|
@@ -19,23 +19,15 @@
|
|
|
{{ index+1 }}
|
|
|
</template>
|
|
|
<template v-slot:positionNo="text,record,index">
|
|
|
- <div v-if="changeType===1">
|
|
|
- {{ text }}
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- <a-input v-if="record.isChild !== 1" style="width: 150px" v-model="record.positionNo" />
|
|
|
- <div v-else style="width:300px">
|
|
|
- <a-input
|
|
|
- disabled
|
|
|
- style="width: 50%"
|
|
|
- v-model="record.positionNo"/>
|
|
|
- <a-button type="primary" @click="handleSbNoSelect(index)">选择</a-button>
|
|
|
- </div>
|
|
|
+ <div style="width:300px">
|
|
|
+ <a-input
|
|
|
+ style="width: 50%"
|
|
|
+ v-model="record.positionNo"/>
|
|
|
+ <a-button v-if="record.isChild !== 1" type="primary" @click="handleSbNoSelect(record.positionId,index)">选择</a-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-slot:positionName="text,record">
|
|
|
<a-tree-select
|
|
|
- v-if="changeType===1"
|
|
|
style="width: 150px"
|
|
|
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
:treeData="treeData"
|
|
@@ -45,7 +37,6 @@
|
|
|
placeholder="请选择"
|
|
|
>
|
|
|
</a-tree-select>
|
|
|
- <span v-else> {{ text }}</span>
|
|
|
</template>
|
|
|
<span slot="status" slot-scope="text">
|
|
|
<badge
|
|
@@ -61,7 +52,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { getSbPositionTree } from '@/api/sb/position'
|
|
|
-import SbPositionNoModal from '@/views/sb/info/modules/SbPositionNoModal'
|
|
|
+import SbPositionNoModal from '@/views/sb/location/modules/LocationSelectModal'
|
|
|
import { batchChanges } from '@/api/sb/info'
|
|
|
|
|
|
export default {
|
|
@@ -77,7 +68,6 @@ export default {
|
|
|
treeData: [],
|
|
|
sbParentOPt: '',
|
|
|
statusMap: {},
|
|
|
- changeType: 0,
|
|
|
columns: [
|
|
|
{
|
|
|
title: '序号',
|
|
@@ -104,12 +94,6 @@ export default {
|
|
|
return record.typeName
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- title: '设备位号',
|
|
|
- dataIndex: 'positionNo',
|
|
|
- width: 150,
|
|
|
- scopedSlots: { customRender: 'positionNo' }
|
|
|
- },
|
|
|
{
|
|
|
title: '设备位置',
|
|
|
checked: true,
|
|
@@ -118,6 +102,12 @@ export default {
|
|
|
scopedSlots: { customRender: 'positionName' }
|
|
|
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '设备位号',
|
|
|
+ dataIndex: 'positionNo',
|
|
|
+ width: 150,
|
|
|
+ scopedSlots: { customRender: 'positionNo' }
|
|
|
+ },
|
|
|
{
|
|
|
title: '状态',
|
|
|
dataIndex: 'status',
|
|
@@ -138,15 +128,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- base (record, type) {
|
|
|
+ base (record) {
|
|
|
this.visible = true
|
|
|
- this.changeType = type
|
|
|
this.modal = record.map(item => {
|
|
|
if (item.children.length === 0) item.children = null
|
|
|
return item
|
|
|
})
|
|
|
console.log(this.modal)
|
|
|
- console.log(this.changeType)
|
|
|
},
|
|
|
save () {
|
|
|
const params = this.modal.map(item => {
|
|
@@ -164,9 +152,9 @@ export default {
|
|
|
})
|
|
|
console.log(params)
|
|
|
},
|
|
|
- handleSbNoSelect (i) {
|
|
|
+ handleSbNoSelect (positionId, i) {
|
|
|
this.sbParentOPt = i
|
|
|
- this.$refs.sbPositionNoModal.base()
|
|
|
+ this.$refs.sbPositionNoModal.base({ positionId })
|
|
|
},
|
|
|
handleSbNoSelectd (keys, rows) {
|
|
|
console.log(keys, rows)
|