[update 标准解读流程] 分发

This commit is contained in:
danshihao
2024-07-09 17:44:06 +08:00
parent 900f27647a
commit e932d40c83
4 changed files with 129 additions and 81 deletions
+4 -1
View File
@@ -78,7 +78,10 @@ module.exports = {
pleaseAddStandard: '请添加一条标准', pleaseAddStandard: '请添加一条标准',
mainInterpreter: '主解读人', mainInterpreter: '主解读人',
interpretingTasksIsDistribute: '解读任务是否下发', interpretingTasksIsDistribute: '解读任务是否下发',
departInterpretingPeople: '各涉及部门解读人' departInterpretingPeople: '各涉及部门解读人',
batchSelectionUser: '批量选择人员',
pleaseSelectTheNextStep: '请选择下一步',
}, },
// 流程配置 // 流程配置
processConfig: { processConfig: {
@@ -380,6 +380,14 @@ export default {
}) })
// 条款列表 // 条款列表
params.data.processStandardInterpretClauseList = compData.clauseData params.data.processStandardInterpretClauseList = compData.clauseData
} else if (this.currentNodeId === StandardInterpretationNodes.standardInterpreterDistribution.value) {
// 标准主解读人分发节点
// 联络人分发节点
params.data.processStandardInterpret = Object.assign({}, this.info.data.processStandardInterpret, compData.formData, {
projectId: this.projectId
})
// 条款列表
params.data.processStandardInterpretClauseList = compData.clauseData
} }
// 如果有校验失败的,那就报错 // 如果有校验失败的,那就报错
if (flag) { if (flag) {
@@ -147,6 +147,8 @@ export default {
resolve(values) resolve(values)
}) })
}) })
} else {
obj.formData = this.form.getFieldsValue()
} }
// 条款列表 // 条款列表
obj.clauseData = this.clauseDataSource obj.clauseData = this.clauseDataSource
@@ -19,77 +19,81 @@
<a-form-item :label="$t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute')" :colon="false"> <a-form-item :label="$t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute')" :colon="false">
<!--解读任务是否下发--> <!--解读任务是否下发-->
<j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute')" <j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute')"
@change="hanldeChangeIsDistribute"
dict-code="is_distribute" dict-code="is_distribute"
:disabled="disabled || isNextStep"
v-decorator="[ 'isDistribute', validatorRules.isDistribute ]" /> v-decorator="[ 'isDistribute', validatorRules.isDistribute ]" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
<div class="mb-20"> <div class="mb-20">
<a-button icon="arrow-down">下一步</a-button> <!-- 下一步-->
<a-button icon="arrow-down" type="primary" ghost @click="handleNextStep" :disabled="isNextStep">{{ $t('next') }}</a-button>
</div> </div>
<!-- 分发的部分 --> <!-- 确认下一步展示 -->
<template v-if="isDistribute"> <template v-if="isNextStep">
<div class="process-part-title">{{ $t('dispatchInformation') }}</div> <!-- 分发的部分 -->
<div v-if="!disabled" class="table-operator"> <template v-if="isDistribute">
<!-- 批量选择人员 --> <div class="process-part-title">{{ $t('dispatchInformation') }}</div>
<a-button icon="plus" type="primary" @click="handleClauseBatchSelectUser"> <div v-if="!disabled" class="table-operator">
{{$t('workCenter.standardInterpretationProcess.addStandard')}} <!-- 批量选择人员 -->
</a-button> <a-button icon="plus" type="primary" @click="handleClauseBatchSelectUser">
<!-- 导出 --> {{$t('workCenter.standardInterpretationProcess.batchSelectionUser')}}
<a-button icon="plus" type="primary" @click="handleExportClause"> </a-button>
{{$t('workCenter.standardInterpretationProcess.selectStandard')}} <!-- 导出 -->
</a-button> <a-button icon="upload" type="primary" ghost @click="handleExportClause('条款')">
<!-- 批量删除 --> {{ $t('export') }}
<a-button icon="plus" type="primary" @click="handleClauseBatchDel"> </a-button>
{{$t('workCenter.standardInterpretationProcess.selectStandard')}} <!-- 批量删除 -->
</a-button> <a-button icon="delete" type="danger" ghost @click="handleClauseBatchDel">
</div> {{$t('batchDelete')}}
<div class="table-container mb-20"> </a-button>
<j-table </div>
:can-drag="true" <div class="table-container mb-20">
:scroll="{x: '100%'}" <j-table
ref="table" :can-drag="true"
rowKey="id" :scroll="{x: '100%'}"
:columns="clauseColumns" ref="table"
:dataSource="clauseDataSource" rowKey="id"
:pagination="clauseIpagination" :columns="clauseColumns"
:row-selection="{ selectedRowKeys: selectedClauseRowKeys, onChange: onSelectClauseChange }" :dataSource="clauseDataSource"
@change="handleClauseTableChange"> :pagination="clauseIpagination"
<!--条文内容--> :row-selection="{ selectedRowKeys: selectedClauseRowKeys, onChange: onSelectClauseChange }"
<template slot="item_content" slot-scope="{text, record}"> @change="handleClauseTableChange">
<div class="table-text" style="cursor: pointer" v-if="text || text === 0" @click="showContent('item_content', text,record)"> <!--条文内容-->
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }} <template slot="item_content" slot-scope="{text, record}">
</div> <div class="table-text" style="cursor: pointer" v-if="text || text === 0" @click="showContent('item_content', text,record)">
<div class="table-text" v-else>{{ global.emptyLine }}</div> {{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
</template> </div>
<!--各涉及部门解读人--> <div class="table-text" v-else>{{ global.emptyLine }}</div>
<template slot="interpretPersonIds" slot-scope="{text, record, index}"> </template>
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardInterpretationProcess.departInterpretingPeople')" <!--各涉及部门解读人-->
v-model="record.interpretPersonIds" <template slot="interpretPersonIds" slot-scope="{text, record, index}">
:disabled="disabled" <user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardInterpretationProcess.departInterpretingPeople')"
filedName="interpretPersonIds" v-model="record.interpretPersonIds"
@nameChange="(...arg) => userSelectNameChange(...arg, index)" :disabled="disabled"
type="checkbox" filedName="interpretPersonIds"
:nameStr="record.interpretPersonIds_dictText" /> @nameChange="(...arg) => userSelectNameChange(...arg, index)"
</template> type="checkbox"
:nameStr="record.interpretPersonIds_dictText" />
</template>
<template v-slot:action="{text, record}"> <template v-slot:action="{text, record}">
<a @click="handleClauseDelete(record.id)" class="table-ope-btn">{{ $t('delete') }}</a> <a @click="handleClauseDelete(record.id)" class="table-ope-btn">{{ $t('delete') }}</a>
</template> </template>
</j-table> </j-table>
</div> </div>
</template> </template>
<!-- 不分发的部分 --> <!-- 不分发的部分 -->
<template v-else-if="isDistribute === false"> <template v-else-if="isDistribute === false">
</template>
</template> </template>
</a-spin> </a-spin>
<!--条文内容--> <!--条文内容-->
<split-clause-detail ref="splitClauseDetail" /> <split-clause-detail ref="splitClauseDetail" />
<!--批量选择人员--> <!--批量选择人员-->
<user-select-modal ref="userSelectModal" check-required @change="handleClauseBatchSelectUserCallback" /> <user-select-modal type="checkbox" ref="userSelectModal" check-required @listChange="handleClauseBatchSelectUserCallback" />
</div> </div>
</template> </template>
@@ -177,7 +181,7 @@ export default {
// 解读任务是否下发 // 解读任务是否下发
isDistribute: { isDistribute: {
rules: [ rules: [
{ required: false, message: this.$t('pleaseSelect') + this.$t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute') } { required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute') }
], ],
validateTrigger: 'change' validateTrigger: 'change'
} }
@@ -236,25 +240,51 @@ export default {
showSizeChanger: true, showSizeChanger: true,
total: 0 total: 0
}, },
selectedClauseRowKeys: [] selectedClauseRowKeys: [],
selectedClauseRows: []
} }
}, },
methods: { methods: {
getData (isValidate) { async getData (isValidate) {
const obj = {}
if (isValidate) {
obj.formData = await new Promise((resolve) => {
this.form.validateFields((err, values) => {
if (err) { obj._flag = true }
// 校验成功失败都返回表单数据
resolve(values)
})
})
// 选择是否分发,校验是否下一步
if (!this.isNextStep) {
obj._flag = true
this.$message.warn(this.$t('workCenter.standardInterpretationProcess.pleaseSelectTheNextStep'))
}
// 如果有没填各涉及部门解读人,提示请完善表格信息
if (this.clauseDataSource.some(item => !item.interpretPersonIds)) {
obj._flag = true
this.$message.warn(this.$t('pleaseCompleteTableInfo'))
}
} else {
obj.formData = this.form.getFieldsValue()
}
obj.clauseData = this.clauseDataSource
return obj
}, },
setData (data) { setData (data) {
console.log(data)
this.dataSource = [data.data.processStandardInterpret]
this.formInline = data.data.processStandardInterpret
this.clauseDataSource = data.data.processStandardInterpretClauseList
}, },
// 是否下发 // 下一步
hanldeChangeIsDistribute (val) { handleNextStep () {
if (val + '' === '1') { this.form.validateFields((err, values) => {
this.isDistribute = true if (!err) {
} else if (val + '' === '2') { this.isDistribute = values.isDistribute === '1'
this.isDistribute = false this.isNextStep = true
} else { }
this.isDistribute = null })
}
}, },
// 条款导出 // 条款导出
handleExportClause () { handleExportClause () {
@@ -271,7 +301,9 @@ export default {
content: this.$t('deleteAData'), content: this.$t('deleteAData'),
onOk: () => { onOk: () => {
this.clauseDataSource = this.clauseDataSource.filter(item => !this.selectedClauseRowKeys.includes(item.id)) this.clauseDataSource = this.clauseDataSource.filter(item => !this.selectedClauseRowKeys.includes(item.id))
this.clauseIpagination.total = this.clauseDataSource.length
this.selectedClauseRowKeys = [] this.selectedClauseRowKeys = []
this.selectedClauseRows = []
// 重新计算分页问题 // 重新计算分页问题
that.handleClauseReCalculatePage(that.selectedClauseRowKeys.length) that.handleClauseReCalculatePage(that.selectedClauseRowKeys.length)
} }
@@ -307,8 +339,9 @@ export default {
} }
}, },
// 勾选条款 // 勾选条款
onSelectClauseChange (keys) { onSelectClauseChange (keys, rows) {
this.selectedClauseRowKeys = keys this.selectedClauseRowKeys = keys
this.selectedClauseRows = rows
}, },
/** /**
* 显示条款内容、条文解读弹框 * 显示条款内容、条文解读弹框
@@ -334,19 +367,21 @@ export default {
this.$refs.userSelectModal.open() this.$refs.userSelectModal.open()
}, },
// 批量选择人员回调 // 批量选择人员回调
handleClauseBatchSelectUserCallback (user) { handleClauseBatchSelectUserCallback (userList) {
// this.clauseDataSource.forEach(item => { const ids = userList.map(item => item.id).join(',')
// if (this.selectedClauseRowKeys.includes(item.id)) { const names = userList.map(item => `${item.realname}(${item.username})`).join(',')
// item.interpretPersonIds = user this.selectedClauseRows.forEach(item => {
// } item.interpretPersonIds = ids
// }) item.interpretPersonIds_dictText = names
console.log(user) })
} }
} }
} }
</script> </script>
<style scoped> <style lang="less" scoped>
.mb-20 {
margin-bottom: 20px;
}
</style> </style>