Browse Source

退货一览表

chenrui 1 năm trước cách đây
mục cha
commit
af1f274c5b

+ 12 - 0
src/api/salesReturn.js

@@ -279,3 +279,15 @@ export const queryLastFinishDingUser = (params) => {
     method: 'post'
   })
 }
+
+// 销售退货一览表   列表
+export const queryOverviewPage = (params) => {
+  const url = `/salesReturn/queryOverviewPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 103 - 175
src/views/salesManagement/salesList/list.vue

@@ -1,50 +1,50 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="pushOrder-wrap">
+    <a-card size="small" :bordered="false" class="salesList-wrap">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="提交时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" :value="time" @change="submitDateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="销售单号">
-                <a-input id="pushOrder-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                <a-input id="salesList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24" v-if="pageType!='viewDealers'">
+            <a-col :md="6" :sm="24">
               <a-form-item label="所属区域/分区">
-                <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
+                <subarea id="salesList-subarea" ref="subarea" @change="subareaChange"></subarea>
               </a-form-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="pushOrder-buyerName" @change="custChange" />
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesList-buyerName" @change="custChange" />
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="是否收款">
+                <a-form-item label="财务状态">
                   <v-select
-                    v-model="queryParam.billStatus"
-                    ref="billStatus"
-                    id="pushOrder-billStatus"
-                    code="DISPATCH_BILL_STATUS"
-                    placeholder="请选择是否收款"
+                    v-model="queryParam.financialStatus"
+                    ref="financialStatus"
+                    id="salesList-financialStatus"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="审核时间">
-                  <rangeDate ref="rangeDate" :value="examineTime" @change="dateChange" />
+                  <rangeDate ref="processRangeDate" :value="examineTime" @change="processDateChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="收款时间">
-                  <rangeDate ref="rangeDate" :value="paymentTime" @change="dateChange" />
+                  <rangeDate ref="collectionRangeDate" :value="paymentTime" @change="collectionDateChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -52,8 +52,8 @@
                   <v-select
                     v-model="queryParam.billStatus"
                     ref="billStatus"
-                    id="pushOrder-billStatus"
-                    code="DISPATCH_BILL_STATUS"
+                    id="salesList-billStatus"
+                    code="SALES_OVERVIEW_BILL_STATUS"
                     placeholder="请选择业务状态"
                     allowClear></v-select>
                 </a-form-item>
@@ -70,8 +70,8 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="省份" prop="shippingAddrProvinceSn">
-                  <Area id="pushOrder-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                <a-form-model-item label="省份" prop="provinceSn">
+                  <Area id="salesList-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -79,14 +79,6 @@
               <div class="table-page-search-submitButtons" style="text-align:center;">
                 <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
                 <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
-                <a-button
-                  style="margin-left: 5px"
-                  type="primary"
-                  class="button-warning"
-                  @click="handleExport"
-                  :disabled="disabled"
-                  :loading="exportLoading"
-                  id="salsesList-export">导出</a-button>
                 <a @click="advanced=!advanced" style="margin-left: 8px">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -105,7 +97,8 @@
           ref="table"
           :style="{ height: tableHeight+84.5+'px' }"
           size="small"
-          :rowKey="(record) => record.id"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
           :columns="columns"
           :data="loadData"
           :scroll="{ y:tableHeight, x:1890 }"
@@ -113,15 +106,16 @@
           bordered>
           <!-- 超时环节提示 -->
           <template slot="tip" slot-scope="text, record">
-            <a-tooltip placement="top">
+            <a-tooltip placement="top" v-if="record.dispatchOverDay*1!=0&&record.sendOverDay*1!=0&&record.settleOverDay*1!=0">
               <template slot="title">
-                <span>已超时{{ record.sendOverDay }}天(要求销售单下推后2天内备货)</span>
+                <span>已超时{{ record.dispatchOverDay }}天(要求销售单下推后2天内备货)</span>
               </template>
               <div>
                 <a-icon type="exclamation-circle" :style="{color:'#ed1c24',fontSize:'20px',marginRight:'8px',display:'inlineBlock'}"/>
-                <span>{{ record.billStatusDictValue }}</span>
+                <span>{{ record.dispatchOverDay*1>0?'未备货':record.dispatchOverDay*1>0 &&record.sendOverDay*1>0?'未备货/未付款' :record.sendOverDay*1>0?'未付款':record.settleOverDay*1>0?'未结算':'--' }}</span>
               </div>
             </a-tooltip>
+            <span v-else>--</span>
           </template>
           <!-- 销售单号 -->
           <template slot="salesBillNo" slot-scope="text, record">
@@ -135,38 +129,8 @@
           <template slot="sendBillNo" slot-scope="text, record">
             <span class="link-bule" @click="handleDetail(record,2)">{{ record.dispatchBillNo }}</span>
           </template>
-          <!-- 操作 -->
-          <template slot="action" slot-scope="text, record">
-            <a-button
-              size="small"
-              type="link"
-              class="button-warning"
-              :loading="!!tipData"
-              v-if="(record.printStatus=='UNABLE_PRINT'||record.printStatus=='CANCEL_PRINT')&&record.voidFlag=='0'&&$hasPermissions('B_UNABLE_PRINT')"
-              @click="handlePrint(record,1)"
-            >允许打印</a-button>
-            <a-button
-              size="small"
-              type="link"
-              class="button-error"
-              :loading="!!tipData"
-              v-if="record.printStatus=='UNABLE_PRINT'&&record.voidFlag=='0'&&$hasPermissions('B_CANSEL_PRINT')"
-              @click="handlePrint(record,0)"
-            >取消打印</a-button>
-          </template>
         </s-table>
 
-        <!-- 操作提示 -->
-        <!-- <commonModal modalTit="操作提示" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
-        <div style="display:flex;flex-direction: column;align-items: center;">
-          <div style="margin-bottom: 15px;font-size: 14px;"><strong>{{ tipData&&tipData.printType==1?'确认允许此单进行备货打印吗?':'确认此单取消备货打印吗?' }}</strong></div>
-          <div style="line-height: 24px;">
-            <div>备货单号:{{ tipData&&tipData.dispatchBillNo }}</div>
-            <div>客户名称:{{ tipData&&tipData.buyerName }}</div>
-          </div>
-        </div>
-      </commonModal> -->
-
         <!-- 查看销售单或备货单详情 -->
         <commonModal
           :modalTit="detailType?'备货单详情':'销售单详情'"
@@ -174,13 +138,10 @@
           width="70%"
           :showFooter="false"
           :openModal="showDetailModal"
-          @cancel="cancelDetail">
+          @cancel="closeDetailModal">
           <salesDetail v-if="detailType==0" ref="salesDetail" :bizSn="bizSn"></salesDetail>
           <dispatchDetail v-if="detailType==1" ref="dispatchDetail" :bizSn="bizSn"></dispatchDetail>
-          <financialDetailModal v-if="detailType==3" ref="financialDetail" :bizSn="bizSn"></financialDetailModal>
         </commonModal>
-        <!-- 发货说明 -->
-        <explainInfoModal v-drag :rowData="tipData" :openModal="showInfoModal" @close="canselModal"></explainInfoModal>
         <!-- 发货单详情 -->
         <detailModal v-drag ref="detailModal" :openModal="showTipModal" @cancel="showTipModal=false" @ok="sendSuccess"></detailModal>
       </a-spin>
@@ -196,21 +157,16 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
-import { hdExportExcel } from '@/libs/exportExcel'
-import chooseWarehouse from '@/views/common/chooseWarehouse'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import salesDetail from '@/views/salesManagement/salesQuery/detail.vue'
 import dispatchDetail from '@/views/salesManagement/pushOrderManagement/detail.vue'
 import detailModal from '@/views/salesManagement/sendOutOrder/detailModal.vue'
-import financialDetailModal from '@/views/financialManagement/financialCollection/detail.vue'
-
-// import explainInfoModal from './explainInfoModal.vue'
 import { salesOverviewQueryPage } from '@/api/sales'
 export default {
-  name: 'PushOrderManagementList',
+  name: 'SalesListManagementList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, commonModal, Area, salesDetail, dispatchDetail, detailModal, financialDetailModal, chooseWarehouse },
+  components: { STable, VSelect, dealerSubareaScopeList, rangeDate, subarea, dispatchDetail, commonModal, Area, salesDetail, detailModal },
   data () {
     return {
       spinning: false,
@@ -218,8 +174,6 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       showDetailModal: false,
       showTipModal: false,
-      showInfoModal: false,
-      exportLoading: false,
       bizSn: null,
       tableHeight: 0,
       detailType: 0,
@@ -231,29 +185,22 @@ export default {
       paymentTime: [],
       // 查询参数
       queryParam: {
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        buyerSn: undefined, //  客户名称
-        receiverSn: undefined, // 收货客户
+        submitBeginDate: getDate.getCurrMonthDays().starttime,
+        submitEndDate: getDate.getCurrMonthDays().endtime,
         salesBillNo: '', //  销售单号
-        dispatchBillNo: '', //  备货单号
+        subareaSn: undefined,
+        subareaAreaSn: undefined,
+        buyerSn: undefined, //  收货客户
+        buyerName: undefined,
+        financialStatus: undefined, // 财务状态
+        auditBeginDate: undefined, // 审核时间
+        auditEndDate: undefined,
+        beginDate: undefined, // 收款开始时间
+        endDate: undefined,
         billStatus: undefined, //  业务状态
-        subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
-        },
-        voidFlag: undefined,
-        shippingAddrProvinceSn: undefined,
-        printStatus: undefined,
-        checkStatus: undefined,
-        warehouseSn: undefined
-      },
-      totalData: {
-        totalAmount: 0,
-        totalQty: 0,
-        totalRecord: 0
+        sendFlag: '', // 发货状态
+        provinceSn: undefined// 省份
       },
-      tipData: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -293,130 +240,111 @@ export default {
 
         { title: '审核时间', dataIndex: 'auditDate', width: '130px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '下推数量', dataIndex: 'dispatchTotalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '下推金额', dataIndex: 'dispatchSettledAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        { title: '备货允许打印时间', dataIndex: 'dispatchPushedDate', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下推金额', dataIndex: 'dispatchTotalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '备货允许打印时间', dataIndex: 'dispatchAllowPrintTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备货时间', dataIndex: 'dispatchAuditDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '发货创建时间', dataIndex: 'sendCreateDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
 
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatus', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '发货状态', dataIndex: 'sendFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收款金额', dataIndex: 'dispatchTotalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        { title: '收款时间', dataIndex: 'sendDate1', width: '130px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收款金额', dataIndex: 'dispatchSettledAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '收款时间', dataIndex: 'dispatchSettleTime', width: '130px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '发货编号', dataIndex: 'dispatchSendNo', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '托运日期', dataIndex: 'sendDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收货人', dataIndex: 'receiverName', width: '80px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货人', dataIndex: 'sendCustomerContactName', width: '80px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '物流电话', dataIndex: 'sendTransportTele', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '物流单号', dataIndex: 'sendTransportNo', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
 
         { title: '总件数', dataIndex: 'sendTotalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '运费合计', dataIndex: 'totalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
         { title: '收货状态', dataIndex: 'sendReceiveFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '收货时间', dataIndex: 'submitDate1', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货时间', dataIndex: 'sendReceiveDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '物流情况', dataIndex: 'sendTransportStateDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '备注', dataIndex: 'checkStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        { title: '备注', dataIndex: 'sendRemarks', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
       return arr
     }
   },
   methods: {
-    handleExport () {
-      const _this = this
-      this.$store.state.app.curActionPermission = 'B_transferOut_export'
-      const params = this.queryParam
-      this.exportLoading = true
-      this.spinning = true
-      hdExportExcel(allocateBillExport, params, '调拨列表', function () {
-        _this.exportLoading = false
-        _this.spinning = false
-        _this.$store.state.app.curActionPermission = ''
-      })
+    //  提交时间  change
+    submitDateChange (date) {
+      this.queryParam.submitBeginDate = date[0]
+      this.queryParam.submitEndDate = date[1]
+    },
+    // 审核时间 change
+    processDateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
     },
-    //  时间  change
-    dateChange (date) {
+    // 收款开始时间  change
+    collectionDateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
     custChange (val) {
-      this.queryParam.buyerSn = val.key
-    },
-    shcustChange (val) {
-      this.queryParam.receiverSn = val.key
+      if (val.row) {
+        this.queryParam.buyerSn = val.row.dealerSn
+        this.queryParam.buyerName = undefined
+      } else {
+        this.queryParam.buyerSn = undefined
+        this.queryParam.buyerName = val.key
+      }
     },
     // 详情
     handleDetail (row, type) {
       this.detailType = type
       if (type != 2) {
-        this.showDetailModal = true
-        if (type == 3) {
-          this.$refs.financialDetail.getDetail()
-        }
+        this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
+        this.$nextTick(() => {
+          this.showDetailModal = true
+        })
       } else {
         this.showTipModal = true
-        this.$refs.detailModal.getDetail(row, 1, '发货单详情')
+        const infoObj = {
+          sendBillSn: row.sendBillSn,
+          customeName: row.buyerName
+        }
+        this.$refs.detailModal.getDetail(infoObj, 1, '发货单详情')
       }
     },
     closeDetailModal () {
       this.showDetailModal = false
-      this.$store.state.app.curActionPermission = ''
+      this.bizSn = null
     },
     sendSuccess () {
       this.showTipModal = false
       this.$refs.table.refresh()
     },
-    // 查看发货说明
-    handleExplainInfo (row) {
-      this.tipData = row
-      this.showInfoModal = true
-    },
-    // 允许备货打印
-    handlePrint (row, type) {
-      this.tipData = row
-      this.tipData.printType = type
-      this.showTipModal = true
-    },
-    canselModal () {
-      this.tipData = null
-      this.showTipModal = false
-      this.showInfoModal = false
-    },
-    updatePrintStatus () {
-      dispatchPrintStatus({ dispatchBillSn: this.tipData.dispatchBillSn, printStatus: this.tipData && this.tipData.printType == 1 ? 'NO_PRINT' : 'CANCEL_PRINT' }).then(res => {
-        if (res.status == 200) {
-          this.canselModal()
-          this.$message.info(res.message)
-          this.$refs.table.refresh()
-        }
-      })
-    },
     subareaChange (val) {
-      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+      this.queryParam.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
     },
     // 重置
     resetSearchForm () {
-      // this.$refs.rangeDate.resetDate(this.time)
-      // this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      // this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      // this.queryParam.buyerSn = undefined
-      // this.queryParam.receiverSn = undefined
-      // this.$refs.dealerSubareaScopeList.resetForm()
-      // this.$refs.shbuyerName.resetForm()
-      // this.queryParam.salesBillNo = ''
-      // this.queryParam.dispatchBillNo = ''
-      // this.queryParam.billStatus = undefined
-      // this.queryParam.voidFlag = undefined
-      // this.queryParam.subareaArea.subareaSn = undefined
-      // this.queryParam.subareaArea.subareaAreaSn = undefined
-      // this.queryParam.shippingAddrProvinceSn = undefined
-      // this.queryParam.printStatus = undefined
-      // this.queryParam.checkStatus = undefined
-      // this.queryParam.warehouseSn = undefined
-      // this.queryParam.subareaArea.subareaSn = undefined
-      // this.queryParam.subareaArea.subareaAreaSn = undefined
-
-      // if (this.advanced) {
-      //   this.$refs.subarea.clearData()
-      // }
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.submitBeginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.submitEndDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.salesBillNo = ''
+      this.queryParam.subareaSn = undefined
+      this.queryParam.subareaAreaSn = undefined
+      this.queryParam.buyerName = ''
+      this.queryParam.buyerSn = undefined
+      this.queryParam.financialStatus = undefined
+      this.queryParam.auditBeginDate = undefined
+      this.queryParam.auditEndDate = undefined
+      this.queryParam.settleBeginDate = undefined
+      this.queryParam.settleEndDate = undefined
+      this.queryParam.billStatus = undefined
+      this.queryParam.sendFlag = ''
+      this.queryParam.provinceSn = undefined
+      this.examineTime = []
+      this.paymentTime = []
+      this.$refs.subarea.clearData()
+      if (this.advanced) {
+        this.$refs.dealerSubareaScopeList.resetForm()
+        this.$refs.processRangeDate.resetDate()
+        this.$refs.collectionRangeDate.resetDate()
+      }
       this.$refs.table.refresh(true)
     },
     pageInit () {
@@ -464,7 +392,7 @@ export default {
 }
 </script>
 <style lang="less">
-  .pushOrder-wrap{
+  .salesList-wrap{
     .sTable{
       margin-top: 10px;
     }

+ 93 - 107
src/views/salesReturnManagement/returnSchedule/list.vue

@@ -43,8 +43,19 @@
                 </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 label="省份" prop="provinceSn">
+                  <Area id="salesReturn-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="退货类别" prop="goodFlag">
+                  <v-select
+                    v-model="queryParam.goodFlag"
+                    ref=" goodFlag"
+                    id="returnSchedule-goodFlag"
+                    code="GOOD_FLAG"
+                    placeholder="请选择退货类别"
+                    allowClear></v-select>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -82,21 +93,24 @@
           :scroll="{ x:1300,y: tableHeight }"
           :defaultLoadData="false"
           bordered>
-          <!-- 销退单号 -->
+          <!-- 超时环节提示 -->
+          <template slot="tip" slot-scope="text, record">
+            <a-tooltip placement="top" v-if="record.customerServiceConfirmOverDay && record.customerServiceConfirmOverDay*1>3">
+              <template slot="title">
+                <span>已超时{{ record.dispatchOverDay }}天(要求提货后3-5天内完成清点)</span>
+              </template>
+              <div>
+                <a-icon type="exclamation-circle" :style="{color:'#ed1c24',fontSize:'20px',marginRight:'8px',display:'inlineBlock'}"/>
+                <a-icon v-if="record.customerServiceConfirmOverDay*1>5" type="exclamation-circle" :style="{color:'#ed1c24',fontSize:'20px',marginRight:'8px',display:'inlineBlock'}"/>
+                <span>未清点</span>
+              </div>
+            </a-tooltip>
+            <span v-else>--</span>
+          </template>
+          <!-- 总部销退单号 -->
           <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>
@@ -105,14 +119,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 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'
+import { queryOverviewPage } from '@/api/salesReturn'
 export default {
   name: 'ReturnSchedule',
   mixins: [commonMixin],
@@ -121,16 +136,24 @@ export default {
     return {
       spinning: false,
       tableHeight: 0,
+      time: [
+        moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        salesReturnBillNo: '', //  单号
+        submitBeginDate: getDate.getCurrMonthDays().starttime,
+        submitEndDate: getDate.getCurrMonthDays().endtime,
         buyerSn: undefined,
-        salesReturnBillSource: undefined,
-        billStatus: undefined, //  状态
-        warehouseSn: undefined, //  仓库
-        subareaSn: undefined,
-        subareaAreaSn: undefined
+        buyerName: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        goodFlag: undefined,
+        salesReturnBillNo: '', //  单号
+        billStatus: undefined, //  业务状态
+        provinceSn: undefined,
+        salesReturnType: undefined// 退货类别
       },
       disabled: false, //  查询、重置按钮是否可操作
       advanced: true,
@@ -138,7 +161,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return salesReturnFinancialList(Object.assign(parameter, this.queryParam)).then(res => {
+        return queryOverviewPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -159,116 +182,79 @@ export default {
   // 根据权限显示列表字段
   computed: {
     columns () {
+      const _this = this
       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: '超时环节提醒', scopedSlots: { customRender: 'tip' }, width: '130px', align: 'center', fixed: 'left' },
+        { title: '提交时间', dataIndex: 'submitTime', 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: 'provinceName', 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: 'goodFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '所在区域', dataIndex: 'subareaArea.subareaName', align: 'center', width: '130px', customRender: function (text) { return text || '--' } },
+        { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', align: 'center', width: '130px', customRender: function (text) { return text || '--' } },
+        { title: '退货类型', dataIndex: 'salesReturnTypeDictValue', 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: 'initialAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '退货申请审核时间', dataIndex: 'updateDate', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提货审核时间', dataIndex: 'auditTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '收货时间', dataIndex: 'receiveTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品检时间', dataIndex: 'checkTime', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客服确认时间', dataIndex: 'customerServiceConfirmTime', 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' }
+        { title: '坏件数量', dataIndex: 'totalBadQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '良品数量', dataIndex: 'totalGoodQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '返库数量', dataIndex: 'totalBackStockQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实际退货金额', dataIndex: 'totalAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       return arr
     }
   },
   methods: {
-    //  创建时间  change
+    //  提交时间  change
     dateChange (date) {
-      this.queryParam.beginDate = date[0]
-      this.queryParam.endDate = date[1]
+      this.queryParam.submitBeginDate = date[0]
+      this.queryParam.submitEndDate = date[1]
     },
+    // 客户名称
     custChange (val) {
-      this.queryParam.buyerSn = val.key
+      if (val.row) {
+        this.queryParam.buyerSn = val.row.dealerSn
+        this.queryParam.buyerName = undefined
+      } else {
+        this.queryParam.buyerSn = undefined
+        this.queryParam.buyerName = val.key
+      }
     },
+    // 区域分区
     subareaChange (val) {
-      this.queryParam.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.subareaSn = undefined
-      this.queryParam.subareaAreaSn = undefined
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.submitBeginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.submitEndDate = getDate.getCurrMonthDays().endtime
+
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.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.buyerName = undefined
+      this.queryParam.salesReturnBillNo = ''
       this.queryParam.billStatus = undefined
-      this.queryParam.warehouseSn = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.salesReturnType = undefined
+      this.queryParam.goodFlag = 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
-        }
-      })
+      this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillSn }, query: { path: 'returnSchedule' } })
     },
     pageInit () {
       const _this = this

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

@@ -223,6 +223,8 @@ export default {
     handleBack () {
       if (this.$route.query.path == 'receiveCheck') {
         this.$router.push({ name: 'receiveCheckList' })
+      } else if (this.$route.query.path == 'returnSchedule') {
+        this.$router.push({ name: 'returnSchedule' })
       } else {
         this.$router.push({ name: 'salesReturnList' })
       }