浏览代码

Merge branch 'develop_yh22' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh22

chenrui 1 年之前
父节点
当前提交
9dccb2b657

二进制
public/templ/收货产品导入模板.xlsx


二进制
public/templ/收货产品(不良品)模板 - 副本.xlsx


二进制
public/templ/收货产品(良品)模板 - 副本.xlsx


二进制
public/templ/销售退货(不良品)产品明细模板.xlsx


+ 48 - 38
src/views/salesReturnManagement/receiveCheck/checking.vue

@@ -70,11 +70,11 @@
           </template>
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
-            <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
+            <returnReason v-model="record.returnReasonCode" @change="e => updateReason(e, record, 0)"></returnReason>
           </template>
           <!-- 备注 -->
           <template slot="remarksInfo" slot-scope="text, record">
-            <a-input size="small" v-model.trim="record.remarksInfo" allowClear placeholder="请输入备注信息(最多50字符)"/>
+            <a-input size="small" v-model.trim="record.returnReasonRemarks" @blur="e => updateReason(e, record, 1)" :maxlength="50" allowClear placeholder="请输入备注信息(最多50字符)"/>
           </template>
         </s-table>
         <div class="footer-btn">
@@ -93,20 +93,16 @@
     <chooseTypeModal :openModal="openTypeModal" :type="actionType" @close="openTypeModal=false" @confirm="plconfirm"></chooseTypeModal>
     <!-- 批量设置退货原因 -->
     <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
-      <a-form-model
-        ref="ruleForm"
-        :model="reasonForm"
-        :rules="rules"
-        :label-col="labelCol"
-        :wrapper-col="wrapperCol"
-      >
-        <a-form-model-item label="请选择退货原因" prop="plReturnReason">
-          <returnReason size="middle" v-model="reasonForm.plReturnReason"></returnReason>
-        </a-form-model-item>
-        <a-form-model-item label="备注" prop="remarksInfo">
-          <a-input v-model="reasonForm.remarksInfo" :maxLength="50" placeholder="请输入备注信息(最多50字符)" />
-        </a-form-model-item>
-      </a-form-model>
+       <div style="text-align: left;">
+         <div style="line-height: 24px;">
+           <div><span style="color:red;">*</span>退货原因</div>
+           <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
+         </div>
+         <div style="line-height: 24px;margin-top:10px;">
+           <div>备注</div>
+           <div><a-input size="large" :maxlength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
+         </div>
+       </div>
     </commonModal>
   </div>
 </template>
