From df86d5bd8bbbe4b2d6ec8bdffa681848d92576ca Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 30 八月 2022 17:02:59 +0800
Subject: [PATCH] 1.修改bug2.保养部位增删查改开发完成
---
src/views/sbgl/djbw.vue | 33 +
src/views/sbgl/bybz.vue | 1165 ++++++++++++++++++++++++++++++++++++++++++++
src/views/scgl/gd.vue | 3
src/views/jcsz/jsqd.vue | 1
src/views/kb/cgdd.vue | 16
src/views/scgl/sckbg.vue | 25
src/views/sbgl/djbz.vue | 16
src/views/kb/zhkb.vue | 156 ++++-
src/views/sbgl/bybw.vue | 115 ++-
9 files changed, 1,410 insertions(+), 120 deletions(-)
diff --git a/src/views/jcsz/jsqd.vue b/src/views/jcsz/jsqd.vue
index 85e6a2f..d8aa604 100644
--- a/src/views/jcsz/jsqd.vue
+++ b/src/views/jcsz/jsqd.vue
@@ -100,6 +100,7 @@
min-width="160"
label="瑙掕壊鎻忚堪"
sortable="custom"
+ show-tooltip-when-overflow
>
<template slot-scope="{row}">
<div v-if="row.description">{{ row.description }}</div>
diff --git a/src/views/kb/cgdd.vue b/src/views/kb/cgdd.vue
index ee9fd37..78a6f61 100644
--- a/src/views/kb/cgdd.vue
+++ b/src/views/kb/cgdd.vue
@@ -272,7 +272,7 @@
const divData = this.$refs.tableData.bodyWrapper
// 鎷垮埌鍏冪礌鍚庯紝瀵瑰厓绱犺繘琛屽畾鏃跺鍔犺窛绂婚《閮ㄨ窛绂伙紝瀹炵幇婊氬姩鏁堟灉(姝ら厤缃负姣�100姣绉诲姩1鍍忕礌)
- setInterval(() => {
+ const task = setInterval(() => {
// 鍏冪礌鑷璺濈椤堕儴1鍍忕礌
// divData.scrollTop += divData.scrollHeight / this.tableDataRank.length
divData.scrollTop += 1
@@ -282,9 +282,13 @@
divData.scrollTop = 0
PurchaseLeftBottom().then(res => {
this.tableData = res.data
+ if (this.tableData.length > 14) {
+ clearInterval(task)
+ this.getPurchaseLeftBottom()
+ }
})
}
- }, this.tableData.length <= 14 ? 1000 * 6 : 100)
+ }, this.tableData.length <= 14 ? 1000 * 3 : 100)
})
},
@@ -294,7 +298,7 @@
const divData = this.$refs.tableDataRank.bodyWrapper
// 鎷垮埌鍏冪礌鍚庯紝瀵瑰厓绱犺繘琛屽畾鏃跺鍔犺窛绂婚《閮ㄨ窛绂伙紝瀹炵幇婊氬姩鏁堟灉(姝ら厤缃负姣�100姣绉诲姩1鍍忕礌)
- setInterval(() => {
+ const task = setInterval(() => {
// 鍏冪礌鑷璺濈椤堕儴1鍍忕礌
// divData.scrollTop += divData.scrollHeight / this.tableDataRank.length
divData.scrollTop += 1
@@ -304,9 +308,13 @@
divData.scrollTop = 0
PurchaseRight().then(res => {
this.tableDataRank = res.data
+ if (this.tableDataRank.length > 22) {
+ clearInterval(task)
+ this.getPurchaseRight()
+ }
})
}
- }, this.tableDataRank.length <= 22 ? 1000 * 6 : 100)
+ }, this.tableDataRank.length <= 22 ? 1000 * 3 : 100)
})
},
diff --git a/src/views/kb/zhkb.vue b/src/views/kb/zhkb.vue
index 3ced825..974fb53 100644
--- a/src/views/kb/zhkb.vue
+++ b/src/views/kb/zhkb.vue
@@ -641,16 +641,16 @@
getLineSearchTopLeftData() {
this.lineArr.forEach((item, index) => {
- // if (index === 0) {
- this.handleEveryLine(item, index)
- this.lineCodeArr.push(item.code)
- // }
+ if (index <= 3) {
+ this.handleEveryLine(item, index)
+ this.lineCodeArr.push(item.code)
+ }
})
},
// 澶勭悊姣忎竴鏉′骇绾�
async handleEveryLine(item, index) {
const res = await LineSearchTopLeftData([item])
- console.log(res, 7)
+
let res1, res2, res3, res4
if (res.data[0].linecode === this.lineCodeArr[0]) {
res1 = res
@@ -688,22 +688,25 @@
children: res1.data[0].children ? res1.data[0].children[count] : []
}
}
- // console.log(res1.data[0].children.length, 9999)
- // console.log(res1.data[0].children, 8888)
- // if (res1.data[0].children.length > 0 && res1.data[0].children.length === count++) {
- if (res1.data[0].children.length === count++) {
- count = 0
+ console.log(res1.data[0].children === null, 999)
+ if (res1.data[0].children === null) {
+ res1.data[0].children = []
+ }
+ if (this.lineContent01.children === undefined || res1.data[0].children.length >= 0) {
LineSearchTopLeftData([item]).then(res => {
res1 = res
- this.lineContent01 = {
- linename: res1.data[0].linename,
- lineworkcont: res1.data[0].lineworkcont,
- children: res1.data[0].children ? res1.data[0].children[count] : []
- }
})
- // this.handleEveryLine(item, index)
}
- }, res1.data[0].children && res1.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ if (res1.data[0].children.length === count++) {
+ count = 0
+ this.lineContent01 = {
+ linename: res1.data[0].linename,
+ lineworkcont: res1.data[0].lineworkcont,
+ children: res1.data[0].children ? res1.data[0].children[count] : []
+ }
+ }
+ }, 1000 * 3)
+ // }, res1.data[0].children && res1.data[0].children.length > 0 ? 1000 * 3 : 1000 * 3)
} else if (index === 1) {
let count = 0
if (flag2) {
@@ -722,20 +725,47 @@
children: res2.data[0].children ? res2.data[0].children[count] : []
}
}
- if (res2.data[0].children.length === count++) {
- count = 0
+ if (res2.data[0].children === null) {
+ res2.data[0].children = []
+ }
+ if (this.lineContent02.children === undefined || res2.data[0].children.length >= 0) {
LineSearchTopLeftData([item]).then(res => {
res2 = res
- this.lineContent02 = {
- linename: res2.data[0].linename,
- lineworkcont: res2.data[0].lineworkcont,
- children: res2.data[0].children ? res2.data[0].children[count] : []
- }
})
-
- // this.handleEveryLine(item, index)
}
- }, res2.data[0].children && res2.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ if (res2.data[0].children.length === count++) {
+ count = 0
+ this.lineContent02 = {
+ linename: res2.data[0].linename,
+ lineworkcont: res2.data[0].lineworkcont,
+ children: res2.data[0].children ? res2.data[0].children[count] : []
+ }
+ }
+ // }, res2.data[0].children && res2.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ }, 1000 * 3)
+
+ // setInterval(() => {
+ // if (count > 0) {
+ // this.lineContent02 = {
+ // linename: res2.data[0].linename,
+ // lineworkcont: res2.data[0].lineworkcont,
+ // children: res2.data[0].children ? res2.data[0].children[count] : []
+ // }
+ // }
+ // if (res2.data[0].children.length === count++) {
+ // count = 0
+ // LineSearchTopLeftData([item]).then(res => {
+ // res2 = res
+ // this.lineContent02 = {
+ // linename: res2.data[0].linename,
+ // lineworkcont: res2.data[0].lineworkcont,
+ // children: res2.data[0].children ? res2.data[0].children[count] : []
+ // }
+ // })
+ //
+ // // this.handleEveryLine(item, index)
+ // }
+ // }, res2.data[0].children && res2.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
} else if (index === 2) {
let count = 0
if (flag3) {
@@ -754,19 +784,31 @@
children: res3.data[0].children ? res3.data[0].children[count] : []
}
}
- if (res3.data[0].children.length === count++) {
- count = 0
+
+ if (res3.data[0].children === null) {
+ res3.data[0].children = []
+ }
+
+ if (this.lineContent03.children === undefined || res3.data[0].children.length >= 0) {
LineSearchTopLeftData([item]).then(res => {
res3 = res
- this.lineContent03 = {
- linename: res3.data[0].linename,
- lineworkcont: res3.data[0].lineworkcont,
- children: res3.data[0].children ? res3.data[0].children[count] : []
- }
})
+ }
+
+ if (res3.data[0].children.length === count++) {
+ count = 0
+ // LineSearchTopLeftData([item]).then(res => {
+ // res3 = res
+ this.lineContent03 = {
+ linename: res3.data[0].linename,
+ lineworkcont: res3.data[0].lineworkcont,
+ children: res3.data[0].children ? res3.data[0].children[count] : []
+ }
+ // })
// this.handleEveryLine(item, index)
}
- }, res3.data[0].children && res3.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ // }, res3.data[0].children && res3.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ }, 1000 * 3)
} else if (index === 3) {
let count = 0
if (flag4) {
@@ -785,20 +827,27 @@
children: res4.data[0].children ? res4.data[0].children[count] : []
}
}
- // if (res4.data[0].children > 0 && res4.data[0].children.length === count++) {
- if (res4.data[0].children.length === count++) {
- count = 0
+
+ if (res4.data[0].children === null) {
+ res4.data[0].children = []
+ }
+
+ if (res4.data[0].children.length === count || this.lineContent04.children === undefined) {
LineSearchTopLeftData([item]).then(res => {
res4 = res
- this.lineContent04 = {
- linename: res4.data[0].linename,
- lineworkcont: res4.data[0].lineworkcont,
- children: res4.data[0].children ? res4.data[0].children[count] : []
- }
})
- // this.handleEveryLine(item, index)
}
- }, res4.data[0].children && res4.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+
+ if (res4.data[0].children.length === count++) {
+ count = 0
+ this.lineContent04 = {
+ linename: res4.data[0].linename,
+ lineworkcont: res4.data[0].lineworkcont,
+ children: res4.data[0].children ? res4.data[0].children[count] : []
+ }
+ }
+ // }, res4.data[0].children && res4.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ }, 1000 * 3)
}
},
@@ -809,7 +858,7 @@
const divData = this.$refs.tableData.bodyWrapper
// 鎷垮埌鍏冪礌鍚庯紝瀵瑰厓绱犺繘琛屽畾鏃跺鍔犺窛绂婚《閮ㄨ窛绂伙紝瀹炵幇婊氬姩鏁堟灉(姝ら厤缃负姣�100姣绉诲姩1鍍忕礌)
- setInterval(() => {
+ const task = setInterval(() => {
// 鍏冪礌鑷璺濈椤堕儴1鍍忕礌
divData.scrollTop += 1
// divData.scrollTop += divData.scrollHeight / this.tableData.length
@@ -819,9 +868,13 @@
divData.scrollTop = 0
LineSearchBottomLeftData().then(res => {
this.tableData = res.data
+ if (this.tableData.length > 10) {
+ clearInterval(task)
+ this.getTableDataRoll()
+ }
})
}
- }, this.tableData.length <= 10 ? 1000 * 6 : 100)
+ }, this.tableData.length <= 10 ? 1000 * 3 : 100)
})
},
// 褰撴棩瀹屽伐浜у搧鏁伴噺鎺掕
@@ -831,7 +884,7 @@
const divData = this.$refs.tableDataRank.bodyWrapper
// 鎷垮埌鍏冪礌鍚庯紝瀵瑰厓绱犺繘琛屽畾鏃跺鍔犺窛绂婚《閮ㄨ窛绂伙紝瀹炵幇婊氬姩鏁堟灉(姝ら厤缃负姣�100姣绉诲姩1鍍忕礌)
- setInterval(() => {
+ const task = setInterval(() => {
// 鍏冪礌鑷璺濈椤堕儴1鍍忕礌
// divData.scrollTop += divData.scrollHeight / this.tableDataRank.length
divData.scrollTop += 1
@@ -841,9 +894,14 @@
divData.scrollTop = 0
LineSearchTopRightData().then(res => {
this.tableDataRank = res.data
+
+ if (this.tableDataRank.length > 10) {
+ clearInterval(task)
+ this.getTableDataRankRoll()
+ }
})
}
- }, this.tableDataRank.length <= 10 ? 1000 * 6 : 100)
+ }, this.tableDataRank.length <= 10 ? 1000 * 3 : 100)
})
},
// 鑾峰彇echarts
diff --git a/src/views/sbgl/bybw.vue b/src/views/sbgl/bybw.vue
index ddff0d5..d4c0582 100644
--- a/src/views/sbgl/bybw.vue
+++ b/src/views/sbgl/bybw.vue
@@ -16,10 +16,10 @@
>
<div class="elForm">
<el-form-item label="閮ㄤ綅缂栫爜" style=" display: flex;">
- <el-input v-model="form.checkitemcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ <el-input v-model="form.maiitemcode" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="閮ㄤ綅鍚嶇О" style=" display: flex;">
- <el-input v-model="form.checkitemname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ <el-input v-model="form.maiitemname" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="淇濆吇瑕佹眰" style=" display: flex;">
<el-input v-model="form.maidescr" placeholder="璇疯緭鍏�" style="width: 200px" />
@@ -65,12 +65,12 @@
label="搴忓彿"
/>
<el-table-column
- prop="org_code"
+ prop="code"
label="閮ㄤ綅缂栫爜"
sortable="custom"
/>
<el-table-column
- prop="org_name"
+ prop="name"
label="閮ㄤ綅鍚嶇О"
sortable="custom"
/>
@@ -78,12 +78,29 @@
prop="description"
label="淇濆吇瑕佹眰"
sortable="custom"
- />
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.description">{{ row.description }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
<el-table-column
- prop="parentorg_name"
+ prop="isscan"
label="閫夋嫨鎵爜"
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isscan==='Y'">
+ <svg-icon icon-class="circleYes" style="margin-right: 2px" />
+ 鏄�
+ </div>
+ <div v-if="row.isscan==='N'">
+ <svg-icon icon-class="circleNo" style="margin-right: 2px" />
+ 鍚�
+ </div>
+ </template>
+ </el-table-column>
<el-table-column
prop="lm_user"
label="鍒涘缓浜哄憳"
@@ -135,30 +152,30 @@
@close="handleClose"
>
<el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
- <el-form-item label="閮ㄤ綅缂栫爜" prop="OrgCode">
- <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 200px" />
+ <el-form-item label="閮ㄤ綅缂栫爜" prop="maiitemcode">
+ <el-input v-model="dialogForm.maiitemcode" :disabled="operation!=='add'" style="width: 200px" />
</el-form-item>
- <el-form-item label="閮ㄤ綅鍚嶇О" prop="OrgName">
- <el-input v-model="dialogForm.OrgName" style="width: 200px" />
+ <el-form-item label="閮ㄤ綅鍚嶇О" prop="maiitemname">
+ <el-input v-model="dialogForm.maiitemname" style="width: 200px" />
</el-form-item>
- <el-form-item prop="SupUnit" label="閫夋嫨鎵爜">
+ <el-form-item required label="閫夋嫨鎵爜">
<el-select
- v-model="dialogForm.SupUnit"
+ v-model="dialogForm.isqrcode"
style="width: 200px"
placeholder="璇烽�夋嫨"
:popper-append-to-body="false"
>
<el-option
- v-for="item in SupUnitArr"
+ v-for="item in isqrcodeArr"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
- <el-form-item label="淇濆吇瑕佹眰" prop="OrgName">
- <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 200px" />
+ <el-form-item label="淇濆吇瑕佹眰" prop="maiitemdescr">
+ <el-input v-model="dialogForm.maiitemdescr" type="textarea" style="width: 200px" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -179,7 +196,7 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
-import { DeviceCheckItemSearch, DeviceMaiItemSearch } from '@/api/sbgl'
+import { AddUpdateDeviceMaiItem, DeleteDeviceMaiItem, DeviceCheckItemSearch, DeviceMaiItemSearch } from '@/api/sbgl'
import ImportPicker from '@/components/ImportPicker'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
@@ -211,8 +228,8 @@
mainHeight: 0,
tableHeight: 0,
form: {
- checkitemcode: '', // 閮ㄤ綅缂栫爜
- checkitemname: '', // 閮ㄤ綅鍚嶇О
+ maiitemcode: '', // 閮ㄤ綅缂栫爜
+ maiitemname: '', // 閮ㄤ綅鍚嶇О
maidescr: '', // 淇濆吇瑕佹眰
isqrcode: '', // 閫変腑鎵爜
prop: 'lm_date', // 鎺掑簭瀛楁
@@ -229,24 +246,20 @@
tableData: [],
dialogVisible: false,
dialogForm: {
- OrgType: '',
- OrgCode: '',
- OrgName: '',
- SupUnit: ''// 涓婄骇鍗曚綅
+ id: '',
+ maiitemcode: '',
+ maiitemname: '',
+ maiitemdescr: '',
+ isqrcode: 'N',
+ OperType: ''
},
operation: '',
dialogFormRules: {
- OrgType: [
- { required: true, message: '璇疯緭鍏ラ�夋嫨绫诲瀷', trigger: ['blur', 'change'] }
- ],
- OrgCode: [
+ maiitemcode: [
{ required: true, validator: validateName, trigger: ['blur', 'change'] }
],
- OrgName: [
+ maiitemname: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
- ],
- SupUnit: [
- { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
]
},
@@ -302,10 +315,10 @@
},
// 閲嶇疆
reset() {
- this.form.OrgCode = ''
- this.form.OrgName = ''
- this.form.OrgType = ''
- this.form.UserName = ''
+ this.form.maiitemcode = ''
+ this.form.maiitemname = ''
+ this.form.maidescr = ''
+ this.form.isqrcode = ''
this.getDeviceMaiItemSearch()
},
@@ -320,9 +333,11 @@
this.dialogVisible = true
this.$nextTick(() => {
- this.dialogForm.OrgCode = row.org_code
- this.dialogForm.OrgName = row.org_name
- this.dialogForm.SupUnit = row.parent_id
+ this.dialogForm.id = row.id
+ this.dialogForm.maiitemcode = row.code
+ this.dialogForm.maiitemname = row.name
+ this.dialogForm.maiitemdescr = row.description
+ this.dialogForm.isqrcode = row.isscan
})
},
// 鍒犻櫎鎸夐挳
@@ -332,7 +347,7 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- DeleteOrganization({ orgid: row.code }).then(res => {
+ DeleteDeviceMaiItem({ maiitemcode: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
this.getDeviceMaiItemSearch()
@@ -344,10 +359,11 @@
},
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
- this.dialogForm.OrgType = ''
- this.dialogForm.OrgCode = ''
- this.dialogForm.OrgName = ''
- this.dialogForm.SupUnit = ''
+ this.dialogForm.id = ''
+ this.dialogForm.maiitemcode = ''
+ this.dialogForm.maiitemname = ''
+ this.dialogForm.maiitemdescr = ''
+ this.dialogForm.isqrcode = 'N'
this.$refs.dialogForm.clearValidate()
},
// 瀵硅瘽妗嗗彇娑�
@@ -359,12 +375,15 @@
this.$refs.dialogForm.validate(valid => {
if (valid) {
const data = {
- OrganCode: this.dialogForm.OrgCode,
- OrganName: this.dialogForm.OrgName,
- OperType: this.operation === 'add' ? 'Add' : 'Update',
- Operator: getCookie('admin')
+ id: this.dialogForm.id,
+ maiitemcode: this.dialogForm.maiitemcode,
+ maiitemname: this.dialogForm.maiitemname,
+ maiitemdescr: this.dialogForm.maiitemdescr,
+ isqrcode: this.dialogForm.isqrcode,
+ OperType: this.operation === 'add' ? 'Add' : 'Update'
}
- AddUpdateOrganization(data).then(res => {
+ console.log(data)
+ AddUpdateDeviceMaiItem(data).then(res => {
if (res.code === '200') {
this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
this.dialogVisible = false
diff --git a/src/views/sbgl/bybz.vue b/src/views/sbgl/bybz.vue
index 9c03e10..974b262 100644
--- a/src/views/sbgl/bybz.vue
+++ b/src/views/sbgl/bybz.vue
@@ -1,11 +1,1170 @@
-<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>
+ </div>
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="80px"
+ inline
+ style="display: flex;justify-content: space-between"
+ >
+ <div class="elForm">
+ <el-form-item label="鏍囧噯缂栫爜" style=" display: flex;">
+ <el-input v-model="form.repairstandcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鏍囧噯鍚嶇О" style=" display: flex;">
+ <el-input v-model="form.repairstandname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鏍囧噯鎻忚堪" style=" display: flex;">
+ <el-input v-model="form.repairstanddescr" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ </div>
+ <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+ <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>
+
+ <div class="elTableDiv">
+ <el-table
+ :data="tableData"
+ :height="tableHeight+'px'"
+ border
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:tableHeight+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @sort-change="sortChange"
+ >
+ <!-- <el-table-column-->
+ <!-- type="selection"-->
+ <!-- width="50"-->
+ <!-- />-->
+ <el-table-column
+ prop="RowNum"
+ width="50"
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="code"
+ label="鏍囧噯缂栫爜"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="name"
+ label="鏍囧噯鍚嶇О"
+ sortable="custom"
+ />
+
+ <el-table-column
+ prop="description"
+ label="鏍囧噯鎻忚堪"
+ sortable="custom"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.description">{{ row.description }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="iscontr"
+ label="淇濆吇鍛ㄦ湡"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="is_checkeqp"
+ label="鍏宠仈璁惧"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <i v-if="row.is_checkeqp==='Y'" class="el-icon-share" @click="checkeqpClick(row)" />
+ <i
+ v-if="row.is_checkeqp==='N'"
+ class="el-icon-share"
+ style="color: rgb(180 ,181, 185)"
+ @click="checkeqpClick(row)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="lm_user"
+ label="鍒涘缓浜哄憳"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="lm_date"
+ label="鍒涘缓鏃堕棿"
+ width="160"
+ sortable="custom"
+ />
+ <el-table-column
+ label="鎿嶄綔"
+ fixed="right"
+ width="120"
+ >
+ <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>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="prev, pager, next,sizes"
+ popper-class="select_bottom"
+ @pagination="getDeviceRepairStandArdSearch"
+ />
+ </div>
+
+ <el-dialog
+ :title="operation==='add'?'鏂板':'缂栬緫'"
+ :visible.sync="dialogVisible"
+ width="800px"
+ :close-on-click-modal="false"
+ top="8vh"
+ @closed="handleClose"
+ >
+ <!-- @close="handleClose"-->
+ <div>
+ <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />璁惧淇濆吇鏍囧噯淇℃伅锛�
+ </div>
+ <div style="margin: 0 30px;">
+ <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
+ <el-form-item label="鏍囧噯缂栫爜" prop="code">
+ <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鏍囧噯鍚嶇О" prop="name">
+ <el-input v-model="dialogForm.name" style="width: 200px" />
+ </el-form-item>
+ <el-form-item required label="淇濆吇鍛ㄦ湡">
+ <el-select
+ v-model="dialogForm.repaircycle"
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="item in cycleArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏍囧噯鎻忚堪" prop="description">
+ <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" />
+ </el-form-item>
+ </el-form>
+ </div>
+ <div>
+ <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />璁惧鍏宠仈淇濆吇椤逛俊鎭細
+ </div>
+ <div style="margin-bottom:10px">
+ <el-button type="primary" icon="el-icon-circle-plus-outline" @click="addRow">鏂板</el-button>
+ </div>
+ <div class="elTableDiv">
+ <el-table
+ ref="tableDataDialogRef"
+ :data="tableDataDialog"
+ :height="(tableHeight-300)+'px'"
+ border
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:(tableHeight-300)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ >
+ <el-table-column
+ type="index"
+ width="50"
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="repairitem_code"
+ label="淇濆吇閮ㄤ綅缂栫爜"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isVisible===0">{{ row.repairitem_code }}</div>
+ <el-select
+ v-if="row.isVisible===1"
+ v-model="row.repairitem_code"
+ placeholder="璇烽�夋嫨"
+ @change="val=>selectChange(val,row)"
+ >
+ <el-option
+ v-for="item in repairItemSelectArr"
+ :key="item.name"
+ :label="item.code"
+ :value="item.name"
+ />
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="repairitem_name"
+ label="淇濆吇閮ㄤ綅鍚嶇О"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isVisible===0">{{ row.repairitem_name }}</div>
+ <el-select
+ v-if="row.isVisible===1"
+ v-model="row.repairitem_code"
+ placeholder="璇烽�夋嫨"
+ @change="val=>selectChange(val,row)"
+ >
+ <el-option
+ v-for="item in repairItemSelectArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="repairitem_descr"
+ label="淇濆吇瑕佹眰"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isVisible===0">{{ row.repairitem_descr }}</div>
+ <el-input v-else v-model="row.repairitem_descr" />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="isscan"
+ label="閫夋嫨鎵爜"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.isVisible===0">{{ row.isscan === 'Y' ? '鏄�' : '鍚�' }}</div>
+ <el-select
+ v-if="row.isVisible===1"
+ v-model="row.isscan"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="item in checkcontrArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎿嶄綔"
+ width="120"
+ fixed="right"
+ >
+ <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>
+ </el-table>
+ </div>
+ <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>
+
+ <!-- 鍏宠仈璁惧-->
+ <el-dialog
+ title="鍏宠仈璁惧"
+ :visible.sync="dialogVisibleEqp"
+ width="800px"
+ top="10vh"
+ :close-on-click-modal="false"
+ class="dialogVisibleEqp"
+ @closed="handleCloseEqp"
+ @close="handleCloseEqp"
+ >
+ <!-- @opened="handleOpenedRoles"-->
+
+ <div>
+ <i class="el-icon-s-comment" style="color:#42b983;" /> 鏍囧噯鍚嶇О锛歿{ dialogFormEqp.name }}
+ </div>
+ <el-divider />
+ <div>
+ <div style="margin-bottom:20px">
+ <i class="el-icon-s-operation" style="color:#42b983;" /> 璁惧鎵�灞炶溅闂撮泦鍚堬細
+ </div>
+ <div class="myCheckboxGroup">
+
+ <div
+ v-for="item in dialogFormEqp.eqpArr"
+ :key="item.code"
+ :style="{border:item.isSelected1?'1px solid #42b983':'1px solid #eee'}"
+ class="myCheckbox"
+ @click="myCheckboxClick(item)"
+ >
+ <input
+ class="myCheckboxInput"
+ type="checkbox"
+ :value="item.code"
+ :name="item.name"
+ :style="{color:item.isSelected2?'#42b983':'#fff'}"
+ @click="myCheckboxInputClick(item)"
+ >{{ item.name }}
+ <!-- 鐖跺瓙鐐瑰嚮浜嬩欢涓嶅奖鍝�-->
+ <!-- onClick="event.cancelBubble = true"-->
+ </div>
+ </div>
+ </div>
+ <el-divider />
+ <div>
+ <div style="margin-bottom:20px">
+ <i class="el-icon-s-operation" style="color:#42b983;" /> 璁惧淇℃伅锛�
+ </div>
+ <el-tree
+ ref="epqTree"
+ :data="dialogFormEqp.eqpTree"
+ show-checkbox
+ node-key="code"
+ default-expand-all
+ style="height: 300px"
+ :props="defaultPropsOfEqpTree"
+ @check="checkBoxClick"
+ />
+ <!-- @check-change="checkChange"-->
+
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button @click="eqpDialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="eqpDialogVisibleConfirm">纭� 瀹�</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 {
+ AddUpdateDeviceCheckStandArd, AddUpdateDeviceRepairStandArd,
+ DeleteDeviceCheckStaned, DeleteDeviceRepairStaned,
+ DeviceCheckItemSelect,
+ DeviceCheckStandArdSearch,
+ DeviceCheckStanedAssociationEqp, DeviceRepairItemSelect,
+ DeviceRepairStandArdSearch, DeviceRepairStanedAssociationEqp,
+ SaveDeviceCheckStanedAssociationEqp, SaveDeviceRepairStanedAssociationEqp,
+ ViewDeviceCheckStanedSearch
+} from '@/api/sbgl'
+import $ from 'jquery'
+
+const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
- name: 'Bybz'
+ name: 'Zzjg',
+ components: {
+ Pagination, ImportPicker
+ },
+ data() {
+ const validateName = (rule, value, callback) => {
+ if (!value) {
+ return callback(new Error('璇疯緭鍏ョ紪鐮�'))
+ } else {
+ if (SER_HZ.test(value)) {
+ return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
+ } else {
+ callback()
+ }
+ }
+ }
+ const validateTypeCode = (rule, value, callback) => {
+ if (!value) {
+ return callback(new Error('璇烽�夋嫨涓婄骇'))
+ } else {
+ callback()
+ }
+ }
+ return {
+ mainHeight: 0,
+ tableHeight: 0,
+ form: {
+ repairstandcode: '', // 鏍囧噯缂栫爜
+ repairstandname: '', // 鏍囧噯鍚嶇О
+ repairstanddescr: '', // 鐐规绠℃帶
+ prop: 'lm_date', // 鎺掑簭瀛楁
+ order: 'desc', // 鎺掑簭瀛楁
+ page: 1, // 绗嚑椤�
+ rows: 20 // 姣忛〉澶氬皯鏉�
+ },
+ checkcontrArr: [
+ { code: 'Y', name: '鏄�' },
+ { code: 'N', name: '鍚�' }
+ ],
+ cycleArr: [
+ { code: 'Y', name: '骞�' },
+ { code: 'S', name: '瀛�' },
+ { code: 'M', name: '鏈�' },
+ { code: 'W', name: '鍛�' }
+ ],
+ total: 10,
+ tableData: [],
+ dialogVisible: false,
+ dialogForm: {
+ code: '',
+ name: '',
+ repaircycle: 'M',
+ description: ''
+ },
+ operation: '',
+ dialogFormRules: {
+
+ code: [
+ { required: true, validator: validateName, trigger: ['blur', 'change'] }
+ ],
+ name: [
+ { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�', trigger: ['blur', 'change'] }
+ ],
+ enable: [
+ { required: true, message: '', trigger: ['blur', 'change'] }
+ ]
+ },
+ tableDataDialog: [], // 琛ㄦ牸鏁版嵁
+
+ repairItemSelectArr: [],
+ repairItemIsCancel: true,
+ dialogVisibleEqp: false,
+
+ dialogFormEqp: {
+ name: '',
+ code: '',
+ eqpAll: [], // 杞﹂棿鍙婅澶囨墍鏈�
+ eqpArr: [], // 杞﹂棿闆嗗悎鎵�鏈�
+ eqpTree: [], // 璁惧鏍戝舰鎵�鏈�
+ eqpCodeSelectedArr: []// 璁惧鏍戝舰閫変腑
+ },
+ defaultPropsOfEqpTree: {
+ value: 'code',
+ label: 'name',
+ children: 'children'
+ },
+
+ title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
+ code: '4',
+ shows: false
+
+ }
+ },
+ watch: {
+ shows() {
+ if (!this.shows) {
+ this.getDeviceRepairStandArdSearch()
+ }
+ }
+ },
+ created() {
+ this.handleRequest()
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ methods: {
+ handleRequest() {
+ this.getDeviceRepairStandArdSearch().then(res => {
+ if (res.code === '200') {
+ this.getDeviceRepairItemSelect()
+ }
+ })
+ },
+ async getDeviceRepairStandArdSearch() {
+ const res = await DeviceRepairStandArdSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ return { code: res.code }
+ },
+ // 鎺掑簭鏀瑰彉鏃�
+ 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.getDeviceRepairStandArdSearch()
+ },
+ // 鏌ヨ
+ search() {
+ this.getDeviceRepairStandArdSearch()
+ },
+ // 瀵煎叆鎸夐挳
+ upload() {
+ this.shows = true
+ this.$refs.importPickerFunc.newDataFunc()
+ },
+ colos() {
+ this.shows = false
+ },
+ // 閲嶇疆
+ reset() {
+ this.form.repairstandcode = ''
+ this.form.repairstandname = ''
+ this.form.repairstanddescr = ''
+ this.getDeviceRepairStandArdSearch()
+ },
+
+ async getDeviceRepairItemSelect() {
+ const { data: res } = await DeviceRepairItemSelect()
+ this.repairItemSelectArr = res
+ },
+
+ // 鏂板鎸夐挳
+ add(operation) {
+ this.operation = operation
+ this.dialogVisible = true
+ this.$nextTick(() => {
+ this.$refs.tableDataDialogRef.doLayout()
+ })
+ },
+ // 淇敼鎸夐挳
+ edit(operation, row) {
+ this.operation = operation
+ this.getViewDeviceCheckStanedSearch(row.code)
+ this.dialogVisible = true
+
+ this.$nextTick(() => {
+ this.$refs.tableDataDialogRef.doLayout()
+ })
+ // this.$nextTick(() => {
+ // this.dialogForm.code = row.code
+ // this.dialogForm.name = row.name
+ // this.dialogForm.enable = row.enable
+ // this.dialogForm.description = row.description
+ // })
+ },
+ // 淇敼鍓嶈姹傛帴鍙�
+ async getViewDeviceCheckStanedSearch(checkstand_code) {
+ const { data: res } = await ViewDeviceCheckStanedSearch({ checkstand_code })
+ this.tableDataDialog = res.Data
+
+ this.dialogForm.code = res.code
+ this.dialogForm.name = res.name
+ this.dialogForm.enable = res.enable
+ this.dialogForm.description = res.description
+
+ this.tableDataDialog.forEach(item => {
+ item.isVisible = 0
+ item.repairitem_code = item.code
+ item.repairitem_name = item.name
+ item.repairitem_descr = item.chkdesc
+ })
+
+ this.repairItemSelectArr = [...this.repairItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.repairitem_code !== x.code))
+ },
+ // 鍒犻櫎鎸夐挳
+ async del(row) {
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ DeleteDeviceRepairStaned({ repairstand_code: row.code }).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍒犻櫎鎴愬姛!')
+ this.getDeviceRepairStandArdSearch()
+ }
+ })
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝垹闄�')
+ })
+ },
+
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogForm.code = ''
+ this.dialogForm.name = ''
+ this.dialogForm.enable = 'Y'
+ this.dialogForm.description = ''
+ this.tableDataDialog = []
+ this.getDeviceRepairItemSelect()
+ this.$refs.dialogForm.clearValidate()
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+ this.$refs.dialogForm.validate(valid => {
+ if (valid) {
+ this.tableDataDialog.filter(item => item.repairitem_code !== '')
+
+ let Data = []
+ // 鏁扮粍涓璞$浉鍚岀殑鍘婚噸
+ Data = this.tableDataDialog.filter((currentValue, currentIndex, selfArr) => {
+ return selfArr.findIndex(item => item.repairitem_code === currentValue.repairitem_code) === currentIndex
+ })
+ Data.forEach((item, index) => {
+ item.repairitem_seq = index + 1
+ })
+
+ const data = {
+ 'code': this.dialogForm.code,
+ 'name': this.dialogForm.name,
+ 'repaircycle': this.dialogForm.repaircycle,
+ 'description': this.dialogForm.description,
+ 'Data': Data
+ }
+
+ AddUpdateDeviceRepairStandArd(data, this.operation === 'add' ? 'Add' : 'Update').then(res => {
+ if (res.code === '200') {
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogVisible = false
+ this.getDeviceRepairStandArdSearch()
+ } else {
+ this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
+ }
+ })
+ },
+
+ selectChange(val, row) {
+ const res = this.repairItemSelectArr.find(item => {
+ return item.code === val || item.name === val
+ })
+ row.repairitem_descr = res.description
+ row.repairitem_code = res.code
+ row.repairitem_name = res.name
+ },
+ // 鏂板琛�
+ addRow() {
+ let flag = false
+ this.tableDataDialog.forEach(item => {
+ if (item.isVisible === 1) {
+ // return this.$message.info('璇峰厛纭鎴栧彇娑堜笂鏉¤褰曪紒')
+ flag = true
+ }
+ })
+ if (flag) {
+ return this.$message.info('璇峰厛纭鎴栧彇娑堜笂鏉¤褰曪紒')
+ }
+ this.tableDataDialog.push({
+ repairitem_code: '',
+ repairitem_name: '',
+ repairitem_descr: '',
+ isscan: 'Y',
+ isVisible: 1
+ })
+
+ this.repairItemIsCancel = false
+ },
+ editRow(row) {
+ let flag = false
+ this.tableDataDialog.forEach((item, index) => {
+ if (item.isVisible === 1) {
+ flag = true
+ }
+ })
+ if (flag) {
+ return this.$message.info('璇峰厛纭鎴栧彇娑堝叾瀹冭锛�')
+ }
+
+ this.repairItemIsCancel = false
+ this.repairItemSelectArr.splice(0, 0, {
+ code: row.repairitem_code,
+ name: row.repairitem_name,
+ description: row.repairitem_descr
+ })
+
+ this.tableDataDialog.forEach((item, index) => {
+ if (item.repairitem_code === row.repairitem_code) {
+ this.tableDataDialog.splice(index, 1, {
+ repairitem_code: row.repairitem_code,
+ repairitem_name: row.repairitem_name,
+ repairitem_descr: row.repairitem_descr,
+ isscan: row.isscan,
+ isVisible: 1
+ })
+ }
+ })
+ },
+ delRow(row) {
+ this.repairItemSelectArr.splice(0, 0, {
+ code: row.repairitem_code,
+ name: row.repairitem_name,
+ description: row.repairitem_descr
+ })
+ this.tableDataDialog.forEach((item, index) => {
+ if (item.repairitem_code === row.repairitem_code) {
+ this.tableDataDialog.splice(index, 1)
+ }
+ })
+ },
+ saveRow(row) {
+ if (row.repairitem_code === '' && row.repairitem_name === '') {
+ return this.$message.info('鐐规閮ㄤ綅涓嶈兘涓虹┖锛�')
+ }
+ row.isVisible = 0
+ this.repairItemSelectArr.forEach((item, index) => {
+ if (item.code === row.repairitem_code) {
+ this.repairItemSelectArr.splice(index, 1)
+ }
+ })
+ },
+ cancelRow(row) {
+ if (this.repairItemIsCancel) {
+ this.repairItemSelectArr.splice(0, 0, {
+ code: row.repairitem_code,
+ name: row.repairitem_name,
+ description: row.repairitem_descr
+ })
+ }
+ this.JYIsCancel = true
+
+ this.tableDataDialog.forEach((item, index) => {
+ if (item.repairitem_code === row.repairitem_code && item.isVisible === 1) {
+ row.isVisible = 0
+ this.tableDataDialog.splice(index, 1)
+ }
+ })
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 200
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ },
+ // 鍏宠仈璁惧
+ async checkeqpClick(row) {
+ this.dialogFormEqp.name = row.name
+ this.dialogFormEqp.code = row.code
+
+ const { data: res } = await DeviceRepairStanedAssociationEqp({ checkstand_code: row.code })
+ this.dialogFormEqp.eqpAll = res
+
+ if (this.dialogFormEqp.eqpAll.length > 0) {
+ this.dialogFormEqp.eqpAll.forEach((item, index) => {
+ this.dialogFormEqp.eqpArr.push({
+ code: item.code,
+ name: item.name,
+ type: item.type,
+ isSelected1: index === 0,
+ isSelected2: item.flag === 'Y'
+ })
+ if (item.flag === 'Y') {
+ this.$nextTick(() => {
+ $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+ })
+ }
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ if (it.flag === 'Y') {
+ this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
+ }
+ })
+ }
+ })
+ this.dialogFormEqp.eqpAll[0].name = '鍏ㄩ儴'
+ this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[0]]
+ }
+
+ this.dialogVisibleEqp = true
+
+ this.$nextTick(() => { // 鏍戝舰鍥炴樉
+ this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
+ })
+ },
+ // 鍏宠仈璁惧瀵硅瘽妗嗗叧闂�
+ handleCloseEqp() {
+ this.$refs.epqTree.setCheckedKeys([])
+ this.dialogFormEqp.code = ''
+ this.dialogFormEqp.name = ''
+ this.dialogFormEqp.eqpAll = []
+ this.dialogFormEqp.eqpArr = []
+ this.dialogFormEqp.eqpTree = []
+ this.dialogFormEqp.eqpCodeSelectedArr = []
+ },
+ // 澶х洅瀛愮偣鍑�
+ myCheckboxClick(val) {
+ this.dialogFormEqp.eqpArr.forEach((item, index) => {
+ item.isSelected1 = item.code === val.code
+ if (item.code === val.code) {
+ this.dialogFormEqp.eqpAll[index].name = '鍏ㄩ儴'
+ this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]]
+ }
+ })
+ },
+ // 灏忕洅瀛愮偣鍑�
+ myCheckboxInputClick(val) {
+ console.log(val)
+ val.isSelected2 = !val.isSelected2
+ if (val.isSelected2) { // 浠庢病閫変腑鍒伴�変腑
+ console.log('浠庢病閫変腑鍒伴�変腑')
+ this.dialogFormEqp.eqpAll.forEach((item, index) => {
+ if (item.code === val.code) {
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
+ })
+ }
+ }
+ })
+ console.log(this.dialogFormEqp.eqpCodeSelectedArr, 1)
+ this.$nextTick(() => { // 鏍戝舰鍥炴樉
+ this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
+ })
+ } else { // 浠庨�変腑鍒版病閫変腑
+ console.log('浠庨�変腑鍒版病閫変腑')
+ const temp = []
+ this.dialogFormEqp.eqpAll.forEach((item, index) => {
+ if (item.code === val.code) {
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ temp.push(it.code)
+ })
+ }
+ }
+ })
+ this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x))
+ this.$nextTick(() => { // 鏍戝舰鍥炴樉
+ this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
+ })
+ }
+ console.log(this.dialogFormEqp.eqpCodeSelectedArr, 999)
+ },
+ // 鏍戝舰澶嶉�夋鐐瑰嚮浜嬩欢
+ checkBoxClick(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) {
+ let checkedFatherCode = '' // 鎵惧埌 checkedFatherCode 鐖禼ode鍊�
+ console.log(obj, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys })
+ this.dialogFormEqp.eqpAll.forEach((item, index) => {
+ if (item.code === obj.code) {
+ checkedFatherCode = item.code
+ }
+ if (item.children && item.children.length > 0) {
+ item.children.forEach((it, ind) => {
+ if (it.code === obj.code) {
+ checkedFatherCode = item.code
+ }
+ })
+ }
+ })
+ console.log(checkedFatherCode, 1)
+
+ // 1.绗竴绉嶆儏鍐靛綋鏍戝舰 鍗婂彾 涓嶄负闆� 鍏ㄥ彾 涓嶄负闆�
+ if (halfCheckedKeys.length !== 0 && checkedKeys.length !== 0) {
+ console.log('// 1.绗竴绉嶆儏鍐靛綋鏍戝舰 鍗婂彾 涓嶄负闆� 鍏ㄥ彾 涓嶄负闆�')
+ this.dialogFormEqp.eqpArr.forEach((item, index) => {
+ if (item.code === checkedFatherCode) {
+ console.log(item.code, 777)
+ this.dialogFormEqp.eqpArr[index].isSelected2 = true
+ this.$nextTick(() => {
+ $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+ })
+ }
+ })
+ this.dialogFormEqp.eqpCodeSelectedArr.forEach((item, index) => {
+ if (item === obj.code) {
+ this.dialogFormEqp.eqpCodeSelectedArr.splice(index, 1)
+ }
+ })
+ checkedKeys.forEach(item => {
+ this.dialogFormEqp.eqpCodeSelectedArr.push(item)
+ })
+ this.dialogFormEqp.eqpCodeSelectedArr = [...new Set(this.dialogFormEqp.eqpCodeSelectedArr)]
+ }
+
+ // 2.绗簩绉嶆儏鍐靛綋鏍戝舰 鍗婂彾 涓洪浂 鍏ㄥ彾 涓洪浂
+ if (halfCheckedKeys.length === 0 && checkedKeys.length === 0) {
+ console.log('// 2.绗簩绉嶆儏鍐靛綋鏍戝舰 鍗婂彾 涓洪浂 鍏ㄥ彾 涓洪浂')
+ const temp = []
+ this.dialogFormEqp.eqpArr.forEach((item, index) => {
+ if (item.code === checkedFatherCode) {
+ this.dialogFormEqp.eqpArr[index].isSelected2 = false
+ this.$nextTick(() => {
+ $('input:checkbox').eq(index).prop('checked', false)// 鑷畾涔夊崟閫夋鍥炴樉
+ })
+ }
+ })
+ this.dialogFormEqp.eqpAll.forEach((item, index) => {
+ if (item.code === checkedFatherCode) {
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ temp.push(it.code)
+ })
+ }
+ }
+ })
+ this.dialogFormEqp.eqpCodeSelectedArr = [...this.dialogFormEqp.eqpCodeSelectedArr].filter(x => [...temp].every(y => y !== x))
+ }
+
+ // 3.绗笁绉嶇鎯呭喌褰撴爲褰� 鍗婂彾 涓洪浂 鍏ㄥ彾 涓嶄负闆�
+ if (halfCheckedKeys.length === 0 && checkedKeys.length !== 0) {
+ console.log('// 3.绗笁绉嶇鎯呭喌褰撴爲褰� 鍗婂彾 涓洪浂 鍏ㄥ彾 涓嶄负闆�')
+ this.dialogFormEqp.eqpArr.forEach((item, index) => {
+ if (item.code === checkedFatherCode) {
+ this.dialogFormEqp.eqpArr[index].isSelected2 = true
+ this.$nextTick(() => {
+ $('input:checkbox').eq(index).prop('checked', true)// 鑷畾涔夊崟閫夋鍥炴樉
+ })
+ }
+ })
+
+ this.dialogFormEqp.eqpAll.forEach((item, index) => {
+ if (item.code === checkedFatherCode) {
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ this.dialogFormEqp.eqpCodeSelectedArr.push(it.code)
+ })
+ }
+ }
+ })
+ }
+ },
+ // 鍙栨秷浜嬩欢
+ eqpDialogVisibleCancel() {
+ this.dialogVisibleEqp = false
+ },
+ // 纭浜嬩欢
+ eqpDialogVisibleConfirm() {
+ // console.log(this.dialogFormEqp.eqpCodeSelectedArr, 888)
+ // this.dialogVisibleEqp = false
+ const data = []
+ this.dialogFormEqp.eqpAll.forEach((item, index) => {
+ if (item.children && item.children.length > 0) {
+ item.children.forEach(it => {
+ if (this.dialogFormEqp.eqpCodeSelectedArr.includes(it.code)) {
+ data.push({
+ name: it.name,
+ code: it.code
+ })
+ }
+ })
+ }
+ })
+
+ SaveDeviceRepairStanedAssociationEqp(data, this.dialogFormEqp.code).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍏宠仈鎴愬姛锛�')
+ this.getDeviceRepairStandArdSearch()
+ this.dialogVisibleEqp = false
+ }
+ })
+ }
+ }
}
</script>
-<style scoped>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+.dialogVisibleEqp {
+ .myCheckboxGroup {
+ display: flex;
+ flex-wrap: wrap;
+
+ .myCheckbox {
+ //border: 1px solid $main_color;
+ border: 1px solid #eee;
+ display: flex;
+ min-width: 100px;
+ padding: 10px;
+ margin: 10px 30px 0 0;
+ border-radius: 5px;
+ cursor: default;
+
+ .myCheckboxInput {
+ margin: 1px 5px 0 0;
+ cursor: pointer;
+ }
+
+ }
+
+ //.myCheckbox{
+ // border: 1px solid $main_color;
+ //}
+
+ input[type=checkbox] {
+ cursor: pointer;
+ position: relative;
+ width: 14px;
+ height: 14px;
+ font-size: 14px;
+ }
+
+ input[type=checkbox]::after {
+ position: absolute;
+ top: 0;
+ //color: rgb(130, 35, 35);
+ color: $main_color;
+ width: 14px;
+ height: 14px;
+ display: inline-block;
+ visibility: visible;
+ padding-left: 0px;
+ text-align: center;
+ content: ' ';
+ border-radius: 3px
+ }
+
+ input[type=checkbox]:checked::after {
+ //content: "鉁�";
+ content: "鈭�";
+ color: #fff;
+ font-size: 12px;
+ font-weight: bold;
+ background-color: $main_color;
+ }
+ }
+}
+
+::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;
+//}
+::v-deep .el-dialog__body {
+ padding: 20px 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;
+}
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
</style>
diff --git a/src/views/sbgl/djbw.vue b/src/views/sbgl/djbw.vue
index 77b6130..6e03434 100644
--- a/src/views/sbgl/djbw.vue
+++ b/src/views/sbgl/djbw.vue
@@ -86,16 +86,28 @@
<el-table-column
prop="description"
label="鐐规瑕佹眰"
+ show-tooltip-when-overflow
sortable="custom"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.description">{{ row.description }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
<el-table-column
prop="isscan"
label="閫夋嫨鎵爜"
sortable="custom"
>
<template slot-scope="{row}">
- <div v-if="row.isscan==='Y'">鏄�</div>
- <div v-if="row.isscan==='N'">鍚�</div>
+ <div v-if="row.isscan==='Y'">
+ <svg-icon icon-class="circleYes" style="margin-right: 2px" />
+ 鏄�
+ </div>
+ <div v-if="row.isscan==='N'">
+ <svg-icon icon-class="circleNo" style="margin-right: 2px" />
+ 鍚�
+ </div>
</template>
</el-table-column>
<el-table-column
@@ -207,7 +219,14 @@
</el-dialog>
<!--瀵煎叆缁勪欢-->
- <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+ <import-picker
+ ref="importPickerFunc"
+ class="importPickerClass"
+ :shows.sync="shows"
+ :title="title_value"
+ :colos="colos"
+ :code="code"
+ />
</div>
</template>
@@ -268,7 +287,7 @@
checkitemname: '', // 璁惧鐐规閮ㄤ綅鍚嶇О
checkitemdescr: '', // 璁惧鐐规閮ㄤ綅瑕佹眰
cycle: 'D', // 璁惧鐐规閮ㄤ綅鍛ㄦ湡
- isqrcode: 'Y', // 鏄惁鎵爜
+ isqrcode: 'N', // 鏄惁鎵爜
OperType: '' // 鎿嶄綔绫诲瀷
},
operation: '',
@@ -353,7 +372,7 @@
this.$nextTick(() => {
this.dialogForm.id = row.id
this.dialogForm.cycle = row.cycle
- this.dialogForm.isscan = row.isqrcode
+ this.dialogForm.isqrcode = row.isscan
this.dialogForm.checkitemcode = row.code
this.dialogForm.checkitemname = row.name
this.dialogForm.checkitemdescr = row.description
@@ -383,7 +402,7 @@
this.dialogForm.checkitemname = ''
this.dialogForm.checkitemdescr = ''
this.dialogForm.cycle = 'D'
- this.dialogForm.isqrcode = 'Y'
+ this.dialogForm.isqrcode = 'N'
this.$refs.dialogForm.clearValidate()
},
// 瀵硅瘽妗嗗彇娑�
diff --git a/src/views/sbgl/djbz.vue b/src/views/sbgl/djbz.vue
index 2dc802b..e07d5f2 100644
--- a/src/views/sbgl/djbz.vue
+++ b/src/views/sbgl/djbz.vue
@@ -164,7 +164,7 @@
>
<!-- @close="handleClose"-->
<div>
- <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />璁惧鐐规鏍囧噯淇℃伅
+ <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />璁惧鐐规鏍囧噯淇℃伅锛�
</div>
<div style="margin: 0 30px;">
<el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
@@ -480,7 +480,7 @@
code: '',
name: '',
enable: 'Y',
- description: ''// 涓婄骇鍗曚綅
+ description: ''
},
operation: '',
dialogFormRules: {
@@ -529,19 +529,25 @@
}
},
created() {
- this.getDeviceCheckStandArdSearch()
+ this.handleRequest()
},
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
-
- this.getDeviceCheckItemSelect()
},
methods: {
+ handleRequest() {
+ this.getDeviceCheckStandArdSearch().then(res => {
+ if (res.code === '200') {
+ this.getDeviceCheckItemSelect()
+ }
+ })
+ },
async getDeviceCheckStandArdSearch() {
const res = await DeviceCheckStandArdSearch(this.form)
this.tableData = res.data
this.total = res.count
+ return { code: res.code }
},
// 鎺掑簭鏀瑰彉鏃�
sortChange({ column, prop, order }) {
diff --git a/src/views/scgl/gd.vue b/src/views/scgl/gd.vue
index e8a1a8a..3a0091c 100644
--- a/src/views/scgl/gd.vue
+++ b/src/views/scgl/gd.vue
@@ -1801,7 +1801,7 @@
// const number = Math.random() * Math.random()
// this.number = number === 0 ? (10 + Math.random()) : number
// console.log(number)
- this.dialogVisibleApprove = true
+
const data2 = {
username: getCookie('admin'),
mesordercode: this.dialogForm.mesordercode
@@ -1833,6 +1833,7 @@
})
}
})
+ this.dialogVisibleApprove = true
},
dialogVisibleTaskClose() {
this.dialogForm.mesordercode = ''
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 2641e18..236d360 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -1068,8 +1068,8 @@
/>
<el-table-column
prop="repair_qty"
- label="缁翠慨鏁伴噺"
- width="90"
+ label="缁翠慨鍚堟牸鏁伴噺"
+ width="110"
>
<template slot-scope="{row}">
<!-- {{ row.repair_qty }}-->
@@ -1624,7 +1624,7 @@
// 鐢熶骇鐝粍涓嬫媺鏀瑰彉
usergroupChange(val) {
this.dialogForm.usergroupcode = val
- this.getUserTableData()
+ this.getMesOrderSelectUserZZ2()
},
// 鑾峰彇鑷埗鎶ュ伐鐢熶骇鐝粍涓嬫媺鍒楄〃
async getMesOrderStepReportSelectUserGroup() {
@@ -1635,6 +1635,11 @@
async getMesOrderSelectUserZZ() {
const { data: res } = await MesOrderSelectUser({ usercode: this.dialogForm.usergroupcode })
this.ZZuserArr = res
+ },
+ async getMesOrderSelectUserZZ2() {
+ const { data: res } = await MesOrderSelectUser({ usercode: '' })
+ this.ZZuserArr = res
+ await this.getUserTableData()
},
// 鑾峰彇鑷埗鐢熶骇璁惧涓嬫媺
async getMesOrderStepStartSelectEqp() {
@@ -1673,6 +1678,8 @@
item.isVisible = 0
item.number = number
})
+
+ this.ZZuserArr = [...this.ZZuserArr].filter(x => [...this.userTableData].every(y => y.usercode !== x.usercode))
},
// 鐢ㄦ埛娣诲姞
userAdd() {
@@ -1683,6 +1690,11 @@
},
// 鐢ㄦ埛鍒楄〃鍒犻櫎
userDel(row) {
+ this.ZZuserArr.splice(0, 0, {
+ usercode: row.usercode,
+ username: row.username
+ })
+
this.userTableData.forEach((item, index) => {
if (item.number === row.number) {
this.userTableData.splice(index, 1)
@@ -1695,6 +1707,13 @@
if (row.usercode === '') {
return this.$message.info('浜哄憳鍚嶇О涓嶈兘涓虹┖锛�')
}
+
+ this.ZZuserArr.forEach((item, index) => {
+ if (item.usercode === row.usercode) {
+ this.ZZuserArr.splice(index, 1)
+ }
+ })
+
this.userTableData.forEach(item => {
if (item.number === row.number) {
item.isVisible = 0
--
Gitblit v1.9.3