Commit 9393ed70 authored by 我在何方's avatar 我在何方

收款单2.2

parent b1565943
......@@ -6,7 +6,7 @@ VUE_APP_TITLE = 捷道管理系统-测试站
# 捷道管理系统/开发环境
VUE_APP_BASE_API = 'https://api.sit.jdshangmen.com'
VUE_APP_BASE_API = 'https://api.jd.jdshangmen.com'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......
......@@ -696,11 +696,12 @@ import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { listSimpleDepts } from "@/api/system/dept";
import { getChannelList } from "@/api/ecw/channel";
import { getTradeCityList } from "@/api/ecw/region";
import { createReceipt,getFirstReceivableListByOrderId, getReceivableList, getReceivableInfoByIds, getReceiptInfoByIds, getReceiptAccountList, getInvoicingItem, updateReceipt, updateReceivableDiscountById, getReceivableDiscountLogById } from "@/api/ecw/financial";
import { createReceipt,getFirstReceivableListByOrderId, getReceivableList, getReceivableItemDetail, getReceiptInfoByIds, getReceiptAccountList, getInvoicingItem, updateReceipt, updateReceivableDiscountById, getReceivableDiscountLogById } from "@/api/ecw/financial";
import {getCustomer} from '@/api/ecw/customer'
import NP from 'number-precision'
import {getOrder} from '@/api/ecw/order'
import { getCurrencyPage } from "@/api/ecw/currency";
import { getExchangeRatePage } from "@/api/ecw/exchangeRate";
import ret from "bluebird/js/release/util";
import dayjs from "dayjs";
import { getUserProfile } from "@/api/system/user";
......@@ -736,7 +737,7 @@ export default {
bankData: [],
params: {
page: 1,
rows: 20,
rows: 100,
},
deptData: [],
deptArr: [],
......@@ -767,7 +768,9 @@ export default {
pageSize: 100
},
pages:1
pages:1,
rateList:[],
orderNo:null
};
},
activated(){
......@@ -777,7 +780,9 @@ export default {
this.getReceivableData()
}
if (this.$route.query.receiptId && this.$route.query.receiptId != 0) {
this.receiptId = this.$route.query.receiptId;
this.orderNo = this.$route.query.orderNo||'';
this.getReceivableInfo()
}else{
this.removeData()
......@@ -812,6 +817,7 @@ export default {
})
// 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list)
getWarehouseList().then(res => this.warehouseList = res.data)
let that = this;
if (that.$route.query.orderId) {
......@@ -836,6 +842,7 @@ export default {
}
if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') {
this.receiptId = this.$route.query.receiptId;
this.orderNo = this.$route.query.orderNo||'';
this.getReceivableInfo()
}
......@@ -973,8 +980,8 @@ export default {
})
},
getReceivableInfo(){
getReceivableInfoByIds({ id: this.receiptId }).then(res => {
this.list = [{...res.data}]
getReceivableItemDetail({ id: this.receiptId,orderNo:this.orderNo }).then(res => {
this.list = res.data
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
......@@ -1008,11 +1015,18 @@ export default {
// if (row.currencyId == 3 && val == 2) row.collectionRate = this.RMBtoNAN()
// if (row.currencyId == 2 && val == 1) row.collectionRate = this.NANtoUS()
// if (row.currencyId == 2 && val == 3) row.collectionRate = this.NANtoRMB()
row.collectionRate = NP.times(this.currencyList.find(v => v.id === row.currencyId).huilv/100, this.currencyList.find(v => v.id === val).exchangeToFc/100).toFixed(6)
// row.collectionRate = NP.times(this.currencyList.find(v => v.id === row.currencyId).huilv/100, this.currencyList.find(v => v.id === val).exchangeToFc/100).toFixed(6)
row.collectionRate = this.getRate(row.currencyId,val)
}
this.rateChange(row, index)
},
//获取汇率
getRate(sourceCurrencyId,targetCurrencyId){
var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId))
if(rate) return rate.currencyRate
return 1
},
writeOffRateChange(row, index) {
row.writeOffAmount = Math.round(NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal)))
......@@ -1095,7 +1109,7 @@ export default {
discountTotal: discountDollar,
currencyId: item.id,
receivableAmount: Math.round(dollar),
writeOffRate: item.id==this.showCurrencyId?1: NP.times(this.currencyList.find(v => v.id === item.id).huilv/100, this.currencyList.find(v => v.id === this.showCurrencyId).exchangeToFc/100).toFixed(6),
writeOffRate: item.id==this.showCurrencyId?1: this.getRate(item.id,this.showCurrencyId),
platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: item.id,
collectionRate: 1
......
......@@ -497,13 +497,39 @@ export default {
},
activated(){
console.log(11)
// this.getList();
if (this.$route.query.payableId && this.$route.query.payableId != 0) {
this.payableId = this.$route.query.payableId;
getPayableInfoByIds({ id: this.payableId }).then(res => {
this.handleSelectionChange([res.data])
this.list = this.multipleSelection
this.$set(this.form, 'supplierId', res.data.supplierId)
this.selectChange(this.form.supplierId)
})
}
if (that.$route.query.id && that.$route.query.id !== '0') {
this.id = this.$route.query.id;
getPaymentInfoByIds({ id: this.id }).then(res => {
this.form = {
...res.data,
latestPayAt: this.parseTime(res.data.latestPayAt, '{y}-{m}-{d}'),
applicationAt: this.parseTime(res.data.applicationAt, '{y}-{m}-{d}'),
invoiceStatus: String(res.data.invoiceStatus),
}
this.$set(this.form,'supplierBankAccount',res.data.supplierBankAccount)
console.log(this.form)
})
getPaymentItem({ id: this.id }).then(res => {
this.list = [...res.data]
this.defaultList = [...res.data]
})
}
},
async created() {
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
getWarehouseList().then(res => this.warehouseList = res.data)
let that = this;
if (that.$route.query.payableId && that.$route.query.payableId !== '0') {
if (that.$route.query.payableId && that.$route.query.payableId != 0) {
this.payableId = this.$route.query.payableId;
getPayableInfoByIds({ id: this.payableId }).then(res => {
this.handleSelectionChange([res.data])
......
......@@ -312,7 +312,7 @@
</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- <div style="margin: 20px 0;font-size:16px">备注:收款单已全部核销,总金额差值小于5$,允许全部核销,核销比例应为100%</div> -->
<div style="margin: 20px 0;font-size:16px" v-if="form.finaceRemark">{{form.finaceRemark}}</div>
<div slot="footer" style="margin: 20px 0">
<el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="toEdit" v-hasPermi="['ecw:payment:detail:edit']">{{ $t('编辑') }}</el-button>
<el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="verificationAll" v-hasPermi="['ecw:payment:detail:allWriteOff']">{{ $t('全部核销') }}</el-button>
......@@ -542,6 +542,7 @@ import { getBankAccountPage } from "@/api/ecw/bankAccount";
import { getToken } from "@/utils/auth";
import { listSimpleDepts } from "@/api/system/dept";
import { getCustomer } from '@/api/ecw/customer'
import { getExchangeRatePage } from "@/api/ecw/exchangeRate";
import {
getReceiptInfoByIds,
......@@ -618,7 +619,8 @@ export default {
detailShow:false,
detailIndex:1,
wiffShow:false,
wiffRemark:''
wiffRemark:'',
rateList:[]
}
},
computed: {
......@@ -698,6 +700,7 @@ export default {
async created() {
// 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
await getExchangeRatePage(this.params).then(res => this.rateList = res.data.list)
await listSimpleDepts().then((res) => {
res.data.forEach((item) => {
if (item.parentId == 0) {
......@@ -1077,10 +1080,16 @@ export default {
// 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 === 3) rate = this.RMBtoNAN()
rate = NP.times(this.currencyList.find(v => v.id === val).huilv/100, this.currencyList.find(v => v.id === this.showCurrencyId).exchangeToFc/100).toFixed(6)
rate = this.getRate()
}
this.$set(this.addForm, 'rate', rate)
},
//获取汇率
getRate(sourceCurrencyId,targetCurrencyId){
var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId))
if(rate) return rate.currencyRate
return 1
},
getList() {
getReceivableItem({ id: this.id }).then(res => {
this.detailed = res.data.map(v => ({
......
......@@ -233,7 +233,7 @@
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button size="mini" type="text" v-hasPermi="['ecw:receivable:collection']" @click="handleAdd(scope.row.id)" >{{ $t('收款') }}</el-button>
<el-button size="mini" type="text" v-hasPermi="['ecw:receivable:collection']" @click="handleAdd(scope.row)" >{{ $t('收款') }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -350,8 +350,8 @@ export default {
this.getList();
},
/** 新增按钮操作 */
handleAdd(id) {
return this.$router.push("creatCollection?receiptId=" + id);
handleAdd(row) {
return this.$router.push("creatCollection?receiptId=" + row.id+'&orderNo='+row.orderNo);
},
submitForm() {},
},
......
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