Commit 54da4be6 authored by houjn@hikoon.cn's avatar houjn@hikoon.cn
parents f96792c4 f20a0cee
......@@ -48,6 +48,7 @@ export function exportProductPriceExcel(query) {
return request({
url: '/ecw/product-price/export-excel',
method: 'get',
timeout: 3*60*1000,
params: query,
responseType: 'blob'
})
......
......@@ -516,6 +516,7 @@ export default {
},
WriteOffProportion(){
let total = 0
if(!this.form.receiptAccountList) return 0
let amountTotal = this.form.receiptAccountList.find(item=>item.type=='total').writeOffAmount
this.detailed.forEach(item => {
......@@ -609,23 +610,23 @@ export default {
var n
// 收款总计
var amountList =[]
this.currencyList.forEach((item,index)=>{
var nairaListByList = this.list.filter(v => v.currencyId === item.id)
if(nairaListByList.length>0){
var discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
var n = res.data.find(v => v.currencyId == item.id)
n = res.data.find(v => v.currencyId == item.id)
n && (n.discountTotal = discountNaira)
}
var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){
var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0).toFixed(2)
if(n.discountTotal&&n.discountTotal>0){
amountList.push({currencyName:item.titleZh,amount:(dollar-n.discountTotal).toFixed(2)})
if(n && n.discountTotal&&n.discountTotal>0){
amountList.push({currencyName:item.titleZh, currencyId: item.id, amount:(dollar-n.discountTotal).toFixed(2)})
}else{
amountList.push({currencyName:item.titleZh,amount:dollar})
amountList.push({currencyName:item.titleZh, currencyId: item.id, amount:dollar})
}
}
......@@ -910,6 +911,8 @@ export default {
},
handleAddReceiptItem() {
this.surplusData = []
// 已收
let recepted = []
this.detailed.forEach(item => {
......@@ -918,13 +921,19 @@ export default {
}else recepted[item.currencyId] = NP.plus(recepted[item.currencyId], item.amount)
})
console.log('rece',recepted)
// 应收
let collom = []
this.form.receiptAccountList.forEach(item => {
/* this.form.receiptAccountList.forEach(item => {
if(item.type!='total'){
if(!collom[item.currencyId]){
collom[item.currencyId] = item.receivableAmount-item.discountTotal
}else collom[item.currencyId] = NP.plus(collom[item.currencyId], item.receivableAmount)
}
}) */
// 从期望收费金额中提取应收币种和金额
this.form.receiptAccountList.find(item => item.type == 'total').collectionAmount.forEach(item => {
collom[item.currencyId] = item.amount
})
console.log('collom',collom)
// if(recepted.length>collom.length){
......
......@@ -498,6 +498,8 @@ export default {
this.form.material = this.warehousing.material
if (this.warehousing.brand && this.warehousing.brand !== 0){
this.form.brand = this.warehousing.brand.toString() || ''
} else {
this.form.brand = ''
}
this.handleBrandChange(this.form.brand)
getWarehouseLastUpdateApprovalInfo({
......
......@@ -77,6 +77,9 @@
<el-button v-if="!$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="batchBlock" :disabled="multiple">{{$t('批量加入黑名单')}}</el-button>
<el-button v-if="!$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="batchOff" :disabled="multiple">{{$t('批量下架')}}</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" >{{$t('导出')}}</el-button>
</el-col>
<!--指定商品-->
<el-button v-if="$route.query.product_id" type="primary" plain icon="el-icon-setting" size="mini" @click="batchSetSingleProductPrice">{{$t('批量设置单个商品的路线')}}</el-button>
</el-col>
......@@ -711,14 +714,16 @@ export default {
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm(this.$t('是否确认导出所有产品价格数据项?')).then(() => {
// c
this.$modal.confirm(this.$t('是否确认导出所有数据项?')).then(() => {
this.exportLoading = true;
return exportProductPriceExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.$download.excel(response, '路线价格.xlsx');
this.exportLoading = false;
}).catch(() => {});
}).catch(() => {
this.exportLoading = false;
});
},
// 表格多选
handleSelectionChange(selection) {
......
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