瀏覽代碼

销售退货一览表

chenrui 1 年之前
父節點
當前提交
6ee808880f

+ 25 - 0
src/config/router.config.js

@@ -812,6 +812,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/salesReturnManagement/returnSchedule',
+            redirect: '/salesReturnManagement/returnSchedule/list',
+            name: 'returnSchedule',
+            component: BlankLayout,
+            meta: {
+              title: '退货一览表',
+              icon: 'vertical-align-top'
+              // permission: 'M_returnScheduleList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'returnScheduleList',
+                component: () => import(/* webpackChunkName: "salesReturnManagement" */ '@/views/salesReturnManagement/returnSchedule/list.vue'),
+                meta: {
+                  title: '销售退货确认列表',
+                  icon: 'vertical-align-top',
+                  hidden: true
+                  // permission: 'M_returnScheduleList'
+                }
+              }
+            ]
           }
         ]
       },

+ 7 - 1
src/views/salesManagement/pushOrderManagement/exportExcelModal.vue

@@ -25,6 +25,12 @@
             <a-radio value="DISPATCH_BILL">不导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <a-form-model-item label="原厂编码" prop="priceType" v-if="$hasPermissions('B_dispatchExport_salesPrice')">
+          <a-radio-group v-model="form.priceType">
+            <a-radio value="DISPATCH_BILL_PRICE">导出</a-radio>
+            <a-radio value="DISPATCH_BILL">不导出</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button type="primary" id="export-excel-save" @click="handleSave()">导出</a-button>
@@ -71,7 +77,7 @@ export default {
       _this.$store.state.app.curActionPermission = 'B_dispatchExport'
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          if(!this.$hasPermissions('B_dispatchExport_salesPrice')){
+          if (!this.$hasPermissions('B_dispatchExport_salesPrice')) {
             _this.form.priceType = 'DISPATCH_BILL'
           }
           _this.$emit('ok', _this.form.priceType, {}, '下推产品')

+ 49 - 8
src/views/salesReturnManagement/custConfirm/list.vue

@@ -26,7 +26,8 @@
           <a-button type="primary" :loading="loading" class="button-error" @click="handlePlss">批量设置退货单价</a-button>
           <a-button style="margin-left:5px;" :loading="loading" @click="openPlSetReason">批量设置退货原因</a-button>
           <span style="margin-left:10px;" v-if="selNums">已选{{ selNums }}项</span>
-          <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品</div>
+          <a-button type="primary" :loading="loading" class="button-info" @click="setNewSalesRetrunOrder">生成新销退单</a-button>
+          <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品;黄色表示客服确认时新增的产品;退货原因文字显示红色表示有修改</div>
         </div>
         <!-- 已选配件列表 -->
         <s-table
@@ -188,12 +189,20 @@
       @addProduct="addProduct"></chooseProductsModal>
     <!-- 批量设置退货原因 -->
     <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
-      <div style="text-align: center;">
-        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
-        <div style="line-height: 24px;">
-          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
-        </div>
-      </div>
+      <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>
     </commonModal>
   </div>
 </template>
@@ -231,6 +240,7 @@ export default {
         productName: '',
         productCode: ''
       },
+      reasonForm: { plReturnReason: undefined, remarksInfo: '' },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -256,7 +266,15 @@ export default {
       chooseData: [],
       openProductModal: false,
       plReturnReason: '',
-      showPlModal: false
+      showPlModal: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 14 },
+      rules: {
+        plReturnReason: [
+          { required: true, message: '请选择退货原因', trigger: 'change' }
+        ],
+        remarksInfo: [{ required: true, message: '请输入备注信息', trigger: 'blur' }]
+      }
     }
   },
   watch: {
@@ -285,6 +303,7 @@ export default {
         // { 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: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '备注', dataIndex: 'priceRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }
       ]
       if (this.$hasPermissions('B_salesReturnConfirm_salesPrice')) { //  售价权限
@@ -295,6 +314,28 @@ export default {
     }
   },
   methods: {
+    // 生成新销退单
+    setNewSalesRetrunOrder () {
+      const _this = this
+      this.$confirm({
+        title: '生成新销退单',
+        content: '选择的产品将生成新的销退单',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.loading = true
+          _this.spinning = true
+          deleteByCustomerService({ salesReturnDetailSn: row.salesReturnDetailSn }).then(res => {
+            if (res.status == 200) {
+              _this.resetSearchForm(false)
+            }
+            _this.$message.info(res.message)
+            _this.loading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null

+ 29 - 7
src/views/salesReturnManagement/receiveCheck/checking.vue

@@ -72,6 +72,10 @@
           <template slot="returnReason" slot-scope="text, record">
             <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
           </template>
+          <!-- 备注 -->
+          <template slot="remarksInfo" slot-scope="text, record">
+            <a-input size="small" v-model.trim="record.remarksInfo" allowClear placeholder="请输入备注信息(最多50字符)"/>
+          </template>
         </s-table>
         <div class="footer-btn">
           <a-button
@@ -89,12 +93,20 @@
     <chooseTypeModal :openModal="openTypeModal" :type="actionType" @close="openTypeModal=false" @confirm="plconfirm"></chooseTypeModal>
     <!-- 批量设置退货原因 -->
     <commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
-      <div style="text-align: center;">
-        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
-        <div style="line-height: 24px;">
-          <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
-        </div>
-      </div>
+      <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>
     </commonModal>
   </div>
 </template>
@@ -133,11 +145,20 @@ export default {
       productForm: {
         salesReturnBillSn: ''
       },
+      reasonForm: { plReturnReason: undefined, remarksInfo: '' },
       queryParam: {
         productCode: '',
         productName: ''
       },
       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
@@ -189,7 +210,8 @@ export default {
         { 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: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } }
+        { title: '退货原因', dataIndex: 'returnReason', width: '20%', align: 'center', scopedSlots: { customRender: 'returnReason' } },
+        { title: '备注', dataIndex: ' remarksInfo', width: '20%', align: 'center', scopedSlots: { customRender: 'remarksInfo' } }
       ]
       return arr
     }

+ 330 - 0
src/views/salesReturnManagement/returnSchedule/list.vue

@@ -0,0 +1,330 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="returnSchedule-wrap">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="提交时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeExamineDate" @change="dateExamineChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="所属区域/分区">
+                <subarea id="returnSchedule-subareaSn" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="returnSchedule-buyerSn" @change="custChange" />
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="总部销退单号">
+                  <a-input id="returnSchedule-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="returnSchedule-billStatus"
+                    code="SALES_RETURN_BILL_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="省份" prop="shippingAddrProvinceSn">
+                  <Area id="salesReturn-provinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="24" :sm="24" style="margin-top:16px;text-align:center">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="returnSchedule-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnSchedule-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+              >导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84.5+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ x:1300,y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 销退单号 -->
+          <template slot="salesReturnBillNo" slot-scope="text, record">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.salesReturnBillNo }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.billStatus=='WAIT_FINANCIAL_AUDIT' && $hasPermissions('B_returnConfirmation_return')"
+              class="button-warning"
+              @click="handleAudit(record)"
+              id="returnSchedule-audit-btn">退货确认</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { STable, VSelect } from '@/components'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import chooseWarehouse from '@/views/common/chooseWarehouse'
+import subarea from '@/views/common/subarea.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import Area from '@/views/common/area.js'
+import { salesReturnFinancialList, salesReturnFinancial } from '@/api/salesReturn'
+export default {
+  name: 'ReturnSchedule',
+  mixins: [commonMixin],
+  components: { STable, VSelect, subarea, dealerSubareaScopeList, rangeDate, chooseWarehouse, Area },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
+        salesReturnBillNo: '', //  单号
+        buyerSn: undefined,
+        salesReturnBillSource: undefined,
+        billStatus: undefined, //  状态
+        warehouseSn: undefined, //  仓库
+        subareaSn: undefined,
+        subareaAreaSn: undefined
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return salesReturnFinancialList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false,
+      itemSn: ''
+    }
+  },
+  // 根据权限显示列表字段
+  computed: {
+    columns () {
+      const arr = [
+        { title: '超时环节提醒', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '130px', align: 'center', fixed: 'left' },
+        { title: '提交时间', dataIndex: 'createDate', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '省份', dataIndex: 'buyerName', align: 'center', width: '100px', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '客户名称', dataIndex: 'buyerName', align: 'center', width: '200px', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
+        { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '130px', align: 'center', fixed: 'left' },
+        { title: '所在区域', dataIndex: 'warehouseName', align: 'center', width: '130px', customRender: function (text) { return text || '--' } },
+        { title: '所在分区', dataIndex: 'warehouseName1', align: 'center', width: '130px', customRender: function (text) { return text || '--' } },
+        { title: '退货类型', dataIndex: 'billStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+
+        { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '申请退货金额', dataIndex: 'totalAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '退货申请审核时间', dataIndex: 'confirmTime2', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提货审核时间', dataIndex: 'confirmTime1', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货时间', dataIndex: 'confirmTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品检时间', dataIndex: 'confirmTime3', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客服确认时间', dataIndex: 'confirmTime4', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '坏件数量', dataIndex: 'totalReceiveQty1', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'totalReceiveQty2', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'totalReceiveQty3', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实际退货金额', dataIndex: 'totalAmount1', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? this.toThousands(text) : '--') } },
+        { title: '业务状态', dataIndex: 'confirmTime6', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货附件', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    subareaChange (val) {
+      this.queryParam.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.subareaSn = undefined
+      this.queryParam.subareaAreaSn = undefined
+      this.$refs.subarea.clearData()
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.buyerSn = undefined
+      this.queryParam.salesReturnBillSource = undefined
+      this.queryParam.billStatus = undefined
+      this.queryParam.warehouseSn = undefined
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.$refs.table.refresh(true)
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillSn } })
+    },
+    closeModal () {
+      this.itemSn = ''
+      this.openModal = false
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(exportForWarehouse, _this.queryParam, '仓库销售单明细', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.showExport = true
+      })
+    },
+    // 单个审核
+    handleAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '请点击下方按钮确认操作',
+        centered: true,
+        closable: true,
+        okText: '通过',
+        cancelText: '不通过',
+        onOk () {
+          _this.auditOrder(row.salesReturnBillSn, 'FINISH')
+        },
+        onCancel (e) {
+          if (!e.triggerCancel) {
+            _this.auditOrder(row.salesReturnBillSn, 'FINANCIAL_REJECT')
+          }
+          _this.$destroyAll()
+        }
+      })
+    },
+    auditOrder (sn, flag) {
+      const _this = this
+      _this.spinning = true
+      salesReturnFinancial({ salesReturnBillSn: sn, billStatus: flag }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 240
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .returnSchedule-wrap{
+    margin-bottom:10px;
+    .active{
+      color: #ed1c24;
+      cursor: pointer;
+    }
+    .common{
+      color: rgba(0, 0, 0);
+    }
+  }
+</style>