瀏覽代碼

完善检定

408249787 2 年之前
父節點
當前提交
9931dc2188

+ 3 - 4
src/views/sb/info/SbInfo.vue

@@ -666,11 +666,10 @@ export default {
       }
       console.log(ids)
       batchLocationList({ ids }).then(res => {
-        console.log(res)
+        this.visible = false
+        const modal = this.$refs.baseFormLocation
+        modal.base(res.data)
       })
-      // this.visible = false
-      // const modal = this.$refs.baseFormLocation
-      // modal.base(ids)
     },
     batchIncorrect (id) {
       let ids = []

+ 103 - 5
src/views/sb/info/modules/BaseFormLocation.vue

@@ -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

+ 6 - 6
src/views/sb/info/modules/BaseFormMeasure.vue

@@ -55,17 +55,17 @@
                 :treeData="treeData"
                 :treeNodeFilterProp="'title'"
                 :showSearch="true"
-                v-model="item.positionId"
+                v-model="item.sbPositionId"
                 placeholder="请选择"
               >
               </a-tree-select></td>
               <td>
-                <a-input v-if="item.isChild !== 1" style="width: 150px" v-model="item.sbNoId" />
+                <a-input v-if="item.isChild !== 1" style="width: 150px" v-model="item.sbPositionNo" />
                 <div v-else style="width:300px">
                   <a-input
                     disabled
                     style="width: 50%"
-                    v-model="item.sbNoId"/>
+                    v-model="item.sbPositionNo"/>
                   <a-button type="primary" @click="handleSbNoSelect(i)">选择</a-button>
                 </div>
               </td>
@@ -199,10 +199,10 @@ export default {
           isChild: item.isChild,
           parentSbName: item.parentSbName,
           sbParentId: item.parentId,
-          positionId: item.positionId,
+          sbPositionId: item.positionId,
           no: '',
           lastDate: '',
-          sbNoId: item.positionNo,
+          sbPositionNo: item.positionNo,
           requirement: '',
           remark: '',
           name: this.username,
@@ -232,7 +232,7 @@ export default {
     },
     handleSbNoSelectd (keys, rows) {
       console.log(keys, rows)
-      this.ListForm[ this.sbParentOPt ].sbNoId = rows[0].no
+      this.ListForm[ this.sbParentOPt ].sbPositionNo = rows[0].no
     },
     uploadFile (val, i) {
       this.uploadFiledVisible = true

+ 17 - 0
src/views/sb/info/modules/SbPositionNoModal.vue

@@ -8,6 +8,23 @@
     @cancel="handleCancel"
   >
     <a-card :bordered="false">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="8" :sm="24">
+              <a-form-item label="关键字">
+                <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/编号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8 || 24" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
       <div class="table-operator" style="margin-bottom: 8px;">
       </div>
       <s-table