Commit 42a7ed14 authored by 我在何方's avatar 我在何方

拆单合单bug修复

parent 754f3373
...@@ -133,17 +133,17 @@ ...@@ -133,17 +133,17 @@
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" v-hasPermi="['ecw:verification:update']" @click="handleAdd(scope.row.id)" type="text">{{ $t('编辑') }}</el-button> <el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" @click="handleAdd(scope.row.id)" type="text">{{ $t('编辑') }}</el-button>
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" v-hasPermi="['ecw:verification:update']" type="text" @click="examineClick(scope.row.id)">{{ $t('审核') }}</el-button> <el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" v-hasPermi="['ecw:payment:update']" type="text" @click="examineClick(scope.row.id)">{{ $t('审核') }}</el-button>
<el-button v-if="scope.row.state == 2" size="mini" type="text" v-hasPermi="['ecw:verification:update']" @click="verifyCancelClick(scope.row)">{{ $t('反审核') }}</el-button> <el-button v-if="scope.row.state == 2" size="mini" type="text" v-hasPermi="['ecw:payment:update']" @click="verifyCancelClick(scope.row)">{{ $t('反审核') }}</el-button>
<el-button v-if="scope.row.state == 2" size="mini" type="text" v-hasPermi="['ecw:verification:update']" @click="verificationClick(scope.row)">{{ $t('核销') }}</el-button> <el-button v-if="scope.row.state == 2" size="mini" type="text" v-hasPermi="['ecw:payment:update']" @click="verificationClick(scope.row)">{{ $t('核销') }}</el-button>
<el-button v-if="scope.row.state == 4" size="mini" type="text" v-hasPermi="['ecw:verification:update']" @click="verificationCancelClick(scope.row)">{{ $t('反核销') }}</el-button> <el-button v-if="scope.row.state == 4" size="mini" type="text" v-hasPermi="['ecw:payment:update']" @click="verificationCancelClick(scope.row)">{{ $t('反核销') }}</el-button>
<!-- <el-button v-if="scope.row.state == 3" size="mini" type="text">开票</el-button> --> <!-- <el-button v-if="scope.row.state == 3" size="mini" type="text">开票</el-button> -->
<el-button size="mini" type="text" @click="toprint(scope.row.id)" v-hasPermi="['ecw:verification:query']">{{ $t('打印') }}</el-button> <el-button size="mini" type="text" @click="toprint(scope.row.id)" v-hasPermi="['ecw:payment:query']">{{ $t('打印') }}</el-button>
<el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" type="text" v-hasPermi="['ecw:verification:delete']" @click="deleteClick(scope.row)">{{ $t('删除') }}</el-button> <el-button v-if="scope.row.state == 1 || scope.row.state == 3" size="mini" type="text" v-hasPermi="['ecw:payment:delete']" @click="deleteClick(scope.row)">{{ $t('删除') }}</el-button>
<!-- <el-button size="mini" type="text" @click="open = true">导出订单</el-button> --> <!-- <el-button size="mini" type="text" @click="open = true">导出订单</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<el-table-column :label="$t('总金额')" align="center" prop="totalAmount"> <el-table-column :label="$t('总金额')" align="center" prop="totalAmount">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.totalAmount }}</span> <span>{{ scope.row.totalAmount }}</span>
< {{getCurrencyLabel(scope.row.currencyId)}} {{getCurrencyLabel(scope.row.currencyId)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('优惠金额')" align="center"> <el-table-column :label="$t('优惠金额')" align="center">
...@@ -176,9 +176,10 @@ ...@@ -176,9 +176,10 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span> <span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else> <div v-else>
<div v-if="scope.row.collectionAmount[0]">{{ $t('美元') }}: {{ scope.row.collectionAmount[0] }}</div> <div v-for="itemAmount in scope.row.collectionAmount">{{itemAmount.currencyName}}: {{ itemAmount.amount}}</div>
<!-- <div v-if="scope.row.collectionAmount[0]">{{ $t('美元') }}: {{ scope.row.collectionAmount[0] }}</div>
<div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1] }}</div> <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1] }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2] }}</div> <div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2] }}</div> -->
</div> </div>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> --> <!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template> </template>
...@@ -575,43 +576,59 @@ export default { ...@@ -575,43 +576,59 @@ export default {
res.data = [...res.data, { res.data = [...res.data, {
type: 'total', type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0), writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: [0, 0, 0] collectionAmount: []
}] }]
} }
this.$set(this.form, 'receiptAccountList', [...res.data])
// 收款总计 // 收款总计
const dollarList = res.data.filter(v => v.collectionCurrencyId == 1) // const dollarList = res.data.filter(v => v.collectionCurrencyId == 1)
const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0) // const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const rmbList = res.data.filter(v => v.collectionCurrencyId == 3) // const rmbList = res.data.filter(v => v.collectionCurrencyId == 3)
const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0) // const rmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
const nairaList = res.data.filter(v => v.collectionCurrencyId == 2) // const nairaList = res.data.filter(v => v.collectionCurrencyId == 2)
const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0) // const naira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira] // res.data[res.data.length -1].collectionAmount = [dollar, rmb, naira]
// this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList]) // this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
const dollarListByList = this.list.filter(v => v.currencyId === 1) // const dollarListByList = this.list.filter(v => v.currencyId === 1)
const discountDollar = dollarListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0) // const discountDollar = dollarListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const d = res.data.find(v => v.currencyId == 1) // const d = res.data.find(v => v.currencyId == 1)
d && (d.discountTotal = discountDollar) // d && (d.discountTotal = discountDollar)
// const rmbListByList = this.list.filter(v => v.currencyId === 3)
// const discountRmb = rmbListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const r = res.data.find(v => v.currencyId == 3)
// r && (r.discountTotal = discountRmb)
const rmbListByList = this.list.filter(v => v.currencyId === 3)
const discountRmb = rmbListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const r = res.data.find(v => v.currencyId == 3)
r && (r.discountTotal = discountRmb)
const nairaListByList = this.list.filter(v => v.currencyId === 2)
const discountNaira = nairaListByList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
const n = res.data.find(v => v.currencyId == 2)
n && (n.discountTotal = discountNaira)
this.$set(this.form, 'receiptAccountList', [...res.data]) // 收款总计
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 && (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(6)
amountList.push({currencyName:item.titleZh,amount:dollar})
}
})
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
this.$nextTick(() => { this.$nextTick(() => {
// this.form.receiptAccountList.forEach((item, index) => { this.form.receiptAccountList.forEach((item, index) => {
// this.rateChange(item, index) this.rateChange(item, index)
// }); });
}) })
}) })
} }
...@@ -619,6 +636,11 @@ export default { ...@@ -619,6 +636,11 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
rateChange(row, index) {
console.log(row)
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(6))
this.form.receiptAccountList[index] = {...row}
},
setWriteOffAmount() { setWriteOffAmount() {
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))
}, },
...@@ -715,7 +737,7 @@ export default { ...@@ -715,7 +737,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 = NP.divide(this.currencyList.find(v => v.id === this.showCurrencyId).huilv, this.currencyList.find(v => v.id === val).huilv).toFixed(6) rate = NP.divide(this.currencyList.find(v => v.id === val).huilv, this.currencyList.find(v => v.id === this.showCurrencyId).huilv).toFixed(6)
} }
this.$set(this.addForm, 'rate', rate) this.$set(this.addForm, 'rate', rate)
}, },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<el-button size="mini" type="primary" @click="$router.push('edit?id=' + offerId)">{{$t('编辑')}}</el-button> <el-button size="mini" type="primary" @click="$router.push('edit?id=' + offerId)">{{$t('编辑')}}</el-button>
<el-button type="primary" v-if="[1,3,7].indexOf(list.status) > -1" size="mini" @click="handleAdd">{{$t('跟进')}}</el-button> <el-button type="primary" v-if="[1,3,7].indexOf(list.status) > -1" size="mini" @click="handleAdd">{{$t('跟进')}}</el-button>
<el-button type="primary" v-if="[3,7].indexOf(list.status) > -1" size="mini" @click="toResult">{{$t('结果')}}</el-button> <el-button type="primary" v-if="[3,7].indexOf(list.status) > -1" size="mini" @click="toResult">{{$t('结果')}}</el-button>
<el-button size="mini" v-if="[1,3,7].indexOf(list.status) > -1" type="primary" @click="$router.push('/offer/special/' + offerId)">{{$t('特价')}}</el-button> <el-button size="mini" v-if="[1,3,7].indexOf(list.status) > -1" type="primary" @click.native="$router.push('/offer/special?offerId=' + offerId)" >{{$t('特价')}}</el-button>
<el-button type="danger" size="mini" @click="handleDelete">{{$t('删除')}}</el-button> <el-button type="danger" size="mini" @click="handleDelete">{{$t('删除')}}</el-button>
</div> </div>
</div> </div>
......
...@@ -276,7 +276,7 @@ export default { ...@@ -276,7 +276,7 @@ export default {
}, },
submitForm(){ submitForm(){
let that = this let that = this
if(!that.orderNos){ if(!that.orderNos||that.orderNos.length==0){
that.$message.error(this.$t("请选择待合单的订单")); that.$message.error(this.$t("请选择待合单的订单"));
return return
} }
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
</el-row> </el-row>
<el-row v-if="scope.row.warehouseInInfoVO"> <el-row v-if="scope.row.warehouseInInfoVO">
<span>{{$t('品牌')}} <span>{{$t('品牌')}}
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.brandType" /> <dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</span> </span>
<span style="margin-left: 10px;">{{$t('箱数')}}{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span> <span style="margin-left: 10px;">{{$t('箱数')}}{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span>
<span style="margin-left: 10px;">{{$t('体积')}}{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}</span> <span style="margin-left: 10px;">{{$t('体积')}}{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}</span>
...@@ -189,23 +189,20 @@ ...@@ -189,23 +189,20 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('新建拆单')" :visible.sync="open" width="400px" append-to-body> <el-dialog :title="$t('新建拆单')" :visible.sync="open" width="400px" append-to-body>
<el-form ref="formSplit" :model="form" :rules="rules" label-width="80px"> <el-form ref="formSplit" :model="form" :rules="rules" label-width="80px">
<el-row> <el-form-item :label="$t('运输方式')">
<el-form-item :label="$t('运输方式')+':'"> <dict-selector :clearable="true" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" @change="changeTransport" v-model="form.transportId" />
<dict-selector :clearable="true" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model="form.transportId" formatter="number"/>
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('目的仓库')+':'" >
<el-select v-model="form.destWarehouseId" :placeholder="$t('请选择目的仓库')" clearable>
<el-option v-for="item in importCityList" :label="item.titleZh" :value="item.id" :key="item.id" ></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'" > <el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'">
<el-select v-model="form.channelId" :placeholder="$t('请选择出货渠道')" clearable> <el-select v-model="form.channelId" :placeholder="$t('请选择出货渠道')" :clearable="true">
<el-option :disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'" v-for="item in channelData" :key="item.channelId" :label="item.nameZh" :value="item.channelId"/> <el-option :disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'" v-for="item in channelData" :key="item.channelId" :label="$l(item, 'name')" :value="item.channelId"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row>
<el-form-item :label="$t('目的仓库')" >
<el-select v-model="form.destWarehouseId" @change="changeDeatWarehouseId" :placeholder="$t('请选择目的仓库')" :clearable="true">
<el-option v-for="items in importCityList" :label="$l(items, 'title')" :value="items.id" :key="items.id" ></el-option>
</el-select>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -373,6 +370,16 @@ export default { ...@@ -373,6 +370,16 @@ export default {
} }
return data return data
}, },
changeTransport(e){
this.$set(this.form,'transportId',e)
console.log(this.form.transportId)
this.$forceUpdate()
},
changeDeatWarehouseId(e){
this.$forceUpdate()
this.$set(this.form,'destWarehouseId',e)
console.log(this.form.destWarehouseId)
},
getOrder(){ getOrder(){
this.loading = true; this.loading = true;
getOrder(this.queryParams.orderId).then(response => { getOrder(this.queryParams.orderId).then(response => {
......
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