普通项目;工作组变更--文件维护接口;批量开票
This commit is contained in:
@@ -37,7 +37,8 @@ const amountReceivedList = (param) => postAction(`/paymentRecord/payPaymentRecor
|
|||||||
// 开票列表
|
// 开票列表
|
||||||
const payBillList = (param) => postAction(`/paymentRecord/payPaymentRecord/payBillList?id=${param}`)
|
const payBillList = (param) => postAction(`/paymentRecord/payPaymentRecord/payBillList?id=${param}`)
|
||||||
// 新增开票阶段
|
// 新增开票阶段
|
||||||
const addPayBill = (projectId, projectType, param) => postAction(`/paymentRecord/payPaymentRecord/addPayBill?projectIds=${projectId}&projectTypes=${projectType}`, param)
|
// const addPayBill = (projectId, projectType, invoiceAmounts, param) => postAction(`/paymentRecord/payPaymentRecord/addPayBill?projectIds=${projectId}&projectTypes=${projectType}&invoiceAmounts=${invoiceAmounts}`, param)
|
||||||
|
const addPayBill = (param) => postAction(`/paymentRecord/payPaymentRecord/addPayBill`, param)
|
||||||
// 编辑开票阶段
|
// 编辑开票阶段
|
||||||
const editPayBill = (param) => postAction('/paymentRecord/payPaymentRecord/editPayBill', param)
|
const editPayBill = (param) => postAction('/paymentRecord/payPaymentRecord/editPayBill', param)
|
||||||
// 普通项目管理-通过项目id查询其他的信息
|
// 普通项目管理-通过项目id查询其他的信息
|
||||||
@@ -52,6 +53,12 @@ const removePackProject = (param) => postAction('/pack/payPackCompanyProject/rem
|
|||||||
const batchRemovePackProject = (param) => postAction('/pack/payPackCompanyProject/removeBatch', param)
|
const batchRemovePackProject = (param) => postAction('/pack/payPackCompanyProject/removeBatch', param)
|
||||||
// 企业管理审核
|
// 企业管理审核
|
||||||
const aduitCompany = (param) => getAction('/company/payCompanyManagement/audit', param)
|
const aduitCompany = (param) => getAction('/company/payCompanyManagement/audit', param)
|
||||||
|
// 资料分发
|
||||||
|
const distribute = (param) => postAction('/project/payWorkingGroupDistributionRecord/add', param)
|
||||||
|
// 资料批量分发
|
||||||
|
const batchDistribute = (param) => postAction('/project/payWorkingGroupDistributionRecord/addBatch', param)
|
||||||
|
// 资料分发成员列表
|
||||||
|
const distributeMemberList = (param) => getAction('/project/payWorkingGroupDistributionRecord/list', param)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getWorkingGroupById,
|
getWorkingGroupById,
|
||||||
@@ -79,5 +86,8 @@ export {
|
|||||||
addPackProject,
|
addPackProject,
|
||||||
removePackProject,
|
removePackProject,
|
||||||
batchRemovePackProject,
|
batchRemovePackProject,
|
||||||
aduitCompany
|
aduitCompany,
|
||||||
|
distribute,
|
||||||
|
batchDistribute,
|
||||||
|
distributeMemberList
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 下拉框的搜索
|
// 下拉框的搜索
|
||||||
filterOption(input, option) {
|
filterOption(input, option) {
|
||||||
|
console.log(option)
|
||||||
return (
|
return (
|
||||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -565,6 +565,7 @@ export function removeArrayElement(array, prod, value) {
|
|||||||
array.splice(index, 1)
|
array.splice(index, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 前端加密方法
|
* 前端加密方法
|
||||||
* @param publicKey:公钥
|
* @param publicKey:公钥
|
||||||
@@ -576,6 +577,7 @@ export function encrypt(publicKey, message) {
|
|||||||
const txt = encrypt.encrypt(message)
|
const txt = encrypt.encrypt(message)
|
||||||
return txt
|
return txt
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验数组是否有重复的元素
|
* 校验数组是否有重复的元素
|
||||||
* */
|
* */
|
||||||
@@ -590,6 +592,7 @@ export function isRepeat(arr) {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补充0
|
* 补充0
|
||||||
* */
|
* */
|
||||||
@@ -624,3 +627,18 @@ export function addZero(e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数组内元素是否完全一致
|
||||||
|
* @param array
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
export function isAllEqual(array) {
|
||||||
|
if (array.length > 0) {
|
||||||
|
return !array.some(item => {
|
||||||
|
return item !== array[0]
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
<!-- 操作按钮区域-->
|
<!-- 操作按钮区域-->
|
||||||
<div class="table-operator">
|
<div class="table-operator">
|
||||||
<a-button type="primary" icon="export" @click="handleExportXls('到账开票')">导出</a-button>
|
<a-button type="primary" icon="export" @click="handleExportXls('到账开票')">导出</a-button>
|
||||||
|
<a-button type="primary" icon="file-text" @click="batchInvoicing">合并开票</a-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 操作按钮区域-end-->
|
<!-- 操作按钮区域-end-->
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@
|
|||||||
|
|
||||||
<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.id)">来款</a>
|
||||||
<a @click="invoicing(record)">开票</a>
|
<a @click="invoicing(record)" :disabled="record.needInvoice === 0">开票</a>
|
||||||
</span>
|
</span>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
@@ -108,6 +109,11 @@
|
|||||||
:visible.sync="invoicingVisible"
|
:visible.sync="invoicingVisible"
|
||||||
:charge-company-name="selectProjectChargeCompanyName"></invoicing-stage-module>
|
:charge-company-name="selectProjectChargeCompanyName"></invoicing-stage-module>
|
||||||
<project-detail-modal ref="projectDetail"></project-detail-modal>
|
<project-detail-modal ref="projectDetail"></project-detail-modal>
|
||||||
|
<!-- 批量开票-->
|
||||||
|
<batch-invoicing-module
|
||||||
|
:selected-data="selectedProject"
|
||||||
|
:visible.sync="batchInvoicingVisible">
|
||||||
|
</batch-invoicing-module>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -121,6 +127,8 @@ import ArriveStageModule from './modules/ArriveStageModule'
|
|||||||
import InvoicingStageModule from './modules/InvoicingStageModule'
|
import InvoicingStageModule from './modules/InvoicingStageModule'
|
||||||
import SelectPrincipal from '../../../components/company/SelectPrincipal'
|
import SelectPrincipal from '../../../components/company/SelectPrincipal'
|
||||||
import ProjectDetailModal from '../../../components/ProjectDetailModal'
|
import ProjectDetailModal from '../../../components/ProjectDetailModal'
|
||||||
|
import BatchInvoicingModule from '../../packManagement/modules/BatchInvoicingModule'
|
||||||
|
import { isAllEqual } from '../../../utils/util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ArriveAndInvoivingList',
|
name: 'ArriveAndInvoivingList',
|
||||||
@@ -131,7 +139,8 @@ export default {
|
|||||||
ArriveStageModule,
|
ArriveStageModule,
|
||||||
InvoicingStageModule,
|
InvoicingStageModule,
|
||||||
SelectPrincipal,
|
SelectPrincipal,
|
||||||
ProjectDetailModal
|
ProjectDetailModal,
|
||||||
|
BatchInvoicingModule
|
||||||
},
|
},
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
data() {
|
data() {
|
||||||
@@ -237,7 +246,9 @@ export default {
|
|||||||
selectProjectName: null, // 选中项目名称open
|
selectProjectName: null, // 选中项目名称open
|
||||||
selectProjectChargeCompanyName: null, // 选中项目来款企业
|
selectProjectChargeCompanyName: null, // 选中项目来款企业
|
||||||
invoicingVisible: false,
|
invoicingVisible: false,
|
||||||
arriveVisible: false
|
arriveVisible: false,
|
||||||
|
selectedProject: [],
|
||||||
|
batchInvoicingVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -260,6 +271,61 @@ export default {
|
|||||||
this.selectProjectName = record.chargeProject
|
this.selectProjectName = record.chargeProject
|
||||||
this.selectProjectChargeCompanyName = record.chargeCompanyTemporaryName
|
this.selectProjectChargeCompanyName = record.chargeCompanyTemporaryName
|
||||||
this.invoicingVisible = true
|
this.invoicingVisible = true
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 批量开票
|
||||||
|
*/
|
||||||
|
batchInvoicing() {
|
||||||
|
this.selectedProject = []
|
||||||
|
if (this.selectedRowKeys.length === 0) {
|
||||||
|
this.$message.warn('请选择至少一个项目')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.getProjectListBySelectedKeys(this.selectedRowKeys, 'invoic').then(res => {
|
||||||
|
this.selectedProject = res
|
||||||
|
this.batchInvoicingVisible = true
|
||||||
|
}).catch((message) => {
|
||||||
|
this.$message.warn(message)
|
||||||
|
}).finally(() => {
|
||||||
|
this.onClearSelected()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 通过选中项目id获取数据,并进行相应提示
|
||||||
|
* @param selectedKeys
|
||||||
|
* @param operateType
|
||||||
|
* @returns {Promise<unknown>}
|
||||||
|
*/
|
||||||
|
getProjectListBySelectedKeys(selectedKeys, operateType) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let arr = []
|
||||||
|
// 获取选中的数据
|
||||||
|
arr = this.dataSource.filter(tt => selectedKeys.indexOf(tt.id) > -1)
|
||||||
|
// 开票
|
||||||
|
if (operateType === 'invoic') {
|
||||||
|
// 是否存在不需要发票的项目
|
||||||
|
if (arr.some(item => item.needInvoice === 0 || Number(item.receivableAmount) === 0)){
|
||||||
|
reject('存在不需要发票的项目!')
|
||||||
|
}
|
||||||
|
// 是否存在企业不同的项目
|
||||||
|
let companyArr = []
|
||||||
|
arr.forEach(item => {
|
||||||
|
companyArr.push(item.chargeCompanyTemporaryName)
|
||||||
|
})
|
||||||
|
// 选中项目非同一企业
|
||||||
|
if (!isAllEqual(companyArr)) {
|
||||||
|
reject('请选择来款单位为同一企业的项目合并开票')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 来款
|
||||||
|
if (operateType === 'incomePayment') {
|
||||||
|
// 是否存在应收金额为0的项目
|
||||||
|
if (arr.some(item => Number(item.receivableAmount) === 0)) {
|
||||||
|
reject('存在应收金额为0的项目!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resolve(arr)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ export default {
|
|||||||
dataSource: [],
|
dataSource: [],
|
||||||
inputIncomingAmount: null, // 输入的来款金额
|
inputIncomingAmount: null, // 输入的来款金额
|
||||||
disableMixinCreated: true,
|
disableMixinCreated: true,
|
||||||
sumAmountOwed: 0, // 总欠款金额
|
sumAmountOwed: 0 // 总欠款金额
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -203,6 +203,7 @@ export default {
|
|||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
|
this.form.resetFields()
|
||||||
this.clearThisTimeAmount()
|
this.clearThisTimeAmount()
|
||||||
this.$emit('update:visible', false)
|
this.$emit('update:visible', false)
|
||||||
},
|
},
|
||||||
@@ -218,22 +219,17 @@ export default {
|
|||||||
this.$message.warn('来款金额大于总欠款金额,请修改')
|
this.$message.warn('来款金额大于总欠款金额,请修改')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.clearThisTimeAmount().then(() => {
|
this.clearThisTimeAmount()
|
||||||
this.calculateThisTimeAmount()
|
this.calculateThisTimeAmount()
|
||||||
this.$forceUpdate()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 清空本次来款金额
|
* 清空本次来款金额
|
||||||
* @returns {Promise<unknown>}
|
* @returns {Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
clearThisTimeAmount() {
|
clearThisTimeAmount() {
|
||||||
return new Promise(resolve => {
|
|
||||||
this.dataSource.forEach(item => {
|
this.dataSource.forEach(item => {
|
||||||
item.thisIncomingAmount = 0.00
|
item.thisIncomingAmount = 0.00
|
||||||
})
|
})
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 计算此次来款信息
|
* 计算此次来款信息
|
||||||
@@ -243,23 +239,22 @@ export default {
|
|||||||
this.$message.warn('请输入大于0的来款金额')
|
this.$message.warn('请输入大于0的来款金额')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dataSource.forEach(item => {
|
this.dataSource.forEach((item, index) => {
|
||||||
// 当前项目欠款是否 >0
|
// 当前项目欠款是否 >0
|
||||||
if (Number(item.amountOwed) > 0) {
|
if (Number(item.amountOwed) > 0) {
|
||||||
// 输入的来款金额是否 >= 当前项目欠款
|
// 输入的来款金额是否 >= 当前项目欠款
|
||||||
if (this.inputIncomingAmount >= Number(item.amountOwed)) {
|
if (this.inputIncomingAmount >= Number(item.amountOwed)) {
|
||||||
item.thisIncomingAmount = this.getAddZero(Number(item.amountOwed))
|
item.thisIncomingAmount = this.getAddZero(Number(item.amountOwed))
|
||||||
this.inputIncomingAmount -= Number(item.amountOwed)
|
this.inputIncomingAmount -= Number(item.amountOwed)
|
||||||
// item.amountOwed = 0
|
|
||||||
} else {
|
} else {
|
||||||
// 输入的来款金额小于当前项目欠款且剩余的输入来款金额大于0,则将剩余全部来款算入当前项目的此次来款
|
// 输入的来款金额小于当前项目欠款且剩余的输入来款金额大于0,则将剩余全部来款算入当前项目的此次来款
|
||||||
if (this.inputIncomingAmount > 0) {
|
if (this.inputIncomingAmount > 0) {
|
||||||
item.thisIncomingAmount = this.getAddZero(this.inputIncomingAmount)
|
item.thisIncomingAmount = this.getAddZero(this.inputIncomingAmount)
|
||||||
// item.amountOwed = Number(item.amountOwed) - item.thisIncomingAmount
|
|
||||||
this.inputIncomingAmount = 0
|
this.inputIncomingAmount = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.$set(this.dataSource, index, item)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<a-col :xl="12" :sm="24">
|
<a-col :xl="12" :sm="24">
|
||||||
<a-form-item label="开票金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="开票金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-input placeholder="请输入开票金额"
|
<a-input placeholder="请输入开票金额"
|
||||||
v-decorator="['invoicingAmount',validatorRules.invoicingAmount]"
|
v-decorator="['invoiceAmount',validatorRules.invoiceAmount]"
|
||||||
:maxLength='50'
|
:maxLength='50'
|
||||||
@blur="invoicingAmountBlur"
|
@blur="invoicingAmountBlur"
|
||||||
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<a-col :xl="12" :sm="24">
|
<a-col :xl="12" :sm="24">
|
||||||
<a-form-item label="开票号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="开票号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-input placeholder="请输入开票号"
|
<a-input placeholder="请输入开票号"
|
||||||
v-decorator="['invoicingNum', validatorRules.invoicingNum]"
|
v-decorator="['billNo', validatorRules.billNo]"
|
||||||
: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>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<a-form-item label="开票时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="开票时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<j-date placeholder="请选择开票时间"
|
<j-date placeholder="请选择开票时间"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
v-decorator="['invoicingTime', validatorRules.invoicingTime]"
|
v-decorator="['billDate', validatorRules.billDate]"
|
||||||
:trigger-change="true"
|
:trigger-change="true"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
date-format="YYYY-MM-DD"/>
|
date-format="YYYY-MM-DD"/>
|
||||||
@@ -56,9 +56,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 输入-->
|
<!-- 输入-->
|
||||||
<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>
|
||||||
@@ -77,6 +77,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 { addPayBill } from '../../../api/incomePaymentsApi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BatchInvoicingModule',
|
name: 'BatchInvoicingModule',
|
||||||
@@ -148,7 +149,7 @@ export default {
|
|||||||
title: '已开票金额',
|
title: '已开票金额',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex: 'paidAmount'
|
dataIndex: 'invoiceAmount'
|
||||||
}, {
|
}, {
|
||||||
title: '本次开票金额',
|
title: '本次开票金额',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -164,7 +165,7 @@ export default {
|
|||||||
],
|
],
|
||||||
dataSource: [],
|
dataSource: [],
|
||||||
validatorRules: {
|
validatorRules: {
|
||||||
invoicingAmount: {
|
invoiceAmount: {
|
||||||
rules: [{ required: true, validator: this.checkMoney }],
|
rules: [{ required: true, validator: this.checkMoney }],
|
||||||
validateTrigger: 'blur'
|
validateTrigger: 'blur'
|
||||||
},
|
},
|
||||||
@@ -172,7 +173,7 @@ export default {
|
|||||||
rules: [{ required: true, message: '请输入开票号' }],
|
rules: [{ required: true, message: '请输入开票号' }],
|
||||||
validateTrigger: 'blur'
|
validateTrigger: 'blur'
|
||||||
},
|
},
|
||||||
invoicingTime: {
|
billDate: {
|
||||||
rules: [{ required: true, message: '请选择开票时间' }],
|
rules: [{ required: true, message: '请选择开票时间' }],
|
||||||
validateTrigger: 'blur'
|
validateTrigger: 'blur'
|
||||||
}
|
}
|
||||||
@@ -198,10 +199,11 @@ export default {
|
|||||||
return e.target.value
|
return e.target.value
|
||||||
},
|
},
|
||||||
loadData() {
|
loadData() {
|
||||||
// 计算项目欠款信息
|
// 计算项目未开票金额信息
|
||||||
this.dataSource.forEach(item => {
|
this.dataSource.forEach(item => {
|
||||||
let amountOwed = Number(item.receivableAmount) - Number(item.paidAmount)
|
let amountOwed = Number(item.receivableAmount) - Number(item.invoiceAmount)
|
||||||
item.amountOwed = this.getAddZero(amountOwed)
|
item.amountOwed = this.getAddZero(amountOwed)
|
||||||
|
item.thisInvoicingAmount = 0
|
||||||
this.sumAmountOwed += Number(item.amountOwed)
|
this.sumAmountOwed += Number(item.amountOwed)
|
||||||
})
|
})
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
@@ -217,52 +219,72 @@ export default {
|
|||||||
this.$message.warn('开票金额大于总未开票金额,请修改')
|
this.$message.warn('开票金额大于总未开票金额,请修改')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.clearThisTimeAmount().then(() => {
|
this.clearThisTimeAmount()
|
||||||
this.calculateThisTimeAmount()
|
this.calculateThisTimeAmount()
|
||||||
this.$forceUpdate()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 清空本次来款金额
|
* 清空本次开票金额
|
||||||
* @returns {Promise<unknown>}
|
* @returns {Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
clearThisTimeAmount() {
|
clearThisTimeAmount() {
|
||||||
return new Promise(resolve => {
|
|
||||||
this.dataSource.forEach(item => {
|
this.dataSource.forEach(item => {
|
||||||
item.thisInvoicingAmount = null
|
item.thisInvoicingAmount = 0
|
||||||
})
|
|
||||||
resolve()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 计算此次来款信息
|
* 计算此次开票信息
|
||||||
*/
|
*/
|
||||||
calculateThisTimeAmount() {
|
calculateThisTimeAmount() {
|
||||||
if (this.inputInvoicingAmount <= 0) {
|
if (this.inputInvoicingAmount <= 0) {
|
||||||
this.$message.warn('请输入大于0的来款金额')
|
this.$message.warn('请输入大于0的开票金额')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dataSource.forEach(item => {
|
this.dataSource.forEach((item, index) => {
|
||||||
// 当前项目欠款是否 >0
|
// 当前项目欠款是否 >0
|
||||||
if (Number(item.amountOwed) > 0) {
|
if (Number(item.amountOwed) > 0) {
|
||||||
// 输入的来款金额是否 >= 当前项目欠款
|
// 输入的开票金额是否 >= 当前项目欠款
|
||||||
if (this.inputInvoicingAmount >= Number(item.amountOwed)) {
|
if (this.inputInvoicingAmount >= Number(item.amountOwed)) {
|
||||||
item.thisInvoicingAmount = this.getAddZero(Number(item.amountOwed))
|
item.thisInvoicingAmount = this.getAddZero(Number(item.amountOwed))
|
||||||
this.inputInvoicingAmount -= Number(item.amountOwed)
|
this.inputInvoicingAmount -= Number(item.amountOwed)
|
||||||
// item.amountOwed = 0
|
|
||||||
} else {
|
} else {
|
||||||
// 输入的来款金额小于当前项目欠款且剩余的输入来款金额大于0,则将剩余全部来款算入当前项目的此次来款
|
// 输入的开票金额小于当前项目欠款且剩余的输入开票金额大于0,则将剩余全部开票算入当前项目的此次开票
|
||||||
if (this.inputInvoicingAmount > 0) {
|
if (this.inputInvoicingAmount > 0) {
|
||||||
item.thisInvoicingAmount = this.getAddZero(this.inputInvoicingAmount)
|
item.thisInvoicingAmount = this.getAddZero(this.inputInvoicingAmount)
|
||||||
// item.amountOwed = Number(item.amountOwed) - item.thisIncomingAmount
|
|
||||||
this.inputInvoicingAmount = 0
|
this.inputInvoicingAmount = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.$set(this.dataSource, index, item)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleOk() {
|
handleOk() {
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
let bmpList = []
|
||||||
|
let data = this.dataSource.filter(tt => tt.thisInvoicingAmount !== 0 && tt.thisInvoicingAmount)
|
||||||
|
data.forEach(item => {
|
||||||
|
let obj = {
|
||||||
|
invoiceAmount: item.thisInvoicingAmount,
|
||||||
|
projectId: item.id,
|
||||||
|
projectType: item.projectType,
|
||||||
|
remark: item.remark
|
||||||
|
}
|
||||||
|
bmpList.push(obj)
|
||||||
|
})
|
||||||
|
let param = values
|
||||||
|
param.bmpList = bmpList
|
||||||
|
console.log(param)
|
||||||
|
addPayBill(param).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.close()
|
||||||
|
this.$emit('ok')
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.close()
|
this.close()
|
||||||
@@ -272,6 +294,8 @@ export default {
|
|||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.clearThisTimeAmount()
|
||||||
this.$emit('update:visible', false)
|
this.$emit('update:visible', false)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
<a-form-item label="来款用途" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="来款用途" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<j-dict-select-tag v-model="queryParam.chargeUse" placeholder="请选择来款用途" dictCode="payment_charge_use"/>
|
<j-dict-select-tag v-model="queryParam.chargeUse" placeholder="请选择来款用途" dictCode="payment_charge_use" show-search/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
|||||||
@@ -44,6 +44,11 @@
|
|||||||
<a-input placeholder="请输入成员单位" v-model="queryParam.chargeCompanyTemporaryName"></a-input>
|
<a-input placeholder="请输入成员单位" v-model="queryParam.chargeCompanyTemporaryName"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<a-form-item label="来款状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-dict-select-tag v-model="queryParam.chargeStatus " placeholder="请选择来款状态" dictCode="work_group_charge_status"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
<a-form-item label="来款年份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="来款年份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<j-year-date style="width:100%" placeholder="请选择年份" v-model="queryParam.paymentDate"></j-year-date>
|
<j-year-date style="width:100%" placeholder="请选择年份" v-model="queryParam.paymentDate"></j-year-date>
|
||||||
@@ -71,6 +76,7 @@
|
|||||||
<a-button type="primary" icon="download" @click="downTemplate('工作组成员导入模板')">下载模板</a-button>
|
<a-button type="primary" icon="download" @click="downTemplate('工作组成员导入模板')">下载模板</a-button>
|
||||||
<a-button type="danger" icon="delete" @click="batchDel">批量删除</a-button>
|
<a-button type="danger" icon="delete" @click="batchDel">批量删除</a-button>
|
||||||
<a-button type="primary" @click="setChargeNotic">设置收费通知</a-button>
|
<a-button type="primary" @click="setChargeNotic">设置收费通知</a-button>
|
||||||
|
<a-button type="primary" @click="setDunningReminder">催款提醒</a-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- /操作按钮区域-end-->
|
<!-- /操作按钮区域-end-->
|
||||||
|
|
||||||
@@ -388,6 +394,15 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 催款提醒
|
||||||
|
*/
|
||||||
|
setDunningReminder() {
|
||||||
|
if (this.selectedRowKeys.length === 0) {
|
||||||
|
this.$message.warn('请先选择成员')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 文件预览
|
* 文件预览
|
||||||
* @param file
|
* @param file
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<page-header-title level-two-title="工作组资料维护" :is-level-one="false"></page-header-title>
|
<page-header-title level-two-title="资料维护" :is-level-one="false"></page-header-title>
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<!-- 查询区域-start -->
|
<!-- 查询区域-start -->
|
||||||
<div class="table-page-search-wrapper">
|
<div class="table-page-search-wrapper">
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<a-button type="primary" icon="plus" @click="handleAdd">上传</a-button>
|
<a-button type="primary" icon="plus" @click="handleAdd">上传</a-button>
|
||||||
<a-button type="danger" icon="delete" @click="batchDel">批量删除</a-button>
|
<a-button type="danger" icon="delete" @click="batchDel">批量删除</a-button>
|
||||||
<a-button type="primary" @click="batchDistribute">批量分发</a-button>
|
<a-button type="primary" @click="batchDistribute">批量分发</a-button>
|
||||||
<a-button type="primary" icon="export" @click="handleExportXls('工作组来款统计')">导出</a-button>
|
<a-button type="primary" icon="export" @click="handleExportXls('资料维护列表')">导出</a-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 操作按钮区域-end-->
|
<!-- 操作按钮区域-end-->
|
||||||
|
|
||||||
@@ -41,8 +41,9 @@
|
|||||||
:dataSource="dataSource"
|
:dataSource="dataSource"
|
||||||
:pagination="ipagination"
|
:pagination="ipagination"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:scroll="{x: 1100}"
|
:scroll="{x: 1200}"
|
||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
class="j-table-force-nowrap main-table">
|
class="j-table-force-nowrap main-table">
|
||||||
|
|
||||||
<!-- 项目名称-->
|
<!-- 项目名称-->
|
||||||
@@ -52,20 +53,32 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot="text" slot-scope="text">
|
<template slot="text" slot-scope="text">
|
||||||
<j-ellipsis :value="text" :length="18"></j-ellipsis>
|
<j-ellipsis :value="text" :length="20"></j-ellipsis>
|
||||||
</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="handleEdit(record)">编辑</a>
|
<a @click="handleDistribute(record.id)">分发</a>
|
||||||
<a @click="handleDistribute(record)">分发</a>
|
|
||||||
<a @click="handleDelete(record.id)">删除</a>
|
<a @click="handleDelete(record.id)">删除</a>
|
||||||
</span>
|
</span>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<work-group-file-upload-modal ref="modalForm" @ok="modalFormOk"></work-group-file-upload-modal>
|
<!-- 上传-->
|
||||||
<work-group-distribute-module ref="distributeModal" @ok="modalFormOk"></work-group-distribute-module>
|
<work-group-file-upload-modal
|
||||||
|
ref="modalForm"
|
||||||
|
@ok="modalFormOk"
|
||||||
|
:project-id="projectId"
|
||||||
|
:project-type="projectType"></work-group-file-upload-modal>
|
||||||
|
<!-- 分发-->
|
||||||
|
<work-group-distribute-module
|
||||||
|
ref="distributeModal"
|
||||||
|
:visible.sync="distributeModalVisible"
|
||||||
|
:project-id="projectId"
|
||||||
|
:project-type="projectType"
|
||||||
|
:is-batch="isBatchDistribute"
|
||||||
|
:record-id="dataId"
|
||||||
|
@ok="modalFormOk"></work-group-distribute-module>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -90,10 +103,10 @@ export default {
|
|||||||
sm: { span: 10 }
|
sm: { span: 10 }
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
list: '',
|
list: '/project/payWorkingGroupDataFile/list',
|
||||||
exportXlsUrl: '',
|
exportXlsUrl: '/project/payWorkingGroupDataFile/exportXls',
|
||||||
delete: '',
|
delete: '/project/payWorkingGroupDataFile/delete',
|
||||||
deleteBatch: ''
|
deleteBatch: '/project/payWorkingGroupDataFile/deleteBatch'
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@@ -108,25 +121,25 @@ export default {
|
|||||||
}, {
|
}, {
|
||||||
title: '文件名称',
|
title: '文件名称',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'workGroup',
|
dataIndex: 'fileName',
|
||||||
scopedSlots: { customRender: 'text' }
|
scopedSlots: { customRender: 'text' }
|
||||||
}, {
|
}, {
|
||||||
title: '下载次数',
|
title: '下载次数',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 160,
|
width: 160,
|
||||||
dataIndex: 'allMoney',
|
dataIndex: 'downloadCount',
|
||||||
scopedSlots: { customRender: 'text' }
|
scopedSlots: { customRender: 'text' }
|
||||||
}, {
|
}, {
|
||||||
title: '上传时间',
|
title: '上传时间',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 160,
|
width: 220,
|
||||||
dataIndex: 'comeAllMoney',
|
dataIndex: 'createTime',
|
||||||
scopedSlots: { customRender: 'text' }
|
scopedSlots: { customRender: 'text' }
|
||||||
}, {
|
}, {
|
||||||
title: '上传人',
|
title: '上传人',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 160,
|
width: 160,
|
||||||
dataIndex: 'moneyRate',
|
dataIndex: 'createBy',
|
||||||
scopedSlots: { customRender: 'text' }
|
scopedSlots: { customRender: 'text' }
|
||||||
}, {
|
}, {
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -137,20 +150,49 @@ export default {
|
|||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
disableMixinCreated: true,
|
||||||
|
projectId: null, // 项目id
|
||||||
|
projectType: null, // 1--工作组;2--分标委
|
||||||
|
distributeModalVisible: false,
|
||||||
|
isBatchDistribute: false,
|
||||||
|
dataId: '' // 资料id,传给分发
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
// 工作组
|
||||||
|
if (this.$route.query.hasOwnProperty.call(this.$route.query, 'workingGroupId')) {
|
||||||
|
this.filters.projectId = this.$route.query.workingGroupId
|
||||||
|
this.projectType = 1
|
||||||
|
this.filters.projectType = 1
|
||||||
|
} else if (this.$route.query.hasOwnProperty.call(this.$route.query, 'id')) {
|
||||||
|
// 分标委
|
||||||
|
this.filters.projectId = this.$route.query.id
|
||||||
|
this.projectType = 2
|
||||||
|
this.filters.projectType = 2
|
||||||
|
}
|
||||||
|
this.projectId = this.filters.projectId
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 批量分发
|
* 批量分发
|
||||||
*/
|
*/
|
||||||
batchDistribute() {
|
batchDistribute() {
|
||||||
this.$refs.distributeModal.edit()
|
if (this.selectedRowKeys.length === 0) {
|
||||||
|
this.$message.warn('请至少选中一个资料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.dataId = this.selectedRowKeys.join(',')
|
||||||
|
this.distributeModalVisible = true
|
||||||
|
this.isBatchDistribute = true
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 分发
|
* 分发
|
||||||
*/
|
*/
|
||||||
handleDistribute() {
|
handleDistribute(id) {
|
||||||
this.$refs.distributeModal.edit()
|
this.dataId = id
|
||||||
|
this.distributeModalVisible = true
|
||||||
|
this.isBatchDistribute = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,10 @@ export default {
|
|||||||
goFilesMaintenance(record) {
|
goFilesMaintenance(record) {
|
||||||
console.log(record)
|
console.log(record)
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/projectManagement/WorkingGroupProjectDataMaintenance'
|
path: '/projectManagement/WorkingGroupProjectDataMaintenance',
|
||||||
|
query: {
|
||||||
|
workingGroupId: record.id,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -154,7 +154,6 @@
|
|||||||
<a-form-item label="资料" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item label="资料" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<j-upload file-type="pdf"
|
<j-upload file-type="pdf"
|
||||||
file-type-error-message="请pdf文件"
|
file-type-error-message="请pdf文件"
|
||||||
:multiple="false"
|
|
||||||
:return-id="true"
|
:return-id="true"
|
||||||
bizPath="payment"
|
bizPath="payment"
|
||||||
v-decorator="['files', validatorRules.files]"
|
v-decorator="['files', validatorRules.files]"
|
||||||
|
|||||||
@@ -9,17 +9,7 @@
|
|||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
cancelText="关闭">
|
cancelText="关闭">
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<a-form :form="form">
|
<a-form>
|
||||||
<a-row>
|
|
||||||
<a-col>
|
|
||||||
<a-form-item label="文件" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
||||||
<j-upload :return-id="true"
|
|
||||||
class="no-upload"
|
|
||||||
v-decorator="['dataId', validatorRules.dataId]"
|
|
||||||
:trigger-change="true"></j-upload>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="2"></a-col>
|
<a-col :span="2"></a-col>
|
||||||
<a-col :span="20">
|
<a-col :span="20">
|
||||||
@@ -33,34 +23,52 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
|
||||||
<a-col :span="4"></a-col>
|
|
||||||
<a-col :span="20">
|
|
||||||
<a-form-item class="choose-member">
|
|
||||||
<a-input v-decorator="['memberName', validatorRules.memberName]"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import pick from 'lodash.pick'
|
import { distribute, batchDistribute, distributeMemberList } from '../../../api/incomePaymentsApi'
|
||||||
import { getAction } from '@api/manage'
|
|
||||||
import JUpload from '@comp/jero/JUpload'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WorkGroupDistributeModule',
|
name: 'WorkGroupDistributeModule',
|
||||||
components: { JUpload },
|
props: {
|
||||||
|
// 项目id
|
||||||
|
projectId: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 项目类型:1--工作组;2--分标委
|
||||||
|
projectType: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 分发资料id
|
||||||
|
recordId: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 是否批量分发
|
||||||
|
isBatch: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '分发',
|
title: '分发',
|
||||||
width: 500,
|
width: 500,
|
||||||
visible: false,
|
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
form: this.$form.createForm(this),
|
|
||||||
model: {},
|
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 5 }
|
sm: { span: 5 }
|
||||||
@@ -71,10 +79,9 @@ export default {
|
|||||||
},
|
},
|
||||||
memberList: [], // 成员树
|
memberList: [], // 成员树
|
||||||
checkedKeys: [], // 已选中的成员数组
|
checkedKeys: [], // 已选中的成员数组
|
||||||
businessSelectedRowKeys: [],
|
|
||||||
replaceFields: {
|
replaceFields: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
title: 'contactsName',
|
title: 'name',
|
||||||
value: 'id',
|
value: 'id',
|
||||||
key: 'id'
|
key: 'id'
|
||||||
},
|
},
|
||||||
@@ -95,46 +102,79 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.initData()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
select(value) {
|
/**
|
||||||
// 群组value===id去获取成员数据
|
* 获取成员列表
|
||||||
if (value) {
|
*/
|
||||||
getAction(this.url.memberList, { id: value }).then(res=>{
|
getMemberList() {
|
||||||
|
let param = {
|
||||||
|
projectId: this.projectId,
|
||||||
|
projectType: this.projectType
|
||||||
|
}
|
||||||
|
distributeMemberList(param).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let tempArr = JSON.parse(JSON.stringify(res.result))
|
this.memberList = res.result
|
||||||
this.memberList = [ { contactsName: '全选', children: [...tempArr] }]
|
} else {
|
||||||
|
console.log(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onCheck(checkedKeys) {
|
onCheck(checkedKeys) {
|
||||||
this.checkedKeys = checkedKeys
|
this.checkedKeys = checkedKeys
|
||||||
},
|
},
|
||||||
edit(record) {
|
/**
|
||||||
this.form.resetFields()
|
* 初始化数据
|
||||||
console.log(record)
|
*/
|
||||||
this.model = Object.assign({}, record)
|
initData() {
|
||||||
this.visible = true
|
this.checkedKeys = []
|
||||||
this.$nextTick(() => {
|
this.getMemberList()
|
||||||
this.form.setFieldsValue(pick(this.model, 'dataId' ))
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
|
this.$emit('update:visible', false)
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
this.visible = false
|
|
||||||
this.memberList = []
|
this.memberList = []
|
||||||
},
|
},
|
||||||
handleOk() {
|
handleOk() {
|
||||||
let arr = JSON.parse(JSON.stringify(this.checkedKeys))
|
if (this.isBatch) {
|
||||||
this.model = Object.assign(this.model, {memberName: arr.toString()})
|
// 批量分发
|
||||||
this.form.setFieldsValue({memberName: arr.toString()})
|
const formData = {
|
||||||
// 触发表单验证
|
contactsIds: this.checkedKeys.join(','),
|
||||||
this.form.validateFields((err, values) => {
|
dataIds: this.recordId,
|
||||||
if (!err) {
|
projectId: this.projectId,
|
||||||
console.log(values)
|
projectType: this.projectType
|
||||||
// 请求分发,或者批量分发接口
|
}
|
||||||
|
batchDistribute(formData).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.close()
|
||||||
|
this.$emit('ok')
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
// 单个分发
|
||||||
|
const formData = {
|
||||||
|
contactsId: this.checkedKeys.join(','),
|
||||||
|
dataId: this.recordId,
|
||||||
|
projectId: this.projectId,
|
||||||
|
projectType: this.projectType
|
||||||
|
}
|
||||||
|
distribute(formData).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.close()
|
||||||
|
this.$emit('ok')
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.close()
|
this.close()
|
||||||
@@ -149,12 +189,15 @@ export default {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .ant-form-explain {
|
/deep/ .ant-form-explain {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .ant-checkbox-group {
|
/deep/ .ant-checkbox-group {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.choose-member {
|
.choose-member {
|
||||||
/deep/ #memberName {
|
/deep/ #memberName {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
:multiple="true"
|
:multiple="true"
|
||||||
:number="10"
|
:number="10"
|
||||||
:return-id="true"
|
:return-id="true"
|
||||||
v-decorator="['dataId', validatorRules.dataId]"
|
v-decorator="['fileIds', validatorRules.fileIds]"
|
||||||
:trigger-change="true"></j-upload>
|
:trigger-change="true"></j-upload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -30,12 +30,26 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import pick from 'lodash.pick'
|
import pick from 'lodash.pick'
|
||||||
import { getAction } from '@api/manage'
|
import { postAction } from '../../../api/manage'
|
||||||
import JUpload from '@comp/jero/JUpload'
|
import JUpload from '@comp/jero/JUpload'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WorkGroupFileUploadModal',
|
name: 'WorkGroupFileUploadModal',
|
||||||
components: { JUpload },
|
components: { JUpload },
|
||||||
|
props: {
|
||||||
|
// 项目id
|
||||||
|
projectId: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 项目类型:1--工作组;2--分标委
|
||||||
|
projectType: {
|
||||||
|
type: Number,
|
||||||
|
require: false,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '编辑',
|
title: '编辑',
|
||||||
@@ -54,19 +68,16 @@ export default {
|
|||||||
sm: { span: 17 }
|
sm: { span: 17 }
|
||||||
},
|
},
|
||||||
validatorRules: {
|
validatorRules: {
|
||||||
dataId: {
|
fileIds: {
|
||||||
rules: [{ required: true, message: '请上传文件' }],
|
rules: [{ required: true, message: '请上传文件' }],
|
||||||
validateTrigger: 'change'
|
validateTrigger: 'change'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
add: '', // 资料和会议的添加 post
|
add: '/project/payWorkingGroupDataFile/add', // 资料上传
|
||||||
edit: '', // 资料和会议的编辑 post
|
edit: '' // 资料和会议的编辑 post
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
created(){
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add(data) {
|
add(data) {
|
||||||
@@ -86,40 +97,23 @@ export default {
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
handleOk() {
|
handleOk() {
|
||||||
const that = this
|
|
||||||
// 触发表单验证
|
// 触发表单验证
|
||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
console.log(values)
|
console.log(values)
|
||||||
let httpurl = ''
|
let params = values
|
||||||
let params = {}
|
params.projectId = this.projectId
|
||||||
if (!this.model.keyId) {
|
params.projectType = this.projectType
|
||||||
httpurl += this.url.add
|
postAction(this.url.add, params).then((res) => {
|
||||||
params = {
|
|
||||||
dataId: values.fileId, // 目录id
|
|
||||||
dataType: this.dataType, // 上传类型
|
|
||||||
fileIds: values.dataId // 资料id
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
httpurl += this.url.edit
|
|
||||||
params = {
|
|
||||||
dataId: values.fileId, // 目录id
|
|
||||||
dataType: this.dataType, // 上传类型
|
|
||||||
fileIds: values.dataId, // 资料id
|
|
||||||
keyId: this.record.keyId, // 主键id
|
|
||||||
oldFileId: this.record.dataId // 旧文件id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
getAction(httpurl, params).then((res) => {
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
that.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
that.$emit('ok')
|
this.$emit('ok')
|
||||||
that.close()
|
this.close()
|
||||||
} else {
|
} else {
|
||||||
that.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
that.confirmLoading = false
|
this.confirmLoading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user