@@ -145,7 +141,6 @@ export default {
       productForm: {
         salesReturnBillSn: ''
       },
-      reasonForm: { plReturnReason: undefined, remarksInfo: '' },
       queryParam: {
         productCode: '',
         productName: ''
@@ -153,12 +148,6 @@ export default {
       chooseLoadData: [],
       labelCol: { span: 8 },
       wrapperCol: { span: 14 },
-      rules: {
-        plReturnReason: [
-          { required: true, message: '请选择退货原因', trigger: 'change' }
-        ],
-        remarksInfo: [{ required: true, message: '请输入备注信息', trigger: 'blur' }]
-      },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -184,18 +173,24 @@ export default {
         })
       },
       rowSelectionInfo: null,
-      plReturnReason: '',
-      showPlModal: false
+      plReturnReason: undefined,
+      plReturnRemark: '',
+      showPlModal: false,
+      returnReasonlist: []
     }
   },
   watch: {
     showPlModal (newValue, oldValue) {
       if (!newValue) {
-        this.plReturnReason = ''
+        this.plReturnReason = undefined
+        this.plReturnRemark = ''
       }
     }
   },
   computed: {
+    goodFlag() {
+      return this.ordeDetail && this.ordeDetail.goodFlag || ''
+    },
     selNums () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
@@ -298,18 +293,22 @@ 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(item.salesReturnDetailSn)
         })
         salesReturnDetailSetReason({
           salesReturnBillDetailSnList: snList,
-          returnReason: this.plReturnReason
+          salesReturnBillSn : this.orderSn,
+          returnReason: rows ? rows.dispName : '',
+          returnReasonCode: this.plReturnReason,
+          returnReasonRemarks: this.plReturnRemark
         }).then(res => {
           if (res.status == 200) {
             this.showPlModal = false
@@ -321,17 +320,25 @@ export default {
       }
     },
     // 修改退货原因
-    updateReason (row) {
-      // 空或没有改变时不保存数据
-      if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
-        row.returnReason = row.returnReasonBackups
-        return
+    updateReason (val, record, type) {
+      const params = {
+        salesReturnDetailSn: record.salesReturnDetailSn,
+        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.target.value
+        if(!params.returnReasonRemarks){
+          return
+        }
       }
       this.spinning = true
-      salesReturnDetailUpdateReason({
-        salesReturnDetailSn: row.salesReturnDetailSn,
-        returnReason: row.returnReason
-      }).then(res => {
+      salesReturnDetailUpdateReason(params).then(res => {
         if (res.status == 200) {
           this.$refs.table.refresh()
           this.$message.success(res.message)
@@ -398,6 +405,9 @@ export default {
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        if(res.data){
+          this.returnReasonlist = [...this.$store.state.app.goodReturnReason,...this.$store.state.app.defectiveReturnReason]
+        }
       })
     },
     //  重置

+ 7 - 6
src/views/salesReturnManagement/receiveCheck/chooseImportModal.vue

@@ -95,23 +95,24 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'initialQtyText', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库实收数量', dataIndex: 'receiveQtyText', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'initialQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库实收数量', dataIndex: 'receiveQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '25%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'initialQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库实收数量', dataIndex: 'receiveQtyText', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'returnReasonRemarks', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '20%', align: 'center' }
       ],
       unLoadData: [],

+ 9 - 3
src/views/salesReturnManagement/receiveCheck/importGuideModal.vue

@@ -15,7 +15,7 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“申请退货数量”、“仓库实收数量”、“退货原因”的列,“产品编码”必填,其它列可自定义,不影响数据导入</li>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“申请退货数量”、“仓库实收数量”、“退货原因”、“备注”的列,“产品编码”必填,其它列可自定义,不影响数据导入</li>
             <li>
               <a :href="filePath" style="margin: 5px 0 0;display: block;">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
@@ -79,6 +79,10 @@ export default {
     params: {
       type: Object,
       default: null
+    },
+    goodFlag: {
+      type: [String, Number],
+      default: ''
     }
   },
   data () {
@@ -91,7 +95,7 @@ export default {
         savePathType: 'local',
         salesReturnBillSn: this.params.salesReturnBillSn
       },
-      filePath: location.protocol + '//' +location.host + '/templ/收货产品导入模板.xlsx'
+      filePath: ''
     }
   },
   methods: {
@@ -128,7 +132,7 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -140,6 +144,8 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.resetSearchForm()
+      } else {
+        this.filePath = location.protocol + '//' + location.host + (this.goodFlag == 1 ? '/templ/收货产品(良品)模板.xlsx' : '/templ/收货产品(不良品)模板.xlsx')
       }
     }
   }

+ 8 - 5
src/views/salesReturnManagement/receiveCheck/list.vue

@@ -23,9 +23,10 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="退货类别">
                 <v-select
-                  v-model="queryParam.billStatus"
-                  ref="billStatus"
-                  code="SALES_RETURN_BILL_STATUS"
+                  v-model="queryParam.goodFlag"
+                  ref="goodFlag"
+                  id="receiveCheck-goodFlag"
+                  code="GOOD_FLAG"
                   placeholder="请选择退货类别"
                   allowClear></v-select>
               </a-form-item>
@@ -152,7 +153,8 @@ export default {
         buyerSn: undefined, //  客户名称
         salesReturnBillNo: undefined, //  总部销退单号
         billStatus: undefined, // 业务状态
-        warehouseSn: undefined
+        warehouseSn: undefined,
+        goodFlag: undefined
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -187,7 +189,7 @@ export default {
         { title: '审核时间', dataIndex: 'auditTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '8%', align: 'center' },
         { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货类别', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货类别', dataIndex: 'goodFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -232,6 +234,7 @@ export default {
       this.queryParam.salesReturnBillNo = ''
       this.queryParam.billStatus = undefined
       this.queryParam.warehouseSn = undefined
+      this.queryParam.goodFlag = undefined
       this.$refs.table.refresh(true)
     },
     pageInit () {

+ 32 - 14
src/views/salesReturnManagement/receiveCheck/receiving.vue

@@ -78,15 +78,16 @@
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
             <returnReason
-              v-model="record.returnReason"
+              v-model="record.returnReasonCode"
+              :goodFlag="goodFlag"
               v-if="record.addFlag == '1'&&record.addType == 'WAREHOUSE_RECEIVE'"
-              @blur="e => onCellBlurReturnReason(e, record)"></returnReason>
+              @change="e => onCellBlurReturnReason(e, record, 0)"></returnReason>
             <span v-else>{{ record.returnReason }}</span>
           </template>
           <!-- 备注 -->
           <template slot="remarks" slot-scope="text, record">
             <div @dblclick.stop>
-              <a-input :maxLength="50" size="small" v-model="record.remarks" placeholder="请输入备注(最多50字符)"/>
+              <a-input :maxLength="50" size="small" v-model="record.returnReasonRemarks" @blur="e => onCellBlurReturnReason(e, record, 1)" placeholder="请输入备注(最多50字符)"/>
             </div>
           </template>
           <!-- 操作 -->
@@ -117,13 +118,14 @@
     <!-- 添加产品 -->
     <chooseProductsModal
       ref="chooseProduct"
+      :goodFlag="goodFlag"
       :isShowPrice="false"
       :openModal="openModal"
       :buyerSn="$route.params.buyerSn"
       @close="openModal=false"
       @addProduct="addProduct"></chooseProductsModal>
     <!-- 导入产品 -->
-    <importGuideModal :params="{salesReturnBillSn: $route.params.sn}" :openModal="openGuideModal" @close="openGuideModal=false" @ok="importOk" />
+    <importGuideModal :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0" :params="{salesReturnBillSn: $route.params.sn}" :openModal="openGuideModal" @close="openGuideModal=false" @ok="importOk" />
   </div>
 </template>
 
@@ -189,10 +191,14 @@ export default {
       queryParam: {
         productCode: '',
         productName: ''
-      }
+      },
+      returnReasonlist: []
     }
   },
   computed: {
+    goodFlag () {
+      return this.ordeDetail && this.ordeDetail.goodFlag || ''
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -343,18 +349,27 @@ export default {
       }
     },
     // 修改退货原因
-    onCellBlurReturnReason (e, record) {
-      // 空或没有改变时不保存数据
-      if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
-        record.returnReason = record.returnReasonBackups
-        return
+    onCellBlurReturnReason (val, record, type) {
+      const params = {
+        salesReturnDetailSn: record.salesReturnDetailSn,
+        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.target.value
+        if (!params.returnReasonRemarks) {
+          return
+        }
+      }
+
       this.loading = true
       this.spinning = true
-      salesReturnDetailUpdateReason({
-        salesReturnDetailSn: record.salesReturnDetailSn,
-        returnReason: record.returnReason
-      }).then(res => {
+      salesReturnDetailUpdateReason(params).then(res => {
         if (res.status == 200) {
           this.resetSearchForm(false)
           this.$message.success(res.message)
@@ -369,6 +384,9 @@ export default {
     getOrderDetail () {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
+        if (res.data) {
+          this.returnReasonlist = [...this.$store.state.app.goodReturnReason, ...this.$store.state.app.defectiveReturnReason]
+        }
       })
     },
     // 审核销售单

+ 1 - 0
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -50,6 +50,7 @@
               <a-descriptions-item label="是否同步给客户">{{ detailData&&detailData.syncFlag ? ['否', '是'][detailData.syncFlag] : '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="退货类别">{{ detailData&&detailData.goodFlagDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="退货类型">{{ detailData&&detailData.salesReturnTypeDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
               <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditTime || '--' }}</a-descriptions-item>
               <a-descriptions-item label="附件" v-if="detailData" :span="3">