|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<a-modal
|
|
|
:title="title"
|
|
|
- :width="800"
|
|
|
+ :width="1300"
|
|
|
:visible="visible"
|
|
|
:confirmLoading="confirmLoading"
|
|
|
@cancel="handleCancel"
|
|
@@ -42,7 +42,17 @@
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
</row-list>
|
|
|
-
|
|
|
+ <row-list :col="1">
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="申请原因"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-textarea v-decorator="['applyReason', { rules: [{required: true, message: '申请原因不能为空'}]}]" placeholder="请填写申请原因" />
|
|
|
+ </a-form-item>
|
|
|
+ </row-item>
|
|
|
+ </row-list>
|
|
|
</a-form>
|
|
|
<title-divider title="设备集合" width="90px"></title-divider>
|
|
|
<a-button type="primary" @click="handleSbSelect">选择</a-button>
|
|
@@ -51,6 +61,7 @@
|
|
|
<a-table
|
|
|
:columns="columns"
|
|
|
bordered
|
|
|
+ :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
|
|
|
:data-source="sbInfoDTOS"
|
|
|
>
|
|
|
<span slot="action" slot-scope="record">
|
|
@@ -59,6 +70,34 @@
|
|
|
@click="handleUpLoad(record)"
|
|
|
> {{ record.sbFileList.length>0?'查看图片':'上传图片' }} </operation-button>
|
|
|
</span>
|
|
|
+ <template #newPositionNo="text,record">
|
|
|
+ <a-input v-model="record.newPositionNo" />
|
|
|
+ </template>
|
|
|
+ <template #clean="text,record">
|
|
|
+ <a-select style="width: 100%" v-model="record.clean" placeholder="请选择">
|
|
|
+ <a-select-option
|
|
|
+ v-for="(label,value) in yesNoMap"
|
|
|
+ :key="value"
|
|
|
+ :label="label"
|
|
|
+ :value="parseInt(value)">{{ label }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </template>
|
|
|
+ <template #newPositionId="text,record">
|
|
|
+ <a-tree-select
|
|
|
+ style="width: 100%"
|
|
|
+ :dropdownStyle="{ maxHeight: '300px', overflow: 'auto' }"
|
|
|
+ :treeData="treeData"
|
|
|
+ :treeNodeFilterProp="'title'"
|
|
|
+ :showSearch="true"
|
|
|
+ v-model="record.newPositionId"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ </a-tree-select>
|
|
|
+ </template>
|
|
|
+ <template #sbIntact="text,record">
|
|
|
+ <a-textarea v-model="record.sbIntact" placeholder="请填写铭牌、零部件、外观" />
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
</a-card>
|
|
|
<template slot="footer">
|
|
@@ -74,6 +113,7 @@ import pick from 'lodash.pick'
|
|
|
import { addSbUnused, getUnusedUsers, updataSbUnused } from '@/api/idle-assets/idle-assets'
|
|
|
import SbInfoSelectModal from './SbInfoSelectModal'
|
|
|
import UpLoad from './UpLoad'
|
|
|
+import { getSbPositionTree } from '@/api/sb/position'
|
|
|
|
|
|
export default {
|
|
|
name: 'BaseForm',
|
|
@@ -94,16 +134,56 @@ export default {
|
|
|
{
|
|
|
title: '设备名称',
|
|
|
dataIndex: 'name',
|
|
|
+ width: 150,
|
|
|
key: 'name'
|
|
|
},
|
|
|
{
|
|
|
title: '设备位号',
|
|
|
dataIndex: 'positionNo',
|
|
|
+ width: 150,
|
|
|
key: 'positionNo'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '新位号',
|
|
|
+ dataIndex: 'newPositionNo',
|
|
|
+ width: 150,
|
|
|
+ key: 'newPositionNo',
|
|
|
+ scopedSlots: { customRender: 'newPositionNo' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '原设备位置',
|
|
|
+ dataIndex: 'oldPositionId',
|
|
|
+ width: 150,
|
|
|
+ key: 'oldPositionId',
|
|
|
+ customRender: (text, record) => {
|
|
|
+ return record.oldPositionName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '新设备位置',
|
|
|
+ dataIndex: 'newPositionId',
|
|
|
+ width: 150,
|
|
|
+ key: 'newPositionId',
|
|
|
+ scopedSlots: { customRender: 'newPositionId' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '是否清洗',
|
|
|
+ width: 150,
|
|
|
+ dataIndex: 'clean',
|
|
|
+ key: 'clean',
|
|
|
+ scopedSlots: { customRender: 'clean' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备完好性',
|
|
|
+ dataIndex: 'sbIntact',
|
|
|
+ width: 200,
|
|
|
+ key: 'sbIntact',
|
|
|
+ scopedSlots: { customRender: 'sbIntact' }
|
|
|
+ },
|
|
|
{
|
|
|
title: '设备编号',
|
|
|
dataIndex: 'no',
|
|
|
+ width: 150,
|
|
|
key: 'no'
|
|
|
},
|
|
|
{
|
|
@@ -115,12 +195,13 @@ export default {
|
|
|
align: 'center',
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ yesNoMap: {}
|
|
|
}
|
|
|
},
|
|
|
|
|
|
created () {
|
|
|
- // this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
|
|
|
+ this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
|
|
|
this.getUnusedUsers()
|
|
|
},
|
|
|
methods: {
|
|
@@ -147,7 +228,13 @@ export default {
|
|
|
name: item.sbName,
|
|
|
no: item.sbNo,
|
|
|
sbFileList: item.usedFileList,
|
|
|
- positionNo: item.positionNo
|
|
|
+ positionNo: item.positionNo,
|
|
|
+ newPositionNo: item.newPositionNo,
|
|
|
+ oldPositionName: item.oldPositionName,
|
|
|
+ oldPositionId: item.oldPositionId,
|
|
|
+ newPositionId: item.newPositionId,
|
|
|
+ clean: item.clean,
|
|
|
+ sbIntact: item.sbIntact
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -155,6 +242,9 @@ export default {
|
|
|
getUnusedUsers().then(res => {
|
|
|
this.verityUserIdMap = res.data
|
|
|
})
|
|
|
+ getSbPositionTree().then(res => {
|
|
|
+ this.treeData = res.data
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
handleSbSelect () {
|
|
@@ -170,6 +260,12 @@ export default {
|
|
|
name: item.name,
|
|
|
no: item.no,
|
|
|
positionNo: item.positionNo,
|
|
|
+ newPositionNo: '',
|
|
|
+ oldPositionName: item.positionName,
|
|
|
+ oldPositionId: item.positionId,
|
|
|
+ newPositionId: '',
|
|
|
+ clean: 0,
|
|
|
+ sbIntact: '',
|
|
|
sbFileList: []
|
|
|
}
|
|
|
})
|
|
@@ -201,11 +297,15 @@ export default {
|
|
|
updataSbUnused(values).then(res => {
|
|
|
this.$message.success('修改成功!')
|
|
|
this.handleCancel()
|
|
|
+ }).catch(() => {
|
|
|
+ this.confirmLoading = false
|
|
|
})
|
|
|
} else {
|
|
|
addSbUnused(values).then(res => {
|
|
|
this.$message.success('创建成功!')
|
|
|
this.handleCancel()
|
|
|
+ }).catch(() => {
|
|
|
+ this.confirmLoading = false
|
|
|
})
|
|
|
}
|
|
|
})
|