diff --git a/src/assets/less/common.less b/src/assets/less/common.less index b872c4c9..ddd2a72d 100644 --- a/src/assets/less/common.less +++ b/src/assets/less/common.less @@ -813,7 +813,7 @@ /*流程表单样式end*/ -/* 按钮中发那个自定义图标的样式 */ +/* 按钮中使用自定义图标的样式 */ /deep/ .ant-btn { .iconfont { margin-right: 8px; @@ -825,9 +825,12 @@ .iconfont { display: none; } + span { + margin-left: 8px; + } } -/* 按钮中发那个自定义图标的样式 end */ +/* 按钮中使用自定义图标的样式 end */ .detail-page-bottom-operate-box { height: 52px; diff --git a/src/common/lang/en-us.js b/src/common/lang/en-us.js index 2e49c87b..b9b86edc 100644 --- a/src/common/lang/en-us.js +++ b/src/common/lang/en-us.js @@ -156,6 +156,7 @@ module.exports = { pleaseFillInAtLeastOneItem: 'Please Fill In At Least One Item', addAtLeastOneRowOfData: 'Please Add At Least One Row Of Data', mergeStandardInformation: '合并标准信息', + pleaseEnterPersonnelInfo: '请完整填写人员信息', // 树右键 treeRight: { addFolder: 'Create New Folder', diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js index b9d6d7d4..cdef71c2 100644 --- a/src/common/lang/zh-cn.js +++ b/src/common/lang/zh-cn.js @@ -159,6 +159,7 @@ module.exports = { pleaseFillInAtLeastOneItem: '请至少填写一项', addAtLeastOneRowOfData: '请至少添加一行数据', mergeStandardInformation: '合并标准信息', + pleaseEnterPersonnelInfo: '请完整填写人员信息', // 树右键 treeRight: { addFolder: '新增文件夹', diff --git a/src/components/PersonnelInfo.vue b/src/components/PersonnelInfo.vue index 87a7a62c..47aa4a23 100644 --- a/src/components/PersonnelInfo.vue +++ b/src/components/PersonnelInfo.vue @@ -82,6 +82,7 @@ export default { data: { handler () { this.stepsData = JSON.parse(JSON.stringify(this.data)) + console.log(this.stepsData) this.currentNodeIndex = this.stepsData.findIndex(tt => tt.nodeName === this.currentNode) }, deep: true, diff --git a/src/components/selection/UserSelectByContact.vue b/src/components/selection/UserSelectByContact.vue index 9e11bcbe..96e0e918 100644 --- a/src/components/selection/UserSelectByContact.vue +++ b/src/components/selection/UserSelectByContact.vue @@ -99,7 +99,7 @@ export default { position: relative; display: flex; align-items: center; - height: 39.98px; + //height: 39.98px; .user-input { resize: none; diff --git a/src/components/selection/UserSelectByContactModal.vue b/src/components/selection/UserSelectByContactModal.vue index 9763a199..4862acc8 100644 --- a/src/components/selection/UserSelectByContactModal.vue +++ b/src/components/selection/UserSelectByContactModal.vue @@ -43,8 +43,8 @@
-
- {{ item.realname + '(' + item.username + ')' }} +
+ {{ item.contactId_dictText }}
@@ -192,7 +192,7 @@ export default { if (selectedRowKeys.length > this.dataSourceRight.length) { // 说明是增加了数据 for (const rowIndex in selectedRows) { - if (!this.dataSourceRight.find(item => item.id === selectedRows[rowIndex].id)) { + if (!this.dataSourceRight.find(item => item.contactId === selectedRows[rowIndex].contactId)) { // 右侧不存在,追加到右侧表格 this.dataSourceRight.push(selectedRows[rowIndex]) } @@ -202,7 +202,7 @@ export default { if (selectedRowKeys && selectedRowKeys.length > 0) { // 没有选中数据,说明这一页没有选中数据了 for (let i = 0; i < this.dataSourceRight.length; i++) { - if (!selectedRowKeys.find(item => item === this.dataSourceRight[i].id)) { + if (!selectedRowKeys.find(item => item === this.dataSourceRight[i].contactId)) { // 表格选中中没有找到这一条数据,说明已经被删了 this.dataSourceRight.splice(i, 1) i-- @@ -229,7 +229,12 @@ export default { this.loadingRight = true getAction(this.url.userListByIds, params).then((res) => { if (res.success) { - this.dataSourceRight = res.result || [] + this.dataSourceRight = res.result.map(item => { + return { + contactId: item.id, + contactId_dictText: item.realname + '(' + item.username + ')' + } + }) || [] } else { this.$message.warn(res.message) } @@ -240,12 +245,12 @@ export default { // 名字列表的删除 handleDelete (record, index) { this.dataSourceRight.splice(index, 1) - this.selectedRowKeys = this.selectedRowKeys.filter(item => item !== record.id) + this.selectedRowKeys = this.selectedRowKeys.filter(item => item !== record.contactId) }, handleOk () { this.$emit('change', this.selectedRowKeys.join(',')) this.$emit('listChange', this.dataSourceRight) - this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(',')) + this.$emit('nameChange', this.dataSourceRight.map(item => item.contactId_dictText).join(',')) this.close() }, handleCancel () { diff --git a/src/components/selection/UserSelectByWorkGroup.vue b/src/components/selection/UserSelectByWorkGroup.vue index ffff8e6c..e380c767 100644 --- a/src/components/selection/UserSelectByWorkGroup.vue +++ b/src/components/selection/UserSelectByWorkGroup.vue @@ -96,7 +96,7 @@ export default { position: relative; display: flex; align-items: center; - height: 39.98px; + //height: 39.98px; .user-input { resize: none; diff --git a/src/components/selection/UserSelectByWorkGroupModal.vue b/src/components/selection/UserSelectByWorkGroupModal.vue index c9094a59..64c73940 100644 --- a/src/components/selection/UserSelectByWorkGroupModal.vue +++ b/src/components/selection/UserSelectByWorkGroupModal.vue @@ -30,20 +30,20 @@ - - - - - + + + + + + + + + + + + + + {{$t('reset')}} {{$t('query')}} @@ -54,7 +54,7 @@ - - - - - - - + + + + + + + + {{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }} + {{ $t('workCenter.enterpriseInitChangePlan.change') }} +
@@ -91,12 +91,11 @@ {{ $t('workCenter.enterpriseInitChangePlan.formulate') }} {{ $t('workCenter.enterpriseInitChangePlan.revise') }} - @@ -105,6 +104,11 @@ {{ $t('workCenter.enterpriseInitChangePlan.dutyDepartChange') }} {{ $t('workCenter.enterpriseInitChangePlan.merge') }} + + @@ -116,6 +120,7 @@ ref="approvalBaseInfo" :disabled="disabled" :currentNode="currentNode" + @processNameChange="processNameChange" :projectType="formInline.projectType"> @@ -141,6 +146,7 @@ v-else-if="formInline.applicationCategory === ApplicationCategory.CHANGE.value && formInline.projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value" ref="changeBaseInfo" :disabled="disabled" + @processNameChange="processNameChange" :projectType="formInline.projectType" > @@ -149,6 +155,7 @@ v-else-if="formInline.applicationCategory === ApplicationCategory.CHANGE.value && formInline.projectType === ProjectType.MERGE.value" ref="changeBaseInfo" :disabled="disabled" + @processNameChange="processNameChange" :projectType="formInline.projectType" > @@ -213,7 +220,7 @@ {{ $t('turnTo') }} - {{ $t('save') }} + {{ $t('preservation') }} {{ $t('submit') }} @@ -225,7 +232,7 @@ {{ $t('turnTo') }} - {{ $t('save') }} + {{ $t('preservation') }} {{ $t('agree') }} @@ -259,6 +266,9 @@ import JobEndBaseInfo from './modules/JobEndBaseInfo' import DutyDepartChangeBaseInfo from './modules/DutyDepartChangeBaseInfo' import MergeBaseInfo from './modules/MergeBaseInfo' import { ProjectType, ApplicationCategory } from '@/enums/commonEnums' +import Vue from 'vue' +import { USER_INFO } from '@/store/mutation-types' +import pick from 'lodash.pick' // 标准立项的人员信息 const approvalPersonalInfo = [ // 人员信息的数据 @@ -266,7 +276,8 @@ const approvalPersonalInfo = [ // 人员信息的数据 id: 1, nodeName: '主起草人发起', nodeRoleName: '发起人', - canChoose: false + canChoose: false, + userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')' }, { id: 2, @@ -359,32 +370,28 @@ const changePersonalInfo = [ nodeName: '新起草部门主管级上一级领导下发', nodeRoleName: '新起草部门主管级上一级领导', canChoose: false, - chooseType: 'radio', - fieldName: 'newMainDraftUserLeaderLeader' + chooseType: 'radio' }, { id: 7, nodeName: '新起草部门主管级领导确认', nodeRoleName: '新起草部门主管级领导', canChoose: false, - chooseType: 'radio', - fieldName: 'newMainDraftUserLeader' + chooseType: 'radio' }, { id: 8, nodeName: '相关人员会签', nodeRoleName: '相关人员', canChoose: false, - chooseType: 'checkbox', - fieldName: 'relatedUser' + chooseType: 'checkbox' }, { id: 9, nodeName: '抄送主起草人', nodeRoleName: '主起草人', canChoose: false, - chooseType: 'checkbox', - fieldName: 'copyUser' + chooseType: 'checkbox' } ] @@ -405,7 +412,36 @@ export default { computed: { pageTitle () { return this.$t('flowCenter') + this.$route.meta.title + }, + // 流程名称是否不可填写 + processNameDisabled () { + if (this.formInline.applicationCategory === ApplicationCategory.CHANGE.value && + (this.formInline.projectType === ProjectType.COMPLETE_TIME_CHANGE.value || + this.formInline.projectType === ProjectType.WORK_TERMINATE.value)) { + // 是完成时间变更或工作终止,流程名称无法自动生成,须填写 + return false + } else { + return true + } } + // 项目类别下拉框数据 + // projectTypeOptions () { + // if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) { + // return [ + // { value: ProjectType.ENACT.value, label: this.$t('workCenter.enterpriseInitChangePlan.formulate') }, + // { value: ProjectType.MODIFY.value, label: this.$t('workCenter.enterpriseInitChangePlan.revise') } + // ] + // } else if (this.formInline.applicationCategory === ApplicationCategory.CHANGE.value) { + // return [ + // { value: ProjectType.COMPLETE_TIME_CHANGE.value, label: this.$t('workCenter.enterpriseInitChangePlan.completionTimeChange') }, + // { value: ProjectType.WORK_TERMINATE.value, label: this.$t('workCenter.enterpriseInitChangePlan.terminationOfWork') }, + // { value: ProjectType.RESPONSIBLE_DEPT_CHANGE.value, label: this.$t('workCenter.enterpriseInitChangePlan.dutyDepartChange') }, + // { value: ProjectType.MERGE.value, label: this.$t('workCenter.enterpriseInitChangePlan.merge') }, + // ] + // } else { + // return [] + // } + // } }, watch: { 'formInline.applicationCategory' (value) { @@ -414,7 +450,7 @@ export default { if (this.currentNode === 1) { this.personnelInfoData = approvalPersonalInfo } else { - this.personnelInfoData = approvalPersonalInfo.map(item => { + this.personnelInfoData = this.personnelInfoData.map(item => { return { ...item, canChoose: false } }) } @@ -422,7 +458,7 @@ export default { if (this.currentNode === 1) { this.personnelInfoData = changePersonalInfo } else { - this.personnelInfoData = changePersonalInfo.map(item => { + this.personnelInfoData = this.personnelInfoData.map(item => { return { ...item, canChoose: false } }) } @@ -434,16 +470,14 @@ export default { } }, mounted () { + console.log(this.$route.query.processId) if (this.$route.query.processId) { + this.currentNode = 2 // todo: 先设置一个假数据,后端还不能返回当前节点 // 有流程id说明是从流程中心来的,需要初始化数据 this.getProcessData(this.$route.query.processId) } if (this.currentNode === 1) { this.personnelInfoData = approvalPersonalInfo - } else { - this.personnelInfoData = approvalPersonalInfo.map(item => { - return { ...item, canChoose: false } - }) } // 如果是查看进入的,不可编辑,不可操作 if (this.$route.query.onlyLook) { @@ -460,7 +494,7 @@ export default { disabled: false, onlyLook: false, // 是否仅查看 currentNode: 1, // 当前节点 - model: {}, + model: [], processInfoForm: this.$form.createForm(this), labelCol: { xs: { span: 24 }, @@ -539,6 +573,64 @@ export default { getProcessData (processId) { getProcessDataById({ processInstanceId: processId }).then(res => { if (res.success) { + this.model = res.result + this.$nextTick(() => { + // 初始化流程信息 + this.processInfoForm.setFieldsValue(pick(this.model[0], 'processName', 'deadlineDate', 'processDescription')) + // 初始化流程审批信息 + this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'remarks', 'attachment')) + }) + // 初始化业务基本信息的申请类型和项目类别 + this.formInline.applicationCategory = this.model[0].applicationCategory + this.formInline.projectType = this.model[0].projectType + // 初始化人员信息 todo: 发起人还没处理 + if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) { + this.personnelInfoData = approvalPersonalInfo.map(item => { + if (item.fieldName) { + return { ...item, userList: this.model[0][item.fieldName + '_dictText'], canChoose: false } + } else { + return item + } + }) + } else { + this.personnelInfoData = changePersonalInfo.map(item => { + console.log(item) + if (item.fieldName) { + return { ...item, userList: this.model[0][item.fieldName + '_dictText'], canChoose: false } + } else { + return item + } + }) + } + // 初始化业务基本信息中组件内容 + if (this.model[0].applicationCategory === ApplicationCategory.INITIATION.value) { + // 是立项 + this.$nextTick(() => { + this.$nextTick(() => { + const param = this.model[0] + param.enStandardSystem = param.enStandardSystem.split(',').map(item => { return { value: item } }) + this.$refs.approvalBaseInfo.formInline = param + }) + }) + } else if (this.model[0].applicationCategory === ApplicationCategory.CHANGE.value && + (this.model[0].projectType === ProjectType.COMPLETE_TIME_CHANGE.value || + this.model[0].projectType === ProjectType.WORK_TERMINATE.value)) { + // 是完成时间变更或工作终止的变更 + this.$nextTick(() => { + this.$refs.changeBaseInfo.dataSource = this.model + }) + } else if (this.model[0].applicationCategory === ApplicationCategory.CHANGE.value && + (this.model[0].projectType === ProjectType.RESPONSIBLE_DEPT_CHANGE.value || + this.model[0].projectType === ProjectType.MERGE.value)) { + // 是责任部门变更或合并变更 + this.$nextTick(() => { + this.$nextTick(() => { + const param = this.model[0] + param.enStandardSystem = param.enStandardSystem.split(',').map(item => { return { value: item } }) + this.$refs.changeBaseInfo.formInline = param + }) + }) + } console.log(res.result) } else { this.$message.warning(res.message) @@ -549,6 +641,13 @@ export default { switchChange (value) { this.switchValue = value }, + // 流程名称修改 + processNameChange (value) { + const param = { processName: value } + this.$nextTick(() => { + this.processInfoForm.setFieldsValue(pick(param, 'processName')) + }) + }, // 保存(业务基本信息那里是表格的就穿给后端数组里多条数据,是表单的就在数组里放一条数据) handleSave () { // 有任意一项填了即可 @@ -577,7 +676,7 @@ export default { if (approvalBaseInfo.enStandardSystem && approvalBaseInfo.enStandardSystem.length > 0) { approvalBaseInfo.enStandardSystem = approvalBaseInfo.enStandardSystem.map(item => item.value).join(',') } - const param = { ...processInfoForm, ...ruleForm, ...approvalBaseInfo, ...approvalInfoForm } + const param = { ...processInfoForm, ...ruleForm, ...approvalBaseInfo, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) if (!flag) { // 提示至少填写一项 @@ -587,7 +686,7 @@ export default { arr.push(param) } else if (this.formInline.projectType === ProjectType.COMPLETE_TIME_CHANGE.value) { // 业务基本信息-变更-完成时间变更 - const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm } + const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) if (!flag && this.$refs.changeBaseInfo.dataSource.length <= 0) { // 提示至少填写一项 @@ -597,7 +696,7 @@ export default { arr = this.$refs.changeBaseInfo.dataSource.map(item => { return { ...item, ...param } }) } else if (this.formInline.projectType === ProjectType.WORK_TERMINATE.value) { // 业务基本信息-变更-工作终止 - const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm } + const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) if (!flag && this.$refs.changeBaseInfo.dataSource.length <= 0) { // 提示至少填写一项 @@ -611,7 +710,7 @@ export default { if (this.$refs.changeBaseInfo) { dutyDepartChangeForm = this.$refs.changeBaseInfo.formInline } - const param = { ...processInfoForm, ...ruleForm, ...dutyDepartChangeForm, ...approvalInfoForm } + const param = { ...processInfoForm, ...ruleForm, ...dutyDepartChangeForm, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) if (!flag) { // 提示至少填写一项 @@ -625,7 +724,7 @@ export default { if (this.$refs.changeBaseInfo) { mergeForm = this.$refs.changeBaseInfo.formInline } - const param = { ...processInfoForm, ...ruleForm, ...mergeForm, ...approvalInfoForm } + const param = { ...processInfoForm, ...ruleForm, ...mergeForm, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) if (!flag) { // 提示至少填写一项 @@ -635,7 +734,7 @@ export default { arr.push(param) } else { // 还没有选择申请类型和项目类别,需要外层信息至少填了一项 - const param = { ...processInfoForm, ...ruleForm, ...approvalBaseInfo, ...approvalInfoForm } + const param = { ...processInfoForm, ...ruleForm, ...approvalBaseInfo, ...approvalInfoForm, ...personnelObj } const flag = Object.values(param).some(v => !!v || v === 0) if (!flag) { // 提示至少填写一项 @@ -657,29 +756,35 @@ export default { // 节点一时候的提交,发起立项变更申请(业务基本信息那里是表格的就穿给后端数组里多条数据,是表单的就在数组里放一条数据) handleStart () { if (this.loading) return + // 人员信息的数据, 处理成对象 + const personnelInfo = this.$refs.personnelInfo.stepsData + const personnelObj = {} + for (const item of personnelInfo) { + if (item.fieldName) { + personnelObj[item.fieldName] = item.user + } + } + // 校验是否填了所有能填的人员信息 + // if (!Object.values(personnelObj).every(v => !!v)) { + // this.$message.warning(this.$t('pleaseEnterPersonnelInfo')) + // return + // } this.processInfoForm.validateFields((err, values) => { this.$refs.ruleForm.validate(valid => { this.approvalInfoForm.validateFields((approvalErr, approvalValues) => { let arr = [] // 需要传给后端的数据 - let haveErr = false // 是否有错误,有错,则不能提交,false没有错 + let haveErr = true // 是否有错误,有错,则不能提交,false没有错 // 立项和变更的数据不一样,分开判断 if (this.formInline.applicationCategory === ApplicationCategory.INITIATION.value) { // 是立项 this.$refs.approvalBaseInfo.$refs.ruleForm.validate(approvalBaseValid => { if (valid && approvalBaseValid && !err && !approvalErr) { this.loading = true - // 人员信息的数据, 处理成对象 - const personnelInfo = this.$refs.personnelInfo.stepsData - const personnelObj = {} - for (const item of personnelInfo) { - if (item.fieldName) { - personnelObj[item.fieldName] = item.user - } - } const param = Object.assign({}, values, this.formInline, approvalValues, this.$refs.approvalBaseInfo.formInline, personnelObj) // 企标体系处理成逗号分隔 param.enStandardSystem = param.enStandardSystem.map(item => item.value).join(',') arr.push(param) + haveErr = false } else { haveErr = true } @@ -689,16 +794,9 @@ export default { // 是变更-完成时间 或者 变更-工作终止变更 if (valid && !err && !approvalErr && this.$refs.changeBaseInfo && this.$refs.changeBaseInfo.dataSource.length > 0) { this.loading = true - // 人员信息的数据, 处理成对象 - const personnelInfo = this.$refs.personnelInfo.stepsData - const personnelObj = {} - for (const item of personnelInfo) { - if (item.fieldName) { - personnelObj[item.fieldName] = item.user - } - } const param = { ...values, ...this.formInline, ...approvalValues, ...personnelObj } arr = this.$refs.changeBaseInfo.dataSource.map(item => { return { ...item, ...param } }) + haveErr = false } else { haveErr = true if (this.$refs.changeBaseInfo.dataSource.length <= 0) { @@ -710,16 +808,9 @@ export default { this.$refs.changeBaseInfo.$refs.ruleForm.validate(changeBaseValid => { if (valid && changeBaseValid && !err && !approvalErr) { this.loading = true - // 人员信息的数据, 处理成对象 - const personnelInfo = this.$refs.personnelInfo.stepsData - const personnelObj = {} - for (const item of personnelInfo) { - if (item.fieldName) { - personnelObj[item.fieldName] = item.user - } - } const param = Object.assign({}, values, this.formInline, approvalValues, this.$refs.changeBaseInfo.formInline, personnelObj) arr.push(param) + haveErr = false } else { haveErr = true } @@ -735,16 +826,11 @@ export default { return } this.loading = true - // 人员信息的数据, 处理成对象 - const personnelInfo = this.$refs.personnelInfo.stepsData - const personnelObj = {} - for (const item of personnelInfo) { - if (item.fieldName) { - personnelObj[item.fieldName] = item.user - } - } const param = Object.assign({}, values, this.formInline, approvalValues, this.$refs.changeBaseInfo.formInline, personnelObj) + // 企标体系处理成逗号分隔 + param.enStandardSystem = param.enStandardSystem.map(item => item.value).join(',') arr.push(param) + haveErr = false } else { haveErr = true } diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/ApprovalBaseInfo.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/ApprovalBaseInfo.vue index ddf6b4c7..c773ad0a 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/ApprovalBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/ApprovalBaseInfo.vue @@ -99,23 +99,6 @@ dictCode="standard_category_code" /> - -
-
- * - - {{ $t('workCenter.enterpriseInitChangePlan.yearNumber') }} - -
- - - -
+ +
+
+ * + {{ $t('workCenter.enterpriseInitChangePlan.yearNumber') }} -
- - -
- + + + +
@@ -219,9 +203,10 @@
- - {{ $t('workCenter.enterpriseInitChangePlan.standardSystem') }} - + * + + {{ $t('workCenter.enterpriseInitChangePlan.standardSystem') }} +
- - {{ $t('workCenter.enterpriseInitChangePlan.standardType') }} - + * + + {{ $t('workCenter.enterpriseInitChangePlan.standardType') }} +
- - {{ $t('workCenter.enterpriseInitChangePlan.standardGradeClassification') }} - + * + + {{ $t('workCenter.enterpriseInitChangePlan.standardGradeClassification') }} +
- * {{ $t('workCenter.enterpriseInitChangePlan.partName') }} @@ -629,7 +615,18 @@ export default { watch: { projectType () { this.$refs.ruleForm.resetFields() - this.formInline.decadeCode = new Date().getFullYear() + '' + const formInline = {} + const userInfo = Vue.ls.get(USER_INFO) + // 初始化主起草人信息 + formInline.mainDraftingUser = userInfo.id + formInline.mainDraftingUser_dictText = userInfo.realname + // 初始化主起草单位信息 + formInline.mainDraftingUnit = userInfo.departIds + // 重置年代号 + formInline.decadeCode = new Date().getFullYear() + '' + formInline.enStandardSystem = [] + this.formInline = Object.assign({}, formInline) + this.$forceUpdate() }, // 企业标准代号 'formInline.enStandardCode' (value) { @@ -646,6 +643,17 @@ export default { // 原企标编号改变,新企标编号随之改变 'formInline.originEnStandardNo' (value) { this.getEnStandardNo() + }, + // 企标名称,企标名称修改流程名称需要自动更改 + 'formInline.newEnStandardName' (value) { + this.returnProcessName() + } + }, + computed: { + // 年代号默认值 + decadeCodeDefaultValue () { + console.log(new Date().getFullYear() + '') + return new Date().getFullYear() + '' } }, data () { @@ -829,25 +837,39 @@ export default { fileMaxSize: undefined } }, - mounted () { - const userInfo = Vue.ls.get(USER_INFO) - // 初始化主起草人信息 - this.formInline.mainDraftingUser = userInfo.id - this.formInline.mainDraftingUser_dictText = userInfo.realname - // 初始化主起草单位信息 - this.formInline.mainDraftingUnit = userInfo.departIds + created () { // 获取零部件名称下拉框数据 this.initPartNameOptions() // 获取标准体系下拉框数据 this.initStandardSystemOptions() - // 初始化年代号 - this.formInline.decadeCode = new Date().getFullYear() + '' + }, + mounted () { + console.log(this.$route.query.processId) + if (!this.$route.query.processId) { + const userInfo = Vue.ls.get(USER_INFO) + const formInline = {} + // 初始化主起草人信息 + formInline.mainDraftingUser = userInfo.id + formInline.mainDraftingUser_dictText = userInfo.realname + // 初始化主起草单位信息 + formInline.mainDraftingUnit = userInfo.departIds + // 初始化年代号 + formInline.decadeCode = new Date().getFullYear() + '' + this.formInline = Object.assign({}, formInline) + this.$forceUpdate() + } }, methods: { // watch监视年代号会滞后 decadeCodeChange (value) { this.getEnStandardNo() }, + // 返回流程名称 + returnProcessName () { + const processName = (this.formInline.newEnStandardNo || '') + '-' + (this.formInline.newEnStandardName || '') + '-' + '立项' + console.log(processName) + this.$emit('processNameChange', processName) + }, // 根据三个代号和一个年代号获取企标编号 getEnStandardNo () { // 如果是制定根据填的三个代号和一个年代号获取 @@ -866,6 +888,8 @@ export default { if (res.success) { this.$set(this.formInline, 'newEnStandardNo', res.message) this.$forceUpdate() + // 返回流程名称 + this.returnProcessName() } }) } else { @@ -874,6 +898,8 @@ export default { const standardNo = this.formInline.originEnStandardNo.split('-')[0] + '-' + this.formInline.decadeCode this.$set(this.formInline, 'newEnStandardNo', standardNo) this.$forceUpdate() + // 返回流程名称 + this.returnProcessName() } } }, diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/DutyDepartChangeBaseInfo.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/DutyDepartChangeBaseInfo.vue index a527bd38..1c66825d 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/DutyDepartChangeBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/DutyDepartChangeBaseInfo.vue @@ -169,6 +169,18 @@ export default { default: 1 } }, + watch: { + // 企标编号,如果修改流程名称需更新 + 'formInline.originEnStandardNo' (value) { + const processName = (value || '') + '-' + (this.formInline.originEnStandardName || '') + '-' + '变更' + this.$emit('processNameChange', processName) + }, + // 企标名称 + 'formInline.originEnStandardName' (value) { + const processName = (this.formInline.originEnStandardNo || '') + '-' + (value || '') + '-' + '变更' + this.$emit('processNameChange', processName) + } + }, data () { return { formInline: {}, @@ -202,10 +214,16 @@ export default { console.log(value) if (value && value.length > 0) { this.formInline.originEnStandardName = value[0].originEnStandardName - this.formInline.mainDraftingUser_dictText = value[0].mainDraftingUser + this.formInline.mainDraftingUser = value[0].mainDraftingUser + this.formInline.mainDraftingUser_dictText = value[0].mainDraftingUser_dictText this.formInline.mainDraftingUnit = value[0].mainDraftingUnit - this.formInline.newMainDraftingUser_dictText = value[0].mainDraftingUser + this.formInline.newMainDraftingUser = value[0].mainDraftingUser + this.formInline.newMainDraftingUser_dictText = value[0].mainDraftingUser_dictText this.formInline.newMainDraftingUnit = value[0].mainDraftingUnit + this.formInline.mainDraftingUnitResponsiblePerson = value[0].mainDraftingUnitResponsiblePerson + this.formInline.mainDraftingUnitResponsiblePerson_dictText = value[0].mainDraftingUnitResponsiblePerson_dictText + this.formInline.newMainDraftingUnitResponsiblePerson = value[0].mainDraftingUnitResponsiblePerson + this.formInline.newMainDraftingUnitResponsiblePerson_dictText = value[0].mainDraftingUnitResponsiblePerson_dictText } }, // 选择用户得到用户名 diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfo.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfo.vue index dca473cd..33524d35 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfo.vue @@ -104,7 +104,7 @@ export default { title: this.$t('workCenter.enterpriseInitChangePlan.mainDraftUnit'), align: 'center', width: 180, - dataIndex: 'mainDraftingUnit', + dataIndex: 'mainDraftingUnit_dictText', scopedSlots: { customRender: 'text' } }, { // 原草稿计划完成日期 diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfoDrawer.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfoDrawer.vue index fc8a0f1c..69ce42e8 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfoDrawer.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/FinishTimeChangeBaseInfoDrawer.vue @@ -279,15 +279,19 @@ export default { // todo: 三个有校验的日期验证不会消失 console.log(value) if (value && value.length > 0) { + this.$refs.ruleForm.clearValidate() this.formInline.originEnStandardName = value[0].originEnStandardName - this.formInline.mainDraftingUser_dictText = value[0].mainDraftingUser + this.formInline.mainDraftingUser = value[0].mainDraftingUser + this.formInline.mainDraftingUser_dictText = value[0].mainDraftingUser_dictText this.formInline.mainDraftingUnit = value[0].mainDraftingUnit + this.formInline.mainDraftingUnit_dictText = value[0].mainDraftingUnit_dictText this.formInline.originDraftPlannedCompleteDate = value[0].draftPlannedCompleteDate this.formInline.originSolicitationDraftPlanCompleteDate = value[0].solicitationDraftPlanCompleteDate this.formInline.originPlanApprovalDate = value[0].planApprovalDate this.formInline.draftPlannedCompleteDate = value[0].draftPlannedCompleteDate this.formInline.solicitationDraftPlanCompleteDate = value[0].solicitationDraftPlanCompleteDate this.formInline.planApprovalDate = value[0].planApprovalDate + this.$refs.ruleForm.validate() } }, // 选择用户得到用户名 diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfo.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfo.vue index bce121ad..3634eb5a 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfo.vue @@ -103,7 +103,7 @@ export default { title: this.$t('workCenter.enterpriseInitChangePlan.mainDraftUnit'), align: 'center', width: 180, - dataIndex: 'mainDraftingUnit', + dataIndex: 'mainDraftingUnit_dictText', scopedSlots: { customRender: 'text' } }, { // 变更原因 diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfoDrawer.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfoDrawer.vue index 2b8c9009..5692d8ca 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfoDrawer.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/JobEndBaseInfoDrawer.vue @@ -160,8 +160,10 @@ export default { console.log(value) if (value && value.length > 0) { this.formInline.originEnStandardName = value[0].originEnStandardName - this.formInline.mainDraftingUser_dictText = value[0].mainDraftingUser + this.formInline.mainDraftingUser = value[0].mainDraftingUser + this.formInline.mainDraftingUser_dictText = value[0].mainDraftingUser_dictText this.formInline.mainDraftingUnit = value[0].mainDraftingUnit + this.formInline.mainDraftingUnit_dictText = value[0].mainDraftingUnit_dictText } }, // 选择用户得到用户名 diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue index 0b6e4140..7146d299 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue @@ -27,7 +27,7 @@ :disabled="disabled" :searchParam="{ projectType: projectType }" @standardNumberChange="standardNumberChangeOne" - @listChange="listChange"/> + @listChange="listChangeOne"/>
@@ -77,7 +77,7 @@ :standard-number="formInline.standardNoTwo" :searchParam="{ projectType: projectType }" @standardNumberChange="standardNumberChangeTwo" - @listChange="listChange"/> + @listChange="listChangeTwo"/>
@@ -123,7 +123,6 @@
@@ -429,7 +428,7 @@
-
+
* {{ $t('workCenter.enterpriseInitChangePlan.changeReason') }} @@ -471,6 +470,16 @@ export default { default: 1 } }, + watch: { + // 企标编号,企标编号修改流程名称需要自动更改 + 'formInline.newEnStandardNo' (value) { + this.returnProcessName() + }, + // 企标名称,企标名称修改流程名称需要自动更改 + 'formInline.newEnStandardName' (value) { + this.returnProcessName() + } + }, data () { return { ApplicationCategory, @@ -630,6 +639,12 @@ export default { this.initPartNameOptions() }, methods: { + // 返回流程名称 + returnProcessName () { + const processName = (this.formInline.newEnStandardNo || '') + '-' + (this.formInline.newEnStandardName || '') + '-' + '立项' + console.log(processName) + this.$emit('processNameChange', processName) + }, // 获取标准体系下拉框数据 initStandardSystemOptions () { getTreeList({ option: 1 }).then(res => { @@ -660,45 +675,64 @@ export default { this.formInline.standardNoTwo = value }, // 企标选编号1选择完成的回调 - listChange (value) { + listChangeOne (value) { console.log(value) if (value && value.length > 0) { + const formInline = {} // 企标名称1 - this.formInline.standardNameOne = value[0].originEnStandardName + formInline.standardNameOne = value[0].originEnStandardName || '' // 制修订类型1 - this.formInline.projectTypeOne = value[0].revisionType + formInline.projectTypeOne = value[0].applicationCategory || undefined // 新企标名称 - this.formInline.newEnStandardName = value[0].originEnStandardName + formInline.newEnStandardName = value[0].originEnStandardName || '' // 标准英文名称 - this.formInline.enStandardEnglishName = value[0].originEnStandardName + formInline.enStandardEnglishName = value[0].enStandardEnglishName || '' // 标准体系 - this.formInline.enStandardSystem = value[0].originEnStandardName + formInline.enStandardSystem = value[0].enStandardSystem ? value[0].enStandardSystem.split(',').map(item => { return { value: item } }) : [] // 企业标准代号 - this.formInline.enStandardCode = value[0].originEnStandardName + formInline.enStandardCode = value[0].enStandardCode || undefined // 企业名称代号 - this.formInline.enNameCode = value[0].originEnStandardName + formInline.enNameCode = value[0].enNameCode || undefined // 标准类别代号 - this.formInline.standardCategoryCode = value[0].originEnStandardName + formInline.standardCategoryCode = value[0].standardCategoryCode || undefined // 年代号 - this.formInline.decadeCode = value[0].originEnStandardName + formInline.decadeCode = value[0].decadeCode || undefined // 编制说明 - this.formInline.compilationDescription = value[0].originEnStandardName + formInline.compilationDescription = value[0].compilationDescription || undefined // 标准等级分类 - this.formInline.enStandardClassification = value[0].originEnStandardName + formInline.enStandardClassification = value[0].enStandardClassification || undefined // 草稿计划完成日期 - this.formInline.draftPlannedCompleteDate = value[0].originEnStandardName + formInline.draftPlannedCompleteDate = value[0].draftPlannedCompleteDate || undefined // 征求意见稿计划完成日期 - this.formInline.solicitationDraftPlanCompleteDate = value[0].originEnStandardName + formInline.solicitationDraftPlanCompleteDate = value[0].solicitationDraftPlanCompleteDate || undefined // 计划报批日期 - this.formInline.planApprovalDate = value[0].originEnStandardName + formInline.planApprovalDate = value[0].planApprovalDate || undefined // 零部件名称 - this.formInline.componentName = value[0].originEnStandardName + formInline.componentName = value[0].componentName || undefined // 主起草人 - this.formInline.mainDraftingUser_dictText = value[0].mainDraftingUser + formInline.mainDraftingUser = value[0].mainDraftingUser || undefined + formInline.mainDraftingUser_dictText = value[0].mainDraftingUser_dictText || undefined // 主起草单位 - this.formInline.mainDraftingUnit = value[0].mainDraftingUnit + formInline.mainDraftingUnit = value[0].mainDraftingUnit || undefined // 起草单位负责人 - this.formInline.mainDraftingUnitResponsiblePerson_dictText = value[0].mainDraftingUnit + formInline.mainDraftingUnitResponsiblePerson = value[0].mainDraftingUnitResponsiblePerson || undefined + formInline.mainDraftingUnitResponsiblePerson_dictText = value[0].mainDraftingUnitResponsiblePerson_dictText || undefined + this.formInline = Object.assign({}, this.formInline, formInline) + this.$forceUpdate() + this.returnProcessName() + } + }, + // 企标选编号2选择完成的回调 + listChangeTwo (value) { + console.log(value) + if (value && value.length > 0) { + const formInline = {} + // 企标名称2 + formInline.standardNameTwo = value[0].originEnStandardName + // 制修订类型2 + formInline.projectTypeTwo = value[0].applicationCategory + this.formInline = Object.assign(this.formInline, formInline) + this.$forceUpdate() } }, // 选择用户得到用户名 @@ -734,6 +768,6 @@ export default { } .title-text-long { - width: 220px; + width: 220px !important; }