zhangjinxing 3 years ago
parent
commit
bd965a0144

+ 3 - 1
src/apis/service/interest/handover/index.js

@@ -15,5 +15,7 @@ export default {
   // 离职交接状态
   status: (data, params) => http(api + 'Resigninfostatu', data, 'post', params),
   // 拉取角色列表
-  getRole: (data, params) => http(api + 'roleall', data, 'post', params)
+  getRole: (data, params) => http(api + 'roleall', data, 'post', params),
+  updateStatus: (data, params) => http(api + 'Resigninfostatu', data, 'post', params),
+
 }

+ 1 - 1
src/apis/service/purchaseIn/storeManage/index.js

@@ -3,7 +3,7 @@ import http from "@/apis/axios";
 const api = "admin/";
 export default {
   // 添加
-  add: (data, params) => http(api + "add", data, "post", params),
+  add: (data, params) => http(api + "purchadd", data, "post", params),
   // 删除
   delete: (data, params) => http(api + "delete", data, "post", params),
   // 分页查询

+ 71 - 12
src/views/interest/handover/components/addEditForm.vue

@@ -38,8 +38,8 @@
       </el-form>
     </el-col>
     <el-col :span="24" style="text-align: right">
-      <el-button type="primary" @click="submitForm">保 存 </el-button>
-      <el-button type="primary" @click="submitForm1" v-if="isBtn"
+      <el-button type="primary" @click="save">保 存 </el-button>
+      <el-button type="primary" @click="submitForm" v-if="isBtn"
         >保 存 并 发 起 流 程
       </el-button>
       <el-button @click="closeAddEdit" v-if="isBtn"
@@ -61,6 +61,7 @@ export default {
     return {
       isBtn: false,
       loading: false,
+      status: "", //存储详情接口返的状态
       showModelThis: this.showModel,
       resign_name: "", //离职人
       hand_name: "", //交接人
@@ -93,7 +94,7 @@ export default {
   mounted() {
     console.log(this.parmValue1);
     console.log(this.isDetail);
-    console.log(this.id);
+    // console.log(this.id);
     this.initForm();
   },
   methods: {
@@ -140,16 +141,17 @@ export default {
       this.loading = false;
     },
     async initData() {
-      console.log(this.id);
+      // console.log(this.id);
       const res = await asyncRequest.detail({ id: this.parmValue1.id });
       if (res && res.code === 0 && res.data) {
-        let { hand_name, resign_name, hand_uid, resign_uid, id } = res.data;
+        let { hand_name, resign_name, hand_uid, resign_uid, id, status } =
+          res.data;
         this.ruleForm = {
           resign_name,
           hand_name,
           hand_uid: hand_uid.split(","),
           resign_uid: resign_uid.split(","),
-          type: "2",
+          type: status,
           id,
         };
         // this.$emit("refreshList");
@@ -174,6 +176,45 @@ export default {
         }
       });
     },
+    async save() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          let resign_uid = this.ruleForm.resign_uid;
+          let hand_uid = this.ruleForm.hand_uid;
+          if (resign_uid.toString() !== hand_uid.toString()) {
+            this.loading = true;
+            const model = {
+              id: this.ruleForm.id,
+              resign_uid: resign_uid.toString(),
+              hand_uid: hand_uid.toString(),
+            };
+            const res = await asyncRequest.update(model);
+            this.$router.push({
+              path: "handover",
+            });
+            this.loading = false;
+            if (res && res.code === 0) {
+              this.$notify.success({
+                title: "修改成功!",
+                message: "",
+              });
+              this.showModelThis = false;
+              // 刷新
+              this.$emit("refresh", false);
+            } else if (res && res.code >= 100 && res.code <= 104) {
+              await this.logout();
+            } else {
+              this.$message.warning(res.message);
+            }
+          } else {
+            this.$message.error("离职人和接收人不能相同");
+          }
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
     async submitForm() {
       console.log(this.ruleForm);
       await this.$refs.ruleForm.validate(async (valid) => {
@@ -189,17 +230,13 @@ export default {
             };
             console.log(model);
             let res = {};
-            console.log(this.id);
             if (this.id === "add") {
               delete model["id"];
               res = await asyncRequest.add(model);
-
               console.log(res);
             } else {
               res = await asyncRequest.update(model);
-              this.$router.push({
-                path: "handover",
-              });
+              this.updateStatus();
             }
             this.loading = false;
             if (res && res.code === 0) {
@@ -225,7 +262,29 @@ export default {
         }
       });
     },
-
+    async updateStatus() {
+      let model = {
+        id: this.ruleForm.id,
+        remark: "123",
+        status: this.ruleForm.type,
+      };
+      console.log(model);
+      const res = await asyncRequest.updateStatus(model);
+      if (res && res.code === 0) {
+        const title = this.id === "add" ? "添加成功!" : "修改成功!";
+        this.$notify.success({
+          title,
+          message: "",
+        });
+        this.showModelThis = false;
+        // 刷新
+        this.$emit("refresh", false);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
     handleResignName(e) {
       if (e && e.id) {
         this.ruleForm.resign_uid = [e.id];

+ 8 - 7
src/views/interest/handover/index.vue

@@ -271,16 +271,17 @@ export default {
     },
     restSearch() {
       this.parmValue = {
-        start: "",//开始 end结束时间
+        start: "", //开始 end结束时间
         end: "",
-        type: "", //审核状态
-        resign_name: "", //离职人姓名
-        handover_name: "", //接受人姓名
+        // type: "", //审核状态
+        // resign_name: "", //离职人姓名
+        // handover_name: "", //接受人姓名
         status: "", //
-        page: 1, // 页码
-        size: 10, // 每页显示条数
+        // page: 1, // 页码
+        // size: 10, // 每页显示条数
         resign_uid: "",
         hand_uid: "",
+        
       };
       this.searchList();
     },
@@ -291,7 +292,7 @@ export default {
     },
     // 获取离职交接列表
     async searchList() {
-      // console.log(this.parmValue);
+      console.log(this.parmValue);
       this.loading = true;
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {

+ 2 - 2
src/views/purchaseIn/storeGoods/index.vue

@@ -29,11 +29,11 @@
               <el-col :span="24">
                 <el-col :span="8" style="width: 200px">
                   <search-supplier
-                    :placeholder="'供应商编号'"
+                    :placeholder="'供应商名称'"
                     :size="searchSize"
                     :value="parmValue.gys_code"
                     @searchChange="handleValue"
-                  ></search-supplier>
+                  />
                 </el-col>
 
                 <el-col :span="4" style="width: 200px; padding-left: 10px">

+ 219 - 303
src/views/purchaseIn/storeManage/addEdit.vue

@@ -4,7 +4,7 @@
     :center="true"
     align="left"
     top="5vh"
-    width="1040px"
+    width="800px"
     @close="closeModel"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
@@ -18,260 +18,179 @@
         <el-col :span="24">
           <el-form
             :model="ruleForm"
-            status-icon
-            :rules="rulesThis"
+            :rules="rules"
             ref="ruleForm"
-            label-width="110px"
-            class="demo-ruleForm"
+            label-width="120px"
           >
-            <el-form-item
-              label="登录名"
-              prop="loginName"
-              v-if="id === 'add' || isDetail"
-            >
+            <el-form-item label="商品名称" prop="goods_name">
               <el-input
-                v-model="ruleForm.loginName"
-                :disabled="isDetail"
+                style="width: 80%"
+                v-model="ruleForm.goods_name"
               ></el-input>
+              <!-- <search-good-modal /> -->
             </el-form-item>
-            <el-form-item label="姓名" prop="fullName">
+            <el-form-item label="采购数量" prop="goods_num">
               <el-input
-                v-model="ruleForm.fullName"
-                :disabled="isDetail"
+                style="width: 80%"
+                v-model="ruleForm.goods_num"
+                placeholder="请输入内容"
+                :size="searchSize"
               ></el-input>
             </el-form-item>
-            <el-form-item label="手机号" prop="tel">
-              <el-input v-model="ruleForm.tel" :disabled="isDetail"></el-input>
+            <el-form-item label="最晚入库时间" prop="last_go_stock">
+              <el-date-picker
+                style="width: 80%"
+                :size="searchSize"
+                v-model="ruleForm.last_go_stock"
+                type="date"
+                value-format="timestamp"
+                placeholder="选择日期"
+                @change="selectTime"
+              >
+              </el-date-picker>
             </el-form-item>
-            <el-form-item label="密码" prop="password" v-if="id === 'add'">
-              <el-input
-                type="password"
-                placeholder="密码"
-                :maxlength="20"
-                v-model="ruleForm.password"
-              ></el-input>
-            </el-form-item>
-            <el-form-item label="确认密码" prop="password2" v-if="id === 'add'">
-              <el-input
-                type="password"
-                placeholder="再次输入密码"
-                :maxlength="20"
-                v-model="ruleForm.password2"
-              ></el-input>
+            <el-form-item label="入库仓库" prop="stock_in_rule">
+              <el-cascader
+                placeholder="请选择入库仓库"
+                filterable
+                clearable
+                :size="searchSize"
+                v-model="ruleForm.stock_in_rule"
+                :options="options"
+                style="width: 80%"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  stockName();
+                "
+              ></el-cascader>
             </el-form-item>
           </el-form>
         </el-col>
-        <el-col :span="24" style="text-align: right;">
+        <el-col :span="24" style="text-align: right">
           <el-button type="primary" @click="submitForm" v-if="!isDetail"
             >保 存
           </el-button>
-          <el-button @click="showModelThis = false">{{ isDetail ? "关 闭" : "取 消" }}</el-button>
+          <el-button @click="showModelThis = false">{{
+            isDetail ? "关 闭" : "取 消"
+          }}</el-button>
+          id:{{ id }} isDetail:{{ isDetail }}
         </el-col>
       </el-row>
     </el-card>
   </el-dialog>
-   </template>
+</template>
    <script>
-   import asyncRequest from "@/apis/service/purchaseIn/storeManage";
-   import resToken from "@/mixins/resToken";
-   import {
-    isnumber,
-    isMobile,
-    validEmail,
-    isAlphanumeric,
-    isChinese,
-    isEmoticon,
-    validAlphabets,
-  } from "@/utils/validate";
-   export default {
-    name: 'storeManage',
-    props: ["showModel", "id", "isDetail","sitem"],
-    mixins: [resToken],
-    data() {
-      const validateusername = (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("账号不能为空!"));
-        } else {
-          if (value.length < 6 || value.length > 18) {
-            callback(new Error("账号规则为6~18位数字与字母组合!"));
-          } else {
-            if (isnumber(value)) {
-              callback(new Error("账号规则为6~18位数字与字母组合!"));
-            } else if (validAlphabets(value)) {
-              callback(new Error("账号规则为6~18位数字与字母组合!"));
-            } else if (!isAlphanumeric(value)) {
-              callback(new Error("账号规则为6~18位数字与字母组合!"));
-            } else {
-              callback();
-            }
-          }
-        }
-      };
-      const validatename = (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("真实姓名不能为空!"));
-        } else {
-          if (value.length < 2 || value.length > 12) {
-            callback(new Error("真实姓名规则为2~12位汉字!"));
-          } else {
-            if (!isChinese(value)) {
-              console.log(9999);
-              callback(new Error("真实姓名规则为2~12位汉字!"));
-            } else if (isEmoticon(value)) {
-              console.log(2345);
-              callback(new Error("真实姓名规则为2~12位汉字!"));
-            } else {
-              callback();
-            }
-          }
-        }
-      };
-      const validatemobile = (rule, value, callback) => {
-        if (value === "") {
-          callback(new Error("手机号不能为空!"));
-        } else {
-          if (!isMobile(value)) {
-            callback(new Error("手机号格式不正确!"));
-          } else {
-            callback();
-          }
-        }
-      };
-  
-      const validateEmail = (rule, value, callback) => {
-        if (value === "") {
-          callback();
-        } else {
-          if (!validEmail(value)) {
-            callback(new Error("邮箱格式不正确!"));
-          } else {
-            callback();
-          }
-        }
-      };
-      return {
-        loading: false,
-        title: "添加账号",
-        showModelThis: this.showModel,
-        ruleForm: {
-          username: "", // 账号
-          name: "", // 真实姓名
-          mobile: "",
-          email: "",
-          role_id: "",
-          status: "1",
-          item: [],
-        },
-        rulesThis: this.rules,
-        rules: {
-          name: [
-            {
-              required: true,
-              validator: validatename,
-              trigger: "blur",
-            },
-          ],
-          username: [
-            {
-              required: true,
-              validator: validateusername,
-              trigger: "blur",
-            },
-          ],
-          mobile: [
-            {
-              required: true,
-              validator: validatemobile,
-              trigger: "blur",
-            },
-          ],
-          email: [
-            {
-              required: false,
-              validator: validateEmail,
-              trigger: "blur",
-            },
-          ],
-          role_id: [
-            {
-              required: true,
-              message: "请选择角色",
-              trigger: "change",
-            },
-          ],
-          item: [
-            {
-              type: "array",
-              required: true,
-              message: "请选择所在部门",
-              trigger: "change",
-            },
-          ],
-          status: [
-            {
-              required: true,
-              message: "请选择状态",
-              trigger: "change",
-            },
-          ],
-        }
-      };
-    },
-    watch: {
-      showModel: function(val) {
-        this.showModelThis = val;
-        if (val) {
-          this.initForm();
-        }
+import asyncRequest from "@/apis/service/purchaseIn/storeManage";
+import resToken from "@/mixins/resToken";
+export default {
+  name: "storeManage",
+  props: ["showModel", "id", "isDetail"],
+  mixins: [resToken],
+  data() {
+    return {
+      loading: false,
+      title: "新建备货申请",
+      showModelThis: this.showModel,
+      ruleForm: {
+        goods_name: "", //商品名称
+        goods_num: "", //商品数量
+        last_go_stock: "", //最晚入库时间
+        stock_in_rule: "", //入库仓库
       },
-      showModelThis(val) {
-        if (!val) {
-          this.$emit("cancel");
-        }
+      rulesThis: this.rules,
+      rules: {
+        //出入库规则
+        goods_name: [
+          {
+            required: true,
+            message: "商品名称不能为空",
+            trigger: "blur",
+          },
+        ],
+        goods_num: [
+          {
+            required: true,
+            message: "请选择入库仓库",
+            trigger: "blur",
+          },
+        ],
+        last_go_stock: [
+          {
+            // type: "date",
+            required: true,
+            message: "请输入入库最晚时间",
+            // trigger: "blur" ,
+            trigger: ["blur", "change"],
+          },
+        ],
+        stock_in_rule: [
+          {
+            required: true,
+            message: "请选择入库仓库",
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  watch: {
+    showModel: function (val) {
+      this.showModelThis = val;
+      if (val) {
+        this.initForm();
       }
     },
-    methods: {
-      closeModel() {
-        console.log("closeModel!!");
-      },
-      async initForm() {
-        this.loading = true;
-        // await this.getRole();
-        if (this.id === "add") {
-          this.title = "添加账号";
-          this.rulesThis = this.rules;
-          await this.resetForm();
+    showModelThis(val) {
+      if (!val) {
+        this.$emit("cancel");
+      }
+    },
+  },
+  methods: {
+    // 最晚入库时间选择
+    selectTime(e) {
+      console.log(e);
+      this.ruleForm.last_go_stock = e;
+    },
+    closeModel() {
+      console.log("closeModel!!");
+    },
+    async initForm() {
+      this.loading = true;
+      // await this.getRole();
+      if (this.id === "add") {
+        this.rulesThis = this.rules;
+        await this.resetForm();
+      } else {
+        if (this.isDetail) {
+          this.rulesThis = {};
         } else {
-          if (this.isDetail) {
-            this.title = "账号详情";
-            this.rulesThis = {};
-          } else {
-            this.title = "修改账号";
-            this.rulesThis = this.rules;
-          }
-          await this.resetForm(this.sitem);
-          // await this.initData()
+          this.rulesThis = this.rules;
         }
-        this.loading = false;
-      },
-      // async getRole() {
-      //   const model = {
-      //     status: "", // 状态
-      //     level: "", // 姓名
-      //     role_name: "",
-      //   };
-      //   const res = await asyncRequest.getRole(model);
-      //   if (res && res.code === 0 && res.data) {
-      //     this.roleList = res.data;
-      //     this.roleList.map((v1) => {
-      //       v1.id += "";
-      //       v1.status += "";
-      //       return v1;
-      //     });
-      //   }
-      // },
-      async initData() {
-        const res = await asyncRequest.detail({ id: this.id });
+        await this.resetForm();
+        // await this.initData()
+      }
+      this.loading = false;
+    },
+    // async getRole() {
+    //   const model = {
+    //     status: "", // 状态
+    //     level: "", // 姓名
+    //     role_name: "",
+    //   };
+    //   const res = await asyncRequest.getRole(model);
+    //   if (res && res.code === 0 && res.data) {
+    //     this.roleList = res.data;
+    //     this.roleList.map((v1) => {
+    //       v1.id += "";
+    //       v1.status += "";
+    //       return v1;
+    //     });
+    //   }
+    // },
+    async initData() {
+      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;
@@ -280,83 +199,80 @@
       } else {
         this.$message.warning(res.message);
       }
-      },
-      async resetForm(sitem) {
-        // 重置
-        await this.$nextTick(() => {
-          if (this.$refs.ruleForm) {
-            this.$refs.ruleForm.resetFields();
-            this.$refs.ruleForm.clearValidate();
-            const { username, nickname, mobile, email, roleid, status, item } =
-              sitem;
-            this.ruleForm = {
-              username: username || "", // 账号
-              name: nickname || "", // 真实姓名
-              mobile: mobile || "",
-              email: email || "",
-              role_id: roleid || "",
-              status: status || "",
-              item: item || [],
-            };
-            if (this.id === "add" || this.isDetail) {
-              this.rules.username[0].required = false;
-            }
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+            goods_name: "GD-GY199803100001", //商品名称
+            goods_num: "100", //商品数量
+            last_go_stock: "", //最晚入库时间
+            stock_in_rule: "WSMcmpk211008104949", //入库仓库
+          };
+          if (this.id === "add" || this.isDetail) {
+            // this.rules.username[0].required = false;
+            console.log("当前是add或者 this.isDetail是true");
           }
-        });
-      },
-    
-      async submitForm() {
-        await this.$refs.ruleForm.validate(async (valid) => {
-          if (valid) {
-            this.loading = true;
-            const { username, name, mobile, email, role_id, status } = JSON.parse(
-              JSON.stringify(this.ruleForm)
-            );
-            const model = {
-              id: this.id,
-              username: username || "", // 账号
-              nickname: name || "", // 真实姓名
-              mobile: mobile || "",
-              email: email || "",
-              role: role_id || "",
-              status: status || "",
-            };
-            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) {
-              const title = this.id === "add" ? "添加成功" : "修改成功";
-              this.$notify.success({
-                title,
-                message: "",
-              });
-              this.showModelThis = false;
-              // 刷新
-              this.$emit("refresh");
-            } else if (res && res.code >= 100 && res.code <= 104) {
-              await this.logout();
-            } else {
-              this.$message.warning(res.message);
-            }
+        }
+      });
+    },
+
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.loading = true;
+          console.log(this.ruleForm);
+          // const { username, name, mobile, email, role_id, status } = JSON.parse(
+          //
+          // );
+
+          const { goods_num, goods_name, last_go_stock, stock_in_rule } =
+            this.ruleForm;
+          const model = {
+            good_code: goods_name || "",
+            good_type_code: "GY199803100001",
+            good_num: goods_num || "",
+            wsm_code: stock_in_rule || "",
+            lastime: last_go_stock || "",
+          };
+          console.log(model);
+          let res = {};
+          if (this.id === "add") {
+            delete model["id"];
+            res = await asyncRequest.add(model);
           } else {
-            console.log("error submit!!");
-            return false;
+            res = await asyncRequest.update(model);
           }
-        });
-      },
+          this.loading = false;
+          if (res && res.code === 0) {
+            const title = this.id === "add" ? "添加成功" : "修改成功";
+            this.$notify.success({
+              title,
+              message: "",
+            });
+            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>
+  },
+};
+</script>
 
    <style lang="scss" scoped>
-   .storeManage {
-    
-   }
-   </style>
+.storeManage {
+}
+</style>
    

+ 14 - 4
src/views/purchaseIn/storeManage/index.vue

@@ -61,6 +61,7 @@
                     icon="el-icon-search"
                     @click="searchList"
                 /></el-col>
+
                 <el-col :span="4" style="width: 66px">
                   <el-button
                     type="warning"
@@ -71,7 +72,16 @@
                     重置
                   </el-button>
                 </el-col>
-
+                <el-col :span="4" style="width: 66px">
+                  <el-button
+                    type="warning"
+                    class="fr"
+                    :size="searchSize"
+                    @click="handleClick"
+                  >
+                    进入详情
+                  </el-button>
+                </el-col>
                 <el-col :span="3" style="width: 66px; float: right">
                   <el-button
                     :size="searchSize"
@@ -92,7 +102,7 @@
                     class="fl"
                     :size="searchSize"
                     type="success"
-                    @click="addStockFlow"
+                    @click="openModal('add', false)"
                   >
                     新建
                   </el-button>
@@ -312,8 +322,8 @@ export default {
   methods: {
     //跳转到新建页面
 
-    addStockFlow() {
-      console.log("新建申请");
+    handleClick() {
+      console.log("采购反馈");
       this.$router.push({
         path: "storeManageFlow",
       });

+ 367 - 56
src/views/purchaseIn/storeManageFlow/components/newSetStock.vue

@@ -4,55 +4,223 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
+      <el-divider content-position="center">备货申请详情</el-divider>
       <el-form
         :model="ruleForm"
         :rules="rules"
         ref="ruleForm"
         label-width="120px"
+        disabled="true"
       >
-        <el-form-item label="商品名称" prop="goods_name">
-          <el-input
-            style="width: 30%"
-            v-model="ruleForm.goods_name"
-            placeholder="请输入内容"
-            :size="searchSize"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="采购数量" prop="goods_num">
-          <el-input
-            style="width: 30%"
-            v-model="ruleForm.goods_num"
-            placeholder="请输入内容"
-            :size="searchSize"
-          ></el-input>
-        </el-form-item>
-        <el-form-item label="最晚入库时间" prop="last_go_stock">
-          <el-date-picker
-            style="width: 30%"
-            :size="searchSize"
-            v-model="ruleForm.last_go_stock"
-            type="date"
-            placeholder="选择日期"
-            @change="selectTime"
-            :picker-options="startDatePicker"
-          >
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="入库仓库" prop="stock_in_rule">
-          <el-cascader
-            placeholder="请选择入库仓库"
-            filterable
-            clearable
-            :size="searchSize"
-            v-model="ruleForm.stock_in_rule"
-            :options="options"
-            style="width: 30%"
-            @change="
-              pageInfo.curr = 1;
-              parmValue.page = 1;
-              stockName();
-            "
-          ></el-cascader>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="商品名称" prop="goods_name">
+              <el-input
+                style="width: 100%"
+                v-model="ruleForm.goods_name"
+                placeholder="请输入内容"
+                :size="searchSize"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <!-- <el-col :span="12">
+            <el-form-item label="商品数量" prop="goods_name">
+              <el-input
+                style="width: 100%"
+                v-model="ruleForm.goods_name"
+                placeholder="请输入内容"
+                :size="searchSize"
+              ></el-input>
+            </el-form-item>
+          </el-col> -->
+          <el-col :span="12">
+            <el-form-item label="采购数量" prop="goods_num">
+              <el-input
+                style="width: 100%"
+                v-model="ruleForm.goods_num"
+                placeholder="请输入内容"
+                :size="searchSize"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="最晚入库时间" prop="last_go_time">
+              <el-date-picker
+                style="width: 100%"
+                :size="searchSize"
+                v-model="ruleForm.last_go_time"
+                type="date"
+                value-format="timestamp"
+                placeholder="选择日期"
+                @change="selectTime"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="入库仓库" prop="stock_in_rule">
+              <el-cascader
+                placeholder="请选择入库仓库"
+                filterable
+                clearable
+                :size="searchSize"
+                v-model="ruleForm.stock_in_rule"
+                :options="options"
+                style="width: 100%"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  stockName();
+                "
+              ></el-cascader>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <!-- <el-row>
+          <el-col :span="12">
+            <el-form-item label="收件人" prop="consignee">
+              <search-account
+                :value="ruleForm.consignee"
+                :size="searchSize"
+                style="width: 100%"
+                @searchChange="handleResignName"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="电话" prop="mobile">
+              <el-input
+                v-model="ruleForm.mobile"
+                placeholder="请输入电话"
+                :size="searchSize"
+                style="width: 100%"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row> -->
+        <!-- <el-row>
+          <el-col :span="12">
+            <el-form-item label="收货地址" prop="receivedArea">
+              <select-area
+                :value="ruleForm.receivedArea"
+                :size="searchSize"
+                :placeholder="'请输入收货地址'"
+                style="width: 100%"
+                @selectChange="selectArea"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="详细地址" prop="detailArea">
+              <el-input
+                :size="searchSize"
+                v-model="ruleForm.detailArea"
+                style="width: 100%"
+                placeholder="详细地址"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row> -->
+        <!-- <el-row>
+          <el-col :span="12">
+            <el-form-item label="物流单号" prop="express_number">
+              <el-input
+                :size="searchSize"
+                style="width: 100%"
+                placeholder="物流单号"
+                v-model="ruleForm.express_number"
+              /> </el-form-item
+          ></el-col>
+          <el-col :span="12">
+            <el-form-item label="发货时间" prop="send_out_time">
+              <el-date-picker
+                style="width: 100%"
+                :size="searchSize"
+                v-model="ruleForm.send_out_time"
+                value-format="timestamp"
+                type="date"
+                placeholder="选择日期"
+                @change="selectOutTime"
+              >
+              </el-date-picker> </el-form-item
+          ></el-col>
+        </el-row> -->
+
+        <!-- <el-form-item>
+          <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="submitForm('ruleForm')"
+              >保 存 并 发 起 流 程
+            </el-button>
+          </el-col>
+        </el-form-item> -->
+      </el-form>
+      <el-divider content-position="center">采购反馈</el-divider>
+      <el-form
+        :model="ruleForm"
+        :rules="ruless"
+        ref="ruleForm"
+        label-width="120px"
+      >
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="出库仓库" prop="stock_go_rule">
+              <el-cascader
+                placeholder="请选择出库仓库"
+                filterable
+                clearable
+                :size="searchSize"
+                v-model="ruleForm.stock_go_rule"
+                :options="options"
+                style="width: 100%"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  stockName();
+                "
+              ></el-cascader> </el-form-item
+          ></el-col>
+          <el-col :span="12">
+            <el-form-item label="预计入库时间" prop="expect_go_stock">
+              <el-date-picker
+                style="width: 100%"
+                :size="searchSize"
+                v-model="ruleForm.expect_go_stock"
+                type="date"
+                value-format="timestamp"
+                placeholder="选择日期"
+                @change="selectTime"
+              >
+              </el-date-picker> </el-form-item
+          ></el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12"
+            ><el-form-item label="采购数量上限" prop="goods_num_limit">
+              <el-input
+                style="width: 100%"
+                v-model="ruleForm.goods_num_limit"
+                placeholder="请输入数量上限"
+                :size="searchSize"
+              ></el-input> </el-form-item
+          ></el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12"
+            ><el-form-item label="备注" prop="remark">
+              <el-input
+                type="textarea"
+                placeholder="请输入备注"
+                v-model="ruleForm.remark"
+                :autosize="{ minRows: 2, maxRows: 6 }"
+              /> </el-form-item
+          ></el-col>
+        </el-row>
+        <el-form-item>
           <el-col :span="24" style="text-align: right; margin-top: 10px">
             <el-button type="primary" @click="save('ruleForm')"
               >保 存
@@ -76,7 +244,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";
 export default {
   name: "allotFlow",
   mixins: [mixinPage, resToken],
@@ -96,12 +264,42 @@ 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 {
+      inTime: "",
+      goTime: "",
       ruleForm: {
         goods_name: "", //商品名称
         goods_num: "", //商品数量
-        last_go_stock: "", //最晚入库时间
-        stock_in_rule: "",
+        last_go_time: "", //最晚入库时间
+        stock_in_rule: "", //入库仓库
+        goods_num_limit: "", //采购数量上限
+        expect_go_time: "", //预计入库时间
+        stock_go_rule: "", //出库仓库
+        remark: "", //备注
       },
       rules: {
         //出入库规则
@@ -119,7 +317,7 @@ export default {
             trigger: "blur",
           },
         ],
-        last_go_stock: [
+        last_go_time: [
           {
             // type: "date",
             required: true,
@@ -135,6 +333,88 @@ export default {
             trigger: "change",
           },
         ],
+        consignee: [
+          {
+            type: "array",
+            required: true,
+            message: "收货人不能为空",
+            trigger: "change",
+          },
+        ],
+        mobile: [
+          {
+            required: true,
+            message: "电话号不能为空",
+            trigger: "blur",
+          },
+          {
+            validator: validatemobile,
+          },
+        ],
+        receivedArea: [
+          {
+            type: "array",
+            required: true,
+            message: "收货地址不能为空",
+            trigger: "change",
+          },
+        ],
+        detailArea: [
+          {
+            required: true,
+            message: "请输入详细地址",
+            trigger: "blur",
+          },
+        ],
+        express_number: [
+          {
+            required: true,
+            message: "请输入快递单号",
+            trigger: "blur",
+          },
+          {
+            validator: validateExpressNumber,
+          },
+        ],
+        send_out_time: [
+          {
+            required: true,
+            message: "请输发货时间",
+            trigger: ["blur", "change"],
+          },
+        ],
+      },
+      ruless: {
+        stock_go_rule: [
+          {
+            required: true,
+            message: "请选择出库仓库",
+            trigger: "change",
+          },
+        ],
+        goods_num_limit: [
+          {
+            required: true,
+            message: "请输入数量上限",
+            trigger: "blur",
+          },
+        ],
+        expect_go_stock: [
+          {
+            // type: "date",
+            required: true,
+            message: "请输入入库最晚时间",
+            // trigger: "blur" ,
+            trigger: ["blur", "change"],
+          },
+        ],
+        remark: [
+          {
+            required: true,
+            message: "请输入备注",
+            trigger: "blur",
+          },
+        ],
       },
       loading: true,
       showModel: false,
@@ -181,20 +461,37 @@ export default {
       parmValue: {},
     };
   },
-  mounted() {
-    // this.searchList();
-    // this.stockName; //假数据,获取二级仓库名
-    console.log(this.stockName);
-    console.log(this.selectTime);
-  },
-
   methods: {
+    // 选择省市区
+    selectArea(e) {
+      // console.log(e);
+      if (e && e.length == 3) {
+        this.ruleForm.receivedArea = e;
+      } else {
+        this.ruleForm.consignee = [];
+      }
+      // console.log(this.ruleForm);
+      this.$refs.ruleForm.validateField("receivedArea");
+    },
+    // 选择收获人
+    handleResignName(e) {
+      if (e && e.id) {
+        this.ruleForm.consignee = [e.id];
+      } else {
+        this.ruleForm.consignee = [];
+      }
+      this.$refs.ruleForm.validateField("consignee");
+    },
+    // 最晚入库时间选择
     selectTime(e) {
       console.log(e);
-      console.log(e.toString());
       this.ruleForm.goTime = e;
-      console.log();
     },
+    // 发货时间选择
+    selectOutTime(e) {
+      console.log(e);
+    },
+    // 保存按钮
     save(formName) {
       console.log("save");
       this.$refs[formName].validate((valid) => {
@@ -205,6 +502,13 @@ export default {
           return false;
         }
       });
+      if (this.ruleForm.goTime < this.ruleForm.send_out_time) {
+        this.$message({
+          showClose: true,
+          message: "最晚入库时间不能小于发货时间",
+          type: "error",
+        });
+      }
     },
     submitForm(formName) {
       console.log("sds");
@@ -217,6 +521,13 @@ export default {
           return false;
         }
       });
+      if (this.ruleForm.goTime < this.ruleForm.send_out_time) {
+        this.$message({
+          showClose: true,
+          message: "最晚入库时间不能小于发货时间",
+          type: "error",
+        });
+      }
     },
   },
   restSearch() {