|
@@ -29,14 +29,14 @@
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
<a-select
|
|
|
- id="salesReturn-buyerName"
|
|
|
+ id="salesReturn-buyerSn"
|
|
|
placeholder="请选择客户"
|
|
|
allowClear
|
|
|
- v-model="queryParam.buyerName"
|
|
|
+ v-model="queryParam.buyerSn"
|
|
|
:showSearch="true"
|
|
|
option-filter-prop="children"
|
|
|
:filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerName">{{ item.customerName }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in custAllList" :key="item.customerSn" :value="item.customerSn">{{ item.customerName }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -52,7 +52,7 @@
|
|
|
v-model="queryParam.billStatus"
|
|
|
ref="billStatus"
|
|
|
id="salesManagementList-billStatus"
|
|
|
- code="SALES_BILL_STATUS"
|
|
|
+ code="SALES_RETURN_BILL_STATUS"
|
|
|
placeholder="请选择业务状态"
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
@@ -73,11 +73,16 @@
|
|
|
</div>
|
|
|
<!-- 操作按钮 -->
|
|
|
<div class="table-operator">
|
|
|
- <a-button type="primary" class="button-error" @click="handleAdd">新增</a-button>
|
|
|
+ <a-button type="primary" class="button-error" @click="openModal = true">新增</a-button>
|
|
|
</div>
|
|
|
<!-- alert -->
|
|
|
<a-alert type="info" style="margin-bottom: 15px;">
|
|
|
- <div slot="message">退货总金额:<strong>14.00</strong>元;总单数:<strong>6</strong>;总款数:<strong>6</strong>;总数量:<strong>6</strong>;</div>
|
|
|
+ <div slot="message">
|
|
|
+ 退货总金额:<strong>{{ countData&&countData.totalAmount }}</strong>元;
|
|
|
+ 总单数:<strong>{{ countData&&countData.totalBillNumber }}</strong>;
|
|
|
+ 总款数:<strong>{{ countData&&countData.totalCategory }}</strong>;
|
|
|
+ 总数量:<strong>{{ countData&&countData.totalQty }}</strong>;
|
|
|
+ </div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -87,16 +92,12 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1590 }"
|
|
|
+ :scroll="{ x: 1590, y: tableHeight }"
|
|
|
bordered>
|
|
|
<!-- 单号 -->
|
|
|
<template slot="salesReturnNo" slot-scope="text, record">
|
|
|
<span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesReturnNo }}</span>
|
|
|
</template>
|
|
|
- <!-- 财务状态 -->
|
|
|
- <template slot="financialStatus" slot-scope="text, record">
|
|
|
- <a-badge :color="text=='FINISH'?'#87d068':'gold'" :text="record.financialStatusDictValue" />
|
|
|
- </template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button size="small" type="link" @click="handleEexamine(record)" id="salesReturn-eexamine-btn">审核</a-button>
|
|
@@ -117,7 +118,8 @@
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
|
import { custAllList } from '@/api/customer'
|
|
|
-import { salesReturnList, salesReturnDel } from '@/api/salesReturn'
|
|
|
+import { salesReturnList, salesReturnQueryCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
|
|
|
+import moment from 'moment'
|
|
|
export default {
|
|
|
name: 'TableList',
|
|
|
components: {
|
|
@@ -127,6 +129,7 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ tableHeight: 0,
|
|
|
// 高级搜索 展开/关闭
|
|
|
advanced: false,
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
@@ -137,27 +140,51 @@ export default {
|
|
|
custAllList: [], // 客户下拉数据
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
- dealerName: undefined, // 客户名称
|
|
|
- salesReturnNo: undefined // 销售退货单号
|
|
|
+ buyerSn: undefined, // 客户名称
|
|
|
+ salesReturnNo: undefined, // 销售退货单号
|
|
|
+ billStatus: undefined, // 业务状态
|
|
|
+ beginDate: undefined,
|
|
|
+ endDate: undefined,
|
|
|
+ auditBeginDate: undefined,
|
|
|
+ auditEndDate: undefined
|
|
|
},
|
|
|
+ countData: null, // 统计数据
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
|
|
|
- { title: '销售退货单号', scopedSlots: { customRender: 'salesReturnNo' }, width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售退货单号', scopedSlots: { customRender: 'salesReturnNo' }, width: 140, align: 'center' },
|
|
|
{ title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '总款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '总数量', dataIndex: 'totalCelQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '退款总金额', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '是否抓单', dataIndex: 'grabFlag', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '是否抓单', dataIndex: 'grabFlag', width: 100, align: 'center', customRender: function (text) { return ['否', '是'][text] } },
|
|
|
{ title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '业务状态', dataIndex: 'billStatusDictValue', width: 110, align: 'center' },
|
|
|
- { title: '财务状态', dataIndex: 'financialStatus', scopedSlots: { customRender: 'financialStatus' }, width: 110, align: 'center' },
|
|
|
+ { title: '状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 220, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
+ if (this.tableHeight == 0) {
|
|
|
+ this.tableHeight = window.innerHeight - 320
|
|
|
+ }
|
|
|
+ // 创建时间
|
|
|
+ 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.examineTime && this.examineTime.length > 0) {
|
|
|
+ this.queryParam.auditBeginDate = moment(this.examineTime[0]).format(this.dateFormat)
|
|
|
+ this.queryParam.auditEndDate = moment(this.examineTime[1]).format(this.dateFormat)
|
|
|
+ } else {
|
|
|
+ this.queryParam.auditBeginDate = undefined
|
|
|
+ this.queryParam.auditEndDate = undefined
|
|
|
+ }
|
|
|
+ // 查询总计
|
|
|
+ this.getQueryCount(Object.assign(parameter, this.queryParam))
|
|
|
return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
@@ -175,18 +202,16 @@ export default {
|
|
|
disabledDate (date, dateStrings) {
|
|
|
return date && date.valueOf() > Date.now()
|
|
|
},
|
|
|
- handleAdd () {
|
|
|
- this.openModal = true
|
|
|
+ // 列表统计
|
|
|
+ getQueryCount (params) {
|
|
|
+ salesReturnQueryCount(params).then(res => {
|
|
|
+ this.countData = res.data || null
|
|
|
+ })
|
|
|
},
|
|
|
// 编辑
|
|
|
handleEdit (row) {
|
|
|
- if (row.grabFlag) {
|
|
|
- // 抓单
|
|
|
- this.$router.push({ name: 'salesReturnGrabEdit', params: { id: row.id, sn: row.salesReturnSn } })
|
|
|
- } else {
|
|
|
- // 不抓单
|
|
|
- this.$router.push({ name: 'salesReturnEdit', params: { id: row.id, sn: row.salesReturnSn } })
|
|
|
- }
|
|
|
+ console.log(row)
|
|
|
+ this.$router.push({ name: row.grabFlag ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { id: row.id, sn: row.salesReturnSn, buyerSn: row.buyerSn } })
|
|
|
},
|
|
|
// 详情
|
|
|
handleDetail (row) {
|
|
@@ -200,7 +225,7 @@ export default {
|
|
|
content: '确认要删除吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
- salesReturnDel({ id: row.id }).then(res => {
|
|
|
+ salesReturnDel({ sn: row.salesReturnSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$refs.table.refresh()
|
|
@@ -217,25 +242,27 @@ export default {
|
|
|
content: '确认要审核吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
- // delectRolePower({
|
|
|
- // id: row.id
|
|
|
- // }).then(res => {
|
|
|
- // console.log(res, 'res1111')
|
|
|
- // if (res.status == 200) {
|
|
|
- // _this.$message.success(res.message)
|
|
|
- // _this.$refs.table.refresh()
|
|
|
- // }
|
|
|
- // })
|
|
|
+ salesReturnAudit({
|
|
|
+ sn: row.salesReturnSn
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.orderBundleNo = ''
|
|
|
- this.queryParam.orderBundle.custMobile = ''
|
|
|
- this.queryParam.bundleName = ''
|
|
|
- this.queryParam.itemName = ''
|
|
|
- this.oldTime = undefined
|
|
|
- this.newTime = undefined
|
|
|
+ this.queryParam.buyerSn = undefined
|
|
|
+ this.queryParam.salesReturnNo = ''
|
|
|
+ this.queryParam.billStatus = ''
|
|
|
+ this.queryParam.beginDate = undefined
|
|
|
+ this.endDate = undefined
|
|
|
+ this.auditBeginDate = undefined
|
|
|
+ this.auditEndDate = undefined
|
|
|
+ this.createDate = []
|
|
|
+ this.examineTime = []
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 客户无分页列表数据
|