bug修改

This commit is contained in:
zhaoxiao
2021-09-27 16:36:00 +08:00
parent 267804b4c2
commit f6b0bb93bb
11 changed files with 167 additions and 50 deletions
@@ -307,7 +307,7 @@ export default {
checkDutyCode(rules, value, callback) { checkDutyCode(rules, value, callback) {
if (value) { if (value) {
if (!dutyCode(value)) { if (!dutyCode(value)) {
callback('请输入15位、18位数字和大写英文字母') callback('请输入15位、18位的信用代码')
return return
} }
if (!this.model.id) { if (!this.model.id) {
@@ -602,6 +602,7 @@ export default {
calculateOutstandingAmount() { calculateOutstandingAmount() {
if (this.accountsReceivableNum !== null && this.amountReceivedNum !== null) { if (this.accountsReceivableNum !== null && this.amountReceivedNum !== null) {
this.model.outstandingAmount = Number(this.accountsReceivableNum) - Number(this.amountReceivedNum) this.model.outstandingAmount = Number(this.accountsReceivableNum) - Number(this.amountReceivedNum)
this.model.outstandingAmount = this.model.outstandingAmount.toFixed(2)
if (this.model.outstandingAmount === 0) { if (this.model.outstandingAmount === 0) {
this.model.accountStatus = '3' this.model.accountStatus = '3'
} else if (this.model.outstandingAmount > 0 && this.model.outstandingAmount < Number(this.accountsReceivableNum)) { } else if (this.model.outstandingAmount > 0 && this.model.outstandingAmount < Number(this.accountsReceivableNum)) {
@@ -663,6 +663,7 @@ export default {
calculateOutstandingAmount() { calculateOutstandingAmount() {
if (this.accountsReceivableNum !== null && this.amountReceivedNum !== null) { if (this.accountsReceivableNum !== null && this.amountReceivedNum !== null) {
this.model.outstandingAmount = Number(this.accountsReceivableNum) - Number(this.amountReceivedNum) this.model.outstandingAmount = Number(this.accountsReceivableNum) - Number(this.amountReceivedNum)
this.model.outstandingAmount = this.model.outstandingAmount.toFixed(2)
// 未收金额 === 0,已付全款状态 // 未收金额 === 0,已付全款状态
if (this.model.outstandingAmount <= 0) { if (this.model.outstandingAmount <= 0) {
this.model.accountStatus = '3' this.model.accountStatus = '3'
@@ -69,7 +69,7 @@
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="false" :pagination="false"
:loading="loading" :loading="confirmLoading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange" @change="handleTableChange"
class="j-table-force-nowrap"> class="j-table-force-nowrap">
@@ -292,6 +292,7 @@ export default {
this.$message.warn('请选择项目后再提交关联') this.$message.warn('请选择项目后再提交关联')
return return
} }
this.confirmLoading = true
let submitData = [] let submitData = []
let projectItem let projectItem
this.selectedRowKeys.forEach(item => { this.selectedRowKeys.forEach(item => {
@@ -309,6 +310,8 @@ export default {
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
} }
}).finally(() => {
this.confirmLoading = false
}) })
}, },
handleCancel() { handleCancel() {
@@ -50,7 +50,7 @@
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="false" :pagination="false"
:loading="loading" :loading="confirmLoading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange" @change="handleTableChange"
class="j-table-force-nowrap"> class="j-table-force-nowrap">
@@ -74,7 +74,7 @@
<!-- 工作组项目新增--> <!-- 工作组项目新增-->
<working-group-member-unit-module <working-group-member-unit-module
ref="workingGroupMemberForm" ref="workingGroupMemberForm"
@ok="modalFormOk" @ok="addOk"
v-bind="$attrs" v-bind="$attrs"
:disabled-charge-company="true" :disabled-charge-company="true"
:is-contract-num-disabled="true" :is-contract-num-disabled="true"
@@ -183,6 +183,7 @@ export default {
this.$message.warn('请选择项目后再提交关联') this.$message.warn('请选择项目后再提交关联')
return return
} }
this.confirmLoading = true
let submitData = [] let submitData = []
let projectItem let projectItem
this.selectedRowKeys.forEach(item => { this.selectedRowKeys.forEach(item => {
@@ -201,6 +202,8 @@ export default {
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
} }
}).finally(() => {
this.confirmLoading = false
}) })
}, },
handleCancel() { handleCancel() {
@@ -219,6 +222,13 @@ export default {
return ( return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
) )
},
/**
* 新增完成后关闭两个对话框
*/
addOk() {
this.close()
this.$emit('ok')
} }
} }
} }
+29 -5
View File
@@ -93,11 +93,17 @@
<!-- 个人统计--> <!-- 个人统计-->
<div class="container-item"> <div class="container-item">
<div class="container-item-title">个人统计(前10)</div> <div class="container-item-title">个人统计(前10)</div>
<div class="container-item-echarts" id="personalStatistics"></div> <template v-if="personalData.length > 0">
<div class="container-item-echarts" id="personalStatistics"></div>
</template>
<a-empty v-else/>
</div> </div>
<div class="container-item"> <div class="container-item">
<div class="container-item-title">科室统计(前10)</div> <div class="container-item-title">科室统计(前10)</div>
<div class="container-item-echarts" id="departStatistics"></div> <template v-if="departData.length > 0">
<div class="container-item-echarts" id="departStatistics"></div>
</template>
<a-empty v-else/>
</div> </div>
</div> </div>
<!-- 工作组统计and企业统计--> <!-- 工作组统计and企业统计-->
@@ -105,11 +111,17 @@
<!-- 个人统计--> <!-- 个人统计-->
<div class="container-item"> <div class="container-item">
<div class="container-item-title">工作组统计(前10)</div> <div class="container-item-title">工作组统计(前10)</div>
<div class="container-item-echarts" id="workingGroupStatistics"></div> <template v-if="workingGroupData.length > 0">
<div class="container-item-echarts" id="workingGroupStatistics"></div>
</template>
<a-empty v-else/>
</div> </div>
<div class="container-item"> <div class="container-item">
<div class="container-item-title">企业统计(前10)</div> <div class="container-item-title">企业统计(前10)</div>
<div class="container-item-echarts" id="companyStatistics"></div> <template v-if="companyData.length > 0">
<div class="container-item-echarts" id="companyStatistics"></div>
</template>
<a-empty v-else/>
</div> </div>
</div> </div>
</div> </div>
@@ -173,7 +185,7 @@ export default {
position: 'center', position: 'center',
formatter: function (params) { formatter: function (params) {
return params.name.length > 8 ? params.name.substr(0, 8) + '...' : params.name return params.name.length > 8 ? params.name.substr(0, 8) + '...' : params.name
}, }
}, },
emphasis: { emphasis: {
label: { label: {
@@ -226,6 +238,9 @@ export default {
* 初始化个人统计echarts * 初始化个人统计echarts
*/ */
initPersonalStatisticsEcharts() { initPersonalStatisticsEcharts() {
if (this.personalData.length === 0) {
return
}
let strData = JSON.stringify(this.personalData) let strData = JSON.stringify(this.personalData)
strData = strData.replaceAll('principalName', 'name').replaceAll('comeAllMoney', 'value') strData = strData.replaceAll('principalName', 'name').replaceAll('comeAllMoney', 'value')
let arr = JSON.parse(strData) let arr = JSON.parse(strData)
@@ -248,6 +263,9 @@ export default {
* 初始化科室统计echarts * 初始化科室统计echarts
*/ */
initDepartStatisticsEcharts() { initDepartStatisticsEcharts() {
if (this.departData.length === 0) {
return
}
let strData = JSON.stringify(this.departData) let strData = JSON.stringify(this.departData)
strData = strData.replaceAll('departName', 'name').replaceAll('comeAllMoney', 'value') strData = strData.replaceAll('departName', 'name').replaceAll('comeAllMoney', 'value')
let arr = JSON.parse(strData) let arr = JSON.parse(strData)
@@ -270,6 +288,9 @@ export default {
* 初始化工作组统计echarts * 初始化工作组统计echarts
*/ */
initWorkingGroupStatisticsEcharts() { initWorkingGroupStatisticsEcharts() {
if (this.workingGroupData.length === 0) {
return
}
let strData = JSON.stringify(this.workingGroupData) let strData = JSON.stringify(this.workingGroupData)
strData = strData.replaceAll('workGroup', 'name').replaceAll('comeAllMoney', 'value') strData = strData.replaceAll('workGroup', 'name').replaceAll('comeAllMoney', 'value')
let arr = JSON.parse(strData) let arr = JSON.parse(strData)
@@ -292,6 +313,9 @@ export default {
* 初始化企业统计echarts * 初始化企业统计echarts
*/ */
initCompanyStatisticsEcharts() { initCompanyStatisticsEcharts() {
if (this.companyData.length === 0) {
return
}
let strData = JSON.stringify(this.companyData) let strData = JSON.stringify(this.companyData)
strData = strData.replaceAll('chargeCompanyName', 'name').replaceAll('comeAllMoney', 'value') strData = strData.replaceAll('chargeCompanyName', 'name').replaceAll('comeAllMoney', 'value')
let arr = JSON.parse(strData) let arr = JSON.parse(strData)
@@ -44,13 +44,13 @@
<!-- table表格区域--> <!-- table表格区域-->
<div> <div>
<a-table rowKey="id" <a-table rowKey="id"
v-if="dataSource.length > 0" size="middle"
:scroll="{x: 1300}" :scroll="{x: 1300}"
:columns="columns" :columns="columns"
:data-source="dataSource" :data-source="dataSource"
:pagination="ipagination" :pagination="ipagination"
:expandedRowKeys.sync="expandedRowKeys"
bordered bordered
:defaultExpandAllRows="true"
:loading="loading" :loading="loading"
@change="handleTableChange" @change="handleTableChange"
class="j-table-force-nowrap"> class="j-table-force-nowrap">
@@ -190,10 +190,52 @@ export default {
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }
], ],
dataSource: [] dataSource: [],
expandedRowKeys: [], // 展开数据的id
} }
}, },
methods: { methods: {
loadData(arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
// 清除展开的行id
this.expandedRowKeys = []
var params = this.getQueryParams()//查询条件
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records || res.result
// 表格有数据则需要展开
if (this.dataSource.length > 0) {
this.dataSource.forEach(item => {
this.expandedRowKeys.push(item.id)
})
this.$forceUpdate()
}
if (res.result.total) {
this.ipagination.total = res.result.total
//清空列表选中
this.onClearSelected()
} else {
this.ipagination.total = 0
}
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
}
if (res.code === 510) {
this.$message.warning(res.message)
}
this.loading = false
}).finally(() => {
this.loading = false
})
},
// 下拉框的搜索 // 下拉框的搜索
filterOption(input, option) { filterOption(input, option) {
return ( return (
@@ -46,10 +46,10 @@
class="j-table-force-nowrap"> class="j-table-force-nowrap">
<!-- 输入--> <!-- 输入-->
<template slot="input-text" slot-scope="text, record"> <template slot="input-text" slot-scope="text, record, index">
<a-input placeholder="请输入备注" <a-input placeholder="请输入备注"
v-model="record.remark"
:maxLength='50' :maxLength='50'
v-model="remarkList[index]"
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input> @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</template> </template>
@@ -81,7 +81,9 @@ export default {
tableData: { tableData: {
type: Array, type: Array,
required: false, required: false,
default: [] default: () => {
return []
}
}, },
visible: { visible: {
type: Boolean, type: Boolean,
@@ -168,6 +170,7 @@ export default {
} }
], ],
dataSource: [], dataSource: [],
remarkList: [], // 备注列表
inputIncomingAmount: null, // 输入的来款金额 inputIncomingAmount: null, // 输入的来款金额
disableMixinCreated: true, disableMixinCreated: true,
sumAmountOwed: 0 // 总欠款金额 sumAmountOwed: 0 // 总欠款金额
@@ -197,14 +200,14 @@ export default {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
let formData = [] let formData = []
this.dataSource.forEach(item => { this.dataSource.forEach((item, index) => {
if (Number(item.thisIncomingAmount) > 0) { if (Number(item.thisIncomingAmount) > 0) {
let obj = { let obj = {
amountReceived: item.thisIncomingAmount, amountReceived: item.thisIncomingAmount,
paymentDate: values.paymentDate, paymentDate: values.paymentDate,
projectId: item.id, projectId: item.id,
projectType: item.projectType, projectType: item.projectType,
remark: item.remark remark: this.remarkList[index]
} }
formData.push(obj) formData.push(obj)
} }
@@ -227,13 +230,14 @@ export default {
}, },
open() { open() {
this.dataSource = this.tableData this.dataSource = this.tableData
this.dataSource.forEach(item => { this.dataSource.forEach(() => {
item.remark = null this.remarkList.push('')
}) })
this.loadData() this.loadData()
}, },
close() { close() {
this.form.resetFields() this.form.resetFields()
this.remarkList = []
this.clearThisTimeAmount() this.clearThisTimeAmount()
this.$emit('update:visible', false) this.$emit('update:visible', false)
}, },
@@ -85,10 +85,10 @@
</template> </template>
<!-- 输入--> <!-- 输入-->
<template slot="input-text" slot-scope="text, record"> <template slot="input-text" slot-scope="text, record, index">
<a-input placeholder="请输入备注" <a-input placeholder="请输入备注"
v-model="record.remark"
:maxLength='50' :maxLength='50'
v-model="remarkList[index]"
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input> @change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
</template> </template>
@@ -146,6 +146,11 @@ export default {
if (value) { if (value) {
this.open() this.open()
} }
},
packContactId(value) {
if (value) {
this.postContactChange(value)
}
} }
}, },
data() { data() {
@@ -209,6 +214,7 @@ export default {
} }
], ],
dataSource: [], dataSource: [],
remarkList: [], // 备注列表
validatorRules: { validatorRules: {
invoiceAmount: { invoiceAmount: {
rules: [{ required: true, validator: this.checkMoney }], rules: [{ required: true, validator: this.checkMoney }],
@@ -236,7 +242,8 @@ export default {
} }
}, },
inputInvoicingAmount: null, // 输入的开票金额 inputInvoicingAmount: null, // 输入的开票金额
sumAmountOwed: 0 // 总未开票金额 sumAmountOwed: 0, // 总未开票金额,
packContact: {}, // 邮寄联系人信息
} }
}, },
methods: { methods: {
@@ -290,7 +297,12 @@ export default {
postalCode: res.result.postalCode, postalCode: res.result.postalCode,
contactAddress: res.result.contactAddress contactAddress: res.result.contactAddress
} }
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress')) if (this.packContactId) {
this.packContact = obj
this.packContact.contactId = value
} else {
this.form.setFieldsValue(pick(obj, 'postalCode', 'contactAddress'))
}
}) })
}, },
/** /**
@@ -333,16 +345,19 @@ export default {
if (!err) { if (!err) {
let bmpList = [] let bmpList = []
let data = this.dataSource.filter(tt => tt.thisInvoicingAmount !== 0 && tt.thisInvoicingAmount) let data = this.dataSource.filter(tt => tt.thisInvoicingAmount !== 0 && tt.thisInvoicingAmount)
data.forEach(item => { data.forEach((item, index) => {
let obj = { let obj = {
invoiceAmount: item.thisInvoicingAmount, invoiceAmount: item.thisInvoicingAmount,
projectId: item.id, projectId: item.id,
projectType: item.projectType, projectType: item.projectType,
remark: item.remark remark: this.remarkList[index]
} }
bmpList.push(obj) bmpList.push(obj)
}) })
let param = values let param = values
if (this.packContactId) {
param = Object.assign(param, this.packContact)
}
param.bmpList = bmpList param.bmpList = bmpList
addPayBill(param).then(res => { addPayBill(param).then(res => {
if (res.success) { if (res.success) {
@@ -360,10 +375,9 @@ export default {
this.close() this.close()
}, },
open() { open() {
console.log(this.selectedData)
this.dataSource = this.selectedData this.dataSource = this.selectedData
this.dataSource.forEach(item => { this.dataSource.forEach(() => {
item.remark = null this.remarkList.push('')
}) })
this.loadData() this.loadData()
}, },
@@ -92,11 +92,13 @@
</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="goFilesMaintenance(record)" v-has="'workingGroupProject:fileMaintenance'">文件维护</a> <template v-if="record.showOperate">
<a @click="goConferenceMaintenance(record)" v-has="'workingGroupProject:meetingMaintenance'">会议维护</a> <a @click="goFilesMaintenance(record)" v-has="'workingGroupProject:fileMaintenance'">文件维护</a>
<a @click="copyWorkGroup(record.id)" v-has="'workingGroupProject:copy'" v-if="record.canOperate">复制</a> <a @click="goConferenceMaintenance(record)" v-has="'workingGroupProject:meetingMaintenance'">会议维护</a>
<a @click="handleEdit(record)" v-has="'workingGroupProject:edit'" v-if="record.canOperate">编辑</a> <a @click="copyWorkGroup(record.id)" v-has="'workingGroupProject:copy'" v-if="record.canOperate">复制</a>
<a @click="handleDelete(record.id)" v-has="'workingGroupProject:delete'" v-if="record.canOperate">删除</a> <a @click="handleEdit(record)" v-has="'workingGroupProject:edit'" v-if="record.canOperate">编辑</a>
<a @click="handleDelete(record.id)" v-has="'workingGroupProject:delete'" v-if="record.canOperate">删除</a>
</template>
</span> </span>
</a-table> </a-table>
</div> </div>
@@ -170,7 +172,8 @@ export default {
width: 300, width: 300,
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }
] ],
operateData: [] // 进行操作权限校验时使用的数据
} }
}, },
methods: { methods: {
@@ -196,19 +199,6 @@ export default {
} else { } else {
this.ipagination.total = 0 this.ipagination.total = 0
} }
// 判断登录用户是否为负责人B
this.dataSource.forEach((item, index) => {
// (负责人B不可操作)
checkoutWorkingGroupPrincipal({ id: item.id }).then(res => {
// 不可操作则置否
if (res.success) {
item.canOperate = true
} else {
item.canOperate = false
}
this.$set(this.dataSource, index, item)
})
})
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
} }
if (res.code === 510) { if (res.code === 510) {
@@ -216,6 +206,34 @@ export default {
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
// 判断登录用户是否为负责人B
if (this.dataSource.length > 0) {
for (let index = 0; index < this.dataSource.length; index++) {
this.checkWorkingGroupPrincipal(index).then((res) => {
res.showOperate = true
this.$set(this.dataSource, index, res)
})
}
}
})
},
/**
* 判断登录用户是否为负责人B
*/
checkWorkingGroupPrincipal(index) {
let item = this.dataSource[index]
// (负责人B不可操作)
return new Promise(resolve => {
checkoutWorkingGroupPrincipal({ id: item.id }).then(res => {
// 不可操作则置否
if (res.success) {
item.canOperate = true
} else {
item.canOperate = false
}
}).finally(() => {
resolve(item)
})
}) })
}, },
/** /**
@@ -139,10 +139,10 @@
</a-col> </a-col>
<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">
<j-upload file-type="pdf" <j-upload file-type-error-message="请上传收费通知"
file-type-error-message="请pdf文件" :multiple="true"
:multiple="false"
:return-id="true" :return-id="true"
:number="1"
bizPath="payment" bizPath="payment"
v-decorator="['chargeNoticeId', validatorRules.chargeNoticeId]" v-decorator="['chargeNoticeId', validatorRules.chargeNoticeId]"
:trigger-change="true"></j-upload> :trigger-change="true"></j-upload>