批量开票、批量来款
This commit is contained in:
@@ -46,9 +46,9 @@
|
||||
class="j-table-force-nowrap">
|
||||
|
||||
<!-- 输入-->
|
||||
<template slot="input-text">
|
||||
<template slot="input-text" slot-scope="text, record">
|
||||
<a-input placeholder="请输入备注"
|
||||
v-decorator="['remark']"
|
||||
v-model="record.remark"
|
||||
:maxLength='50'
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||
</template>
|
||||
@@ -71,6 +71,7 @@
|
||||
import JDate from '../../../components/tools/JDate'
|
||||
import { money } from '../../../utils/validate'
|
||||
import { addZero } from '../../../utils/util'
|
||||
import { addPaymentPhase } from '../../../api/incomePaymentsApi'
|
||||
|
||||
export default {
|
||||
name: 'BatchIncomePaymentModule',
|
||||
@@ -193,7 +194,33 @@ export default {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
handleOk() {
|
||||
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
let formData = []
|
||||
this.dataSource.forEach(item => {
|
||||
if (Number(item.thisIncomingAmount) > 0) {
|
||||
let obj = {
|
||||
amountReceived: item.thisIncomingAmount,
|
||||
paymentDate: values.paymentDate,
|
||||
projectId: item.id,
|
||||
projectType: item.projectType,
|
||||
remark: item.remark
|
||||
}
|
||||
formData.push(obj)
|
||||
}
|
||||
})
|
||||
console.log(formData)
|
||||
addPaymentPhase(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.$emit('ok')
|
||||
this.close()
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
|
||||
@@ -109,6 +109,7 @@ import { addZero } from '../../../utils/util'
|
||||
import { addPayBill } from '../../../api/incomePaymentsApi'
|
||||
import SelectContacts from '../../../components/company/SelectContacts'
|
||||
import { getContactsById } from '../../../api/api'
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
export default {
|
||||
name: 'BatchInvoicingModule',
|
||||
@@ -266,6 +267,20 @@ export default {
|
||||
this.clearThisTimeAmount()
|
||||
this.calculateThisTimeAmount()
|
||||
},
|
||||
/**
|
||||
* 邮寄联系人变化
|
||||
* @param value
|
||||
*/
|
||||
postContactChange(value) {
|
||||
console.log(value)
|
||||
getContactsById({ id: value }).then(res => {
|
||||
let obj = {
|
||||
postalCode: res.result.postalCode,
|
||||
contactAddress: res.result.contactAddress
|
||||
}
|
||||
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 清空本次开票金额
|
||||
* @returns {Promise<unknown>}
|
||||
@@ -301,15 +316,6 @@ export default {
|
||||
this.$set(this.dataSource, index, item)
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取联系人信息
|
||||
* @param value
|
||||
*/
|
||||
postContactChange(value) {
|
||||
getContactsById({id: value}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
handleOk() {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
@@ -326,7 +332,6 @@ export default {
|
||||
})
|
||||
let param = values
|
||||
param.bmpList = bmpList
|
||||
console.log(param)
|
||||
addPayBill(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
@@ -343,12 +348,14 @@ export default {
|
||||
this.close()
|
||||
},
|
||||
open() {
|
||||
console.log(this.selectedData)
|
||||
this.dataSource = this.selectedData
|
||||
this.loadData()
|
||||
},
|
||||
close() {
|
||||
this.form.resetFields()
|
||||
this.clearThisTimeAmount()
|
||||
this.dataSource = []
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user