Explorar o código

销售退货客服确认

lilei %!s(int64=2) %!d(string=hai) anos
pai
achega
56f58b6b52

+ 9 - 0
src/api/salesReturn.js

@@ -142,6 +142,15 @@ export const salesReturnFinancialDetailList = (params) => {
     method: 'post'
   })
 }
+
+//销售退货 客服确认
+export const customerServiceConfirm = (params) => {
+  return axios({
+    url: `/salesReturn/customerServiceConfirm/${params.salesReturnBillSn}`,
+    method: 'get'
+  })
+}
+
 // 退货确认 退货确认
 export const salesReturnFinancial = (params) => {
   return axios({

+ 34 - 0
src/api/salesReturnDetail.js

@@ -55,4 +55,38 @@ export const salesReturnDetailUpdateReason = (params) => {
     data: params,
     method: 'post'
   })
+}
+// 修改销售退货明细实收数量
+export const salesReturnDetailUpdateReceiveQty = (params) => {
+  return axios({
+    url: '/salesReturn/detail/updateReceiveQty',
+    data: params,
+    method: 'post'
+  })
+}
+// 修改销售退货明细返库数量
+export const salesReturnDetailUpdateBackStockQty = (params) => {
+  return axios({
+    url: '/salesReturn/detail/updateBackStockQty',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 客服确认单行保存
+export const updateByCustomerService = (params) => {
+  return axios({
+    url: '/salesReturn/detail/updateByCustomerService',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 客服设置退货单价
+export const setReturnPrice = (params) => {
+  return axios({
+    url: '/salesReturn/detail/setReturnPrice',
+    data: params,
+    method: 'post'
+  })
 }

+ 114 - 45
src/views/salesReturnManagement/custConfirm/list.vue

@@ -31,6 +31,7 @@
           class="sTable"
           ref="table"
           :style="{ height: tableHeight+84.5+'px' }"
+          :rowClassName="(record, index) => record.addFlag == '1' ? (record.addType == 'WAREHOUSE_RECEIVE'?'redBg-row':'orgBg-row'):''"
           size="small"
           :rowKey="(record) => record.id"
           :row-selection="{ columnWidth: 40 }"
@@ -40,37 +41,99 @@
           :scroll="{ y: tableHeight }"
           :defaultLoadData="false"
           bordered>
+          <!-- 退货数量 -->
+          <template slot="qty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.addFlag == '0'"
+              size="small"
+              v-model="record.qty"
+              :precision="0"
+              :min="0"
+              :max="record.qty"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>--</span>
+          </template>
           <!-- 仓库实收数量 -->
+          <template slot="receiveQty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.addFlag == '0'"
+              size="small"
+              v-model="record.receiveQty"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>--</span>
+          </template>
+          <!-- 坏件数量 -->
+          <template slot="badQty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.addFlag == '0'"
+              size="small"
+              v-model="record.badQty"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>--</span>
+          </template>
+          <!-- 良品数量 -->
+          <template slot="goodQty" slot-scope="text, record">
+            <a-input-number
+              v-if="record.addFlag == '0'"
+              size="small"
+              v-model="record.goodQty"
+              :precision="0"
+              :min="0"
+              :max="999999"
+              placeholder="请输入"
+              style="width: 100%;" />
+            <span v-else>--</span>
+          </template>
+          <!-- 返库数量 -->
           <template slot="backStockQty" slot-scope="text, record">
             <a-input-number
-              id="salesReturn-backStockQty"
+              v-if="record.addFlag == '0'"
               size="small"
               v-model="record.backStockQty"
               :precision="0"
               :min="0"
-              :max="record.qty"
+              :max="999999"
               placeholder="请输入"
-              @blur="e => onCellBlur(e.target.value, record)"
               style="width: 100%;" />
+            <span v-else>--</span>
           </template>
           <!-- 退货原因 -->
-          <template slot="returnYy" slot-scope="text, record">
-            <v-select
+          <template slot="returnReason" slot-scope="text, record">
+            <a-select
+              v-if="record.addFlag == '0'"
               style="width:100%;"
-              v-model="queryParam.billStatus"
-              ref="billStatus"
-              code="SALES_RETURN_BILL_STATUS"
-              placeholder="请选择业退货原因"
-              allowClear></v-select>
+              v-model="record.returnReason"
+              placeholder="请选择退货原因"
+              allowClear>
+              <a-select-option v-for="item in returnReasonList" :value="item.code">
+                {{ item.dispName }}
+              </a-select-option>
+            </a-select>
+            <span v-else>--</span>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleEdit(record)"
+            >保存</a-button>
             <a-button
               size="small"
               type="link"
               class="button-warning"
               @click="handleDel(record)"
-              id="salesReturn-eexamine-btn">删除</a-button>
+            >删除</a-button>
           </template>
         </s-table>
       </a-card>
@@ -92,10 +155,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { salesReturnDetail, salesReturnCheck } from '@/api/salesReturn'
-import {
-  salesReturnDetailList,
-  updateBackStockQty
-} from '@/api/salesReturnDetail'
+import { salesReturnDetailList, updateByCustomerService, setReturnPrice } from '@/api/salesReturnDetail'
 export default {
   name: 'SalesReturnCheck',
   mixins: [commonMixin],
@@ -144,26 +204,27 @@ export default {
       queryParam: {
         productCode: '',
         productName: ''
-      }
+      },
+      returnReasonList: [] // 申请退货列表
     }
   },
   computed: {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '23%', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '13%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '10%', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '仓库实收数量', dataIndex: 'qty', align: 'center', width: '10%', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '坏件数量', dataIndex: 'qty', align: 'center', width: '10%', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '良品数量', dataIndex: 'qty', align: 'center', width: '10%', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '返库数量', dataIndex: 'qty', align: 'center', width: '10%', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '实际退货单价', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实际退货金额', dataIndex: 'badQty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货单价说明', dataIndex: 'backStockQty', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货原因', dataIndex: 'backStockQty', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '10%', scopedSlots: { customRender: 'qty' } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '10%', scopedSlots: { customRender: 'receiveQty' } },
+        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '10%', scopedSlots: { customRender: 'badQty' } },
+        { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '10%', scopedSlots: { customRender: 'goodQty' } },
+        { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '10%', scopedSlots: { customRender: 'backStockQty' } },
+        { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实际退货金额', dataIndex: 'totalAmount', 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: 'returnReason', width: '15%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ]
       return arr
     }
@@ -185,7 +246,7 @@ export default {
     handleDel (row) {
 
     },
-    // 批量返库
+    // 批量设置退货单价
     handlePlss () {
       const _this = this
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
@@ -194,7 +255,7 @@ export default {
       }
       this.$confirm({
         title: '提示',
-        content: '确认要批量实收吗?',
+        content: '确认要批量设置退货单价吗?',
         centered: true,
         onOk () {
           const obj = []
@@ -204,27 +265,28 @@ export default {
               backStockQty: item.qty
             })
           })
-          _this.submitCheck(obj)
+          _this.setPrice(obj)
         }
       })
     },
-    // 已选产品  blur
-    onCellBlur (val, record) {
-      //  光标移出,值发生改变再调用编辑接口
-      if (val && val != record.backStockQtyBackups) {
-        this.submitCheck([{
-          salesReturnDetailSn: record.salesReturnDetailSn,
-          backStockQty: record.backStockQty
-        }])
-      } else {
-        record.backStockQty = record.backStockQtyBackups
-      }
+    // 保存编辑
+    handleEdit (record) {
+      this.loading = true
+      this.spinning = true
+      updateByCustomerService(record).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm(true)
+          this.$message.success(res.message)
+        }
+        this.loading = false
+        this.spinning = false
+      })
     },
-    // 品检
-    submitCheck (data) {
+    // 设置退货单价
+    setPrice (data) {
       this.loading = true
       this.spinning = true
-      updateBackStockQty(data).then(res => {
+      setReturnPrice(data).then(res => {
         if (res.status == 200) {
           this.resetSearchForm(true)
           this.$message.success(res.message)
@@ -268,6 +330,7 @@ export default {
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
       this.getOrderDetail()
+      this.returnReasonList = this.$store.state.app.returnReason
     },
     setTableH () {
       this.tableHeight = window.innerHeight - 340
@@ -320,5 +383,11 @@ export default {
         }
       }
     }
+    .redBg-row{
+      background-color: #f5beb4;
+    }
+    .orgBg-row{
+      background-color: #fffca2;
+    }
   }
 </style>