浏览代码

提交代码

zyf 2 年之前
父节点
当前提交
77798b4854

+ 2 - 2
config/index.js

@@ -74,8 +74,8 @@ let proxyTable = {
     }
   },
   "/views/api/v1": {
-    target: "http://172.16.33.166:80",
-    // target: "http://192.168.1.109:8080",
+    //target: "http://172.16.33.166:80",
+    target: "http://192.168.1.109:8080",
     ws: true,
     pathRewrite: {
       "^/views/api/v1": "/api/v1"

+ 37 - 3
src/views/appoint/components/saleContract/addSaleOrder.vue

@@ -962,7 +962,8 @@ export default {
       restaurants: [],
       saleAreaId: null,
       isNiTui: 0,
-      datalistindex: 0
+      datalistindex: 0,
+      temporarylist:[],
     };
   },
   created() {
@@ -1985,7 +1986,7 @@ export default {
       }
     },
     // 确定
-    makeSure() {
+    async makeSure() {
       if (this.selectionList.length == 0) {
         this.$message.warning("请先填写具体信息");
         return;
@@ -1997,6 +1998,18 @@ export default {
           i++;
         }
       });
+      let flag=0
+      await this.axios
+        .post("/api/v1/ams/queryFormat",this.selectionList)
+        .then(res=>{
+          if (res.data.code=="500"){
+            flag=1
+          }
+        })
+      if (flag== 1){
+        this.$message.error("规格型号有问题,请重新输入");
+        return;
+      }
       if (i != 0) {
         this.$message.error("件数必填且请输入正整数");
         return;
@@ -2033,10 +2046,31 @@ export default {
       this.orderMakeSure = true;
     },
     //发送请求
-    sendRequest() {
+    async sendRequest() {
       this.orderMakeSure = false;
       //是否还有件数未填写
       var orderPlanWeightAllFill = 0;
+      //根据规格型号与物资名称获取对应的物资ID||确认规格型号格式是否正确
+      //先把暂存区的数据清空
+      this.temporarylist=[]
+      let flag=0
+      await this.axios
+        .post("/api/v1/ams/queryMaterial",this.selectionList)
+        .then(res=>{
+          if (res.data.code === "500"){
+            flag=1
+          }
+          console.log(res.data.code)
+          //给暂存区的数据赋值
+          this.temporarylist=res.data.data
+          console.log("以下是查询出来的数据")
+          console.log(res.data.data)
+        })
+      if (flag===1){
+        this.$message.error("规格型号不对")
+        return
+      }
+      this.selectionList=this.temporarylist
       //初始化maplist
       var mapList = [];
       this.selectionList.forEach(item => {

+ 47 - 9
src/views/appoint/components/saleContract/editSaleOrder.vue

@@ -907,7 +907,9 @@ export default {
       //收款公司
       saleOrderReceiveCustomer: null,
       //是否忽视收货客户电话字段
-      ignoreSaleOrderConsigneeTel: 0
+      ignoreSaleOrderConsigneeTel: 0,
+      //暂时存取的数据
+      temporarylist: [],
     };
   },
   created() {
@@ -1882,7 +1884,7 @@ export default {
       }
     },
     // 确定
-    makeSure() {
+    async makeSure() {
       if (this.selectionList.length == 0) {
         this.$message.warning("请先填写具体信息");
         return;
@@ -1894,15 +1896,20 @@ export default {
           i++;
         }
       });
+      let s=0
       //确认规格型号格式是否正确
-      this.axios
+      await this.axios
         .post("/api/v1/ams/queryFormat",this.selectionList)
-        .then(res =>{
-          if (res.data.code == "500"){
-            this.$message.error("规格型号不对");
-            return;
+        .then(res=>{
+          if (res.data.code=="500"){
+            s=1
           }
         })
+      console.log("这是获取到的数据")
+      if (s== 1){
+        this.$message.error("规格型号有问题,请重新输入");
+        return;
+      }
       if (i != 0) {
         this.$message.error("件数必填且请输入正整数");
         return;
@@ -1938,8 +1945,37 @@ export default {
       });
       this.orderMakeSure = true;
     },
+    async getlist(){
+      let res=await this.axios
+        .post("/api/v1/ams/queryMaterial",this.selectionList)
+      this.selectionList=res.data.data
+      console.log("这是查询出来的")
+      console.log(res.data.data)
+      console.log("这是修改后的数据")
+      console.log(this.selectionList)
+    },
     //发送请求
-    sendRequest() {
+    async sendRequest() {
+      //根据规格型号与物资名称获取对应的物资ID||确认规格型号格式是否正确
+      //先把暂存区的数据清空
+      this.temporarylist=[]
+      let flag=0
+      await this.axios
+        .post("/api/v1/ams/queryMaterial",this.selectionList)
+        .then(res=>{
+          if (res.data.code === "500"){
+            flag=1
+          }
+          console.log(res.data.code)
+          //给暂存区的数据赋值
+          this.temporarylist=res.data.data
+          console.log("以下是查询出来的数据")
+          console.log(res.data.data)
+        })
+      if (flag===1){
+        this.$message.error("规格型号不对")
+        return
+      }
       //先调删除订单接口
       this.axios
         .post(
@@ -1952,8 +1988,10 @@ export default {
             //是否还有件数未填写
             var orderPlanWeightAllFill = 0;
             //初始化maplist
+            this.selectionList=this.temporarylist
+            console.log("以下是修改过后的数据")
+            console.log(this.selectionList)
             var mapList = [];
-            console.log(this.selectionList);
             this.selectionList.forEach(item => {
               if (!item.orderPlanWeight) {
                 orderPlanWeightAllFill++;