|
@@ -70,7 +70,7 @@
|
|
|
icon="el-icon-delete"
|
|
|
size="small"
|
|
|
@click.stop="rowDel(scope.row,scope.index)"
|
|
|
- :disabled="scope.row.status > 0 || scope.row.createFreight == 1"
|
|
|
+ :disabled="scope.row.item.length == 0 || scope.row.createFreight == 1"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -122,6 +122,8 @@
|
|
|
:checkData="financeData"
|
|
|
:arrList="applyPaymentList"
|
|
|
@choceFun="choceFun"
|
|
|
+ tradeType="GN"
|
|
|
+ @submit="feeSubmit"
|
|
|
>
|
|
|
</financial-account>
|
|
|
</el-dialog>
|
|
@@ -402,10 +404,8 @@ export default {
|
|
|
done()
|
|
|
},
|
|
|
searchReset() {
|
|
|
- console.log('1')
|
|
|
},
|
|
|
selectionChange(list) {
|
|
|
- console.log(list)
|
|
|
this.selection = []
|
|
|
this.selection = list;
|
|
|
this.single = list.length !== 1;
|
|
@@ -516,29 +516,60 @@ export default {
|
|
|
let a = []
|
|
|
this.selection.forEach(item => {
|
|
|
item.itemsList = item.itemsList? item.itemsList: [];
|
|
|
- item.itemsList.forEach(e => {
|
|
|
- let form = {
|
|
|
- srcOrderno:item.orderNo,
|
|
|
- itemType:"采购",
|
|
|
- optionType:"GN",
|
|
|
- corpsName: [{cname: item.strCorpName, id: item.id}],
|
|
|
- corpId:item.corpId,
|
|
|
- srcParentId: item.id,
|
|
|
- currency: 'CNY',
|
|
|
- exchangeRate: '1',
|
|
|
- taxRate: '0',
|
|
|
- accDate: item.businesDate,
|
|
|
- srcType: 1,
|
|
|
- tradeType: 'GN',
|
|
|
- costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
|
|
|
- goodName: e.goodsName,
|
|
|
- price: e.price,
|
|
|
- quantity: e.orderQuantity,
|
|
|
- unit: e.unit,
|
|
|
- amount: e.amount,
|
|
|
+ let amount = Number(item.debitAmount) - Number(item.settlmentAmount);
|
|
|
+ let quantity = 0;
|
|
|
+ item.itemsList.map(e => {
|
|
|
+ if (e.submitPay != 1) {
|
|
|
+ // amount += Number(e.amount)
|
|
|
+ quantity += Number(e.orderQuantity)
|
|
|
}
|
|
|
- a.push(form)
|
|
|
})
|
|
|
+ const price = quantity === 0? 0: Number(amount) / Number(quantity)
|
|
|
+ let form = {
|
|
|
+ belongCompany: item.belongCompany,
|
|
|
+ srcOrderno:item.orderNo,
|
|
|
+ itemType:"采购",
|
|
|
+ corpsName:[{cname: item.strCorpName, id: item.id}],
|
|
|
+ corpId:item.corpId,
|
|
|
+ srcParentId: item.id,
|
|
|
+ currency: 'CNY',
|
|
|
+ exchangeRate: '1',
|
|
|
+ taxRate: '0',
|
|
|
+ accDate: item.businesDate,
|
|
|
+ srcType: 1,
|
|
|
+ tradeType: 'GN',
|
|
|
+ optionType: 'GN',
|
|
|
+ costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
|
|
|
+ amount,
|
|
|
+ quantity,
|
|
|
+ price,
|
|
|
+ unit: '条',
|
|
|
+ remarks: item.orderRemark,
|
|
|
+ }
|
|
|
+ a.push(form)
|
|
|
+ // item.itemsList.forEach(e => {
|
|
|
+ // let form = {
|
|
|
+ // srcOrderno:item.orderNo,
|
|
|
+ // itemType:"采购",
|
|
|
+ // optionType:"GN",
|
|
|
+ // corpsName: [{cname: item.strCorpName, id: item.id}],
|
|
|
+ // corpId:item.corpId,
|
|
|
+ // srcParentId: item.id,
|
|
|
+ // currency: 'CNY',
|
|
|
+ // exchangeRate: '1',
|
|
|
+ // taxRate: '0',
|
|
|
+ // accDate: item.businesDate,
|
|
|
+ // srcType: 1,
|
|
|
+ // tradeType: 'GN',
|
|
|
+ // costType: this.feesOption.find(e => e.cname == '货款')? this.feesOption.find(e => e.cname == '货款').id: null,
|
|
|
+ // goodName: e.goodsName,
|
|
|
+ // price: e.price,
|
|
|
+ // quantity: e.orderQuantity,
|
|
|
+ // unit: e.unit,
|
|
|
+ // amount: e.amount,
|
|
|
+ // }
|
|
|
+ // a.push(form)
|
|
|
+ // })
|
|
|
})
|
|
|
this.applyPaymentList = [...a]
|
|
|
// this.beforeBillData(true);
|
|
@@ -553,6 +584,9 @@ export default {
|
|
|
choceFun(){
|
|
|
this.financialAccountDialog = false
|
|
|
},
|
|
|
+ feeSubmit() {
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ },
|
|
|
// 生成工厂发货
|
|
|
createPlant(row, index) {
|
|
|
let ids = [];
|