|
|
@@ -26,7 +26,7 @@
|
|
|
>
|
|
|
<ibps-user-selector
|
|
|
v-model="row.bianZhiBuMen"
|
|
|
- type="position"
|
|
|
+ type="org"
|
|
|
readonly-text="text"
|
|
|
:multiple="true"
|
|
|
:disabled="true"
|
|
|
@@ -54,7 +54,7 @@
|
|
|
<ibps-custom-dialog
|
|
|
v-model="row.weiHuFangShi"
|
|
|
size="mini"
|
|
|
- template-key="sbbqdhk"
|
|
|
+ template-key="sbfzpz"
|
|
|
multiple
|
|
|
:disabled="true"
|
|
|
type="dialog"
|
|
|
@@ -79,7 +79,7 @@
|
|
|
<ibps-custom-dialog
|
|
|
v-model="row.cunFangWeiZhi"
|
|
|
size="mini"
|
|
|
- template-key="fjxzkdd"
|
|
|
+ template-key="fjwzdhk"
|
|
|
multiple
|
|
|
:disabled="true"
|
|
|
type="dialog"
|
|
|
@@ -154,7 +154,7 @@
|
|
|
<span class="span">建档部门:</span>
|
|
|
<ibps-user-selector
|
|
|
:value="row.bianZhiBuMen"
|
|
|
- type="position"
|
|
|
+ type="org"
|
|
|
readonly-text="text"
|
|
|
:disabled="true"
|
|
|
:multiple="false"
|
|
|
@@ -229,7 +229,7 @@
|
|
|
<template slot="pos">
|
|
|
<ibps-user-selector
|
|
|
v-model="search.pos"
|
|
|
- type="position"
|
|
|
+ type="org"
|
|
|
readonly-text="text"
|
|
|
:multiple="true"
|
|
|
size="mini"
|
|
|
@@ -297,7 +297,7 @@
|
|
|
<ibps-custom-dialog
|
|
|
v-model="search.deviceClass"
|
|
|
size="mini"
|
|
|
- template-key="sbbqdhk"
|
|
|
+ template-key="sbfzpz"
|
|
|
multiple
|
|
|
:disabled="false"
|
|
|
type="dialog"
|
|
|
@@ -323,7 +323,7 @@
|
|
|
|
|
|
<bpmn-formrender
|
|
|
:visible="npmDialogFormVisible"
|
|
|
- def-id="1120718364969271296"
|
|
|
+ def-id="1055162372286578688"
|
|
|
@close="visible => npmDialogFormVisible = visible"
|
|
|
/>
|
|
|
<DeviceTag :scan-visible="printVisible" :obj="printObj" :state-list="stateList" @scanOff="scanOff" />
|
|
|
@@ -372,7 +372,9 @@ export default {
|
|
|
},
|
|
|
mixins: [FixHeight],
|
|
|
data () {
|
|
|
- const { userId, level = {}, position } = this.$store.getters || {}
|
|
|
+ const { userId, position } = this.$store.getters || {}
|
|
|
+ console.log(userId, position)
|
|
|
+
|
|
|
return {
|
|
|
filter: [{
|
|
|
descVal: '1',
|
|
|
@@ -423,7 +425,6 @@ export default {
|
|
|
params: {},
|
|
|
deviceDialogShow: false,
|
|
|
position: position,
|
|
|
- level: level.second || level.first,
|
|
|
userId: userId,
|
|
|
search: {
|
|
|
pos: '',
|
|
|
@@ -653,10 +654,6 @@ export default {
|
|
|
relation: 'AND',
|
|
|
parameters: []
|
|
|
}
|
|
|
- // 增加地点过滤
|
|
|
- const obj = { relation: 'AND', parameters: [] }
|
|
|
- obj.parameters.push({ key: 'Q^di_dian_^S', value: this.level, param: this.$utils.guid() })
|
|
|
- parameters.parameters.push(obj)
|
|
|
|
|
|
// 部门搜索(可多选)
|
|
|
if (this.search.pos) {
|
|
|
@@ -745,8 +742,8 @@ export default {
|
|
|
},
|
|
|
// 查看表单
|
|
|
goLookForm (row) {
|
|
|
- const first = this.$store.getters.level.first
|
|
|
- this.srcUrl = this.$reportPath.replace('show', 'pdf') + '设备/设备档案卡.rpx&id_=' + row.id + '&org_=' + first
|
|
|
+ const orgId = this.$store.getters.org.id
|
|
|
+ this.srcUrl = this.$reportPath.replace('show', 'pdf') + '设备/设备档案卡.rpx&id_=' + row.id
|
|
|
this.iframeVisible = true
|
|
|
},
|
|
|
// 按钮事件处理
|
|
|
@@ -836,6 +833,8 @@ export default {
|
|
|
this.getDatas()
|
|
|
},
|
|
|
goEdit (row) {
|
|
|
+ console.log('aa')
|
|
|
+
|
|
|
this.params = row
|
|
|
this.deviceDialogShow = true
|
|
|
},
|
|
|
@@ -960,9 +959,9 @@ export default {
|
|
|
},
|
|
|
async switchExportData (data) {
|
|
|
const deviceGroupSql = `select id_,wei_hu_gang_wei_ from t_sbwhgwpzb` // 设备分组信息
|
|
|
- const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb` // 供应商信息
|
|
|
+ // const supplierSql = `select id_,gong_ying_shang_m from t_hggysxx` // 供应商信息
|
|
|
const { variables: { data: deviceGroupData }} = await this.$common.request('sql', deviceGroupSql)
|
|
|
- const { variables: { data: gysData }} = await this.$common.request('sql', supplierSql)
|
|
|
+ // const { variables: { data: gysData }} = await this.$common.request('sql', supplierSql)
|
|
|
const exportData = JSON.parse(JSON.stringify(data))
|
|
|
for (let i = 0; i < exportData.length; i++) {
|
|
|
const item = exportData[i]
|
|
|
@@ -970,7 +969,7 @@ export default {
|
|
|
item.guanLiRen = this.switchIdToUserName(item.guanLiRen.split(',')[0])
|
|
|
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]) {
|
|
|
item.sheBeiZhuangTa = this.stateList[item.sheBeiZhuangTa]
|
|
|
}
|
|
|
@@ -1231,9 +1230,9 @@ export default {
|
|
|
* 过滤出来excel 的原设备编号存在当前数据库中的数据
|
|
|
* @param {*} list 导入的数据
|
|
|
*/
|
|
|
- async filterOriginalDeviceNo (list, currentPosition) {
|
|
|
+ async filterOriginalDeviceNo (list) {
|
|
|
const uniqueArr = Array.from(new Set(list.map(i => i.yuanSheBeiBian.trim())))
|
|
|
- const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')and di_dian_ = '${currentPosition}'`
|
|
|
+ const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')`
|
|
|
const res = await this.$common.request('sql', sql)
|
|
|
const { data = [] } = res.variables || {}
|
|
|
const originalDeviceNoList = data.map(i => i.yuan_she_bei_bian.trim())
|
|
|
@@ -1252,12 +1251,11 @@ export default {
|
|
|
* @param {*} currentUser 当前用户ID
|
|
|
* @param {*} currentPosition 当前地点ID
|
|
|
*/
|
|
|
- async handleBasicData (list, currentTime, currentApartment, currentUser, currentPosition, deptList) {
|
|
|
+ async handleBasicData (list, currentTime, currentApartment, currentUser, deptList) {
|
|
|
// 使用map生成一个异步操作的数组
|
|
|
const promises = list.map(async (element) => {
|
|
|
element.bianZhiShiJian = currentTime
|
|
|
element.bianZhiRen = currentUser
|
|
|
- element.diDian = currentPosition
|
|
|
element.shiFouGuoShen = '已完成'
|
|
|
const o = deptList?.find(i => i.positionName === element.bianZhiBuMen.trim())
|
|
|
const { positionId = currentApartment } = o || {}
|
|
|
@@ -1279,11 +1277,11 @@ export default {
|
|
|
* @param {*} employeeList 现有人员信息
|
|
|
* @returns
|
|
|
*/
|
|
|
- handleExcelData (list, positionList, supplierList, employeeList, deviceGroupList) {
|
|
|
+ handleExcelData (list, positionList, employeeList, deviceGroupList) {
|
|
|
if (list.length < 1) {
|
|
|
return
|
|
|
}
|
|
|
- this.handleSupplierInfo(list, supplierList)
|
|
|
+ // this.handleSupplierInfo(list, supplierList)
|
|
|
this.handlePositionInfo(list, positionList)
|
|
|
this.handlePersonInfo(list, employeeList)
|
|
|
this.handleDeviceGroupInfo(list, deviceGroupList)
|
|
|
@@ -1392,11 +1390,10 @@ export default {
|
|
|
i.sheBeiZhuangTa = keyFound[0]
|
|
|
}
|
|
|
})
|
|
|
- const currentPosition = this.level
|
|
|
const { userList = [], deptList = [] } = this.$store.getters || {}
|
|
|
- const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb where di_dian_ = ${currentPosition}` // 房间信息
|
|
|
- const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb where di_dian_ = ${currentPosition}` // 供应商信息
|
|
|
- const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ = ${currentPosition}` // 设备分组信息
|
|
|
+ const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb ` // 房间信息
|
|
|
+ // const supplierSql = `select id_,gong_ying_shang_m from t_hggysxx ` // 供应商信息
|
|
|
+ const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb` // 设备分组信息
|
|
|
const currentTime = dayjs().format('YYYY-MM-DD HH:mm')
|
|
|
const currentApartment = this.$store.getters.userInfo.employee.positions
|
|
|
const currentUser = this.userId
|
|
|
@@ -1405,21 +1402,19 @@ export default {
|
|
|
if (!partOneInvalidResult) return
|
|
|
|
|
|
importData = this.formatDateFieldsToReal(importData)
|
|
|
- console.log('%c partOne doCheck is completed! %c the result is %c', 'background:#35495E; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;', 'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;', 'background:transparent', importData)
|
|
|
this.loading = true
|
|
|
- Promise.all([this.$common.request('sql', positionSql), this.$common.request('sql', supplierSql), this.$common.request('sql', deviceGroupSql)]).then(async ([res1, res2, res3]) => {
|
|
|
+ Promise.all([this.$common.request('sql', positionSql), this.$common.request('sql', deviceGroupSql)]).then(async ([res1, res2, res3]) => {
|
|
|
+ console.log('sss')
|
|
|
const { data: positionList = [] } = res1.variables || {}
|
|
|
- const { data: supplierList = [] } = res2.variables || {}
|
|
|
+ // const { data: supplierList = [] } = res2.variables || {}
|
|
|
const { data: deviceGroupList = [] } = res3.variables || {}
|
|
|
// 根据原设备编号去重,检验原设备编号是否在数据库中存在
|
|
|
- const originalDeviceNoList = await this.filterOriginalDeviceNo(importData, currentPosition)
|
|
|
- await this.handleBasicData(importData, currentTime, currentApartment, currentUser, currentPosition, deptList)
|
|
|
- this.handleExcelData(importData, positionList, supplierList, userList, deviceGroupList)
|
|
|
+ const originalDeviceNoList = await this.filterOriginalDeviceNo(importData)
|
|
|
+ await this.handleBasicData(importData, currentTime, currentApartment, currentUser, deptList)
|
|
|
+ this.handleExcelData(importData, positionList, userList, deviceGroupList)
|
|
|
// 分离出 已存在的设备,和新设备
|
|
|
const newDeviceList = importData.filter(i => !originalDeviceNoList.includes(i.yuanSheBeiBian.trim()))
|
|
|
const existDeviceList = importData.filter(i => originalDeviceNoList.includes(i.yuanSheBeiBian.trim()))
|
|
|
- console.log('%c new device %c', 'background:#FF5733; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;', 'background:transparent', newDeviceList)
|
|
|
- console.log('%c already exist device %c', 'background:#43f80c; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;', 'background:transparent', existDeviceList)
|
|
|
this.loading = false
|
|
|
this.$confirm(`<span style="color:#f56c6c; font-size: 18px; font-weight: 600;">
|
|
|
经系统判定</span><br>1.预期新导入设备的数量为 ${newDeviceList.length} 台!<br>
|
|
|
@@ -1455,11 +1450,12 @@ export default {
|
|
|
} else {
|
|
|
params = item // 直接使用当前 item
|
|
|
}
|
|
|
- console.log(params)
|
|
|
// 将每个 saveEquipmentCard 请求加入到 allRequests 数组中
|
|
|
allRequests.push(saveEquipmentCard(params))
|
|
|
}
|
|
|
// 等待所有异步请求完成
|
|
|
+ console.log(allRequests, '000')
|
|
|
+
|
|
|
await Promise.all(allRequests)
|
|
|
this.loading = false
|
|
|
},
|
|
|
@@ -1542,11 +1538,10 @@ export default {
|
|
|
item.weiHuRiQi = '/'
|
|
|
}
|
|
|
})
|
|
|
- const currentPosition = this.level
|
|
|
const { userList = [], deptList = [] } = this.$store.getters || {}
|
|
|
- const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb where di_dian_ = ${currentPosition}` // 房间信息
|
|
|
- const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb where di_dian_ = ${currentPosition}` // 供应商信息
|
|
|
- const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb where di_dian_ = ${currentPosition}` // 设备分组信息
|
|
|
+ const positionSql = `select id_,fang_jian_ming_ha from t_jjqfjb ` // 房间信息
|
|
|
+ // const supplierSql = `select id_,gong_ying_shang_m from t_gysxxb ` // 供应商信息
|
|
|
+ const deviceGroupSql = `select id_,suo_shu_bu_men_,wei_hu_gang_wei_ from t_sbwhgwpzb` // 设备分组信息
|
|
|
const currentTime = dayjs().format('YYYY-MM-DD HH:mm')
|
|
|
const currentApartment = this.$store.getters.userInfo.employee.positions
|
|
|
const currentUser = this.userId
|
|
|
@@ -1557,7 +1552,7 @@ export default {
|
|
|
// 2、根据原设备编号去重,检验原设备编号是否在数据库中存在,如有不存在的数据,不进行导入,并提示用户
|
|
|
const uniqueArr = Array.from(new Set(importData.map(i => i.yuanSheBeiBian.trim())))
|
|
|
/* 3、根据去重的设备编号去查对应的设备ID,然后拼接data数据,赋值设备ID*/
|
|
|
- const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')and di_dian_ = ${currentPosition}`
|
|
|
+ const sql = `select id_,yuan_she_bei_bian from t_sbdj where find_in_set(yuan_she_bei_bian,'${uniqueArr.join(',')}')`
|
|
|
this.$common.request('sql', sql).then(async res => {
|
|
|
const deviceNoWithIdlist = res.variables.data
|
|
|
console.log(deviceNoWithIdlist, ' <=> ', uniqueArr)
|