zhangjinxing 3 years ago
parent
commit
5c53a98442

+ 1 - 0
src/views/purchaseIn/storeManage/addEdit.vue

@@ -269,6 +269,7 @@ export default {
     },
 
     async submitForm() {
+
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;

+ 1 - 8
src/views/purchaseIn/storeManage/addModel.vue

@@ -22,14 +22,13 @@
    <script>
 import addEdit from "./components/addEdit.vue";
 export default {
-  name: "addModel",
+  name: "storeManageFlow",
   props: ["showModel", "id"],
   components: {
     addEdit,
   },
   data() {
     return {
-      formId: "",
       loading: false,
       showModelThis: this.showModel,
     };
@@ -47,14 +46,8 @@ export default {
   methods: {
     closeModel() {
       this.showModelThis = false;
-      // console.log("closeModel!!");
     },
   },
 };
 </script>
-
-   <style lang="scss" scoped>
-.check {
-}
-</style>
    

+ 1 - 0
src/views/purchaseIn/storeManage/components/addEdit.vue

@@ -287,6 +287,7 @@ export default {
     },
 
     async submitForm() {
+
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;

+ 8 - 3
src/views/purchaseIn/storeManage/index.vue

@@ -48,7 +48,7 @@
                 <el-col :span="4" style="width: 160px; padding: 0 0 0 10px">
                   <el-input
                     :size="searchSize"
-                    v-model="parmValue.username"
+                    v-model="parmValue.bk_code"
                     :maxlength="40"
                     placeholder="备货申请编码"
                   />
@@ -169,18 +169,20 @@ export default {
   },
   data() {
     return {
-      sitem: null,
+      // sitem: null,
       // 状态
       statusOptions: [
         { id: "0", label: "后端未定" },
         { id: "1", label: "后端未定义" },
       ],
+
       statusList: statusList,
       loading: true,
       showModel: false,
       isDetail: false,
       modelId: 0,
       parmValue: {
+        bk_code: "", //备库编号
         page: 1, // 页码
         size: 15, // 每页显示条数
       },
@@ -207,6 +209,7 @@ export default {
         {
           prop: "apply_name",
           label: "申请人",
+          width: "60",
         },
         {
           prop: "good_name",
@@ -219,6 +222,7 @@ export default {
         {
           prop: "good_num",
           label: "数量",
+          width: "50",
         },
         {
           prop: "lasttime",
@@ -266,10 +270,11 @@ export default {
     },
     restSearch() {
       this.parmValue = {
+        bk_code: "", //备库编号
         page: 1, // 页码
         size: 15, // 每页显示条数
       };
-       // 表格 - 分页
+      // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,

+ 179 - 138
src/views/purchaseIn/storeManageFlow/components/newSetStock.vue

@@ -34,15 +34,6 @@
           </el-col>
         </el-row>
         <el-row>
-          <el-col :span="12">
-            <el-form-item label="申请人" prop="apply_name">
-              <el-input
-                v-model="ruleForm.apply_name"
-                style="width: 100%"
-                placeholder="请输入内容"
-              />
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="入库仓库" prop="wsm_name">
               <el-cascader
@@ -59,48 +50,31 @@
               ></el-cascader>
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="商品code">
-              <el-input
-                v-model="ruleForm.good_code"
-                style="width: 100%"
-                placeholder="请输入内容"
-              />
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
-            <el-form-item label="商品属性code">
-              <el-input
-                v-model="ruleForm.good_type_code"
+            <el-form-item label="最晚入库时间" prop="lasttime">
+              <el-date-picker
                 style="width: 100%"
-                placeholder="请输入内容"
-              />
+                v-model="ruleForm.lasttime"
+                type="date"
+                value-format="yyyy-MM-dd HH-mm-ss"
+                placeholder="选择日期"
+                @change="selectTime"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="仓库code">
-              <el-input
-                v-model="ruleForm.wsm_code"
-                style="width: 100%"
-                placeholder="请输入内容"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="备库code">
+            <el-form-item label="申请人" prop="apply_name">
               <el-input
-                v-model="ruleForm.bk_code"
+                disabled="true"
+                v-model="ruleForm.apply_name"
                 style="width: 100%"
                 placeholder="请输入内容"
               />
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row>
           <el-col :span="12">
             <el-form-item label="当前状态">
               <el-input
@@ -110,36 +84,45 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="最晚入库时间" prop="lasttime">
-              <el-date-picker
-                style="width: 100%"
-                v-model="ruleForm.lasttime"
-                type="date"
-                value-format="yyyy-MM-dd HH-mm-ss"
-                placeholder="选择日期"
-                @change="selectTime"
-              >
-              </el-date-picker>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-col :span="24" style="text-align: right; margin-top: 10px">
-              <el-button type="primary" @click="save('ruleForm')"
-                >保 存
-              </el-button>
-              <el-button type="warning" @click="searchList('1')"
-                >保 存 并 发 起 流 程
-              </el-button>
-            </el-col>
-          </el-col>
-          <el-col :span="12"></el-col>
         </el-row>
+        <!-- v-if="
+              id === 'add' ||
+              (status === '0' && powers.some((item) => item == '005'))
+            " -->
+        <el-col :span="24" style="text-align: right">
+          <el-button type="primary" @click="submitForm">保 存</el-button>
+          <!--  v-if="status === '0' && powers.some((item) => item == '012')"-->
+          <el-button type="primary" @click="statusConfirm('1', '发起审核流程')"
+            >发起审核流程
+          </el-button>
+          <!--  -->
+          <el-button
+            @click="statusConfirm('0', '取消审核流程')"
+            plain
+            v-if="status === '1' && powers.some((item) => item == '014')"
+            >取消审核流程</el-button
+          >
+          <!-- v-if="
+              (status === '0' || status === '1') &&
+              powers.some((item) => item == '015')
+            " -->
+          <el-button
+            @click="statusConfirm('-1', '作废该条信息')"
+            type="danger"
+            plain
+            >作废该条信息</el-button
+          >
+          <!--  -->
+          <el-button
+            @click="statusConfirm('2', '通过审核')"
+            type="primary"
+            v-if="status === '1' && powers.some((item) => item == '016')"
+            >通过审核</el-button
+          >
+        </el-col>
       </el-form>
-      <el-divider content-position="center">采购反馈</el-divider>
-      <el-form
+      <!-- <el-divider content-position="center">采购反馈</el-divider> -->
+      <!-- <el-form
         v-if="ruleForm && ruleForm.status === '1'"
         :model="ruleForm"
         :rules="ruless"
@@ -206,7 +189,7 @@
               /> </el-form-item
           ></el-col>
         </el-row>
-      </el-form>
+      </el-form> -->
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -220,7 +203,7 @@ import resToken from "@/mixins/resToken";
 // import asyncRequest from "@/apis/service/stock/newApply";
 import asyncRequest from "@/apis/service/purchaseIn/storeManageFlow";
 import { mapGetters } from "vuex";
-import { isMobile, isAlphanumeric } from "@/utils/validate";
+// import { isMobile, isAlphanumeric } from "@/utils/validate";
 export default {
   name: "allotFlow",
   mixins: [mixinPage, resToken],
@@ -239,52 +222,32 @@ export default {
     },
   },
   data() {
-    // const validatemobile = (rule, value, callback) => {
-    //   if (value === "") {
-    //     callback(new Error("手机号不能为空!"));
-    //   } else {
-    //     if (!isMobile(value)) {
-    //       callback(new Error("手机号格式不正确!"));
-    //     } else {
-    //       callback();
-    //     }
-    //   }
-    // };
-    // const validateExpressNumber = (rule, value, callback) => {
-    //   if (value === "") {
-    //     callback(new Error("物流单号不能为空!"));
-    //   } else {
-    //     if (!isAlphanumeric(value)) {
-    //       callback(new Error("物流单号为6-16位数字字母组合!"));
-    //     } else if (value.length < 6 || value.length > 16) {
-    //       callback(new Error("物流单号为6-16位数字字母组合!"));
-    //     } else {
-    //       callback();
-    //     }
-    //   }
-    // };
     return {
       companyCode: "", //公司code
       id: "", //路由传过来的id
       inTime: "",
       goTime: "",
       ruleForm: {
-        supplier_code: [], //供应商名称
-        good_name: "", //商品名称
-        good_num: "", //商品数量
-        lasttime: "", //最晚入库时间
-        stock_in_rule: "", //入库仓库
-        goods_num_limit: "", //采购数量上限
-        expect_go_time: "", //预计入库时间
-        stock_go_rule: "", //出库仓库
-        remark: "", //备注
-        bk_code: "", //备库code
-        apply_name: "", //申请人
         good_code: "", //商品code
-        good_type_code: "", //商品属性code
+        good_num: "", //商品数量
         wsm_code: "", //仓库code
-        wsm_name: "", //仓库名
+        lasttime: "", //最晚入库时间
         status: "", //当前状态
+
+        // supplier_code: [], //供应商名称
+        // good_name: "", //商品名称
+
+        // stock_in_rule: "", //入库仓库
+        // goods_num_limit: "", //采购数量上限
+        // expect_go_time: "", //预计入库时间
+        // stock_go_rule: "", //出库仓库
+        // remark: "", //备注
+        // bk_code: "", //备库code
+        // apply_name: "", //申请人
+
+        // good_type_code: "", //商品属性code
+
+        // wsm_name: "", //仓库名
       },
       rules: {
         //出入库规则
@@ -298,7 +261,7 @@ export default {
         good_num: [
           {
             required: true,
-            message: "请选择入库仓库",
+            message: "请输入商品数量",
             trigger: "blur",
           },
         ],
@@ -418,48 +381,56 @@ export default {
     // 最晚入库时间选择
     selectTime(e) {
       console.log(e);
-      this.ruleForm.goTime = e;
+      // this.ruleForm.goTime = e;
     },
-    // 保存按钮
-    save(formName) {
-      this.$refs[formName].validate((valid) => {
+    //保存按钮
+    async submitForm(e) {
+      await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
-          alert("submit!");
+          this.loading = true;
+          console.log(this.ruleForm);
+          const { good_code, good_num, wsm_code, lasttime } = this.ruleForm;
+          const model = {
+            good_code,
+            good_num,
+            wsm_code,
+            lastime: lasttime,
+            id: this.id,
+          };
+          console.log(model);
+          let res = {};
+          if (e === "save") {
+            res = await asyncRequest.status({
+              id: this.id,
+              status: "1",
+            });
+          } else {
+            res = await asyncRequest.update(model);
+          }
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功" : "修改成功";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            this.showModel = true;
+            // 刷新
+            this.$emit("closeModel");
+          } 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;
         }
       });
-      if (this.ruleForm.goTime < this.ruleForm.send_out_time) {
-        this.$message({
-          showClose: true,
-          message: "最晚入库时间不能小于发货时间",
-          type: "error",
-        });
-      }
-    },
-    submitForm(formName) {
-      console.log("sds");
-      console.log(formName);
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          alert("submit!");
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-      if (this.ruleForm.goTime < this.ruleForm.send_out_time) {
-        this.$message({
-          showClose: true,
-          message: "最晚入库时间不能小于发货时间",
-          type: "error",
-        });
-      }
     },
 
     restSearch() {
-       // 表格 - 分页
+      // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
@@ -534,6 +505,76 @@ export default {
       this.ruleForm.good_code = good_code;
       this.$refs.ruleForm.validateField("goods_name");
     },
+
+    // 提交
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          console.log(this.ruleForm);
+          const { good_code, good_num, wsm_code, lasttime } = this.ruleForm;
+          const model = {
+            good_code,
+            good_num,
+            wsm_code,
+            lastime: lasttime,
+            id: this.id,
+          };
+          // console.log(model);
+
+          this.loading = true;
+          let res = {};
+          // console.log(this.id);
+          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) {
+            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+
+            if (this.id === "add") {
+              this.showModelThis = false;
+              this.$emit("refresh", false);
+            } else {
+              this.initForm();
+            }
+          } 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;
+        }
+      });
+    },
+    // 状态
+    async statusConfirm(status, message) {
+      console.log(status, message);
+      await this.$confirm(`确定要${message}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          if (status === "-1") {
+            await this.deleteById(message);
+          } else {
+            await this.setStatus(status, message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
   },
 };
 </script>

+ 11 - 224
src/views/stock/allot/addDetail.vue

@@ -7,8 +7,9 @@
       <NewApply :myType="type"></NewApply>
       <!-- 发货 -->
       <GoStock :myType="type"></GoStock>
-      
+      <!-- 入库验货详情 -->
       <InStockCheck :myType="type"></InStockCheck>
+      <!-- 入库验货审核 -->
       <CheckStock :myType="type"></CheckStock>
       <add-edit
         :id="modelId"
@@ -27,9 +28,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-// import statusList from "@/assets/js/statusList";
-// import asyncRequest from "@/apis/service/stock/newApply";
-import asyncRequest from "@/mock/service/stock/newApply";
 import { mapGetters } from "vuex";
 import NewApply from "./components/newApply.vue"; //新建申请页面
 import GoStock from "./components/goStock-audit.vue"; //出库方发货
@@ -37,7 +35,7 @@ import InStockCheck from "./components/inStock-check.vue"; //入库方验货
 import CheckStock from "./components/checkStock.vue"; //验货审核
 
 export default {
-  name: "newApply",
+  name: "allotFlow",
   mixins: [mixinPage, resToken],
   components: {
     NewApply,
@@ -59,6 +57,9 @@ export default {
       }
     },
   },
+  mounted() {
+    console.log(this.$route);
+  },
   data() {
     return {
       company: "",
@@ -71,94 +72,19 @@ export default {
        * type=5,验货审核流程     checkStock
        *
        */
-      selectStock_in: "", //选择的入库仓库名称
-      selectStock_go: "", //选择的出库仓库名称
-      stock_go: "", //出库仓库name
-      stock_in: "", //入库仓库name
-      options: [], //用于渲染二级仓库名
-      ruleForm: {},
-      rules: {
-        //出入库规则
-        stock_go_rule: [
-          {
-            required: true,
-            message: "请选择出库仓库",
-            trigger: "blur",
-          },
-        ],
-        stock_in_rule: [
-          {
-            required: true,
-            message: "请选择入库仓库",
-            trigger: "blur",
-          },
-        ],
-      },
       loading: true,
       showModel: false,
       isDetail: false,
       modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      tableData: [],
-      // 表格 - 参数
-      table: {
-        stripe: true,
-        border: true,
-        _defaultHeader_: ["setcol"],
-      },
-      // 表格 - 分页
-      pageInfo: {
-        size: 15,
-        curr: 1,
-        total: 0,
-      },
-      // 表格 - 列参数
-      columns: [
-        {
-          prop: "nickname",
-          label: "商品编号",
-        },
-        {
-          prop: "role_name",
-          label: "商品名称",
-        },
-        {
-          prop: "mobile",
-          label: "数量",
-        },
-        {
-          prop: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
-      // sitem: null,
-      // // 状态
-      // statusOptions: [
-      //   { id: "0", label: "禁用" },
-      //   { id: "1", label: "启用" },
-      // ],
+      //入参
       parmValue: {
-        //入参
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
-        // page: 1, // 页码
-        // size: 15, // 每页显示条数
+        //page: 1,  页码
+        //size: 15,  每页显示条数
       },
-      // passwordModel: false,
-      // passwordModelId: 0,
-      // isPasswordDetail: false,
-      // statusList: statusList,
     };
   },
   mounted() {
     this.searchList();
-    this.stockName(); //假数据,获取二级仓库名
   },
 
   methods: {
@@ -169,49 +95,11 @@ export default {
     restSearch() {
       //重置入参
       this.parmValue = {
-        // name: "", // 业务员名字
-        // username: "", // 账号
-        // status: "", //
-        // page: 1, // 页码
-        // size: 10, // 每页显示条数
+        page: 1, // 页码
+        size: 10, // 每页显示条数
       };
       this.searchList();
     },
-
-    openModal(id, isDetail, sitem) {
-      this.showModel = true;
-      this.modelId = id;
-      this.isDetail = isDetail;
-      this.sitem = sitem;
-    },
-    async deleteById(id, status) {
-      // await this.$confirm("确定要删除?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.$notify.success({
-      //         title: "删除成功",
-      //         message: "",
-      //       });
-      //       this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
     async searchList() {
       // this.loading = true;
       // const res = await asyncRequest.list(this.parmValue);
@@ -226,108 +114,7 @@ export default {
       // }
       // this.loading = false;
     },
-
-    async statusConfirm(id, status) {
-      // let str = status === "1" ? "禁用" : "启用";
-      // await this.$confirm("确定要改为" + str + "?", {
-      //   confirmButtonText: "确定",
-      //   cancelButtonText: "取消",
-      //   type: "warning",
-      // })
-      //   .then(async () => {
-      //     this.loading = true;
-      //     const model = {
-      //       id: id,
-      //       status: status === "1" ? "0" : "1",
-      //     };
-      //     const res = await asyncRequest.status(model);
-      //     if (res && res.code === 0) {
-      //       this.loading = false;
-      //       this.$notify.success({
-      //         title: "状态修改成功!",
-      //         message: "",
-      //       });
-      //       await this.searchList();
-      //     } else if (res && res.code >= 100 && res.code <= 104) {
-      //       await this.logout();
-      //     } else {
-      //       this.$message.warning(res.message);
-      //     }
-      //   })
-      //   .catch(() => {
-      //     console.log("取消");
-      //   });
-    },
-    async stockName() {
-      //获取多级仓库名称的方法
-      const res = await asyncRequest.listAll(this.parmValue);
-      // console.log(res.data);
-      // this.openModal("005", true);
-      // console.log(this.selectStock_go);
-      // console.log(this.selectStock_in);
-      // this.options = res.data;
-      // console.log(this.options);
-      let arr = res.data;
-      // console.log(arr);
-      arr.forEach((ele) => {
-        //重新封装后台传递来的数据,转换格式
-        let item = {
-          value: ele.id,
-          label: ele.name,
-          children: [],
-        };
-        ele.child.forEach((elem) => {
-          let model = {
-            value: elem.id,
-            label: elem.name,
-          };
-          item.children.push(model);
-        });
-        this.options.push(item);
-      });
-      this.options.forEach((ele) => {
-        //从数据表中筛选出我们要用的数据
-        if (ele.value === this.selectStock_go[0]) {
-          ele.children.forEach((elem) => {
-            if (elem.value === this.selectStock_go[1]) {
-              this.stock_go = ele.label + "/" + elem.label;
-            }
-          });
-        }
-        if (ele.value === this.selectStock_in[0]) {
-          ele.children.forEach((elem) => {
-            if (elem.value === this.selectStock_in[1]) {
-              this.stock_in = ele.label + "/" + elem.label;
-            }
-          });
-        }
-      });
-      if (this.selectStock_in != "" || this.selectStock_go != "") {
-        console.log("选择了一个项目");
-        this.openModal("005", true);
-      }
-      // console.log(this.stock_go);
-      // console.log(this.stock_in);
-      // console.log(this.pageInfo.total);
-      this.compareStock(); //比较出库仓库和入库仓库是否相同
-    },
-    compareStock() {
-      // //比较出库仓库和入库仓库是否相同
-      // if (
-      //   this.stock_go === this.stock_in &&
-      //   this.stock_go !== "" &&
-      //   this.stock_go != ""
-      // ) {
-      //   console.log("出库仓库和入库仓库相同");
-      //   this.$message({
-      //     message: "出库仓库不能和入库仓库相同",
-      //     type: "error",
-      //   });
-      // }
-    },
   },
 };
 </script>
-   <style lang="scss" >
-</style>
    

+ 21 - 18
src/views/stock/allot/components/addForm.vue

@@ -106,6 +106,7 @@ export default {
   mixins: [resToken],
   data() {
     return {
+      id: "",
       supplier_code: "",
       stock_in_code: "",
       isDisabled: true,
@@ -122,7 +123,6 @@ export default {
         product_type_code: "", //商品属性code
         status: "", //审核状态
       },
-      // tableData: [],
       rulesThis: this.rules,
       rules: {
         supplier_code: [
@@ -230,9 +230,23 @@ export default {
     },
   },
   mounted() {
+    console.log("asd");
+    this.id = this.$route.query.id;
+    this.getValue();
     this.initForm();
   },
   methods: {
+    async getValue() {
+      const res = await asyncRequest.detail({ id: this.id });
+      if (res && res.code === 0 && res.data) {
+        // this.ruleForm = res.data;
+        // this.ruleForm.role_id = this.ruleForm.role;
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
     // 删除行操作
     deleteRow(index, rows) {
       //   console.log(index, rows);
@@ -256,7 +270,7 @@ export default {
         } else {
           this.rulesThis = this.rules;
         }
-        await this.resetForm(this.sitem);
+        await this.resetForm();
         // await this.initData()
       }
       this.loading = false;
@@ -304,30 +318,23 @@ export default {
           //     JSON.stringify(this.ruleForm)
           //   );
 
-          const { stock_code, stock_in_code, supplier_code, supplier_in_code } =
-            JSON.parse(JSON.stringify(this.ruleForm));
-          console.log(
-            stock_code,
-            stock_in_code,
-            supplier_code,
-            supplier_in_code,
+          const { stock_code, stock_in_code } = JSON.parse(
+            JSON.stringify(this.ruleForm)
           );
+
           console.log(this.ruleForm);
           const model = {
             id: this.id,
             wsm_out: stock_code.toString(), //出库仓库
             wsm_in: stock_in_code.toString(), //入库仓库
-            supplier_code: supplier_code.toString(),
-            supplier_in_code: supplier_in_code.toString(),
-            status: "",
             good: [
               {
-                good_code: "df12fa1",
+                good_code: "GD-GY199803100001",
                 allot_num: 100,
-                type_code: "fafa131",
               },
             ],
           };
+          console.log(model);
           let res = {};
           if (this.id === "add") {
             delete model["id"];
@@ -432,8 +439,4 @@ export default {
 };
 </script>
 
-   <style lang="scss" scoped>
-.allot {
-}
-</style>
    

+ 4 - 8
src/views/stock/allot/components/goStock-audit.vue

@@ -3,6 +3,7 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
+      发货物流公司
       <el-form
         :model="ruleForm"
         :rules="rules"
@@ -24,7 +25,7 @@
                 :rows="2"
                 style="width: calc(100% - 150px)"
                 placeholder="请输入物流单号"
-                v-model="ruleForm.expressage"
+                v-model="ruleForm.expressage_sn"
                 clearable
               >
               </el-input> </el-form-item
@@ -48,10 +49,6 @@
           <el-col :span="24" style="text-align: right; margin-top: 10px">
             <el-button type="primary" @click="submitForm">保 存 </el-button>
             <el-button type="">关 闭 </el-button>
-
-            <!-- <el-button type="warning" @click="submitForm"
-              >保 存 并 发 起 流 程
-            </el-button> -->
           </el-col>
         </el-form-item>
       </el-form>
@@ -64,7 +61,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import statusList from "@/assets/js/statusList";
 // import asyncRequest from "@/apis/service/stock/newApply";
 import addEdit from "./addEdit-newApply";
 import { mapGetters } from "vuex";
@@ -96,7 +92,7 @@ export default {
         callback(new Error("物流单号号不能为空!"));
       } else {
         if (!isExpressSn(value)) {
-          callback(new Error("请输入正确的手机号"));
+          callback(new Error("请输入正确的物流单号"));
         } else {
           callback();
         }
@@ -122,7 +118,7 @@ export default {
             required: true,
             message: "请输入物流单号",
             trigger: "blur",
-            validate: "validateExpressSn",
+            validate: validateExpressSn,
           },
         ],
         expressage_cost: [

+ 2 - 99
src/views/stock/allot/components/newApply.vue

@@ -3,8 +3,8 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
+      详情
       <add-form :id="id" @closeModel="closeModel" />
-      id:{{ id }}
     </div>
     <div v-else>
       <no-auth></no-auth>
@@ -14,7 +14,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import asyncRequest from "@/mock/service/stock/newApply";
 import AddForm from "./addForm"; //新建表单
 
 import { mapGetters } from "vuex";
@@ -40,103 +39,7 @@ export default {
     },
   },
   data() {
-    const validateStock = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
-      }
-    };
-
-    return {
-      stock_go: "", //出库仓库name
-      stock_in: "", //入库仓库name
-      options: [], //用于渲染二级仓库名
-      ruleForm: {
-        selectStock_go: "",
-        selectStock_in: "",
-      },
-     
-      loading: true,
-      showModel: false,
-      isDetail: false,
-      modelId: 0,
-      tableData: [], //渲染表格
-      //
-      // 表格 - 数据
-      tableData: [],
-      // 表格 - 参数
-      table: {
-        stripe: true,
-        border: true,
-        // _defaultHeader_: ["setcol"],
-      },
-      // 表格 - 分页
-      pageInfo: {
-        size: 15,
-        curr: 1,
-        total: 0,
-      },
-      // 表格 - 列参数
-      columns: [
-        {
-          prop: "nickname",
-          label: "商品编号",
-        },
-        {
-          prop: "role_name",
-          label: "商品名称",
-        },
-        {
-          prop: "mobile",
-          label: "数量",
-        },
-        {
-          prop: "",
-          label: "操作",
-          fixed: "right",
-          _noset_: true,
-          _slot_: "operation",
-        },
-      ],
-      parmValue: {},
-    };
-  },
-  mounted() {
-    // this.searchList();
-    // this.stockName(); //假数据,获取二级仓库名
-  },
-
-  methods: {
-    submitForm(formName) {
-      console.log("sds");
-      console.log(formName);
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          alert("submit!");
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
-  },
-  restSearch() {
-    //重置入参
-    this.parmValue = {};
-    // this.searchList();
-  },
-  async searchList() {
-    // this.loading = true;
-    // const res = await asyncRequest.list(this.parmValue);
-    // if (res && res.code === 0 && res.data) {
-    //   this.tableData = res.data.list;
-    //   this.pageInfo.total = Number(res.data.count);
-    // } else if (res && res.code >= 100 && res.code <= 104) {
-    //   await this.logout();
-    // } else {
-    //   this.tableData = [];
-    //   this.pageInfo.total = 0;
-    // }
-    // this.loading = false;
+    return {};
   },
 };
 </script>

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

@@ -246,7 +246,7 @@ export default {
     },
     // 重置搜索框
     restSearch() {
-           // 表格 - 分页
+      // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,