|
@@ -9,9 +9,45 @@
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<div>
|
|
|
-
|
|
|
+ <a-table
|
|
|
+ :columns="columns"
|
|
|
+ :data-source="modal"
|
|
|
+ bordered
|
|
|
+ :expanded-row-keys.sync="expandedRowKeys"
|
|
|
+ >
|
|
|
+ <template v-slot:index="text,record,index">
|
|
|
+ {{ index+1 }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:positionNo="text,record,index">
|
|
|
+ <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>
|
|
|
+ </template>
|
|
|
+ <template v-slot:positionName="text,record">
|
|
|
+ <a-tree-select
|
|
|
+ style="width: 150px"
|
|
|
+ :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
+ :treeData="treeData"
|
|
|
+ :treeNodeFilterProp="'title'"
|
|
|
+ :showSearch="true"
|
|
|
+ v-model="record.positionId"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ </a-tree-select>
|
|
|
+ </template>
|
|
|
+ <span slot="status" slot-scope="text">
|
|
|
+ <badge
|
|
|
+ :status="DictCache.COLOR.SB_INFO_STATUS[text]"
|
|
|
+ :text="statusMap[text]" />
|
|
|
+ </span>
|
|
|
+ </a-table>
|
|
|
</div>
|
|
|
- <!-- <sb-position-no-modal ref="sbPositionNoModal" @selected="handleSbNoSelectd"/> -->
|
|
|
+ <sb-position-no-modal ref="sbPositionNoModal" @selected="handleSbNoSelectd"/>
|
|
|
|
|
|
</a-card>
|
|
|
</template>
|
|
@@ -29,23 +65,85 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
visible: false,
|
|
|
- modal: []
|
|
|
+ modal: [],
|
|
|
+ expandedRowKeys: [],
|
|
|
+ treeData: [],
|
|
|
+ sbParentOPt: '',
|
|
|
+ statusMap: {},
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ key: 'index',
|
|
|
+ width: 50,
|
|
|
+ scopedSlots: { customRender: 'index' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备名称',
|
|
|
+ width: 100,
|
|
|
+ dataIndex: 'name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备编号',
|
|
|
+ dataIndex: 'no',
|
|
|
+ width: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备类型',
|
|
|
+ dataIndex: 'type',
|
|
|
+ width: 150,
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return record.typeName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位号',
|
|
|
+ dataIndex: 'positionNo',
|
|
|
+ width: 150,
|
|
|
+ scopedSlots: { customRender: 'positionNo' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备位置',
|
|
|
+ checked: true,
|
|
|
+ width: 200,
|
|
|
+ dataIndex: 'positionName',
|
|
|
+ scopedSlots: { customRender: 'positionName' }
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ width: 100,
|
|
|
+ scopedSlots: { customRender: 'status' }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
},
|
|
|
created () {
|
|
|
// 下拉框map
|
|
|
+ this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
|
|
|
|
|
|
+ getSbPositionTree().then(res => {
|
|
|
+ this.treeData = res.data
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
base (record) {
|
|
|
this.visible = true
|
|
|
-
|
|
|
- this.model = record
|
|
|
+ this.modal = record
|
|
|
+ console.log(this.modal)
|
|
|
},
|
|
|
save () {
|
|
|
|
|
|
+ },
|
|
|
+ handleSbNoSelect (i) {
|
|
|
+ this.sbParentOPt = i
|
|
|
+ this.$refs.sbPositionNoModal.base()
|
|
|
+ },
|
|
|
+ handleSbNoSelectd (keys, rows) {
|
|
|
+ console.log(keys, rows)
|
|
|
+ this.modal[ this.sbParentOPt ].positionNo = rows[0].no
|
|
|
},
|
|
|
handleCancel () {
|
|
|
this.visible = false
|