From b11d41acf7ba2449cac04982af7e4e58bc3080f1 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 15 十月 2022 14:03:16 +0800
Subject: [PATCH] 1.产能规划功能开发基本实现2.维修记录列表静态页面开发完成
---
src/views/sbgl/wxjl.vue | 654 +++++++++++++++++++++++++++
src/views/scgl/cngh.vue | 473 ++++++++++--------
src/views/zzmx/wlqd.vue | 30
src/api/sbgl.js | 24 +
src/api/scgl.js | 8
src/components/DatePicker/index.vue | 198 ++++---
src/router/index.js | 7
src/utils/global.js | 7
8 files changed, 1,087 insertions(+), 314 deletions(-)
diff --git a/src/api/sbgl.js b/src/api/sbgl.js
index 87a541a..564e655 100644
--- a/src/api/sbgl.js
+++ b/src/api/sbgl.js
@@ -315,3 +315,27 @@
params: data
})
}
+// 璁惧缁翠慨璁板綍鏌ヨ
+export function DeviceUpdateSearch(data) {
+ return request({
+ url: 'DeviceManager/DeviceUpdateSearch',
+ method: 'get',
+ params: data
+ })
+}
+// 璁惧缁翠慨璁板綍鏄庣粏鏌ヨ
+export function DeviceUpdateSubSearch(data) {
+ return request({
+ url: 'DeviceManager/DeviceUpdateSubSearch',
+ method: 'get',
+ params: data
+ })
+}
+// 璁惧缁翠慨璁板綍涓嬭浇
+export function DeviceUpdateOutExcel(data) {
+ return request({
+ url: 'DeviceManager/DeviceUpdateOutExcel',
+ method: 'get',
+ params: data
+ })
+}
diff --git a/src/api/scgl.js b/src/api/scgl.js
index 4aef108..c2b0bc9 100644
--- a/src/api/scgl.js
+++ b/src/api/scgl.js
@@ -308,3 +308,11 @@
params: data
})
}
+// 浜ц兘瑙勫垝宸ヤ綔鏃ュ巻閫夋嫨鎻愪氦
+export function CapacityPlanningGivePlanSubmit(data) {
+ return request({
+ url: 'ProductionManagement/CapacityPlanningGivePlanSubmit',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/components/DatePicker/index.vue b/src/components/DatePicker/index.vue
index 71d22b0..475fa71 100644
--- a/src/components/DatePicker/index.vue
+++ b/src/components/DatePicker/index.vue
@@ -1,5 +1,5 @@
<template>
- <div v-click-outside onselectstart="return false" style="-moz-user-select : none">
+ <div v-click-outside onselectstart="return false" style="-moz-user-select : none;">
<input type="text" :value="value" :rowData="rowData" class="input__inner">
<div v-if="isVisible" :class="[{pannel:true},{top_yes:topStyle}]">
<div class="pannel-nav">
@@ -64,6 +64,7 @@
}}骞磠{ dblTime.month + 1 }}鏈�</span><span class="samllText">鏄熸湡{{ getweekday(handleDatetime(dblDate)) }}</span>
</div>
<div class="pannelTo_nav">
+
<el-select v-model="schemeDate" size="small" style="width:240px;" @change="changeScheme">
<el-option v-for="item in projectList" :key="item.CapCode" :value="item.CapCode" :label="item.CapName" />
</el-select>
@@ -120,7 +121,12 @@
</template>
<script>
import * as funsdates from '@/utils/funsdate'
-// import capacityPlanning from '@/api/capacityPlanning'
+import {
+ CapacityPlanningCalendar,
+ CapacityPlanningGivePlanSubmit,
+ CapacityPlanningOnclickSelect,
+ CapacityPlanningSetupSearch
+} from '@/api/scgl'
var time = null
export default {
directives: {
@@ -147,13 +153,15 @@
},
props: {
value: {
- // type:Date,
- // default:()=> new Date
- type: String,
+ type: Array,
default: null
},
+ defArr: {
+ type: Array,
+ default: Array
+ },
rowData: {
- type: String,
+ type: Object,
default: null
},
CapacityPlanningSearch: {
@@ -161,6 +169,7 @@
default: null
}
},
+
data() {
const { year, month } = funsdates.getYearMonthDay(new Date())
return {
@@ -181,11 +190,11 @@
weekDays: ['鏃�', '涓�', '浜�', '涓�', '鍥�', '浜�', '鍏�'],
changeTime: '',
changeTimeArr: [],
- defArr: [],
+ // defArr: [],
dm_top: '',
topStyle: false,
form: {
- rows: 100,
+ rows: 1000,
page: 1
},
projectDef: []
@@ -209,9 +218,7 @@
return `${year}-${month + 1}-${day}`
}
},
- mounted() {
-
- },
+ mounted() {},
methods: {
getDblTime() {
const { year, month, day } = funsdates.getYearMonthDay(this.dblDate)
@@ -227,13 +234,13 @@
let name = ''
if (this.isDblDate(date)) {
for (const i in this.defArr) {
- if (this.defArr[i].name == this.handleDatetime(date)) {
+ if (this.defArr[i].name === this.handleDatetime(date)) {
code = this.defArr[i].key
}
}
}
for (const i in this.projectDef) {
- if (this.projectDef[i].CapSetupCode == code) {
+ if (this.projectDef[i].CapSetupCode === code) {
name = this.projectDef[i].CapSetupName
}
}
@@ -249,6 +256,7 @@
}
const e = event || window.event
+ // console.log(e.clientY, 7)
const nowHeigth = e.clientY
if (nowHeigth >= 500) {
this.topStyle = true
@@ -273,13 +281,13 @@
changeScheme() {
let toList = []
for (const i in this.projectList) {
- if (this.schemeDate == this.projectList[i].CapCode) {
+ if (this.schemeDate === this.projectList[i].CapCode) {
toList = this.projectList[i].list
}
}
for (const i in this.defArr) {
- if (this.defArr[i].name == this.changeTime) {
+ if (this.defArr[i].name === this.changeTime) {
this.defArr[i].key = this.schemeDate
}
}
@@ -288,13 +296,16 @@
},
focus() {
this.isVisible = true
+
this.CapacityPlanningCalendar()
this.getHeight()
this.CapacityPlanningSetupSearch()
this.CapacityPlanningSearch()
},
blur() {
- this.isVisible = false
+ this.isDbl = false // 鍙充晶闈㈡澘鍏抽棴
+ this.isVisible = false// 涓婚潰鏉垮叧闂�
+ this.$emit('over', true)// 缁欑埗缁勪欢鍙戝嚭璇锋眰锛屽憡璇変粬宸茬粡瀹屾垚鎿嶄綔锛屽彲璋冪敤鑾峰彇鍒楄〃鎺ュ彛
},
isCurrentMonth(date) {
const { year, month } = funsdates.getYearMonthDay(new Date(this.time.year,
@@ -310,33 +321,28 @@
// 杩囨湡鏃堕棿
isPastDue(date) {
const newDate = this.handleDatetime(new Date())
- if (new Date(newDate) > date && this.handleDatetime(date) != newDate) {
- return true
- } else {
- return false
- }
+ return new Date(newDate) > date && this.handleDatetime(date) !== newDate
},
chooseDate(date) {
clearTimeout(time) // 棣栧厛娓呴櫎璁℃椂鍣�
time = setTimeout(() => {
this.time = funsdates.getYearMonthDay(date)
- const timeDate = ''
+ // const timeDate = ''
this.isDbl = false
// 鍙互鐐瑰嚮鐨勬棩鏈�
if (!this.isPastDue(date)) {
- if ((this.value.indexOf(this.handleDatetime(date)) < 0 && this.value != '') || this.value == '') { // 鏁扮粍娣诲姞
+ if ((this.value.indexOf(this.handleDatetime(date)) < 0 && this.value !== '') || this.value === '') { // 鏁扮粍娣诲姞
this.value.push(this.handleDatetime(date)) // 鏂板鍒癷nput閲�
const data = {
name: this.handleDatetime(date),
key: this.rowData.CaptPlanWorkShiftCode
}
-
this.defArr.push(data) // 鏂板鍒� 榛樿鏁扮粍閲�
} else if (this.value.indexOf(this.handleDatetime(date)) >= 0) { // 鏁扮粍鍑忓幓
const indexV = this.value.indexOf(this.handleDatetime(date))
this.value.splice(indexV, 1)
for (const i in this.defArr) {
- if (this.defArr[i].name == this.handleDatetime(date)) {
+ if (this.defArr[i].name === this.handleDatetime(date)) {
this.defArr.splice(i, 1)
}
}
@@ -351,14 +357,15 @@
this.dblDate = date
this.isDbl = true
this.changeTime = this.handleDatetime(date)
- this.CapacityPlanningOnclickSelect({ CaptPlanId: this.rowData.CaptPlanId, DateTime: this.handleDatetime(date) })
+
+ this.CapacityPlanningOnclickSelect({ CaptPlanWorkShiftCode: this.rowData.CaptPlanWorkShiftCode, captplanid: this.rowData.CaptPlanId, datetime: this.handleDatetime(date) })
this.getDblTime()
}
},
isDblDate(date) {
for (const i in this.defArr) {
- if (this.defArr[i].key != '') {
- if (this.defArr[i].name == this.handleDatetime(date) && this.defArr[i].key != this.rowData.CaptPlanWorkShiftCode) {
+ if (this.defArr[i].key !== '') {
+ if (this.defArr[i].name === this.handleDatetime(date) && this.defArr[i].key !== this.rowData.CaptPlanWorkShiftCode) {
return true
}
}
@@ -418,75 +425,75 @@
// },
// 鍙屽嚮璇锋眰鏁版嵁
CapacityPlanningOnclickSelect(data) {
- // capacityPlanning.CapacityPlanningOnclickSelect(data).then((res) =>{
- // this.projectList = res.List
- // for(let i in this.defArr){
- // if(this.defArr[i].name == data.DateTime){
- // this.schemeDate = this.defArr[i].key
- // }
- // }
- // this.changeScheme()
- // })
+ CapacityPlanningOnclickSelect(data).then((res) => {
+ this.projectList = res.data
+
+ // for (const i in this.defArr) {
+ // console.log(this.defArr[i].name === data.DateTime, 6)
+ // if (this.defArr[i].name === data.DateTime) {
+ // this.schemeDate = this.defArr[i].key
+ // }
+ // }
+
+ this.schemeDate = data.CaptPlanWorkShiftCode
+
+ this.changeScheme()
+ })
},
+ // 宸ヤ綔鏃ュ巻鎻愪氦
CapacityPlanningGivePlanSubmit() {
- const data = {
- CaptPlanId: this.rowData.CaptPlanId,
- WkshopCode: this.rowData.CaptPlanWorkShopid,
- CapUnitCode: this.rowData.CaptPlanDeviceTypeid,
- CapSetupCode: this.rowData.CaptPlanWorkShiftCode,
- CaptPlanType: this.rowData.CaptPlanType,
- WorkList: JSON.stringify(this.defArr)
+ const formData = new FormData()
+ formData.append('CaptPlanId', this.rowData.CaptPlanId)// 浜ц兘璧勬簮id
+ formData.append('WkshopCode', this.rowData.CaptPlanWorkShopid)// 杞﹂棿缂栫爜
+ formData.append('CapUnitCode', this.rowData.CaptPlanDeviceTypeid)// 鐢熶骇鍗曞厓锛堜骇绾跨紪鐮侊級
+ formData.append('CaptSetupCode', '')
+ formData.append('CaptPlanType', this.rowData.CaptPlanType)// 浜ц兘绫诲瀷
+ console.log(this.defArr, 555)
+ formData.append('WorkList', JSON.stringify(this.defArr))
+ console.log(formData, 666)
+
+ for (const [a, b] of formData.entries()) {
+ console.log(a, ':', b)
}
- // capacityPlanning.CapacityPlanningGivePlanSubmit(data).then((res) =>{
- // if (res.statusCode == 300) {
- // this.$message({
- // showClose:true,
- // message: res.message,
- // type: "error"
- // });
- // } else {
- // this.$message({
- // showClose:true,
- // message: res.message,
- // type: "success"
- // });
- // this.blur()
- // this.CapacityPlanningSearch()
- // }
- // })
+
+ CapacityPlanningGivePlanSubmit(formData).then(res => {
+ if (res.code === '200') {
+ this.$message.success('淇濆瓨鎴愬姛锛�')
+ this.blur()
+ this.CapacityPlanningSearch()
+ }
+ })
},
CapacityPlanningCalendar() {
- // capacityPlanning.CapacityPlanningCalendar({CaptPlanId:this.rowData.CaptPlanId}).then((res) =>{
- //
- // for(let i in res.List){
- //
- // if(res.List[i].key == ''){
- // res.List[i].key = this.rowData.CaptPlanWorkShiftCode
- // }
- // }
- // this.defArr = res.List
- // })
+ // const temp = JSON.parse(this.rowData)
+ CapacityPlanningCalendar({ captplanid: this.rowData.CaptPlanId }).then((res) => {
+ for (const i in res.List) {
+ if (res.List[i].key === '') {
+ res.List[i].key = this.rowData.CaptPlanWorkShiftCode
+ }
+ }
+ this.defArr = res.List
+ })
},
closeCapacityPlanningCalendar() {
- // capacityPlanning.CapacityPlanningCalendar({CaptPlanId:this.rowData.CaptPlanId}).then((res) =>{
- // let nameList = []
- // for(let i in res.List){
- // nameList.push(res.List[i].name)
- // if(res.List[i].key == ''){
- // res.List[i].key = this.rowData.CaptPlanWorkShiftCode
- // }
- // }
- // for(let i in this.defArr){
- // for(let j in res.List){
- // if(this.defArr[i].name == this.changeTime && res.List[j].name == this.changeTime){
- // this.defArr[i].key = res.List[j].key
- // } else if(this.defArr[i].name == this.changeTime && nameList.indexOf(this.changeTime)==-1){
- // this.defArr[i].key = this.rowData.CaptPlanWorkShiftCode
- // }
- // }
- //
- // }
- // })
+ CapacityPlanningCalendar({ captplanid: this.rowData.CaptPlanId }).then((res) => {
+ const nameList = []
+ for (const i in res.List) {
+ nameList.push(res.List[i].name)
+ if (res.List[i].key === '') {
+ res.List[i].key = this.rowData.CaptPlanWorkShiftCode
+ }
+ }
+ for (const i in this.defArr) {
+ for (const j in res.List) {
+ if (this.defArr[i].name === this.changeTime && res.List[j].name === this.changeTime) {
+ this.defArr[i].key = res.List[j].key
+ } else if (this.defArr[i].name === this.changeTime && nameList.indexOf(this.changeTime) === -1) {
+ this.defArr[i].key = this.rowData.CaptPlanWorkShiftCode
+ }
+ }
+ }
+ })
},
close() {
setTimeout(() => {
@@ -495,9 +502,9 @@
}, 300)
},
CapacityPlanningSetupSearch() {
- // capacityPlanning.CapacityPlanningSetupSearch(this.form).then((res) => {
- // this.projectDef = res.rows
- // })
+ CapacityPlanningSetupSearch(this.form).then((res) => {
+ this.projectDef = res.rows
+ })
}
}
@@ -572,6 +579,8 @@
border-radius: 4px;
line-height: 30px;
margin: 5px 0;
+ //overflow: visible !important;
+ //box-sizing: border-box;
.pannel-nav {
position: relative;
@@ -643,7 +652,8 @@
border-top: 1px solid #E7E7EA;
padding: 10px;
overflow: hidden;
- height: 58px;;
+ height: 58px;
+
}
}
diff --git a/src/router/index.js b/src/router/index.js
index 8dc5096..bc631be 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -235,6 +235,13 @@
code: '1028',
component: () => import('@/views/sbgl/byjl'),
meta: { code: '1028', title: '淇濆吇璁板綍', icon: '', keepAlive: true }
+ },
+ {
+ path: 'wxjl',
+ name: 'WXJLCancel',
+ code: '1029',
+ component: () => import('@/views/sbgl/wxjl'),
+ meta: { code: '1029', title: '璁惧缁翠慨璁板綍', icon: '', keepAlive: true }
}
]
},
diff --git a/src/utils/global.js b/src/utils/global.js
index dedc120..3c23e76 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -50,6 +50,13 @@
// return `${y}-${m}-${d} ${hh}:${mm}:${ss} ${week}`
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
+// 鏃堕棿澶勭悊鍑芥暟 杩斿洖 鏃跺垎
+export function handleDatetime3(value) {
+ const dt = new Date(value)
+ const hh = (dt.getHours() + '').padStart(2, '0')
+ const mm = (dt.getMinutes() + '').padStart(2, '0')
+ return `${hh}:${mm}`
+}
// 鑾峰彇瑙勫垯鐢熸垚鐨勭紪鐮�
export async function getNewEncodingRules(encode) {
diff --git a/src/views/sbgl/wxjl.vue b/src/views/sbgl/wxjl.vue
index f1dc14b..d24301a 100644
--- a/src/views/sbgl/wxjl.vue
+++ b/src/views/sbgl/wxjl.vue
@@ -1,11 +1,659 @@
-<template />
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+ <div class="bodyTopButtonGroup" style="justify-content: space-between">
+ <!-- <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>-->
+ <!-- <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
+ <el-button type="primary" icon="el-icon-download" @click="download">瀵煎嚭</el-button>
+ </div>
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="100px"
+ inline
+ style="display: flex;justify-content: space-between"
+ >
+ <div class="elForm">
+ <el-form-item label="璁惧缂栫爜" label-width="70px" style=" display: flex;">
+ <el-input v-model="form.eqpcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="璁惧鍚嶇О" style=" display: flex;">
+ <el-input v-model="form.eqpname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鐢熶骇杞﹂棿" style=" display: flex;">
+ <el-select v-model="form.wkshopcode" style="width: 200px" placeholder="璇烽�夋嫨">
+ <el-option
+ v-for="item in wkshopSelectArr"
+ :key="item.org_code"
+ :label="item.org_name"
+ :value="item.org_code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鎶ヤ慨浜哄憳" style=" display: flex;">
+ <el-input v-model="form.reportuser" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item v-show="isExpandForm" label-width="70px" label="鎶ヤ慨鏃堕棿" style=" display: flex;">
+ <el-input v-model="form.repairuser" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item v-show="isExpandForm" label="缁翠慨浜哄憳" style=" display: flex;">
+ <el-input v-model="form.vrifcatuser" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item v-show="isExpandForm" label="缁翠慨鏃堕棿" style=" display: flex;">
+ <el-input v-model="form.reportdate" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item v-show="isExpandForm" label="楠岃瘉浜哄憳" style=" display: flex;">
+ <el-input v-model="form.repairdate" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item
+ v-show="isExpandForm"
+ label-width="70px"
+ label="楠岃瘉鏃堕棿"
+ style=" display: flex;align-items: center"
+ >
+ <el-date-picker
+ v-model="form.vrifcatdate"
+ type="daterange"
+ :clearable="false"
+ class="timeMini"
+ range-separator="~"
+ start-placeholder="寮�濮嬫棩鏈�"
+ style="width: 200px;display: flex;line-height: 34px ;height: 34px ;"
+ end-placeholder="缁撴潫鏃ユ湡"
+ size="mini"
+ />
+ </el-form-item>
+ </div>
+ <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
+ <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+ <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+ </div>
+ </el-form>
+ <div
+ class="bodyTopFormExpand"
+ >
+ <svg-icon
+ v-show="mouseHoverType==='mouseout'"
+ style="cursor: pointer"
+ :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+ @mouseenter="mouseHoverType=$event.type"
+ />
+ <svg-icon
+ v-show="mouseHoverType==='mouseenter'"
+ style="cursor: pointer"
+ :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+ @click="isExpandForm=!isExpandForm"
+ @mouseout="mouseHoverType=$event.type"
+ />
+ </div>
+ </div>
+
+ <div class="elTableDiv">
+ <el-table
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableData"
+ :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
+ border
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @sort-change="sortChange"
+ >
+ <el-table-column
+ prop="RowNum"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="repair_code"
+ label="缁翠慨鍗曞彿"
+ min-width="160"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="wksp_name"
+ label="鎵�灞炶溅闂�"
+ show-tooltip-when-overflow
+ min-width="120"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="eqp_code"
+ width="120"
+ label="璁惧缂栫爜"
+ show-tooltip-when-overflow
+ sortable="custom"
+ />
+ <el-table-column
+ prop="eqp_name"
+ label="璁惧鍚嶇О"
+ width="120"
+ show-tooltip-when-overflow
+ sortable="custom"
+ />
+ <el-table-column
+ prop="request_person"
+ label="鎶ヤ慨浜�"
+ sortable="custom"
+ width="100"
+ />
+ <el-table-column
+ prop="request_date"
+ label="鎶ヤ慨鏃堕棿"
+ width="160"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="repair_person"
+ label="缁翠慨浜�"
+ width="100"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="repair_date"
+ label="缁翠慨瀹屾垚鏃堕棿"
+ width="160"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="cycleDate"
+ label="缁翠慨鏃堕暱"
+ width="120"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <div>{{ row.cycleDate }} 灏忔椂</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="verify_person"
+ label="楠岃瘉浜�"
+ width="100"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="verify_date"
+ label="楠岃瘉鏃堕棿"
+ width="160"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="verify_result"
+ label="楠岃瘉缁撴灉"
+ width="120"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.verify_result==='閫氳繃'" style="display: flex;align-items: center">
+ <div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: #42b983" />
+ 閫氳繃
+ </div>
+ <div v-if="row.verify_result==='涓嶉�氳繃'" style="display: flex;align-items: center">
+ <div style="margin-right: 5px;width:10px;height: 10px;border-radius: 50%;background-color: red" />
+ 涓嶉�氳繃
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鏌ョ湅璁板綍"
+ width="80"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <i
+ class="el-icon-tickets"
+ style="cursor: pointer;color: #42b983;margin-right: 15px"
+ @click="edit('edit',row)"
+ />
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="total,prev, pager, next,sizes"
+ popper-class="select_bottom"
+ @pagination="getDeviceUpdateSearch"
+ />
+ </div>
+
+ <el-dialog
+ :title="operation==='add'?'鏂板':'缁翠慨鏄庣粏'"
+ :visible.sync="dialogVisible"
+ width="800px"
+ :close-on-click-modal="false"
+ top="10vh"
+ @closed="handleClose"
+ @close="handleClose"
+ >
+ <div style="font-size:16px;">
+ <div style="margin-bottom: 20px">
+ <i class="el-icon-s-operation" style="color:#42b983;" /> 璁惧鎶ヤ慨淇℃伅锛�
+ </div>
+ <div style="display: flex;flex-direction: column;margin-left: 40px">
+ <div style="margin-bottom: 10px">鏁呴殰鏉ユ簮锛歿{ dialogData1.faultsource }}</div>
+ <div style="margin-bottom: 10px">鏁呴殰鎻忚堪锛歿{ dialogData1.faultdescr }}</div>
+ <div v-if="dialogData1.faultimage" style="display: flex;margin-bottom: 10px">鏁呴殰鍥剧墖锛�
+ <div v-for="item in dialogData1.faultimage">
+ <img
+ style="width: 100px;margin-left: 10px"
+ :src="baseUrl+item.img1url"
+ alt=""
+ @click="handlePictureCardPreview(baseUrl+item.img1url)"
+ >
+ </div>
+ </div>
+ </div>
+ <div style="margin-bottom: 20px">
+ <i class="el-icon-s-operation" style="color:#42b983;" /> 璁惧缁翠慨淇℃伅锛�
+ </div>
+ <div style="display: flex;flex-direction: column;margin-left: 40px">
+ <div style="margin-bottom: 10px">鏁呴殰鎻忚堪锛歿{ dialogData2.faultdescr }}</div>
+ <div v-if="dialogData2.repairimage" style="display: flex;margin-bottom: 10px">鏁呴殰鍥剧墖锛�
+ <div v-for="item in dialogData2.repairimage">
+ <img
+ style="width: 100px;margin-left: 10px"
+ :src="baseUrl+item.img1url"
+ alt=""
+ @click="handlePictureCardPreview(baseUrl+item.img1url)"
+ >
+ </div>
+ </div>
+ <div style="margin-bottom: 10px">鍋滄満缁翠慨锛歿{ dialogData2.isstoprepair === 'N' ? '鍚�' : '鏄�' }}</div>
+ <div v-if="dialogData2.repaircontent" style="margin-bottom: 10px">缁翠慨鍐呭锛歿{ dialogData2.repaircontent }}</div>
+ <div v-if="dialogData2.repairpart" style="margin-bottom: 10px">鏇存崲澶囦欢锛歿{ dialogData2.repairpart }}</div>
+ <div v-if="dialogData2.repairimage" style="display: flex;margin-bottom: 10px">澶囦欢鍥剧墖锛�
+ <div v-for="item in dialogData2.repairimage">
+ <img
+ style="width: 100px;margin-left: 10px"
+ :src="baseUrl+item.img2url"
+ alt=""
+ @click="handlePictureCardPreview(baseUrl+item.img2url)"
+ >
+ </div>
+ </div>
+ </div>
+ <div style="margin-bottom: 20px">
+ <i class="el-icon-s-operation" style="color:#42b983;" /> 璁惧缁翠慨楠岃瘉淇℃伅锛�
+ </div>
+ <div style="display: flex;flex-direction: column;margin-left: 40px">
+ <div style="margin-bottom: 10px">楠岃瘉缁撴灉锛歺xx</div>
+ </div>
+ </div>
+ <!-- 鍥剧墖棰勮瀵硅瘽妗�-->
+ <el-dialog
+ title="鍥剧墖棰勮"
+ :visible.sync="pictureVisible"
+ width="800px"
+ append-to-body
+ @close="pictureHandleClose"
+ >
+ <img width="100%" :src="pictureUrl" alt="">
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button @click="pictureVisible=false">杩� 鍥�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button @click="dialogVisibleCancel">杩� 鍥�</el-button>
+ <!-- <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>-->
+ </div>
+ </span>
+ </el-dialog>
+
+ <!--瀵煎叆缁勪欢-->
+ <import-picker
+ ref="importPickerFunc"
+ class="importPickerClass"
+ :shows.sync="shows"
+ :title="title_value"
+ :colos="colos"
+ :code="code"
+ />
+
+ </div>
+</template>
<script>
+import Pagination from '@/components/Pagination'
+import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
+import { getCookie } from '@/utils/auth'
+import ImportPicker from '@/components/ImportPicker'
+import { handleDatetime, validateCode } from '@/utils/global'
+import { DeviceRepairTakeOutExcel, DeviceUpdateSearch, DeviceUpdateSubSearch } from '@/api/sbgl'
+import { ShopSearch } from '@/api/dzkb'
+
export default {
- name: 'Wxjl'
+ name: 'Zzjg',
+ components: {
+ Pagination, ImportPicker
+ },
+ data() {
+ return {
+ mouseHoverType: 'mouseout',
+ isExpandForm: false,
+ mainHeight: 0,
+ tableHeight: 0,
+ form: {
+ wkshopcode: '', // 杞﹂棿缂栫爜
+ eqpcode: '', // 璁惧缂栫爜
+ eqpname: '', // 璁惧鍚嶇О
+ reportuser: '', // 鎶ヤ慨浜哄憳
+ repairuser: '', // 鎶ヤ慨鏃堕棿
+ vrifcatuser: '', // 缁翠慨浜哄憳
+ reportdate: '', // 缁翠慨鏃堕棿
+ repairdate: '', // 楠岃瘉浜哄憳
+ vrifcatdate: '', // 楠岃瘉鏃堕棿
+ prop: 'repair_code', // 鎺掑簭瀛楁
+ order: 'desc', // 鎺掑簭瀛楁
+ page: 1, // 绗嚑椤�
+ rows: 20 // 姣忛〉澶氬皯鏉�
+ },
+ wkshopSelectArr: [],
+ total: 10,
+ tableData: [],
+ dialogVisible: false,
+ dialogData1: {},
+ dialogData2: {},
+ operation: '',
+
+ baseUrl: 'http://121.196.36.24:8001/', // 鍥剧墖棰勮鍦板潃鍓嶇紑
+
+ pictureVisible: false, // 鍥剧墖棰勮瀵硅瘽妗�
+ pictureUrl: '', // 鍥剧墖棰勮Url
+
+ title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
+ code: '4',
+ shows: false
+
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getDeviceUpdateSearch()
+ }
+ }
+ },
+ created() {
+ this.handleRequest()
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ methods: {
+ handleRequest() {
+ this.getDeviceUpdateSearch().then(res => {
+ if (res.code === '200') {
+ this.getShopSearch()
+ }
+ })
+ },
+ async getDeviceUpdateSearch() {
+ const res = await DeviceUpdateSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ return { code: res.code }
+ },
+ // 鑾峰彇鎵ц杞﹂棿涓嬫媺鏁扮粍
+ async getShopSearch() {
+ const { data: res } = await ShopSearch()
+ this.wkshopSelectArr = res
+ },
+ // 鎺掑簭鏀瑰彉鏃�
+ sortChange({ column, prop, order }) {
+ if (order === 'descending') {
+ order = 'desc'
+ } else if (order === 'ascending') {
+ order = 'asc'
+ } else {
+ order = 'desc'
+ }
+ this.form.order = order
+ this.form.prop = prop
+ this.getDeviceUpdateSearch()
+ },
+ // 鏌ヨ
+ search() {
+ this.getDeviceUpdateSearch()
+ },
+ // 瀵煎叆鎸夐挳
+ upload() {
+ this.shows = true
+ this.$refs.importPickerFunc.newDataFunc()
+ },
+ colos() {
+ this.shows = false
+ },
+ // 閲嶇疆
+ reset() {
+ this.form.wkshopcode = ''
+ this.form.eqpcode = ''
+ this.form.eqpname = ''
+ this.form.reportuser = ''
+ this.form.repairuser = ''
+ this.form.vrifcatuser = ''
+ this.form.reportdate = ''
+ this.form.repairdate = ''
+ this.form.vrifcatdate = ''
+ this.getDeviceUpdateSearch()
+ },
+
+ // 鏂板鎸夐挳
+ add(operation) {
+ this.operation = operation
+ this.dialogVisible = true
+ },
+ // 淇敼鎸夐挳
+ async edit(operation, row) {
+ this.operation = operation
+ this.dialogVisible = true
+
+ const { data: res } = await DeviceUpdateSubSearch({ repair_code: row.repair_code })
+ this.dialogData1 = res.data1
+ this.dialogData2 = res.data2
+ },
+ handlePictureCardPreview(url) {
+ this.pictureVisible = true
+ this.pictureUrl = url
+ },
+ pictureHandleClose() {
+ this.pictureUrl = ''
+ },
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogData1 = {}
+ this.dialogData2 = {}
+ },
+ async download() {
+ // let tempDate = this.form.repairdate
+ // if (tempDate.length > 0) {
+ // tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
+ // }
+ // const data = {
+ // wkshopcode: this.form.wkshopcode,
+ // eqpcode: this.form.eqpcode,
+ // eqpname: this.form.eqpname,
+ // stanedname: this.form.stanedname,
+ // repairuser: this.form.repairuser,
+ // repairdate: tempDate,
+ // repairresult: this.form.repairresult
+ // }
+ // const { data: res } = await DeviceUpdateOutExcel(data)
+ // window.location.href = res
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 295
+ this.$refs.tableDataRef.doLayout()
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ }
+ }
}
</script>
-<style scoped>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-range__icon {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-separator {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-input {
+ font-size: 14px;
+}
+
+::v-deep .el-range-separator {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+::v-deep .el-button--text {
+ font-size: 14px;
+ cursor: pointer;
+}
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+ color: $main_color;
+ cursor: pointer;
+}
+
+.el-icon-edit-outline {
+ margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+ height: 34px;
+ display: flex;
+ align-items: center;
+ padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+ //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+ background-color: #f8f8fa;
+ border: none;
+}
+
+::v-deep .el-input__inner {
+ height: 34px;
+ line-height: 34px;
+ //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+ //padding: 20px 100px !important;
+ padding: 20px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+ display: flex;
+ justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+ transform: scale(0.8);
+}
+
+::v-deep .cell {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+ height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+ background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+ color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+ border: 1px solid #eee;
+ width: 99%;
+ margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+.userDialogVisible ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+::v-deep .el-select__caret {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.tableFixed {
+ ::v-deep .el-table__fixed-right {
+ height: 100% !important;
+ }
+
+ ::v-deep .el-table__fixed {
+ height: 100% !important;
+ }
+}
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
</style>
diff --git a/src/views/scgl/cngh.vue b/src/views/scgl/cngh.vue
index e68cff2..2ad7c15 100644
--- a/src/views/scgl/cngh.vue
+++ b/src/views/scgl/cngh.vue
@@ -67,7 +67,7 @@
<div class="elTableDiv">
<el-table
ref="tableDataRef"
- class="tableFixed"
+ class="tableFixed table_only"
:data="tableData"
:style="{width: 100+'%',height:tableHeight+'px'}"
border
@@ -120,6 +120,7 @@
prop="CaptPlanShopCalendarList"
label="宸ヤ綔鏃ュ巻"
sortable="custom"
+ min-width="300"
>
<template slot-scope="{row}">
<date-picker
@@ -127,6 +128,7 @@
:row-data="row"
style="width: 100%;"
:capacity-planning-search="CapacityPlanningSearch"
+ @over="over"
/>
</template>
</el-table-column>
@@ -134,7 +136,7 @@
prop="CaptPlanUser"
label="鍒涘缓浜哄憳"
sortable="custom"
- width="160"
+ width="120"
/>
<el-table-column
prop="CaptPlanDate"
@@ -145,7 +147,7 @@
<el-table-column
prop="CaptPlanStus"
- width="160"
+ width="120"
label="鏈夋晥鐘舵��"
sortable="custom"
>
@@ -161,23 +163,6 @@
<div v-else>/</div>
</template>
</el-table-column>
-
- <!-- <el-table-column-->
- <!-- label="鎿嶄綔"-->
- <!-- width="120"-->
- <!-- fixed="right"-->
- <!-- >-->
- <!-- <template slot-scope="{row}">-->
- <!-- <div class="operationClass">-->
- <!-- <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">-->
- <!-- <i class="el-icon-edit-outline" @click="edit('edit',row)" />-->
- <!-- </el-tooltip>-->
- <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">-->
- <!-- <i class="el-icon-delete" @click="del(row)" />-->
- <!-- </el-tooltip>-->
- <!-- </div>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
</el-table>
</div>
<!--鍒嗛〉-->
@@ -195,7 +180,7 @@
<el-dialog
:title="operation==='setting'?'璁剧疆':'榛樿鏂规'"
:visible.sync="dialogVisible"
- width="1280px"
+ width="1360px"
:close-on-click-modal="false"
top="10vh"
@closed="handleClose"
@@ -215,7 +200,6 @@
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
>
-
<el-table-column
v-if="operation!=='setting'"
width="50"
@@ -223,123 +207,165 @@
>
<template slot-scope="{row}">
<el-radio
- v-model="radioSelectedId"
- :label="row.hx"
+ v-model="radioSelectedCode"
+ :label="row.code"
style="padding-left: 10px;"
- @change.native="getCurrentRowSource(row.hx)"
+ @change.native="getCurrentRowSource(row.code)"
/>
</template>
</el-table-column>
<el-table-column
- prop="famc"
+ prop="code"
+ label="鏂规缂栫爜"
+ width="100"
+ fixed
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isVisible===0">{{ row.code }}</div>
+ <el-input v-else v-model="row.code" placeholder="璇疯緭鍏�" type="text" />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="name"
label="鏂规鍚嶇О"
width="150"
fixed
show-tooltip-when-overflow
>
<template slot-scope="{row}">
- <el-input v-model="row.famc" :disabled="row.isVisible===0" type="text" />
+ <div v-if="row.isVisible===0">{{ row.name }}</div>
+ <el-input v-else v-model="row.name" placeholder="璇疯緭鍏�" type="text" />
</template>
</el-table-column>
<el-table-column
- prop="gzsc"
+ prop="duration"
label="宸ヤ綔鏃堕暱"
width="100"
show-tooltip-when-overflow
- />
+ >
+ <template slot-scope="{row}">
+ <div>{{ row.duration ? parseFloat(row.duration.toFixed(2)) : '0' }} 灏忔椂</div>
+ </template>
+ </el-table-column>
<el-table-column
- prop="time1"
+ prop="wktme1_start"
label="宸ヤ綔鏃堕棿涓�"
>
<template slot-scope="{row}">
+ <div v-if="row.isVisible===0">
+ <div v-if="row.wktme1_start">{{ row.wktme1_start }}</div>
+ <div v-else>/</div>
+ </div>
<el-time-picker
- v-model="row.time1"
+ v-else
+ v-model="row.wktme1_start"
is-range
- :disabled="row.isVisible===0"
:editable="false"
:clearable="false"
range-separator="~"
start-placeholder="寮�濮�"
end-placeholder="缁撴潫"
format="HH:mm"
- @focus="val=>getTime(val,row,'time1')"
+ @focus="val=>getTime(val,row,'wktme1_start')"
/>
</template>
</el-table-column>
<el-table-column
- prop="time2"
+ prop="wktme2_start"
label="宸ヤ綔鏃堕棿浜�"
>
<template slot-scope="{row}">
+ <div v-if="row.isVisible===0">
+ <div v-if="row.wktme2_start">{{ row.wktme2_start }}</div>
+ <div v-else>/</div>
+ </div>
<el-time-picker
- v-model="row.time2"
+ v-else-if="row.isVisible===1"
+ v-model="row.wktme2_start"
is-range
- :disabled="row.isVisible===0"
+ :disabled="row.wktme1_start.length===0"
:editable="false"
:clearable="false"
range-separator="~"
start-placeholder="寮�濮�"
end-placeholder="缁撴潫"
format="HH:mm"
- @focus="val=>getTime(val,row,'time2')"
+ @focus="val=>getTime(val,row,'wktme2_start')"
/>
</template>
</el-table-column>
<el-table-column
- prop="time3"
+ prop="wktme3_start"
label="宸ヤ綔鏃堕棿涓�"
>
<template slot-scope="{row}">
+ <div v-if="row.isVisible===0">
+ <div v-if="row.wktme3_start">{{ row.wktme3_start }}</div>
+ <div v-else>/</div>
+ </div>
<el-time-picker
- v-model="row.time3"
+ v-else-if="row.isVisible===1"
+ v-model="row.wktme3_start"
is-range
+ :disabled="row.wktme2_start.length===0"
:editable="false"
- :disabled="row.isVisible===0"
:clearable="false"
format="HH:mm"
range-separator="~"
start-placeholder="寮�濮�"
end-placeholder="缁撴潫"
- @focus="val=>getTime(val,row,'time3')"
+ @focus="val=>getTime(val,row,'wktme3_start')"
/>
</template>
</el-table-column>
<el-table-column
- prop="time4"
+ prop="wktme4_start"
label="宸ヤ綔鏃堕棿鍥�"
>
<template slot-scope="{row}">
+ <div v-if="row.isVisible===0">
+ <div v-if="row.wktme4_start">{{ row.wktme4_start }}</div>
+ <div v-else>/</div>
+ </div>
<el-time-picker
- v-model="row.time4"
+ v-else-if="row.isVisible===1"
+ v-model="row.wktme4_start"
is-range
+ :disabled="row.wktme3_start.length===0"
format="HH:mm"
- :editable="false"
- :disabled="row.isVisible===0"
:clearable="false"
+ :editable="false"
range-separator="~"
start-placeholder="寮�濮�"
end-placeholder="缁撴潫"
- @focus="val=>getTime(val,row,'time4')"
+ @focus="val=>getTime(val,row,'wktme4_start')"
/>
+
</template>
</el-table-column>
<el-table-column
- prop="time5"
+ prop="wktme5_start"
label="宸ヤ綔鏃堕棿浜�"
>
<template slot-scope="{row}">
+ <div v-if="row.isVisible===0">
+ <div v-if="row.wktme5_start">{{ row.wktme5_start }}</div>
+ <div v-else>/</div>
+ </div>
<el-time-picker
- v-model="row.time5"
- :disabled="row.isVisible===0"
+ v-else-if="row.isVisible===1"
+ v-model="row.wktme5_start"
is-range
+ :disabled="row.wktme4_start.length===0"
+ :clearable="false"
:editable="false"
format="HH:mm"
- :clearable="false"
range-separator="~"
start-placeholder="寮�濮�"
end-placeholder="缁撴潫"
- @focus="val=>getTime(val,row,'time5')"
+ @focus="val=>getTime(val,row,'wktme5_start')"
/>
</template>
</el-table-column>
@@ -351,9 +377,9 @@
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-button v-if="row.isVisible===0" type="text" @click="editRow(row)">缂栬緫</el-button>
<el-button v-if="row.isVisible===0" type="text" @click="delRow(row)">鍒犻櫎</el-button>
<el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">淇濆瓨</el-button>
+ <el-button v-if="row.isVisible===1" type="text" @click="cancelRow(row)">鍙栨秷</el-button>
</div>
</template>
</el-table-column>
@@ -362,39 +388,35 @@
<span slot="footer" class="dialog-footer">
<div class="footerButton">
<el-button @click="dialogVisibleCancel">杩� 鍥�</el-button>
- <el-button v-if="operation!=='setting'" type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+ <el-button
+ v-if="operation!=='setting'"
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="dialogVisibleConfirm"
+ >纭� 瀹�</el-button>
</div>
</span>
</el-dialog>
-
- <!--瀵煎叆缁勪欢-->
- <import-picker
- ref="importPickerFunc"
- class="importPickerClass"
- :shows.sync="shows"
- :title="title_value"
- :colos="colos"
- :code="code"
- />
-
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
-import ImportPicker from '@/components/ImportPicker'
-import { validateCode } from '@/utils/global'
-import $ from 'jquery'
import DatePicker from '@/components/DatePicker'
-import { CapacityPlanningSearch } from '@/api/scgl'
+import {
+ CapacityPlanningSearch,
+ CapacityPlanningSetupAddUpdate,
+ CapacityPlanningSetupDelete,
+ CapacityPlanningSetupSearch, CapacityPlanSubmit
+} from '@/api/scgl'
import { DeviceTypeSelect, WorkShopSelect } from '@/api/sbgl'
+import { handleDatetime3 } from '@/utils/global'
export default {
name: 'Zzjg',
components: {
- Pagination, ImportPicker, DatePicker
+ Pagination, DatePicker
},
data() {
return {
@@ -419,14 +441,7 @@
devicetypeArr: [],
total: 10,
tableData: [],
-
dialogVisible: false,
- dialogForm: {
- // OrgType: '',
- // OrgCode: '',
- // OrgName: '',
- // SupUnit: ''// 涓婄骇鍗曚綅
- },
operation: '',
pickerOptions: {
disabledDate(time) {
@@ -436,82 +451,80 @@
// return time.getTime() < Date.now(); // 涓嶅彲閫夊巻鍙插ぉ銆佷笉鍙�夊綋鍓嶅ぉ銆佸彲閫夋湭鏉ュぉ
}
},
- popoverVisible: false,
- available: null,
- nextMonth: null,
-
- tableDataDialog: [
- // {
- // famc: '鏂规涓�',
- // gzsc: '8灏忔椂',
- // time1: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
- // time2: '',
- // time3: '',
- // time4: '',
- // time5: ''
- // }
- ],
- radioSelectedId: '',
-
- title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
- code: '4',
- shows: false
+ tableDataDialog: [],
+ radioSelectedCode: '',
+ tempObj: {} // 涓存椂瀵硅薄锛岄粯璁ゆ柟妗堟彁浜ゆ椂浣跨敤
}
},
- watch: {
- shows() {
- if (!this.shows) {
- this.getCapacityPlanningSearch()
- }
- }
- },
+
created() {
-
+ this.handleRequest()
},
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
-
- this.handleRequest()
- // this.getDialogData()
},
methods: {
- getCurrentRowSource() {
-
+ // 瀛愮粍浠跺け鐒︽椂鎵ц
+ over(val) {
+ if (val) {
+ // console.log(val)
+ this.getCapacityPlanningSearch()
+ }
},
- getDialogData() {
- let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
- number = number === 0 ? (10 + Math.random()) : number
- this.tableDataDialog.push(
- {
- hx: 1,
- famc: '鏂规涓�',
- gzsc: '8灏忔椂',
- time1: [],
- time2: [],
- time3: [],
- time4: [],
- time5: [],
- number,
- isVisible: 0
- }
- )
+ getCurrentRowSource(code) {
+ this.radioSelectedCode = code
+ },
+ async getDialogData() {
+ const { data: res } = await CapacityPlanningSetupSearch()
+ this.tableDataDialog = res
+
+ this.tableDataDialog.forEach(item => {
+ let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+ number = number === 0 ? (10 + Math.random()) : number
+ item.number = number
+ item.isVisible = 0
+ item.duration = this.computingTime(item.wktme1_start, item.wktme2_start, item.wktme3_start, item.wktme4_start, item.wktme5_start)
+ })
+ },
+ // 璁$畻鏃堕棿鐨勬柟娉� 杩斿洖 澶氬皯灏忔椂
+ computingTime(time1, time2, time3, time4, time5) {
+ // 杞垚鍒嗛挓璁$畻
+ const second1 = time1 ? calcTime(time1) : null
+ const second2 = time2 ? calcTime(time2) : null
+ const second3 = time3 ? calcTime(time3) : null
+ const second4 = time4 ? calcTime(time4) : null
+ const second5 = time5 ? calcTime(time5) : null
+ return (second1 + second2 + second3 + second4 + second5) / 60
+
+ // 涓や釜鏃堕棿宸�� 杞寲涓哄垎閽熸暟
+ function calcTime(val) {
+ return (parseInt(val.split('~')[1].split(':')[0]) * 60 + parseInt(val.split('~')[1].split(':')[1])) - (parseInt(val.split('~')[0].split(':')[0]) * 60 + parseInt(val.split('~')[0].split(':')[1]))
+ }
},
getTime(val, row, belong) {
- const res = this.getDt()
- if (belong === 'time1') {
- // row.time1.push(new Date(res.yyyy, res.MM, res.dd, '00', '00'))
- row.time1 = row.time1.length > 0 ? row.time1 : row.time1.push(new Date())
- } else if (belong === 'time2') {
- row.time2 = row.time2.length > 0 ? row.time2 : row.time2.push(new Date())
- } else if (belong === 'time3') {
- row.time3 = row.time3.length > 0 ? row.time3 : row.time3.push(new Date())
- } else if (belong === 'time4') {
- row.time4 = row.time4.length > 0 ? row.time4 : row.time4.push(new Date())
- } else if (belong === 'time5') {
- row.time5 = row.time5.length > 0 ? row.time5 : row.time5.push(new Date())
+ // const res = this.getDt()
+ if (belong === 'wktme1_start') {
+ // row.wktme1_start.push(new Date(res.yyyy, res.MM, res.dd, '00', '00'))
+ row.wktme1_start = row.wktme1_start.length > 0 ? row.wktme1_start : row.wktme1_start.push(new Date())
+ } else if (belong === 'wktme2_start') {
+ row.wktme2_start = row.wktme2_start.length > 0 ? row.wktme2_start : row.wktme2_start.push(new Date())
+ } else if (belong === 'wktme3_start') {
+ row.wktme3_start = row.wktme3_start.length > 0 ? row.wktme3_start : row.wktme3_start.push(new Date())
+ } else if (belong === 'wktme4_start') {
+ row.wktme4_start = row.wktme4_start.length > 0 ? row.wktme4_start : row.wktme4_start.push(new Date())
+ } else if (belong === 'wktme5_start') {
+ row.wktme5_start = row.wktme5_start.length > 0 ? row.wktme5_start : row.wktme5_start.push(new Date())
}
+
+ const duration = this.computingTime(handleDatetime3(row.wktme1_start[0]) + '~' + handleDatetime3(row.wktme1_start[1]),
+ row.wktme2_start.length !== 0 ? handleDatetime3(row.wktme2_start[0]) + '~' + handleDatetime3(row.wktme2_start[1]) : null,
+ row.wktme3_start.length !== 0 ? handleDatetime3(row.wktme3_start[0]) + '~' + handleDatetime3(row.wktme3_start[1]) : null,
+ row.wktme4_start.length !== 0 ? handleDatetime3(row.wktme4_start[0]) + '~' + handleDatetime3(row.wktme4_start[1]) : null,
+ row.wktme5_start.length !== 0 ? handleDatetime3(row.wktme5_start[0]) + '~' + handleDatetime3(row.wktme5_start[1]) : null)
+ row.duration = parseFloat(duration.toFixed(2))
+ console.log(row.duration)
},
getDt() {
const dt = new Date()
@@ -527,31 +540,94 @@
return { yyyy: y, MM: m, dd: d, hh, mm }
},
addRow() {
+ const temp = this.tableDataDialog.find(item => item.isVisible === 1)
+ if (temp) {
+ return this.$message.info('璇峰厛淇濆瓨涓婁竴鏉¤褰曪紒')
+ }
+
+ let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
+ number = number === 0 ? (10 + Math.random()) : number
this.tableDataDialog.push(
{
- hx: 2,
- famc: '鏂规xxx',
- gzsc: '8灏忔椂',
- time1: [],
- time2: [],
- time3: [],
- time4: [],
- time5: [],
- isVisible: 1
+ RowNum: 2,
+ code: '',
+ name: '',
+ duration: '',
+ wktme1_start: [],
+ wktme2_start: [],
+ wktme3_start: [],
+ wktme4_start: [],
+ wktme5_start: [],
+ isVisible: 1,
+ number
}
)
},
- editRow(row) {
- console.log(row)
- row.isVisible = 1
+ cancelRow(row) {
+ this.tableDataDialog.forEach((item, index) => {
+ if (row.number === item.number) {
+ this.tableDataDialog.splice(index, 1)
+ }
+ })
},
- saveRow(row) {
- row.isVisible = 0
- },
- delRow(row) {
+ async saveRow(row) {
+ if (row.code.trim().toString().length === 0) {
+ return this.$message.info('鏂规缂栫爜涓嶈兘涓虹┖锛�')
+ }
+ if (row.name.trim().toString().length === 0) {
+ return this.$message.info('鏂规鍚嶇О涓嶈兘涓虹┖锛�')
+ }
+ if (row.wktme1_start.length === 0) {
+ return this.$message.info('宸ヤ綔鏃堕棿涓嶈兘涓虹┖锛屼繚瀛樺け璐ワ紒')
+ }
+ // 淇濆瓨鏃堕渶瑕佸厛鍒ゆ柇宸ヤ綔鏃堕棿鍚庨潰鐨勪笉鑳藉皬浜庡墠闈㈢殑
+ // 鍏堝彇鍑烘潵瀛樿浆鍖栨垚鍒嗛挓瀛樻垚鏁扮粍杩涜澶у皬瀵规瘮
+ if (calcTime(handleDatetime3(row.wktme1_start[1]), handleDatetime3(row.wktme2_start[0]))) {
+ return this.$message.info('宸ヤ綔鏃堕棿浜岀殑寮�濮嬫椂闂村皬浜庝簡宸ヤ綔鏃堕棿涓�鐨勭粨鏉熸椂闂达紝淇濆瓨澶辫触锛�')
+ }
+ if (calcTime(handleDatetime3(row.wktme2_start[1]), handleDatetime3(row.wktme3_start[0]))) {
+ return this.$message.info('宸ヤ綔鏃堕棿涓夌殑寮�濮嬫椂闂村皬浜庝簡宸ヤ綔鏃堕棿浜岀殑缁撴潫鏃堕棿锛屼繚瀛樺け璐ワ紒')
+ }
+ if (calcTime(handleDatetime3(row.wktme3_start[1]), handleDatetime3(row.wktme4_start[0]))) {
+ return this.$message.info('宸ヤ綔鏃堕棿鍥涚殑寮�濮嬫椂闂村皬浜庝簡宸ヤ綔鏃堕棿涓夌殑缁撴潫鏃堕棿锛屼繚瀛樺け璐ワ紒')
+ }
+ if (calcTime(handleDatetime3(row.wktme4_start[1]), handleDatetime3(row.wktme5_start[0]))) {
+ return this.$message.info('宸ヤ綔鏃堕棿浜旂殑寮�濮嬫椂闂村皬浜庝簡宸ヤ綔鏃堕棿鍥涚殑缁撴潫鏃堕棿锛屼繚瀛樺け璐ワ紒')
+ }
+ const Duration = this.computingTime(handleDatetime3(row.wktme1_start[0]) + '~' + handleDatetime3(row.wktme1_start[1]),
+ row.wktme2_start.length !== 0 ? handleDatetime3(row.wktme2_start[0]) + '~' + handleDatetime3(row.wktme2_start[1]) : null,
+ row.wktme3_start.length !== 0 ? handleDatetime3(row.wktme3_start[0]) + '~' + handleDatetime3(row.wktme3_start[1]) : null,
+ row.wktme4_start.length !== 0 ? handleDatetime3(row.wktme4_start[0]) + '~' + handleDatetime3(row.wktme4_start[1]) : null,
+ row.wktme5_start.length !== 0 ? handleDatetime3(row.wktme5_start[0]) + '~' + handleDatetime3(row.wktme5_start[1]) : null)
+ const data = {
+ CapSetupCode: row.code,
+ CapSetupName: row.name,
+ OneStartDate: row.wktme1_start.length !== 0 ? handleDatetime3(row.wktme1_start[0]) + '~' + handleDatetime3(row.wktme1_start[1]) : '',
+ TwoStartDate: row.wktme2_start.length !== 0 ? handleDatetime3(row.wktme2_start[0]) + '~' + handleDatetime3(row.wktme2_start[1]) : '',
+ ThreeStartDate: row.wktme3_start.length !== 0 ? handleDatetime3(row.wktme3_start[0]) + '~' + handleDatetime3(row.wktme3_start[1]) : '',
+ FourStartDate: row.wktme4_start.length !== 0 ? handleDatetime3(row.wktme4_start[0]) + '~' + handleDatetime3(row.wktme4_start[1]) : '',
+ FiveStartDate: row.wktme5_start.length !== 0 ? handleDatetime3(row.wktme5_start[0]) + '~' + handleDatetime3(row.wktme5_start[1]) : '',
+ Duration: parseFloat(Duration.toFixed(2))
+ }
+ const res = await CapacityPlanningSetupAddUpdate({ capacitylist: [data] })
+ if (res.code === '200') {
+ await this.getDialogData()
+ }
+ // 濡傛灉鏃堕棿娈典簩鐨勫紑濮嬫椂闂村皬浜庢椂闂存涓�鐨勭粨鏉熸椂闂� 鍒欒繑鍥瀟rue,骞朵笖鎻愮ず鐢ㄦ埛淇濆瓨涓嶄簡
+ function calcTime(time1, time2) {
+ const temp1 = parseInt(time1.split(':')[0]) * 60 + parseInt(time1.split(':')[1])
+ const temp2 = parseInt(time2.split(':')[0]) * 60 + parseInt(time2.split(':')[1])
+ return temp2 < temp1
+ }
},
- CapacityPlanningSearch() {
+ async delRow(row) {
+ const res = await CapacityPlanningSetupDelete({ capsetupcode: row.code })
+ if (res.code === '200') {
+ await this.getDialogData()
+ }
+ },
+ async CapacityPlanningSearch() {
},
handleRequest() {
@@ -581,10 +657,11 @@
this.devicetypeArr = res
},
mrfaSearch(row, operation) {
- console.log(row)
this.operation = operation
this.dialogVisible = true
-
+ this.tempObj = row
+ this.radioSelectedCode = row.CaptPlanWorkShiftCode
+ this.getDialogData()
this.$nextTick(() => {
this.$refs.tableDataDialogRef.doLayout()
})
@@ -606,14 +683,6 @@
search() {
this.getCapacityPlanningSearch()
},
- // 瀵煎叆鎸夐挳
- upload() {
- this.shows = true
- this.$refs.importPickerFunc.newDataFunc()
- },
- colos() {
- this.shows = false
- },
// 閲嶇疆
reset() {
this.form.workshop = ''
@@ -624,54 +693,16 @@
setting(operation) {
this.operation = operation
this.dialogVisible = true
-
+ this.getDialogData()
this.$nextTick(() => {
this.$refs.tableDataDialogRef.doLayout()
})
},
- // 鏂板鎸夐挳
- add(operation) {
- this.operation = operation
- this.dialogVisible = true
- },
- // 淇敼鎸夐挳
- edit(operation, row) {
- this.operation = operation
- this.dialogVisible = true
-
- this.$nextTick(() => {
- this.dialogForm.OrgCode = row.org_code
- this.dialogForm.OrgName = row.org_name
- this.dialogForm.SupUnit = row.parent_id
- })
- },
- // 鍒犻櫎鎸夐挳
- async del(row) {
- this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- DeleteOrganization({ orgid: row.code }).then(res => {
- if (res.code === '200') {
- this.$message.success('鍒犻櫎鎴愬姛!')
- if (this.form.page > 1 && this.tableData.length === 1) {
- this.form.page--
- }
- this.getCapacityPlanningSearch()
- }
- })
- }).catch(() => {
- this.$message.info('宸插彇娑堝垹闄�')
- })
- },
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
- this.dialogForm.OrgType = ''
- this.dialogForm.OrgCode = ''
- this.dialogForm.OrgName = ''
- this.dialogForm.SupUnit = ''
- this.$refs.dialogForm.clearValidate()
+ this.radioSelectedCode = ''
+ this.tempObj = {}
+ this.tableDataDialog = []
},
// 瀵硅瘽妗嗗彇娑�
dialogVisibleCancel() {
@@ -679,7 +710,21 @@
},
// 瀵硅瘽妗嗙‘璁�
dialogVisibleConfirm() {
- this.dialogVisible = false
+ const data = {
+ wkshopcode: this.tempObj.CaptPlanWorkShopid,
+ capunitcode: this.tempObj.CaptPlanDeviceTypeid,
+ captplanid: this.tempObj.CaptPlanId ? this.tempObj.CaptPlanId : '',
+ capsetupcode: this.radioSelectedCode,
+ captplantype: this.tempObj.CaptPlanType
+ }
+ this.$store.state.app.buttonIsDisabled = true
+ CapacityPlanSubmit(data).then(res => {
+ if (res.code === '200') {
+ this.dialogVisible = false
+ this.$store.state.app.buttonIsDisabled = false
+ this.getCapacityPlanningSearch()
+ }
+ })
},
// 鑾峰彇椤甸潰楂樺害
getHeight() {
@@ -833,4 +878,12 @@
.el-table .custom-row {
background: #f8f8fa;
}
+
+/*涓轰簡璁╅潰鏉垮湪瓒呭嚭鍖哄煙鍙樉绀�*/
+.el-table__body-wrapper{
+ overflow: visible !important
+}
+.table_only{
+overflow: visible !important
+}
</style>
diff --git a/src/views/zzmx/wlqd.vue b/src/views/zzmx/wlqd.vue
index 35783d0..cb763d8 100644
--- a/src/views/zzmx/wlqd.vue
+++ b/src/views/zzmx/wlqd.vue
@@ -15,7 +15,7 @@
style="display: flex;justify-content: space-between"
>
<div class="elForm">
- <el-form-item label-width="70px" label="姣嶄欢缂栫爜" style=" display: flex;">
+ <el-form-item label="姣嶄欢缂栫爜" style=" display: flex;">
<el-input v-model="form.parentpartcode" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="姣嶄欢鍚嶇О" style=" display: flex;">
@@ -34,7 +34,7 @@
/>
</el-select>
</el-form-item>
- <el-form-item v-show="isExpandForm" label-width="70px" label="鐗堟湰缂栧彿" style=" display: flex;">
+ <el-form-item v-show="isExpandForm" label="鐗堟湰缂栧彿" style=" display: flex;">
<el-input v-model="form.version" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item v-show="isExpandForm" label="鍒涘缓浜哄憳" style=" display: flex;">
@@ -503,7 +503,13 @@
width="110"
>
<template slot-scope="{row}">
- <el-select v-if="row.isVisible===1" v-model="row.PN_TYPE" placeholder="璇烽�夋嫨">
+ <el-select
+ v-if="row.isVisible===1"
+ v-model="row.PN_TYPE"
+ :disabled="row.PN_TYPE==='Z'"
+ placeholder="璇烽�夋嫨"
+ @change="val=>changeType(val,row)"
+ >
<el-option
v-for="item in sxArr"
:key="item.code"
@@ -522,7 +528,7 @@
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">淇濆瓨</el-button>
+ <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">纭畾</el-button>
<el-button v-if="row.isVisible===1" type="text" @click="cancelRow(row)">鍙栨秷</el-button>
<el-button v-if="row.isVisible===0" type="text" @click="editRow(row)">缂栬緫</el-button>
<el-button v-if="row.isVisible===0" type="text" @click="delRow(row)">鍒犻櫎</el-button>
@@ -541,7 +547,7 @@
:disabled="$store.state.app.buttonIsDisabled"
type="primary"
@click="dialogVisibleConfirm"
- >纭� 瀹�</el-button>
+ >淇濆瓨</el-button>
</div>
</span>
</el-dialog>
@@ -858,6 +864,12 @@
// this.PartSelectArr.splice(index, 1)
// })
},
+ // 鐗╂枡娓呭崟灞炴�х被鍨嬪�兼敼鍙樻椂瑙﹀彂
+ changeType(val, row) {
+ this.dialogTableDataArr.forEach(item => {
+ item.PN_TYPE = item.SMATERIRL_CODE === row.SMATERIRL_CODE ? 'Z' : 'F'
+ })
+ },
addDialog() {
if (this.dialogTableDataArr.find(item => item.isVisible === 1)) {
return this.$message.info('璇峰厛淇濆瓨鏈潯璁板綍锛�')
@@ -876,7 +888,7 @@
BASE_QUANTITY: '',
LOSS_QUANTITY: '',
TOTAL_QUANTITY: '',
- PN_TYPE: ''
+ PN_TYPE: this.dialogTableDataArr.length === 0 ? 'Z' : 'F'
})
},
saveRow(row) {
@@ -905,6 +917,10 @@
})
},
delRow(row) {
+ if (row.PN_TYPE === 'Z') {
+ return this.$message.info('涓绘枡涓嶅彲鍒犻櫎锛�')
+ }
+
this.PartSelectArrAll.forEach(item => {
if (item.partcode === row.SMATERIRL_CODE) {
this.PartSelectArr.unshift(item)
@@ -981,7 +997,7 @@
worklist: this.dialogTableDataArr,
opertype: this.operation === 'add' ? 'Add' : 'Update'
}
- console.log(data, 89)
+
this.$store.state.app.buttonIsDisabled = true
AddUpdateBoIventory(data).then(res => {
if (res.code === '200') {
--
Gitblit v1.9.3