批量开票、批量来款
This commit is contained in:
@@ -87,7 +87,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
<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>
|
<a @click="invoicing(record)" :disabled="record.needInvoice === 0">开票</a>
|
||||||
</span>
|
</span>
|
||||||
</a-table>
|
</a-table>
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
ref="arriveStage"
|
ref="arriveStage"
|
||||||
@ok="modalFormOk"
|
@ok="modalFormOk"
|
||||||
:project-id="selectProjectId"
|
:project-id="selectProjectId"
|
||||||
|
:project-type="selectProjectType"
|
||||||
:visible.sync="arriveVisible"></arrive-stage-module>
|
:visible.sync="arriveVisible"></arrive-stage-module>
|
||||||
|
|
||||||
<!-- 开票阶段-->
|
<!-- 开票阶段-->
|
||||||
@@ -115,6 +116,7 @@
|
|||||||
:selected-data="selectedProject"
|
:selected-data="selectedProject"
|
||||||
:selected-company="selectedCompany"
|
:selected-company="selectedCompany"
|
||||||
is-financial
|
is-financial
|
||||||
|
@ok="modalFormOk"
|
||||||
:visible.sync="batchInvoicingVisible">
|
:visible.sync="batchInvoicingVisible">
|
||||||
</batch-invoicing-module>
|
</batch-invoicing-module>
|
||||||
|
|
||||||
@@ -263,10 +265,11 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 来款
|
* 来款
|
||||||
* @param id
|
* @param record
|
||||||
*/
|
*/
|
||||||
incomePayment(id) {
|
incomePayment(record) {
|
||||||
this.selectProjectId = id
|
this.selectProjectType = record.projectType
|
||||||
|
this.selectProjectId = record.id
|
||||||
this.arriveVisible = true
|
this.arriveVisible = true
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -329,7 +332,6 @@ export default {
|
|||||||
id: arr[0].chargeCompanyId,
|
id: arr[0].chargeCompanyId,
|
||||||
companyName: arr[0].chargeCompanyTemporaryName
|
companyName: arr[0].chargeCompanyTemporaryName
|
||||||
}
|
}
|
||||||
console.log(this.selectedCompany)
|
|
||||||
}
|
}
|
||||||
// 来款
|
// 来款
|
||||||
if (operateType === 'incomePayment') {
|
if (operateType === 'incomePayment') {
|
||||||
|
|||||||
@@ -59,6 +59,12 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: null
|
default: null
|
||||||
|
},
|
||||||
|
// 项目类型
|
||||||
|
projectType: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -106,15 +112,17 @@ export default {
|
|||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
values.projectId = this.projectId
|
values.projectId = this.projectId
|
||||||
const formData = Object.assign(this.model, values)
|
values.projectType = this.projectType
|
||||||
console.log('表单提交数据', formData)
|
const obj = Object.assign(this.model, values)
|
||||||
let okHttpMethod
|
let okHttpMethod
|
||||||
if (this.model.id) {
|
if (this.model.id) {
|
||||||
okHttpMethod = editAmountPhase
|
okHttpMethod = editAmountPhase(obj)
|
||||||
} else {
|
} else {
|
||||||
okHttpMethod = addPaymentPhase
|
let arr = []
|
||||||
|
arr.push(obj)
|
||||||
|
okHttpMethod = addPaymentPhase(arr)
|
||||||
}
|
}
|
||||||
okHttpMethod(formData).then(res => {
|
okHttpMethod.then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
this.$emit('ok')
|
this.$emit('ok')
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<a-button type="primary" @click="handleAdd" v-preventclick>添加阶段</a-button>
|
<a-button type="primary" @click="handleAdd" v-preventclick>添加阶段</a-button>
|
||||||
</template>
|
</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>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,9 @@
|
|||||||
class="j-table-force-nowrap">
|
class="j-table-force-nowrap">
|
||||||
|
|
||||||
<!-- 输入-->
|
<!-- 输入-->
|
||||||
<template slot="input-text">
|
<template slot="input-text" slot-scope="text, record">
|
||||||
<a-input placeholder="请输入备注"
|
<a-input placeholder="请输入备注"
|
||||||
v-decorator="['remark']"
|
v-model="record.remark"
|
||||||
:maxLength='50'
|
:maxLength='50'
|
||||||
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
</template>
|
</template>
|
||||||
@@ -71,6 +71,7 @@
|
|||||||
import JDate from '../../../components/tools/JDate'
|
import JDate from '../../../components/tools/JDate'
|
||||||
import { money } from '../../../utils/validate'
|
import { money } from '../../../utils/validate'
|
||||||
import { addZero } from '../../../utils/util'
|
import { addZero } from '../../../utils/util'
|
||||||
|
import { addPaymentPhase } from '../../../api/incomePaymentsApi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BatchIncomePaymentModule',
|
name: 'BatchIncomePaymentModule',
|
||||||
@@ -193,7 +194,33 @@ export default {
|
|||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
handleOk() {
|
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() {
|
handleCancel() {
|
||||||
this.close()
|
this.close()
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ import { addZero } from '../../../utils/util'
|
|||||||
import { addPayBill } from '../../../api/incomePaymentsApi'
|
import { addPayBill } from '../../../api/incomePaymentsApi'
|
||||||
import SelectContacts from '../../../components/company/SelectContacts'
|
import SelectContacts from '../../../components/company/SelectContacts'
|
||||||
import { getContactsById } from '../../../api/api'
|
import { getContactsById } from '../../../api/api'
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BatchInvoicingModule',
|
name: 'BatchInvoicingModule',
|
||||||
@@ -266,6 +267,20 @@ export default {
|
|||||||
this.clearThisTimeAmount()
|
this.clearThisTimeAmount()
|
||||||
this.calculateThisTimeAmount()
|
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>}
|
* @returns {Promise<unknown>}
|
||||||
@@ -301,15 +316,6 @@ export default {
|
|||||||
this.$set(this.dataSource, index, item)
|
this.$set(this.dataSource, index, item)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 获取联系人信息
|
|
||||||
* @param value
|
|
||||||
*/
|
|
||||||
postContactChange(value) {
|
|
||||||
getContactsById({id: value}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleOk() {
|
handleOk() {
|
||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
@@ -326,7 +332,6 @@ export default {
|
|||||||
})
|
})
|
||||||
let param = values
|
let param = values
|
||||||
param.bmpList = bmpList
|
param.bmpList = bmpList
|
||||||
console.log(param)
|
|
||||||
addPayBill(param).then(res => {
|
addPayBill(param).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
@@ -343,12 +348,14 @@ export default {
|
|||||||
this.close()
|
this.close()
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
|
console.log(this.selectedData)
|
||||||
this.dataSource = this.selectedData
|
this.dataSource = this.selectedData
|
||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.form.resetFields()
|
this.form.resetFields()
|
||||||
this.clearThisTimeAmount()
|
this.clearThisTimeAmount()
|
||||||
|
this.dataSource = []
|
||||||
this.$emit('update:visible', false)
|
this.$emit('update:visible', false)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -312,7 +312,6 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
callback()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
callback()
|
callback()
|
||||||
@@ -331,6 +330,7 @@ export default {
|
|||||||
}
|
}
|
||||||
callback('请输入正确格式的金额')
|
callback('请输入正确格式的金额')
|
||||||
}
|
}
|
||||||
|
callback()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user