snow 2 jaren geleden
bovenliggende
commit
684dc1d90c

File diff suppressed because it is too large
+ 8 - 0
dist/static/js/0.js


+ 47 - 47
src/components/good-online-platform-modal/columns.js

@@ -1,73 +1,73 @@
 export default [
-  { type: "selection", fixed: "left", _noset_: true },
+  { type: 'selection', fixed: 'left', _noset_: true },
   {
-    prop: "skuCode",
-    label: "商品编码",
-    width: "160",
+    prop: 'skuCode',
+    label: '商品编码',
+    width: '160'
   },
   {
-    prop: "good_thumb_img",
-    label: "图片",
-    _slot_: "good_thumb_img", 
-    "width": "50",
+    prop: 'good_thumb_img',
+    label: '图片',
+    _slot_: 'good_thumb_img',
+    'width': '50'
   },
   {
-    prop: "good_name",
-    label: "商品名称",
+    prop: 'good_name',
+    label: '商品名称',
     // good_thumb_img
-    "min-width": "120",
+    'min-width': '120'
   },
   {
-    prop: "plat_code",
-    label: "平台商品编号",
-    "width": "160",
+    prop: 'plat_code',
+    label: '平台商品编号',
+    'width': '160'
   },
   {
-    prop: "cat_name",
-    label: "商品分类",
-    width: "120",
+    prop: 'cat_name',
+    label: '商品分类',
+    width: '120'
   },
 
   {
-    prop: "unit",
-    label: "单位",
-    width: "45",
+    prop: 'unit',
+    label: '单位',
+    width: '45'
   },
   {
-    prop: "model",
-    label: "规格",
-    _slot_: "model",
-    width: "110",
+    prop: 'model',
+    label: '规格',
+    _slot_: 'model',
+    width: '110'
   },
-  
+
   {
-    prop: "brand_name",
-    label: "品牌",
-    "width": "100",
+    prop: 'brand_name',
+    label: '品牌',
+    'width': '100'
   },
   {
-    prop: "is_stock",
-    label: "库存类型",
-    _slot_: "is_stock",
-    "width": "100",
+    prop: 'is_stock',
+    label: '库存类型',
+    _slot_: 'is_stock',
+    'width': '100'
   },
-  
+
   {
-    prop: "platform_name",
-    label: "所属平台",
-    "width": "100",
+    prop: 'platform_name',
+    label: '所属平台',
+    'width': '100'
   },
-  
+
   {
-    prop: "company",
-    label: "业务公司",
-    "min-width": "150",
+    prop: 'company',
+    label: '业务公司',
+    'min-width': '150'
   },
   {
-    prop: "purchase",
-    label: "供应商负责人",
-    fixed: "right",
-    width: "95",
-  },
-  
-]
+    prop: 'purchase',
+    label: '供应商负责人',
+    fixed: 'right',
+    width: '95'
+  }
+
+]

+ 72 - 75
src/views/sellOut/sellAfterApply/columns.js

