|
@@ -37,7 +37,7 @@
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <template slot="deviceSlot" slot-scope="{ row }">
|
|
|
|
|
|
|
+ <!-- <template slot="deviceSlot" slot-scope="{ row }">
|
|
|
<ibps-custom-dialog
|
|
<ibps-custom-dialog
|
|
|
v-model="row.weiHuFangShi"
|
|
v-model="row.weiHuFangShi"
|
|
|
size="mini"
|
|
size="mini"
|
|
@@ -49,7 +49,7 @@
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
icon="el-icon-search"
|
|
icon="el-icon-search"
|
|
|
/>
|
|
/>
|
|
|
- </template>
|
|
|
|
|
|
|
+ </template> -->
|
|
|
|
|
|
|
|
<template slot="deviceStateSlot" slot-scope="{ row }">
|
|
<template slot="deviceStateSlot" slot-scope="{ row }">
|
|
|
<span>{{
|
|
<span>{{
|
|
@@ -466,7 +466,7 @@ export default {
|
|
|
mixins: [FixHeight],
|
|
mixins: [FixHeight],
|
|
|
data () {
|
|
data () {
|
|
|
const { userId, position } = this.$store.getters || {}
|
|
const { userId, position } = this.$store.getters || {}
|
|
|
- console.log(userId, position)
|
|
|
|
|
|
|
+ // console.log(userId, position)
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
filter: [
|
|
filter: [
|
|
@@ -595,7 +595,6 @@ export default {
|
|
|
icon: 'ibps-icon-sign-in',
|
|
icon: 'ibps-icon-sign-in',
|
|
|
type: 'primary'
|
|
type: 'primary'
|
|
|
},
|
|
},
|
|
|
- // { key: 'customSetting', label: '设置分组配置', icon: 'ibps-icon-cogs', type: 'info' },
|
|
|
|
|
{
|
|
{
|
|
|
key: 'customRemove',
|
|
key: 'customRemove',
|
|
|
label: '删除',
|
|
label: '删除',
|
|
@@ -622,12 +621,6 @@ export default {
|
|
|
prop: '',
|
|
prop: '',
|
|
|
label: '设备编号',
|
|
label: '设备编号',
|
|
|
fieldType: 'slot',
|
|
fieldType: 'slot',
|
|
|
- slotName: 'nowNumber'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: '',
|
|
|
|
|
- label: '原设备编号',
|
|
|
|
|
- fieldType: 'slot',
|
|
|
|
|
slotName: 'preNumber'
|
|
slotName: 'preNumber'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -636,12 +629,6 @@ export default {
|
|
|
fieldType: 'slot',
|
|
fieldType: 'slot',
|
|
|
slotName: 'deviceName'
|
|
slotName: 'deviceName'
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: '',
|
|
|
|
|
- label: '设备类型',
|
|
|
|
|
- fieldType: 'slot',
|
|
|
|
|
- slotName: 'deviceType'
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
prop: '',
|
|
prop: '',
|
|
|
label: '设备状态',
|
|
label: '设备状态',
|
|
@@ -653,13 +640,6 @@ export default {
|
|
|
label: '放置地点',
|
|
label: '放置地点',
|
|
|
fieldType: 'slot',
|
|
fieldType: 'slot',
|
|
|
slotName: 'place'
|
|
slotName: 'place'
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- prop: '',
|
|
|
|
|
- label: '设备分组',
|
|
|
|
|
- fieldType: 'slot',
|
|
|
|
|
- slotName: 'deviceClass'
|
|
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
@@ -677,14 +657,10 @@ export default {
|
|
|
label: '建档时间',
|
|
label: '建档时间',
|
|
|
sortable: true
|
|
sortable: true
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'sheBeiShiBieH',
|
|
|
|
|
- label: '设备编号',
|
|
|
|
|
- sortable: true
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
prop: 'yuanSheBeiBian',
|
|
prop: 'yuanSheBeiBian',
|
|
|
- label: '原设备编号',
|
|
|
|
|
|
|
+ label: '设备编号',
|
|
|
sortable: true
|
|
sortable: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -692,11 +668,7 @@ export default {
|
|
|
label: '设备名称',
|
|
label: '设备名称',
|
|
|
sortable: true
|
|
sortable: true
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'sheBeiLeiXing',
|
|
|
|
|
- label: '设备类型',
|
|
|
|
|
- sortable: true
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
{ prop: 'guiGeXingHao', label: '规格型号', sortable: true },
|
|
{ prop: 'guiGeXingHao', label: '规格型号', sortable: true },
|
|
|
{
|
|
{
|
|
|
prop: 'sheBeiZhuangTa',
|
|
prop: 'sheBeiZhuangTa',
|
|
@@ -706,16 +678,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'guanLiRen',
|
|
prop: 'guanLiRen',
|
|
|
- label: '保管人',
|
|
|
|
|
|
|
+ label: '负责人',
|
|
|
slotName: 'userSlot',
|
|
slotName: 'userSlot',
|
|
|
sortable: true
|
|
sortable: true
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'weiHuFangShi',
|
|
|
|
|
- label: '设备分组',
|
|
|
|
|
- slotName: 'deviceSlot',
|
|
|
|
|
- sortable: true
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
prop: 'cunFangWeiZhi',
|
|
prop: 'cunFangWeiZhi',
|
|
|
label: '放置地点',
|
|
label: '放置地点',
|
|
@@ -740,47 +707,37 @@ export default {
|
|
|
deviceColumns: {
|
|
deviceColumns: {
|
|
|
bianZhiBuMen: '部门',
|
|
bianZhiBuMen: '部门',
|
|
|
sheBeiMingCheng: '设备名称',
|
|
sheBeiMingCheng: '设备名称',
|
|
|
- // sheBeiShiBieH: '设备编号(导入无需填写)',
|
|
|
|
|
- yuanSheBeiBian: '原设备编号(必填,且不可重复)',
|
|
|
|
|
|
|
+ yuanSheBeiBian: '设备编号(必填,且不可重复)',
|
|
|
|
|
+ ziChanBianHao: '资产编号',
|
|
|
sheBeiZhuangTa: '设备状态(正常/停用/限用)',
|
|
sheBeiZhuangTa: '设备状态(正常/停用/限用)',
|
|
|
- sheBeiLeiXing: '设备类型(检验系统/通用设备/软件/信息系统)',
|
|
|
|
|
shiFouWeiHu: '是否维护(是/否)',
|
|
shiFouWeiHu: '是否维护(是/否)',
|
|
|
- shiFouXiaoZhun: '是否校准(是/否)',
|
|
|
|
|
- weiHuFangShi: '设备分组',
|
|
|
|
|
guiGeXingHao: '规格型号',
|
|
guiGeXingHao: '规格型号',
|
|
|
cunFangDiDian: '存放地点(格式:房间号+空格+房间名)',
|
|
cunFangDiDian: '存放地点(格式:房间号+空格+房间名)',
|
|
|
- guanLiRen: '保管人',
|
|
|
|
|
- ziChanBianHao: '资产编号',
|
|
|
|
|
|
|
+ guanLiRen: '负责人',
|
|
|
shiFouQiJianH: '供应商',
|
|
shiFouQiJianH: '供应商',
|
|
|
lianXiFangShi: '联系方式',
|
|
lianXiFangShi: '联系方式',
|
|
|
changShang: '厂商',
|
|
changShang: '厂商',
|
|
|
jiShenXuHao: '机身序号',
|
|
jiShenXuHao: '机身序号',
|
|
|
- zhuCeZhengHao: '注册证号',
|
|
|
|
|
|
|
+ heChaXiaoZhun: '使用年限(年)',
|
|
|
chuChangRiQi: '出厂日期',
|
|
chuChangRiQi: '出厂日期',
|
|
|
- yanShouRiQi: '验收日期',
|
|
|
|
|
jieShouRiQi: '接收日期',
|
|
jieShouRiQi: '接收日期',
|
|
|
- qiYongRiQi: '投入日期',
|
|
|
|
|
- yiXiaoRiQi: '已校日期',
|
|
|
|
|
|
|
+ yanShouRiQi: '验收日期',
|
|
|
|
|
+ qiYongRiQi: '启用日期',
|
|
|
|
|
+ shiFouXiaoZhun: '是否检定/校准(是/否)',
|
|
|
|
|
+ yiXiaoRiQi: '上次检定/校准日期',
|
|
|
xiaoZhunZQ: '检定/校准周期(以月为单位)',
|
|
xiaoZhunZQ: '检定/校准周期(以月为单位)',
|
|
|
- xiaoZhunYouXia: '校准有效期至',
|
|
|
|
|
|
|
+ xiaoZhunYouXia: '检定/校准有效期至',
|
|
|
shiYongKeShi: '检定/校准单位',
|
|
shiYongKeShi: '检定/校准单位',
|
|
|
- ceLiangGongZuo: '测量/工作范围',
|
|
|
|
|
|
|
+ ceLiangGongZuo: '预期测量范围',
|
|
|
|
|
+ jianDingXiao: '检定/校准参数',
|
|
|
|
|
+ zuiDaYunCha: 'U/准确度/最大允差',
|
|
|
huanJingYaoQiu: '环境要求',
|
|
huanJingYaoQiu: '环境要求',
|
|
|
dianYuanYaoQiu: '电源要求',
|
|
dianYuanYaoQiu: '电源要求',
|
|
|
jieShouZhuangTai: '接收时状态(新设备/二手或翻新设备)',
|
|
jieShouZhuangTai: '接收时状态(新设备/二手或翻新设备)',
|
|
|
- jianDingXiao: '检定/校准参数',
|
|
|
|
|
- zuiDaYunCha: 'U/精确度/最大允差',
|
|
|
|
|
- zhengShuBianHa: '证书编号',
|
|
|
|
|
- xiuZhengZhiXiu: '修正值/修正因子',
|
|
|
|
|
- wenDuYingYong: '温度应用修正值',
|
|
|
|
|
- shiDuYingYong: '湿度应用修正值',
|
|
|
|
|
- biXuDeHuanJin: '核查人',
|
|
|
|
|
- biXuSheShi: '核查日期',
|
|
|
|
|
- heChaXiaoZhun: '使用年限(年)',
|
|
|
|
|
- jiShuCanShu: '计算参数'
|
|
|
|
|
|
|
+ zhengShuBianHa: '检定/校准证书编号'
|
|
|
},
|
|
},
|
|
|
projectColums: {
|
|
projectColums: {
|
|
|
- yuanSheBeiBian: '原设备编号*',
|
|
|
|
|
|
|
+ yuanSheBeiBian: '设备编号*',
|
|
|
sheBeiMingCheng: '设备名称*',
|
|
sheBeiMingCheng: '设备名称*',
|
|
|
weiHuLeiXing:
|
|
weiHuLeiXing:
|
|
|
'维护类型*(日保养/周保养/月保养/季度保养/半年保养/年保养/按需保养)',
|
|
'维护类型*(日保养/周保养/月保养/季度保养/半年保养/年保养/按需保养)',
|
|
@@ -799,9 +756,9 @@ export default {
|
|
|
requiredFieldMap: {
|
|
requiredFieldMap: {
|
|
|
bianZhiBuMen: '部门',
|
|
bianZhiBuMen: '部门',
|
|
|
sheBeiMingCheng: '设备名称',
|
|
sheBeiMingCheng: '设备名称',
|
|
|
- yuanSheBeiBian: '原设备编号',
|
|
|
|
|
|
|
+ yuanSheBeiBian: '设备编号',
|
|
|
sheBeiZhuangTa: '设备状态',
|
|
sheBeiZhuangTa: '设备状态',
|
|
|
- sheBeiLeiXing: '设备类型',
|
|
|
|
|
|
|
+ // sheBeiLeiXing: '设备类型',
|
|
|
shiFouWeiHu: '是否维护',
|
|
shiFouWeiHu: '是否维护',
|
|
|
shiFouXiaoZhun: '是否校准'
|
|
shiFouXiaoZhun: '是否校准'
|
|
|
},
|
|
},
|
|
@@ -841,7 +798,7 @@ export default {
|
|
|
heChaXiaoZhun: '使用年限(年)'
|
|
heChaXiaoZhun: '使用年限(年)'
|
|
|
},
|
|
},
|
|
|
maintenanceRequiredFieldMap: {
|
|
maintenanceRequiredFieldMap: {
|
|
|
- yuanSheBeiBian: '原设备编号',
|
|
|
|
|
|
|
+ yuanSheBeiBian: '设备编号',
|
|
|
sheBeiMingCheng: '设备名称',
|
|
sheBeiMingCheng: '设备名称',
|
|
|
weiHuLeiXing: '维护类型',
|
|
weiHuLeiXing: '维护类型',
|
|
|
weiHuRiQi: '维护日期',
|
|
weiHuRiQi: '维护日期',
|
|
@@ -876,7 +833,7 @@ export default {
|
|
|
async mounted () {
|
|
async mounted () {
|
|
|
const stateList = await getSetting('device', 'stateList')
|
|
const stateList = await getSetting('device', 'stateList')
|
|
|
if (stateList) {
|
|
if (stateList) {
|
|
|
- console.debug(stateList)
|
|
|
|
|
|
|
+ // console.debug(stateList)
|
|
|
this.stateList = stateList
|
|
this.stateList = stateList
|
|
|
}
|
|
}
|
|
|
this.getDatas()
|
|
this.getDatas()
|
|
@@ -940,7 +897,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
parameters.parameters.push(obj)
|
|
parameters.parameters.push(obj)
|
|
|
}
|
|
}
|
|
|
- // 原设备编号搜索
|
|
|
|
|
|
|
+ // 设备编号搜索
|
|
|
if (this.search.preNumber) {
|
|
if (this.search.preNumber) {
|
|
|
const obj = { relation: 'AND', parameters: [] }
|
|
const obj = { relation: 'AND', parameters: [] }
|
|
|
obj.parameters.push({
|
|
obj.parameters.push({
|
|
@@ -990,7 +947,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
parameters.parameters.push(obj)
|
|
parameters.parameters.push(obj)
|
|
|
}
|
|
}
|
|
|
- // 保管人搜索(可多选)
|
|
|
|
|
|
|
+ // 负责人搜索(可多选)
|
|
|
if (this.search.managePeople) {
|
|
if (this.search.managePeople) {
|
|
|
const obj = { relation: 'OR', parameters: [] }
|
|
const obj = { relation: 'OR', parameters: [] }
|
|
|
this.search.managePeople.split(',').forEach((item) => {
|
|
this.search.managePeople.split(',').forEach((item) => {
|
|
@@ -1130,7 +1087,7 @@ export default {
|
|
|
this.getDatas()
|
|
this.getDatas()
|
|
|
},
|
|
},
|
|
|
goEdit (row) {
|
|
goEdit (row) {
|
|
|
- console.log('aa')
|
|
|
|
|
|
|
+ // console.log('aa')
|
|
|
|
|
|
|
|
this.params = row
|
|
this.params = row
|
|
|
this.deviceDialogShow = true
|
|
this.deviceDialogShow = true
|
|
@@ -1139,7 +1096,7 @@ export default {
|
|
|
this.customDialogVisible = true
|
|
this.customDialogVisible = true
|
|
|
},
|
|
},
|
|
|
handleCustomRemove (selection) {
|
|
handleCustomRemove (selection) {
|
|
|
- console.log('selection', selection)
|
|
|
|
|
|
|
+ // console.log('selection', selection)
|
|
|
if (!selection || selection.length === 0) {
|
|
if (!selection || selection.length === 0) {
|
|
|
return this.$message.warning('请选择要删除的数据!')
|
|
return this.$message.warning('请选择要删除的数据!')
|
|
|
}
|
|
}
|
|
@@ -1219,12 +1176,12 @@ export default {
|
|
|
// 导入设备
|
|
// 导入设备
|
|
|
ImportDevice () {
|
|
ImportDevice () {
|
|
|
this.$refs.file1.click()
|
|
this.$refs.file1.click()
|
|
|
- console.log('导入设备')
|
|
|
|
|
|
|
+ // console.log('导入设备')
|
|
|
},
|
|
},
|
|
|
// 导入维护项目
|
|
// 导入维护项目
|
|
|
ImportProject () {
|
|
ImportProject () {
|
|
|
this.$refs.file2.click()
|
|
this.$refs.file2.click()
|
|
|
- console.log('导入维护项目')
|
|
|
|
|
|
|
+ // console.log('导入维护项目')
|
|
|
},
|
|
},
|
|
|
getTimeStamp () {
|
|
getTimeStamp () {
|
|
|
return dayjs().format('YYYYMMDDHHmmss')
|
|
return dayjs().format('YYYYMMDDHHmmss')
|
|
@@ -1294,13 +1251,13 @@ export default {
|
|
|
item.guanLiRen = this.switchIdToUserName(
|
|
item.guanLiRen = this.switchIdToUserName(
|
|
|
item.guanLiRen.split(',')[0]
|
|
item.guanLiRen.split(',')[0]
|
|
|
)
|
|
)
|
|
|
- item.biXuDeHuanJin = this.switchIdToUserName(
|
|
|
|
|
- item.biXuDeHuanJin.split(',')[0]
|
|
|
|
|
- )
|
|
|
|
|
- item.weiHuFangShi = this.switchDeviceIdToName(
|
|
|
|
|
- item.weiHuFangShi,
|
|
|
|
|
- deviceGroupData
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ // item.biXuDeHuanJin = this.switchIdToUserName(
|
|
|
|
|
+ // item.biXuDeHuanJin.split(',')[0]
|
|
|
|
|
+ // )
|
|
|
|
|
+ // item.weiHuFangShi = this.switchDeviceIdToName(
|
|
|
|
|
+ // item.weiHuFangShi,
|
|
|
|
|
+ // deviceGroupData
|
|
|
|
|
+ // )
|
|
|
// item.shiYongKeShi = this.switchGYSIdToName(item.shiYongKeShi, gysData)
|
|
// item.shiYongKeShi = this.switchGYSIdToName(item.shiYongKeShi, gysData)
|
|
|
if (this.stateList[item.sheBeiZhuangTa]) {
|
|
if (this.stateList[item.sheBeiZhuangTa]) {
|
|
|
item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
|
|
item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
|
|
@@ -1364,7 +1321,7 @@ export default {
|
|
|
// 导出维护项目
|
|
// 导出维护项目
|
|
|
async ExportProject (selection = []) {
|
|
async ExportProject (selection = []) {
|
|
|
let exportData = []
|
|
let exportData = []
|
|
|
- console.log('导出维护项目')
|
|
|
|
|
|
|
+ // console.log('导出维护项目')
|
|
|
if (selection.length > 0) {
|
|
if (selection.length > 0) {
|
|
|
const sql = `select b.yuan_she_bei_bian as yuanSheBeiBian,b.she_bei_ming_cheng_ as sheBeiMingCheng,a.parent_id_,a.wei_hu_xiang_mu_c as weiHuXiangMuC,a.wei_hu_ri_qi_ as weiHuRiQi,a.wei_hu_lei_xing_ as weiHuLeiXing,a.ri_qi_shu_zi_ as riQiShuZi from t_whzqjxm a,t_sbdj b where a.parent_id_=b.id_ and a.parent_id_ in (${selection
|
|
const sql = `select b.yuan_she_bei_bian as yuanSheBeiBian,b.she_bei_ming_cheng_ as sheBeiMingCheng,a.parent_id_,a.wei_hu_xiang_mu_c as weiHuXiangMuC,a.wei_hu_ri_qi_ as weiHuRiQi,a.wei_hu_lei_xing_ as weiHuLeiXing,a.ri_qi_shu_zi_ as riQiShuZi from t_whzqjxm a,t_sbdj b where a.parent_id_=b.id_ and a.parent_id_ in (${selection
|
|
|
.map((i) => `'${i}'`)
|
|
.map((i) => `'${i}'`)
|
|
@@ -1432,7 +1389,7 @@ export default {
|
|
|
item.weiHuLeiXing === '按需保养' &&
|
|
item.weiHuLeiXing === '按需保养' &&
|
|
|
field === 'weiHuRiQi'
|
|
field === 'weiHuRiQi'
|
|
|
) {
|
|
) {
|
|
|
- console.log('按需pass1')
|
|
|
|
|
|
|
+ // console.log('按需pass1')
|
|
|
} else {
|
|
} else {
|
|
|
if (!item[field]) {
|
|
if (!item[field]) {
|
|
|
invalidFieldNames.push(name)
|
|
invalidFieldNames.push(name)
|
|
@@ -1454,12 +1411,12 @@ export default {
|
|
|
if (allResult.length < 1) {
|
|
if (allResult.length < 1) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- console.log(
|
|
|
|
|
- '%c Msg Obj %c',
|
|
|
|
|
- 'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
|
|
|
|
|
- 'background:transparent',
|
|
|
|
|
- allResult
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ // console.log(
|
|
|
|
|
+ // '%c Msg Obj %c',
|
|
|
|
|
+ // 'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;',
|
|
|
|
|
+ // 'background:transparent',
|
|
|
|
|
+ // allResult
|
|
|
|
|
+ // )
|
|
|
const item = allResult[0]
|
|
const item = allResult[0]
|
|
|
switch (mark) {
|
|
switch (mark) {
|
|
|
case 'required':
|
|
case 'required':
|
|
@@ -1520,7 +1477,7 @@ export default {
|
|
|
const row = list[i]
|
|
const row = list[i]
|
|
|
for (const field in this.dateFieldsMap) {
|
|
for (const field in this.dateFieldsMap) {
|
|
|
if (row[field] && !dateRegex.test(row[field])) {
|
|
if (row[field] && !dateRegex.test(row[field])) {
|
|
|
- console.error('error field:', row[field])
|
|
|
|
|
|
|
+ // console.error('error field:', row[field])
|
|
|
return [
|
|
return [
|
|
|
{ row: i + 2, field: this.dateFieldsMap[field] }
|
|
{ row: i + 2, field: this.dateFieldsMap[field] }
|
|
|
]
|
|
]
|
|
@@ -1544,7 +1501,7 @@ export default {
|
|
|
if (indices.length > 1) {
|
|
if (indices.length > 1) {
|
|
|
return [
|
|
return [
|
|
|
{
|
|
{
|
|
|
- field: `发现重复的原设备编号:${key} 在第 ${indices.join(
|
|
|
|
|
|
|
+ field: `发现重复的设备编号:${key} 在第 ${indices.join(
|
|
|
', '
|
|
', '
|
|
|
)} 行`
|
|
)} 行`
|
|
|
}
|
|
}
|
|
@@ -1580,7 +1537,7 @@ export default {
|
|
|
this.sendWarningMessages(dateResult, 'dateFormat')
|
|
this.sendWarningMessages(dateResult, 'dateFormat')
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
- // 校验是否存在重复的原设备编号
|
|
|
|
|
|
|
+ // 校验是否存在重复的设备编号
|
|
|
const duplicateOriginalDeviceResult =
|
|
const duplicateOriginalDeviceResult =
|
|
|
this.checkDuplicateOriginalDeviceNo(data)
|
|
this.checkDuplicateOriginalDeviceNo(data)
|
|
|
if (duplicateOriginalDeviceResult.length > 0) {
|
|
if (duplicateOriginalDeviceResult.length > 0) {
|
|
@@ -1620,7 +1577,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
- * 过滤出来excel 的原设备编号存在当前数据库中的数据
|
|
|
|
|
|
|
+ * 过滤出来excel 的设备编号存在当前数据库中的数据
|
|
|
* @param {*} list 导入的数据
|
|
* @param {*} list 导入的数据
|
|
|
*/
|
|
*/
|
|
|
async filterOriginalDeviceNo (list) {
|
|
async filterOriginalDeviceNo (list) {
|
|
@@ -1660,6 +1617,7 @@ export default {
|
|
|
deptList
|
|
deptList
|
|
|
) {
|
|
) {
|
|
|
// 使用map生成一个异步操作的数组
|
|
// 使用map生成一个异步操作的数组
|
|
|
|
|
+
|
|
|
const promises = list.map(async (element) => {
|
|
const promises = list.map(async (element) => {
|
|
|
element.bianZhiShiJian = currentTime
|
|
element.bianZhiShiJian = currentTime
|
|
|
element.bianZhiRen = currentUser
|
|
element.bianZhiRen = currentUser
|
|
@@ -1693,7 +1651,7 @@ export default {
|
|
|
// this.handleSupplierInfo(list, supplierList)
|
|
// this.handleSupplierInfo(list, supplierList)
|
|
|
this.handlePositionInfo(list, positionList)
|
|
this.handlePositionInfo(list, positionList)
|
|
|
this.handlePersonInfo(list, employeeList)
|
|
this.handlePersonInfo(list, employeeList)
|
|
|
- this.handleDeviceGroupInfo(list, deviceGroupList)
|
|
|
|
|
|
|
+ // this.handleDeviceGroupInfo(list, deviceGroupList)
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
*
|
|
*
|
|
@@ -1759,7 +1717,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
handlePersonInfo (list, employeeList) {
|
|
handlePersonInfo (list, employeeList) {
|
|
|
list.forEach((element) => {
|
|
list.forEach((element) => {
|
|
|
- // 处理保管人
|
|
|
|
|
|
|
+ // 处理负责人
|
|
|
if (element.guanLiRen !== '') {
|
|
if (element.guanLiRen !== '') {
|
|
|
const person = employeeList.find(
|
|
const person = employeeList.find(
|
|
|
(i) => i.userName === element.guanLiRen.trim()
|
|
(i) => i.userName === element.guanLiRen.trim()
|
|
@@ -1774,36 +1732,36 @@ export default {
|
|
|
element.guanLiRen = ''
|
|
element.guanLiRen = ''
|
|
|
}
|
|
}
|
|
|
// 处理核查人
|
|
// 处理核查人
|
|
|
- if (element.biXuDeHuanJin !== '') {
|
|
|
|
|
- const checkPerson = employeeList.find(
|
|
|
|
|
- (i) => i.userName === element.biXuDeHuanJin.trim()
|
|
|
|
|
- )
|
|
|
|
|
- if (checkPerson) {
|
|
|
|
|
- const checkPersonId = checkPerson.userId
|
|
|
|
|
- element.biXuDeHuanJin = checkPersonId
|
|
|
|
|
- } else {
|
|
|
|
|
- element.biXuDeHuanJin = ''
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- element.biXuDeHuanJin = ''
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- handleDeviceGroupInfo (list, deviceGroupList) {
|
|
|
|
|
- list.forEach((element) => {
|
|
|
|
|
- const result = []
|
|
|
|
|
- const { weiHuFangShi } = element
|
|
|
|
|
- const valList = weiHuFangShi.trim()?.split(',')
|
|
|
|
|
- valList.forEach((item) =>
|
|
|
|
|
- result.push(
|
|
|
|
|
- deviceGroupList?.find(
|
|
|
|
|
- (i) => i.wei_hu_gang_wei_ === item
|
|
|
|
|
- )?.id_ || ''
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
- element.weiHuFangShi = result.join(',')
|
|
|
|
|
|
|
+ // if (element.biXuDeHuanJin !== '') {
|
|
|
|
|
+ // const checkPerson = employeeList.find(
|
|
|
|
|
+ // (i) => i.userName === element.biXuDeHuanJin.trim()
|
|
|
|
|
+ // )
|
|
|
|
|
+ // if (checkPerson) {
|
|
|
|
|
+ // const checkPersonId = checkPerson.userId
|
|
|
|
|
+ // element.biXuDeHuanJin = checkPersonId
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // element.biXuDeHuanJin = ''
|
|
|
|
|
+ // }
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // element.biXuDeHuanJin = ''
|
|
|
|
|
+ // }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // handleDeviceGroupInfo (list, deviceGroupList) {
|
|
|
|
|
+ // list.forEach((element) => {
|
|
|
|
|
+ // const result = []
|
|
|
|
|
+ // const { weiHuFangShi } = element
|
|
|
|
|
+ // const valList = weiHuFangShi.trim()?.split(',')
|
|
|
|
|
+ // valList.forEach((item) =>
|
|
|
|
|
+ // result.push(
|
|
|
|
|
+ // deviceGroupList?.find(
|
|
|
|
|
+ // (i) => i.wei_hu_gang_wei_ === item
|
|
|
|
|
+ // )?.id_ || ''
|
|
|
|
|
+ // )
|
|
|
|
|
+ // )
|
|
|
|
|
+ // element.weiHuFangShi = result.join(',')
|
|
|
|
|
+ // })
|
|
|
|
|
+ // },
|
|
|
async handleUploadChange1 (file) {
|
|
async handleUploadChange1 (file) {
|
|
|
const dataBinary = await this.readFile(file.target.files[0])
|
|
const dataBinary = await this.readFile(file.target.files[0])
|
|
|
file.target.value = null // 注意上传后要将input的值设为空
|
|
file.target.value = null // 注意上传后要将input的值设为空
|
|
@@ -1848,7 +1806,7 @@ export default {
|
|
|
const { data: positionList = [] } = res1.variables || {}
|
|
const { data: positionList = [] } = res1.variables || {}
|
|
|
// const { data: supplierList = [] } = res2.variables || {}
|
|
// const { data: supplierList = [] } = res2.variables || {}
|
|
|
const { data: deviceGroupList = [] } = res3.variables || {}
|
|
const { data: deviceGroupList = [] } = res3.variables || {}
|
|
|
- // 根据原设备编号去重,检验原设备编号是否在数据库中存在
|
|
|
|
|
|
|
+ // 根据设备编号去重,检验设备编号是否在数据库中存在
|
|
|
const originalDeviceNoList =
|
|
const originalDeviceNoList =
|
|
|
await this.filterOriginalDeviceNo(importData)
|
|
await this.filterOriginalDeviceNo(importData)
|
|
|
await this.handleBasicData(
|
|
await this.handleBasicData(
|
|
@@ -1864,6 +1822,7 @@ export default {
|
|
|
userList,
|
|
userList,
|
|
|
deviceGroupList
|
|
deviceGroupList
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
// 分离出 已存在的设备,和新设备
|
|
// 分离出 已存在的设备,和新设备
|
|
|
const newDeviceList = importData.filter(
|
|
const newDeviceList = importData.filter(
|
|
|
(i) =>
|
|
(i) =>
|
|
@@ -1922,7 +1881,7 @@ export default {
|
|
|
allRequests.push(saveEquipmentCard(params))
|
|
allRequests.push(saveEquipmentCard(params))
|
|
|
}
|
|
}
|
|
|
// 等待所有异步请求完成
|
|
// 等待所有异步请求完成
|
|
|
- console.log(allRequests, '000')
|
|
|
|
|
|
|
+ // console.log(allRequests, '000')
|
|
|
|
|
|
|
|
await Promise.all(allRequests)
|
|
await Promise.all(allRequests)
|
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -2007,7 +1966,7 @@ export default {
|
|
|
list.forEach(
|
|
list.forEach(
|
|
|
({ weiHuLeiXing: type, weiHuRiQi: exactDate }, index) => {
|
|
({ weiHuLeiXing: type, weiHuRiQi: exactDate }, index) => {
|
|
|
if (type === '按需保养') {
|
|
if (type === '按需保养') {
|
|
|
- console.log('按需pass2')
|
|
|
|
|
|
|
+ // console.log('按需pass2')
|
|
|
} else {
|
|
} else {
|
|
|
if (!rules[type].includes(exactDate)) {
|
|
if (!rules[type].includes(exactDate)) {
|
|
|
msgList.push({
|
|
msgList.push({
|
|
@@ -2031,7 +1990,7 @@ export default {
|
|
|
const workSheet = workBook.Sheets[workBook.SheetNames[0]]
|
|
const workSheet = workBook.Sheets[workBook.SheetNames[0]]
|
|
|
const data = xlsx.utils.sheet_to_json(workSheet)
|
|
const data = xlsx.utils.sheet_to_json(workSheet)
|
|
|
const importData = this.switchDeviceObj(data, this.projectColums)
|
|
const importData = this.switchDeviceObj(data, this.projectColums)
|
|
|
- console.log(importData)
|
|
|
|
|
|
|
+ // console.log(importData)
|
|
|
importData.forEach((item) => {
|
|
importData.forEach((item) => {
|
|
|
if (item.weiHuLeiXing === '按需保养') {
|
|
if (item.weiHuLeiXing === '按需保养') {
|
|
|
item.weiHuRiQi = '/'
|
|
item.weiHuRiQi = '/'
|
|
@@ -2050,7 +2009,7 @@ export default {
|
|
|
this.maintenanceInvalidPartOne(importData)
|
|
this.maintenanceInvalidPartOne(importData)
|
|
|
if (!partOneInvalidResult) return
|
|
if (!partOneInvalidResult) return
|
|
|
|
|
|
|
|
- // 2、根据原设备编号去重,检验原设备编号是否在数据库中存在,如有不存在的数据,不进行导入,并提示用户
|
|
|
|
|
|
|
+ // 2、根据设备编号去重,检验设备编号是否在数据库中存在,如有不存在的数据,不进行导入,并提示用户
|
|
|
const uniqueArr = Array.from(
|
|
const uniqueArr = Array.from(
|
|
|
new Set(importData.map((i) => i.yuanSheBeiBian.trim()))
|
|
new Set(importData.map((i) => i.yuanSheBeiBian.trim()))
|
|
|
)
|
|
)
|
|
@@ -2060,7 +2019,7 @@ export default {
|
|
|
)}')`
|
|
)}')`
|
|
|
this.$common.request('sql', sql).then(async (res) => {
|
|
this.$common.request('sql', sql).then(async (res) => {
|
|
|
const deviceNoWithIdlist = res.variables.data
|
|
const deviceNoWithIdlist = res.variables.data
|
|
|
- console.log(deviceNoWithIdlist, ' <=> ', uniqueArr)
|
|
|
|
|
|
|
+ // console.log(deviceNoWithIdlist, ' <=> ', uniqueArr)
|
|
|
const deviceNoSet = new Set(
|
|
const deviceNoSet = new Set(
|
|
|
deviceNoWithIdlist.map((i) => i.yuan_she_bei_bian)
|
|
deviceNoWithIdlist.map((i) => i.yuan_she_bei_bian)
|
|
|
)
|
|
)
|
|
@@ -2069,7 +2028,7 @@ export default {
|
|
|
''
|
|
''
|
|
|
if (missStr !== '') {
|
|
if (missStr !== '') {
|
|
|
this.$message.error(
|
|
this.$message.error(
|
|
|
- `设备维护项目数据中包含不存在于设备档案的原设备编号!具体原设备编号为:${missStr}`
|
|
|
|
|
|
|
+ `设备维护项目数据中包含不存在于设备档案的设备编号!具体设备编号为:${missStr}`
|
|
|
)
|
|
)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -2138,7 +2097,7 @@ export default {
|
|
|
maintenanceItemPoList: temp
|
|
maintenanceItemPoList: temp
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- console.log('params', params)
|
|
|
|
|
|
|
+ // console.log('params', params)
|
|
|
allRequests.push(saveEquipmentCard(params))
|
|
allRequests.push(saveEquipmentCard(params))
|
|
|
})
|
|
})
|
|
|
await Promise.all(allRequests)
|
|
await Promise.all(allRequests)
|