[update] 调年度制修订计划两个流程

This commit is contained in:
lideqin
2023-10-24 17:59:40 +08:00
parent 4e1d090c78
commit 9ab2eb4c24
17 changed files with 711 additions and 159 deletions
@@ -14,7 +14,7 @@
</div>
</template>
<!-- 基础信息 -->
<div v-if="switchValue === 'base'" class="detail-page-scroll-content">
<div v-show="switchValue === 'base'" class="detail-page-scroll-content">
<!-- 流程信息 -->
<div class="process-part-title">{{ $t('processInformation') }}</div>
<a-form :form="processInfoForm">
@@ -24,7 +24,7 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
@change="event => event.target.value = event.target.value.trim()"
:disabled="disabled"
:disabled="disabled || processInfoDisabled"
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
</a-form-item>
@@ -34,7 +34,7 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
:disabled="disabled || processInfoDisabled"
value-format="YYYY-MM-DD"
v-decorator="['expirationDate']" />
</a-form-item>
@@ -45,7 +45,7 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
:disabled="disabled || processInfoDisabled"
v-decorator="['processExplain']" />
</a-form-item>
</a-col>
@@ -65,19 +65,19 @@
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 节点1、标准工程师发起的基本信息表单 -->
<engineer-init-form v-if="currentNode === 1" ref="basicInfoFormRef"></engineer-init-form>
<engineer-init-form v-if="currentNode === 1" ref="baseInfoFormRef"></engineer-init-form>
<!-- 节点2、各部所联络人填写/下发任务 -->
<contact-enter-send-task-form v-if="currentNode === 2" ref="basicInfoFormRef"></contact-enter-send-task-form>
<contact-enter-send-task-form v-else-if="currentNode === 2" ref="baseInfoFormRef"></contact-enter-send-task-form>
<!-- 节点3、工作组、所联络人填写企标-->
<contact-enter-standard-form v-if="currentNode === 3" ref="basicInfoFormRef"></contact-enter-standard-form>
<contact-enter-standard-form v-else-if="currentNode === 3" ref="baseInfoFormRef"></contact-enter-standard-form>
<!-- 节点4、收集联络人主管级领导审批 只有表格,不能操作 -->
<only-table-form v-if="currentNode === 4" disabled ref="basicInfoFormRef"></only-table-form>
<only-table-form v-else-if="currentNode === 4" disabled ref="baseInfoFormRef"></only-table-form>
<!-- 节点5、各部所联络人汇总 只有表格,可操作 -->
<only-table-form v-if="currentNode === 5" ref="basicInfoFormRef"></only-table-form>
<only-table-form v-else-if="currentNode === 5" ref="baseInfoFormRef"></only-table-form>
<!-- 节点6、联络人主管级上一级领导审批 表格不可操作,可以查看详情 -->
<only-table-form v-if="currentNode === 6" onlyCanLook ref="basicInfoFormRef"></only-table-form>
<only-table-form v-else-if="currentNode === 6" onlyCanLook ref="baseInfoFormRef"></only-table-form>
<!-- 节点7、标准化工程师归档 表格不可新增,可以编辑和查看详情 -->
<only-table-form v-if="currentNode === 7" disabled ref="basicInfoFormRef"></only-table-form>
<only-table-form v-else-if="currentNode === 7" disabled ref="baseInfoFormRef"></only-table-form>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -97,9 +97,9 @@
</div>
<!-- 人员信息 -->
<div v-if="switchValue === 'user'" class="detail-page-scroll-content p-0">
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info>
</process-detail-list>
</div>
@@ -151,6 +151,13 @@ import ProcessDetailList from '../../../components/ProcessDetailList'
import ContactEnterStandardForm from './modules/ContactEnterStandardForm'
import OnlyTableForm from './modules/OnlyTableForm'
import UserSelectModal from '@/components/selection/UserSelectModal'
import {
activelyReportApproval,
activelyReportSave,
activelyReportTurnTo,
activelyReportAgree,
activelyReportReject
} from '@/api/workCenter'
const personData = [
{
@@ -217,6 +224,10 @@ export default {
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
},
// 流程信息不能编辑
processInfoDisabled () {
return this.currentNode !== 1
}
},
mounted () {
@@ -278,7 +289,7 @@ export default {
validateTrigger: 'blur'
}
},
currentNode: 3,
currentNode: 1,
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [], // 人员信息数据
url: {
@@ -295,15 +306,6 @@ export default {
// 有任意一项填了即可
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 业务基本信息
let ruleForm = {}
if ([1, 2, 3].includes(this.currentNode)) {
// 业务基本信息中有表单
ruleForm = this.$refs.basicInfoFormRef.formInline
}
if ([2, 3, 5].includes(this.currentNode)) {
// 业务基础信息中有可编辑表格 todo: 看后端要什么格式
}
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象
@@ -315,12 +317,20 @@ export default {
}
}
// 需要传给后端的
let param = {}
// 业务基本信息
if (this.$refs.basicInfoFormRef) {
if (this.$refs.baseInfoFormRef) {
// 业务基本信息
let ruleForm = this.$refs.baseInfoFormRef.getData()
if ([1, 2, 3].includes(this.currentNode)) {
// 业务基本信息中有表单
}
if ([2, 3, 5].includes(this.currentNode)) {
// 业务基础信息中有可编辑表格 todo: 看后端要什么格式
}
} else {
// 需要外层信息至少填了一项
const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm, ...personnelObj }
param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
@@ -328,14 +338,17 @@ export default {
return
}
}
this.loading = true
// 保存到草稿
// enterprisePlanApprovalSave(arr).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// } else {
// this.$message.warning(res.message)
// }
// })
activelyReportSave(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 节点一时候的提交,发起变更
handleStart () {
@@ -353,9 +366,26 @@ export default {
this.$message.warning(this.$t('pleaseEnterPersonnelInfo'))
return
}
// 流程信息校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息校验
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
// 需要校验业务基本信息中的表单
this.$refs.baseInfoFormRef.getDataValidate(data => {
if (!err && !approvalErr && data) {
this.loading = true
const param = {} // 需要给后端的参数
activelyReportApproval(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
})
})
},
@@ -373,29 +403,70 @@ export default {
const param = Object.assign({}, values)
param.userId = userIds
param.taskId = this.$route.query.taskId
// enterprisePlanApprovalTurnTo(param).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// this.loading = false
// })
activelyReportTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 提交
// 提交(节点2,3,5有提交)
handleSubmit () {
if (this.loading) return
// 流程审批信息校验
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.$refs.baseInfoFormRef.getDataValidate(data => {
if (approvalErr && data) {
// 节点2,3有表单和表格,节点4只有表格
// param =
}
})
})
},
// 同意
// 同意(节点4,6有同意)
handleAgree () {
if (this.loading) return
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = Object.assign({}, values)
param.taskId = this.$route.query.taskId
activelyReportAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 驳回
// 驳回(节点4,6有驳回)
handleReject () {
if (this.loading) return
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = Object.assign({}, values)
param.taskId = this.$route.query.taskId
activelyReportReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
}
}
}
@@ -120,13 +120,53 @@ export default {
}
]
},
modalType: '' // 是在新增还是在编辑,编辑的时候放正在编辑的下标
modalType: '', // 是在新增还是在编辑,编辑的时候放正在编辑的下标
data: undefined
}
},
methods: {
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
},
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
// 给表格赋值
// this.$nextTick(() => {
// this.$refs.tableRef.dataSource =
// })
},
// 外层要获取数据
getData () {
// 把数据抛出
const data = {}
data.formInline = this.formInline
data.dataSource = this.$refs.tableRef.dataSource
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
// 可能是表单,也可能是表格,表单校验一定要填,有是否下发联络人
this.$refs.ruleForm.validate(result => {
if (result) {
if (this.$refs.tableRef.dataSource && this.$refs.tableRef.dataSource.length > 0) {
const data = {}
data.formInline = this.formInline
data.dataSource = this.$refs.tableRef.dataSource
callback(data)
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
const data = false
callback(data)
}
} else {
const data = false
callback(data)
}
})
}
}
}
@@ -25,8 +25,9 @@
<a-form-model-item class="item-model" prop="applicationType">
<a-select v-model="formInline.applicationType"
:disabled="disabled"
:defaultValue="ApplicationCategory.INITIATION.value"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.applicationType')">
<a-select-option :value="1">{{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }}</a-select-option>
<a-select-option :value="ApplicationCategory.INITIATION.value">{{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }}</a-select-option>
</a-select>
</a-form-model-item>
</div>
@@ -494,6 +495,21 @@
type="radio" />
</a-form-model-item>
</div>
<!-- 配合单位 -->
<div class="box-title-text form-flex-item-half">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.suitUnit')">
{{ $t('workCenter.enterpriseInitChangePlan.suitUnit') }}
</span>
</div>
<a-form-model-item class="item-model" prop="cooperationUnit">
<j-select-depart v-model="formInline.cooperationUnit"
:disabled="disabled"
@back="cooperationUnitBack"
:backDepart="true" />
</a-form-model-item>
</div>
</div>
</a-form-model>
</a-spin>
@@ -509,7 +525,7 @@
</template>
<script>
import { StandardSource, ProjectType } from '@/enums/commonEnums'
import { StandardSource, ProjectType, ApplicationCategory } from '@/enums/commonEnums'
import { getWorkGroupTreeList, getFormDictTreeList } from '@/api/api'
import UserSelection from '@/components/selection/UserSelection'
import StandardSelection from '@/components/selection/StandardSelection'
@@ -526,6 +542,7 @@ export default {
return {
StandardSource,
ProjectType,
ApplicationCategory,
workingGroupTreeList: [], // 隶属工作组下拉框数据
partNameOptions: [], // 零部件名称下拉框数据
standardSystemOptions: [], // 企标体系下拉框数据
@@ -765,7 +782,12 @@ export default {
this.visible = true
this.model = Object.assign({}, record)
this.formInline = Object.assign({}, record)
this.formInline.workGroup = { value: this.formInline.workGroup, label: this.formInline.workGroup_dictText }
if (this.formInline.workGroup) {
this.formInline.workGroup = { value: this.formInline.workGroup, label: this.formInline.workGroup_dictText }
}
if (!this.formInline.applicationType) {
this.formInline.applicationType = this.ApplicationCategory.INITIATION.value
}
},
look (record) {
this.visible = true
@@ -850,6 +872,10 @@ export default {
mainDraftingUnitBack (value) {
this.formInline.mainDraftingUnit_dictText = value.map(item => item.text).join(',')
},
// 配合单位返回参数
cooperationUnitBack (value) {
this.formInline.cooperationUnit_dictText = value.map(item => item.text).join(',')
},
// 标准选择组件返回标准名称的回调
nameChange (value) {
this.formInline.originEnStandardName = value
@@ -899,7 +925,7 @@ export default {
const formInline = JSON.parse(JSON.stringify(this.formInline))
if (formInline.projectType) {
// 翻译项目类别
formInline.projectType_dictText = formInline.projectType === 1 ? ProjectType.ENACT.text : ProjectType.MODIFY.text
formInline.projectType_dictText = formInline.projectType === ProjectType.ENACT.value ? ProjectType.ENACT.text : ProjectType.MODIFY.text
// 设置变更状态
if (formInline.projectType === 1) {
// 是制定,变更状态是新增
@@ -918,7 +944,6 @@ export default {
if (formInline.enStandardCode) {
formInline.enStandardCode_dictText = this.$refs.enStandardCodeRef.dictOptions.find(item => item.value === formInline.enStandardCode).text
}
// 配合单位弹框中没有该字段,是否要加??
// 主起草单位的回显需要在登录信息中有当前登录人部门的翻译 ??
console.log(formInline)
this.$emit('ok', formInline)
@@ -63,13 +63,53 @@ export default {
}
]
},
modalType: '' // 是在新增还是在编辑,编辑的时候放正在编辑的下标
modalType: '', // 是在新增还是在编辑,编辑的时候放正在编辑的下标
data: undefined
}
},
methods: {
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
},
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
// 给表格赋值
// this.$nextTick(() => {
// this.$refs.tableRef.dataSource =
// })
},
// 外层要获取数据
getData () {
// 把数据抛出
const data = {}
data.formInline = this.formInline
data.dataSource = this.$refs.tableRef.dataSource
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
// 可能是表单,也可能是表格,表单校验一定要填,有是否下发联络人
this.$refs.ruleForm.validate(result => {
if (result) {
if (this.$refs.tableRef.dataSource && this.$refs.tableRef.dataSource.length > 0) {
const data = {}
data.formInline = this.formInline
data.dataSource = this.$refs.tableRef.dataSource
callback(data)
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
const data = false
callback(data)
}
} else {
const data = false
callback(data)
}
})
}
}
}
@@ -36,15 +36,44 @@ export default {
return {
formInline: {},
rules: {
// 企标编号
enterpriseStandardNum: [
// 制修订计划说明
revisionPlanDesc: [
{
required: true,
message: this.$t('workCenter.revisionPlanActivelyReport.revisionPlanDesc') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
}
},
data: undefined
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
},
// 外层要获取数据
getData () {
// 把数据抛出
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.formInline = this.formInline
callback(data)
} else {
const data = false
callback(data)
}
})
}
}
}
@@ -25,7 +25,7 @@
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="enterpriseStandardPlanId"
:rowKey="(record, index) => { return index }"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
@@ -392,7 +392,7 @@ export default {
},
// 编辑
handleEdit (record, index) {
this.modalType = 'edit' + index
this.modalType = 'edit' + ',' + index
this.$refs.contactEnterSendTaskModal.edit(record)
},
// 查看
@@ -405,7 +405,11 @@ export default {
},
// 批量删除
batchDel () {
this.dataSource = this.dataSource.filter(item => !this.selectedRowKeys.includes(item.enterpriseStandardPlanId))
for (let i = 0; i < this.selectedRowKeys.length; i++) {
this.dataSource.splice(this.selectedRowKeys[i], 1, false)
}
this.dataSource = this.dataSource.filter(item => !!item)
this.selectedRowKeys = []
}
}
}