|
@@ -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>
|