lilei 2 лет назад
Родитель
Сommit
f0ce2c712d

+ 1 - 1
src/views/financialManagement/returnConfirmation/detailModal.vue

@@ -99,7 +99,7 @@ export default {
         { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '12%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限

+ 1 - 1
src/views/salesReturnManagement/custConfirm/setPriceModal.vue

@@ -136,7 +136,7 @@ export default {
         { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '退货单价说明', dataIndex: 'priceRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {

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

@@ -56,18 +56,11 @@
           </template>
           <!-- 退货原因 -->
           <template slot="returnReason" slot-scope="text, record">
-            <a-select
-              style="width:100%;"
+            <returnReason
               v-model="record.returnReason"
               v-if="record.addFlag == '1'&&record.addType == 'WAREHOUSE_RECEIVE'"
-              @change="e => onCellBlurReturnReason(e, record)"
-              placeholder="请选择退货原因"
-            >
-              <a-select-option v-for="item in returnReasonList" :value="item.code">
-                {{ item.dispName }}
-              </a-select-option>
-            </a-select>
-            <span v-else>{{ record.returnReasonDictValue }}</span>
+              @blur="e => onCellBlurReturnReason(e, record)"></returnReason>
+            <span v-else>{{ record.returnReason }}</span>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
@@ -109,6 +102,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import chooseProductsModal from './chooseProductsModal.vue'
+import returnReason from '@/views/common/returnReason'
 import { salesReturnDetail, salesReturnReceive } from '@/api/salesReturn'
 import {
   salesReturnDetailList, salesReturnDetailReceiveBatch, salesReturnDetailUpdateReceiveQty, salesReturnDetailUpdateReason, insertByReceive, deleteByReceiver
@@ -119,7 +113,8 @@ export default {
   components: {
     STable,
     VSelect,
-    chooseProductsModal
+    chooseProductsModal,
+    returnReason
   },
   data () {
     return {
@@ -161,8 +156,7 @@ export default {
       queryParam: {
         productCode: '',
         productName: ''
-      },
-      returnReasonList: [] // 申请退货列表
+      }
     }
   },
   computed: {
@@ -282,6 +276,11 @@ export default {
     },
     // 修改退货原因
     onCellBlurReturnReason (e, record) {
+      // 空或没有改变时不保存数据
+      if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
+        record.returnReason = record.returnReasonBackups
+        return
+      }
       this.loading = true
       this.spinning = true
       salesReturnDetailUpdateReason({
@@ -346,7 +345,6 @@ export default {
         _this.setTableH()
       })
       this.orderSn = this.$route.params.sn
-      this.returnReasonList = this.$store.state.app.returnReason
       this.getOrderDetail()
     },
     setTableH () {

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

@@ -193,7 +193,7 @@ export default {
         { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货原因', dataIndex: 'returnReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '参考退货单价', dataIndex: 'initialPrice', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '参考退货金额', dataIndex: 'initialAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },