lilei 2 jaren geleden
bovenliggende
commit
85a829221d

+ 5 - 5
src/api/salesReturnDetail.js

@@ -63,18 +63,18 @@ export const salesReturnDetailUpdateReceiveQty = (params) => {
     method: 'post'
   })
 }
-// 修改销售退货明细良品数量
-export const salesReturnDetailUpdateBatchGoodQty = (params) => {
+// 批量修改销售退货明细良品数量
+export const updateBatchGoodQty = (params) => {
   return axios({
     url: '/salesReturn/detail/updateBatchGoodQty',
     data: params,
     method: 'post'
   })
 }
-// 修改销售退货明细返库数量
-export const salesReturnDetailUpdateBackStockQty = (params) => {
+// 批量修改销售退货明细返库数量
+export const updateBatchBackStockQty = (params) => {
   return axios({
-    url: '/salesReturn/detail/updateBackStockQty',
+    url: '/salesReturn/detail/updateBatchBackStockQty',
     data: params,
     method: 'post'
   })

+ 7 - 7
src/views/financialManagement/returnConfirmation/list.vue

@@ -142,19 +142,19 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '16%', align: 'center' },
-        { title: '退货客户', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '15%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerName', align: 'center', width: '15%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '是否抓单', dataIndex: 'grabFlagDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '确认时间', dataIndex: 'confirmTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '确认时间', dataIndex: 'confirmTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(6, 0, { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { title: '退货金额', dataIndex: 'totalAmount', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }

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

@@ -22,8 +22,8 @@
           </a-form-item>
         </a-form>
         <div style="border-top:1px solid #eee;padding-top:10px;">
-          <a-button type="primary" :loading="loading" class="button-info" @click="plSetQty">批量设置良品数量</a-button>
-          <a-button type="primary" :loading="loading" class="button-error" @click="plSetQty">批量设置返库数量</a-button>
+          <a-button type="primary" :loading="loading" class="button-info" @click="plSetQty(1)">批量设置良品数量</a-button>
+          <a-button type="primary" :loading="loading" class="button-error" @click="plSetQty(2)">批量设置返库数量</a-button>
           <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品</div>
         </div>
         <!-- 已选配件列表 -->
@@ -51,7 +51,7 @@
               :min="0"
               :max="record.receiveQty"
               placeholder="请输入"
-              @blur="e => updateBatchGoodQty(e.target.value, record)"
+              @blur="e => updateGoodQty(e.target.value, record)"
               style="width: 100%;" />
           </template>
           <!-- 返库数量 -->
@@ -80,6 +80,9 @@
         @click="handleSubmit()"
         id="salesReturn-handleSubmit">提交</a-button>
     </div>
+
+    <!-- 选中批量操作 -->
+    <chooseTypeModal :openModal="openTypeModal" :type="actionType" @close="openTypeModal=false" @confirm="plconfirm"></chooseTypeModal>
   </div>
 </template>
 
@@ -87,21 +90,23 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { salesReturnDetail, salesReturnCheck } from '@/api/salesReturn'
-import { salesReturnDetailList, salesReturnDetailUpdateBackStockQty, salesReturnDetailUpdateBatchGoodQty } from '@/api/salesReturnDetail'
+import { salesReturnDetailList, updateBatchBackStockQty, updateBatchGoodQty } from '@/api/salesReturnDetail'
+import chooseTypeModal from './chooseTypeModal.vue'
 export default {
   name: 'SalesReturnCheck',
   mixins: [commonMixin],
   components: {
     STable,
-    VSelect
+    VSelect,
+    chooseTypeModal
   },
   data () {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
-      orderId: null,
       orderSn: null,
-      buyerSn: null,
+      openTypeModal: false,
+      actionType: '',
       disabled: false,
       isInster: false, // 是否正在添加产品
       ordeDetail: { discountAmount: 0 },
@@ -111,13 +116,17 @@ export default {
       productForm: {
         salesReturnBillSn: ''
       },
+      queryParam: {
+        productCode: '',
+        productName: ''
+      },
       chooseLoadData: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         // 查询总计
         this.productForm.salesReturnBillSn = this.$route.params.sn
-        return salesReturnDetailList(Object.assign(parameter, this.productForm)).then(res => {
+        return salesReturnDetailList(Object.assign(parameter, this.productForm, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -135,26 +144,22 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null,
-      queryParam: {
-        productCode: '',
-        productName: ''
-      }
+      rowSelectionInfo: null
     }
   },
   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 || '--' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '20%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '28%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '10%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库实收数量', dataIndex: 'receiveQty', 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: 'goodQty', width: '10%', align: 'center', scopedSlots: { customRender: 'goodQty' } },
         { title: '返库数量', dataIndex: 'backStockQty', width: '10%', align: 'center', scopedSlots: { customRender: 'backStockQty' } },
-        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '25%', align: 'left', customRender: function (text) { return text || '--' } }
+        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       return arr
     }
@@ -169,38 +174,53 @@ export default {
       this.$router.push({ name: 'receiveCheckList' })
     },
     // 批量设置
-    plSetQty () {
+    plSetQty (type) {
       const _this = this
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
         _this.$message.warning('请先选择产品!')
         return
       }
-      this.$confirm({
-        title: '提示',
-        content: '确认要批量返库吗?',
-        centered: true,
-        onOk () {
-          const obj = []
-          _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-            obj.push({
-              salesReturnDetailSn: item.salesReturnDetailSn,
-              backStockQty: item.qty
-            })
+      this.actionType = type
+      this.openTypeModal = true
+    },
+    // 批量修改数量
+    plconfirm (val) {
+      const _this = this
+      const obj = []
+      _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
+        if (this.actionType == 1) {
+          obj.push({
+            salesReturnDetailSn: item.salesReturnDetailSn,
+            goodQty: val == 1 ? item.receiveQty : 0
+          })
+        } else {
+          obj.push({
+            salesReturnDetailSn: item.salesReturnDetailSn,
+            backStockQty: val == 1 ? item.goodQty : 0
           })
-          console.log(obj)
-          _this.submitCheck(obj)
         }
       })
+      console.log(obj)
+      const fun = this.actionType == 1 ? updateBatchGoodQty : updateBatchBackStockQty
+      this.spinning = true
+      fun(obj).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm(true)
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+        this.openTypeModal = false
+      })
     },
     // 修改良品数量
-    updateBatchGoodQty (val, record) {
+    updateGoodQty (val, record) {
       //  光标移出,值发生改变再调用编辑接口
       if (val && val != record.goodQtyBackups) {
         this.spinning = true
-        salesReturnDetailUpdateBatchGoodQty({
+        updateBatchGoodQty([{
           salesReturnDetailSn: record.salesReturnDetailSn,
           goodQty: record.goodQty
-        }).then(res => {
+        }]).then(res => {
           if (res.status == 200) {
             this.resetSearchForm(true)
             this.$message.success(res.message)
@@ -219,10 +239,10 @@ export default {
       //  光标移出,值发生改变再调用编辑接口
       if (val && val != record.backStockQtyBackups) {
         this.spinning = true
-        salesReturnDetailUpdateBackStockQty({
+        updateBatchBackStockQty([{
           salesReturnDetailSn: record.salesReturnDetailSn,
           backStockQty: record.backStockQty
-        }).then(res => {
+        }]).then(res => {
           if (res.status == 200) {
             this.resetSearchForm(true)
             this.$message.success(res.message)
@@ -245,19 +265,33 @@ export default {
     },
     //  重置
     resetSearchForm (flag) {
+      this.rowSelectionInfo = null
+      this.$refs.table.clearTable()
+      this.queryParam = {
+        productCode: '',
+        productName: ''
+      }
       this.$refs.table.refresh(!!flag)
-      this.getOrderDetail()
     },
-    // 提交销售单
+    // 提交品检
     handleSubmit () {
-      this.spinning = true
-      salesReturnCheck({ salesReturnBillSn: this.orderSn }).then(res => {
-        if (res.status == 200) {
-          this.handleBack()
-          this.$message.success(res.message)
-          this.spinning = false
-        } else {
-          this.spinning = false
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '提交后将无法修改,确认提交吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          salesReturnCheck({ salesReturnBillSn: _this.orderSn }).then(res => {
+            if (res.status == 200) {
+              _this.handleBack()
+              _this.$message.success(res.message)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
         }
       })
     },
@@ -267,7 +301,6 @@ export default {
         _this.setTableH()
       })
       this.orderSn = this.$route.params.sn
-      this.buyerSn = this.$route.params.buyerSn
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
       this.getOrderDetail()

+ 97 - 0
src/views/salesReturnManagement/receiveCheck/chooseTypeModal.vue

@@ -0,0 +1,97 @@
+<template>
+  <a-modal
+    centered
+    class="chooseProducts-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="type==1?'批量设置良品数量':'批量设置返库数量'"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="450px">
+    <div class="products-con">
+      <div v-if="type == 1">
+        <div>良品数量:</div>
+        <a-radio-group v-model="value"><a-radio :style="radioStyle" :value="1">等于仓库实收数量</a-radio><a-radio :style="radioStyle" :value="0">等于0</a-radio></a-radio-group>
+      </div>
+      <div v-if="type == 2">
+        <div>返库数量:</div>
+        <a-radio-group v-model="value"><a-radio :style="radioStyle" :value="1">等于良品数量</a-radio><a-radio :style="radioStyle" :value="0">等于0</a-radio></a-radio-group>
+      </div>
+    </div>
+    <div class="btn-con">
+      <a-button size="large" @click="isShow=false" style="padding: 0 40px;margin:0 15px;" type="default">取消</a-button>
+      <a-button
+        size="large"
+        style="padding: 0 40px;margin:0 15px;"
+        type="primary"
+        class="button-primary"
+        @click="handleSubmit()"
+      >确定</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  name: 'ChooseTypeModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: [Number, String],
+      default: '1'
+    }
+  },
+  data () {
+    return {
+      value: 1,
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      radioStyle: {
+        display: 'block',
+        height: '40px',
+        lineHeight: '40px'
+      }
+    }
+  },
+  methods: {
+    handleSubmit () {
+      this.$emit('confirm', this.value)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.value = 1
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseProducts-modal{
+    .products-con{
+      padding-top:20px;
+      > div{
+        padding: 0 30px;
+        display: flex;
+        > div:first-child{
+          padding-top: 10px;
+        }
+      }
+    }
+    .btn-con{
+      text-align: center;
+      margin: 30px 0 20px;
+    }
+  }
+</style>

+ 59 - 12
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -57,9 +57,40 @@
       <a-card size="small" :bordered="false" class="pages-wrap">
         <a-tabs>
           <a-tab-pane key="1" tab="产品明细" force-render>
+            <a-alert style="margin-bottom: 10px;" type="info">
+              <div slot="message" class="total-bar">
+                <div>
+                  <span>申请退货数量:{{ ordeDetail&&(ordeDetail.totalQty || ordeDetail.totalQty==0) ? ordeDetail.totalQty : '--' }};</span>
+                  <span>仓库实收数量:3;</span>
+                  <span>坏件数量:3;</span>
+                  <span>良品数量:0;</span>
+                  <span>返库数量:0;</span>
+                  <span v-if="$hasPermissions('B_isShowPrice')">
+                    参考退货金额:{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? ordeDetail.totalAmount : '--' }}元;
+                    实际退货金额:{{ ordeDetail&&(ordeDetail.totalAmount || ordeDetail.totalAmount==0) ? ordeDetail.totalAmount : '--' }}元;
+                  </span>
+                </div>
+              </div>
+            </a-alert>
+            <div style="display:flex;align-items:center;justify-content: space-between;margin-bottom: 10px;">
+              <div>说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+              <div>
+                <a-select
+                  style="width:250px;"
+                  v-model="queryStr"
+                  @change="changeQueryStr(record)"
+                  placeholder="请选择"
+                  allowClear>
+                  <a-select-option v-for="item in queryStrList" :value="item.code">
+                    {{ item.text }}
+                  </a-select-option>
+                </a-select>
+              </div>
+            </div>
             <!-- 列表 -->
             <s-table
               class="sTable"
+              :rowClassName="(record, index) => record.addFlag == '1' ? (record.addType == 'WAREHOUSE_RECEIVE'?'redBg-row':'orgBg-row'):''"
               ref="table"
               size="small"
               :rowKey="record => record.id"
@@ -126,6 +157,12 @@ export default {
       detailData: null, //  详情数据
       visibleAudit: false,
       spinningAudit: false,
+      queryStrList: [
+        { code: 0, text: '不显示退货单价/金额' },
+        { code: 1, text: '显示——按照申请退货数量计算' },
+        { code: 2, text: '显示——按照仓库实收数量计算' }
+      ],
+      queryStr: undefined,
       // 操作记录
       operateColumns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -157,19 +194,19 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '7%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '7%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '坏件数量', dataIndex: 'badQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '良品数量', dataIndex: 'goodQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '返库数量', dataIndex: 'backStockQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品编码', dataIndex: 'productEntity.code', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '19%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请退货数量', dataIndex: 'qty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '仓库实收数量', dataIndex: 'receiveQty', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { 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: 'initialPrice', align: 'center', width: '7%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '参考退货金额', dataIndex: 'initialAmount', align: 'center', width: '7%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实际退货单价', dataIndex: 'price', align: 'center', width: '7%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '7%', customRender: function (text) { return ((text || text == 0) ? 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 : '--') } },
+        { title: '实际退货金额', dataIndex: 'totalAmount', align: 'center', width: '6%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '实际退货单价说明', dataIndex: 'priceRemark', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       return arr
@@ -179,6 +216,10 @@ export default {
     //  返回
     handleBack () {
       this.$router.push({ name: 'salesReturnList', query: { closeLastOldTab: true } })
+    },
+    // 明细筛选
+    changeQueryStr (v) {
+
     },
     //  详情
     getDetail () {
@@ -234,5 +275,11 @@ export default {
     margin-top: 5px;
     text-align: center;
   }
+  .redBg-row{
+    background-color: #f5beb4;
+  }
+  .orgBg-row{
+    background-color: #fffca2;
+  }
 }
 </style>