whj пре 7 месеци
родитељ
комит
8519e492ea
1 измењених фајлова са 37 додато и 4 уклоњено
  1. 37 4
      src/views/idle-assets-map/modules/StoreDetailMap.vue

+ 37 - 4
src/views/idle-assets-map/modules/StoreDetailMap.vue

@@ -16,19 +16,34 @@
     </div>
     <a-drawer
       title="备件信息"
+      :width="400"
       placement="right"
       :closable="false"
       :visible="show"
       @close="close"
     >
-      <p>Some contents...</p>
-      <p>Some contents...</p>
-      <p>Some contents...</p>
+      <a-tree-select
+        style="width: 100%"
+        :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+        :treeData="spareTypeData"
+        :treeNodeFilterProp="'title'"
+        :showSearch="true"
+        v-model="type"
+        allowClear
+        treeDefaultExpandAll
+        @change="fetchStoreSpare"
+        placeholder="请选择备件类型"
+      >
+      </a-tree-select>
+      <br>
+      <br>
+      <a-table :columns="columns" :data-source="spareList"></a-table>
     </a-drawer>
   </div>
 </template>
 
 <script>
+import { fetchSpareTypeTree } from '@/api/sqarepartmanage/sparetype'
 import { fetchStoreSpare } from '@/api/store/store'
 export default {
   data () {
@@ -39,9 +54,27 @@ export default {
       storeId: null,
       dataList: [],
       spareList: [],
-      opcImg: ''
+      opcImg: '',
+      spareTypeData: [],
+      columns: [
+        {
+          title: '备件名称',
+          dataIndex: 'name',
+          key: 'name'
+        },
+        {
+          title: '数量',
+          dataIndex: 'totalNum',
+          key: 'totalNum'
+        }
+      ]
     }
   },
+  created () {
+    fetchSpareTypeTree().then(res => {
+      this.spareTypeData = res.data
+    })
+  },
   methods: {
     base (record, imgUrl, storeId) {
       this.visible = true