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