戴艳蓉 3 years ago
parent
commit
6ea32cee9f

+ 10 - 1
src/components/globalComponents/search-stock/main.vue

@@ -75,11 +75,17 @@ export default {
   },
   watch: {
     companyCode: function (val, old) {
-      console.log(val);
       if (this.isRelation && val !== "") {
         this.remoteMethod(val);
       }
     },
+    //  names: function (val, old) {
+    //   // console.log(val, old);
+    //   this.searchName = val;
+    //   if (this.isDetail && this.searchName) {
+    //     this.remoteMethod(this.searchName);
+    //   }
+    // },
   },
   mounted() {
     this.options = [];
@@ -94,6 +100,9 @@ export default {
             id: this.options[index].id,
             code: this.options[index].wsm_code,
             label: this.options[index].name,
+            contactor: this.options[index].wsm_name,
+            mobile: this.options[index].mobile,
+            addr: this.options[index].addr_cn + this.options[index].wsm_addr,
           };
           this.$emit("searchChange", model);
         } else {

+ 1 - 0
src/views/sellOut/returnOrder/columns.js

@@ -101,6 +101,7 @@ export default [
         },
         {
           prop: "",
+          width:50,
           label: "操作",
           fixed: "right",
           _noset_: true,

+ 0 - 39
src/views/sellOut/returnOrder/index.vue

@@ -3,7 +3,6 @@
     <div
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      {{ powers }}
       <ex-table
         v-loading="loading"
         :table="table"
@@ -103,7 +102,6 @@
                     placeholder="请选择"
                   >
                     <el-option label="快递单号" value="expressNo"></el-option>
-
                     <el-option label="客户编号" value="customerNo"></el-option>
                     <el-option label="售后单编号" value="serviceNo"></el-option>
                     <el-option
@@ -157,43 +155,6 @@
               @click="routeGoto('returnOrderDetail', { id: scope.row.thNo })"
             ></i>
           </el-tooltip>
-          <el-tooltip
-            v-if="powers.some((item) => item == '005')"
-            effect="dark"
-            content="修改"
-            placement="top"
-          >
-            <i
-              class="el-icon-edit tb-icon"
-              @click="openModal(scope.row.id, false, scope.row)"
-            ></i>
-          </el-tooltip>
-          <el-tooltip
-            v-if="
-              powers.some((item) => item == '004') && scope.row.status === '1'
-            "
-            effect="dark"
-            content="禁用"
-            placement="top"
-          >
-            <i
-              class="el-icon-video-pause tb-icon"
-              @click="statusConfirm(scope.row.id, scope.row.status)"
-            ></i>
-          </el-tooltip>
-          <el-tooltip
-            v-if="
-              powers.some((item) => item == '004') && scope.row.status === '0'
-            "
-            effect="dark"
-            content="启用"
-            placement="top"
-          >
-            <i
-              class="el-icon-video-play tb-icon"
-              @click="statusConfirm(scope.row.id, scope.row.status)"
-            ></i>
-          </el-tooltip>
         </template>
       </ex-table>
       <add-edit

+ 7 - 122
src/views/sellOut/salesOrder/addEdit.vue

@@ -13,7 +13,7 @@
     element-loading-spinner="el-icon-loading"
     element-loading-background="rgba(0, 0, 0, 0.8)"
   >
-    <el-card style="margin:-20px 0 0 0">
+    <el-card style="margin: -20px 0 0 0">
       <add-edit-form
         v-if="showModel"
         :showModel="showModel"
@@ -30,16 +30,7 @@
 import asyncRequest from "@/apis/service/sellOut/sellReturnList";
 import resToken from "@/mixins/resToken";
 import addEditForm from "./addEditForm";
-
-import {
-  isnumber,
-  isMobile,
-  validEmail,
-  isAlphanumeric,
-  isChinese,
-  isEmoticon,
-  validAlphabets,
-} from "@/utils/validate";
+import { isMobile } from "@/utils/validate";
 import addEdit from "../../interest/account/addEdit.vue";
 import AddEditForm from "../../interest/handover/components/addEditForm.vue";
 export default {
@@ -48,42 +39,6 @@ export default {
   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)) {
-            callback(new Error("真实姓名规则为2~12位汉字!"));
-          } else if (isEmoticon(value)) {
-            callback(new Error("真实姓名规则为2~12位汉字!"));
-          } else {
-            callback();
-          }
-        }
-      }
-    };
     const validatemobile = (rule, value, callback) => {
       if (value === "") {
         callback(new Error("手机号不能为空!"));
@@ -95,18 +50,6 @@ export default {
         }
       }
     };
