...
|
...
|
@@ -50,148 +50,148 @@ |
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import moment from "moment";
|
|
|
import {Withdraw} from './store';
|
|
|
import FinanceService from 'services/finance/finance-service';
|
|
|
import _ from "lodash";
|
|
|
import moment from "moment";
|
|
|
import {Withdraw} from './store';
|
|
|
import FinanceService from 'services/finance/finance-service';
|
|
|
import _ from "lodash";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return Withdraw.call(this);
|
|
|
export default {
|
|
|
data() {
|
|
|
return Withdraw.call(this);
|
|
|
},
|
|
|
created() {
|
|
|
this.financeService = new FinanceService();
|
|
|
},
|
|
|
mounted() {
|
|
|
this.loadData();
|
|
|
},
|
|
|
watch: {
|
|
|
date() {
|
|
|
this.loadData();
|
|
|
},
|
|
|
created() {
|
|
|
this.financeService = new FinanceService();
|
|
|
day(newDay) {
|
|
|
let curDay = moment().format('YYYY-MM-DD');
|
|
|
if (newDay === this.beginTime || !newDay) {
|
|
|
return;
|
|
|
}
|
|
|
this.dateRange = newDay !== this.curDay ? [newDay, curDay] : [newDay, newDay];
|
|
|
},
|
|
|
mounted() {
|
|
|
this.loadData();
|
|
|
dateRange(newDate) {
|
|
|
this.beginTime = moment(Array.isArray(newDate) ? newDate[0] : newDate).format('YYYY-MM-DD');
|
|
|
this.endTime = moment(Array.isArray(newDate) ? newDate[1] : newDate).format('YYYY-MM-DD');
|
|
|
this.day = this.beginTime === this.endTime === this.today ? '' : this.beginTime;
|
|
|
this.pageData.current = 1;
|
|
|
this.list();
|
|
|
},
|
|
|
watch: {
|
|
|
date() {
|
|
|
this.loadData();
|
|
|
},
|
|
|
day(newDay) {
|
|
|
let curDay = moment().format('YYYY-MM-DD');
|
|
|
if (newDay === this.beginTime || !newDay) {
|
|
|
return;
|
|
|
}
|
|
|
this.dateRange = newDay !== this.curDay ? [newDay, curDay] : [newDay, newDay];
|
|
|
},
|
|
|
dateRange(newDate) {
|
|
|
this.beginTime = moment(Array.isArray(newDate) ? newDate[0] : newDate).format('YYYY-MM-DD');
|
|
|
this.endTime = moment(Array.isArray(newDate) ? newDate[1] : newDate).format('YYYY-MM-DD');
|
|
|
this.day = this.beginTime === this.endTime === this.today ? '' : this.beginTime;
|
|
|
this.pageData.current = 1;
|
|
|
this.list();
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
loadData() {
|
|
|
this.list();
|
|
|
},
|
|
|
methods: {
|
|
|
loadData() {
|
|
|
this.list();
|
|
|
},
|
|
|
changeLimit(limit) {
|
|
|
if(limit > 1) {
|
|
|
this.dateRange = [this[`day${limit}`], this.today];
|
|
|
}else if(limit===1){
|
|
|
this.dateRange = [this.yesterday, this.today];
|
|
|
}else{
|
|
|
this.dateRange = [this.today, this.today];
|
|
|
}
|
|
|
this.pageData.current = 1;
|
|
|
},
|
|
|
pageChange() {
|
|
|
this.pageData.current = page;
|
|
|
this.list();
|
|
|
},
|
|
|
filtersParams() {
|
|
|
let params = {};
|
|
|
let fts = this.filters;
|
|
|
let withdrawStatus = fts.withdrawStatus.model,
|
|
|
statementSn = fts.statementSn.model === '' || fts.brand.model === null ?
|
|
|
null : fts.statementSn.model;
|
|
|
let pageNo = this.pageData.current;
|
|
|
let pageSize = this.pageData.pageSize;
|
|
|
changeLimit(limit) {
|
|
|
if(limit > 1) {
|
|
|
this.dateRange = [this[`day${limit}`], this.today];
|
|
|
}else if(limit===1){
|
|
|
this.dateRange = [this.yesterday, this.today];
|
|
|
}else{
|
|
|
this.dateRange = [this.today, this.today];
|
|
|
}
|
|
|
this.pageData.current = 1;
|
|
|
},
|
|
|
pageChange() {
|
|
|
this.pageData.current = page;
|
|
|
this.list();
|
|
|
},
|
|
|
filtersParams() {
|
|
|
let params = {};
|
|
|
let fts = this.filters;
|
|
|
let withdrawStatus = fts.withdrawStatus.model,
|
|
|
statementSn = fts.statementSn.model === '' || fts.brand.model === null ?
|
|
|
null : fts.statementSn.model;
|
|
|
let pageNo = this.pageData.current;
|
|
|
let pageSize = this.pageData.pageSize;
|
|
|
|
|
|
if(this.filters.withdrawStatus.model){
|
|
|
if (this.isNumber(this.filters.withdrawStatus.mode)) {
|
|
|
params.withdrawStatus = this.filters.withdrawStatus.model;
|
|
|
}
|
|
|
if(this.filters.withdrawStatus.model){
|
|
|
if (this.isNumber(this.filters.withdrawStatus.mode)) {
|
|
|
params.withdrawStatus = this.filters.withdrawStatus.model;
|
|
|
}
|
|
|
if(this.filters.statementSn.model){
|
|
|
if (this.isString(this.filters.statementSn.mode)) {
|
|
|
params.statementSn = this.filters.statementSn.model;
|
|
|
}
|
|
|
}
|
|
|
if(this.filters.statementSn.model){
|
|
|
if (this.isString(this.filters.statementSn.mode)) {
|
|
|
params.statementSn = this.filters.statementSn.model;
|
|
|
}
|
|
|
params.pageSize = this.pageData.pageSize;
|
|
|
params.pageNo = this.pageData.current;
|
|
|
}
|
|
|
params.pageSize = this.pageData.pageSize;
|
|
|
params.pageNo = this.pageData.current;
|
|
|
|
|
|
return Promise.resolve({
|
|
|
params,
|
|
|
withdrawStatus,
|
|
|
statementSn,
|
|
|
pageNo,
|
|
|
pageSize
|
|
|
});
|
|
|
},
|
|
|
list() {
|
|
|
this.$Loading.start();
|
|
|
return this.filtersParams().then((params) => {
|
|
|
let filter = {
|
|
|
beginTime: this.beginDate,
|
|
|
endTime: this.endDate,
|
|
|
pageNo: params.pageNo,
|
|
|
};
|
|
|
if (this.withdrawStatus && this.withdrawStatus !== '-1') {
|
|
|
filter = Object.assign({}, filter, {withdrawStatus: this.withdrawStatus});
|
|
|
}
|
|
|
return this.FinanceService.shopWithdrawList(filter);
|
|
|
}).then(result => {
|
|
|
if (!result.data) {
|
|
|
result.data = {
|
|
|
pageNo: 1,
|
|
|
pageSize: 1,
|
|
|
totalCount: 1,
|
|
|
totalPage: 1,
|
|
|
records: []
|
|
|
}
|
|
|
return Promise.resolve({
|
|
|
params,
|
|
|
withdrawStatus,
|
|
|
statementSn,
|
|
|
pageNo,
|
|
|
pageSize
|
|
|
});
|
|
|
},
|
|
|
list() {
|
|
|
this.$Loading.start();
|
|
|
return this.filtersParams().then((params) => {
|
|
|
let filter = {
|
|
|
beginTime: this.beginDate,
|
|
|
endTime: this.endDate,
|
|
|
pageNo: params.pageNo,
|
|
|
};
|
|
|
if (this.withdrawStatus && this.withdrawStatus !== '-1') {
|
|
|
filter = Object.assign({}, filter, {withdrawStatus: this.withdrawStatus});
|
|
|
}
|
|
|
return this.FinanceService.shopWithdrawList(filter);
|
|
|
}).then(result => {
|
|
|
if (!result.data) {
|
|
|
result.data = {
|
|
|
pageNo: 1,
|
|
|
pageSize: 1,
|
|
|
totalCount: 1,
|
|
|
totalPage: 1,
|
|
|
records: []
|
|
|
}
|
|
|
this.pageData.total = result.data.totalCount;
|
|
|
this.pageData.current = result.data.pageNo;
|
|
|
this.tableData = result.data.records;
|
|
|
this.$Loading.finish();
|
|
|
}).catch(() => {
|
|
|
this.$Loading.finish();
|
|
|
});
|
|
|
},
|
|
|
reset() {
|
|
|
this.filters.withdrawStatus.model = null;
|
|
|
this.filters.statementSn.model = null;
|
|
|
this.filters.timeFlag.model = null;
|
|
|
this.filters.beginTime.model = null;
|
|
|
this.filters.endTime.model = null;
|
|
|
this.pageData.pageNo = 1;
|
|
|
this.pageData.total = 0;
|
|
|
this.list();
|
|
|
},
|
|
|
exportFile() {
|
|
|
let param = {};
|
|
|
|
|
|
param.beginTime = this.beginTime;
|
|
|
param.endTime = this.endTime;
|
|
|
// param.timeFlag = '1,2,3,4';
|
|
|
if (this.withdrawStatus && this.withdrawStatus !== '0') {
|
|
|
param.withdrawStatus = this.withdrawStatus;
|
|
|
}
|
|
|
this.pageData.total = result.data.totalCount;
|
|
|
this.pageData.current = result.data.pageNo;
|
|
|
this.tableData = result.data.records;
|
|
|
this.$Loading.finish();
|
|
|
}).catch(() => {
|
|
|
this.$Loading.finish();
|
|
|
});
|
|
|
},
|
|
|
reset() {
|
|
|
this.filters.withdrawStatus.model = null;
|
|
|
this.filters.statementSn.model = null;
|
|
|
this.filters.timeFlag.model = null;
|
|
|
this.filters.beginTime.model = null;
|
|
|
this.filters.endTime.model = null;
|
|
|
this.pageData.pageNo = 1;
|
|
|
this.pageData.total = 0;
|
|
|
this.list();
|
|
|
},
|
|
|
exportFile() {
|
|
|
let param = {};
|
|
|
|
|
|
const href = '/Api/erp/exportShopWithdrawList?queryConf=' +
|
|
|
JSON.stringify(param);
|
|
|
param.beginTime = this.beginTime;
|
|
|
param.endTime = this.endTime;
|
|
|
// param.timeFlag = '1,2,3,4';
|
|
|
if (this.withdrawStatus && this.withdrawStatus !== '0') {
|
|
|
param.withdrawStatus = this.withdrawStatus;
|
|
|
}
|
|
|
|
|
|
window.open(href, '_blank');
|
|
|
},
|
|
|
getDetailById() {
|
|
|
const href = '/Api/erp/exportShopWithdrawList?queryConf=' +
|
|
|
JSON.stringify(param);
|
|
|
|
|
|
window.open(href, '_blank');
|
|
|
},
|
|
|
getDetailById() {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
...
|
...
|
|