Commit 75e2c809 authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/release2.2' into release2.2

parents 5efaee53 960d6e05
...@@ -127,4 +127,13 @@ export function getOrderExcptionResult(query) { ...@@ -127,4 +127,13 @@ export function getOrderExcptionResult(query) {
method: 'get', method: 'get',
params: query params: query
}) })
}
// 参数查询获得订单统计
export function getStatistics(query) {
return request({
url: '/ecw/order-exception/statistics',
method: 'get',
params: query
})
} }
\ No newline at end of file
...@@ -769,7 +769,8 @@ export default { ...@@ -769,7 +769,8 @@ export default {
}, },
pages:1, pages:1,
rateList:[] rateList:[],
userInfo:null
}; };
}, },
activated(){ activated(){
...@@ -777,6 +778,10 @@ export default { ...@@ -777,6 +778,10 @@ export default {
this.flag = true this.flag = true
this.id = this.$route.query.id; this.id = this.$route.query.id;
this.getReceivableData() this.getReceivableData()
}else{
this.discountForm.author = this.userInfo.username
this.form.departmentId = this.userInfo.deptId
this.form.salesmanId = this.userInfo.id
} }
if (this.$route.query.receiptId && this.$route.query.receiptId != 0) { if (this.$route.query.receiptId && this.$route.query.receiptId != 0) {
...@@ -804,11 +809,7 @@ export default { ...@@ -804,11 +809,7 @@ export default {
}) })
}) })
} }
getUserProfile().then(res => {
this.discountForm.author = res.data.username
this.form.departmentId = res.data.deptId
this.form.salesmanId = res.data.id
})
}, },
directives: { directives: {
'el-select-loadmore': { 'el-select-loadmore': {
...@@ -827,11 +828,7 @@ export default { ...@@ -827,11 +828,7 @@ export default {
} }
}, },
async created() { async created() {
await getUserProfile().then(res => { await getUserProfile().then(res => this.userInfo = res.data)
this.discountForm.author = res.data.username
this.form.departmentId = res.data.deptId
this.form.salesmanId = res.data.id
})
// 获取汇率 // 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list) await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list)
...@@ -858,6 +855,10 @@ export default { ...@@ -858,6 +855,10 @@ export default {
this.flag = true this.flag = true
this.id = this.$route.query.id; this.id = this.$route.query.id;
this.getReceivableData() this.getReceivableData()
}else{
this.discountForm.author = this.userInfo.username
this.form.departmentId = this.userInfo.deptId
this.form.salesmanId = this.userInfo.id
} }
if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') { if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') {
this.receiptId = this.$route.query.receiptId; this.receiptId = this.$route.query.receiptId;
...@@ -954,6 +955,9 @@ export default { ...@@ -954,6 +955,9 @@ export default {
getReceiptInfoByIds({ id: this.id }).then(res => { getReceiptInfoByIds({ id: this.id }).then(res => {
if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss') if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss')
this.form = Object.assign({}, this.form, res.data) this.form = Object.assign({}, this.form, res.data)
this.discountForm.author = this.userInfo.username
if(!this.form.departmentId) this.form.departmentId = this.userInfo.deptId
if(!this.form.salesmanId) this.form.salesmanId = this.userInfo.id
}) })
getInvoicingItem({ id: this.id }).then(res => { getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data] this.list = [...res.data]
...@@ -1048,19 +1052,29 @@ export default { ...@@ -1048,19 +1052,29 @@ export default {
getRate(sourceCurrencyId,targetCurrencyId){ getRate(sourceCurrencyId,targetCurrencyId){
var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId)) var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId))
if(rate) return rate.currencyRate if(rate) return rate.currencyRate
return 0 return ''
}, },
writeOffRateChange(row, index) { writeOffRateChange(row, index) {
row.writeOffAmount = Math.round(NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal))) if(parseInt(row.writeOffRate)===0){
this.$modal.msgError(this.$t('汇率不能为0,请输入正确的汇率'));
}
if(row.writeOffRate){
row.writeOffAmount = Math.round(NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal)))
}else{
row.writeOffAmount = ''
}
const writeOffAmountTotal = this.form.receiptAccountList.filter(v => v.type !== 'total').reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0) const writeOffAmountTotal = this.form.receiptAccountList.filter(v => v.type !== 'total').reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0)
this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal
}, },
rateChange(row, index) { rateChange(row, index) {
if(parseInt(row.collectionRate)===0){
this.$modal.msgError(this.$t('汇率不能为0,请输入正确的汇率'));
}
if(row.collectionRate){ if(row.collectionRate){
row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)))) row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0))))
}else{ }else{
row.collectionAmount = 0 row.collectionAmount = ''
} }
this.form.receiptAccountList[index] = {...row} this.form.receiptAccountList[index] = {...row}
...@@ -1396,7 +1410,8 @@ export default { ...@@ -1396,7 +1410,8 @@ export default {
this.form.receiptAccountList[index].platformAccountId = platformAccountId this.form.receiptAccountList[index].platformAccountId = platformAccountId
}, },
submitForm(addType) { submitForm(addType) {
const params = {...this.form} // const params = {...this.form}
const params = JSON.parse(JSON.stringify(this.form))
params.addType = addType params.addType = addType
// params.receiptAccountList = params.receiptAccountList.map(v => Object.assign(v, { })) // params.receiptAccountList = params.receiptAccountList.map(v => Object.assign(v, { }))
if(!params.customerId){ if(!params.customerId){
......
...@@ -454,6 +454,7 @@ import { getCurrencyPage } from "@/api/ecw/currency"; ...@@ -454,6 +454,7 @@ import { getCurrencyPage } from "@/api/ecw/currency";
import NP from 'number-precision' import NP from 'number-precision'
import {getWarehouseList} from '@/api/ecw/warehouse' import {getWarehouseList} from '@/api/ecw/warehouse'
import WorkFlow from '@/components/WorkFlow/' import WorkFlow from '@/components/WorkFlow/'
import { getExchangeRatePage } from "@/api/ecw/exchangeRate";
export default { export default {
name: "EcwFinancialCreatpayment", name: "EcwFinancialCreatpayment",
...@@ -492,7 +493,8 @@ export default { ...@@ -492,7 +493,8 @@ export default {
currencyList: [], currencyList: [],
warehouseList:[], warehouseList:[],
selectedUsers:[], selectedUsers:[],
dialogVisible:false dialogVisible:false,
rateList:[],
}; };
}, },
activated(){ activated(){
...@@ -506,7 +508,7 @@ export default { ...@@ -506,7 +508,7 @@ export default {
this.selectChange(this.form.supplierId) this.selectChange(this.form.supplierId)
}) })
} }
if (that.$route.query.id && that.$route.query.id !== '0') { if (this.$route.query.id && this.$route.query.id !== '0') {
this.id = this.$route.query.id; this.id = this.$route.query.id;
getPaymentInfoByIds({ id: this.id }).then(res => { getPaymentInfoByIds({ id: this.id }).then(res => {
this.form = { this.form = {
...@@ -515,7 +517,7 @@ export default { ...@@ -515,7 +517,7 @@ export default {
applicationAt: this.parseTime(res.data.applicationAt, '{y}-{m}-{d}'), applicationAt: this.parseTime(res.data.applicationAt, '{y}-{m}-{d}'),
invoiceStatus: String(res.data.invoiceStatus), invoiceStatus: String(res.data.invoiceStatus),
} }
this.$set(this.form,'supplierBankAccount',res.data.supplierBankAccount) this.$set(this.form,'supplierBankAccount',res.data.supplierBankAccount)
console.log(this.form) console.log(this.form)
}) })
...@@ -527,6 +529,7 @@ export default { ...@@ -527,6 +529,7 @@ export default {
}, },
async created() { async created() {
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await getExchangeRatePage({page:1,rows: 100}).then(res => this.rateList = res.data.list)
getWarehouseList().then(res => this.warehouseList = res.data) getWarehouseList().then(res => this.warehouseList = res.data)
let that = this; let that = this;
if (that.$route.query.payableId && that.$route.query.payableId != 0) { if (that.$route.query.payableId && that.$route.query.payableId != 0) {
...@@ -740,10 +743,18 @@ export default { ...@@ -740,10 +743,18 @@ export default {
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val.map(v => { this.multipleSelection = val.map(v => {
var rate = NP.divide(this.currencyList.find(vs => vs.id === v.currencyId).huilv, 100).toFixed(6) // var rate = NP.divide(this.currencyList.find(vs => vs.id === v.currencyId).huilv, 100).toFixed(6)
var rate = this.getRate(v.currencyId)
return Object.assign(v, { exchangeRate: rate }) return Object.assign(v, { exchangeRate: rate })
}); });
}, },
//获取汇率
getRate(sourceCurrencyId){
var targetCurrencyId = this.currencyList.find(vs=>vs.titleEn=='RMB').id
var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId))
if(rate) return rate.currencyRate
return ''
},
hiddenDialog() { hiddenDialog() {
this.open = false; this.open = false;
}, },
......
...@@ -702,20 +702,21 @@ export default { ...@@ -702,20 +702,21 @@ export default {
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list) await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list)
await listSimpleDepts().then((res) => { await listSimpleDepts().then((res) => {
res.data.forEach((item) => { this.deptData = res.data
if (item.parentId == 0) { // res.data.forEach((item) => {
this.deptArr.push(item); // if (item.parentId == 0) {
} else { // this.deptArr.push(item);
this.deptData.push(item); // } else {
} // this.deptData.push(item);
}); // }
// });
this.deptData.forEach((value) => { // this.deptData.forEach((value) => {
var dept = this.deptArr.filter((itt) => itt.id == value.parentId); // var dept = this.deptArr.filter((itt) => itt.id == value.parentId);
if (dept.length > 0) { // if (dept.length > 0) {
value.name = dept[0].name + " | " + value.name; // value.name = dept[0].name + " | " + value.name;
} // }
}); // });
// console.log(this.deptData) // console.log(this.deptData)
}); });
await getBankAccountPage(this.params).then((res) => (this.bankData = res.data.list)); await getBankAccountPage(this.params).then((res) => (this.bankData = res.data.list));
...@@ -813,7 +814,7 @@ export default { ...@@ -813,7 +814,7 @@ export default {
if(row.collectionRate){ if(row.collectionRate){
row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)))) row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0))))
}else{ }else{
row.collectionAmount = 0 row.collectionAmount = ''
} }
// row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2)) // row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2))
this.form.receiptAccountList[index] = {...row} this.form.receiptAccountList[index] = {...row}
...@@ -837,11 +838,12 @@ export default { ...@@ -837,11 +838,12 @@ export default {
this.addForm.amount = '' this.addForm.amount = ''
this.$modal.msgError(this.$t('输入金额不对')); this.$modal.msgError(this.$t('输入金额不对'));
}else{ }else{
pointArr = this.addForm.amount.split('.') if(this.addForm.amount.indexOf('.')>-1){
if(pointArr.length>1&&pointArr[1]){ pointArr = this.addForm.amount.split('.')
this.addForm.amount =Math.round(this.addForm.amount*100)/100 if(pointArr.length>1&&pointArr[1]){
} this.addForm.amount =Math.round(this.addForm.amount*100)/100
}
}
} }
this.$set(this.addForm, 'writeOffAmount', NP.times(this.addForm.rate || 0, this.addForm.amount || 0)) this.$set(this.addForm, 'writeOffAmount', NP.times(this.addForm.rate || 0, this.addForm.amount || 0))
}, },
...@@ -1099,7 +1101,7 @@ export default { ...@@ -1099,7 +1101,7 @@ export default {
// else if (this.showCurrencyId === 3 && val === 2) rate = this.NANtoRMB() // else if (this.showCurrencyId === 3 && val === 2) rate = this.NANtoRMB()
// else if (this.showCurrencyId === 2 && val === 1) rate = this.UStoNAN() // else if (this.showCurrencyId === 2 && val === 1) rate = this.UStoNAN()
// else if (this.showCurrencyId === 2 && val === 3) rate = this.RMBtoNAN() // else if (this.showCurrencyId === 2 && val === 3) rate = this.RMBtoNAN()
rate = this.getRate() rate = this.getRate(val,this.showCurrencyId)
} }
this.$set(this.addForm, 'rate', rate) this.$set(this.addForm, 'rate', rate)
}, },
...@@ -1107,7 +1109,7 @@ export default { ...@@ -1107,7 +1109,7 @@ export default {
getRate(sourceCurrencyId,targetCurrencyId){ getRate(sourceCurrencyId,targetCurrencyId){
var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId)) var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId))
if(rate) return rate.currencyRate if(rate) return rate.currencyRate
return 1 return ''
}, },
getList() { getList() {
getReceivableItem({ id: this.id }).then(res => { getReceivableItem({ id: this.id }).then(res => {
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
<el-date-picker clearable v-model="queryParams.endCreateTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" type="datetime" :placeholder="$t('请选择结束日期')" /> <el-date-picker clearable v-model="queryParams.endCreateTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" type="datetime" :placeholder="$t('请选择结束日期')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('始发仓')" prop="destinationId"> <el-form-item :label="$t('始发仓')" prop="destinationId">
<el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable> <el-select v-model="queryParams.originId" :placeholder="$t('请选择始发仓')" clearable>
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')" prop="destinationId"> <el-form-item :label="$t('目的仓')" prop="destinationId">
<el-select v-model="queryParams.pdaDestWareIds" multiple :placeholder="$t('请选择目的仓')" clearable> <el-select v-model="queryParams.destinationId" multiple :placeholder="$t('请选择目的仓')" clearable>
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option> <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :clearable="true" v-model="queryParams.transportId" /> <dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :clearable="true" v-model="queryParams.transportId" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单状态')" prop="status"> <el-form-item :label="$t('订单状态')" prop="status">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" <dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.orderStatus"
@keyup.enter.native="handleQuery" clearable /> @keyup.enter.native="handleQuery" clearable />
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('跟进客服')" prop="destinationId"> <!-- <el-form-item :label="$t('跟进客服')" prop="destinationId">
...@@ -109,10 +109,26 @@ ...@@ -109,10 +109,26 @@
<!-- 操作工具栏 --> <!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="12"> <el-col :span="4">
<el-button type="primary" size="mini" @click="exportSearch" v-hasPermi="['ecw:exception:export']">导出</el-button> <el-button type="primary" size="mini" @click="exportSearch" v-hasPermi="['ecw:exception:export']">导出</el-button>
</el-col> </el-col>
<el-col :span="12"><right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar></el-col> <el-col :span="16">
<el-descriptions :column="4">
<el-descriptions-item :label="$t('箱数')">
{{totalData.totalNum||'/'}}
</el-descriptions-item>
<el-descriptions-item :label="$t('测量方数汇总')">
{{totalData.totalVolume||'/'}}
</el-descriptions-item>
<el-descriptions-item :label="$t('收费方数汇总')">
{{totalData.totalChargeVolume||'/'}}
</el-descriptions-item>
<el-descriptions-item :label="$t('重量汇总')">
{{totalData.totalWeight||'/'}}
</el-descriptions-item>
</el-descriptions>
</el-col>
<el-col :span="4"><right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar></el-col>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
...@@ -181,7 +197,8 @@ ...@@ -181,7 +197,8 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('异常类型')" align="center"> <el-table-column :label="$t('异常类型')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.ORDER_ERROR_TYPE" :value="scope.row.orderExceptionType" /> <span v-if="scope.row.moreException">{{$t('多个异常')}}</span>
<dict-tag v-else :type="DICT_TYPE.ORDER_ERROR_TYPE" :value="scope.row.orderExceptionType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" align="center"> <el-table-column :label="$t('操作')" align="center">
...@@ -215,7 +232,7 @@ ...@@ -215,7 +232,7 @@
</template> </template>
<script> <script>
import {getExceptionPage,getOrderExceptionPage, exportExcel} from "@/api/ecw/orderException" import {getOrderExceptionPage, exportExcel,getStatistics} from "@/api/ecw/orderException"
import {getTradeCityList} from '@/api/ecw/region' import {getTradeCityList} from '@/api/ecw/region'
import {DICT_TYPE} from '@/utils/dict' import {DICT_TYPE} from '@/utils/dict'
// import { userList } from "@/api/system/user" // import { userList } from "@/api/system/user"
...@@ -248,6 +265,7 @@ export default { ...@@ -248,6 +265,7 @@ export default {
}, },
tradeCityList:[], tradeCityList:[],
warehouseList:[], warehouseList:[],
totalData:{}
}; };
}, },
activated(){ activated(){
...@@ -292,6 +310,7 @@ export default { ...@@ -292,6 +310,7 @@ export default {
this.loading = false; this.loading = false;
// this.reset() // this.reset()
}); });
getStatistics(params).then(res=>this.totalData = res.data)
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment