普通项目;工作组变更--文件维护接口;批量开票

This commit is contained in:
zhaoxiao
2021-09-16 18:54:38 +08:00
parent ac559d9be7
commit a0c45be5fc
13 changed files with 442 additions and 232 deletions
+12 -2
View File
@@ -37,7 +37,8 @@ const amountReceivedList = (param) => postAction(`/paymentRecord/payPaymentRecor
// 开票列表
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)
// 普通项目管理-通过项目id查询其他的信息
@@ -52,6 +53,12 @@ const removePackProject = (param) => postAction('/pack/payPackCompanyProject/rem
const batchRemovePackProject = (param) => postAction('/pack/payPackCompanyProject/removeBatch', 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 {
getWorkingGroupById,
@@ -79,5 +86,8 @@ export {
addPackProject,
removePackProject,
batchRemovePackProject,
aduitCompany
aduitCompany,
distribute,
batchDistribute,
distributeMemberList
}
@@ -42,6 +42,7 @@ export default {
},
// 下拉框的搜索
filterOption(input, option) {
console.log(option)
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
)
+79 -61
View File
@@ -11,7 +11,7 @@ export function timeFix() {
export function welcome() {
const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
let index = Math.floor((Math.random()*arr.length))
let index = Math.floor((Math.random() * arr.length))
return arr[index]
}
@@ -35,7 +35,7 @@ export function filterObj(obj) {
return
}
for ( let key in obj) {
for (let key in obj) {
// eslint-disable-next-line
if (obj.hasOwnProperty(key)
&& (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
@@ -53,7 +53,7 @@ export function filterObj(obj) {
*/
export function formatDate(value, fmt) {
let regPos = /^\d+(\.\d+)?$/
if(regPos.test(value)){
if (regPos.test(value)) {
//如果是数字
let getDate = new Date(value)
let o = {
@@ -74,46 +74,46 @@ export function formatDate(value, fmt) {
}
}
return fmt
}else{
} else {
//TODO
value = value.trim()
return value.substr(0,fmt.length)
return value.substr(0, fmt.length)
}
}
// 生成首页路由
export function generateIndexRouter(data) {
let indexRouter = [{
path: '/',
name: 'dashboard',
//component: () => import('@/components/layouts/BasicLayout'),
// eslint-disable-next-line
component: resolve => require(['@/components/layouts/TabLayout'], resolve),
meta: { title: '首页' },
redirect: '/dashboard/analysis',
children: [
...generateChildRouters(data)
]
},{
'path': '*', 'redirect': '/404', 'hidden': true
}]
let indexRouter = [{
path: '/',
name: 'dashboard',
//component: () => import('@/components/layouts/BasicLayout'),
// eslint-disable-next-line
component: resolve => require(['@/components/layouts/TabLayout'], resolve),
meta: { title: '首页' },
redirect: '/dashboard/analysis',
children: [
...generateChildRouters(data)
]
}, {
'path': '*', 'redirect': '/404', 'hidden': true
}]
return indexRouter
}
// 生成嵌套路由(子路由)
function generateChildRouters (data) {
function generateChildRouters(data) {
const routers = []
for (let item of data) {
let component = ''
if(item.component.indexOf('layouts')>=0){
component = 'components/'+item.component
}else{
component = 'views/'+item.component
if (item.component.indexOf('layouts') >= 0) {
component = 'components/' + item.component
} else {
component = 'views/' + item.component
}
// eslint-disable-next-line
let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
let URL = (item.meta.url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
if (isURL(URL)) {
item.meta.url = URL
}
@@ -139,42 +139,42 @@ function generateChildRouters (data) {
// componentPath = onlineCommons.OnlCgreportAutoList
// }else{
// eslint-disable-next-line
componentPath = resolve => require(['@/' + component+'.vue'], resolve)
componentPath = resolve => require(['@/' + component + '.vue'], resolve)
// }
let menu = {
let menu = {
path: item.path,
name: item.name,
redirect:item.redirect,
redirect: item.redirect,
component: componentPath,
//component: resolve => require(['@/' + component+'.vue'], resolve),
hidden:item.hidden,
hidden: item.hidden,
//component:()=> import(`@/views/${item.component}.vue`),
meta: {
title:item.meta.title ,
title: item.meta.title,
icon: item.meta.icon,
url:item.meta.url ,
permissionList:item.meta.permissionList,
keepAlive:item.meta.keepAlive,
url: item.meta.url,
permissionList: item.meta.permissionList,
keepAlive: item.meta.keepAlive,
/*update_begin author:wuxianquan date:20190908 for:赋值 */
internalOrExternal:item.meta.internalOrExternal,
internalOrExternal: item.meta.internalOrExternal,
/*update_end author:wuxianquan date:20190908 for:赋值 */
componentName:item.meta.componentName
componentName: item.meta.componentName
}
}
if(item.alwaysShow){
if (item.alwaysShow) {
menu.alwaysShow = true
menu.redirect = menu.path
}
if (item.children && item.children.length > 0) {
menu.children = [...generateChildRouters( item.children)]
menu.children = [...generateChildRouters(item.children)]
}
//--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
//判断是否生成路由
if(item.route && item.route === '0'){
if (item.route && item.route === '0') {
//console.log(' 不生成路由 item.route: '+item.route);
//console.log(' 不生成路由 item.path: '+item.path);
}else{
} else {
routers.push(menu)
}
//--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
@@ -208,7 +208,7 @@ export function randomNumber() {
}
if (arguments.length === 1) {
let [length] = arguments
// 生成指定长度的随机数字,首位一定不是 0
// 生成指定长度的随机数字,首位一定不是 0
let nums = [...Array(length).keys()].map((i) => (i > 0 ? random(0, 9) : random(1, 9)))
return parseInt(nums.join(''))
} else if (arguments.length >= 2) {
@@ -250,8 +250,8 @@ export function randomUUID() {
* @param string
* @returns {*}
*/
export function underLine2CamelCase(string){
return string.replace( /_([a-z])/g, function( all, letter ) {
export function underLine2CamelCase(string) {
return string.replace(/_([a-z])/g, function (all, letter) {
return letter.toUpperCase()
})
}
@@ -261,8 +261,8 @@ export function underLine2CamelCase(string){
* @param bpmStatus
* @returns {*}
*/
export function showDealBtn(bpmStatus){
if(bpmStatus!='1'&&bpmStatus!='3'&&bpmStatus!='4'){
export function showDealBtn(bpmStatus) {
if (bpmStatus != '1' && bpmStatus != '3' && bpmStatus != '4') {
return true
}
return false
@@ -276,7 +276,7 @@ export function showDealBtn(bpmStatus){
export function cssExpand(css, id) {
let style = document.createElement('style')
style.type = 'text/css'
style.innerHTML = `@charset "UTF-8"; ${css}`
style.innerHTML = `@charset "UTF-8"; ${ css }`
// 清除旧样式
if (id) {
let $style = document.getElementById(id)
@@ -307,16 +307,16 @@ export function jsExpand(options = {}) {
let id = randomString(16, 'qwertyuioplkjhgfdsazxcvbnm'.toUpperCase())
// 封装按钮点击事件
let code = `
(function (o_${id}) {
(function (o_${ id }) {
try {
(function (globalEvent, vm) {
${options.jsCode}
})(o_${id}.event, o_${id}.vm)
${ options.jsCode }
})(o_${ id }.event, o_${ id }.vm)
} catch (e) {
o_${id}.error(e)
o_${ id }.error(e)
}
o_${id}.done()
})(window['${windowKeyName}']['EVENT_${id}'])
o_${ id }.done()
})(window['${ windowKeyName }']['EVENT_${ id }'])
`
// 创建script标签
const script = document.createElement('script')
@@ -332,7 +332,7 @@ export function jsExpand(options = {}) {
},
// 当js运行出错的时候调用的事件
error(e) {
console.group(`${options.errorMessage || '用户自定义JS增强代码运行出错'}(${new Date()})`)
console.group(`${ options.errorMessage || '用户自定义JS增强代码运行出错' }(${ new Date() })`)
console.error(e)
console.groupEnd()
}
@@ -555,16 +555,17 @@ export function neverNull(value, def) {
*/
export function removeArrayElement(array, prod, value) {
let index = -1
for(let i = 0;i<array.length;i++){
if(array[i][prod] == value){
for (let i = 0; i < array.length; i++) {
if (array[i][prod] == value) {
index = i
break
}
}
if(index>=0){
if (index >= 0) {
array.splice(index, 1)
}
}
/**
* 前端加密方法
* @param publicKey:公钥
@@ -576,13 +577,14 @@ export function encrypt(publicKey, message) {
const txt = encrypt.encrypt(message)
return txt
}
/**
* 校验数组是否有重复的元素
* */
export function isRepeat(arr) {
var hash = {}
for(var i in arr) {
if(hash[arr[i]]) {
for (var i in arr) {
if (hash[arr[i]]) {
return true
}
// 不存在该元素,则赋值为true,可以赋任意值,相应的修改if判断条件即可
@@ -590,6 +592,7 @@ export function isRepeat(arr) {
}
return false
}
/**
* 补充0
* */
@@ -613,14 +616,29 @@ export function addZero(e) {
// 大于等于2
if (afterPointValue.length >= 2) {
e.target.value = beforePointValue + afterPointValue
}else {
} else {
// 不足2位补0
afterPointValue = afterPointValue.padEnd(2,'0')
afterPointValue = afterPointValue.padEnd(2, '0')
e.target.value = beforePointValue + afterPointValue
}
}else {
} else {
// 不包括小数点
e.target.value = e.target.value + '.00'
e.target.value = e.target.value + '.00'
}
}
}
/**
* 数组内元素是否完全一致
* @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">
<a-button type="primary" icon="export" @click="handleExportXls('到账开票')">导出</a-button>
<a-button type="primary" icon="file-text" @click="batchInvoicing">合并开票</a-button>
</div>
<!-- 操作按钮区域-end-->
@@ -87,7 +88,7 @@
<span slot="action" class="action-span-cell" slot-scope="text, record">
<a @click="incomePayment(record.id)">来款</a>
<a @click="invoicing(record)">开票</a>
<a @click="invoicing(record)" :disabled="record.needInvoice === 0">开票</a>
</span>
</a-table>
</div>
@@ -108,6 +109,11 @@
:visible.sync="invoicingVisible"
:charge-company-name="selectProjectChargeCompanyName"></invoicing-stage-module>
<project-detail-modal ref="projectDetail"></project-detail-modal>
<!-- 批量开票-->
<batch-invoicing-module
:selected-data="selectedProject"
:visible.sync="batchInvoicingVisible">
</batch-invoicing-module>
</div>
</template>
@@ -121,6 +127,8 @@ import ArriveStageModule from './modules/ArriveStageModule'
import InvoicingStageModule from './modules/InvoicingStageModule'
import SelectPrincipal from '../../../components/company/SelectPrincipal'
import ProjectDetailModal from '../../../components/ProjectDetailModal'
import BatchInvoicingModule from '../../packManagement/modules/BatchInvoicingModule'
import { isAllEqual } from '../../../utils/util'
export default {
name: 'ArriveAndInvoivingList',
@@ -131,7 +139,8 @@ export default {
ArriveStageModule,
InvoicingStageModule,
SelectPrincipal,
ProjectDetailModal
ProjectDetailModal,
BatchInvoicingModule
},
mixins: [JeroListMixin],
data() {
@@ -237,7 +246,9 @@ export default {
selectProjectName: null, // 选中项目名称open
selectProjectChargeCompanyName: null, // 选中项目来款企业
invoicingVisible: false,
arriveVisible: false
arriveVisible: false,
selectedProject: [],
batchInvoicingVisible: false
}
},
methods: {
@@ -260,6 +271,61 @@ export default {
this.selectProjectName = record.chargeProject
this.selectProjectChargeCompanyName = record.chargeCompanyTemporaryName
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: [],
inputIncomingAmount: null, // 输入的来款金额
disableMixinCreated: true,
sumAmountOwed: 0, // 总欠款金额
sumAmountOwed: 0 // 总欠款金额
}
},
methods: {
@@ -203,6 +203,7 @@ export default {
this.loadData()
},
close() {
this.form.resetFields()
this.clearThisTimeAmount()
this.$emit('update:visible', false)
},
@@ -218,21 +219,16 @@ export default {
this.$message.warn('来款金额大于总欠款金额,请修改')
return
}
this.clearThisTimeAmount().then(() => {
this.calculateThisTimeAmount()
this.$forceUpdate()
})
this.clearThisTimeAmount()
this.calculateThisTimeAmount()
},
/**
* 清空本次来款金额
* @returns {Promise<unknown>}
*/
clearThisTimeAmount() {
return new Promise(resolve => {
this.dataSource.forEach(item => {
item.thisIncomingAmount = 0.00
})
resolve()
this.dataSource.forEach(item => {
item.thisIncomingAmount = 0.00
})
},
/**
@@ -243,23 +239,22 @@ export default {
this.$message.warn('请输入大于0的来款金额')
return
}
this.dataSource.forEach(item => {
this.dataSource.forEach((item, index) => {
// 当前项目欠款是否 >0
if (Number(item.amountOwed) > 0) {
// 输入的来款金额是否 >= 当前项目欠款
if (this.inputIncomingAmount >= Number(item.amountOwed)) {
item.thisIncomingAmount = this.getAddZero(Number(item.amountOwed))
this.inputIncomingAmount -= Number(item.amountOwed)
// item.amountOwed = 0
} else {
// 输入的来款金额小于当前项目欠款且剩余的输入来款金额大于0,则将剩余全部来款算入当前项目的此次来款
if (this.inputIncomingAmount > 0) {
item.thisIncomingAmount = this.getAddZero(this.inputIncomingAmount)
// item.amountOwed = Number(item.amountOwed) - item.thisIncomingAmount
this.inputIncomingAmount = 0
}
}
}
this.$set(this.dataSource, index, item)
})
}
,
@@ -14,7 +14,7 @@
<a-col :xl="12" :sm="24">
<a-form-item label="开票金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入开票金额"
v-decorator="['invoicingAmount',validatorRules.invoicingAmount]"
v-decorator="['invoiceAmount',validatorRules.invoiceAmount]"
:maxLength='50'
@blur="invoicingAmountBlur"
@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-form-item label="开票号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入开票号"
v-decorator="['invoicingNum', validatorRules.invoicingNum]"
v-decorator="['billNo', validatorRules.billNo]"
:maxLength='50'
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</a-form-item>
@@ -34,7 +34,7 @@
<a-form-item label="开票时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择开票时间"
style="width: 100%;"
v-decorator="['invoicingTime', validatorRules.invoicingTime]"
v-decorator="['billDate', validatorRules.billDate]"
:trigger-change="true"
v-bind="$attrs"
date-format="YYYY-MM-DD"/>
@@ -56,9 +56,9 @@
</template>
<!-- 输入-->
<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>
@@ -77,6 +77,7 @@
import JDate from '../../../components/tools/JDate'
import { money } from '../../../utils/validate'
import { addZero } from '../../../utils/util'
import { addPayBill } from '../../../api/incomePaymentsApi'
export default {
name: 'BatchInvoicingModule',
@@ -148,7 +149,7 @@ export default {
title: '已开票金额',
align: 'center',
width: 100,
dataIndex: 'paidAmount'
dataIndex: 'invoiceAmount'
}, {
title: '本次开票金额',
align: 'center',
@@ -164,7 +165,7 @@ export default {
],
dataSource: [],
validatorRules: {
invoicingAmount: {
invoiceAmount: {
rules: [{ required: true, validator: this.checkMoney }],
validateTrigger: 'blur'
},
@@ -172,7 +173,7 @@ export default {
rules: [{ required: true, message: '请输入开票号' }],
validateTrigger: 'blur'
},
invoicingTime: {
billDate: {
rules: [{ required: true, message: '请选择开票时间' }],
validateTrigger: 'blur'
}
@@ -198,10 +199,11 @@ export default {
return e.target.value
},
loadData() {
// 计算项目欠款信息
// 计算项目未开票金额信息
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.thisInvoicingAmount = 0
this.sumAmountOwed += Number(item.amountOwed)
})
this.$forceUpdate()
@@ -217,52 +219,72 @@ export default {
this.$message.warn('开票金额大于总未开票金额,请修改')
return
}
this.clearThisTimeAmount().then(() => {
this.calculateThisTimeAmount()
this.$forceUpdate()
})
this.clearThisTimeAmount()
this.calculateThisTimeAmount()
},
/**
* 清空本次来款金额
* 清空本次开票金额
* @returns {Promise<unknown>}
*/
clearThisTimeAmount() {
return new Promise(resolve => {
this.dataSource.forEach(item => {
item.thisInvoicingAmount = null
})
resolve()
this.dataSource.forEach(item => {
item.thisInvoicingAmount = 0
})
},
/**
* 计算此次来款信息
* 计算此次开票信息
*/
calculateThisTimeAmount() {
if (this.inputInvoicingAmount <= 0) {
this.$message.warn('请输入大于0的来款金额')
this.$message.warn('请输入大于0的开票金额')
return
}
this.dataSource.forEach(item => {
this.dataSource.forEach((item, index) => {
// 当前项目欠款是否 >0
if (Number(item.amountOwed) > 0) {
// 输入的来款金额是否 >= 当前项目欠款
// 输入的开票金额是否 >= 当前项目欠款
if (this.inputInvoicingAmount >= Number(item.amountOwed)) {
item.thisInvoicingAmount = this.getAddZero(Number(item.amountOwed))
this.inputInvoicingAmount -= Number(item.amountOwed)
// item.amountOwed = 0
} else {
// 输入的来款金额小于当前项目欠款且剩余的输入来款金额大于0,则将剩余全部来款算入当前项目的此次来款
// 输入的开票金额小于当前项目欠款且剩余的输入开票金额大于0,则将剩余全部开票算入当前项目的此次开票
if (this.inputInvoicingAmount > 0) {
item.thisInvoicingAmount = this.getAddZero(this.inputInvoicingAmount)
// item.amountOwed = Number(item.amountOwed) - item.thisIncomingAmount
this.inputInvoicingAmount = 0
}
}
}
this.$set(this.dataSource, index, item)
})
},
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() {
this.close()
@@ -272,6 +294,8 @@ export default {
this.loadData()
},
close() {
this.form.resetFields()
this.clearThisTimeAmount()
this.$emit('update:visible', false)
},
/**
@@ -23,7 +23,7 @@
</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.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-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -44,6 +44,11 @@
<a-input placeholder="请输入成员单位" v-model="queryParam.chargeCompanyTemporaryName"></a-input>
</a-form-item>
</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-form-item label="来款年份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<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="danger" icon="delete" @click="batchDel">批量删除</a-button>
<a-button type="primary" @click="setChargeNotic">设置收费通知</a-button>
<a-button type="primary" @click="setDunningReminder">催款提醒</a-button>
</div>
<!-- /操作按钮区域-end-->
@@ -388,6 +394,15 @@ export default {
}
})
},
/**
* 催款提醒
*/
setDunningReminder() {
if (this.selectedRowKeys.length === 0) {
this.$message.warn('请先选择成员')
return
}
},
/**
* 文件预览
* @param file
@@ -1,6 +1,6 @@
<template>
<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">
<!-- 查询区域-start -->
<div class="table-page-search-wrapper">
@@ -26,7 +26,7 @@
<a-button type="primary" icon="plus" @click="handleAdd">上传</a-button>
<a-button type="danger" icon="delete" @click="batchDel">批量删除</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>
<!-- 操作按钮区域-end-->
@@ -41,8 +41,9 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:scroll="{x: 1100}"
:scroll="{x: 1200}"
@change="handleTableChange"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap main-table">
<!-- 项目名称-->
@@ -52,20 +53,32 @@
</template>
<template slot="text" slot-scope="text">
<j-ellipsis :value="text" :length="18"></j-ellipsis>
<j-ellipsis :value="text" :length="20"></j-ellipsis>
</template>
<span slot="action" class="action-span-cell" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a @click="handleDistribute(record)">分发</a>
<a @click="handleDistribute(record.id)">分发</a>
<a @click="handleDelete(record.id)">删除</a>
</span>
</a-table>
</div>
</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>
</template>
@@ -90,10 +103,10 @@ export default {
sm: { span: 10 }
},
url: {
list: '',
exportXlsUrl: '',
delete: '',
deleteBatch: ''
list: '/project/payWorkingGroupDataFile/list',
exportXlsUrl: '/project/payWorkingGroupDataFile/exportXls',
delete: '/project/payWorkingGroupDataFile/delete',
deleteBatch: '/project/payWorkingGroupDataFile/deleteBatch'
},
columns: [
{
@@ -108,25 +121,25 @@ export default {
}, {
title: '文件名称',
align: 'center',
dataIndex: 'workGroup',
dataIndex: 'fileName',
scopedSlots: { customRender: 'text' }
}, {
title: '下载次数',
align: 'center',
width: 160,
dataIndex: 'allMoney',
dataIndex: 'downloadCount',
scopedSlots: { customRender: 'text' }
}, {
title: '上传时间',
align: 'center',
width: 160,
dataIndex: 'comeAllMoney',
width: 220,
dataIndex: 'createTime',
scopedSlots: { customRender: 'text' }
}, {
title: '上传人',
align: 'center',
width: 160,
dataIndex: 'moneyRate',
dataIndex: 'createBy',
scopedSlots: { customRender: 'text' }
}, {
title: '操作',
@@ -137,20 +150,49 @@ export default {
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: {
/**
* 批量分发
*/
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() {
this.$refs.distributeModal.edit()
handleDistribute(id) {
this.dataId = id
this.distributeModalVisible = true
this.isBatchDistribute = false
}
}
}
@@ -178,7 +178,10 @@ export default {
goFilesMaintenance(record) {
console.log(record)
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">
<j-upload file-type="pdf"
file-type-error-message="请pdf文件"
:multiple="false"
:return-id="true"
bizPath="payment"
v-decorator="['files', validatorRules.files]"
@@ -9,17 +9,7 @@
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="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-form>
<a-row>
<a-col :span="2"></a-col>
<a-col :span="20">
@@ -33,34 +23,52 @@
</a-form-item>
</a-col>
</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-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { getAction } from '@api/manage'
import JUpload from '@comp/jero/JUpload'
import { distribute, batchDistribute, distributeMemberList } from '../../../api/incomePaymentsApi'
export default {
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() {
return {
title: '分发',
width: 500,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
@@ -71,10 +79,9 @@ export default {
},
memberList: [], // 成员树
checkedKeys: [], // 已选中的成员数组
businessSelectedRowKeys: [],
replaceFields: {
children: 'children',
title: 'contactsName',
title: 'name',
value: 'id',
key: 'id'
},
@@ -95,46 +102,79 @@ export default {
}
}
},
created() {
this.initData()
},
methods: {
select(value) {
// 群组value===id去获取成员数据
if (value) {
getAction(this.url.memberList, { id: value }).then(res=>{
if (res.success) {
let tempArr = JSON.parse(JSON.stringify(res.result))
this.memberList = [ { contactsName: '全选', children: [...tempArr] }]
}
})
/**
* 获取成员列表
*/
getMemberList() {
let param = {
projectId: this.projectId,
projectType: this.projectType
}
distributeMemberList(param).then(res => {
if (res.success) {
this.memberList = res.result
} else {
console.log(res.message)
}
})
},
onCheck(checkedKeys) {
this.checkedKeys = checkedKeys
},
edit(record) {
this.form.resetFields()
console.log(record)
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'dataId' ))
})
/**
* 初始化数据
*/
initData() {
this.checkedKeys = []
this.getMemberList()
},
close() {
this.$emit('update:visible', false)
this.$emit('close')
this.visible = false
this.memberList = []
},
handleOk() {
let arr = JSON.parse(JSON.stringify(this.checkedKeys))
this.model = Object.assign(this.model, {memberName: arr.toString()})
this.form.setFieldsValue({memberName: arr.toString()})
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
console.log(values)
// 请求分发,或者批量分发接口
if (this.isBatch) {
// 批量分发
const formData = {
contactsIds: this.checkedKeys.join(','),
dataIds: this.recordId,
projectId: this.projectId,
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() {
this.close()
@@ -144,20 +184,23 @@ export default {
</script>
<style scoped lang="less">
.no-upload{
/deep/.ant-upload-select-text{
.no-upload {
/deep/ .ant-upload-select-text {
display: none;
}
}
/deep/.ant-form-explain{
/deep/ .ant-form-explain {
margin-top: 10px;
}
/deep/.ant-checkbox-group{
/deep/ .ant-checkbox-group {
width: 100%;
}
.choose-member{
/deep/#memberName{
display:none;
.choose-member {
/deep/ #memberName {
display: none;
}
}
</style>
@@ -18,7 +18,7 @@
:multiple="true"
:number="10"
:return-id="true"
v-decorator="['dataId', validatorRules.dataId]"
v-decorator="['fileIds', validatorRules.fileIds]"
:trigger-change="true"></j-upload>
</a-form-item>
</a-col>
@@ -30,12 +30,26 @@
<script>
import pick from 'lodash.pick'
import { getAction } from '@api/manage'
import { postAction } from '../../../api/manage'
import JUpload from '@comp/jero/JUpload'
export default {
name: 'WorkGroupFileUploadModal',
components: { JUpload },
props: {
// 项目id
projectId: {
type: String,
required: false,
default: ''
},
// 项目类型:1--工作组;2--分标委
projectType: {
type: Number,
require: false,
default: null
}
},
data() {
return {
title: '编辑',
@@ -54,19 +68,16 @@ export default {
sm: { span: 17 }
},
validatorRules: {
dataId: {
fileIds: {
rules: [{ required: true, message: '请上传文件' }],
validateTrigger: 'change'
}
},
url: {
add: '', // 资料和会议的添加 post
edit: '', // 资料和会议的编辑 post
add: '/project/payWorkingGroupDataFile/add', // 资料上传
edit: '' // 资料和会议的编辑 post
}
}
},
created(){
},
methods: {
add(data) {
@@ -78,7 +89,7 @@ export default {
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'dataId' ))
this.form.setFieldsValue(pick(this.model, 'dataId'))
})
},
close() {
@@ -86,41 +97,24 @@ export default {
this.visible = false
},
handleOk() {
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
console.log(values)
let httpurl = ''
let params = {}
if (!this.model.keyId) {
httpurl += this.url.add
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) {
that.$message.success(res.message)
that.$emit('ok')
that.close()
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
})
let params = values
params.projectId = this.projectId
params.projectType = this.projectType
postAction(this.url.add, params).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},