bug修改

This commit is contained in:
zhaoxiao
2021-09-27 16:36:00 +08:00
parent 267804b4c2
commit f6b0bb93bb
11 changed files with 167 additions and 50 deletions
@@ -46,10 +46,10 @@
class="j-table-force-nowrap">
<!-- 输入-->
<template slot="input-text" slot-scope="text, record">
<template slot="input-text" slot-scope="text, record, index">
<a-input placeholder="请输入备注"
v-model="record.remark"
:maxLength='50'
v-model="remarkList[index]"
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</template>
@@ -81,7 +81,9 @@ export default {
tableData: {
type: Array,
required: false,
default: []
default: () => {
return []
}
},
visible: {
type: Boolean,
@@ -168,6 +170,7 @@ export default {
}
],
dataSource: [],
remarkList: [], // 备注列表
inputIncomingAmount: null, // 输入的来款金额
disableMixinCreated: true,
sumAmountOwed: 0 // 总欠款金额
@@ -197,14 +200,14 @@ export default {
this.form.validateFields((err, values) => {
if (!err) {
let formData = []
this.dataSource.forEach(item => {
this.dataSource.forEach((item, index) => {
if (Number(item.thisIncomingAmount) > 0) {
let obj = {
amountReceived: item.thisIncomingAmount,
paymentDate: values.paymentDate,
projectId: item.id,
projectType: item.projectType,
remark: item.remark
remark: this.remarkList[index]
}
formData.push(obj)
}
@@ -227,13 +230,14 @@ export default {
},
open() {
this.dataSource = this.tableData
this.dataSource.forEach(item => {
item.remark = null
this.dataSource.forEach(() => {
this.remarkList.push('')
})
this.loadData()
},
close() {
this.form.resetFields()
this.remarkList = []
this.clearThisTimeAmount()
this.$emit('update:visible', false)
},
@@ -85,10 +85,10 @@
</template>
<!-- 输入-->
<template slot="input-text" slot-scope="text, record">
<template slot="input-text" slot-scope="text, record, index">
<a-input placeholder="请输入备注"
v-model="record.remark"
:maxLength='50'
v-model="remarkList[index]"
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</template>
@@ -146,6 +146,11 @@ export default {
if (value) {
this.open()
}
},
packContactId(value) {
if (value) {
this.postContactChange(value)
}
}
},
data() {
@@ -209,6 +214,7 @@ export default {
}
],
dataSource: [],
remarkList: [], // 备注列表
validatorRules: {
invoiceAmount: {
rules: [{ required: true, validator: this.checkMoney }],
@@ -236,7 +242,8 @@ export default {
}
},
inputInvoicingAmount: null, // 输入的开票金额
sumAmountOwed: 0 // 总未开票金额
sumAmountOwed: 0, // 总未开票金额,
packContact: {}, // 邮寄联系人信息
}
},
methods: {
@@ -290,7 +297,12 @@ export default {
postalCode: res.result.postalCode,
contactAddress: res.result.contactAddress
}
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
if (this.packContactId) {
this.packContact = obj
this.packContact.contactId = value
} else {
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
}
})
},
/**
@@ -333,16 +345,19 @@ export default {
if (!err) {
let bmpList = []
let data = this.dataSource.filter(tt => tt.thisInvoicingAmount !== 0 && tt.thisInvoicingAmount)
data.forEach(item => {
data.forEach((item, index) => {
let obj = {
invoiceAmount: item.thisInvoicingAmount,
projectId: item.id,
projectType: item.projectType,
remark: item.remark
remark: this.remarkList[index]
}
bmpList.push(obj)
})
let param = values
if (this.packContactId) {
param = Object.assign(param, this.packContact)
}
param.bmpList = bmpList
addPayBill(param).then(res => {
if (res.success) {
@@ -360,10 +375,9 @@ export default {
this.close()
},
open() {
console.log(this.selectedData)
this.dataSource = this.selectedData
this.dataSource.forEach(item => {
item.remark = null
this.dataSource.forEach(() => {
this.remarkList.push('')
})
this.loadData()
},