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