[update] 打包管理接口联调;工作组项目文件预览

This commit is contained in:
zhaoxiao
2021-09-13 16:53:38 +08:00
parent 33012457c3
commit 844787e991
6 changed files with 196 additions and 69 deletions
+13 -1
View File
@@ -42,6 +42,14 @@ const addPayBill = (projectId, projectType, param) => postAction(`/paymentRecord
const editPayBill = (param) => postAction('/paymentRecord/payPaymentRecord/editPayBill', param)
// 普通项目管理-通过项目id查询其他的信息
const queryCommonProjectById = (param) => getAction('/project/payCommonProject/queryById', param)
// 通过id查询打包企业信息
const getPackCompanyById = (param) => getAction('/pack/payPackCompany/queryById', param)
// 添加打包项目
const addPackProject = (param) => postAction('/pack/payPackCompanyProject/add', param)
// 取消打包
const removePackProject = (param) => postAction('/pack/payPackCompanyProject/remove', param)
// 批量取消打包
const batchRemovePackProject = (param) => postAction('/pack/payPackCompanyProject/removeBatch', param)
export {
getWorkingGroupById,
@@ -64,5 +72,9 @@ export {
payBillList,
addPayBill,
editPayBill,
queryCommonProjectById
queryCommonProjectById,
getPackCompanyById,
addPackProject,
removePackProject,
batchRemovePackProject
}
@@ -118,7 +118,8 @@
</a-card>
<!-- 打包-->
<pack-project-select-project-module ref="selectPackProjectModal"
<pack-project-select-project-module :visible.sync="selectPackProjectVisible"
:pack-id="companyDataById.id"
@ok="modalFormOk"></pack-project-select-project-module>
<!-- 批量来款-->
<batch-income-payment-module ref="batchIncomePaymentModal" @ok="modalFormOk"></batch-income-payment-module>
@@ -142,6 +143,7 @@ import BatchIncomePaymentModule from './modules/BatchIncomePaymentModule'
import BatchInvoicingModule from './modules/BatchInvoicingModule'
import ArriveStageModule from '../financialManagement/arriveAndInvoicing/modules/ArriveStageModule'
import InvoicingStageModule from '../financialManagement/arriveAndInvoicing/modules/InvoicingStageModule'
import { getPackCompanyById, batchRemovePackProject, removePackProject } from '../../api/incomePaymentsApi'
export default {
name: 'PackProjectMaintenance',
@@ -159,6 +161,7 @@ export default {
data() {
return {
IconImg,
// 企业信息名称字段对应
companyDataField: [
{
title: '企业名称',
@@ -171,7 +174,7 @@ export default {
dataIndex: 'phone'
}, {
title: '邮箱',
dataIndex: 'mail'
dataIndex: 'email'
}, {
title: '打包费用总计',
dataIndex: 'packChargeTotal'
@@ -183,13 +186,14 @@ export default {
dataIndex: ''
}, {
title: '已来款未开票金额',
dataIndex: ''
dataIndex: 'uninvoicedAmount'
}, {
title: '打包年份',
dataIndex: 'packYear'
}
], // 企业信息名称字段对应
companyDataById: {}, // 通过id获取的企业信息
],
// 通过id获取的企业信息
companyDataById: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
@@ -287,24 +291,44 @@ export default {
scopedSlots: { customRender: 'action' }
}
],
dataSource: [
{
id: 1,
chargeProject: 'asd'
}
],
disableMixinCreated: true,
selectPackProjectVisible: false,
url: {
list: '',
exportXlsUrl: ''
list: '/pack/payPackCompanyProject/listAll',
exportXlsUrl: '/pack/payPackCompanyProject/exportXls'
}
}
},
created() {
this.loadCompanyDetail().then(() => {
this.filters.packId = this.companyDataById.id
this.loadData()
})
},
methods: {
/**
* 获取企业信息
*/
loadCompanyDetail() {
let param = {
id: this.$route.query.packCompanyId
}
return new Promise(resolve => {
getPackCompanyById(param).then(res => {
if (res.success) {
this.companyDataById = res.result
resolve()
} else {
console.log(res.message)
}
})
})
},
/**
* 添加打包项目
*/
handlePack() {
this.$refs.selectPackProjectModal.open()
this.selectPackProjectVisible = true
},
/**
* 批量取消打包
@@ -314,11 +338,23 @@ export default {
this.$message.warn('请至少选中一个项目')
return
}
let that = this
this.$confirm({
title: '确认取消打包',
content: '确定要取消选中项目的打包状态吗?',
onOk: function () {
console.log('批量取消打包')
let param = {
packId: that.companyDataById.id,
packProjectIds: that.selectedRowKeys.join(',')
}
batchRemovePackProject(param).then(res => {
if (res.success) {
that.$message.success(res.message)
that.loadData()
} else {
that.$message.warn(res.message)
}
})
}
})
},
@@ -342,8 +378,30 @@ export default {
console.log(id)
this.$refs.arriveStage.open()
},
cancelPack() {
/**
* 取消打包
* @param id
*/
cancelPack(id) {
let that = this
this.$confirm({
title: '确认取消打包',
content: '确定要取消该项目的打包状态吗?',
onOk: function () {
let param = {
id: id,
packId: that.companyDataById.id
}
removePackProject(param).then(res => {
if (res.success) {
that.$message.success(res.message)
that.loadData()
} else {
that.$message.warn(res.message)
}
})
}
})
},
/**
* 开票
@@ -154,7 +154,7 @@ export default {
id: 1,
chargeProject: '项目名称',
receivableAmount: 100,
paidAmount: 0,
paidAmount: 50,
thisIncomingAmount: null,
remark: ''
}, {
@@ -197,6 +197,10 @@ export default {
close() {
this.visible = false
},
/**
* 来款金额输入失去焦点,进行金额分配
* @param e
*/
incomingAmountBlur(e) {
e.target.value = (e.target.value.replace(/[^0-9.]/g, '')).trim()
this.inputIncomingAmount = Number(e.target.value)
@@ -204,6 +208,10 @@ export default {
this.calculateThisTimeAmount()
})
},
/**
* 清空本次来款金额
* @returns {Promise<unknown>}
*/
clearThisTimeAmount() {
return new Promise(resolve => {
this.dataSource.forEach(item => {
@@ -24,9 +24,11 @@
<a-form-item label="企业联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<select-contacts
:selected-company="selectedCompany"
:init-contacts="initContact"
placeholder="请选择企业联系人"
v-decorator="['companyContactId', validatorRules.companyContactId]"
@change="handleContactChange">
ref="companyContact"
@ok="companyContactOk">
</select-contacts>
</a-form-item>
</a-col>
@@ -55,8 +57,11 @@
<a-form-item label="打包联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<select-contacts
:selected-company="selectedCompany"
:init-contacts="initPackContact"
placeholder="请选择打包联系人"
v-decorator="['packContactId', validatorRules.packContactId]">
ref="packContact"
v-decorator="['packContactId', validatorRules.packContactId]"
@ok="packContactOk">
</select-contacts>
</a-form-item>
</a-col>
@@ -151,7 +156,9 @@ export default {
rules: [{ required: true, message: '请选择打包联系人' }],
validateTrigger: 'change'
}
}
},
initContact: null, // 编辑回显的企业联系人信息
initPackContact: null // 编辑回显的打包联系人信息
}
},
methods: {
@@ -161,11 +168,24 @@ export default {
edit(record) {
this.form.resetFields()
record.company = {
id: record.companyTemporaryId,
id: record.companyId,
companyName: record.companyTemporaryName
}
// 回显企业信息
this.selectedCompany = record.company
record.companyContactId = record.companyContactTemporaryId
record.packContactId = record.packContactTemporaryId
// 编辑时,将企业联系人、打包联系人添加至候选项中
if (record.id) {
this.initContact = {
id: record.companyContactTemporaryId,
name: record.companyContactTemporaryName
}
this.initPackContact = {
id: record.packContactTemporaryId,
name: record.packContactTemporaryName
}
}
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
@@ -215,18 +235,13 @@ export default {
handleCompanyChange(value) {
this.selectedCompany = value
},
/**
* 企业联系人变化,打包联系人默认为企业联系人,打包联系人未选择时进行回显
* @param value
*/
handleContactChange(value) {
console.log(Object.values(this.form.getFieldValue(['packContactId'])).indexOf(undefined) !== -1)
if (Object.values(this.form.getFieldValue(['packContactId'])).indexOf(undefined) !== -1) {
this.model.packContactId = value
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'packContactId'))
})
}
// 企业联系人新增回调
companyContactOk() {
this.$refs.packContact.getContactsList()
},
// 打包联系人新增回调
packContactOk() {
this.$refs.companyContact.getContactsList()
},
/**
* 校验金额格式
@@ -15,7 +15,7 @@
<a-row>
<a-col :xl="8" :lg="9" :md="10" :sm="24">
<a-form-item label="项目名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入项目名称" v-model="queryParam.companyName"></a-input>
<a-input placeholder="请输入项目名称" v-model="queryParam.chargeProject"></a-input>
</a-form-item>
</a-col>
<a-col :xl="8" :lg="9" :md="10" :sm="24">
@@ -78,16 +78,36 @@
import { JeroListMixin } from '../../../mixins/JeroListMixin'
import JYearDate from '../../../components/jero/JYearDate'
import StatusSlot from '../../../components/tools/StatusSlot'
import { addPackProject } from '../../../api/incomePaymentsApi'
export default {
name: 'PackProjectSelectProjectModule',
components: { JYearDate, StatusSlot },
mixins: [JeroListMixin],
props: {
// 打包id
packId: {
type: String,
required: false,
default: null
},
visible: {
type: Boolean,
required: false,
default: false
}
},
watch:{
visible(value) {
if (value) {
this.open()
}
}
},
data() {
return {
title: '添加打包项目',
width: 1000,
visible: false,
width: 1200,
confirmLoading: false,
labelCol: {
xs: { span: 24 },
@@ -98,7 +118,7 @@ export default {
sm: { span: 10 }
},
url:{
list: ''
list: '/pack/payPackCompanyProject/queryNotPackListAll'
},
columns: [
{
@@ -119,8 +139,8 @@ export default {
}, {
title: '来款用途',
align: 'center',
width: 180,
dataIndex: 'chargeUse',
width: 160,
dataIndex: 'chargeUse_dictText',
scopedSlots: { customRender: 'text' }
}, {
title: '项目负责人',
@@ -163,21 +183,45 @@ export default {
dataIndex: 'mail',
scopedSlots: { customRender: 'status' }
}
]
],
disableMixinCreated: true,
filters: {
packId: this.packId
}
}
},
methods: {
handleOk() {
if (this.selectedRowKeys.length === 0) {
this.$message.warn('请至少选择一个项目')
return
}
let projectIds = this.selectedRowKeys.join(',')
let params = {
projectIds: projectIds,
packId: this.packId
}
addPackProject(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.close()
this.$emit('ok')
} else {
this.$message.warn(res.message)
}
})
},
handleCancel() {
this.close()
},
open() {
this.visible = true
this.filters.packId = this.packId
console.log(this.filters)
this.loadData()
},
close() {
this.visible = false
this.selectedRowKeys = []
this.$emit('update:visible', false)
}
}
}
@@ -13,9 +13,8 @@
:key="index">
<div class="work-group-detail-item-title">{{ item.title }}</div>
<div class="work-group-detail-item-content work-group-detail-item-filename"
v-if="(item.fieldName === 'chargeNoticeA' || item.fieldName === 'chargeNoticeB') && workingGroupDetail[item.fieldName]"
@click="previewFile(workingGroupDetail[item.fieldName])">
{{ workingGroupDetail[item.fieldName].fileName }}
v-if="(item.fieldName === 'chargeNoticeAId' || item.fieldName === 'chargeNoticeBId') && workingGroupDetail[item.fieldName]">
<preview-file :file-id="workingGroupDetail[item.fieldName]"></preview-file>
</div>
<div class="work-group-detail-item-content" v-else>{{ workingGroupDetail[item.fieldName] }}</div>
</div>
@@ -139,6 +138,7 @@ import WorkingGroupMemberSetChargeNotice from './modules/WorkingGroupMemberSetCh
import { getFileInfo } from '../../api/api'
import Vue from 'vue'
import { ACCESS_TOKEN } from '../../store/mutation-types'
import PreviewFile from '../../components/jero/PreviewFile'
const Base64 = require('js-base64').Base64
export default {
@@ -149,7 +149,8 @@ export default {
StatusSlot,
ProjectDetailModal,
WorkingGroupMemberUnitModule,
WorkingGroupMemberSetChargeNotice
WorkingGroupMemberSetChargeNotice,
PreviewFile
},
mixins: [JeroListMixin],
computed: {
@@ -187,7 +188,7 @@ export default {
fieldName: 'chargeNoticeNoA'
}, {
title: '收费通知A',
fieldName: 'chargeNoticeA'
fieldName: 'chargeNoticeAId'
}, {
title: '本年应收款B',
fieldName: 'yearChargeB'
@@ -196,7 +197,7 @@ export default {
fieldName: 'chargeNoticeNoB'
}, {
title: '收费通知B',
fieldName: 'chargeNoticeB'
fieldName: 'chargeNoticeBId'
}
],
labelCol: {
@@ -309,23 +310,11 @@ export default {
}
getWorkingGroupById(param).then(res => {
this.workingGroupDetail = res.result
// this.workingGroupDetail.chargeNoticeA = {}
// this.workingGroupDetail.chargeNoticeB = {}
this.getFile()
}).finally(() => {
this.spinning = false
})
},
async getFile() {
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeAId }).then(res => {
this.workingGroupDetail.chargeNoticeA = res.result
this.$forceUpdate()
})
await getFileInfo({ id: this.workingGroupDetail.chargeNoticeBId }).then(res => {
this.workingGroupDetail.chargeNoticeB = res.result
this.$forceUpdate()
})
},
handleAdd: function () {
this.getChargeNoticeList()
this.$refs.modalForm.workingGroupId = this.workingGroupProjectId
@@ -342,9 +331,13 @@ export default {
this.$refs.modalForm.title = '编辑'
this.$refs.modalForm.disableSubmit = false
},
/**
* 获取收费通知列表
*/
getChargeNoticeList() {
this.chargeNoticeList = []
let chargeNoticeA, chargeNoticeB
// 是否存在收费通知A
if (this.workingGroupDetail.chargeNoticeNoA && this.workingGroupDetail.chargeNoticeNoA !== '') {
chargeNoticeA = {
type: 'chargeNoticeA',
@@ -353,7 +346,9 @@ export default {
yearCharge: this.workingGroupDetail.yearChargeA,
chargeNoticeId: this.workingGroupDetail.chargeNoticeAId
}
this.chargeNoticeList.push(chargeNoticeA)
}
// 是否存在收费通知B
if (this.workingGroupDetail.chargeNoticeNoB && this.workingGroupDetail.chargeNoticeNoB !== '') {
chargeNoticeB = {
type: 'chargeNoticeB',
@@ -362,11 +357,6 @@ export default {
yearCharge: this.workingGroupDetail.yearChargeB,
chargeNoticeId: this.workingGroupDetail.chargeNoticeBId
}
}
if (chargeNoticeA && chargeNoticeA.hasOwnProperty.call(chargeNoticeA, 'value')) {
this.chargeNoticeList.push(chargeNoticeA)
}
if (chargeNoticeB && chargeNoticeB.hasOwnProperty.call(chargeNoticeA, 'value')) {
this.chargeNoticeList.push(chargeNoticeB)
}
},