黎星凯
2024-04-15 62b6a7fac3f2acde70b578431147c4a01f19c182
admin-web/src/views/stock/inventorycount/inventorytask/index.vue
@@ -43,7 +43,7 @@
import detail from './detail';
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';
@@ -338,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;