|
@@ -1,8 +1,340 @@
|
|
|
<template>
|
|
|
+ <a-card size="small" :bordered="false" class="financialCollectionList-wrap">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
+ <div 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="审核时间">
|
|
|
+ <a-range-picker
|
|
|
+ style="width:100%"
|
|
|
+ id="financialCollectionList-createDate"
|
|
|
+ :disabledDate="disabledDate"
|
|
|
+ v-model="createDate"
|
|
|
+ :format="dateFormat"
|
|
|
+ :placeholder="['开始时间', '结束时间']" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="经销商名称">
|
|
|
+ <a-input id="financialCollectionList-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="financialCollectionList-billStatus"
|
|
|
+ code="DEALER_LEVEL"
|
|
|
+ placeholder="请选择商户级别"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="收款方式">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.billStatus"
|
|
|
+ ref="billStatus"
|
|
|
+ id="financialCollectionList-billStatus"
|
|
|
+ code="SETTLE_STYLE"
|
|
|
+ placeholder="请选择收款方式"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="区域">
|
|
|
+ <subarea id="financialCollectionList-subarea" v-model="queryParam.subareaSn"></subarea>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="业务状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.grabFlag"
|
|
|
+ ref="grabFlag"
|
|
|
+ id="financialCollectionList-grabFlag"
|
|
|
+ code="SALES_RECEIVE_LIST_STATUS"
|
|
|
+ placeholder="请选择业务状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="财务状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.grabFlag"
|
|
|
+ ref="grabFlag"
|
|
|
+ id="financialCollectionList-grabFlag"
|
|
|
+ code="FINANCIAL_RECEIVE_STATUS"
|
|
|
+ placeholder="请选择财务状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="收款时间">
|
|
|
+ <a-range-picker
|
|
|
+ style="width:100%"
|
|
|
+ id="financialCollectionList-createDate"
|
|
|
+ :disabledDate="disabledDate"
|
|
|
+ v-model="createDate"
|
|
|
+ :format="dateFormat"
|
|
|
+ :placeholder="['开始时间', '结束时间']" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="12" :sm="24">
|
|
|
+ <a-row>
|
|
|
+ <a-form-item label="经销商地区">
|
|
|
+ <a-col span="7">
|
|
|
+ <a-form-item prop="provinceSn" style="margin: 0;">
|
|
|
+ <a-select v-model="queryParam.provinceSn" @change="getCityList" placeholder="请选择省">
|
|
|
+ <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="7" offset="1">
|
|
|
+ <a-form-item prop="citySn" style="margin: 0;">
|
|
|
+ <a-select v-model="queryParam.citySn" @change="getAreaList" placeholder="请选择市">
|
|
|
+ <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="7" offset="1">
|
|
|
+ <a-form-item prop="countySn" style="margin: 0;">
|
|
|
+ <a-select v-model="queryParam.countySn" placeholder="请选择区/县">
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-form-item>
|
|
|
+ </a-row>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="financialCollectionList-reset">重置</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-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
+ <div slot="message">合计:<strong>{{ total }}</strong>条</div>
|
|
|
+ </a-alert>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="default"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ x: 1460, y: tableHeight }"
|
|
|
+ bordered>
|
|
|
+ <!-- 单号 -->
|
|
|
+ <template slot="salesBillNo" slot-scope="text, record">
|
|
|
+ <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.billStatus=='WAIT_FINANCIAL_AUDIT'"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleAudit(record)"
|
|
|
+ id="financialCollectionList-audit-btn">退货确认</a-button>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import moment from 'moment'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import subarea from '@/views/common/subarea.js'
|
|
|
+import { getArea } from '@/api/data'
|
|
|
+import { salesReceiptList } from '@/api/sales'
|
|
|
+export default {
|
|
|
+ components: { STable, VSelect, subarea },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ queryParam: { // 查询条件
|
|
|
+ salesReturnBillNo: '', // 单号
|
|
|
+ buyerName: undefined,
|
|
|
+ grabFlag: undefined,
|
|
|
+ billStatus: undefined // 状态
|
|
|
+ },
|
|
|
+ tableHeight: 0,
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ createDate: [], // 创建时间
|
|
|
+ dateFormat: 'YYYY-MM-DD',
|
|
|
+ advanced: false,
|
|
|
+ columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
+ { title: '审核时间', dataIndex: 'auditDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 220, align: 'center' },
|
|
|
+ { title: '经销商名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '商户级别', dataIndex: 'salesReturnBillSourceDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '订单金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '收款时间', dataIndex: 'settleDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '备注', dataIndex: 'remarks', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '业务状态', dataIndex: 'billStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '财务状态', dataIndex: 'financialStatusDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
+ ],
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ if (this.tableHeight == 0) {
|
|
|
+ this.tableHeight = window.innerHeight - 380
|
|
|
+ }
|
|
|
+ // // 审核时间
|
|
|
+ // if (this.createDate && this.createDate.length > 0) {
|
|
|
+ // this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
|
|
|
+ // this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
|
|
|
+ // } else {
|
|
|
+ // this.queryParam.beginDate = undefined
|
|
|
+ // this.queryParam.endDate = undefined
|
|
|
+ // }
|
|
|
+ // // 收款时间
|
|
|
+ // if (this.createDate && this.createDate.length > 0) {
|
|
|
+ // this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
|
|
|
+ // this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
|
|
|
+ // } else {
|
|
|
+ // this.queryParam.beginDate = undefined
|
|
|
+ // this.queryParam.endDate = undefined
|
|
|
+ // }
|
|
|
+ return salesReceiptList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ const 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.total = data.count
|
|
|
+ this.disabled = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ total: 0, // 合计
|
|
|
+ addrProvinceList: [], // 省下拉
|
|
|
+ addrCityList: [], // 市下拉
|
|
|
+ addrDistrictList: [] // 区下拉
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 不可选日期
|
|
|
+ disabledDate (date, dateStrings) {
|
|
|
+ return date && date.valueOf() > Date.now()
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.queryParam.salesReturnBillNo = ''
|
|
|
+ this.queryParam.buyerName = undefined
|
|
|
+ this.queryParam.grabFlag = undefined
|
|
|
+ this.queryParam.billStatus = undefined
|
|
|
+ this.createDate = []
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ handleDetail (row) {
|
|
|
+ this.itemSn = row.salesReturnBillSn
|
|
|
+ this.openModal = true
|
|
|
+ },
|
|
|
+ closeModal () {
|
|
|
+ this.itemSn = ''
|
|
|
+ this.openModal = false
|
|
|
+ },
|
|
|
+ // 单个审核
|
|
|
+ handleAudit (row) {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '请点击下方按钮确认操作',
|
|
|
+ centered: 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
|
|
|
+ salesReturnFinancial({ salesReturnBillSn: sn, billStatus: flag }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取城市列表
|
|
|
+ getCityList (val) {
|
|
|
+ this.addrCityList = []
|
|
|
+ this.addrDistrictList = []
|
|
|
+ this.queryParam.citySn = undefined
|
|
|
+ this.queryParam.districtSn = undefined
|
|
|
+ this.getArea('city', val)
|
|
|
+ },
|
|
|
+ // 获取区县列表
|
|
|
+ getAreaList (val) {
|
|
|
+ this.addrDistrictList = []
|
|
|
+ this.queryParam.districtSn = undefined
|
|
|
+ this.getArea('district', val)
|
|
|
+ },
|
|
|
+ // 省/市/区
|
|
|
+ getArea (type, sn) {
|
|
|
+ let params
|
|
|
+ if (type == 'province') {
|
|
|
+ params = { level: '1' }
|
|
|
+ } else {
|
|
|
+ params = { psn: sn }
|
|
|
+ }
|
|
|
+ getArea(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ if (type == 'province') {
|
|
|
+ this.addrProvinceList = res.data || []
|
|
|
+ } else if (type == 'city') {
|
|
|
+ this.addrCityList = res.data || []
|
|
|
+ } else if (type == 'district') {
|
|
|
+ this.addrDistrictList = res.data || []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (type == 'province') {
|
|
|
+ this.addrProvinceList = []
|
|
|
+ } else if (type == 'city') {
|
|
|
+ this.addrCityList = []
|
|
|
+ } else if (type == 'district') {
|
|
|
+ this.addrDistrictList = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {
|
|
|
+ vm.getArea('province')
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
+<style lang="less">
|
|
|
+ .financialCollectionList-wrap{
|
|
|
+ .sTable{
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|