批量开票、批量来款
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
</template>
|
||||
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<a @click="incomePayment(record.id)">来款</a>
|
||||
<a @click="incomePayment(record)">来款</a>
|
||||
<a @click="invoicing(record)" :disabled="record.needInvoice === 0">开票</a>
|
||||
</span>
|
||||
</a-table>
|
||||
@@ -98,6 +98,7 @@
|
||||
ref="arriveStage"
|
||||
@ok="modalFormOk"
|
||||
:project-id="selectProjectId"
|
||||
:project-type="selectProjectType"
|
||||
:visible.sync="arriveVisible"></arrive-stage-module>
|
||||
|
||||
<!-- 开票阶段-->
|
||||
@@ -115,6 +116,7 @@
|
||||
:selected-data="selectedProject"
|
||||
:selected-company="selectedCompany"
|
||||
is-financial
|
||||
@ok="modalFormOk"
|
||||
:visible.sync="batchInvoicingVisible">
|
||||
</batch-invoicing-module>
|
||||
|
||||
@@ -263,10 +265,11 @@ export default {
|
||||
methods: {
|
||||
/**
|
||||
* 来款
|
||||
* @param id
|
||||
* @param record
|
||||
*/
|
||||
incomePayment(id) {
|
||||
this.selectProjectId = id
|
||||
incomePayment(record) {
|
||||
this.selectProjectType = record.projectType
|
||||
this.selectProjectId = record.id
|
||||
this.arriveVisible = true
|
||||
},
|
||||
/**
|
||||
@@ -329,7 +332,6 @@ export default {
|
||||
id: arr[0].chargeCompanyId,
|
||||
companyName: arr[0].chargeCompanyTemporaryName
|
||||
}
|
||||
console.log(this.selectedCompany)
|
||||
}
|
||||
// 来款
|
||||
if (operateType === 'incomePayment') {
|
||||
|
||||
@@ -59,6 +59,12 @@ export default {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
// 项目类型
|
||||
projectType: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -106,15 +112,17 @@ export default {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
values.projectId = this.projectId
|
||||
const formData = Object.assign(this.model, values)
|
||||
console.log('表单提交数据', formData)
|
||||
values.projectType = this.projectType
|
||||
const obj = Object.assign(this.model, values)
|
||||
let okHttpMethod
|
||||
if (this.model.id) {
|
||||
okHttpMethod = editAmountPhase
|
||||
okHttpMethod = editAmountPhase(obj)
|
||||
} else {
|
||||
okHttpMethod = addPaymentPhase
|
||||
let arr = []
|
||||
arr.push(obj)
|
||||
okHttpMethod = addPaymentPhase(arr)
|
||||
}
|
||||
okHttpMethod(formData).then(res => {
|
||||
okHttpMethod.then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.$emit('ok')
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<a-button type="primary" @click="handleAdd" v-preventclick>添加阶段</a-button>
|
||||
</template>
|
||||
|
||||
<arrive-module ref="arriveModal" :project-id="projectId" @ok="addArriveOk"></arrive-module>
|
||||
<arrive-module ref="arriveModal" :project-id="projectId" @ok="addArriveOk" v-bind="$attrs"></arrive-module>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -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)
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -312,7 +312,6 @@ export default {
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
callback()
|
||||
return
|
||||
}
|
||||
callback()
|
||||
@@ -331,6 +330,7 @@ export default {
|
||||
}
|
||||
callback('请输入正确格式的金额')
|
||||
}
|
||||
callback()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user