@@ -1,22 +1,23 @@
 const columns = [
+  { type: 'selection', fixed: 'left', _noset_: true },
   {
-    prop: "orderCode",
-    label: "订单编号",
-    width: "160"
+    prop: 'orderCode',
+    label: '订单编号',
+    width: '160'
   },
   {
-    prop: "returnCode",
-    label: "售后申请单",
-    width: "160"
+    prop: 'returnCode',
+    label: '售后申请单',
+    width: '160'
   },
   {
-    prop: "company_name",
-    label: "申请人部门",
-    minWidth: "150px",
+    prop: 'company_name',
+    label: '申请人部门',
+    minWidth: '150px'
   },
   {
-    prop: "apply_name",
-    label: "申请人",
+    prop: 'apply_name',
+    label: '申请人'
   },
   // {
   //   prop: "orderCode",
@@ -24,23 +25,23 @@ const columns = [
   //   width:"160"
   // },
   {
-    prop: "outCode",
-    label: "发货申请单编号",
-    width: "160"
+    prop: 'outCode',
+    label: '发货申请单编号',
+    width: '160'
   },
   {
-    prop: "total_num",
-    label: "出库总数",
+    prop: 'total_num',
+    label: '出库总数'
   },
   {
-    prop: "good_code",
-    label: "商品编码",
-    width: "140"
+    prop: 'good_code',
+    label: '商品编码',
+    width: '140'
   },
   {
-    prop: "good_name",
-    label: "商品名称",
-    width: "150"
+    prop: 'good_name',
+    label: '商品名称',
+    width: '150'
   },
   // {
   //     prop:"error_num",
@@ -59,18 +60,17 @@ const columns = [
   // },
 
   {
-    prop: "status",
-    label: "状态",
-    _slot_: "status",
-    width: "120px",
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    width: '120px'
   },
   {
-    prop: "addtime",
-    label: "添加时间",
-    width: 150,
+    prop: 'addtime',
+    label: '添加时间',
+    width: 150
   },
 
-
   // {
   //   prop:"post_company",
   //   label:"快递名称",
@@ -92,95 +92,94 @@ const columns = [
   //   width:"150"
   // },
   {
-    prop: "customer_name",
-    label: "客户名称",
-    width: "200"
+    prop: 'customer_name',
+    label: '客户名称',
+    width: '200'
   },
   {
-    prop: "",
-    label: "操作",
-    fixed: "right",
+    prop: '',
+    label: '操作',
+    fixed: 'right',
     _noset_: true,
-    _slot_: "operation",
-    width: 50,
-  },
+    _slot_: 'operation',
+    width: 50
+  }
 ]
 const sellshowColumns = [
   {
-    prop: "returnCode",
-    label: "售后申请单号",
+    prop: 'returnCode',
+    label: '售后申请单号',
     span: 6
   },
   {
-    prop: "status",
-    label: "售后申请单状态",
-    _slot_: "status",
+    prop: 'status',
+    label: '售后申请单状态',
+    _slot_: 'status',
     span: 6
   },
   {
-    prop: "outCode",
-    label: "发货申请单编号",
+    prop: 'outCode',
+    label: '发货申请单编号',
     span: 6
   },
 
   {
-    prop: "order_type",
-    label: "订单类别",
-    _slot_: "order_type",
+    prop: 'order_type',
+    label: '订单类别',
+    _slot_: 'order_type',
     span: 6
   },
 
   {
-    prop: "is_receive",
-    label: "收货情况",
-    _slot_: "is_receive",
+    prop: 'is_receive',
+    label: '收货情况',
+    _slot_: 'is_receive',
     span: 6
   },
   {
-    prop: "addtime",
-    label: "创建时间",
+    prop: 'addtime',
+    label: '创建时间',
     span: 6
   },
   {
-    prop: "total_num",
-    label: "发货总数量",
+    prop: 'total_num',
+    label: '发货总数量',
     span: 4
   },
   {
-    prop: "error_num",
-    label: "异常数量",
+    prop: 'error_num',
+    label: '异常数量',
     span: 4
   },
 
-
   {
-    prop: "apply_name",
-    label: "申请人",
+    prop: 'apply_name',
+    label: '申请人',
     span: 4
   },
 
   {
-    prop: "error_msg",
-    label: "异常原因",
+    prop: 'error_msg',
+    label: '异常原因',
     span: 6
   },
   {
-    prop: "except_code",
-    label: "期望",
-    _slot_: "except_code",
+    prop: 'except_code',
+    label: '期望',
+    _slot_: 'except_code',
     span: 6
   },
   {
-    prop: "error_img",
-    label: "异常图片",
-    _slot_: "error_img",
+    prop: 'error_img',
+    label: '异常图片',
+    _slot_: 'error_img',
     span: 12
   },
   {
-    prop: "error_remark",
-    label: "备注",
+    prop: 'error_remark',
+    label: '备注',
     span: 24
-  },
+  }
   // {
   //   prop: "sale_price",
   //   label: "销售单价",
@@ -204,7 +203,5 @@ const sellshowColumns = [
   //   label: "更新时间",
   // },
 
-
-
 ]
-export { columns, sellshowColumns }
+export { columns, sellshowColumns }

+ 168 - 0
src/views/sellOut/sellAfterApply/components/supplier-confirm.vue

@@ -0,0 +1,168 @@
+<template>
+  <el-form ref="formRef" class="supplier-form" size="mini" label-width="80px" :model="formData" :rules="rules">
+    <el-form-item label="审核状态" prop="status">
+      <el-select v-model="formData.status" style="width:100%">
+        <el-option v-for="opt in statusOptions" :key="opt.value" :value="opt.value" :label="opt.label" />
+      </el-select>
+    </el-form-item>
+    <el-form-item label="审核备注" prop="remark">
+      <el-input v-model="formData.remark" />
+    </el-form-item>
+
+    <template v-if="displayExpressField">
+      <el-form-item label="收货人" prop="contactor">
+        <el-input v-model="formData.contactor" />
+      </el-form-item>
+      <el-form-item label="联系电话" prop="mobile">
+        <el-input v-model="formData.mobile" max-length="11" />
+      </el-form-item>
+      <el-form-item label="退货地址" prop="addr_code">
+        <select-area
+          :placeholder="'省/市/区'"
+          :value="formData.addr_code"
+          :is-detail="true"
+          :size="'mini'"
+          @selectChange="addr_selectChange"
+        />
+      </el-form-item>
+
+      <el-form-item prop="addr" label="详细地址">
+        <el-input v-model="formData.addr" placeholder="详细地址" />
+      </el-form-item>
+    </template>
+
+    <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>
+import { isMobile } from '@/utils/validate'
+
+const validatename = (rule, value, callback) => {
+  if (value === '') {
+    callback(new Error('收件人不能为空!'))
+  } else {
+    callback()
+  }
+}
+const validatemobile = (rule, value, callback) => {
+  if (value === '') {
+    callback(new Error('手机号不能为空!'))
+  } else {
+    if (!isMobile(value)) {
+      callback(new Error('手机号格式不正确!'))
+    } else {
+      callback()
+    }
+  }
+}
+export default {
+  name: 'SupplierExam',
+  mixins: [],
+  props: ['sitem'],
+  data() {
+    return {
+      formData: {
+        status: '4',
+        remark: '',
+        addr_code: '',
+        mobile: '',
+        contactor: ''
+      },
+      statusOptions: [
+        { value: '4', label: '确认修改' },
+        { value: '2', label: '不同意修改' }
+      ]
+    }
+  },
+  computed: {
+    displayExpressField() {
+      return this.formData.status === '4'
+    },
+    rules() {
+      const { status } = this.formData
+      return ({
+        addr: [
+          {
+            required: true,
+            trigger: 'change',
+            message: '想输入详细地址'
+          }
+        ],
+        status: [
+          {
+            required: true,
+            trigger: 'change',
+            message: '请选择审核状态'
+          }
+        ],
+        remark: [
+          {
+            required: status === '2',
+            trigger: 'change',
+            message: '请输入备注'
+          }
+        ],
+        contactor: [
+          {
+            required: true,
+            trigger: 'blur',
+            validator: validatename
+          }
+        ],
+        mobile: [
+          {
+            required: true,
+            trigger: 'blur',
+            validator: validatemobile
+          }
+        ],
+        addr_code: [
+          {
+            type: 'array',
+            required: true,
+            trigger: 'change',
+            message: '请选择省市区'
+          }
+        ]
+      })
+    }
+  },
+  methods: {
+    addr_selectChange(e) {
+      this.formData.addr_code = e || []
+      this.$refs.formRef.validateField('addr_code')
+    },
+    submit() {
+      this.$refs.formRef.validate(isValid => {
+        if (!isValid) return
+        const { addr_code, status } = this.formData
+        let _status = status
+
+        if (status === '4' && String(this.sitem.is_receive) === '0') {
+          _status = '5'
+        }
+
+        const params = {
+          ...this.formData,
+          status: _status,
+          addr_code: addr_code ? addr_code.join(',') : ''
+        }
+
+        this.$emit('changeStatus', params)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.supplier-form{
+  ::v-deep(.el-form-item){
+    width: 400px;
+  }
+}
+</style>

+ 85 - 39
src/views/sellOut/sellAfterApply/detail.vue

@@ -82,7 +82,7 @@
             <el-collapse-item
               title="业务审核"
               name="3"
-              v-if="status + '' === '1' && ppowers.some((i) => i == '1')"
+              v-if="isSupertube && String(sitem.status) === '1' && this.ppowers.includes('1')"
             >
               <exam-form
                 :statusList="statusList"
@@ -93,42 +93,22 @@
               />
             </el-collapse-item>
 
-            <el-collapse-item name="4" label="待采购审核" v-if="status + '' === '2'">
-              <purchase-exam />
+            <el-collapse-item name="4" title="供应商驳回,待采购审核"  v-if="isSupertube && String(sitem.status) === '2' && this.ppowers.includes('2')">
+              <purchase-exam :sitem="sitem" @changeStatus="handlePurchaseConfirm" />
             </el-collapse-item>
 
-            <el-collapse-item name="5" title="供应商审核"  v-if="status=== '9'">
-              <supplier-exam @changeStatus="handleSupplierExam" />
+            <el-collapse-item name="5" title="供应商审核"   v-if="isSupertube && String(sitem.status) === '9' && this.ppowers.includes('9')">
+              <supplier-exam :sitem="sitem" @changeStatus="handleSupplierExam" />
             </el-collapse-item>
 
-            <el-collapse-item name="6" title="待客户退货" v-if="status === '4'">
-              <wait-return @changeStatus="handleExpress" />
+            <el-collapse-item name="6" title="待客户退货"  v-if="isSupertube && String(sitem.status) === '4' && this.ppowers.includes('4')">
+              <wait-return :sitem="sitem" @changeStatus="handleExpress" />
             </el-collapse-item>
-            
-            <!-- <el-collapse-item
-              title="采购审核"
-              name="4"
-              v-if="
-                (status == '2' ||
-                  status == '3' ||
-                  status == '4' ||
-                  status == '5' ||
-                  status == '7') &&
-                newTime != ''
-              "
-            >
-              <purchase-exam
-                :sitem="sitem"
-                :newTime="newTime"
-                v-if="newTime != ''"
-                @refresh="initData"
-              />
-            </el-collapse-item> -->
-
-            <!-- <el-collapse-item>
-              <supplier-exam />
-            </el-collapse-item> -->
 
+            <el-collapse-item name="7" title="业务公司修改待供应商确认"  v-if="isSupertube && String(sitem.status) === '10' && this.ppowers.includes('10')">
+              <supplier-confrim :sitem="sitem"  @changeStatus="handleSupplierConfirm"/>
+            </el-collapse-item>
+            
             <el-collapse-item
               title="设置退货仓库"
               name="4"
@@ -147,6 +127,8 @@
             </el-collapse-item>
           </el-collapse>
         </el-tab-pane>
+
+        
         <el-tab-pane label="审批记录" name="2">
           <process-time-line
             v-if="newTime !== ''"
@@ -176,6 +158,8 @@ 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";
+import SupplierConfrim from "./components/supplier-confirm.vue";
+import { mapGetters } from "vuex";
 
 export default {
   name: "sellAfterApplyDetail",
@@ -184,12 +168,13 @@ export default {
     WaitReturn,
     SupplierExam,
     purchaseExam,
-    ExpressFeedback
+    ExpressFeedback,
+    SupplierConfrim
   },
   computed: {
+    ...mapGetters(['isSuppertube']),
     powers() {
-      const tran =
-        this.$store.getters.btnList.find(
+      const tran = this.$store.getters.btnList.find(
           (item) => item.menu_route == "sellAfterApplyDetail"
         ) || {};
       const { action } = tran ?? {};
@@ -236,24 +221,43 @@ export default {
       loading: false,
       // 收到货状态
       status1Options: [
+        // { id: "1", label: "待业务审核" },
+        // { id: "2", label: "待采购审核" },
+        // { id: "3", label: "待同意退货" },
+        // { id: "5", label: "售后已完成" },
+        // { id: "6", label: "业务已驳回" },
+        // { id: "7", label: "采购已驳回" },
+        // { id: "8", label: "申请已取消" },
         { id: "1", label: "待业务审核" },
         { id: "2", label: "待采购审核" },
-        { id: "3", label: "待设置仓库" },
+        { id: "3", label: "待设置仓库" }, // 废弃
         { id: "4", label: "待客户退货" },
         { id: "5", label: "售后已完成" },
         { id: "6", label: "业务已驳回" },
-        { id: "7", label: "采购已驳回" },
+        { id: "7", label: "采购已驳回" }, // 废弃
         { id: "8", label: "申请已取消" },
+        { id: "9", label: "供应商审核" },
+        { id: "10", label: "业务公司修改待供应商确认" }
       ],
       // 未收到货状态
       status2Options: [
+        // { id: "1", label: "待业务审核" },
+        // { id: "2", label: "待采购审核" },
+        // { id: "3", label: "待同意退货" },
+        // { id: "5", label: "售后已完成" },
+        // { id: "6", label: "业务已驳回" },
+        // { id: "7", label: "采购已驳回" },
+        // { id: "8", label: "申请已取消" },
         { id: "1", label: "待业务审核" },
         { id: "2", label: "待采购审核" },
-        { id: "3", label: "待同意退货" },
+        { id: "3", label: "待设置仓库" }, // 废弃
+        { id: "4", label: "待客户退货" },
         { id: "5", label: "售后已完成" },
         { id: "6", label: "业务已驳回" },
-        { id: "7", label: "采购已驳回" },
+        { id: "7", label: "采购已驳回" }, // 废弃
         { id: "8", label: "申请已取消" },
+        { id: "9", label: "供应商审核" },
+        { id: "10", label: "业务公司修改待供应商确认" }
       ],
       orderCode: "",
       return_code: "",
@@ -284,7 +288,25 @@ export default {
         this.$message.warning(res.message);
       }
     },
-    
+
+    async handleSupplierConfirm(data){
+      let res = await asyncRequest.status({
+        ...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,
@@ -306,6 +328,26 @@ export default {
     getNewTime() {
       this.newTime = new Date().valueOf();
     },
+    async handlePurchaseConfirm(data){
+      const model = {
+        returnCode: this.code,
+        ...data
+      };
+
+      let res = await asyncRequest.status(model);
+      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 statusConfirm(status, message, remark = "") {
       this.$confirm(`确定要${message}?`, {
         confirmButtonText: "确定",
@@ -354,6 +396,10 @@ export default {
         this.$message.warning(res.message);
       }
     },
+    hasPermission({status, process}){
+      console.log(this.sitem)
+      return !this.isSupertube && String(this.sitem.status) === status && this.ppowers.includes(process)
+    },
     async initData() {
       let model = {
         returnCode: this.code,

+ 62 - 0
src/views/sellOut/sellAfterApply/index.vue

@@ -12,6 +12,7 @@
         :size="size"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
+        @selection="handleSelection"
         @screen-reset="
           pageInfo.curr = 1;
           parmValue.page = 1;
@@ -78,6 +79,10 @@
                     刷新
                   </el-button>
                 </el-col>
+
+                <el-col :span="4" style="width: 66px; float: right;margin-right: 50px;">
+                  <el-button type="primary" size="mini" @click="handleExport">售后申请单导出</el-button>
+                </el-col>
               </el-col>
             </el-row>
             <el-row style="padding-top: 10px">
@@ -222,6 +227,7 @@ import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
 import { columns } from "./columns";
 import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
 
 export default {
   name: "sellAfterApply",
@@ -239,7 +245,9 @@ export default {
   },
   data() {
     return {
+      fileUrl: urlConfig.baseURL,
       select: "serviceNum",
+      select_list:[],
       s_input: "",
       customerCode: [], //客户公司code
       except_codeOptions: [
@@ -372,6 +380,56 @@ export default {
   },
 
   methods: {
+    handleExport(){
+      if(this.select_list.length === 0){
+        this.$message.warning('请选择一条售后申请单');
+        return
+      }
+      const returnCode = this.select_list.map(({returnCode}) => returnCode)
+
+      if (!this.loading) {
+        this.loading = true;
+        let httpType = `aplication/zip`;
+        axios({
+          method: "post",
+          url: this.fileUrl + "/admin/reorderexam",
+          responseType: "blob",
+          data: {returnCode},
+          headers: {
+            Accept: httpType,
+          },
+        })
+          .then((res) => {
+            if (res && res.status == 200 && res.data) {
+              let url = window.URL.createObjectURL(
+                new Blob([res.data], { type: httpType })
+              );
+              let link = document.createElement("a");
+              link.style.display = "none";
+              link.href = url;
+              let excelName = "售后申请单.zip";
+              link.setAttribute("download", excelName);
+              document.body.appendChild(link);
+              link.click();
+              link.remove();
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+              this.$message.success(`导出成功!`);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            } else {
+              this.$message.error(res.data.message);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            }
+          })
+          .catch((error) => {
+            console.log(error);
+            this.loading = false;
+          });
+      }
+    },
     restSearch() {
       this.customerCode = [];
       this.select = "serviceNum";
@@ -435,6 +493,10 @@ export default {
           console.log("取消");
         });
     },
+    handleSelection(order){
+      const { list } = order
+      this.select_list = list;
+    },
     // 列表搜索
     async searchList() {
        if (

+ 1 - 5
src/views/sellOut/sellReturn/columns.js

@@ -1,9 +1,5 @@
 export default [
-  // {
-  //   prop: "orderCode",
-  //   label: "采购订单编号",
-  //   width:"160"
-  // },
+  { type: 'selection', fixed: 'left', _noset_: true },
   {
     prop: 'returnCode',
     label: '退货单编号',

+ 13 - 9
src/views/sellOut/sellReturn/detail.vue

@@ -155,7 +155,7 @@
             <el-collapse-item
               title="业务审核"
               name="3"
-              v-if="status + '' === '1'"
+              v-if="hasPermission({status:'1', process:'1'})"
             >
               <exam-form
                 v-if="newTime"
@@ -178,8 +178,7 @@
             <el-collapse-item
               title="供应商审核"
               name="4"
-              v-if="status + '' === '9'
-              "
+              v-if="hasPermission({status:'9', process:'9'})"
             >
               <exam-form
                 v-if="newTime"
@@ -192,11 +191,11 @@
             </el-collapse-item>
 
 
-            <el-collapse-item title="供应商已驳回,待采购审核" name="5" v-if="status + '' === '8'">
+            <el-collapse-item title="供应商已驳回,待采购审核" name="5"  v-if="hasPermission({status:'8', process:'8'})">
               <approval-results @changeStatus="handlePurchaseExam" />
             </el-collapse-item>
 
-            <el-collapse-item title="业务公司修改待供应商确认" name="6" v-if="status + '' === '10'">
+            <el-collapse-item title="业务公司修改待供应商确认" name="6" v-if="hasPermission({status:'10', process:'10'})">
               <exam-form
                 v-if="newTime"
                 :statusList="statusList"
@@ -267,9 +266,9 @@
           />
         </el-tab-pane>
 
-        <el-tab-pane label="流程图" name="3"  v-if="sitem.order_type !== '1'">
-          <flow-chart process_id="8" type="XSTHD" :orderCode="queryId" />
-       </el-tab-pane>
+        <!-- <el-tab-pane label="流程图" name="3"  v-if="sitem.order_type !== '1'"> -->
+          <!-- <flow-chart process_id="8" type="XSTHD" :orderCode="queryId" /> -->
+       <!-- </el-tab-pane> -->
       </el-tabs>
     </div>
     <div v-else>
@@ -286,6 +285,7 @@ import comExamForm from "./components/comExamForm";
 import ApprovalResults from "./components/approval-results.vue";
 import { showColumns } from "./components/ShowDataTableColumns";
 import { xs_order_type_options } from "@/assets/js/statusList";
+import { mapGetters } from "vuex";
 export default {
   name: "sellReturnDetail",
   mixins: [mixinPage, resToken],
@@ -295,6 +295,7 @@ export default {
     // ReturnCheck,
   },
   computed: {
+    ...mapGetters(['isSupertube']),
     powers() {
       const tran =
         this.$store.getters.btnList.find(
@@ -307,7 +308,6 @@ export default {
       const tran =
         this.$store.getters.roleProcess.find((i) => i.process_type === "XSTHD") || {};
       const { action } = tran ?? {};
-      console.log(action)
       return action ?? [];
     },
   },
@@ -451,6 +451,10 @@ export default {
         this.$message.warning(res.message);
       }
     },
+
+    hasPermission({status, process}){
+      return !this.isSupertube && String(this.sitem.status) === status && this.ppowers.includes(process)
+    },
     async initData() {
       const { code, data, message } = await asyncRequest.detail({
         returnCode: this.queryId,

+ 66 - 1
src/views/sellOut/sellReturn/index.vue

@@ -12,6 +12,7 @@
         :size="size"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
+        @selection="handleSelection"
         @screen-reset="
           pageInfo.curr = 1;
           parmValue.page = 1;
@@ -120,7 +121,13 @@
                 </el-col>
               </el-col>
             </el-row>
-            <el-row style="padding: 10px 0 0 0"> </el-row>
+
+
+            <el-row style="padding: 10px 0 0 0">
+               <div style="display:flex;width:100%;justify-content:flex-end">
+                  <el-button type="primary" size="mini" @click="handleExport">退货单导出</el-button>
+               </div>
+             </el-row>
           </div>
         </template>
         <template #status="{ scope }">
@@ -159,6 +166,7 @@ import resToken from "@/mixins/resToken";
 import columns from "./columns";
 import asyncRequest from "@/apis/service/sellOut/sellReturn";
 import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
 
 export default {
   name: "sellReturn",
@@ -176,8 +184,10 @@ export default {
   },
   data() {
     return {
+      fileUrl: urlConfig.baseURL,
       select: "returnCode", //默认选择下拉框
       s_input: "", //搜索框内容
+      select_list:[],
       sitem: null,
       // 状态
       statusOptions: [
@@ -267,6 +277,61 @@ export default {
   },
 
   methods: {
+    handleExport(){
+      if(this.select_list.length === 0){
+        this.$message.warning('请选择一条退货单');
+        return
+      }
+
+      const returnCode = this.select_list.map(({returnCode}) => returnCode)
+
+      if (!this.loading) {
+        this.loading = true;
+        let httpType = `aplication/zip`;
+        axios({
+          method: "post",
+          url: this.fileUrl +  "/admin/reorderExport",
+          responseType: "blob",
+          data: {returnCode},
+          headers: {
+            Accept: httpType,
+          },
+        })
+          .then((res) => {
+            if (res && res.status == 200 && res.data) {
+              let url = window.URL.createObjectURL(
+                new Blob([res.data], { type: httpType })
+              );
+              let link = document.createElement("a");
+              link.style.display = "none";
+              link.href = url;
+              let excelName = "退货单.zip";
+              link.setAttribute("download", excelName);
+              document.body.appendChild(link);
+              link.click();
+              link.remove();
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+              this.$message.success(`导出成功!`);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            } else {
+              this.$message.error(res.data.message);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            }
+          })
+          .catch((error) => {
+            console.log(error);
+            this.loading = false;
+          });
+      }
+    },
+    handleSelection(order){
+      const { list } = order
+      this.select_list = list;
+    },
     getRouter(toRouter, queryId) {
       if (toRouter && queryId) {
         let model = {

+ 75 - 71
src/views/supplierSellOut/sellAfterApply/columns.js

@@ -1,22 +1,22 @@
 const columns = [
   {
-    prop: 'orderCode',
-    label: '订单编号',
-    width: '160'
+    prop: "orderCode",
+    label: "订单编号",
+    width: "160"
   },
   {
-    prop: 'returnCode',
-    label: '售后申请单',
-    width: '160'
+    prop: "returnCode",
+    label: "售后申请单",
+    width: "160"
   },
   {
-    prop: 'company_name',
-    label: '申请人部门',
-    minWidth: '150px'
+    prop: "company_name",
+    label: "申请人部门",
+    minWidth: "150px",
   },
   {
-    prop: 'apply_name',
-    label: '申请人'
+    prop: "apply_name",
+    label: "申请人",
   },
   // {
   //   prop: "orderCode",
@@ -24,23 +24,23 @@ const columns = [
   //   width:"160"
   // },
   {
-    prop: 'outCode',
-    label: '发货申请单编号',
-    width: '160'
+    prop: "outCode",
+    label: "发货申请单编号",
+    width: "160"
   },
   {
-    prop: 'total_num',
-    label: '出库总数'
+    prop: "total_num",
+    label: "出库总数",
   },
   {
-    prop: 'good_code',
-    label: '商品编码',
-    width: '140'
+    prop: "good_code",
+    label: "商品编码",
+    width: "140"
   },
   {
-    prop: 'good_name',
-    label: '商品名称',
-    width: '150'
+    prop: "good_name",
+    label: "商品名称",
+    width: "150"
   },
   // {
   //     prop:"error_num",
@@ -59,17 +59,18 @@ const columns = [
   // },
 
   {
-    prop: 'status',
-    label: '状态',
-    _slot_: 'status',
-    width: '120px'
+    prop: "status",
+    label: "状态",
+    _slot_: "status",
+    width: "120px",
   },
   {
-    prop: 'addtime',
-    label: '添加时间',
-    width: 150
+    prop: "addtime",
+    label: "添加时间",
+    width: 150,
   },
 
+
   // {
   //   prop:"post_company",
   //   label:"快递名称",
@@ -91,94 +92,95 @@ const columns = [
   //   width:"150"
   // },
   {
-    prop: 'customer_name',
-    label: '客户名称',
-    width: '200'
+    prop: "customer_name",
+    label: "客户名称",
+    width: "200"
   },
   {
-    prop: '',
-    label: '操作',
-    fixed: 'right',
+    prop: "",
+    label: "操作",
+    fixed: "right",
     _noset_: true,
-    _slot_: 'operation',
-    width: 50
-  }
+    _slot_: "operation",
+    width: 50,
+  },
 ]
 const sellshowColumns = [
   {
-    prop: 'returnCode',
-    label: '售后申请单号',
+    prop: "returnCode",
+    label: "售后申请单号",
     span: 6
   },
   {
-    prop: 'status',
-    label: '售后申请单状态',
-    _slot_: 'status',
+    prop: "status",
+    label: "售后申请单状态",
+    _slot_: "status",
     span: 6
   },
   {
-    prop: 'outCode',
-    label: '发货申请单编号',
+    prop: "outCode",
+    label: "发货申请单编号",
     span: 6
   },
 
   {
-    prop: 'order_type',
-    label: '订单类别',
-    _slot_: 'order_type',
+    prop: "order_type",
+    label: "订单类别",
+    _slot_: "order_type",
     span: 6
   },
 
   {
-    prop: 'is_receive',
-    label: '收货情况',
-    _slot_: 'is_receive',
+    prop: "is_receive",
+    label: "收货情况",
+    _slot_: "is_receive",
     span: 6
   },
   {
-    prop: 'addtime',
-    label: '创建时间',
+    prop: "addtime",
+    label: "创建时间",
     span: 6
   },
   {
-    prop: 'total_num',
-    label: '发货总数量',
+    prop: "total_num",
+    label: "发货总数量",
     span: 4
   },
   {
-    prop: 'error_num',
-    label: '异常数量',
+    prop: "error_num",
+    label: "异常数量",
     span: 4
   },
 
+
   {
-    prop: 'apply_name',
-    label: '申请人',
+    prop: "apply_name",
+    label: "申请人",
     span: 4
   },
 
   {
-    prop: 'error_msg',
-    label: '异常原因',
+    prop: "error_msg",
+    label: "异常原因",
     span: 6
   },
   {
-    prop: 'except_code',
-    label: '期望',
-    _slot_: 'except_code',
+    prop: "except_code",
+    label: "期望",
+    _slot_: "except_code",
     span: 6
   },
   {
-    prop: 'error_img',
-    label: '异常图片',
-    _slot_: 'error_img',
+    prop: "error_img",
+    label: "异常图片",
+    _slot_: "error_img",
     span: 12
   },
   {
-    prop: 'error_remark',
-    label: '备注',
+    prop: "error_remark",
+    label: "备注",
     span: 24
-  }
+  },
   // {
   //   prop: "sale_price",
   //   label: "销售单价",
@@ -202,5 +204,7 @@ const sellshowColumns = [
   //   label: "更新时间",
   // },
 
+
+
 ]
-export { columns, sellshowColumns }
+export { columns, sellshowColumns }

+ 259 - 113
src/views/supplierSellOut/sellAfterApply/components/purchase_exam.vue

@@ -1,142 +1,288 @@
 <template>
-  <el-form ref="formRef" class="supplier-form" size="mini" label-width="80px" :model="formData" :rules="rules">
-    <el-form-item label="审核状态" prop="status">
-      <el-select v-model="formData.status" style="width:100%">
-        <el-option label="修改供应商审批结果" value="10" />
-        <el-option label="认同供应商审批结果" value="4" />
-      </el-select>
-    </el-form-item>
-
-    <el-form-item label="审核备注" prop="remark">
-      <el-input v-model="formData.remark" />
-    </el-form-item>
-
-    <template v-if="displayExpressField">
-      <el-form-item label="退回至" prop="wsm_code">
-        <search-stock
-          :size="'mini'"
-          :value="formData.wsm_code"
-          placeholder="退货仓库"
-          :is-detail="true"
-          :is-relation="true"
-          :names="wsm_code_name"
-          :company-no="currentCompany"
-          @searchChange="stockChange"
-        />
-      </el-form-item>
-
-      <el-form-item label="">
-        <el-input v-model="expressInfo" placeholder="退货仓库收货信息展示" disabled />
-      </el-form-item>
-    </template>
-
-    <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
+    ref="ruleForm"
+    :loading="loading"
+    :model="ruleForm"
+    status-icon
+    :size="'mini'"
+    :rules="rules"
+    label-width="100px"
+    style="width: 100%"
+    class="demo-ruleForm"
+  >
+    <el-row>
+      <el-col :span="6"
+        ><el-form-item label="审核状态" prop="status">
+          <el-select
+            v-model="ruleForm.status"
+            placeholder="请选择审核状态"
+            style="width: 100%"
+            :size="'mini'"
+            :disabled="!(status + '' == '2' && ppowers.some((i) => i == '2'))"
+            @change="statusChange"
+          >
+            <el-option
+              v-for="item in statusList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="6" v-show="ruleForm.status + '' === '1' && is_receive + '' === '1'">
+        <el-form-item label="物流费承担方" prop="is_th" label-width="110px">
+          <el-select
+            v-model="ruleForm.is_th"
+            style="width: 100%"
+            :disabled="!(status == '2' && ppowers.some((i) => i == '2'))"
+            placeholder="是否承担物流费"
+            :size="'mini'"
+          >
+            <el-option
+              v-for="item in is_th_list"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="6" v-show="ruleForm.status + '' === '1' && is_receive + '' === '1'">
+        <el-form-item label="退回至" prop="return_tag">
+          <el-select
+            v-model="ruleForm.return_tag"
+            style="width: 100%"
+            :disabled="!(status == '2' && ppowers.some((i) => i == '2'))"
+            placeholder="是否承担物流费"
+            :size="'mini'"
+          >
+            <el-option
+              v-for="item in return_tag_options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12" v-show="ruleForm.status + '' === '0'">
+        <el-form-item
+          label="审核备注"
+          :disabled="!(status == '2' && ppowers.some((i) => i == '2'))"
+          prop="remark"
+        >
+          <el-input
+            type="textarea"
+            :size="'mini'"
+            placeholder="请输入审核备注"
+            v-model="ruleForm.remark"
+            :disabled="disabled"
+            maxlength="250"
+            :autosize="{ minRows: 2, maxRows: 2 }"
+            show-word-limit
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6" v-if="status == '2' && ppowers.some((i) => i == '2')" class="tr">
+        <el-button v-if="!isDetail" :size="'mini'" type="primary" @click="submitForm"
+          >保 存
+        </el-button>
+      </el-col>
+    </el-row>
   </el-form>
 </template>
 <script>
-import companyHelper from '@/mixins/companyHelper'
+import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
+import resToken from "@/mixins/resToken";
 export default {
-  name: 'ApprovalResults',
-  mixins: [companyHelper],
-  props: ['sitem'],
+  name: "sellAfterApplyDetail",
+  mixins: [resToken],
+  props: ["id", "newTime", "sitem", "show"],
   data() {
     return {
-      company: '',
-      formData: {
-        status: '10',
-        remark: '',
-        wsm_code: ''
+      loading: false,
+      is_receive: "1",
+      status: "",
+      statusList: [
+        {
+          value: "1",
+          label: "通过",
+        },
+        {
+          value: "0",
+          label: "驳回",
+        },
+      ],
+      is_th_list: [
+        {
+          value: "1",
+          label: "收货人承担",
+        },
+        {
+          value: "2",
+          label: "业务公司承担",
+        },
+        {
+          value: "3",
+          label: "供应商承担",
+        },
+      ],
+      return_tag_options: [
+        {
+          value: "1",
+          label: "供应商仓库",
+        },
+        {
+          value: "2",
+          label: "业务公司仓库",
+        },
+      ],
+
+      showModelThis: this.showModel,
+      ruleForm: {
+        status: "1", // 通过or驳回
+        is_th: "1", //驳回至
+        return_tag: "1",
+        remark: "",
       },
-      wsm_code: '',
-      wsm_name: '',
-      expressInfo: ''
-    }
-  },
-  computed: {
-    displayExpressField() {
-      return this.formData.status === '4'
-    },
-    rules() {
-      const { status } = this.formData
-      return ({
-        wsm_code: [
+      rulesThis: this.rules,
+      rules: {
+        status: [
           {
-            type: 'array',
             required: true,
-            trigger: 'change',
-            message: '请选择退货仓库'
-          }
+            message: "请选择审核状态",
+            trigger: "change",
+          },
         ],
-        status: [
+        is_th: [
           {
             required: true,
-            trigger: 'change',
-            message: '请选择退货仓库'
-          }
+            message: "请选择物流费承担方",
+            trigger: "change",
+          },
+        ],
+        return_tag: [
+          {
+            required: true,
+            message: "请选择退回位置",
+            trigger: "change",
+          },
         ],
         remark: [
+          { required: true, message: "请输入审核备注", trigger: "blur" },
           {
-            required: status === '10',
-            trigger: 'change',
-            message: '请输入审核备注'
-          }
-        ]
-      })
-    }
+            min: 1,
+            max: 250,
+            message: "长度在 1 到 250 个字符",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  computed: {
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find(
+          (item) => item.menu_route == "sellAfterApplyDetail"
+        ) || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "SHD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
   },
   watch: {
-    'formData.status'(status) {
-      this.expressInfo = ''
-      this.formData = {
-        status,
-        remark: '',
-        wsm_code: ''
+    newTime: function (val) {
+      if (val) {
+        this.initForm();
       }
-    }
+    },
   },
   mounted() {
+    this.initForm();
   },
   methods: {
-    async stockChange(e) {
-      const { code, label, contactor, mobile, addr_cn } = e
-      this.expressInfo = `${contactor}-${mobile}-${addr_cn}`
-      this.wsm_name = label || ''
-      this.wsm_code = code || ''
-      this.formData.wsm_code = code ? [code] : []
-      this.$refs.formRef.validateField('wsm_code')
+    async initForm() {
+      this.loading = true;
+      this.rulesThis = this.rules;
+      await this.resetForm();
+      this.statusChange();
+      this.loading = false;
     },
-    submit() {
-      this.$refs.formRef.validate(isValid => {
-        if (!isValid) return
-
-        const { wsm_code, status } = this.formData
 
-        let _status = status
-
-        if (status === '4' && String(this.sitem.is_receive) === '0') {
-          _status = '5'
+    statusChange() {
+      this.rulesThis.is_th[0].required =
+        this.ruleForm.status + '' === "1" && this.is_receive + '' === "1";
+      this.rulesThis.remark[0].required = this.ruleForm.status + '' !== "1";
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const {
+            returnCode,
+            is_receive,
+            status,
+            return_tag,
+            is_th,
+            remark,
+          } = this.sitem;
+          this.status = status || "";
+          this.is_receive = is_receive || "1";
+          this.ruleForm = {
+            status: "1", // 通过or驳回
+            is_th: is_th || "1", //驳回至
+            return_tag: return_tag || "1",
+            remark: remark || "",
+            returnCode: returnCode || "",
+          };
         }
-
-        const params = {
-          ...this.formData,
-          status: _status,
-          wsm_code: Array.isArray(wsm_code) ? wsm_code[0] : wsm_code
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          if (this.loading) {
+            return;
+          }
+          this.loading = true;
+          let model = JSON.parse(JSON.stringify(this.ruleForm));
+          model.status = model.status + '' === "1" ? "3" : "6";
+          model.is_th = this.is_receive + '' === "0" ? "0" : model.is_th;
+          model.return_tag = this.is_receive + '' === "0" ? "0" : model.return_tag;
+          model.is_post = "0";
+          let res = await asyncRequest.status(model);
+          this.loading = false;
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "提交成功!",
+              message: "",
+            });
+            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;
         }
-        this.$emit('changeStatus', params)
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 
-<style lang="scss" scoped>
-.supplier-form{
-  ::v-deep(.el-form-item){
-    width: 500px;
-  }
-}
-</style>
+<style lang="scss" scoped></style>

+ 3 - 22
src/views/supplierSellOut/sellAfterApply/components/supplier_exam.vue

@@ -25,10 +25,6 @@
           @selectChange="addr_selectChange"
         />
       </el-form-item>
-
-      <el-form-item prop="addr" label="详细地址">
-        <el-input v-model="formData.addr" placeholder="详细地址" />
-      </el-form-item>
     </template>
 
     <el-form-item>
@@ -63,7 +59,7 @@ const validatemobile = (rule, value, callback) => {
 export default {
   name: 'SupplierExam',
   mixins: [],
-  props: ['sitem'],
+  props: [],
   data() {
     return {
       formData: {
@@ -71,8 +67,7 @@ export default {
         remark: '',
         contactor: '',
         mobile: '',
-        addr_code: '',
-        addr: ''
+        addr_code: ''
       },
       statusOptions: [
         { value: '4', label: '通过' }, // -> 待客户退货
@@ -87,13 +82,6 @@ export default {
     rules() {
       const { status } = this.formData
       return ({
-        addr: [
-          {
-            required: true,
-            trigger: 'change',
-            message: '想输入详细地址'
-          }
-        ],
         status: [
           {
             required: true,
@@ -143,17 +131,10 @@ export default {
     submit() {
       this.$refs.formRef.validate(isValid => {
         if (!isValid) return
-        const { addr_code, status } = this.formData
-
-        let _status = status
-
-        if (status === '4' && String(this.sitem.is_receive) === '0') {
-          _status = '5'
-        }
+        const { addr_code } = this.formData
 
         const params = {
           ...this.formData,
-          status: _status,
           addr_code: addr_code ? addr_code.join(',') : ''
         }
 

+ 3 - 10
src/views/supplierSellOut/sellAfterApply/components/wait-return.vue

@@ -1,11 +1,11 @@
 <template>
   <el-form ref="formRef" class="supplier-form" size="mini" label-width="80px" :model="formData" :rules="rules">
-    <!-- <el-form-item label="是否退货" prop="is_th">
+    <el-form-item label="是否退货" prop="is_th">
       <el-select v-model="formData.is_th" style="width:100%">
         <el-option label="是" value="1" />
         <el-option label="否" value="2" />
       </el-select>
-    </el-form-item> -->
+    </el-form-item>
 
     <template v-if="displayExpressField">
       <el-form-item label="物流公司" prop="company">
@@ -40,7 +40,7 @@
 export default {
   name: 'SupplierExam',
   mixins: [],
-  props: ['sitem'],
+  props: [],
   data() {
     return {
       company: '',
@@ -105,15 +105,8 @@ export default {
       this.$refs.formRef.validate(isValid => {
         if (!isValid) return
 
-        let _status = this.formData.status
-
-        if (this.formData.status === '4' && String(this.sitem.is_receive) !== '0') {
-          _status = '5'
-        }
-
         const params = {
           ...this.formData,
-          status: _status,
           company: this.company
         }
 

+ 12 - 7
src/views/supplierSellOut/sellAfterApply/detail.vue

@@ -82,7 +82,7 @@
             <el-collapse-item
               title="业务审核"
               name="3"
-              v-if="status + '' === '1' && ppowers.some((i) => i == '1')"
+              v-if="isSupertube && String(sitem.status) === '1' && this.ppowers.includes('1')"
             >
               <exam-form
                 :statusList="statusList"
@@ -93,19 +93,19 @@
               />
             </el-collapse-item>
 
-            <el-collapse-item name="4" title="供应商驳回,待采购审核" v-if="status + '' === '2'">
+            <el-collapse-item name="4" title="供应商驳回,待采购审核"  v-if="isSupertube && String(sitem.status) === '2' && this.ppowers.includes('2')">
               <purchase-exam :sitem="sitem" @changeStatus="handlePurchaseConfirm" />
             </el-collapse-item>
 
-            <el-collapse-item name="5" title="供应商审核"  v-if="status + '' === '9'">
+            <el-collapse-item name="5" title="供应商审核"   v-if="isSupertube && String(sitem.status) === '9' && this.ppowers.includes('9')">
               <supplier-exam :sitem="sitem" @changeStatus="handleSupplierExam" />
             </el-collapse-item>
 
-            <el-collapse-item name="6" title="待客户退货" v-if="status + '' === '4'">
+            <el-collapse-item name="6" title="待客户退货"  v-if="isSupertube && String(sitem.status) === '4' && this.ppowers.includes('4')">
               <wait-return :sitem="sitem" @changeStatus="handleExpress" />
             </el-collapse-item>
 
-            <el-collapse-item name="7" title="业务公司修改待供应商确认" v-if="status + '' === '10'">
+            <el-collapse-item name="7" title="业务公司修改待供应商确认"  v-if="isSupertube && String(sitem.status) === '10' && this.ppowers.includes('10')">
               <supplier-confrim :sitem="sitem"  @changeStatus="handleSupplierConfirm"/>
             </el-collapse-item>
             
@@ -159,6 +159,7 @@ import SupplierExam from "./components/supplier_exam.vue";
 import { xs_order_type_options } from "@/assets/js/statusList";
 import WaitReturn from "./components/wait-return.vue";
 import SupplierConfrim from "./components/supplier-confirm.vue";
+import { mapGetters } from "vuex";
 
 export default {
   name: "sellAfterApplyDetail",
@@ -171,9 +172,9 @@ export default {
     SupplierConfrim
   },
   computed: {
+    ...mapGetters(['isSuppertube']),
     powers() {
-      const tran =
-        this.$store.getters.btnList.find(
+      const tran = this.$store.getters.btnList.find(
           (item) => item.menu_route == "supplierSellAfterApplyDetail"
         ) || {};
       const { action } = tran ?? {};
@@ -395,6 +396,10 @@ export default {
         this.$message.warning(res.message);
       }
     },
+    hasPermission({status, process}){
+      console.log(this.sitem)
+      return !this.isSupertube && String(this.sitem.status) === status && this.ppowers.includes(process)
+    },
     async initData() {
       let model = {
         returnCode: this.code,

+ 63 - 5
src/views/supplierSellOut/sellAfterApply/index.vue

@@ -12,6 +12,7 @@
         :size="size"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
+        @selection="handleSelection"
         @screen-reset="
           pageInfo.curr = 1;
           parmValue.page = 1;
@@ -78,6 +79,10 @@
                     刷新
                   </el-button>
                 </el-col>
+
+                <el-col :span="4" style="width: 66px; float: right;margin-right: 50px;">
+                  <el-button type="primary" size="mini" @click="handleExport">售后申请单导出</el-button>
+                </el-col>
               </el-col>
             </el-row>
             <el-row style="padding-top: 10px">
@@ -220,13 +225,13 @@
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
-import companyHelper from "@/mixins/companyHelper"
 import { columns } from "./columns";
 import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
 
 export default {
   name: "sellAfterApply",
-  mixins: [mixinPage, resToken, companyHelper],
+  mixins: [mixinPage, resToken],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -240,7 +245,9 @@ export default {
   },
   data() {
     return {
+      fileUrl: urlConfig.baseURL,
       select: "serviceNum",
+      select_list:[],
       s_input: "",
       customerCode: [], //客户公司code
       except_codeOptions: [
@@ -373,6 +380,56 @@ export default {
   },
 
   methods: {
+    handleExport(){
+      if(this.select_list.length === 0){
+        this.$message.warning('请选择一条售后申请单');
+        return
+      }
+      const returnCode = this.select_list.map(({returnCode}) => returnCode)
+
+      if (!this.loading) {
+        this.loading = true;
+        let httpType = `aplication/zip`;
+        axios({
+          method: "post",
+          url: this.fileUrl + "/admin/reorderexam",
+          responseType: "blob",
+          data: {returnCode},
+          headers: {
+            Accept: httpType,
+          },
+        })
+          .then((res) => {
+            if (res && res.status == 200 && res.data) {
+              let url = window.URL.createObjectURL(
+                new Blob([res.data], { type: httpType })
+              );
+              let link = document.createElement("a");
+              link.style.display = "none";
+              link.href = url;
+              let excelName = "售后申请单.zip";
+              link.setAttribute("download", excelName);
+              document.body.appendChild(link);
+              link.click();
+              link.remove();
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+              this.$message.success(`导出成功!`);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            } else {
+              this.$message.error(res.data.message);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            }
+          })
+          .catch((error) => {
+            console.log(error);
+            this.loading = false;
+          });
+      }
+    },
     restSearch() {
       this.customerCode = [];
       this.select = "serviceNum";
@@ -436,6 +493,10 @@ export default {
           console.log("取消");
         });
     },
+    handleSelection(order){
+      const { list } = order
+      this.select_list = list;
+    },
     // 列表搜索
     async searchList() {
        if (
@@ -458,9 +519,6 @@ export default {
       this.parmValue.company_name = this.select === "company_name" ? this.s_input : ""; // 申请人部门
 
       let model = JSON.parse(JSON.stringify(this.parmValue));
-      model.supplierNo = this.currentCompany
-      model.noRelation = true
-      
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

+ 38 - 41
src/views/supplierSellOut/sellReturn/columns.js

@@ -5,45 +5,45 @@ export default [
   //   width:"160"
   // },
   {
-    prop: "returnCode",
-    label: "退货单编号",
-    width: "160"
+    prop: 'returnCode',
+    label: '退货单编号',
+    width: '160'
   },
   {
-    prop: "orderCode",
-    label: "销售订单编号",
-    width: "160"
+    prop: 'orderCode',
+    label: '销售订单编号',
+    width: '160'
   },
   {
-    prop: "status",
-    label: "状态",
-    _slot_: "status",
-    width: "120px",
+    prop: 'status',
+    label: '状态',
+    _slot_: 'status',
+    width: '180px'
   },
   {
-    prop: "good_code",
-    label: "商品成本编码",
-    width: "160"
+    prop: 'good_code',
+    label: '商品成本编码',
+    width: '160'
   },
   {
-    prop: "skuCode",
-    label: "上线商品编码",
-    width: "160"
+    prop: 'skuCode',
+    label: '上线商品编码',
+    width: '160'
   },
   {
-    prop: "good_name",
-    label: "商品名称",
-    'min-width': "180"
+    prop: 'good_name',
+    label: '商品名称',
+    'min-width': '180'
   },
   {
-    prop: "num",
-    label: "退货数量",
-    width: "110"
+    prop: 'num',
+    label: '退货数量',
+    width: '110'
   },
   {
-    prop: "total_num",
-    label: "订单总数",
-    width: "110"
+    prop: 'total_num',
+    label: '订单总数',
+    width: '110'
   },
   // {
   //   prop: "error_msg",
@@ -51,38 +51,35 @@ export default [
   //   width: "160"
   // },
 
-
-
-
   // {
   //   prop: "return_total",
   //   label: "退货总金额",
   //   width: "120"
   // },
   {
-    prop: "company_name",
-    label: "申请人部门",
-    minWidth: "150px",
+    prop: 'company_name',
+    label: '申请人部门',
+    minWidth: '150px'
   },
   {
-    prop: "apply_name",
-    label: "申请人",
-    width: "70"
+    prop: 'apply_name',
+    label: '申请人',
+    width: '70'
   },
   {
-    prop: "addtime",
-    label: "申请时间",
+    prop: 'addtime',
+    label: '申请时间',
     sortable: true,
     width: 150
   },
   {
-    prop: "",
+    prop: '',
     width: 50,
-    label: "操作",
-    fixed: "right",
+    label: '操作',
+    fixed: 'right',
     _noset_: true,
-    _slot_: "operation",
-  },
+    _slot_: 'operation'
+  }
 
 ]
 // page	是	string	页码

+ 132 - 130
src/views/supplierSellOut/sellReturn/components/addForm.vue

@@ -2,10 +2,10 @@
   <el-row :gutter="10">
     <el-col :span="24">
       <el-form
+        ref="ruleForm"
         :model="ruleForm"
         status-icon
         :rules="rulesThis"
-        ref="ruleForm"
         :size="'mini'"
         label-width="80px"
         class="demo-ruleForm"
@@ -20,18 +20,16 @@
                 :size="'mini'"
                 @searchChange="errorCode_change"
               />
-            </el-form-item> </el-col
-          ><el-col :span="16">
+            </el-form-item> </el-col><el-col :span="16">
             <el-form-item label="退货备注" prop="remark">
               <el-input
+                v-model="ruleForm.remark"
                 :disabled="isDetail"
                 type="textarea"
                 maxlength="250"
                 show-word-limit
                 placeholder="请填写备注"
-                v-model="ruleForm.remark"
-              /> </el-form-item></el-col
-        ></el-row>
+              /> </el-form-item></el-col></el-row>
 
         <el-form-item label="收货信息" :size="'mini'" required>
           <el-table
@@ -50,8 +48,7 @@
                 {{ scope.row.contactor }}-{{ scope.row.mobile }}-{{
                   scope.row.addr_info
                 }}{{ scope.row.addr }}
-              </template></el-table-column
-            >
+              </template></el-table-column>
             <el-table-column
               label="收货总数量"
               prop="receipt_quantity"
@@ -62,8 +59,8 @@
               <template slot-scope="scope">
                 <el-form-item style="margin: 0" :size="'mini'">
                   <el-input-number
-                    size="mini"
                     v-model="scope.row.return_num"
+                    size="mini"
                     :disabled="!scope.row.edit"
                     :min="0"
                     :max="scope.row.wsend_num"
@@ -78,27 +75,27 @@
             <el-table-column fixed="right" label="操作" width="50">
               <template slot-scope="scope">
                 <el-tooltip
+                  v-if="!scope.row.edit"
                   effect="dark"
                   content="编辑"
-                  v-if="!scope.row.edit"
                   placement="top"
                 >
                   <i
                     class="el-icon-edit tb-icon"
                     @click="editRow(scope.$index, 1)"
-                  ></i>
+                  />
                 </el-tooltip>
 
                 <el-tooltip
+                  v-if="scope.row.edit"
                   effect="dark"
                   content="保存"
-                  v-if="scope.row.edit"
                   placement="top"
                 >
                   <i
                     class="el-icon-circle-check tb-icon"
                     @click="checkRow(scope.$index, 1)"
-                  ></i>
+                  />
                 </el-tooltip>
               </template>
             </el-table-column>
@@ -107,206 +104,211 @@
       </el-form>
     </el-col>
     <el-col :span="24" style="text-align: right">
-      <el-button type="primary" @click="submitForm" :size="'mini'"
-        >保 存
+      <el-button
+        type="primary"
+        :size="'mini'"
+        @click="submitForm"
+      >保 存
       </el-button>
-      <el-button @click="showModelThis = false" v-if="!isDetail" :size="'mini'"
-        >关 闭</el-button
-      >
+      <el-button
+        v-if="!isDetail"
+        :size="'mini'"
+        @click="showModelThis = false"
+      >关 闭</el-button>
     </el-col>
   </el-row>
 </template>
 
-   <script>
-import asyncRequest from "@/apis/service/sellOut/sellReturn";
-import resToken from "@/mixins/resToken";
-import { isnumber } from "@/utils/validate";
+<script>
+import asyncRequest from '@/apis/service/sellOut/sellReturn'
+import resToken from '@/mixins/resToken'
+import { isnumber } from '@/utils/validate'
 export default {
-  name: "sellReturn",
-  props: ["showModel", "id", "isDetail", "sitem", "showModelThis", "newTime"],
+  name: 'SellReturn',
   mixins: [resToken],
+  props: ['showModel', 'id', 'isDetail', 'sitem', 'showModelThis', 'newTime'],
   data() {
     return {
       loading: false,
       showModelThis: this.showModel,
       ruleForm: {
-        orderCode: "", //发货申请单编号
-        remark: "", //退货备注
-        errorCode: "", //退货原因
+        orderCode: '', // 发货申请单编号
+        remark: '', // 退货备注
+        errorCode: '' // 退货原因
       },
       rulesThis: this.rules,
       rules: {
         errorCode: [
           {
             required: true,
-            message: "请选择退货原因",
-            trigger: "change",
-          },
+            message: '请选择退货原因',
+            trigger: 'change'
+          }
         ],
         remark: [
           {
             required: true,
-            message: "请输入退货备注",
-            trigger: "blur",
-          },
-        ],
+            message: '请输入退货备注',
+            trigger: 'blur'
+          }
+        ]
       },
       tableForm: {
-        get_product_go: [],
-      },
-    };
-  },
-  mounted() {
-    this.initForm();
+        get_product_go: []
+      }
+    }
   },
   watch: {
-    newTime: function (val) {
+    newTime: function(val) {
       if (val) {
-        this.initForm();
+        this.initForm()
       }
-    },
+    }
+  },
+  mounted() {
+    this.initForm()
   },
 
   methods: {
     errorCode_change(e) {
-      this.ruleForm.errorCode = e && e.code ? e.code : "";
-      this.$refs.ruleForm.validateField("errorCode");
+      this.ruleForm.errorCode = e && e.code ? e.code : ''
+      this.$refs.ruleForm.validateField('errorCode')
     },
     async initForm() {
-      this.loading = true;
-      this.rulesThis = this.rules;
-      await this.resetForm();
-      this.loading = false;
+      this.loading = true
+      this.rulesThis = this.rules
+      await this.resetForm()
+      this.loading = false
     },
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          const { info, addrs, orderCode } = this.sitem;
-          console.log(this.sitem);
-          let list =
-            info && info.length > 0 ? JSON.parse(JSON.stringify(info)) : []; //
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
+          const { info, addrs, orderCode } = this.sitem
+          console.log(this.sitem)
+          const list =
+            info && info.length > 0 ? JSON.parse(JSON.stringify(info)) : [] //
           list.map((v) => {
-            v.edit = false;
-            v.return_num = v.return_num || "0";
-            return v;
-          });
-          let l_list =
-            addrs && addrs.length > 0 ? JSON.parse(JSON.stringify(addrs)) : [];
+            v.edit = false
+            v.return_num = v.return_num || '0'
+            return v
+          })
+          const l_list =
+            addrs && addrs.length > 0 ? JSON.parse(JSON.stringify(addrs)) : []
           l_list.map((ele) => {
-            ele.edit = false;
-            ele.return_num = ele.return_num || "0";
-            return ele;
-          });
+            ele.edit = false
+            ele.return_num = ele.return_num || '0'
+            return ele
+          })
           this.ruleForm = {
-            orderCode: orderCode || "",
-            remark: "", //退货备注
-            errorCode: "", //退货原因
-          };
+            orderCode: orderCode || '',
+            remark: '', // 退货备注
+            errorCode: '' // 退货原因
+          }
           this.tableForm = {
-            get_product_go: [].concat(...l_list),
-          };
+            get_product_go: [].concat(...l_list)
+          }
         }
-      });
+      })
     },
 
     async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
+      await this.$refs.ruleForm.validate(async(valid) => {
         if (valid) {
           if (this.loading) {
-            return;
+            return
           }
-          this.loading = true;
-          let model = JSON.parse(JSON.stringify(this.ruleForm));
-          let arr1 = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
-          let wsm_code_edit = false,
-            addr_edit = false,
-            wsm_code_total = 0,
-            addr_total = 0;
+          this.loading = true
+          const model = JSON.parse(JSON.stringify(this.ruleForm))
+          const arr1 = JSON.parse(JSON.stringify(this.tableForm.get_product_go))
+          const wsm_code_edit = false
+          let addr_edit = false
+          const wsm_code_total = 0
+          let addr_total = 0
 
-          let addr = [];
+          const addr = []
           arr1.forEach((e) => {
             if (e.edit) {
-              addr_edit = true;
+              addr_edit = true
             }
-            let obj = {
+            const obj = {
               addrid: e.id,
-              return_num: e.return_num,
-            };
-            addr_total += e.return_num;
-            addr.push(obj);
-          });
-          model.addr = addr;
+              return_num: e.return_num
+            }
+            addr_total += e.return_num
+            addr.push(obj)
+          })
+          model.addr = addr
           if (wsm_code_edit) {
-            this.$message.warning("仓库信息正在编辑,请保存后再试!");
-            this.loading = false;
-            return;
+            this.$message.warning('仓库信息正在编辑,请保存后再试!')
+            this.loading = false
+            return
           }
           if (addr_edit) {
-            this.$message.warning("地址信息正在编辑,请保存后再试!");
-            this.loading = false;
-            return;
+            this.$message.warning('地址信息正在编辑,请保存后再试!')
+            this.loading = false
+            return
           }
           if (wsm_code_total !== addr_total) {
-            this.$message.warning("仓库退货总数不等于收货地址总数!");
-            this.loading = false;
-            return;
+            this.$message.warning('仓库退货总数不等于收货地址总数!')
+            this.loading = false
+            return
           }
-          let res = await asyncRequest.add(model);
-          this.loading = false;
+          const res = await asyncRequest.add(model)
+          this.loading = false
           if (res && res.code === 0) {
-            const title = this.id === "add" ? "添加成功" : "修改成功";
+            const title = this.id === 'add' ? '添加成功' : '修改成功'
             this.$notify.success({
               title,
-              message: "",
-            });
-            this.showModelThis = false;
+              message: ''
+            })
+            this.showModelThis = false
             // 刷新
-            this.$emit("refresh", false);
+            this.$emit('refresh', false)
           } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
+            await this.logout()
           } else {
-            this.$message.warning(res.message);
+            this.$message.warning(res.message)
           }
         } else {
-          console.log("error submit!!");
-          return false;
+          console.log('error submit!!')
+          return false
         }
-      });
+      })
     },
-    //保存某一行
+    // 保存某一行
     checkRow(rowIndex, type) {
       if (type === 1) {
         const { wsend_num, return_num } =
-          this.tableForm.get_product_go[rowIndex];
+          this.tableForm.get_product_go[rowIndex]
         if (!isnumber(return_num)) {
-          this.$message.warning("退货数量不规范!");
-          return;
+          this.$message.warning('退货数量不规范!')
+          return
         }
         if (parseInt(wsend_num) < parseInt(return_num)) {
-          this.$message.warning("退货数量不能大于未发货总数量!");
-          return;
+          this.$message.warning('退货数量不能大于未发货总数量!')
+          return
         }
-        this.tableForm.get_product_go[rowIndex].edit = false;
+        this.tableForm.get_product_go[rowIndex].edit = false
       }
     },
-    //编辑某一行
+    // 编辑某一行
     editRow(rowIndex, type) {
-      let list = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
-      let index = list.findIndex((v) => {
-        v.edit;
-      });
+      const list = JSON.parse(JSON.stringify(this.tableForm.get_product_go))
+      const index = list.findIndex((v) => {
+        v.edit
+      })
       if (index !== -1) {
-        this.$message.warning("请完成其他行的编辑!");
-        return;
+        this.$message.warning('请完成其他行的编辑!')
+        return
       }
-      this.tableForm.get_product_go[rowIndex].edit = true;
-    },
-  },
-};
+      this.tableForm.get_product_go[rowIndex].edit = true
+    }
+  }
+}
 </script>
 
 <style>
-</style>
+</style>

+ 135 - 0
src/views/supplierSellOut/sellReturn/components/approval-results.vue

@@ -0,0 +1,135 @@
+<template>
+  <el-form ref="formRef" class="supplier-form" size="mini" label-width="80px" :model="formData" :rules="rules">
+    <el-form-item label="审核状态" prop="status">
+      <el-select v-model="formData.status" style="width:100%">
+        <el-option label="修改供应商审批结果" value="10" />
+        <el-option label="认同供应商审批结果" value="4" />
+      </el-select>
+    </el-form-item>
+
+    <el-form-item label="审核备注" prop="remark">
+      <el-input v-model="formData.remark" />
+    </el-form-item>
+
+    <template v-if="displayExpressField">
+      <el-form-item label="退回至" prop="return_wsm">
+        <search-stock
+          :size="'mini'"
+          :value="formData.return_wsm"
+          placeholder="退货仓库"
+          :is-detail="true"
+          :is-relation="true"
+          :names="wsm_code_name"
+          :company-no="currentCompany"
+          @searchChange="stockChange"
+        />
+      </el-form-item>
+
+      <el-form-item label="">
+        <el-input v-model="expressInfo" placeholder="退货仓库收货信息展示" disabled />
+      </el-form-item>
+    </template>
+
+    <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>
+import companyHelper from '@/mixins/companyHelper'
+export default {
+  name: 'ApprovalResults',
+  mixins: [companyHelper],
+  props: [],
+  data() {
+    return {
+      company: '',
+      formData: {
+        status: '10',
+        remark: '',
+        return_wsm: ''
+      },
+      wsm_code: '',
+      wsm_name: '',
+      expressInfo: ''
+    }
+  },
+  computed: {
+    displayExpressField() {
+      return this.formData.status === '4'
+    },
+    rules() {
+      const { status } = this.formData
+      return ({
+        return_wsm: [
+          {
+            type: 'array',
+            required: true,
+            trigger: 'change',
+            message: '请选择退货仓库'
+          }
+        ],
+        status: [
+          {
+            required: true,
+            trigger: 'change',
+            message: '请选择退货仓库'
+          }
+        ],
+        remark: [
+          {
+            required: status === '10',
+            trigger: 'change',
+            message: '请输入审核备注'
+          }
+        ]
+      })
+    }
+  },
+  watch: {
+    'formData.status'(status) {
+      // this
+      this.formData = {
+        status,
+        remark: '',
+        return_wsm: ''
+      }
+    }
+  },
+  mounted() {
+  },
+  methods: {
+    async stockChange(e) {
+      const { code, label, contactor, mobile, addr_cn } = e
+      this.expressInfo = `${contactor}-${mobile}-${addr_cn}`
+      this.wsm_name = label || ''
+      this.wsm_code = code || ''
+      this.formData.return_wsm = code ? [code] : []
+      this.$refs.formRef.validateField('return_wsm')
+    },
+    submit() {
+      this.$refs.formRef.validate(isValid => {
+        if (!isValid) return
+        const { return_wsm } = this.formData
+
+        const params = {
+          ...this.formData,
+          return_wsm: Array.isArray(return_wsm) ? return_wsm[0] : return_wsm
+        }
+
+        this.$emit('changeStatus', params)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.supplier-form{
+  ::v-deep(.el-form-item){
+    width: 500px;
+  }
+}
+</style>

+ 105 - 14
src/views/supplierSellOut/sellReturn/detail.vue

@@ -145,19 +145,40 @@
                 :iscgd="false"
               />
             </el-collapse-item>
+            <!-- newTime !== '' &&
+                sitem &&
+                !(
+                  (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
+                  is_stock + '' === '1'
+                ) &&
+                ppowers.some((i) => i == '1') && -->
             <el-collapse-item
               title="业务审核"
               name="3"
-              v-if="
-                newTime !== '' &&
+              v-if="hasPermission({status:'1', process:'1'})"
+            >
+              <exam-form
+                v-if="newTime"
+                :statusList="statusList"
+                :newTime="newTime"
+                :disabled="false"
+                :isMust="false"
+                @searchChange="examForm"
+              />
+            </el-collapse-item>
+
+            <!-- newTime !== '' &&
                 sitem &&
                 !(
                   (sitem.order_type + '' === '1' || sitem.order_type + '' === '2') &&
                   is_stock + '' === '1'
                 ) &&
-                ppowers.some((i) => i == '1') &&
-                status + '' === '1'
-              "
+                ppowers.some((i) => i == '1') && -->
+
+            <el-collapse-item
+              title="供应商审核"
+              name="4"
+              v-if="hasPermission({status:'9', process:'9'})"
             >
               <exam-form
                 v-if="newTime"
@@ -165,11 +186,27 @@
                 :newTime="newTime"
                 :disabled="false"
                 :isMust="false"
-                @searchChange="examForm"
+                @searchChange="examForm_supplier"
               />
             </el-collapse-item>
 
-            <el-collapse-item
+
+            <el-collapse-item title="供应商已驳回,待采购审核" name="5"  v-if="hasPermission({status:'8', process:'8'})">
+              <approval-results @changeStatus="handlePurchaseExam" />
+            </el-collapse-item>
+
+            <el-collapse-item title="业务公司修改待供应商确认" name="6" v-if="hasPermission({status:'10', process:'10'})">
+              <exam-form
+                v-if="newTime"
+                :statusList="statusList"
+                :newTime="newTime"
+                :disabled="false"
+                :isMust="false"
+                @searchChange="handleSupplierConfirm"
+              />
+            </el-collapse-item>
+
+            <!-- <el-collapse-item
               title="采购专员审批"
               name="4"
               v-if="
@@ -194,7 +231,8 @@
                 :isMust="false"
                 @refresh="initData"
               />
-            </el-collapse-item>
+            </el-collapse-item> -->
+<!-- 
             <el-collapse-item
               title="采购主管审批"
               name="5"
@@ -216,7 +254,7 @@
                 :isMust="false"
                 @searchChange="dirExamForm"
               />
-            </el-collapse-item>
+            </el-collapse-item> -->
           </el-collapse>
         </el-tab-pane>
         <el-tab-pane label="审批记录" name="2">
@@ -244,17 +282,20 @@ import resToken from "@/mixins/resToken";
 import asyncRequest from "@/apis/service/sellOut/sellReturn";
 // import ReturnCheck from "./components/returnCheck";
 import comExamForm from "./components/comExamForm";
+import ApprovalResults from "./components/approval-results.vue";
 import { showColumns } from "./components/ShowDataTableColumns";
 import { xs_order_type_options } from "@/assets/js/statusList";
-
+import { mapGetters } from "vuex";
 export default {
   name: "sellReturnDetail",
   mixins: [mixinPage, resToken],
   components: {
     comExamForm,
+    ApprovalResults
     // ReturnCheck,
   },
   computed: {
+    ...mapGetters(['isSupertube']),
     powers() {
       const tran =
         this.$store.getters.btnList.find(
@@ -275,17 +316,27 @@ export default {
       activeTabs: "1",
       showColumns: showColumns,
       statusOptions: [
+        // { value: "1", label: "待业务审批" },
+        // { value: "2", label: "待专员审批" },
+        // { value: "3", label: "待主管审批" },
+        // { value: "4", label: "退货完成" },
+        // { value: "5", label: "业务驳回" },
+        // { value: "6", label: "采购驳回" },
+        // { value: "7", label: "专员审批不通过" },
         { value: "1", label: "待业务审批" },
         { value: "2", label: "待专员审批" },
         { value: "3", label: "待主管审批" },
         { value: "4", label: "退货完成" },
         { value: "5", label: "业务驳回" },
-        { value: "6", label: "采购驳回" },
+        // { value: "6", label: "采购驳回" }, // 废弃
+        { value: '8', label:'供应商驳回,待采购审核'},
+        { value: '9', label:'待供应商确认'},
+        { value: '10', label:'业务公司修改待供应商确认'},
         { value: "7", label: "专员审批不通过" },
       ],
       xs_order_type_options,
       sitem: null, //传给组件
-      activeNames: ["0", "1", "2", "3", "4", "5"],
+      activeNames: ["0", "1", "2", "3", "4", "5", "6"],
       sitem: null,
       status: "", //存储详情接口状态
       statusList: [
@@ -326,13 +377,49 @@ export default {
           console.log("取消");
         });
     },
+    async handlePurchaseExam(data){
+      let _model = {
+        returnCode: this.queryId,
+        ...data
+      };
+
+      let res = await asyncRequest.status(_model);
+      console.log(res)
+
+      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);
+      }
+    },
     getNewTime() {
       this.newTime = new Date().valueOf();
     },
+    //供应商确认
+    async handleSupplierConfirm(e){
+      if (!this.loading) {
+        let type = e.state + '' === "1" ? "4" : "8";
+        let message = e.state + '' === "1" ? "提交审核结果" : "提交审核结果";
+        await this.statusConfirm(type, message, e.remark);
+      }
+    },
     // 点击业务审核的保存按钮
     async examForm(e) {
       if (!this.loading) {
-        let type = e.state + '' === "1" ? "2" : "5";
+        let type = e.state + '' === "1" ? "9" : "5";
+        let message = e.state + '' === "1" ? "提交审核结果" : "提交审核结果";
+        await this.statusConfirm(type, message, e.remark);
+      }
+    },
+    async examForm_supplier(e){
+      if (!this.loading) {
+        let type = e.state + '' === "1" ? "4" : "8";
         let message = e.state + '' === "1" ? "提交审核结果" : "提交审核结果";
         await this.statusConfirm(type, message, e.remark);
       }
@@ -340,7 +427,7 @@ export default {
     // 点击采购主管审核的保存按钮
     async dirExamForm(e) {
       if (!this.loading) {
-        let type = e.state + '' === "1" ? "4" : "2";
+        let type = e.state + '' === "1" ? "4" : "8";
         let message = e.state + '' === "1" ? "提交审核结果" : "提交审核结果";
         await this.statusConfirm(type, message, e.remark);
       }
@@ -364,6 +451,10 @@ export default {
         this.$message.warning(res.message);
       }
     },
+
+    hasPermission({status, process}){
+      return !this.isSupertube && String(this.sitem.status) === status && this.ppowers.includes(process)
+    },
     async initData() {
       const { code, data, message } = await asyncRequest.detail({
         returnCode: this.queryId,

+ 85 - 15
src/views/supplierSellOut/sellReturn/index.vue

@@ -12,6 +12,7 @@
         :size="size"
         @page-curr-change="handlePageChange"
         @page-size-change="handleSizeChange"
+        @selection="handleSelection"
         @screen-reset="
           pageInfo.curr = 1;
           parmValue.page = 1;
@@ -120,7 +121,13 @@
                 </el-col>
               </el-col>
             </el-row>
-            <el-row style="padding: 10px 0 0 0"> </el-row>
+
+
+            <el-row style="padding: 10px 0 0 0">
+               <div style="display:flex;width:100%;justify-content:flex-end">
+                  <el-button type="primary" size="mini" @click="handleExport">退货单导出</el-button>
+               </div>
+             </el-row>
           </div>
         </template>
         <template #status="{ scope }">
@@ -128,7 +135,7 @@
             :size="tablebtnSize"
             :type="scope.row.status == '0' ? 'warning' : ''"
             v-text="
-              (statusOptions.find((item) => item.id == scope.row.status) || {})
+              (statusOptions.find((item) => item.value == scope.row.status) || {})
                 .label || '--'
             "
           ></el-tag>
@@ -156,14 +163,14 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import companyHelper from "@/mixins/companyHelper"
 import columns from "./columns";
 import asyncRequest from "@/apis/service/sellOut/sellReturn";
 import { mapGetters } from "vuex";
+import urlConfig from "@/apis/url-config";
 
 export default {
   name: "sellReturn",
-  mixins: [mixinPage, resToken, companyHelper],
+  mixins: [mixinPage, resToken],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
@@ -177,18 +184,30 @@ export default {
   },
   data() {
     return {
+      fileUrl: urlConfig.baseURL,
       select: "returnCode", //默认选择下拉框
       s_input: "", //搜索框内容
+      select_list:[],
       sitem: null,
       // 状态
       statusOptions: [
-        { id: "1", label: "待业务审批" },
-        { id: "2", label: "待专员审批" },
-        { id: "3", label: "待主管审批" },
-        { id: "4", label: "退货完成" },
-        { id: "5", label: "业务驳回" },
-        { id: "6", label: "采购驳回" },
-        { id: "7", label: "专员审批不通过" },
+        // { value: "1", label: "待业务审批" },
+        // { value: "2", label: "待专员审批" },
+        // { value: "3", label: "待主管审批" },
+        // { value: "4", label: "退货完成" },
+        // { value: "5", label: "业务驳回" },
+        // { value: "6", label: "采购驳回" },
+        // { value: "7", label: "专员审批不通过" },
+        { value: "1", label: "待业务审批" },
+        { value: "2", label: "待专员审批" },
+        { value: "3", label: "待主管审批" },
+        { value: "4", label: "退货完成" },
+        { value: "5", label: "业务驳回" },
+        { value: "6", label: "采购驳回" }, // 废弃
+        { value: "7", label: "专员审批不通过" },
+        { value: '8', label:'供应商驳回,待采购审核'},
+        { value: '9', label:'待供应商确认'},
+        { value: '10', label:'业务公司修改待供应商确认'},
       ],
       loading: false,
       showModel: false,
@@ -234,7 +253,6 @@ export default {
     const { back } = this.$route.query;
     if (back) {
       this.parmValue = JSON.parse(back);
-      console.log(this.parmValue);
       const { page, size } = this.parmValue;
       // this.parmValue.start = start || last_start;
       // this.parmValue.end = end || last_end;
@@ -259,6 +277,61 @@ export default {
   },
 
   methods: {
+    handleExport(){
+      if(this.select_list.length === 0){
+        this.$message.warning('请选择一条退货单');
+        return
+      }
+
+      const returnCode = this.select_list.map(({returnCode}) => returnCode)
+
+      if (!this.loading) {
+        this.loading = true;
+        let httpType = `aplication/zip`;
+        axios({
+          method: "post",
+          url: this.fileUrl +  "/admin/reorderExport",
+          responseType: "blob",
+          data: {returnCode},
+          headers: {
+            Accept: httpType,
+          },
+        })
+          .then((res) => {
+            if (res && res.status == 200 && res.data) {
+              let url = window.URL.createObjectURL(
+                new Blob([res.data], { type: httpType })
+              );
+              let link = document.createElement("a");
+              link.style.display = "none";
+              link.href = url;
+              let excelName = "退货单.zip";
+              link.setAttribute("download", excelName);
+              document.body.appendChild(link);
+              link.click();
+              link.remove();
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+              this.$message.success(`导出成功!`);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            } else {
+              this.$message.error(res.data.message);
+              setTimeout(() => {
+                this.loading = false;
+              }, 500);
+            }
+          })
+          .catch((error) => {
+            console.log(error);
+            this.loading = false;
+          });
+      }
+    },
+    handleSelection(order){
+      const { list } = order
+      this.select_list = list;
+    },
     getRouter(toRouter, queryId) {
       if (toRouter && queryId) {
         let model = {
@@ -364,9 +437,6 @@ export default {
 
       let model = JSON.parse(JSON.stringify(this.parmValue));
 
-      model.supplierNo = this.currentCompany
-      model.noRelation = true
-
       const res = await asyncRequest.list(model);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;

Some files were not shown because too many files changed in this diff