From 33032d320cb75854def7391026b0401f1bfb8360 Mon Sep 17 00:00:00 2001
From: 黎星凯 <13949086503@163.com>
Date: 星期六, 11 五月 2024 17:26:02 +0800
Subject: [PATCH] 20240511修改: 分发单优化, 分类,物品,分发单明细,采购单明细数据导入

---
 admin-web/src/views/stock/inventorycount/inventorytask/index.vue |   53 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/admin-web/src/views/stock/inventorycount/inventorytask/index.vue b/admin-web/src/views/stock/inventorycount/inventorytask/index.vue
index b315b68..95a42e1 100644
--- a/admin-web/src/views/stock/inventorycount/inventorytask/index.vue
+++ b/admin-web/src/views/stock/inventorycount/inventorytask/index.vue
@@ -41,10 +41,9 @@
 import edit from './edit';
 import inventory from './inventory';
 import detail from './detail';
-import {selectTenantWarehouse} from '@/api/baseSetting/finsystenant';
 import myImport from '@/views/components/myImport';
 import {getBaseUrl} from '@/utils/base';
-import {inventoryDel, inventoryListApi} from '@/api/stock/inventory';
+import {inventoryDel, inventoryListApi,isAddInventory} from '@/api/stock/inventory';
 import * as DateFormatter from '@/utils/DateFormatter';
 import {mapGetters} from 'vuex';
 import listPage from '@/views/mixins/listPage';
@@ -72,12 +71,27 @@
           defaultValue: '',
         },
         {
+          type: 'cascader',
+          dataIndex: 'agencyId',
+          label: '鏈烘瀯',
+          placeholder: '璇烽�夋嫨',
+          optionsConfig: {url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null},
+          cascader: [{key:'warehouseId',queryKey: 'agencyId'}],
+          defaultValue: '',
+          options: [],
+        },
+        {
           type: 'select',
           dataIndex: 'warehouseId',
-          label: '鐩樼偣浠撳簱',
+          label: '浠撳簱',
           placeholder: '璇烽�夋嫨',
           defaultValue: '',
           options: [],
+          optionsConfig: {
+            label: 'warehouseName',
+            value: 'id',
+            url: SettingIplatform.apiBaseURL + '/pc/base/warehouse/select/tenant_warehouse'
+          },
         },
         {
           type: 'date-picker',
@@ -296,17 +310,6 @@
     ...mapGetters(['userInfo']),
   },
   created() {
-    selectTenantWarehouse({agencyId: this.userInfo.tenantId}).then((res) => {
-      this.items.forEach((v) => {
-        if (v.label == '鐩樼偣浠撳簱') {
-          v.options = res.map((item) => {
-            item.label = item.warehouseName;
-            item.value = item.id;
-            return item;
-          });
-        }
-      });
-    });
   },
   methods: {
     //瀵煎叆
@@ -335,10 +338,22 @@
           });
     },
     showAdd() {
-      this.editSetting.id = null;
-      this.editSetting.info = null;
-      this.editSetting.title = '鏂板';
-      this.editSetting.show = true;
+      // 鍏堟煡璇㈡槸鍚﹁兘澧炲姞鏂扮殑鐩樼偣浠诲姟
+      // 缂栬緫鎺ュ彛
+      isAddInventory().then((res) => {
+        if(res == 0){
+          this.$message.warning('褰撳墠鏈夋湭瀹屾垚鐨勭洏鐐逛换鍔★紒');
+        }else if(res == -1){
+          this.$message.warning('褰撳墠浠撳簱鏃犵墿鍝侊紒');
+        }else{
+          this.editSetting.id = null;
+          this.editSetting.info = null;
+          this.editSetting.title = '鏂板';
+          this.editSetting.show = true;
+        }
+      }).catch(()=>{
+        //this.loading = false
+      });
     },
     showAudit(row) {
       this.editSetting.id = row.id;
@@ -362,7 +377,7 @@
     // 鏌ヨtable鍒楄〃
     search(pageNum) {
       if (pageNum != undefined) {
-        this.$refs.myTable.search(pageNum);
+        this.$refs.myTable.search({pageNum});
       } else {
         this.$refs.myTable.search();
       }

--
Gitblit v1.9.1