-
-    const validateEmail = (rule, value, callback) => {
-      if (value === "") {
-        callback();
-      } else {
-        if (!validEmail(value)) {
-          callback(new Error("邮箱格式不正确!"));
-        } else {
-          callback();
-        }
-      }
-    };
     return {
       noSendNumbers: "", //收货-未发货数量
       noSendNum: "", //销售-未发货数量
@@ -120,10 +63,6 @@ export default {
         return_remark: "", //退货备注
         return_num: "", //退货数量
         returnReason: [], //退货原因
-        // email: "",
-        // role_id: "",
-        // status: "1",
-        // item: [],
       },
       rulesThis: this.rules,
       rules: {
@@ -131,7 +70,6 @@ export default {
           {
             required: true,
             message: "请选择退货原因",
-            // type: "array",
             trigger: "change",
           },
         ],
@@ -171,68 +109,16 @@ export default {
   },
 
   methods: {
-    
-    // 获取退换货原因
-    async getReason() {
-      this.loading = true;
-      let model = {
-        page: 1,
-        size: 100,
-        type: "5",
-      };
-      const res = await asyncRequest.getReason(model);
-      if (res && res.code === 0 && res.data) {
-        const { list } = res.data;
-        list.forEach((element) => {
-          let obj = {
-            value: element.result_code,
-            label: element.result,
-            id: element.id,
-          };
-          this.reason_options.push(obj);
-        });
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout();
-      } else {
-        this.tableData = [];
-        this.pageInfo.total = 0;
-      }
-      this.loading = false;
-    },
     async initForm() {
       this.loading = true;
-      // await this.getRole();
-      if (this.id === "add") {
-        this.title = "添加销售退货单";
-        this.rulesThis = this.rules;
-        await this.resetForm();
-      } else {
-        if (this.isDetail) {
-          this.title = "添加销售退货单详情";
-          this.rulesThis = {};
-        } else {
-          this.title = "修改添加销售退货单";
-          this.rulesThis = this.rules;
-        }
-        await this.resetForm(this.sitem);
-        // await this.initData()
-      }
-      this.getReason(); //获取退还货原因
+      this.title = "添加销售退货单";
+      // this.rulesThis = this.rules;
+      // await this.resetForm();
+      // this.getReason(); //获取退还货原因
 
       this.loading = false;
     },
-    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;
-      // } else if (res && res.code >= 100 && res.code <= 104) {
-      //   await this.logout();
-      // } else {
-      //   this.$message.warning(res.message);
-      // }
-    },
-    async resetForm(sitem) {
+    async resetForm() {
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
@@ -249,7 +135,6 @@ export default {
             return v;
           });
           this.tableForm.product_go = [].concat(...list);
-
           addrs.forEach((ele) => {
             this.noSendNumbers += ele.wsend_num;
           });

+ 4 - 5
src/views/sellOut/sellAfterApply/components/addEdit.vue

@@ -12,10 +12,6 @@
     element-loading-background="rgba(0, 0, 0, 0.8)"
     @close="showModelThis = false"
   >
-    <!-- <p>orderCode{{ sitem }}</p> -->
-    <!-- <p>outCode{{ outCode }}</p> -->
-
-
     <el-card style="margin-top: -20px" v-loading="loading">
       <add-edit-form
         v-if="showModel"
@@ -23,7 +19,7 @@
         :sitem="sitem"
         :show-model="showModel"
         :is-detail="isDetail"
-        @closeModel="handClick"
+        @closeModel="aaa(e)"
         @refresh="refresh"
       />
     </el-card>
@@ -77,6 +73,9 @@ export default {
     handClick(e) {
       this.showModelThis = e;
     },
+    aaa(e){
+      console.log(e);
+    },
     refresh(e) {
       this.showModelThis = e;
       this.$emit("refresh", true);

+ 40 - 17
src/views/sellOut/sellAfterApply/components/express_feedback.vue

@@ -15,9 +15,14 @@
           <search-supplier
             :size="searchSize"
             :value="ruleForm.wsm_supplierNo"
-            :disabled="false"
+            :disabled="
+              !(status === '2' && powers.some((item) => item == '040'))
+            "
             :placeholder="'仓库所在公司'"
-            :isDetail="false"
+            :names="wsm_supplier_name"
+            :isDetail="
+              !(status === '2' && powers.some((item) => item == '040'))
+            "
             @searchChange="supplierChange"
           />
         </el-form-item>
@@ -28,10 +33,15 @@
             :size="searchSize"
             :value="ruleForm.wsm_code"
             :placeholder="'退库仓库'"
-            :disabled="false"
-            :isDetail="false"
+            :disabled="
+              !(status === '2' && powers.some((item) => item == '040'))
+            "
+            :isDetail="
+              !(status === '2' && powers.some((item) => item == '040'))
+            "
             :isRelation="true"
-            :companyCode="ruleForm.wsm_supplier"
+            :names="wsm_code_name"
+            :companyCode="wsm_supplier_code"
             @searchChange="stockChange"
           />
         </el-form-item>
@@ -66,7 +76,11 @@
           </el-form-item>
         </el-col>
       </el-col>
-      <el-col :span="24" style="text-align: right; margin: 0 0 20px 0">
+      <el-col
+        :span="24"
+        style="text-align: right; margin: 0 0 20px 0"
+        v-if="status === '2' && powers.some((item) => item == '040')"
+      >
         <el-button type="primary" @click="submitForm" size="mini"
           >保 存</el-button
         >
@@ -86,6 +100,8 @@ export default {
       loading: false,
       status: "", //存储详情接口返的状态
       showModelThis: this.showModel,
+      wsm_supplier_name: "",
+      wsm_code_name: "",
       ruleForm: {
         wsm_supplier: "",
         wsm_supplierNo: [],
@@ -103,7 +119,7 @@ export default {
             message: "请选择仓库所在公司",
           },
         ],
-          wsm_code: [
+        wsm_code: [
           {
             type: "array",
             required: true,
@@ -165,8 +181,13 @@ export default {
             mobile,
             contactor,
             wsm_supplierNo,
+            wsm_supplier,
+            wsm_name,
           } = this.sitem;
           this.status = status;
+          this.wsm_supplier_name = wsm_supplier;
+          this.wsm_code_name = wsm_name;
+          this.wsm_supplier_code = wsm_supplierNo;
           this.ruleForm = {
             returnCode: returnCode || "",
             wsm_code: return_wsm ? [return_wsm] : [],
@@ -182,8 +203,9 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           this.loading = true;
+
           let model = {
-            returnCode: this.orderCode,
+            returnCode: this.ruleForm.returnCode,
             wsm_code: this.ruleForm.wsm_codeNo,
           };
           const res = await asyncRequest.afterFeed(model);
@@ -208,23 +230,24 @@ export default {
 
     async supplierChange(e) {
       if (e && e.id) {
-        this.ruleForm.wsm_supplier = e.code;
+        this.wsm_supplier_code = e.code;
         this.ruleForm.wsm_supplierNo = [e.code];
       } else {
-        this.ruleForm.wsm_supplierNo = "";
         this.ruleForm.wsm_supplier = [];
+        this.wsm_supplier_code = "";
       }
       this.ruleForm.wsm_code = "";
       this.wsm_code = [];
+      this.ruleForm.contactor = "";
+      this.ruleForm.mobile = "";
+      this.ruleForm.addr = "";
     },
     async stockChange(e) {
-      if (e && e.id) {
-        this.ruleForm.wsm_codeNo = e.code;
-        this.ruleForm.wsm_code = [e.code];
-      } else {
-        this.ruleForm.wsm_codeNo = "";
-        this.ruleForm.wsm_code = [];
-      }
+      this.ruleForm.wsm_codeNo = e && e.id ? e.code : "";
+      this.ruleForm.wsm_code = e && e.id ? [e.code] : [];
+      this.ruleForm.contactor = e && e.id ? e.contactor : "";
+      this.ruleForm.mobile = e && e.id ? e.mobile : "";
+      this.ruleForm.addr = e && e.id ? e.addr : "";
     },
   },
 };

+ 0 - 362
src/views/sellOut/sellAfterApply/components/supplier_feedback.vue

@@ -1,362 +0,0 @@
-<template>
-  <el-form
-    ref="ruleForm"
-    :loading="loading"
-    :model="ruleForm"
-    status-icon
-    :rules="rulesThis"
-    label-width="100px"
-    style="width: 100%"
-    class="demo-ruleForm"
-  >
-    <el-row>
-      <el-row>
-        <el-col :span="12">
-          <el-form-item label="是否同意" prop="whether_back">
-            <el-select
-              style="width: 100%"
-              v-model="ruleForm.whether_back"
-              placeholder="请选择是否同意退回"
-              @change="handleView"
-            >
-              <el-option
-                v-for="item in whether_back_options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="反馈备注" prop="feedback_remark">
-            <el-input
-              type="textarea"
-              placeholder="请输入反馈备注"
-              v-model="ruleForm.feedback_remark"
-              maxlength="250"
-              show-word-limit
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row v-if="ruleForm.whether_back === 'value1'">
-        <el-col :span="12">
-          <el-form-item label="退回地址" prop="return_goods_addr">
-            <select-area
-              :placeholder="'请选择省/市/区'"
-              :value="ruleForm.return_goods_addr"
-              :is-detail="id !== 'add'"
-              @selectChange="selectAreaAddr_code"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="详细地址" prop="addr_detail">
-            <el-input
-              v-model="ruleForm.addr_detail"
-              placeholder="请输入退货详细地址"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="收件人" prop="addressee">
-            <el-input
-              v-model="ruleForm.addressee"
-              placeholder="请输入收件人"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="收件人电话" prop="addressee_phone">
-            <el-input
-              v-model="ruleForm.addressee_phone"
-              placeholder="请输入收件人电话"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="物流要求" prop="express_require">
-            <el-input
-              v-model="ruleForm.express_require"
-              placeholder="请输入物流"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-col :span="24" style="text-align: right">
-        <el-button type="primary" @click="submitForm" v-if="true"
-          >保 存</el-button
-        >
-        <el-button
-          type="primary"
-          @click="statusConfirm('1', '发起审核流程')"
-          v-if="status === '0' && powers.some((item) => item == '012')"
-          >发起审核流程
-        </el-button>
-        <el-button
-          @click="statusConfirm('0', '取消审核流程')"
-          plain
-          v-if="status === '1' && powers.some((item) => item == '014')"
-          >取消审核流程</el-button
-        >
-        <el-button
-          @click="statusConfirm('-1', '作废该条信息')"
-          type="danger"
-          plain
-          v-if="
-            (status === '0' || status === '1') &&
-            powers.some((item) => item == '015')
-          "
-          >作废该条信息</el-button
-        >
-        <el-button
-          @click="statusConfirm('2', '通过审核')"
-          type="primary"
-          v-if="status === '1' && powers.some((item) => item == '016')"
-          >通过审核</el-button
-        >
-      </el-col>
-    </el-row>
-  </el-form>
-</template>
-<script>
-import { isMobile } from "@/utils/validate.js";
-import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
-import resToken from "@/mixins/resToken";
-export default {
-  name: "sellAfterApplyDetail",
-  props: ["id", "showModelThis", "newTime"],
-  mixins: [resToken],
-  data() {
-    const validatemobile = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
-      } else {
-        if (!isMobile(value)) {
-          callback(new Error("手机号格式不正确!"));
-        } else {
-          callback();
-        }
-      }
-    };
-    return {
-      loading: false,
-      status: "", //存储详情接口返的状态
-      showModelThis: this.showModel,
-      ruleForm: {
-        whether_back: "", //是否同意退回
-        feedback_remark: "", //反馈备注
-        return_goods_addr: [], //退货地址
-        addr_detail: "", //退货详细地址
-        addressee: "", //收件人
-        addressee_phone: "", //收件人电话
-        express_require: "", //物流要求
-      },
-      rulesThis: this.rules,
-      // 验证规则
-      rules: {
-        whether_back: [
-          {
-            required: true,
-            trigger: "change",
-            message: "请选择是否同意退回",
-          },
-        ],
-        feedback_remark: [
-          {
-            required: true,
-            message: "请输入反馈备注",
-            trigger: "blur",
-          },
-        ],
-        return_goods_addr: [
-          {
-            type: "array",
-            required: true,
-            message: "请选择退回地址所在省/市/区",
-            trigger: "change",
-          },
-        ],
-        addr_detail: [
-          {
-            required: true,
-            message: "请输入详细退货地址",
-            trigger: "blur",
-          },
-        ],
-        addressee: [
-          {
-            required: true,
-            message: "请输入收件人",
-            trigger: "blur",
-          },
-        ],
-        addressee_phone: [
-          {
-            required: true,
-            trigger: "blur",
-            validator: validatemobile,
-          },
-        ],
-        express_require: [
-          {
-            required: true,
-            trigger: "blur",
-            message: "请输入物流信息",
-          },
-        ],
-      },
-      whether_back_options: [
-        {
-          value: "value1",
-          label: "同意退回",
-        },
-        {
-          value: "value2",
-          label: "拒绝退回",
-        },
-      ],
-    };
-  },
-  computed: {
-    powers() {
-      let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "sellAfterApplyDetail"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
-    },
-  },
-  mounted() {
-    this.initForm();
-  },
-  watch: {
-    id: function (val) {
-      if (val) {
-        this.initForm();
-      }
-    },
-    newTime: function (val) {
-      if (val) {
-        this.initForm();
-      }
-    },
-  },
-  methods: {
-    closeAdd() {
-      this.showModelThis = false;
-    },
-    async initForm() {
-      this.loading = true;
-      if (this.id === "add") {
-        this.rulesThis = this.rules;
-        await this.resetForm();
-      } else {
-        this.rulesThis = this.rules;
-        await this.resetForm();
-        // await this.initData();
-      }
-      this.loading = false;
-    },
-    // async initData() {
-    //   const res = await asyncRequest.detail({ id: this.id });
-    //   if (res && res.code === 0 && res.data) {
-    //     let { hand_name, resign_name, hand_uid, resign_uid, status } = res.data;
-    //     this.resign_name = resign_name;
-    //     this.hand_name = hand_name;
-    //     this.status = status;
-    //     this.ruleForm = {
-    //       hand_uid: hand_uid.split(","),
-    //       resign_uid: resign_uid.split(","),
-    //     };
-    //   } else if (res && res.code >= 100 && res.code <= 104) {
-    //     await this.logout();
-    //   } else {
-    //     this.$message.warning(res.message);
-    //   }
-    // },
-
-    async resetForm() {
-      // 重置
-      await this.$nextTick(() => {
-        if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          this.ruleForm = {
-            whether_back: "", //是否同意退回
-            feedback_remark: "", //反馈备注
-            return_goods_addr: [], //退货地址
-            addr_detail: "", //退货详细地址
-            addressee: "", //收件人
-            addressee_phone: "", //收件人电话
-            express_require: "", //物流要求
-          };
-        }
-      });
-    },
-    async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
-        // if (valid) {
-        //   const { resign_uid, hand_uid } = this.ruleForm;
-        //   let rUid = resign_uid.toString(),
-        //     hUid = hand_uid.toString();
-        //   if (rUid === hUid) {
-        //     this.$message.error("离职人和接收人不能相同");
-        //     return;
-        //   }
-        //   this.loading = true;
-        //   const model = {
-        //     id: this.id,
-        //     resign_uid: rUid,
-        //     hand_uid: hUid,
-        //   };
-        //   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: "",
-        //     });
-        //     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;
-        // }
-      });
-    },
-    handleView(e) {
-      this.ruleForm.whether_back = e;
-      this.$refs.ruleForm.validateField("return_goods_addr");
-    },
-    //退货省市区
-    selectAreaAddr_code(e) {
-      this.ruleForm.return_goods_addr = e;
-      this.$refs.ruleForm.validateField("return_goods_addr");
-    },
-  },
-};
-</script>