diff --git a/package.json b/package.json index f3eb8bff..96cf6715 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "js-base64": "^3.6.0", "js-cookie": "^2.2.0", "jsencrypt": "^3.0.0-rc.1", + "lodash": "^4.17.21", "lodash.get": "^4.4.2", "lodash.pick": "^4.4.0", "md5": "^2.2.1", diff --git a/public/api_address_config.js b/public/api_address_config.js index 159a102d..4b57f53c 100644 --- a/public/api_address_config.js +++ b/public/api_address_config.js @@ -15,4 +15,4 @@ window._CONFIG.onlyOfficeUrl = 'http://127.0.0.1:8080' // onlyOffice下载文件地址(暂时没用) window._CONFIG.onlyOfficeDownloadFileUrl = 'http://localhost:8184/sys/common/download' // 管理员角色code,英文逗号拼接 -window._CONFIG.adminRoleCode = 'admin' +window._CONFIG.adminRoleCode = 'admin,BZGLY' diff --git a/src/api/workCenter.js b/src/api/workCenter.js index 26116bdf..435fb4bd 100644 --- a/src/api/workCenter.js +++ b/src/api/workCenter.js @@ -381,6 +381,22 @@ const agreeProjectComplianceEvaluation = (params) => postAction('/process/projec // 驳回 const rejectProjectComplianceEvaluation = (params) => postAction('/process/projectAssess/reject', params) +/* 未符合项跟踪流程 */ +// 按条件查询未符合项 +const queryNoMatchItemByCondition = (params) => getAction('/process/projectNotMet/pageForProcess', params) +// 查询流程信息 +const queryNoMatchTrackingProcess = (params) => getAction('/process/projectNotMet/queryProcessInfoVO', params) +// 发起流程 +const initialNoMatchTrackingProcess = (params) => postAction('/process/projectNotMet/startProcess', params) +// 提交 +const submitNoMatchTrackingProcess = (params) => postAction('/process/projectNotMet/submit', params) +// 同意 +const agreeNoMatchTrackingProcess = (params) => postAction('/process/projectNotMet/agree', params) +// 驳回 +const rejectNoMatchTrackingProcess = (params) => postAction('/process/projectNotMet/reject', params) +// 保存 +const saveNoMatchTrackingProcess = (params) => postAction('/process/projectNotMet/saveToDraft', params) + export { getProcessNodeList, @@ -572,5 +588,13 @@ export { saveProjectComplianceEvaluation, queryProjectComplianceEvaluation, agreeProjectComplianceEvaluation, - rejectProjectComplianceEvaluation + rejectProjectComplianceEvaluation, + + queryNoMatchItemByCondition, + queryNoMatchTrackingProcess, + initialNoMatchTrackingProcess, + submitNoMatchTrackingProcess, + agreeNoMatchTrackingProcess, + rejectNoMatchTrackingProcess, + saveNoMatchTrackingProcess } diff --git a/src/components/jero/JUpload.vue b/src/components/jero/JUpload.vue index 5e5d8884..10e204e6 100644 --- a/src/components/jero/JUpload.vue +++ b/src/components/jero/JUpload.vue @@ -15,9 +15,7 @@ @download="handleDownload" v-bind="$attrs" v-on="childListeners" - :showUploadList="showUploadList ? { - showDownloadIcon: isDownload - } : false" + :showUploadList="showUploadList ? {showDownloadIcon: isDownload} : false" :class="{'uploadty-disabled':disabled}"> @@ -174,16 +183,24 @@ import { WorkCenterMixin } from '../../../mixins/WorkCenterMixin' import { ProcessKey, NoMatchTrackingNodes } from '../../../enums/commonEnums' import UserSelection from '../../../components/selection/UserSelection' import NoMatchItemSelectDrawer from './modules/NoMatchItemSelectDrawer' +import { getCarTypeProjectList } from '../../../api/projectLibraryApi' +import { + saveNoMatchTrackingProcess, + queryNoMatchTrackingProcess, + initialNoMatchTrackingProcess, + submitNoMatchTrackingProcess, processTransfer, agreeNoMatchTrackingProcess, rejectNoMatchTrackingProcess +} from '../../../api/workCenter' +import { cloneDeep } from 'lodash' +import UserSelectModal from '../../../components/selection/UserSelectModal' export default { name: 'NoMatchTrackingProcess', - components: { ProcessDetailList, InternalDetailPage, PersonnelInfo, UserSelection, NoMatchItemSelectDrawer }, + components: { UserSelectModal, ProcessDetailList, InternalDetailPage, PersonnelInfo, UserSelection, NoMatchItemSelectDrawer }, mixins: [WorkCenterMixin], data () { return { loading: false, btnList: [], - disabled: false, // 流程信息表单 processInfoForm: this.$form.createForm(this), processInfo: {}, @@ -193,7 +210,7 @@ export default { // 业务基本信息表单(发起时候的查询条件) businessInfoForm: this.$form.createForm(this), businessInfo: {}, - currentNode: '2', + currentNode: null, labelCol: { xs: { span: 24 }, sm: { span: 4 } @@ -217,12 +234,15 @@ export default { validateTrigger: 'blur' }, // 标准编号/标准名称 - standardNumberName: { - rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('projectLibrary.vehicleItemLibrary.standardNumberStandardName') }], + standardNumberOrName: { + rules: [{ + required: true, + message: this.$t('pleaseEnter') + this.$t('projectLibrary.vehicleItemLibrary.standardNumberStandardName') + }], validateTrigger: 'blur' }, // 设计工程师 - designEngineer: { + engineerId: { rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.standardConsultationProcess.designEngineer') }], validateTrigger: 'change' } @@ -243,17 +263,9 @@ export default { width: 150, scopedSlots: { customRender: 'detail' } }, - // 问题类型 - { - dataIndex: '1', - title: this.$t('workCenter.noMatchTracking.problemTypes'), - width: 150, - align: 'center', - scopedSlots: { customRender: 'text' } - }, // 条款号 { - dataIndex: 'termNumber', + dataIndex: 'termNum', title: this.$t('workCenter.enStandardRevision.clauseNumber'), width: 150, align: 'center', @@ -267,11 +279,19 @@ export default { align: 'center', scopedSlots: { customRender: 'text' } }, + // 问题类型 + { + dataIndex: 'assessResults_dictText', + title: this.$t('workCenter.noMatchTracking.problemTypes'), + width: 150, + align: 'center', + scopedSlots: { customRender: 'text' } + }, // 相关项目 { title: this.$t('projectLibrary.noncoincidenceItem.relevantProject'), width: 150, - dataIndex: '2', + dataIndex: 'projectName', align: 'center', scopedSlots: { customRender: 'text' } }, @@ -285,7 +305,7 @@ export default { }, // 设计工程师 { - dataIndex: 'engineerName', + dataIndex: 'engineerId_dictText', title: this.$t('workCenter.standardConsultationProcess.designEngineer'), width: 120, align: 'center', @@ -300,18 +320,18 @@ export default { scopedSlots: { customRender: 'text' } } ], - dataSource: [{ id: 1, standardNumber: '124' }], + dataSource: [], // 展开表格的规则 extraForm: { rules: { // 依据描述 - basisDescription: { + description: { required: true, message: this.$t('pleaseEnter') + this.$t('projectLibrary.specialProjectLibrary.basisDescription'), trigger: 'blur' }, // 佐证材料 - basisFile: { + fileId: { required: false, message: this.$t('pleaseUpload') + this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'), trigger: 'change' @@ -321,20 +341,22 @@ export default { { fieldShowType: 1, dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.basisDescription'), - dbFieldName: 'basisDescription' + dbFieldName: 'description' }, { fieldShowType: 2, dbFieldTxt: this.$t('projectLibrary.specialProjectLibrary.supportingMaterial'), - dbFieldName: 'basisFile' + dbFieldName: 'fileId' } ] - } + }, + projectSelectOptions: [] // 项目下拉数据 } }, computed: { pageTitle () { - return `${this.$t('flowCenter')}${this.$route.meta.title}` + const subTitle = this.$route.query.taskName || NoMatchTrackingNodes.initial.text + return `${this.$t('flowCenter')}${this.$route.meta.title}(${subTitle})` }, // 是否展示选择标准的表单 showSelectStandardForm () { @@ -350,27 +372,78 @@ export default { // 展开表格是否禁用,设计工程师上传整改材料节点不禁用 expandTableDisabled () { return this.currentNode !== NoMatchTrackingNodes.designEngineer.value + }, + // 禁用流程信息部分表单 + disabledProcessInfo () { + return this.currentNode !== NoMatchTrackingNodes.initial.value } }, created () { - // if (this.$route.query.processInstanceId || this.$route.query.draftId) { - // this.currentNode = this.$route.query.nodeId - // this.initProcessInfo() - // } else { - // this.currentNode = NoMatchTrackingNodes.initial.value - // } + this.initDict() + if (this.$route.query.processInstanceId || this.$route.query.draftId) { + this.currentNode = this.$route.query.nodeId || NoMatchTrackingNodes.initial.value + this.initProcessInfo() + } else { + this.currentNode = NoMatchTrackingNodes.initial.value + } // 如果节点不是固定节点,就默认显示审批节点的信息 this.btnList = NoMatchTrackingNodes.propertyOfValue('btn', this.currentNode) || NoMatchTrackingNodes.regulatoryEngineer.btn this.getPersonInfoStructure(ProcessKey.NO_MATCH_TRACKING.value, () => { - this.initPersonInfoData(this.current) + this.initPersonInfoData(this.currentNode === NoMatchTrackingNodes.initial.value) }) }, methods: { + /** + * 获取下拉数据 + */ + initDict () { + getCarTypeProjectList().then(res => { + if (res.success) { + this.projectSelectOptions = res.result + } else { + this.$message.warning(res.message) + } + }) + }, /** * 获取流程信息 */ initProcessInfo () { - + this.loading = true + const params = { + taskId: this.$route.query.taskId + } + if (this.$route.query.draftId) { + params.draftId = this.$route.query.draftId + } else { + params.processInstanceId = this.$route.query.processInstanceId + } + queryNoMatchTrackingProcess(params).then(res => { + if (res.success) { + const { result = {} } = res + // 草稿从json里取得 + if (this.$route.query.draftId) { + const draftResult = JSON.parse(result.infoJsonStr) + this.processInfo = draftResult.processInfo + this.businessInfo = draftResult.businessInfo + this.dataSource = draftResult.dataSource || [] + this.approvalInfo = draftResult.approvalInfo + } else { + this.processInfo = result.basicProcessInfoDTO || {} + this.dataSource = result.businessInfoDTO.processProjectNotMetLinks || [] + this.approvalInfo = result.basicTaskInfoDTO || {} + } + this.$nextTick(() => { + this.processInfoForm.setFieldsValue(this.processInfo) + this.businessInfoForm.setFieldsValue(this.businessInfo) + this.approvalInfoForm.setFieldsValue(this.approvalInfo) + }) + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) }, /** * 选择标准 @@ -378,7 +451,8 @@ export default { selectStandard () { this.businessInfoForm.validateFields((errors, values) => { if (!errors) { - this.$refs.selectStandardDrawer.open(values) + const selectedNoMatchItemKeys = this.dataSource.map(item => item.id) + this.$refs.selectStandardDrawer.open(values, selectedNoMatchItemKeys) } }) }, @@ -417,6 +491,182 @@ export default { this.$openPageNewSheet({ path, query }) + }, + filterOption (input, option) { + return ( + option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + ) + }, + /** + * 转办 + */ + handleTurnTo () { + this.$refs.userSelectModal.open() + }, + continueTransfer (userId) { + const params = { + taskId: this.$route.query.taskId, + userId + } + this.loading = true + processTransfer(params).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + /** + * 保存 + */ + handleSave () { + const processInfo = Object.assign(this.processInfo, this.processInfoForm.getFieldsValue()) + const businessInfo = Object.assign(this.businessInfo, this.businessInfoForm.getFieldsValue()) + const approvalInfo = Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue()) + const checkValueArr = Object.values({ ...processInfo, ...businessInfo, ...approvalInfo }) + if (!checkValueArr.some(tt => !tt) && this.dataSource.length === 0) { + // 提示至少填写一项 + this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) + return + } + const formData = { processInfo, businessInfo, approvalInfo, dataSource: this.dataSource } + this.loading = true + saveNoMatchTrackingProcess({ infoJsonStr: JSON.stringify(formData) }).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + /** + * 处理表单数据 + */ + dealFormData () { + let flag = true, basicProcessInfoDTO = {}, basicTaskInfoDTO = {}, userInfoMap = {} + this.processInfoForm.validateFields((errors, values) => { + if (!errors) { + basicProcessInfoDTO = Object.assign(this.processInfo, values) + } else { + flag = false + } + }) + this.approvalInfoForm.validateFields((errors, values) => { + if (!errors) { + basicTaskInfoDTO = Object.assign(this.approvalInfo, values) + basicTaskInfoDTO.taskId = this.$route.query.taskId + } else { + flag = false + } + }) + // 发起节点表格无数据需要提示 + if (this.currentNode === NoMatchTrackingNodes.initial.value && this.dataSource.length === 0) { + this.$message.warning(this.$t('addAtLeastOneRowOfData')) + flag = false + } + // 展示展开表格,且不被禁用,需要校验表格的表单 + if (!this.showSelectStandardForm && !this.expandTableDisabled && !this.$refs.expandTable.submit()) { + this.$message.warning(this.$t('workCenter.checkTableRequired')) + flag = false + } + const basicFlag = flag + // 用户信息 + const userInfo = this.$refs.personnelInfo.getDataObjVerify() + if (!userInfo) { + flag = false + } else { + userInfoMap = userInfo + } + if (!flag && !basicFlag) { + this.switchValue = 'base' + } else if (!flag && !userInfo) { + this.switchValue = 'user' + } + const formData = { + basicProcessInfoDTO, + basicTaskInfoDTO, + businessInfoDTO: { + processProjectNotMetLinks: cloneDeep(this.dataSource) + }, + userInfoMap + } + return !flag ? false : formData + }, + /** + * 提交 + */ + handleSubmit () { + const formData = this.dealFormData() + if (!formData) { + return + } + this.loading = true + const submitFunc = this.currentNode === NoMatchTrackingNodes.initial.value ? initialNoMatchTrackingProcess : submitNoMatchTrackingProcess + submitFunc(formData).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + /** + * 同意 + */ + handleAgree () { + this.validatorRules.handleText.rules[0].required = false + if (!this.approvalInfoForm.getFieldValue('handleText')) { + this.approvalInfoForm.setFieldsValue({ handleText: '同意' }) + } + const formData = this.dealFormData() + if (!formData) { + return + } + this.loading = true + agreeNoMatchTrackingProcess(formData).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + /** + * 驳回 + */ + handleReject () { + this.validatorRules.handleText.rules[0].required = true + const formData = this.dealFormData() + if (!formData) { + return + } + this.loading = true + rejectNoMatchTrackingProcess(formData).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + handleDesignEngineerNameChange (name) { + this.businessInfo.engineerId_dictText = name } } } diff --git a/src/views/workCenter/noMatchTrackingProcess/modules/NoMatchItemSelectDrawer.vue b/src/views/workCenter/noMatchTrackingProcess/modules/NoMatchItemSelectDrawer.vue index c958844c..692816b8 100644 --- a/src/views/workCenter/noMatchTrackingProcess/modules/NoMatchItemSelectDrawer.vue +++ b/src/views/workCenter/noMatchTrackingProcess/modules/NoMatchItemSelectDrawer.vue @@ -9,36 +9,9 @@ :visible="visible" class="custom-drawer-style">
-
- - - - - - - - - - - - -
- {{ $t('query') }} - {{ $t('reset') }} -
-
-
-
+ + +
@@ -65,43 +47,17 @@