|
@@ -18,11 +18,12 @@
|
|
|
<thead border="1px">
|
|
|
<tr>
|
|
|
<th width="100px">序号</th>
|
|
|
+ <th width="150px">是否在库</th>
|
|
|
<th width="150px">设备名称</th>
|
|
|
<th width="150px">型号</th>
|
|
|
<th width="150px">是否是子设备</th>
|
|
|
- <th width="350px">选择父设备</th>
|
|
|
<th width="150px">设备位置</th>
|
|
|
+ <th width="350px">选择父设备</th>
|
|
|
<th width="150px">设备位号</th>
|
|
|
<th width="150px">检定周期</th>
|
|
|
<th width="150px">检定日期</th>
|
|
@@ -32,53 +33,63 @@
|
|
|
<th width="150px">有效期</th>
|
|
|
<th width="150px">操作</th>
|
|
|
</tr>
|
|
|
- <tr v-if="ListForm.length>0">
|
|
|
- <th v-for="item in ListForm[0].content" :key="item.name">{{ item.name }}</th>
|
|
|
- </tr>
|
|
|
</thead>
|
|
|
<tbody v-if="ListForm.length>0">
|
|
|
<tr v-for="(item,i) in ListForm" :key="item.id">
|
|
|
<td>{{ i+1 }}</td>
|
|
|
+ <td> <a-switch v-model="item.sbStatus" >
|
|
|
+ <a-icon slot="checkedChildren" type="check" />
|
|
|
+ <a-icon slot="unCheckedChildren" type="close" />
|
|
|
+ </a-switch></td>
|
|
|
<td>{{ item.sbName }}</td>
|
|
|
<td>{{ item.sbModel }}</td>
|
|
|
<td>{{ item.isChild === 1?'是':'否' }}</td>
|
|
|
- <td> <div v-if="item.isChild === 1" style="width:300px">
|
|
|
+ <td>
|
|
|
+ <div v-if="item.sbStatus">{{ item.sbPositionName }}</div>
|
|
|
+ <a-tree-select
|
|
|
+ v-else
|
|
|
+ style="width: 150px"
|
|
|
+ :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
+ :treeData="treeData"
|
|
|
+ :treeNodeFilterProp="'title'"
|
|
|
+ :showSearch="true"
|
|
|
+ v-model="item.sbPositionId"
|
|
|
+ @change="handleSbPosition(item)"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ </a-tree-select></td>
|
|
|
+ <td> <div v-if="item.isChild === 1&&!item.sbStatus" style="width:250px">
|
|
|
<a-input
|
|
|
disabled
|
|
|
- style="width: 50%"
|
|
|
+ style="width: 60%"
|
|
|
v-model="item.parentSbName"/>
|
|
|
- <a-button type="primary" @click="handleSbSelect(i)">选择</a-button>
|
|
|
+ <a-button type="primary" @click="handleSbSelect(item.sbPositionId,i)">选择</a-button>
|
|
|
</div>
|
|
|
- <div v-else>无</div></td>
|
|
|
- <td><a-tree-select
|
|
|
- style="width: 150px"
|
|
|
- :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
- :treeData="treeData"
|
|
|
- :treeNodeFilterProp="'title'"
|
|
|
- :showSearch="true"
|
|
|
- v-model="item.sbPositionId"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- </a-tree-select></td>
|
|
|
+ <div v-else-if="item.isChild === 1&&item.sbStatus">{{ item.parentSbName }}</div>
|
|
|
+ <div v-else>无</div>
|
|
|
+ </td>
|
|
|
+
|
|
|
<td>
|
|
|
- <a-input v-if="item.isChild !== 1" style="width: 150px" v-model="item.sbPositionNo" />
|
|
|
- <div v-else style="width:300px">
|
|
|
+ <div v-if="item.sbStatus"> {{ item.sbPositionNo }}</div>
|
|
|
+ <div v-else style="width:250px">
|
|
|
<a-input
|
|
|
- disabled
|
|
|
- style="width: 50%"
|
|
|
+ style="width: 60%"
|
|
|
v-model="item.sbPositionNo"/>
|
|
|
- <a-button type="primary" @click="handleSbNoSelect(i)">选择</a-button>
|
|
|
+ <a-button v-if="item.isChild === 1" type="primary" @click="handleSbNoSelect(item.sbParentId,i)">选择</a-button>
|
|
|
</div>
|
|
|
</td>
|
|
|
- <td><a-input v-model="item.checkPeriod" :formatter="BaseTool.Amount.formatter" :parser="BaseTool.Amount.parser"> <span slot="suffix" >月</span> </a-input></td>
|
|
|
- <td><a-date-picker
|
|
|
- placeholder="日期"
|
|
|
- style="width: 150px"
|
|
|
- :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
|
- v-model="item.lastDate" /></td>
|
|
|
- <td><a-input style="width: 150px" v-model="item.no" /></td>
|
|
|
- <td><a-input style="width: 150px" v-model="item.requirement" /></td>
|
|
|
- <td><a-input style="width: 150px" v-model="item.remark" /></td>
|
|
|
+ <td><div v-if="item.sbStatus"> {{ item.checkPeriod }}月</div><a-input v-else v-model="item.checkPeriod" suffix="月" /></td>
|
|
|
+ <td>
|
|
|
+ <div v-if="item.sbStatus"> {{ item.lastDate instanceof Object? BaseTool.Date.formatter(item.lastDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN): item.lastDate }}</div>
|
|
|
+ <a-date-picker
|
|
|
+ v-else
|
|
|
+ placeholder="日期"
|
|
|
+ style="width: 150px"
|
|
|
+ :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
|
+ v-model="item.lastDate" /></td>
|
|
|
+ <td><div v-if="item.sbStatus"> {{ item.no }}</div><a-input v-else style="width: 150px" v-model="item.no" /></td>
|
|
|
+ <td><div v-if="item.sbStatus"> {{ item.requirement }}</div><a-input v-else style="width: 150px" v-model="item.requirement" /></td>
|
|
|
+ <td><div v-if="item.sbStatus"> {{ item.remark }}</div><a-input v-else style="width: 150px" v-model="item.remark" /></td>
|
|
|
<td>{{ validity(item.lastDate,item.checkPeriod) }}</td>
|
|
|
<td>
|
|
|
<a-button type="link" @click="uploadImg(item,i)">上传图片</a-button>
|
|
@@ -130,7 +141,7 @@
|
|
|
<script>
|
|
|
import { getSbPositionTree } from '@/api/sb/position'
|
|
|
import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
|
|
|
-import SbPositionNoModal from '@/views/sb/info/modules/SbPositionNoModal'
|
|
|
+import SbPositionNoModal from '@/views/sb/location/modules/LocationSelectModal'
|
|
|
import { importMeasure } from '@/api/sb/info'
|
|
|
|
|
|
import { uploadUrl } from '@/api/upms/file'
|
|
@@ -208,8 +219,10 @@ export default {
|
|
|
parentSbName: item.parentSbName,
|
|
|
sbParentId: item.parentId,
|
|
|
sbPositionId: item.positionId,
|
|
|
+ sbPositionName: item.positionName,
|
|
|
no: '',
|
|
|
lastDate: '',
|
|
|
+ sbStatus: false,
|
|
|
sbPositionNo: item.positionNo,
|
|
|
requirement: '',
|
|
|
remark: '',
|
|
@@ -225,18 +238,24 @@ export default {
|
|
|
this.treeData = res.data
|
|
|
})
|
|
|
},
|
|
|
- handleSbSelect (i) {
|
|
|
+ handleSbPosition (item) {
|
|
|
+ item.parentSbName = ''
|
|
|
+ item.sbParentId = ''
|
|
|
+ item.sbPositionNo = ''
|
|
|
+ },
|
|
|
+ handleSbSelect (positionId, i) {
|
|
|
this.sbParentOPt = i
|
|
|
- this.$refs.sbInfoSelectModal.base({}, { isChild: this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT })
|
|
|
+ this.$refs.sbInfoSelectModal.base({}, { isChild: this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT, positionId })
|
|
|
},
|
|
|
- handleSbNoSelect (i) {
|
|
|
+ handleSbNoSelect (sbId, i) {
|
|
|
this.sbParentOPt = i
|
|
|
- this.$refs.sbPositionNoModal.base()
|
|
|
+ this.$refs.sbPositionNoModal.base({ sbId })
|
|
|
},
|
|
|
handleSbSelectd (keys, rows) {
|
|
|
console.log(keys, rows)
|
|
|
this.ListForm[ this.sbParentOPt ].sbParentId = keys[0]
|
|
|
this.ListForm[ this.sbParentOPt ].parentSbName = rows[0].name
|
|
|
+ this.ListForm[ this.sbParentOPt ].sbPositionNo = ''
|
|
|
},
|
|
|
handleSbNoSelectd (keys, rows) {
|
|
|
console.log(keys, rows)
|
|
@@ -298,21 +317,24 @@ export default {
|
|
|
|
|
|
this.ListForm.forEach(item => {
|
|
|
switch (true) {
|
|
|
- case item.no == '':
|
|
|
+ case item.sbStatus || (item.no === '' && (item.lastDate === '' || item.lastDate === null)) :
|
|
|
+ break
|
|
|
+ case item.no === '':
|
|
|
this.$message.warning(item.sbName + '的检定单号不能为空!')
|
|
|
status = true
|
|
|
break
|
|
|
- case item.lastDate == '':
|
|
|
+ case item.lastDate === '' || item.lastDate === null:
|
|
|
this.$message.warning(item.sbName + '的检定日期不能为空!')
|
|
|
status = true
|
|
|
break
|
|
|
}
|
|
|
- item.lastDate = item.lastDate != '' ? this.BaseTool.Date.formatter(item.lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : ''
|
|
|
+ item.lastDate = item.lastDate !== '' && item.lastDate !== null ? this.BaseTool.Date.formatter(item.lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : ''
|
|
|
})
|
|
|
if (status) return
|
|
|
const params = {
|
|
|
- sbMeasureLogDTOList: this.ListForm
|
|
|
+ sbMeasureLogDTOList: this.ListForm.filter(item => !(!item.sbStatus && item.no === '' && item.lastDate === ''))
|
|
|
}
|
|
|
+ // console.log(params)
|
|
|
importMeasure(params).then(res => {
|
|
|
this.$message.success('检定完成!')
|
|
|
this.handleCancel()
|