|
@@ -586,7 +586,7 @@ export default {
|
|
{ title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
|
|
{ title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
|
|
|
|
|
|
{ title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
|
|
{ title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
|
|
- { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
|
|
|
|
|
|
+ // { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
@@ -761,62 +761,63 @@ export default {
|
|
this.$refs.linkBillList.title = '请选择采购订单'
|
|
this.$refs.linkBillList.title = '请选择采购订单'
|
|
},
|
|
},
|
|
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId, accountId) {
|
|
linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId, accountId) {
|
|
- // let that = this
|
|
|
|
- // this.rowCanEdit = false
|
|
|
|
- // this.materialTable.columns[1].type = FormTypes.normal
|
|
|
|
|
|
+ let that = this
|
|
|
|
+ this.rowCanEdit = false
|
|
// this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
|
|
// this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
|
|
// this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
|
|
// this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
|
|
- // if (selectBillDetailRows && selectBillDetailRows.length > 0) {
|
|
|
|
- // let listEx = []
|
|
|
|
- // let allTaxLastMoney = 0
|
|
|
|
- // for (let j = 0; j < selectBillDetailRows.length; j++) {
|
|
|
|
- // let info = selectBillDetailRows[j]
|
|
|
|
- // if (info.finishNumber > 0) {
|
|
|
|
- // info.operNumber = info.preNumber - info.finishNumber
|
|
|
|
- // info.allPrice = info.operNumber * info.unitPrice - 0
|
|
|
|
- // let taxRate = info.taxRate - 0
|
|
|
|
- // info.taxMoney = ((info.allPrice * taxRate) / 100).toFixed(2) - 0
|
|
|
|
- // info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2) - 0
|
|
|
|
- // }
|
|
|
|
- // info.linkId = info.id
|
|
|
|
- // allTaxLastMoney += info.taxLastMoney
|
|
|
|
- // listEx.push(info)
|
|
|
|
- // this.changeColumnShow(info)
|
|
|
|
- // }
|
|
|
|
- // this.materialTable.dataSource = listEx
|
|
|
|
|
|
+ console.log('selectBillDetailRows', selectBillDetailRows)
|
|
|
|
+ if (selectBillDetailRows && selectBillDetailRows.length > 0) {
|
|
|
|
+ let listEx = []
|
|
|
|
+ let allTaxLastMoney = 0
|
|
|
|
+ for (let j = 0; j < selectBillDetailRows.length; j++) {
|
|
|
|
+ let info = selectBillDetailRows[j]
|
|
|
|
+ if (info.finishNumber > 0) {
|
|
|
|
+ info.operNumber = info.preNumber - info.finishNumber
|
|
|
|
+ info.allPrice = info.operNumber * info.unitPrice - 0
|
|
|
|
+ let taxRate = info.taxRate - 0
|
|
|
|
+ info.taxMoney = ((info.allPrice * taxRate) / 100).toFixed(2) - 0
|
|
|
|
+ info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2) - 0
|
|
|
|
+ }
|
|
|
|
+ info.linkId = info.id
|
|
|
|
+ allTaxLastMoney += info.taxLastMoney
|
|
|
|
+ listEx.push(info)
|
|
|
|
+ this.changeColumnShow(info)
|
|
|
|
+ }
|
|
|
|
+ this.materialTable.dataSource = listEx
|
|
|
|
|
|
- // ///给优惠后金额重新赋值
|
|
|
|
- // allTaxLastMoney = allTaxLastMoney ? allTaxLastMoney : 0
|
|
|
|
- // let discount = 0
|
|
|
|
- // if (allTaxLastMoney !== 0) {
|
|
|
|
- // discount = ((discountMoney / allTaxLastMoney) * 100).toFixed(2) - 0
|
|
|
|
- // }
|
|
|
|
- // let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
|
|
|
|
- // let changeAmount = discountLastMoney
|
|
|
|
- // if (deposit) {
|
|
|
|
- // this.depositStatus = true
|
|
|
|
- // changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
|
|
|
|
- // }
|
|
|
|
- // this.$nextTick(() => {
|
|
|
|
- // this.form.setFieldsValue({
|
|
|
|
- // organId: organId,
|
|
|
|
- // linkNumber: linkNumber,
|
|
|
|
- // discount: discount,
|
|
|
|
- // discountMoney: discountMoney,
|
|
|
|
- // discountLastMoney: discountLastMoney,
|
|
|
|
- // deposit: deposit,
|
|
|
|
- // changeAmount: changeAmount,
|
|
|
|
- // accountId: accountId,
|
|
|
|
- // remark: remark,
|
|
|
|
- // })
|
|
|
|
- // })
|
|
|
|
- // //判断后进行仓库的切换
|
|
|
|
- // if (depotId) {
|
|
|
|
- // setTimeout(function () {
|
|
|
|
- // that.batchSetDepotModalFormOk(depotId)
|
|
|
|
- // }, 1000)
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
|
|
+ ///给优惠后金额重新赋值
|
|
|
|
+ allTaxLastMoney = allTaxLastMoney ? allTaxLastMoney : 0
|
|
|
|
+ let discount = 0
|
|
|
|
+ if (allTaxLastMoney !== 0) {
|
|
|
|
+ discount = ((discountMoney / allTaxLastMoney) * 100).toFixed(2) - 0
|
|
|
|
+ }
|
|
|
|
+ let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
|
|
|
|
+ let changeAmount = discountLastMoney
|
|
|
|
+ if (deposit) {
|
|
|
|
+ this.depositStatus = true
|
|
|
|
+ changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
|
|
|
|
+ }
|
|
|
|
+ this.form.setFieldsValue({
|
|
|
|
+ organId: organId,
|
|
|
|
+ linkNumber: linkNumber,
|
|
|
|
+ discount: discount,
|
|
|
|
+ discountMoney: discountMoney,
|
|
|
|
+ discountLastMoney: discountLastMoney,
|
|
|
|
+ deposit: deposit,
|
|
|
|
+ changeAmount: changeAmount,
|
|
|
|
+ accountId: accountId,
|
|
|
|
+ remark: remark,
|
|
|
|
+ depotId: depotId,
|
|
|
|
+ })
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ console.log('discount===',this.form.getFieldValue('discount'))
|
|
|
|
+ this.getTatRate(organId)
|
|
|
|
+ })
|
|
|
|
+ //判断后进行仓库的切换
|
|
|
|
+ if (depotId) {
|
|
|
|
+ this.changeDepot(depotId, this.refKeys[0])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
getUnitInfo(val) {
|
|
getUnitInfo(val) {
|
|
this.unitList = val
|
|
this.unitList = val
|