From 8001df7d975e51a467f3eaf05da27186b5e004e1 Mon Sep 17 00:00:00 2001 From: super_liu <396572590@qq.com> Date: Thu, 10 Feb 2022 20:40:01 +0800 Subject: [PATCH] feat: There is no way the, --- .../pages/creatProcess/qbfs/step1.vue | 964 ++++++++++++++---- 1 file changed, 770 insertions(+), 194 deletions(-) diff --git a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue index 1a6c39107..ae9766055 100644 --- a/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/qbfs/step1.vue @@ -9,11 +9,8 @@
基础信息
人员信息
-
+
- - - - - 选择企业标准 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

{{ item.oldFileName }} - - -

-
-
- 暂无数据 -
+ + 选择复审企标 +
+
+ + 批量编辑 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -148,10 +253,10 @@ :model="roleForm" :rules="roleFormRules" class="label-input-form"> - + -

标准法规工程师

+

流程发起人

- + - -

工作组组组长

+ +

标准法规部高级经理

- - + +
@@ -178,6 +282,48 @@
+ 自动创建流程 + + + + + + + + + + + + + + + 带入
+ +
+
+ + + + + + + + + + + + 查询 + + + + 清空 + + +
+
+ + + + + + + + + + + + + + + + + {{$t('m.dataAcquisition')}} + + + +
@@ -362,8 +620,38 @@ export default { ProcessFooter, ProcessTitle }, + filters: { + ellipsis (value) { + if (!value) return '' + if (value.length > 15) { + return value.slice(0,15) + '...' + } + return value + }, + ellipsis2 (value) { + if (!value) return '' + if (value.length > 10) { + return value.slice(0,10) + '...' + } + return value + } + }, data(){ + const bussFsSubUser1NameVal = (rule, value, callback) => { + if(value === undefined || value === ''){ + return callback(new Error('请选择对接人')) + }else { + callback() + } + }; return { + loading:false, + tableHeight: null, + nodeList2: [], + zrType: '', + zrIndex: '', + zrIdList: [], + type: '', bpnId: '', active: '1', commentText: '', @@ -375,15 +663,36 @@ export default { total: 0, pageSize: this.$store.getters.userInfo.configContent, drawerTitle: '', + replaceLawsNumRow: [], // 代替政策号 数组内容 + replaceLoading: true, + replaceLawsNumModel: false, + replacePage: 1, + replaceTotal: 0, + replaceRows: 10, + replaceLawsNumForm: { + standCode: '', // 标准编号 + reviewTimeArr:'', + reviewTimeStart:'', + reviewTimeEnd:'', + issueTimeArr:'', + issueTimeStart:'', + issueTimeEnd:'', + page: 1, + pageSize: this.$store.getters.userInfo.configContent, + total: 0, + validFlag: '0', + }, ListModel: false, saveLoading: false, isSubmit: false, - modalshowflag: false, + modalShowFlag: false, standardSearch: { standCode: "", standName: "" }, + modelDataSelect:[], qbfsForm:{ + modelData:[], entNumber: '', cnName: '', enName: '', @@ -399,17 +708,31 @@ export default { prcCreateUser: this.$store.getters.userInfo.userId, dockUser: "", dockUserName: "", + bussFsSubUser2: "", // 对接人选择复审人 + bussFsSubUser2Name: "", + bussFsUser2: this.$store.getters.userInfo.userId, // 发起人汇总人 + bussFsUser2Name: this.$store.getters.userInfo.userName, + bussFsUserC2: this.$store.getters.userInfo.userId, // 重新发起人汇总人 + bussFsUserC2Name: this.$store.getters.userInfo.userName, + bussFsUser3: "", // 标准法规部高级经理 + bussFsUser3Name: "", }, //必填人员校验规则 roleFormRules: { dockUserName: [ {required: true, message: "请选择工作组组长", trigger: "change"} ], + bussFsUser3Name: [ + {required: true, message: "请选择标准法规部高级经理", trigger: "change"} + ], }, formRules: { entNumber: [ {required: true, message: "请填写企标编号", trigger: "change"} ], + bussFsSubUser1Name: [ + {required: true, validator: bussFsSubUser1NameVal, trigger: 'blur'}, + ], }, } }, @@ -418,9 +741,214 @@ export default { if (this.bpnId !== undefined) { this.getDatas() } + this.tableHeight = $('#fsTableHeight').height() - 44 - 20 + window.onresize = () => { + this.tableHeight = $('#fsTableHeight').height() - 44 - 20 + } this.getData() }, methods: { + replaceLawsNumModelBt(){ + if(this.modelDataSelect && this.modelDataSelect.length > 0){ + this.qbfsForm.modelData = [] + this.qbfsForm.modelData = this.modelDataSelect + } + console.log(this.qbfsForm.modelData) + this.replaceLawsNumModel = false + }, + // 更多 + handleCommand (command) { + if (command[2] === '删除') { + this.handleDelete(command[0],command[1]) + } + }, + handleDelete(val, row) { + // 模态框删除按钮 + this.$confirm("是否确认删除本条数据?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "info" + }).then(() => { + // 此为假删除,只是删除了模态框中当前行的数据,并没有真正删除表格数据 + // const ids = [] + // ids.push(row.id) + // this.form.modelData = this.changeRestTree(this.deletedId(this.form.modelData,ids)) + this.qbfsForm.modelData.splice(val,1) + this.$message({ + message: "删除成功", + type: "success", + duration: 2000 + }); + this.$forceUpdate() + }); + }, + handleSelectionChange(val) { + this.zrIdList = [] + val.forEach(item => { + this.zrIdList.push(item.id) + }) + }, + choiceZRRS(row, type, index) { + this.type = type + if (type === 1) { + this.drawerTitle = '选择对接人' + this.nodeList = [] + this.zrIndex = index + this.zrType = type + this.nodeList.push(row) + this.modalShowFlag = true + } else if (type === 2) { + // 批量 + if (this.zrIdList.length > 0) { + this.zrType = type + this.nodeList = [] + this.modalShowFlag = true + this.drawerTitle = '批量选择对接人' + } else { + this.$message.warning('请选择要编辑的数据') + } + } else { + this.nodeList = [] + this.nodeList.push(row) + this.drawerTitle = '' + this.modalShowFlag = true + } + }, + selectReplaceStandNumRowChange(val) { + this.modelDataSelect = val + }, + formatIssueDate(str) { + if(str && str.length > 10){ + str = str.substring(0,10) + } + return str + }, + filterOp(data){ + if(!data || data === ""){ + return "" + } + const map = new Map(); + map.set(1,"修订"); + map.set(2,"废止"); + map.set(3,"继续有效"); + return map.get(data) + }, + selectBuss(){ + this.replaceLawsNumModel = true + this.getReplaceLawsNumRow() + }, + replaceLawsNumModelCancel () { + // this.replaceLawsNumModel = false + this.$refs.selections.clearSelection() + }, + pageChangeReplace (page) { + this.replacePage = page + this.replaceLawsNumForm.page = page + this.getReplaceLawsNumRow() + }, + pageSizeChangeReplace (pageSize) { + // this.replaceRows = pageSize + this.replaceLawsNumForm.pageSize = pageSize + this.getReplaceLawsNumRow() + }, + getResetLawsNumRow () { + this.replaceLawsNumForm = { + standCode: '', // 标准编号 + reviewTimeArr:'', + reviewTimeStart:'', + reviewTimeEnd:'', + issueTimeArr:'', + issueTimeStart:'', + issueTimeEnd:'', + page: 1, + pageSize: this.$store.getters.userInfo.configContent, + total: 0, + validFlag: '0', + } + this.getReplaceLawsNumRow() + }, + getReplaceLawsNumRow () { + if(this.replaceLawsNumForm.issueTimeArr && this.replaceLawsNumForm.issueTimeArr.length > 0){ + this.replaceLawsNumForm.issueTimeStart = this.replaceLawsNumForm.issueTimeArr[0] || null + this.replaceLawsNumForm.issueTimeEnd = this.replaceLawsNumForm.issueTimeArr[1] || null + }else{ + this.replaceLawsNumForm.issueTimeStart = "" + this.replaceLawsNumForm.issueTimeEnd = "" + } + if(this.replaceLawsNumForm.reviewTimeArr && this.replaceLawsNumForm.reviewTimeArr.length > 0){ + this.replaceLawsNumForm.reviewTimeStart = this.replaceLawsNumForm.reviewTimeArr[0] || null + this.replaceLawsNumForm.reviewTimeEnd = this.replaceLawsNumForm.reviewTimeArr[1] || null + }else{ + this.replaceLawsNumForm.reviewTimeStart = "" + this.replaceLawsNumForm.reviewTimeEnd = "" + } + this.$http.get('lawss/sarBussionessStandState/getSarBussionStandPageNo', this.replaceLawsNumForm, { + _this: this, + loading: 'replaceLoading' + }, res => { + if(res.data.list && res.data.list.length > 0){ + res.data.list.forEach(item =>{ + item.processStatus = '' + item.bussFsSubUser1 = '' + item.bussFsSubUser1Name = '' + }) + } + this.replaceLawsNumRow = res.data.list + this.replaceTotal = res.data.count + if (this.selectedListRep.length !== 0) { + this.selectedListRep.map((list) => { + this.replaceLawsNumRow.map((item) => { + if (list.id === item.id) { + item._checked = true + } + }) + }) + } + }, e => { + }) + }, + getReplaceLawsNumRowFirst () { + this.replaceLawsNumForm.page = 1 + this.replacePage = 1 + if(this.replaceLawsNumForm.issueTimeArr && this.replaceLawsNumForm.issueTimeArr.length > 0){ + this.replaceLawsNumForm.issueTimeStart = this.replaceLawsNumForm.issueTimeArr[0] || null + this.replaceLawsNumForm.issueTimeEnd = this.replaceLawsNumForm.issueTimeArr[1] || null + }else{ + this.replaceLawsNumForm.issueTimeStart = "" + this.replaceLawsNumForm.issueTimeEnd = "" + } + if(this.replaceLawsNumForm.reviewTimeArr && this.replaceLawsNumForm.reviewTimeArr.length > 0){ + this.replaceLawsNumForm.reviewTimeStart = this.replaceLawsNumForm.reviewTimeArr[0] || null + this.replaceLawsNumForm.reviewTimeEnd = this.replaceLawsNumForm.reviewTimeArr[1] || null + }else{ + this.replaceLawsNumForm.reviewTimeStart = "" + this.replaceLawsNumForm.reviewTimeEnd = "" + } + this.$http.get('lawss/sarBussionessStandState/getSarBussionStandPageNo', this.replaceLawsNumForm, { + _this: this, + loading: 'replaceLoading' + }, res => { + if(res.data.list && res.data.list.length > 0){ + res.data.list.forEach(item =>{ + item.processStatus = '' + item.bussFsSubUser1 = '' + item.bussFsSubUser1Name = '' + }) + } + this.replaceLawsNumRow = res.data.list + this.replaceTotal = res.data.count + if (this.selectedListRep.length !== 0) { + this.selectedListRep.map((list) => { + this.replaceLawsNumRow.map((item) => { + if (list.id === item.id) { + item._checked = true + } + }) + }) + } + }, e => { + }) + }, getDatas(){ queryTaskFirst({ bpnId: this.$route.query.bpnId @@ -432,18 +960,20 @@ export default { }); }, getData() { - return new Promise((resolve, reject) => { - inboundLiaisonDetail({ - taskIds: this.$route.query.taskIds, - pId: this.$route.query.prcId - }).then(res => { - if (res) { - const processForm = JSON.parse(res.mesg); - this.getFormFieldList(processForm); - } - }).catch(e => { + if(this.taskIds && this.pId){ + return new Promise((resolve, reject) => { + inboundLiaisonDetail({ + taskIds: this.$route.query.taskIds, + pId: this.$route.query.prcId + }).then(res => { + if (res) { + const processForm = JSON.parse(res.mesg); + this.getFormFieldList(processForm); + } + }).catch(e => { + }); }); - }); + } }, /** * @description: 动态表单读取 @@ -459,8 +989,8 @@ export default { this.active = name; }, choiceShow(){ - this.getStandDataBtn() - this.ListModel = true; + this.getReplaceLawsNumRow() + this.replaceLawsNumModel = true; }, getStandDataBtns(){ this.$http.get('lawss/sarBussionessStand/getSarBussionStandPage',{ @@ -545,7 +1075,7 @@ export default { let routeUrl = this.$router.resolve({ name: 'OtherBussStandardDetails', params: { - id: item.id, + id: item.standId, pageType: 'BUSINESS_STAND' } }) @@ -558,7 +1088,7 @@ export default { _formData.append('id', this.bpnId || '') _formData.append('createUser', this.$store.getters.userInfo.userId) _formData.append('createUserName', this.$store.getters.userInfo.userName) - _formData.append('prcType', '23') + _formData.append('prcType', 'buss3') _formData.append('json', JSON.stringify({ roleForm: this.roleForm, qbfsForm: this.qbfsForm, @@ -572,53 +1102,75 @@ export default { this.saveLoading = false }) }, + async processExec(sendProcess){ + const json = Object.assign(sendProcess, this.roleForm); + this.$http.post('lawss/activiti/startProcessRollBack', { + createUser: this.$store.getters.userInfo.userId, + createUserName: this.$store.getters.userInfo.userName, + type: 'buss3', + json: JSON.stringify({ + roleForm: this.roleForm, + qbfsForm: this.qbfsForm, + commentText: this.commentText + }) + }, { + _this: this + }, res => { + if (res.ok) { + this.$http.post('lawss/activiti/completeTask', { + taskIds: res.data, + userId : this.$store.getters.userInfo.userId, + json: JSON.stringify(json) + }, { + _this: this + }, res => { + if (res.success) { + sendProcess.processStatus = '1' + this.$message.success(res.message) + if (this.bpnId !== '') { + let taskId = { + id: this.bpnId + } + taskDel(taskId).then(res=>{ + }) + } + } + }) + } + }) + }, //流程提交 handleSubmit() { if(this.$route.query.prcNum === undefined){ + if(this.qbfsForm.modelData === undefined || this.qbfsForm.modelData === null || this.qbfsForm.modelData.length === 0){ + this.$message.warning('请选择复审企标完善列表内容') + return + } this.$refs['qbfsForm'].validate((valid) => { if (valid) { this.$refs['roleForm'].validate((valid) => { if (valid) { this.isSubmit = true - this.qbfsForm.fileList = this.fileList + // this.qbfsForm.fileList = this.fileList this.qbfsForm.commentText = this.commentText - var json = Object.assign(this.qbfsForm, this.roleForm) - this.$http.post('lawss/activiti/startProcessRollBack', { - createUser: this.$store.getters.userInfo.userId, - createUserName: this.$store.getters.userInfo.userName, - type: '23', - json: JSON.stringify({ - roleForm: this.roleForm, - qbfsForm: this.qbfsForm, - commentText: this.commentText - }) - }, { - _this: this - }, res => { - if (res.ok) { - this.$http.post('lawss/activiti/completeTask', { - taskIds: res.data, - userId : this.$store.getters.userInfo.userId, - json: JSON.stringify(json) - }, { - _this: this - }, res => { - if (res.success) { - this.$message.success(res.message) - if (this.bpnId !== '') { - let taskId = { - id: this.bpnId - } - taskDel(taskId).then(res=>{ - return res - }) - } - this.isSubmit = false - this.$router.push({path:'/processCenter?tabsName=ProcessCenter'}) - } - }) - } + // 批量发起列表流程 + this.loading = true + this.qbfsForm.modelData.forEach(sendProcess =>{ + sendProcess.processStatus = '2' + setTimeout(() => { + this.processExec(sendProcess) + }, 3000); + this.$forceUpdate() }) + + const time = setInterval(() => { + const list = this.qbfsForm.modelData.filter ( item => item.processStatus === '1') + if(list && this.qbfsForm.modelData && list.length === this.qbfsForm.modelData.length){ + this.isSubmit = false + clearInterval(time) + this.$router.push({path:'/processCenter?tabsName=ProcessCenter'}) + } + },1000); }else { this.$message.warning('请检查人员信息表单是否填写完整') } @@ -627,35 +1179,35 @@ export default { this.$message.warning('请检查基础信息表单是否填写完整') } }) - }else{ - this.$refs['qbfsForm'].validate((valid) => { - if (valid) { - this.$refs['roleForm'].validate((valid) => { - if (valid) { - this.isSubmit = true - this.qbfsForm.commentText = this.commentText - var json = Object.assign(this.qbfsForm, this.roleForm) - this.$http.post('lawss/activiti/completeTask', { - taskIds: res.data, - userId : this.$store.getters.userInfo.userId, - json: JSON.stringify(json) - }, { - _this: this - }, res => { - if (res.success) { - this.$message.success(res.message) - this.isSubmit = false - this.$router.push({path:'/processCenter?tabsName=ProcessCenter'}) - } - }) - }else { - this.$message.warning('请检查人员信息表单是否填写完整') - } - }) - } else { - this.$message.warning('请检查基础信息表单是否填写完整') - } - }) + // }else{ + // this.$refs['qbfsForm'].validate((valid) => { + // if (valid) { + // this.$refs['roleForm'].validate((valid) => { + // if (valid) { + // this.isSubmit = true + // this.qbfsForm.commentText = this.commentText + // var json = Object.assign(this.qbfsForm, this.roleForm) + // this.$http.post('lawss/activiti/completeTask', { + // taskIds: res.data, + // userId : this.$store.getters.userInfo.userId, + // json: JSON.stringify(json) + // }, { + // _this: this + // }, res => { + // if (res.success) { + // this.$message.success(res.message) + // this.isSubmit = false + // this.$router.push({path:'/processCenter?tabsName=ProcessCenter'}) + // } + // }) + // }else { + // this.$message.warning('请检查人员信息表单是否填写完整') + // } + // }) + // } else { + // this.$message.warning('请检查基础信息表单是否填写完整') + // } + // }) } }, // 流程阶段负责人选择 @@ -664,14 +1216,34 @@ export default { this.nodeList.push(id); this.type = type; this.drawerTitle = title; - this.modalshowflag = true; + this.modalShowFlag = true; }, checkedRole (data) { + if (this.type === 0) { + this.roleForm.deptUserId = data[0].id + this.roleForm.deptUserIdName = data[0].name + } else if (this.type === 1) { + this.qbfsForm.modelData[this.zrIndex].bussFsSubUser1 = data[0].id + this.qbfsForm.modelData[this.zrIndex].bussFsSubUser1Name = data[0].name + } else { + this.qbfsForm.modelData.forEach(item => { + this.zrIdList.forEach(items => { + if (item.id === items) { + item.bussFsSubUser1 = data[0].id + item.bussFsSubUser1Name = data[0].name + } + }) + }) + } + if (this.type === "dockUser") { this.roleForm.dockUser = data[0].id; this.roleForm.dockUserName = data[0].name; + }else if (this.type === "bussFsUser3") { + this.roleForm.bussFsUser3 = data[0].id; + this.roleForm.bussFsUser3Name = data[0].name; } - this.modalshowflag = false; + this.modalShowFlag = false; }, pageChange(page) { this.page = page; @@ -731,6 +1303,10 @@ export default {