Browse Source

采购退货

lilei 2 years ago
parent
commit
139334456e

+ 1 - 1
public/version.json

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

+ 1 - 1
src/api/purchaseReturnApply.js

@@ -53,7 +53,7 @@ export const purchaseReturnDetailDel = (params) => {
 //  采购退货 详情 全部删除
 export const purchaseReturnDetailDelAll = (params) => {
   return axios({
-    url: `/purchaseReturn/detail/deleteAll`,
+    url: `/purchaseReturnApply/detail/deleteAll`,
     data: params,
     method: 'post'
   })

+ 10 - 0
src/components/index.less

@@ -394,6 +394,11 @@
       color: #d62a00;
     }
   }
+  td > div:empty{
+    &::after{
+      content:'--'
+    }
+  }
 }
 .sTable.fixPagination{
   >.ant-table-wrapper{
@@ -410,6 +415,11 @@
         }
       }
     }
+    td > div:empty{
+      &::after{
+        content:'--'
+      }
+    }
   }
 }
 .ant-collapse{

+ 20 - 1
src/store/modules/app.js

@@ -1,4 +1,5 @@
 import Vue from 'vue'
+import { getLookUpData, listLookUp } from '@/api/data'
 import {
   SIDEBAR_TYPE,
   DEFAULT_THEME,
@@ -46,6 +47,7 @@ const app = {
     printSettingType: '', // 设置打印机类型,0 针式,1 喷墨
     printDefNeedle: undefined,// 默认针式打印机
     printDefInk: undefined, // 默认喷墨打印机
+    returnReason: [], // 申请退货列表
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {
@@ -148,6 +150,9 @@ const app = {
     SET_printSettingType: (state, val) => {
       state.printSettingType = val
     },
+    SET_returnReason:(state, val) => {
+      state.returnReason = val
+    },
   },
   actions: {
     setSidebar ({
@@ -240,7 +245,21 @@ const app = {
     },
     SetWinHeight ({ commit }, val) {
       commit('SET_WIN_HEIGHT', val)
-    }
+    },
+    getLookUpData({ commit }, code, isEnable) {
+      getLookUpData({
+        pageNo: 1,
+        pageSize: 1000,
+        lookupCode: code,
+        isEnable: isEnable ? 1 : undefined
+      }).then(res => {
+        if (res.status == 200) {
+          commit('SET_returnReason', res.data.list)
+        }else{
+          commit('SET_returnReason', [])
+        }
+      })
+    },
   }
 }
 

+ 3 - 1
src/views/Home.vue

@@ -347,7 +347,7 @@
 <script>
 import { mixin, commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
-import { mapGetters } from 'vuex'
+import { mapGetters, mapActions } from 'vuex'
 import ResetPwd from '@/views/user/ResetPwd.vue'
 import newProduct from '@/views/productManagement/newProduct/modal.vue'
 import { queryNewProductPage } from '@/api/product'
@@ -787,7 +787,9 @@ export default {
     }
   },
   methods: {
+    ...mapActions(['getLookUpData']),
     hasNewProduct () {
+      this.getLookUpData('RETURN_APPLY_BILL_STATUS')
       queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {
         if (res.status == 200) {
           if (res.data.count > 0) {

+ 175 - 0
src/views/purchasingManagement/purchaseReturnApplyForm/creatPurchaseReutn.vue

@@ -0,0 +1,175 @@
+<template>
+  <a-modal
+    centered
+    class="creatPurchaseReutn-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="生成采购退货单"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="creatPurchaseReutn-con">
+        <div class="row-flex" v-if="detail">
+          <div>供应商:{{ detail.returnTargetName }}</div>
+          <div><div class="col">总公司实收数量:{{ detail.totalReceiveQty||'--' }} </div><div class="col">退货金额:{{ detail.totalAmount||'--' }}</div></div>
+          <div>
+            <div>采购退货单:</div>
+            <div style="width:80%;padding-top:5px;">
+              <a-row>
+                <a-col :span="6">
+                  <a-checkbox :value="1" @change="onChange" :checked="syncStep.indexOf(1)>=0">
+                    同步提交
+                  </a-checkbox>
+                </a-col>
+                <a-col :span="6">
+                  <a-checkbox :value="2" @change="onChange" :checked="syncStep.indexOf(2)>=0">
+                    同步审核
+                  </a-checkbox>
+                </a-col>
+                <a-col :span="6">
+                  <a-checkbox :value="3" @change="onChange" :checked="syncStep.indexOf(3)>=0">
+                    同步出库
+                  </a-checkbox>
+                </a-col>
+                <a-col :span="6">
+                  <a-checkbox :value="4" @change="onChange" :checked="syncStep.indexOf(4)>=0">
+                    同步收款
+                  </a-checkbox>
+                </a-col>
+              </a-row>
+            </div>
+          </div>
+        </div>
+        <!-- 按钮 -->
+        <div class="btn-con">
+          <a-button
+            type="primary"
+            id="creatPurchaseReutn-save"
+            size="large"
+            :loading="spinning"
+            class="button-primary"
+            @click="handleSave"
+            style="padding: 0 36px;">确定</a-button>
+          <a-button
+            id="creatPurchaseReutn-cancel"
+            size="large"
+            class="button-cancel"
+            @click="isShow=false"
+            style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { createPurchaseReturnBill } from '@/api/purchaseReturnApply'
+export default {
+  name: 'CreatPurchaseReutnModal',
+  components: { STable },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false, //  查询、重置按钮是否可操作
+      spinning: false,
+      detail: null,
+      syncStep: []
+    }
+  },
+  methods: {
+    onChange (e) {
+      const len = e.target.value
+      if (!e.target.checked && len == 1) {
+        this.syncStep = []
+      } else {
+        // 选中
+        if (len > 0 || e.target.checked) {
+          this.syncStep = []
+          for (let i = 1; i <= len; i++) {
+            this.syncStep.push(i)
+          }
+        } else {
+          this.syncStep = []
+        }
+      }
+    },
+    setData (data) {
+      this.detail = data
+    },
+    // 保存
+    handleSave () {
+      const params = {
+        purchaseReturnApplySn: this.detail.purchaseReturnApplySn,
+        syncStep: this.syncStep.length ? this.syncStep[this.syncStep.length - 1] : 0
+      }
+      this.spinning = true
+      createPurchaseReturnBill(params).then(res => {
+        if (res.status == 200 && res.data) {
+          this.$emit('creatOk')
+          this.$emit('close')
+          this.$message.success(res.message)
+          this.spinning = false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.detail = null
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .creatPurchaseReutn-modal{
+    .creatPurchaseReutn-con{
+      padding: 0 20px;
+      .row-flex{
+        > div{
+          display:flex;
+          align-items:center;
+          padding: 10px 0;
+          width:100%;
+          &:last-child{
+            flex-grow:1;
+          }
+          .col{
+            width:50%;
+          }
+        }
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 93 - 74
src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue

@@ -22,12 +22,12 @@
                 <a-row :gutter="15">
                   <a-col :md="6" :sm="24">
                     <a-form-item label="产品编码" prop="productCode">
-                      <a-input id="purchaseReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      <a-input id="purchaseReturnEdit-productCode" v-model.trim="queryParam.code" placeholder="请输入产品编码" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
                     <a-form-item label="产品名称" prop="productName">
-                      <a-input id="purchaseReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                      <a-input id="purchaseReturnEdit-productName" v-model.trim="queryParam.name" placeholder="请输入产品名称" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
@@ -73,14 +73,16 @@
               </template>
               <!-- 退货原因 -->
               <template slot="returnReason" slot-scope="text, record">
-                <v-select
+                <a-select
+                  style="width:100%;"
+                  size="small"
                   v-model="record.returnReason"
-                  ref="billStatus"
-                  code="RETURN_APPLY_BILL_STATUS"
                   placeholder="请选择退货原因"
-                  allowClear
-                  style="width: 100%;"
-                ></v-select>
+                  allowClear>
+                  <a-select-option v-for="item in returnReasonList" :value="item.code">
+                    {{ item.dispName }}
+                  </a-select-option>
+                </a-select>
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
@@ -104,6 +106,12 @@
             <template slot="header">
               已选产品
             </template>
+            <!-- 总计 -->
+            <a-alert type="info" style="margin-bottom:10px">
+              <div slot="message">
+                申请退货数量:<strong>{{ (detailData&&(detailData.totalQty || detailData.totalQty==0)) ? detailData.totalQty : '--' }}</strong> ;
+              </div>
+            </a-alert>
             <!-- 筛选条件 -->
             <div class="table-page-search-wrapper" style="display:flex;width:100%;">
               <div style="width:80%;">
@@ -153,7 +161,7 @@
               bordered>
               <!-- 产品分类 -->
               <template slot="productType" slot-scope="text, record">
-                <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+                <span v-if="record.product.productTypeName2 || record.product.productTypeName3">{{ record.product.productTypeName2 }} {{ record.product.productTypeName3 ? '>' : '' }} {{ record.product.productTypeName3 }}</span>
                 <span v-else>--</span>
               </template>
               <!-- 退货数量 -->
@@ -170,15 +178,17 @@
               </template>
               <!-- 退货原因 -->
               <template slot="returnReason" slot-scope="text, record">
-                <v-select
+                <a-select
+                  style="width:100%;"
+                  size="small"
                   v-model="record.returnReason"
-                  ref="billStatus"
-                  code="RETURN_APPLY_BILL_STATUS"
                   placeholder="请选择退货原因"
-                  allowClear
-                  style="width: 100%;"
                   @change="e => remarksBlur(e, record)"
-                ></v-select>
+                  allowClear>
+                  <a-select-option v-for="item in returnReasonList" :value="item.code">
+                    {{ item.dispName }}
+                  </a-select-option>
+                </a-select>
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
@@ -211,12 +221,13 @@ import ProductType from '../../common/productType.js'
 import { productList } from '@/api/product'
 import {
   purchaseReturnDetailList,
+  purchaseReturnDetail,
   purchaseReturnDetailSave,
   purchaseReturnDetailDel,
-  purchaseReturnSubmit,
   purchaseReturnDetailDelAll,
   purchaseReturnModifyQty,
   modifyReturnReason,
+  purchaseReturnSubmit,
   purchaseReturnDetailPrint,
   purchaseReturnDetailExport } from '@/api/purchaseReturnApply'
 export default {
@@ -227,19 +238,21 @@ export default {
     return {
       spinning: false,
       queryParam: {
-        productCode: '',
-        productName: '',
+        code: '',
+        name: '',
         productTypeSn1: undefined,
         productTypeSn2: undefined,
         productTypeSn3: undefined
       },
       productType: [],
       dataSource: [],
+      returnReasonList: [], // 退货原因列表
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        this.queryParam.sysFlag = '1' // 剪冠产品
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -257,7 +270,7 @@ export default {
       },
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
-        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnApplySn: this.$route.params.sn })).then(res => {
+        return purchaseReturnDetailList(Object.assign(parameter, { purchaseReturnApplySn: this.$route.params.sn }, this.chooseParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
@@ -268,7 +281,8 @@ export default {
           this.dataSource = data.list
           return data
         })
-      }
+      },
+      detailData: null
     }
   },
   computed: {
@@ -276,11 +290,11 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '15%', align: 'center' },
+        { title: '产品名称', dataIndex: 'name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '20%', align: 'center' },
         { title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', scopedSlots: { customRender: 'returnQty' }, width: '15%', align: 'center' },
-        { title: '退货原因', scopedSlots: { customRender: 'returnReason' }, width: '15%', align: 'center' },
+        { title: '申请退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' },
+        { title: '退货原因', scopedSlots: { customRender: 'returnReason' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       return arr
@@ -288,18 +302,22 @@ export default {
     chooseColumns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '15%', align: 'center' },
-        { title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', scopedSlots: { customRender: 'qty' }, width: '15%', align: 'center' },
-        { title: '退货原因', scopedSlots: { customRender: 'returnReason' }, width: '15%', align: 'center' },
+        { title: '产品编码', dataIndex: 'product.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '20%', align: 'center' },
+        { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
+        { title: '退货原因', scopedSlots: { customRender: 'returnReason' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       return arr
     }
   },
   methods: {
+    //  返回列表
+    handleBack () {
+      this.$router.push({ name: 'purchaseReturnApplyFormList' })
+    },
     // 打印预览/快捷打印
     handlePrint (type, printerType) {
       const _this = this
@@ -321,20 +339,16 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  重置
+    //  重置产品列表
     resetSearchForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.productName = ''
+      this.queryParam.code = ''
+      this.queryParam.name = ''
       this.queryParam.productTypeSn1 = undefined
       this.queryParam.productTypeSn2 = undefined
       this.queryParam.productTypeSn3 = undefined
+      this.productType = []
       this.$refs.table.refresh(true)
     },
-    resetChooseForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.productName = ''
-      this.$refs.chooseTable.refresh(true)
-    },
     //  添加/编辑
     handleAdd (row) {
       // 添加时退货数量字段名为returnQty,编辑时退货数量字段名为qty
@@ -357,6 +371,7 @@ export default {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.chooseTable.refresh()
+          this.getDetail()
           this.spinning = false
         } else {
           this.spinning = false
@@ -376,6 +391,12 @@ export default {
     },
     // 导入明细
     handleImport () {},
+    // 重置已选产品列表
+    resetChooseForm () {
+      this.chooseParam.productCode = ''
+      this.chooseParam.productName = ''
+      this.$refs.chooseTable.refresh(true)
+    },
     //  删除
     handleDel (row, isAll) {
       const _this = this
@@ -385,31 +406,20 @@ export default {
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
-            _this.spinning = true
-            purchaseReturnDetailDelAll({ purchaseReturnApplySn: _this.$route.params.sn }).then(res => {
-              if (res.status == 200) {
-                _this.$message.success(res.message)
-                _this.$refs.table.refresh()
-                _this.$refs.chooseTable.refresh()
-                _this.spinning = false
-              } else {
-                _this.spinning = false
-              }
-            })
-          } else { //  单个删除
-            _this.spinning = true
-            purchaseReturnDetailDel({ purchaseReturnApplySn: _this.$route.params.sn }).then(res => {
-              if (res.status == 200) {
-                _this.$message.success(res.message)
-                _this.$refs.table.refresh()
-                _this.$refs.chooseTable.refresh()
-                _this.spinning = false
-              } else {
-                _this.spinning = false
-              }
-            })
-          }
+          const fun = isAll ? purchaseReturnDetailDelAll : purchaseReturnDetailDel
+          const params = isAll ? { purchaseReturnApplySn: _this.$route.params.sn } : { purchaseReturnApplySn: _this.$route.params.sn, purchaseReturnApplyDetailSn: row.purchaseReturnApplyDetailSn }
+          _this.spinning = true
+          fun(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.$refs.chooseTable.refresh()
+              _this.spinning = false
+              _this.getDetail()
+            } else {
+              _this.spinning = false
+            }
+          })
         }
       })
     },
@@ -429,11 +439,7 @@ export default {
         }
       })
     },
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/purchasingManagement/purchaseReturn/list' })
-    },
-    // 已选产品 退货数量  blur
+    // 已选产品 退货数量修改
     qtyBlur (val, record) {
       //  光标移出,值发生改变再调用编辑接口
       if (val != record.qtyBackups) {
@@ -446,6 +452,8 @@ export default {
           if (res.status == 200) {
             this.$message.success(res.message)
             this.$refs.chooseTable.refresh()
+            record.qtyBackups = record.qty
+            this.getDetail()
           } else {
             record.qty = record.qtyBackups
           }
@@ -453,37 +461,48 @@ export default {
         })
       }
     },
-    // 已选产品 退货原因  blur
+    // 已选产品 退货原因修改
     remarksBlur (val, record) {
       if (val && (val != record.returnReasonBackups)) {
         this.spinning = true
         modifyReturnReason({
-          returnReason: val,
+          returnReason: record.returnReason,
           purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
           purchaseReturnApplySn: this.$route.params.sn
         }).then(res => {
           if (res.status == 200) {
             this.$message.success(res.message)
             this.$refs.chooseTable.refresh()
+            record.returnReasonBackups = record.returnReason
           } else {
             record.returnReason = record.returnReasonBackups
           }
           this.spinning = false
         })
       }
+    },
+    // 获取单据详情
+    getDetail () {
+      purchaseReturnDetail({ sn: this.$route.params.sn }).then(res => {
+        this.detailData = res.data ? res.data : null
+      })
+    },
+    pageInit () {
+      this.returnReasonList = this.$store.state.app.returnReason
+      this.$refs.chooseTable.refresh(true)
+      this.resetSearchForm()
+      this.getDetail()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.$refs.chooseTable.refresh(true)
-      this.resetSearchForm()
+      this.pageInit()
     }
   },
   activated () {
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
-      this.$refs.chooseTable.refresh(true)
-      this.resetSearchForm()
+      this.pageInit()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 45 - 52
src/views/purchasingManagement/purchaseReturnApplyForm/list.vue

@@ -74,57 +74,48 @@
         bordered>
         <!-- 采退单号 -->
         <template slot="purchaseReturnApplyNo" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_purchaseReturnDetail')" @click="handleDetail(record)">{{ record.purchaseReturnNo }}</span>
-          <span v-else>{{ record.purchaseReturnNo }}</span>
+          <span class="table-td-link" v-if="$hasPermissions('B_purchaseReturnDetail')" @click="handleDetail(record)">{{ record.purchaseReturnApplyNo }}</span>
+          <span v-else>{{ record.purchaseReturnApplyNo }}</span>
           <a-badge count="改" :offset="[10,0]" v-if="record.state=='HQ_CHANGE'"></a-badge>
         </template>
-        <!-- 审核 -->
-        <template slot="audit" slot-scope="text, record">
-          <stateIcon :title="record.billStatusDictValue" v-if="record.billStatus!='AUDIT_REJECT'" :state="record.billStatus == 'WAIT_BACK'||record.billStatus=='CHECKED'||record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
-          <stateIcon :title="record.billStatusDictValue" v-else :state="0"></stateIcon>
-        </template>
-        <!-- 出库 -->
-        <template slot="waitOut" slot-scope="text, record">
-          <stateIcon :state="record.hasStockBill == '1'?'1':'2'"></stateIcon>
-        </template>
-        <!-- 收款 -->
-        <template slot="financial" slot-scope="text, record">
-          <stateIcon :title="record.settleStateDictValue" :state="record.settleState == 'FINISH'&&record.billStatus!='CANCEL'?'1':'2'"></stateIcon>
-        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            class="button-primary"
-            v-if="(record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')"
-            @click="handleEdit(record)"
-            id="purchaseReturnList-edit-btn">编辑</a-button>
-          <a-button
-            size="small"
-            type="link"
-            v-else-if="(record.hasStockBill == '0' && (record.billStatus == 'CHECKED'||record.billStatus == 'FINISH'))"
-            @click="handleWarehouse(record)"
-            class="button-primary"
-            id="bulkReturnGoodsList-warehouse-btn">生成采购退货单</a-button>
-          <a-button
-            size="small"
-            type="link"
-            v-else-if="record.billStatus == 'CHECKED'"
-            @click="handleFinishBill(record)"
-            class="button-primary"
-            id="bulkReturnGoodsList-warehouse-btn">再次编辑</a-button>
-          <a-button
-            size="small"
-            type="link"
-            class="button-error"
-            v-else-if="(record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')"
-            @click="handleDel(record)"
-            id="purchaseReturnList-del-btn">删除</a-button>
-          <span v-else>--</span>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              v-if="record.billStatus == 'WAIT_SUBMIT'"
+              @click="handleEdit(record)"
+            >编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              v-if="record.billStatus == 'WAIT_SUBMIT'"
+              @click="handleDel(record)"
+            >删除</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.billStatus == 'FINISH'"
+              @click="handleWarehouse(record)"
+              class="button-primary"
+            >生成采购退货单</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.billStatus == 'CANCEL'||record.billStatus == 'AUDIT_REJECT'"
+              @click="handleFinishBill(record)"
+              class="button-primary"
+            >再次编辑</a-button>
+          </div>
         </template>
       </s-table>
     </a-spin>
+
+    <!-- 生成采购退货单 -->
+    <creatPurchaseReutn ref="creatPurchaseReutn" :openModal="openCpModal" @close="openCpModal=false" @creatOk="$refs.table.refresh()"></creatPurchaseReutn>
   </a-card>
 </template>
 
@@ -133,16 +124,17 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import getDate from '@/libs/getDate.js'
-import stateIcon from '@/views/common/stateIcon'
+import creatPurchaseReutn from './creatPurchaseReutn.vue'
 import { purchaseReturnList, purchaseReturnSave, purchaseReturnDel, purchaseReturnAgainCreate } from '@/api/purchaseReturnApply'
 export default {
   name: 'PurchaseReturnList',
-  components: { STable, VSelect, rangeDate, stateIcon },
+  components: { STable, VSelect, rangeDate, creatPurchaseReutn },
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
+      openCpModal: false,
       time: [
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
@@ -151,7 +143,7 @@ export default {
       queryParam: { //  查询条件
         beginDate: getDate.getCurrMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
-        purchaseReturnApplyNo: '', //  退货单号
+        purchaseReturnApplyNo: '', //  退货申请单号
         billStatus: undefined, //  业务状态
         billSource: undefined, // 单据来源
         beginAuditDate: '', // 审核时间
@@ -184,10 +176,10 @@ export default {
   computed: {
     columns () {
       const arr = [
-        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
-        { title: '单据来源', dataIndex: 'billSourceDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购退货申请单号', scopedSlots: { customRender: 'purchaseReturnApplyNo' }, width: '16%', align: 'center' },
-        { title: '供应商', dataIndex: 'returnTargetName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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: 'totalQty', 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 || '--' } },
@@ -305,7 +297,8 @@ export default {
     },
     // 生成采购单
     handleWarehouse (row) {
-
+      this.openCpModal = true
+      this.$refs.creatPurchaseReutn.setData(row)
     },
     pageInit () {
       const _this = this