lilei пре 1 година
родитељ
комит
a615fd218b

BIN
public/templ/采购退货申请单产品明细模板.xlsx


BIN
public/templ/采购退货申请单(不良品)产品明细模板.xlsx


BIN
public/templ/采购退货申请单(良品)产品明细模板.xlsx


+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1689296694867
+  "version": 1689307388171
 }

+ 4 - 3
src/api/purchaseReturnApply.js

@@ -78,9 +78,10 @@ export const purchaseReturnModifyQty = (params) => {
   })
 }
 // 申请单详情修改退货原因
-export const modifyReturnReason = (params) => {
+// 修改备注
+export const modifyReturnInfo = (params) => {
   return axios({
-    url: `/purchaseReturnApply/detail/modifyReturnReason`,
+    url: `/purchaseReturnApply/detail/modifyInfo`,
     data: params,
     method: 'post'
   })
@@ -88,7 +89,7 @@ export const modifyReturnReason = (params) => {
 // 批量修改退货原因
 export const modifyReturnReasonList = (params) => {
   return axios({
-    url: `/purchaseReturnApply/detail/modifyReturnReasonList`,
+    url: `/purchaseReturnApply/detail/modifyInfoList`,
     data: params,
     method: 'post'
   })

+ 5 - 6
src/store/modules/app.js

@@ -48,7 +48,8 @@ const app = {
     printSettingType: '', // 设置打印机类型,0 针式,1 喷墨
     printDefNeedle: undefined,// 默认针式打印机
     printDefInk: undefined, // 默认喷墨打印机
-    returnReason: [], // 申请退货列表
+    defectiveReturnReason: [], // 不良品申请退货列表
+    goodReturnReason: [], // 良品申请退货列表
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {
@@ -151,8 +152,8 @@ const app = {
     SET_printSettingType: (state, val) => {
       state.printSettingType = val
     },
-    SET_returnReason:(state, val) => {
-      state.returnReason = val
+    SET_returnReason:(state, obj) => {
+      state[obj.key] = obj.val
     },
   },
   actions: {
@@ -255,9 +256,7 @@ const app = {
         isEnable: params.isEnable
       }).then(res => {
         if (res.status == 200) {
-          commit('SET_returnReason', res.data.list)
-        }else{
-          commit('SET_returnReason', [])
+          commit('SET_returnReason', {key: params.key, val: res.data.list})
         }
       })
     },

+ 7 - 1
src/views/Home.vue

@@ -902,7 +902,13 @@ export default {
       }
       // 退货原因列表
       vm.getLookUpDataByCode({
-        code: 'RETURN_REASON',
+        code: 'GOOD_PRODUCT_RETURN',
+        key: 'goodReturnReason',
+        isEnable: 1
+      })
+      vm.getLookUpDataByCode({
+        code: 'DEFECTIVE_PRODUCT_RETURN',
+        key: 'defectiveReturnReason',
         isEnable: 1
       })
     })

+ 1 - 0
src/views/allocationManagement/chainTransferOut/list.vue

@@ -71,6 +71,7 @@
               <a-button
                 type="primary"
                 class="button-warning"
+                v-if="$hasPermissions('B_allocLinkageOutExport')"
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"

+ 39 - 39
src/views/common/returnReason.js

@@ -1,31 +1,26 @@
 const ReturnReason = {
   template: `
-        <a-select
-            allowClear
-            :size="size"
-            mode="combobox"
-            :value="defaultVal"
-            show-search
-            :placeholder="placeholder"
-            option-filter-prop="children"
-            style="width: 100%"
-            :filter-option="filterOption"
-            :dropdownMatchSelectWidth="false"
-            @change="onChange"
-            @blur="onBlur"
-            @focus="open=true"
-            @select="open=false"
-            :open="open"
-          >
-            <a-select-option v-for="item in list" :key="item.code" :value="item.dispName">
-              {{item.dispName}}
-            </a-select-option>
-          </a-select>
+      <a-select
+        :placeholder="placeholder"
+        style="width:100%"
+        :size="size"
+        :id="id"
+        allowClear
+        :value="defaultVal"
+        :showSearch="true"
+        @change="handleChange"
+        option-filter-prop="children"
+        :dropdownMatchSelectWidth="false"
+        :filter-option="filterOption">
+        <a-select-option v-for="item in list" :key="item.code" :value="item.code">
+          {{item.dispName}}
+        </a-select-option>
+      </a-select>
     `,
   props: {
     value: {
       type: String,
-      default: ''
+      default: undefined
     },
     id: {
       type: String,
@@ -33,27 +28,38 @@ const ReturnReason = {
     },
     placeholder: {
       type: String,
-      default: '请输入退货原因(最多50字符)'
+      default: '请选择退货原因'
     },
     size: {
       type: String,
       default: 'small'
+    },
+    goodFlag: {
+      type: String,
+      default: ''
     }
   },
   data() {
     return {
       defaultVal: this.value,
-      open: false,
       list: []
     };
   },
-  mounted() {
-    this.list = this.$store.state.app.returnReason
+  created() {
+    // 不良品
+    if(this.goodFlag == 'DEFECTIVE_PRODUCT_RETURN'){
+      this.list = this.$store.state.app.defectiveReturnReason
+    }
+    // 良品
+    if(this.goodFlag == 'GOOD_PRODUCT_RETURN'){
+      this.list = this.$store.state.app.goodReturnReason
+    }
+    console.log(this.list)
   },
   watch: {
     value(newValue, oldValue) {
-      this.defaultVal = newValue
-    },
+      this.defaultVal = newValue || undefined
+    }
   },
   methods: {
     filterOption(input, option) {
@@ -61,17 +67,11 @@ const ReturnReason = {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       );
     },
-    onChange(value) {
-      console.log(value,'----')
-      this.open = true;
-      const ret = value?value.substr(0,50):''
-      this.defaultVal = ret;
-      this.$emit('change', ret);
-      this.$emit('input', ret);
-    },
-    onBlur(value){
-      this.open = false;
-      this.$emit('blur', value);
+    handleChange(value) {
+      this.defaultVal = value;
+      const row = this.list.find(item => item.code == value)
+      this.$emit('change', value, row);
+      this.$emit('input', value);
     }
   },
 };

+ 13 - 11
src/views/purchasingManagement/purchaseReturnApplyForm/chooseImportModal.vue

@@ -86,21 +86,23 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [
-        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'product.unit', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '7%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'product.unit', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'exprotQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
       nowUnColumns: [
-        { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'product.unit', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'exprotQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '7%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'product.unit', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'exprotQty', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '错误说明', dataIndex: 'remarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       unLoadData: [],

+ 71 - 30
src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue

@@ -6,6 +6,7 @@
         <template slot="subTitle">
           <a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">供应商名称:箭冠营销中心</span>
+          <span style="margin: 0 15px;color: #666;">退货类别:{{detailData&&detailData.goodFlagDictValue||'--'}}</span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
         <template slot="extra" v-if="$hasPermissions('B_purchaseReturnApplyPrint')">
@@ -74,7 +75,7 @@
               </template>
               <!-- 退货原因 -->
               <template slot="returnReason" slot-scope="text, record">
-                <returnReason v-model="record.returnReason"></returnReason>
+                <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode"></returnReason>
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
@@ -178,7 +179,11 @@
               </template>
               <!-- 退货原因 -->
               <template slot="returnReason" slot-scope="text, record">
-                <returnReason v-model="record.returnReason" @blur="e => remarksBlur(e, record)"></returnReason>
+                <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode" @change="e => returnReasonChange(e, record, 0)"></returnReason>
+              </template>
+              <!-- 备注 -->
+              <template slot="returnRemarks" slot-scope="text, record">
+                <a-input size="small" v-model="record.returnReasonRemarks" @change="e => returnReasonChange(e, record, 1)"></a-input>
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
@@ -203,16 +208,21 @@
     <!-- 导入明细 -->
     <importGuideModal
       :openModal="openGuideModal"
+      :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0"
       :params="{purchaseReturnApplySn: $route.params.sn, purchaseReturnApplyNo:detailData?detailData.purchaseReturnApplyNo:''}"
       @close="openGuideModal=false"
       @ok="hanldeImprotOk" />
 
     <!-- 批量设置退货原因 -->
     <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @close="showPlModal=false" @ok="setPlReturnReason">
-      <div style="text-align: center;">
-        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
+      <div style="text-align: left;">
         <div style="line-height: 24px;">
-          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
+          <div><span style="color:red;">*</span>退货原因</div>
+          <div><returnReason size="large" :goodFlag="goodFlag" v-model="plReturnReason"></returnReason></div>
+        </div>
+        <div style="line-height: 24px;margin-top:10px;">
+          <div>备注</div>
+          <div><a-input size="large" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
         </div>
       </div>
     </commonModal>
@@ -235,7 +245,7 @@ import {
   purchaseReturnDetailDel,
   purchaseReturnDetailDelAll,
   purchaseReturnModifyQty,
-  modifyReturnReason,
+  modifyReturnInfo,
   purchaseReturnSubmit,
   purchaseReturnApplyPrint,
   purchaseReturnApplyExport,
@@ -258,7 +268,7 @@ export default {
       },
       productType: [],
       dataSource: [],
-      returnReasonList: [], // 退货原因列表
+      returnReasonlist: [],
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
       openGuideModal: false, // 导入产品弹框
@@ -266,12 +276,14 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.queryParam.sysFlag = '1' // 剪冠产品
+        this.queryParam.onlineFalg = this.goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : undefined
         return queryDealerScopeProductPage(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].returnQty = 1
+            data.list[i].returnReasonCode = undefined
           }
           this.disabled = false
           return data
@@ -289,7 +301,7 @@ export default {
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].qtyBackups = data.list[i].initQty
-            data.list[i].returnReasonBackups = data.list[i].returnReason
+            data.list[i].returnReasonBackups = data.list[i].returnReasonCode
           }
           this.dataSource = data.list
           return data
@@ -297,14 +309,16 @@ export default {
       },
       detailData: null,
       rowSelectionInfo: null,
-      plReturnReason: '',
+      plReturnReason: undefined,
+      plReturnRemark: '',
       showPlModal: false
     }
   },
   watch: {
     showPlModal (newValue, oldValue) {
       if (!newValue) {
-        this.plReturnReason = ''
+        this.plReturnReason = undefined
+        this.plReturnRemark = ''
       }
     }
   },
@@ -312,6 +326,9 @@ export default {
     selNums () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    goodFlag() {
+      return this.detailData && this.detailData.goodFlag || ''
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -397,11 +414,15 @@ export default {
         this.$message.warning('请输入退货数量')
         return
       }
+      // 退货原因
+      const rows = this.returnReasonlist.find(item => item.code == row.returnReasonCode)
       const params = {
         purchaseReturnApplySn: this.$route.params.sn,
         initQty: row.returnQty, //  退货数量
         productSn: row.productSn,
-        returnReason: row.returnReason
+        returnReasonCode: row.returnReasonCode,
+        returnReason: rows ? rows.dispName : '',
+        goodFlag: this.goodFlag
       }
       this.spinning = true
       purchaseReturnDetailSave(params).then(res => {
@@ -500,23 +521,31 @@ export default {
       }
     },
     // 已选产品 退货原因修改
-    remarksBlur (val, record) {
-      // 空或没有改变时不保存数据
-      if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
-        record.returnReason = record.returnReasonBackups
-        return
+    returnReasonChange (val, record, type) {
+      console.log(val,record,type)
+      const params = {
+        purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
+        purchaseReturnApplySn: this.$route.params.sn,
+        goodFlag: this.goodFlag
+      }
+      // 退货原因
+      if(type == 0){
+        const rows = this.returnReasonlist.find(item => item.code == val)
+        params.returnReasonCode = val||''
+        params.returnReason = rows ? rows.dispName : ''
+      }else{
+        // 备注
+        params.returnReasonRemarks = val
       }
       this.spinning = true
-      modifyReturnReason({
-        returnReason: record.returnReason,
-        purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
-        purchaseReturnApplySn: this.$route.params.sn
-      }).then(res => {
+      modifyReturnInfo(params).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.chooseTable.refresh()
         } else {
-          record.returnReason = record.returnReasonBackups
+          if(type == 0){
+            record.returnReasonCode = record.returnReasonBackups
+          }
         }
         this.spinning = false
       })
@@ -530,16 +559,20 @@ export default {
       }
     },
     setPlReturnReason () {
-      if (this.plReturnReason == '') {
-        this.$message.warning('请输入退货原因!')
+      if (!this.plReturnReason) {
+        this.$message.warning('请选择退货原因!')
       } else {
         this.spinning = true
         const snList = []
         const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
         arr.map(item => {
           snList.push({
             purchaseReturnApplyDetailSn: item.purchaseReturnApplyDetailSn,
-            returnReason: this.plReturnReason
+            returnReason: rows ? rows.dispName : '',
+            returnReasonCode: this.plReturnReason,
+            returnReasonRemarks: this.plReturnRemark,
+            goodFlag: this.goodFlag
           })
         })
         modifyReturnReasonList({
@@ -556,16 +589,24 @@ export default {
       }
     },
     // 获取单据详情
-    getDetail () {
+    getDetail (flag) {
       purchaseReturnDetail({ sn: this.$route.params.sn }).then(res => {
         this.detailData = res.data ? res.data : null
+        if(res.data.goodFlag == 'DEFECTIVE_PRODUCT_RETURN'){
+          this.returnReasonlist = this.$store.state.app.defectiveReturnReason
+        }
+        // 良品
+        if(res.data.goodFlag == 'GOOD_PRODUCT_RETURN'){
+          this.returnReasonlist = this.$store.state.app.goodReturnReason
+        }
+        if(flag){
+          this.$refs.chooseTable.refresh(true)
+          this.resetSearchForm()
+        }
       })
     },
     pageInit () {
-      this.returnReasonList = this.$store.state.app.returnReason
-      this.$refs.chooseTable.refresh(true)
-      this.resetSearchForm()
-      this.getDetail()
+      this.getDetail(true)
     }
   },
   mounted () {

+ 8 - 2
src/views/purchasingManagement/purchaseReturnApplyForm/importGuideModal.vue

@@ -15,7 +15,7 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“申请退货数量”、“退货原因”的列,且名称必须相同,其它列可自定义,不影响数据导入</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“申请退货数量”、“退货原因”、“备注”的列,且名称必须相同,其它列可自定义,不影响数据导入</li>
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
             <li>
               <a :href="filePath" style="margin: 5px 0 0;display: block;">
@@ -80,6 +80,10 @@ export default {
     params: {
       type: Object,
       default: null
+    },
+    goodFlag: {
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -91,7 +95,7 @@ export default {
       uploadParams: {
         savePathType: 'local'
       },
-      filePath: location.protocol + '//' +location.host + '/templ/采购退货申请单产品明细模板.xlsx'
+      filePath: ''
     }
   },
   methods: {
@@ -141,6 +145,8 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.resetSearchForm()
+      }else{
+        this.filePath = location.protocol + '//' +location.host + (this.goodFlag==1 ? '/templ/采购退货申请单(良品)产品明细模板.xlsx' : '/templ/采购退货申请单(不良品)产品明细模板.xlsx')
       }
     }
   }

+ 70 - 21
src/views/purchasingManagement/purchaseReturnApplyForm/list.vue

@@ -21,6 +21,17 @@
                   allowClear></v-select>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="退货类别">
+                <v-select
+                  v-model="queryParam.goodFlag"
+                  ref="goodFlag"
+                  id="purchaseReturnList-goodFlag"
+                  code="GOOD_FLAG"
+                  placeholder="请选择退货类别"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="采购退货申请单号">
                 <a-input id="purchaseReturnList-purchaseReturnApplyNo" v-model.trim="queryParam.purchaseReturnApplyNo" allowClear placeholder="请输入采购退货申请单号"/>
@@ -116,6 +127,32 @@
 
     <!-- 生成采购退货单 -->
     <creatPurchaseReutn ref="creatPurchaseReutn" :openModal="openCpModal" @close="openCpModal=false" @creatOk="$refs.table.refresh()"></creatPurchaseReutn>
+    <!-- 新建弹框 -->
+    <common-modal
+      :openModal="openTipsModal"
+      modalTit="新建采购退货申请单"
+      okText="确定"
+      @ok="creatReturnOrder"
+      @close="closeCreatModal">
+        <div>
+          <div style="padding:10px 0;">供应商:箭冠营销中心</div>
+          <div style='color:#999;'>
+            <div>说明:</div>
+            <div>1、采购退货申请单提交后,箭冠营销中心系统将能查看到此单并进行后续处理。</div>
+            <div>2、采购退货申请单中的产品,不会占用库存。</div>
+          </div>
+          <div style="display:flex;align-items: center;padding-top: 20px;">
+             <span style="color:red;">*</span>
+             <span>退货类别:</span>
+             <v-select
+               style="width:250px;"
+               v-model="goodFlag"
+               code="GOOD_FLAG"
+               placeholder="请选择退货类别"
+               allowClear></v-select>
+          </div>
+        </div>
+    </common-modal>
   </a-card>
 </template>
 
@@ -125,14 +162,16 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import getDate from '@/libs/getDate.js'
 import creatPurchaseReutn from './creatPurchaseReutn.vue'
+import commonModal from '@/views/common/commonModal.vue'
 import { purchaseReturnList, purchaseReturnSave, purchaseReturnDel, purchaseReturnAgainCreate } from '@/api/purchaseReturnApply'
 export default {
   name: 'PurchaseReturnList',
-  components: { STable, VSelect, rangeDate, creatPurchaseReutn },
+  components: { STable, VSelect, rangeDate, creatPurchaseReutn, commonModal },
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
+      openTipsModal: false,
       advanced: true, // 高级搜索 展开/关闭
       openCpModal: false,
       time: [
@@ -146,9 +185,11 @@ export default {
         purchaseReturnApplyNo: '', //  退货申请单号
         billStatus: undefined, //  业务状态
         billSource: undefined, // 单据来源
+        goodFlag: undefined, // 退货类别
         beginAuditDate: '', // 审核时间
         endAuditDate: ''
       },
+      goodFlag: undefined,
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
       // 加载数据方法 必须为 Promise 对象
@@ -179,13 +220,14 @@ export default {
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '单据来源', dataIndex: 'billSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购退货申请单号', scopedSlots: { customRender: 'purchaseReturnApplyNo' }, width: '14%', align: 'center' },
-        { title: '供应商', dataIndex: 'returnTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商', dataIndex: 'returnTargetName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总公司实收数量', dataIndex: 'totalReceiveQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客服审核时间', dataIndex: 'auditTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       return arr
     }
@@ -214,6 +256,7 @@ export default {
       this.queryParam.purchaseReturnApplyNo = ''
       this.queryParam.billStatus = undefined
       this.queryParam.billSource = undefined
+      this.queryParam.goodFlag = undefined
       this.auditTime = []
       this.$refs.auditDate.resetDate(this.auditTime)
       this.queryParam.beginAuditDate = ''
@@ -253,25 +296,31 @@ export default {
       if (row) { //  编辑
         _this.$router.push({ name: 'purchaseReturnApplyFormEdit', params: { sn: row.purchaseReturnApplySn } })
       } else { //  新增
-        this.$confirm({
-          title: '提示',
-          content: <div><div style="padding:10px 0;">供应商:箭冠营销中心</div><div style='color:#999;'><div>说明:</div><div>1、采购退货申请单提交后,箭冠营销中心系统将能查看到此单并进行后续处理。</div><div>2、采购退货申请单中的产品,不会占用库存。</div></div></div>,
-          centered: true,
-          onOk () {
-            _this.spinning = true
-            purchaseReturnSave({}).then(res => {
-              if (res.status == 200) {
-                const data = res.data
-                _this.spinning = false
-                // 重置查询条件
-                _this.resetData()
-                _this.$router.push({ name: 'purchaseReturnApplyFormEdit', params: { sn: data.purchaseReturnApplySn } })
-              } else {
-                _this.spinning = false
-              }
-            })
+        _this.openTipsModal = true
+      }
+    },
+    closeCreatModal(){
+      this.openTipsModal = false
+      this.goodFlag = undefined
+    },
+    creatReturnOrder(){
+      const _this = this
+      if(_this.goodFlag){
+        _this.spinning = true
+        purchaseReturnSave({goodFlag: _this.goodFlag}).then(res => {
+          if (res.status == 200) {
+            const data = res.data
+            _this.spinning = false
+            _this.openTipsModal = false
+            // 重置查询条件
+            _this.resetData()
+            _this.$router.push({ name: 'purchaseReturnApplyFormEdit', params: { sn: data.purchaseReturnApplySn } })
+          } else {
+            _this.spinning = false
           }
         })
+      }else{
+        this.$message.success("请选择退货类别")
       }
     },
     // 再次编辑