zhangjinxing 3 years ago
parent
commit
84fe2956b1

+ 2 - 1
src/apis/service/goodsService/index.js

@@ -19,7 +19,8 @@ export default {
   // 物流反馈
   afterFeed: (data, params) => http(api + "afterfeed", data, "post", params),  
   
-
+ // 售后快递录入
+  afterPost : (data, params) => http(api + "afterpost ", data, "post", params),  
 
 };
    

+ 2 - 2
src/views/sellOut/goodsService/columns.js

@@ -24,7 +24,7 @@ export default [
         },
         {
           prop: "good_code",
-          label: "商品属性code",
+          label: "商品编码",
           width:"140"
         },
         {
@@ -55,7 +55,7 @@ export default [
           prop: "status",
           label: "状态",
           _slot_: "status",
-          width: "80px",
+          width: "120px",
         },
         {
             prop:"addtime",

+ 28 - 29
src/views/sellOut/goodsService/components/express_feedback.vue

@@ -9,6 +9,7 @@
     style="width: 100%"
     class="demo-ruleForm"
   >
+    <p>returnCode{{ returnCode }}</p>
     <el-row>
       <!-- <el-form-item label="供应商仓库" -->
       <el-col :span="4" style="width: 370px; padding: 0 0 0 10px">
@@ -29,7 +30,7 @@
           :disabled="false"
           :isDetail="false"
           :isRelation="true"
-          :companyCode="parmValue.wsm_supplierNo"
+          :companyCode="ruleForm.wsm_supplierNo"
           @searchChange="stockChange"
         />
       </el-col>
@@ -38,8 +39,7 @@
         <el-button type="primary" @click="submitForm" v-if="true"
           >保 存</el-button
         >
-        <!-- id === 'add' ||
-            (status === '0' && powers.some((item) => item == '005')) -->
+        <!-- id === 'add' || (status === '0' && powers.some((item) => item == '005')) -->
         <el-button
           type="primary"
           @click="statusConfirm('1', '发起审核流程')"
@@ -79,7 +79,7 @@ import resToken from "@/mixins/resToken";
 import { isnumber } from "@/utils/validate.js";
 export default {
   name: "purchase_check",
-  props: ["id", "showModelThis", "newTime"],
+  props: ["id", "showModelThis", "newTime", "returnCode"],
   mixins: [resToken],
   data() {
     const validatemobile = (rule, value, callback) => {
@@ -94,6 +94,7 @@ export default {
       }
     };
     return {
+      wsm_code: [],
       wsm_supplierNo: [],
       loading: false,
       status: "", //存储详情接口返的状态
@@ -102,6 +103,7 @@ export default {
       hand_name: "", //交接人
       ruleForm: {
         wsm_supplierNo: "",
+        wsm_code: "",
       },
       rulesThis: this.rules,
       // 验证规则
@@ -114,6 +116,11 @@ export default {
           },
         ],
       },
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
     };
   },
   computed: {
@@ -131,7 +138,7 @@ export default {
   },
 
   created() {
-    this.initForm();
+    // this.initForm();
   },
   watch: {
     id: function (val) {
@@ -193,19 +200,12 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           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);
+          console.log(this.ruleForm);
+          let model = {
+            returnCode:this.returnCode,
+            wsm_code:this.ruleForm.wsm_code
           }
-
+          const res = await asyncRequest.afterFeed(model);
           this.loading = false;
           if (res && res.code === 0) {
             const title = this.id === "add" ? "添加成功!" : "修改成功!";
@@ -248,31 +248,30 @@ export default {
     },
     async supplierChange(e) {
       if (e && e.id) {
-        this.parmValue.wsm_supplierNo = e.code;
+        this.ruleForm.wsm_supplierNo = e.code;
         this.wsm_supplierNo = [e.code];
       } else {
-        this.parmValue.wsm_supplierNo = "";
+        this.ruleForm.wsm_supplierNo = "";
         this.wsm_supplierNo = [];
       }
-      this.parmValue.wsm_code = "";
+      this.ruleForm.wsm_code = "";
       this.wsm_code = [];
-      this.parmValue.page = 1;
-      this.pageInfo.curr = 1;
-      await this.searchList();
+      // this.ruleForm.page = 1;
+      // this.pageInfo.curr = 1;
+      // await this.searchList();
     },
     async stockChange(e) {
       if (e && e.id) {
-        this.parmValue.wsm_code = e.code;
+        this.ruleForm.wsm_code = e.code;
         this.wsm_code = [e.code];
       } else {
-        this.parmValue.wsm_code = "";
+        this.ruleForm.wsm_code = "";
         this.wsm_code = [];
       }
-
       console.log(e);
-      this.parmValue.page = 1;
-      this.pageInfo.curr = 1;
-      await this.searchList();
+      // this.ruleForm.page = 1;
+      // this.pageInfo.curr = 1;
+      // await this.searchList();
     },
   },
 };

+ 40 - 23
src/views/sellOut/goodsService/components/returnExpress.vue

@@ -10,11 +10,13 @@
     class="demo-ruleForm"
   >
     {{ ruleForm }}
+    <p>returnCode{{ returnCode }}</p>
     <el-row>
       <el-col :span="12">
         <el-form-item label="费用承担方" prop="express_bear">
           <el-select
             clearable
+            @change="handleChange"
             v-model="ruleForm.express_bear"
             placeholder="请选择"
             style="width: 100%"
@@ -47,7 +49,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="12">
+      <el-col :span="12" v-if="isShow">
         <el-form-item label="物流费用" prop="express_fee">
           <el-input placeholder="请输入物流费用" v-model="ruleForm.express_fee">
             <template slot="append">元</template>
@@ -100,7 +102,7 @@ import resToken from "@/mixins/resToken";
 import { isAlphanumeric, isnumber } from "@/utils/validate.js";
 export default {
   name: "purchase_check",
-  props: ["id", "showModelThis", "newTime"],
+  props: ["id", "showModelThis", "newTime", "returnCode"],
   mixins: [resToken],
   data() {
     const validateexpress = (rule, value, callback) => {
@@ -128,20 +130,27 @@ export default {
     return {
       options: [
         {
-          value: "选项1",
+          value: "1",
           label: "个人承担",
         },
         {
-          value: "选项2",
-          label: "xxx公司",
+          value: "2",
+          label: "公司承担",
+        },
+        {
+          value: "3",
+          label: "供应商承担",
         },
       ],
+      isShow: false,
       loading: false,
       status: "", //存储详情接口返的状态
       showModelThis: this.showModel,
       resign_name: "", //离职人
       hand_name: "", //交接人
       ruleForm: {
+        post_company: "", //入参快递公司
+
         express_bear: "", //物流费用承担方
         express_company: [], //物流公司
         express_numbres: "", //物流单号
@@ -248,6 +257,7 @@ export default {
           this.$refs.ruleForm.clearValidate();
           this.ruleForm = {
             express_bear: "",
+            post_company: "", //入参快递公司
             express_company: [], //物流公司
             express_numbres: "", //物流单号
             express_fee: "", //物流费用
@@ -262,30 +272,28 @@ export default {
         if (valid) {
           console.log(this.ruleForm);
           let model = JSON.parse(JSON.stringify(this.ruleForm));
-          model.post_company = model.express_company.toString();
-          
-          let res = {};
-          if (this.id === "add") {
-            delete model["id"];
-            res = await asyncRequest.add(model);
-          } else {
-            res = await asyncRequest.update(model);
-          }
-
+          let _model = {
+            returnCode: this.returnCode, //退货单号
+            own: model.express_bear, //费用承担方
+            company: model.post_company, //快递公司
+            post_code: model.express_numbres, //快递编号
+            post_fee: model.express_fee, //快递费用
+          };
+          const res = (res = await asyncRequest.afterPost(_model));
           this.loading = false;
           if (res && res.code === 0) {
-            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            // const title = this.id === "add" ? "添加成功!" : "修改成功!";
             this.$notify.success({
-              title,
+              title: "物流已上传",
               message: "",
             });
 
-            if (this.id === "add") {
-              this.showModelThis = false;
-              this.$emit("refresh", false);
-            } else {
-              this.initForm();
-            }
+            // 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 {
@@ -300,11 +308,20 @@ export default {
     handleCompany(e) {
       console.log(e);
       if (e && e.code) {
+        this.ruleForm.post_company = e.shortName;
         this.ruleForm.express_company = [e.code];
         this.ruleForm.page = 1;
       }
       console.log(this.ruleForm.express_company);
     },
+    handleChange(e) {
+      console.log(e);
+      if (e && e == "2") {
+        this.isShow = true;
+      } else {
+        this.isShow = false;
+      }
+    },
   },
 };
 </script>

+ 6 - 6
src/views/sellOut/goodsService/index.vue

@@ -131,7 +131,7 @@
                 />
               </el-col>
               <!-- 商品名称 -->
-              <el-col :span="4" style="width: 180px; padding: 0 0 0 10px">
+              <el-col :span="4" style="width: 280px; padding: 0 0 0 10px">
                 <el-input
                   clearable
                   :size="searchSize"
@@ -140,8 +140,10 @@
                   placeholder="商品名称"
                 />
               </el-col>
+            </el-row>
+            <el-row style="padding: 10px 0 0 0">
               <!-- 商品编码 -->
-              <el-col :span="4" style="width: 200px; padding: 0 0 0 10px">
+              <el-col :span="4" style="width: 180px; padding: 0 0 0 0px">
                 <el-input
                   clearable
                   :size="searchSize"
@@ -149,10 +151,8 @@
                   placeholder="商品编号"
                 />
               </el-col>
-            </el-row>
-            <el-row style="padding: 10px 0 0 0">
               <!-- 确认单号 -->
-              <el-col :span="4" style="width: 200px; padding: 0 0 0 0px">
+              <el-col :span="4" style="width: 200px; padding: 0 0 0 10px">
                 <el-input
                   clearable
                   :size="searchSize"
@@ -317,7 +317,7 @@ export default {
         { id: "1", label: "待物流反馈" },
         { id: "2", label: "待退货" },
         { id: "3", label: "已退货" },
-        { id: "4", label: "" },
+        { id: "4", label: "待客户验收" },
         { id: "5", label: "" },
       ],
       statusList: statusList,

+ 45 - 6
src/views/sellOut/goodsService/serviceDetail.vue

@@ -5,12 +5,13 @@
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
       <p>{{ powers }}</p>
+      <p>status{{ status }}</p>
       <div class="detail-page-title">
         <span class="title">售后申请详情</span>
         <add-edit-form :sitem="sitem"></add-edit-form>
       </div>
       <el-collapse v-model="activeNames">
-        <p>status{{ sitem.status }}</p>
+        <!-- <p>status{{ sitem.status }}</p> -->
 
         <el-collapse-item
           title="业务审核"
@@ -18,6 +19,7 @@
           v-if="powers.some((item) => item == '034')"
         >
           <exam-form
+            v-if="status == '0'"
             :statusList="statusList"
             :newTime="newTime"
             :disabled="false"
@@ -25,8 +27,13 @@
             @searchChange="examForm"
           />
         </el-collapse-item>
-        <el-collapse-item title="物流反馈" name="2">
-          <express-feedback></express-feedback>
+        <el-collapse-item
+          title="物流反馈"
+          name="2"
+          v-if="powers.some((item) => item == '040')"
+        >
+          <!-- v-if="status == '2'" -->
+          <express-feedback :returnCode="returnCode"></express-feedback>
         </el-collapse-item>
         <!-- <el-collapse-item
           title="采购审核"
@@ -40,7 +47,7 @@
           name="4"
           v-if="powers.some((item) => item == '040')"
         >
-          <return-express></return-express>
+          <return-express :returnCode="returnCode"></return-express>
         </el-collapse-item>
       </el-collapse>
     </div>
@@ -84,8 +91,10 @@ export default {
   },
   data() {
     return {
+      returnCode: "",
       activeNames: ["0", "1", "2", "3", "4"],
       sitem: null,
+      status: "", //存储详情接口状态
       statusList: [],
       sitem: null,
       newTime: "",
@@ -95,6 +104,8 @@ export default {
   mounted() {
     this.sitem = this.$route.query.id;
     console.log(this.sitem);
+    this.returnCode = this.sitem.returnCode;
+    this.searchList();
   },
   methods: {
     getNewTime() {
@@ -104,14 +115,14 @@ export default {
     async examForm(e) {
       console.log(e);
       if (!this.loading) {
-        let type = e.state === "1" ? "2" : "0";
+        let type = e.state === "1" ? "1" : "0";
         console.log(type);
         await this.setstatus(type, "提交业务审核", e.remark);
       }
     },
     //
     async setstatus(type, detail, remark) {
-      await this.$confirm(`确定要${type === "2" ? "同意" : "驳回"}?`, {
+      await this.$confirm(`确定要${type === "1" ? "同意" : "驳回"}?`, {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -143,6 +154,34 @@ export default {
           console.log("取消");
         });
     },
+    async searchList() {
+      console.log(this.sitem);
+      if (this.sitem) {
+        let { returnCode } = this.sitem;
+        let model = {
+          returnCode,
+        };
+        const res = await asyncRequest.detail(model);
+        if (res && res.code === 0 && res.data) {
+          this.status = res.data.status;
+          // let { error_num, error_img, error_remark, except_code, error_code } =
+          //   res.data;
+          // console.log(res.data);
+          // this.ruleForm = {
+          //   stock_out_numbers: "", //出库单编号
+          //   anomalous_numbers: error_num, //异常数量
+          //   anomalous_reason: error_code, //异常原因
+          //   expect_wish: except_code, //期望意愿
+          //   anomalous_images: [error_img],
+          //   anomalous_remark: error_remark, //异常备注
+          // };
+        } else if (res && res.code >= 100 && res.code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(res.message);
+        }
+      }
+    },
   },
 };
 </script>