snow 2 years ago
parent
commit
2b516d8a32

+ 16 - 15
src/apis/service/sellOut/sellAfterApply/index.js

@@ -1,26 +1,27 @@
 // 物业管理员
-import http from "@/apis/axios";
-const api = "admin/";
+import http from '@/apis/axios'
+const api = 'admin/'
 export default {
   // 添加
-  add: (data, params) => http(api + "aftercreate", data, "post", params),
+  add: (data, params) => http(api + 'aftercreate', data, 'post', params),
   // 删除
-  delete: (data, params) => http(api + "delete", data, "post", params),
+  delete: (data, params) => http(api + 'delete', data, 'post', params),
   // 分页查询
-  list: (data, params) => http(api + "afterlist", data, "post", params),
+  list: (data, params) => http(api + 'afterlist', data, 'post', params),
   // 详情
-  detail: (data, params) => http(api + "afterinfo", data, "post", params),
+  detail: (data, params) => http(api + 'afterinfo', data, 'post', params),
   // 更新
-  update: (data, params) => http(api + "update", data, "post", params),
+  update: (data, params) => http(api + 'update', data, 'post', params),
   // 修改状态
-  status: (data, params) => http(api + "afterstatus", data, "post", params),
+  status: (data, params) => http(api + 'afterstatus', data, 'post', params),
   // 异常原因接口
-  reasonList: (data, params) => http(api + "resultlist", data, "post", params),
+  reasonList: (data, params) => http(api + 'resultlist', data, 'post', params),
   // 设置退回仓库
-  aftersetwsm: (data, params) => http(api + "aftersetwsm", data, "post", params),  
-  
- // 售后快递录入
-  afterPost : (data, params) => http(api + "afterpost ", data, "post", params),  
+  aftersetwsm: (data, params) => http(api + 'aftersetwsm', data, 'post', params),
+
+  // 售后快递录入
+  afterPost: (data, params) => http(api + 'afterpost ', data, 'post', params),
+  express: (data, params) => http(api + 'setdelivery ', data, 'post', params)
+
+}
 
-};
-   

+ 114 - 0
src/views/supplierSellOut/sellAfterApply/components/wait-return.vue

@@ -0,0 +1,114 @@
+<template>
+  <el-form ref="formRef" class="supplier-form" size="mini" label-width="80px" :model="formData" :rules="rules">
+    <el-form-item label="物流公司" prop="company">
+      <search-express
+        :value="formData.company"
+        :placeholder="'物流公司'"
+        :names="''"
+        :order_source="order_source"
+        :is-detail="false"
+        size="mini"
+        @searchChange="handleCompany"
+      />
+    </el-form-item>
+
+    <el-form-item label="物流单号" prop="post_code">
+      <el-input v-model="formData.post_code" placeholder="物流单号" />
+    </el-form-item>
+
+    <el-form-item label="物流费用" prop="post_fee">
+      <el-input v-model="formData.post_fee" placeholder="物流费用" />
+    </el-form-item>
+
+    <el-form-item>
+      <div style="width:100%;display:flex;justify-content:flex-end">
+        <el-button type="primary" @click="submit">提交</el-button>
+      </div>
+    </el-form-item>
+  </el-form>
+</template>
+<script>
+export default {
+  name: 'SupplierExam',
+  mixins: [],
+  props: [],
+  data() {
+    return {
+      formData: {
+        company: '',
+        post_fee: '',
+        post_code: ''
+      },
+      statusOptions: [
+        { value: '4', label: '通过' }, // -> 待客户退货
+        { value: '2', label: '驳回' } // -> 待采购审核
+      ]
+    }
+  },
+  computed: {
+    displayExpressField() {
+      return this.formData.status === '4'
+    },
+    rules() {
+      return ({
+        company: [
+          {
+            type: 'array',
+            required: true,
+            trigger: 'change',
+            message: '请选择物流公司'
+          }
+        ],
+        post_code: [
+          {
+            required: true,
+            trigger: 'change',
+            message: '请输入物流单号'
+          }
+        ],
+        post_fee: [
+          {
+            required: true,
+            trigger: 'change',
+            message: '请输入快递费用'
+          }
+        ]
+      })
+    }
+  },
+  mounted() {
+  },
+  methods: {
+    handleCompany(e) {
+      if (e && e.code) {
+        this.formData.company = [e.code]
+      }
+      this.$refs.formRef.validateField('company')
+    },
+    addr_selectChange(e) {
+      this.formData.addr_code = e || []
+      this.$refs.formRef.validateField('addr_code')
+    },
+    submit() {
+      this.$refs.formRef.validate(isValid => {
+        if (!isValid) return
+
+        const params = {
+          ...this.formData,
+          company: this.formData.company[0]
+        }
+
+        this.$emit('changeStatus', params)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.supplier-form{
+  ::v-deep(.el-form-item){
+    width: 400px;
+  }
+}
+</style>

+ 26 - 2
src/views/supplierSellOut/sellAfterApply/detail.vue

@@ -93,13 +93,17 @@
               />
             </el-collapse-item>
 
-            <el-collapse-item label="待采购审核" v-if="status + '' === '2'">
+            <el-collapse-item name="4" label="待采购审核" v-if="status + '' === '2'">
               <purchase-exam />
             </el-collapse-item>
 
-            <el-collapse-item title="供应商审核" name="4" v-if="status=== '9'">
+            <el-collapse-item name="5" title="供应商审核"  v-if="status=== '9'">
               <supplier-exam @changeStatus="handleSupplierExam" />
             </el-collapse-item>
+
+            <el-collapse-item name="6" title="待客户退货" v-if="status === '4'">
+              <wait-return @changeStatus="handleExpress" />
+            </el-collapse-item>
             
             <!-- <el-collapse-item
               title="采购审核"
@@ -171,11 +175,13 @@ import { sellshowColumns } from "./columns";
 import purchaseExam from "./components/purchase_exam";
 import SupplierExam from "./components/supplier_exam.vue";
 import { xs_order_type_options } from "@/assets/js/statusList";
+import WaitReturn from "./components/wait-return.vue";
 
 export default {
   name: "sellAfterApplyDetail",
   mixins: [mixinPage, resToken],
   components: {
+    WaitReturn,
     SupplierExam,
     purchaseExam,
     ExpressFeedback
@@ -260,6 +266,24 @@ export default {
     this.initData();
   },
   methods: {
+    async handleExpress(){
+      let res = await asyncRequest.express({
+        ...data,
+        returnCode: this.code
+      });
+      
+      if (res && res.code === 0) {
+        this.$notify.success({
+          title: "修改成功!",
+          message: "",
+        });
+        await this.initData();
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(res.message);
+      }
+    },
     async handleSupplierExam(data){
       let res = await asyncRequest.status({
         ...data,