|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<a-drawer
|
|
|
- :title="'交易流水('+titInfo+')'"
|
|
|
+ :title="'交易流水('+itemInfo.customerName+(modalType==1?':充值金额':':抵扣金额')+')'"
|
|
|
placement="right"
|
|
|
:visible="isShow"
|
|
|
width="80%"
|
|
@@ -19,23 +19,23 @@
|
|
|
:model="queryParam"
|
|
|
@keyup.enter.native="$refs.table.refresh(true)"
|
|
|
id="transactionFlow-form">
|
|
|
- <a-row :gutter="5">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
+ <a-row :gutter="5" type="flex" justify="center" align="center">
|
|
|
+ <a-col :md="8" :sm="24">
|
|
|
<a-form-model-item label="交易时间">
|
|
|
<rangeDate id="transactionFlow-time" ref="rangeDate" :value="time" @change="dateChange" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="关联单号">
|
|
|
- <a-input id="transactionFlow-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
|
|
|
+ <a-input id="transactionFlow-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入关联单号"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="交易类型">
|
|
|
<v-select
|
|
|
- v-model="queryParam.promoType"
|
|
|
- id="transactionFlow-promoType"
|
|
|
- code="SHOP_PROMO_PROMO_STATE"
|
|
|
+ v-model="queryParam.bizType"
|
|
|
+ id="transactionFlow-bizType"
|
|
|
+ code="STORE_ACCOUNT_BIZ_TYPE"
|
|
|
placeholder="请选择交易类型"
|
|
|
allowClear></v-select>
|
|
|
</a-form-model-item>
|
|
@@ -50,10 +50,10 @@
|
|
|
<!-- 统计 -->
|
|
|
<div class="table-operator" style="margin-bottom: 10px;">
|
|
|
<div class="alert-message">
|
|
|
- 总{{ modalType=='1'?'充值':'补贴' }}:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
|
|
|
- 已用{{ modalType=='1'?'充值':'补贴' }}:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
|
|
|
- {{ modalType=='1'?'充值':'补贴' }}余额:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
|
|
|
- 清零余额:<strong>{{ totalData&&(totalData.refundingAmount || totalData.refundingAmount==0) ? toThousands(totalData.refundingAmount) : '--' }}</strong>;
|
|
|
+ 充值金额:<strong>{{ totalData&&(totalData.rechargeAmount || totalData.rechargeAmount==0) ? toThousands(totalData.rechargeAmount) : '--' }}</strong>;
|
|
|
+ 销售金额:<strong>{{ totalData&&(totalData.salesAmount || totalData.salesAmount==0) ? toThousands(totalData.salesAmount) : '--' }}</strong>;
|
|
|
+ 退款金额:<strong>{{ totalData&&(totalData.refundAmount || totalData.refundAmount==0) ? toThousands(totalData.refundAmount) : '--' }}</strong>;
|
|
|
+ 清零金额:<strong>{{ totalData&&(totalData.zeroAmount || totalData.zeroAmount==0) ? toThousands(totalData.zeroAmount) : '--' }}</strong>;
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
@@ -80,8 +80,7 @@ import productType from '@/views/common/productType.js'
|
|
|
import productBrand from '@/views/common/productBrand.js'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
// 接口
|
|
|
-import { stockOutDetailList } from '@/api/stockOut'
|
|
|
-import { queryExtList } from '@/api/shopProduct'
|
|
|
+import { storeAccountDetailList, storeAccountDetailCount } from '@/api/storeAccount' // 接口api
|
|
|
export default {
|
|
|
name: 'TransactionFlowModal',
|
|
|
components: { STable, VSelect, productType, productBrand, rangeDate },
|
|
@@ -95,35 +94,46 @@ export default {
|
|
|
modalType: { // 1是充值交易流水 2是补贴交易流水
|
|
|
type: String,
|
|
|
default: '1'
|
|
|
+ },
|
|
|
+ itemInfo: {// 当前行回显数据
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
+ const _this = this
|
|
|
return {
|
|
|
spinning: false,
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
tableHeight: 0, // 表格高度
|
|
|
totalData: null, // 统计数据
|
|
|
- titInfo: '西安店1:充值金额',
|
|
|
- time: [],
|
|
|
+ time: [], // 交易时间
|
|
|
// 查询条件
|
|
|
queryParam: {
|
|
|
beginDate: undefined, // 交易开始时间
|
|
|
endDate: undefined, // 交易结束时间
|
|
|
- productCode: '', // 关联单号
|
|
|
- promoType: undefined // 交易类型
|
|
|
+ bizNo: '', // 关联单号
|
|
|
+ bizType: undefined // 交易类型
|
|
|
},
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '交易时间', dataIndex: 'stockBatchNo', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '关联单号', dataIndex: 'putBizTypeDictValue', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '金额(¥)', dataIndex: 'warehouseLocationName', width: '24%', align: 'right', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '交易类型', dataIndex: 'outQty', width: '24%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ { title: '交易时间', dataIndex: 'tradeDate', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '关联单号', dataIndex: 'bizNo', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '金额(¥)', dataIndex: 'tradeAmount', width: '24%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
+ { title: '交易类型', dataIndex: 'bizTypeDictValue', width: '24%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
+ const params = Object.assign(parameter, this.queryParam)
|
|
|
+ params.storeAccountSn = this.itemInfo.storeAccountSn
|
|
|
+ params.storeSn = this.itemInfo.storeSn
|
|
|
+ params.shelfSn = this.itemInfo.shelfSn
|
|
|
+ params.bizType = this.modalType == 1 ? 'RECHARGE' : 'GIVE'
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return stockOutDetailList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ return storeAccountDetailList(params).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -131,6 +141,7 @@ export default {
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
data[i].no = no + i + 1
|
|
|
}
|
|
|
+ this.getCount(params)
|
|
|
this.disabled = false
|
|
|
}
|
|
|
this.spinning = false
|
|
@@ -145,46 +156,25 @@ export default {
|
|
|
this.queryParam.beginDate = date[0]
|
|
|
this.queryParam.endDate = date[1]
|
|
|
},
|
|
|
- // 计算表格高度
|
|
|
- setTableH () {
|
|
|
- this.$nextTick(() => {
|
|
|
- const searchBoxH = this.$refs.searchBox.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - searchBoxH - 235
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取产品类目列表
|
|
|
- getCategoryList () {
|
|
|
- const _this = this
|
|
|
- _this.spinning = true
|
|
|
- queryExtList({}).then(res => {
|
|
|
+ // 统计
|
|
|
+ getCount (ajaxData) {
|
|
|
+ storeAccountDetailCount(ajaxData).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.categoryOptions = res.data || []
|
|
|
+ this.totalData = res.data || []
|
|
|
+ } else {
|
|
|
+ this.totalData = null
|
|
|
}
|
|
|
- _this.spinning = false
|
|
|
- })
|
|
|
- },
|
|
|
- // 关闭弹框
|
|
|
- cansel () {
|
|
|
- this.isShow = false
|
|
|
- this.baseData = null
|
|
|
- },
|
|
|
- // 查询列表
|
|
|
- getData (row) {
|
|
|
- this.baseData = row
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
})
|
|
|
},
|
|
|
- // 批量添加
|
|
|
- handlePlAdd () {
|
|
|
- if (this.selectTotal) {
|
|
|
- this.$emit('plAdd', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || [])
|
|
|
- } else {
|
|
|
- this.$message.info('请选择产品')
|
|
|
- }
|
|
|
- },
|
|
|
+ // 充值
|
|
|
resetSearchForm () {
|
|
|
-
|
|
|
+ this.time = []
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
+ this.queryParam.beginDate = undefined
|
|
|
+ this.queryParam.endDate = undefined
|
|
|
+ this.queryParam.bizNo = undefined
|
|
|
+ this.queryParam.bizType = undefined
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -192,15 +182,14 @@ export default {
|
|
|
openModal (newValue, oldValue) {
|
|
|
this.isShow = newValue
|
|
|
},
|
|
|
- '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
- this.setTableH()
|
|
|
- },
|
|
|
// 重定义的弹框状态
|
|
|
isShow (newValue, oldValue) {
|
|
|
if (!newValue) {
|
|
|
this.$emit('close')
|
|
|
} else {
|
|
|
- this.setTableH()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.resetSearchForm()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|