|
@@ -805,8 +805,9 @@
|
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
<!-- 附件 -->
|
|
<!-- 附件 -->
|
|
- <InvoiceReimbursementUpLoadComponent ref="invoiceReimbursementUpLoadComponent"
|
|
|
|
- v-show="'1' === this.inputForm.reimbursementType"></InvoiceReimbursementUpLoadComponent>
|
|
|
|
|
|
+ <InvoiceReimbursementUpLoadComponent @changeConfirmList="changeConfirmList"
|
|
|
|
+ ref="invoiceReimbursementUpLoadComponent" v-show="'1' === this.inputForm.reimbursementType">
|
|
|
|
+ </InvoiceReimbursementUpLoadComponent>
|
|
<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
<WorkContractChooseCom ref="workContractChooseCom" @getContract="getContract"></WorkContractChooseCom>
|
|
<WorkContractChooseCom ref="workContractChooseCom" @getContract="getContract"></WorkContractChooseCom>
|
|
<ReportNoChooseRadio ref="reportNoChooseRadio" @getWorkClientRadioChoose="getWorkClientChoose2">
|
|
<ReportNoChooseRadio ref="reportNoChooseRadio" @getWorkClientRadioChoose="getWorkClientChoose2">
|
|
@@ -823,6 +824,7 @@ import ReportNoChooseRadio from './ReportNoChooseRadio'
|
|
import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
|
|
import ReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
|
|
// import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
|
|
// import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
|
|
import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
|
|
import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
|
|
|
|
+import InvoiceConfirmStatusService from '@/api/finance/invoice/InvoiceConfirmStatusService'
|
|
import InvoiceReimbursementUpLoadComponent from '@/views/common/DigitalInvoiceUploadComponent'
|
|
import InvoiceReimbursementUpLoadComponent from '@/views/common/DigitalInvoiceUploadComponent'
|
|
import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
import XEUtils from 'xe-utils'
|
|
import XEUtils from 'xe-utils'
|
|
@@ -842,6 +844,8 @@ import ProjectListForm from './ProgramForm'
|
|
import CwProgramPageForm2 from './CwProgramPageForm2'
|
|
import CwProgramPageForm2 from './CwProgramPageForm2'
|
|
import userService from '@/api/sys/UserService'
|
|
import userService from '@/api/sys/UserService'
|
|
import taskService from "@/api/flowable/taskService.js";
|
|
import taskService from "@/api/flowable/taskService.js";
|
|
|
|
+
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
businessId: {
|
|
businessId: {
|
|
@@ -859,6 +863,8 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ currentNodeName: "",
|
|
|
|
+ confirmStatusList: [],
|
|
validRules: {
|
|
validRules: {
|
|
userName: [
|
|
userName: [
|
|
{ required: true, message: '报销人不能为空' }
|
|
{ required: true, message: '报销人不能为空' }
|
|
@@ -985,6 +991,7 @@ export default {
|
|
// reimbursementService: null,
|
|
// reimbursementService: null,
|
|
// reimbursementTypeService: null,
|
|
// reimbursementTypeService: null,
|
|
reimbursementApprovalTypeService: null,
|
|
reimbursementApprovalTypeService: null,
|
|
|
|
+ invoiceConfirmStatusService: null,
|
|
commonApi: null,
|
|
commonApi: null,
|
|
// materialManagementService: null,
|
|
// materialManagementService: null,
|
|
created() {
|
|
created() {
|
|
@@ -992,6 +999,8 @@ export default {
|
|
// this.reimbursementService = new ReimbursementService()
|
|
// this.reimbursementService = new ReimbursementService()
|
|
// this.reimbursementTypeService = new ReimbursementTypeService()
|
|
// this.reimbursementTypeService = new ReimbursementTypeService()
|
|
this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
|
|
this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
|
|
|
|
+ this.invoiceConfirmStatusService = new InvoiceConfirmStatusService()
|
|
|
|
+
|
|
this.commonApi = new CommonApi()
|
|
this.commonApi = new CommonApi()
|
|
// this.materialManagementService = new MaterialManagementService()
|
|
// this.materialManagementService = new MaterialManagementService()
|
|
if (this.$store.state.user.name === '潘中') {
|
|
if (this.$store.state.user.name === '潘中') {
|
|
@@ -1105,7 +1114,6 @@ export default {
|
|
this.loading = true
|
|
this.loading = true
|
|
this.$refs.inputForm.resetFields()
|
|
this.$refs.inputForm.resetFields()
|
|
this.reimbursementApprovalService.findById(this.inputForm.id).then((data) => {
|
|
this.reimbursementApprovalService.findById(this.inputForm.id).then((data) => {
|
|
- console.log('data', data)
|
|
|
|
this.$refs.invoiceReimbursementUpLoadComponent.clearUpload()
|
|
this.$refs.invoiceReimbursementUpLoadComponent.clearUpload()
|
|
this.$refs.uploadComponent.clearUpload()
|
|
this.$refs.uploadComponent.clearUpload()
|
|
if (this.status === 'audit' || this.status === 'taskFormDetail') {
|
|
if (this.status === 'audit' || this.status === 'taskFormDetail') {
|
|
@@ -1145,6 +1153,26 @@ export default {
|
|
if (this.commonJS.isNotEmpty(this.inputForm.purchaseId)) {
|
|
if (this.commonJS.isNotEmpty(this.inputForm.purchaseId)) {
|
|
this.startPur(this.inputForm.purchaseId)
|
|
this.startPur(this.inputForm.purchaseId)
|
|
}
|
|
}
|
|
|
|
+ // 获取当前审核节点
|
|
|
|
+ this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(name => {
|
|
|
|
+ this.currentNodeName = name
|
|
|
|
+ if (name == "综合管理部主任审批" || name == "财务审批") {
|
|
|
|
+ this.$refs.invoiceReimbursementUpLoadComponent.isConfirm = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // 获取文件确认状态
|
|
|
|
+ this.invoiceConfirmStatusService.getListByUser(this.inputForm.id).then(data => {
|
|
|
|
+ console.log(data);
|
|
|
|
+ // 先构建一个 Map 方便查找
|
|
|
|
+ const statusMap = new Map(data.map(item => [item.invoiceId, item.status]));
|
|
|
|
+ // 遍历 targetArray 给每项加 confirmStatus
|
|
|
|
+ this.inputForm.invoiceReimbursementFiles.forEach(item => {
|
|
|
|
+ const status = statusMap.get(item.id);
|
|
|
|
+ if (status !== undefined) {
|
|
|
|
+ item.confirmStatus = status;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
if (method !== 'edit' && method !== 'view') {
|
|
if (method !== 'edit' && method !== 'view') {
|
|
@@ -1739,6 +1767,7 @@ export default {
|
|
this.loading = true
|
|
this.loading = true
|
|
this.reimbursementApprovalService.findById(this.inputForm.id).then((data) => {
|
|
this.reimbursementApprovalService.findById(this.inputForm.id).then((data) => {
|
|
if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
|
|
if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
|
|
|
|
+
|
|
taskService.getTaskAuditUsersByprocInstId(this.$route.query.procInsId).then(res => {
|
|
taskService.getTaskAuditUsersByprocInstId(this.$route.query.procInsId).then(res => {
|
|
let userInfo = this.$TOOL.data.get("USER_INFO");
|
|
let userInfo = this.$TOOL.data.get("USER_INFO");
|
|
// 如果审核人是本人的话,则跳过数据状态的限制,可再次审批
|
|
// 如果审核人是本人的话,则跳过数据状态的限制,可再次审批
|
|
@@ -1782,9 +1811,11 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- console.log('this.inputForm', this.inputForm)
|
|
|
|
this.reimbursementApprovalService.save(this.inputForm).then((data) => {
|
|
this.reimbursementApprovalService.save(this.inputForm).then((data) => {
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
|
+ if (this.currentNodeName == "综合管理部主任审批" || this.currentNodeName == "财务审批") {
|
|
|
|
+ this.changeStatusApi()
|
|
|
|
+ }
|
|
this.loading = false
|
|
this.loading = false
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -1847,6 +1878,7 @@ export default {
|
|
console.log('this.inputForm', this.inputForm)
|
|
console.log('this.inputForm', this.inputForm)
|
|
this.reimbursementApprovalService.save(this.inputForm).then((data) => {
|
|
this.reimbursementApprovalService.save(this.inputForm).then((data) => {
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
|
+ this.changeStatusApi()
|
|
this.loading = false
|
|
this.loading = false
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -2765,6 +2797,30 @@ export default {
|
|
]
|
|
]
|
|
return footerData
|
|
return footerData
|
|
},
|
|
},
|
|
|
|
+ changeConfirmList(row) {
|
|
|
|
+ // 如果 confirmStatusList 中存在这个 row.id,则移除
|
|
|
|
+ const index = this.confirmStatusList.findIndex(item => item === row.id);
|
|
|
|
+ if (index !== -1) {
|
|
|
|
+ this.confirmStatusList.splice(index, 1);
|
|
|
|
+ row.confirmStatus = "0"
|
|
|
|
+ } else {
|
|
|
|
+ this.confirmStatusList.push(row.id);
|
|
|
|
+ row.confirmStatus = "1"
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async changeStatusApi() {
|
|
|
|
+ if (this.$refs.invoiceReimbursementUpLoadComponent.getDataList().length == 0) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let invoiceStatusIds = this.$refs.invoiceReimbursementUpLoadComponent.getDataList().map(item => {
|
|
|
|
+ return item.id
|
|
|
|
+ }).join(",")
|
|
|
|
+ await this.invoiceConfirmStatusService.save({
|
|
|
|
+ invoiceId: invoiceStatusIds,
|
|
|
|
+ status: "1",
|
|
|
|
+ reimbursementId: this.inputForm.id
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|