Prechádzať zdrojové kódy

1.采购订单维护提交时校验,使用返利金额和抵扣余款不能为0
2.物料基本信息物料编码查询不到数据

002390 1 rok pred
rodič
commit
db74a05de1

+ 5 - 1
src/utils/request.js

@@ -164,7 +164,11 @@ service.interceptors.response.use(
       });
       // Message({ message: msg, type: "warning" });
       return Promise.reject("error");
-    } else if (code !== 200) {
+    } 
+    else if (code == 10000) {
+      return res.data;
+    }
+    else if (code !== 200) {
       Notification.error({
         title: msg.replaceAll(/(\n|\r|\r\n|↵)/g, "<br/>"),
         dangerouslyUseHTMLString: true,

+ 1 - 1
src/views/material/basicFile/columns.js

@@ -16,7 +16,7 @@ export const SearchColumns = [
   },
   {
     item:{
-      key: "code",
+      key: "codes",
       title: "物料编码",  
     },
     attr:{

+ 36 - 6
src/views/purchase/purchase-order/index.vue

@@ -304,19 +304,49 @@ export default {
     },
     fetchSubmit(puOrderIds){
 
+      let _this = this;
+
       this.handleConfirmTips(async()=>{
       
         try {
 
+          _this.loading = true;
 
-          this.loading = true;
-
-          let { code } = await orderApi.submit({ puOrderIds});
-
+          let { code,msg } = await orderApi.submit({ puOrderIds,checkAmount:true});
+          console.log(code,'code');
           if (code == 200) {
 
-          this.handleRefreshList();
-
+            _this.handleRefreshList();
+
+          }else if(code == 10000){
+
+            _this.$alert(msg, '提示', {
+              showCancelButton: true,
+              confirmButtonText: '置为0并提交',
+              cancelButtonText: '取消',
+              beforeClose: async(action, instance, done) => {
+                if (action === 'confirm') {
+                  try {
+                    instance.confirmButtonLoading = true;
+                    instance.confirmButtonText = '执行中...';
+                    let { code,msg } = await orderApi.submit({ puOrderIds,checkAmount:false});
+                    if(code == 200){
+                      done();
+                      _this.handleRefreshList();
+                    }
+                    
+                  } catch (error) {
+                    
+                  }finally{
+                    instance.confirmButtonLoading = false;
+                  }
+                
+                } else {
+                  done();
+                }
+              }
+            });
+            
           }
 
         }  catch (error) {}