zhangjinxing 3 years ago
parent
commit
7c68d012fa

+ 1 - 0
src/views/stock/allot/addDetail.vue

@@ -7,6 +7,7 @@
       <NewApply :myType="type"></NewApply>
       <!-- 发货 -->
       <GoStock :myType="type"></GoStock>
+      
       <InStockCheck :myType="type"></InStockCheck>
       <CheckStock :myType="type"></CheckStock>
       <add-edit

+ 38 - 2
src/views/stock/allot/components/goStock-audit.vue

@@ -47,7 +47,7 @@
 
         <el-form-item>
           <el-col :span="24" style="text-align: right; margin-top: 10px">
-            <el-button type="primary" @click="save">保 存 </el-button>
+            <el-button type="primary" @click="submitForm">保 存 </el-button>
             <el-button type="">关 闭 </el-button>
 
             <!-- <el-button type="warning" @click="submitForm"
@@ -69,7 +69,7 @@ import statusList from "@/assets/js/statusList";
 // import asyncRequest from "@/apis/service/stock/newApply";
 import addEdit from "./addEdit-newApply";
 import { mapGetters } from "vuex";
-
+// import from "@/utils/validate";
 export default {
   name: "allotFlow",
   mixins: [mixinPage, resToken],
@@ -152,6 +152,42 @@ export default {
       // }
       // this.loading = false;
     },
+
+    // 商品保存提交
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          // const { stock_code, stock_in_code, supplier_code, supplier_in_code } =
+          //   JSON.parse(JSON.stringify(this.ruleForm));
+          console.log(this.ruleForm);
+          const model = {
+            
+          };
+          let res = {};
+          // if (this.id === "add") {
+          //   delete model["id"];
+          //   res = await asyncRequest.add(model);
+          // } else {
+          //   res = await asyncRequest.update(model);
+          // }
+          this.loading = false;
+          if (res && res.code === 0) {
+            // 
+            this.showModelThis = false;
+            // 刷新
+            this.$emit("refresh");
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
   },
 };
 </script>

+ 9 - 9
src/views/stock/allot/index.vue

@@ -192,8 +192,8 @@ export default {
       isDetail: false,
       modelId: 0,
       parmValue: {
-        startTime: "", //开始日期
-        endTime: "", //结束日期
+        start: "", //开始日期
+        end: "", //结束日期
         allot_code: "", //调拨编号
         wsm_in: "", //入仓库名称
         wsm_out: "", //出仓库名称
@@ -225,16 +225,16 @@ export default {
     // 时间选择
     async handleTime(val) {
       if (val.startTime !== "") {
-        this.parmValue.startTime = val.startTime;
+        this.parmValue.start = val.startTime;
       } else {
-        this.parmValue.startTime = "";
+        this.parmValue.start = "";
       }
       if (val.endTime !== "") {
-        this.parmValue.endTime = val.endTime;
+        this.parmValue.end = val.endTime;
       } else {
-        this.parmValue.endTime = "";
+        this.parmValue.end = "";
       }
-      if (this.parmValue.startTime !== "" && this.parmValue.endTime !== "") {
+      if (this.parmValue.start !== "" && this.parmValue.end !== "") {
         this.parmValue.page = 1;
         await this.searchList();
       }
@@ -250,8 +250,8 @@ export default {
         allot_code: "", //调拨编号
         wsm_in: "", //入仓库名称
         wsm_out: "", //出仓库名称
-        startTime: "", //开始日期
-        endTime: "", //结束日期
+        start: "", //开始日期
+        end: "", //结束日期
         page: 1, // 页码
         size: 10, // 每页显示条数
       };