|
@@ -65,6 +65,13 @@
|
|
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
+ <template
|
|
|
|
|
+ slot="deviceStateSlot"
|
|
|
|
|
+ slot-scope="{row}"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>{{ stateList[row.sheBeiZhuangTa] || row.sheBeiZhuangTa }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
<template
|
|
<template
|
|
|
slot="placeSlot"
|
|
slot="placeSlot"
|
|
|
slot-scope="{row}"
|
|
slot-scope="{row}"
|
|
@@ -265,10 +272,10 @@
|
|
|
<template slot="deviceStatus">
|
|
<template slot="deviceStatus">
|
|
|
<el-select v-model="search.deviceStatus" placeholder="请选择" size="mini" :clearable="true">
|
|
<el-select v-model="search.deviceStatus" placeholder="请选择" size="mini" :clearable="true">
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in ['合格','限用','停用','报废']"
|
|
|
|
|
- :key="item"
|
|
|
|
|
- :label="item"
|
|
|
|
|
- :value="item"
|
|
|
|
|
|
|
+ v-for="(v,k) in stateList"
|
|
|
|
|
+ :key="k"
|
|
|
|
|
+ :label="v"
|
|
|
|
|
+ :value="k"
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
@@ -302,7 +309,7 @@
|
|
|
</ibps-crud>
|
|
</ibps-crud>
|
|
|
</template>
|
|
</template>
|
|
|
</ibps-container>
|
|
</ibps-container>
|
|
|
- <DeviceDialog v-if="deviceDialogShow" :params="params" @close="close" />
|
|
|
|
|
|
|
+ <DeviceDialog v-if="deviceDialogShow" :params="params" :state-list="stateList" @close="close" />
|
|
|
<input id="" ref="file1" type="file" name="" accept=".xlsx,.xls" @change="handleUploadChange1">
|
|
<input id="" ref="file1" type="file" name="" accept=".xlsx,.xls" @change="handleUploadChange1">
|
|
|
<input id="" ref="file2" type="file" name="" accept=".xlsx,.xls" @change="handleUploadChange2">
|
|
<input id="" ref="file2" type="file" name="" accept=".xlsx,.xls" @change="handleUploadChange2">
|
|
|
|
|
|
|
@@ -319,7 +326,7 @@
|
|
|
def-id="1120718364969271296"
|
|
def-id="1120718364969271296"
|
|
|
@close="visible => npmDialogFormVisible = visible"
|
|
@close="visible => npmDialogFormVisible = visible"
|
|
|
/>
|
|
/>
|
|
|
- <DeviceTag :scan-visible="printVisible" :obj="printObj" @scanOff="scanOff" />
|
|
|
|
|
|
|
+ <DeviceTag :scan-visible="printVisible" :obj="printObj" :state-list="stateList" @scanOff="scanOff" />
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
@@ -485,7 +492,7 @@ export default {
|
|
|
{ prop: 'sheBeiMingCheng', label: '设备名称', sortable: true },
|
|
{ prop: 'sheBeiMingCheng', label: '设备名称', sortable: true },
|
|
|
{ prop: 'sheBeiLeiXing', label: '设备类型', sortable: true },
|
|
{ prop: 'sheBeiLeiXing', label: '设备类型', sortable: true },
|
|
|
{ prop: 'guiGeXingHao', label: '规格型号', sortable: true },
|
|
{ prop: 'guiGeXingHao', label: '规格型号', sortable: true },
|
|
|
- { prop: 'sheBeiZhuangTa', label: '设备状态', sortable: true },
|
|
|
|
|
|
|
+ { prop: 'sheBeiZhuangTa', label: '设备状态', sortable: true, slotName: 'deviceStateSlot' },
|
|
|
{ prop: 'guanLiRen', label: '保管人', slotName: 'userSlot', sortable: true },
|
|
{ prop: 'guanLiRen', label: '保管人', slotName: 'userSlot', sortable: true },
|
|
|
{ prop: 'weiHuFangShi', label: '设备分组', slotName: 'deviceSlot', sortable: true },
|
|
{ prop: 'weiHuFangShi', label: '设备分组', slotName: 'deviceSlot', sortable: true },
|
|
|
{ prop: 'cunFangWeiZhi', label: '放置地点', slotName: 'placeSlot', sortable: true },
|
|
{ prop: 'cunFangWeiZhi', label: '放置地点', slotName: 'placeSlot', sortable: true },
|
|
@@ -611,13 +618,35 @@ export default {
|
|
|
'季度保养': this.generateRule(3, `每季度第`, `个月`),
|
|
'季度保养': this.generateRule(3, `每季度第`, `个月`),
|
|
|
'年保养': this.generateRule(12, `每年第`, `个月`),
|
|
'年保养': this.generateRule(12, `每年第`, `个月`),
|
|
|
'按需保养': ['/']
|
|
'按需保养': ['/']
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ stateList: { '停用': '停用', '报废': '报废', '合格': '合格' }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- mounted () {
|
|
|
|
|
|
|
+ async mounted () {
|
|
|
this.getDatas()
|
|
this.getDatas()
|
|
|
|
|
+ const stateList = await this.getSetting('device', 'stateList')
|
|
|
|
|
+ if (stateList) {
|
|
|
|
|
+ this.stateList = stateList
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 获取全局配置对象
|
|
|
|
|
+ async getSetting (module, key) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const org = this.$store.getters.level.first || ''
|
|
|
|
|
+ const sql = `select setting from t_ipcc where org_ = '${org}' limit 1`
|
|
|
|
|
+ const { variables: { data = [] } = {}} = await this.$common.request('sql', sql)
|
|
|
|
|
+ if (data.length > 0 && data[0]?.setting) {
|
|
|
|
|
+ const setting = JSON.parse(data[0].setting)
|
|
|
|
|
+ const res = setting?.[module]?.[key]
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ return res
|
|
|
|
|
+ }
|
|
|
|
|
+ return null
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ return this.$message.warning('数据库字段配置错误!')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
ImageAllUrl (row) {
|
|
ImageAllUrl (row) {
|
|
|
if (row && row.buMen) {
|
|
if (row && row.buMen) {
|
|
|
const imgId = row.buMen.split(',')
|
|
const imgId = row.buMen.split(',')
|
|
@@ -1349,6 +1378,7 @@ export default {
|
|
|
let importData = this.switchDeviceObj(data, this.deviceColumns)
|
|
let importData = this.switchDeviceObj(data, this.deviceColumns)
|
|
|
importData.forEach(i => {
|
|
importData.forEach(i => {
|
|
|
delete i.sheBeiShiBieH // 设备编号需自动生成
|
|
delete i.sheBeiShiBieH // 设备编号需自动生成
|
|
|
|
|
+ i.sheBeiZhuangTa = '合格'
|
|
|
})
|
|
})
|
|
|
const currentPosition = this.level
|
|
const currentPosition = this.level
|
|
|
const { userList = [], deptList = [] } = this.$store.getters || {}
|
|
const { userList = [], deptList = [] } = this.$store.getters || {}
|