[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: '请添加一条标准',
mainInterpreter: '主解读人',
interpretingTasksIsDistribute: '解读任务是否下发',
departInterpretingPeople: '各涉及部门解读人'
departInterpretingPeople: '各涉及部门解读人',
batchSelectionUser: '批量选择人员',
pleaseSelectTheNextStep: '请选择下一步',
},
// 流程配置
processConfig: {
@@ -380,6 +380,14 @@ export default {
})
// 条款列表
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) {
@@ -147,6 +147,8 @@ export default {
resolve(values)
})
})
} else {
obj.formData = this.form.getFieldsValue()
}
// 条款列表
obj.clauseData = this.clauseDataSource
@@ -19,77 +19,81 @@
<a-form-item :label="$t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute')" :colon="false">
<!--解读任务是否下发-->
<j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.standardInterpretationProcess.interpretingTasksIsDistribute')"
@change="hanldeChangeIsDistribute"
dict-code="is_distribute"
:disabled="disabled || isNextStep"
v-decorator="[ 'isDistribute', validatorRules.isDistribute ]" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<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>
<!-- 分发的部分 -->
<template v-if="isDistribute">
<div class="process-part-title">{{ $t('dispatchInformation') }}</div>
<div v-if="!disabled" class="table-operator">
<!-- 批量选择人员 -->
<a-button icon="plus" type="primary" @click="handleClauseBatchSelectUser">
{{$t('workCenter.standardInterpretationProcess.addStandard')}}
</a-button>
<!-- 导出 -->
<a-button icon="plus" type="primary" @click="handleExportClause">
{{$t('workCenter.standardInterpretationProcess.selectStandard')}}
</a-button>
<!-- 批量删除 -->
<a-button icon="plus" type="primary" @click="handleClauseBatchDel">
{{$t('workCenter.standardInterpretationProcess.selectStandard')}}
</a-button>
</div>
<div class="table-container mb-20">
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="clauseColumns"
:dataSource="clauseDataSource"
:pagination="clauseIpagination"
:row-selection="{ selectedRowKeys: selectedClauseRowKeys, onChange: onSelectClauseChange }"
@change="handleClauseTableChange">
<!--条文内容-->
<template slot="item_content" slot-scope="{text, record}">
<div class="table-text" style="cursor: pointer" v-if="text || text === 0" @click="showContent('item_content', text,record)">
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
</div>
<div class="table-text" v-else>{{ global.emptyLine }}</div>
</template>
<!--各涉及部门解读人-->
<template slot="interpretPersonIds" slot-scope="{text, record, index}">
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardInterpretationProcess.departInterpretingPeople')"
v-model="record.interpretPersonIds"
:disabled="disabled"
filedName="interpretPersonIds"
@nameChange="(...arg) => userSelectNameChange(...arg, index)"
type="checkbox"
:nameStr="record.interpretPersonIds_dictText" />
</template>
<!-- 确认下一步展示 -->
<template v-if="isNextStep">
<!-- 分发的部分 -->
<template v-if="isDistribute">
<div class="process-part-title">{{ $t('dispatchInformation') }}</div>
<div v-if="!disabled" class="table-operator">
<!-- 批量选择人员 -->
<a-button icon="plus" type="primary" @click="handleClauseBatchSelectUser">
{{$t('workCenter.standardInterpretationProcess.batchSelectionUser')}}
</a-button>
<!-- 导出 -->
<a-button icon="upload" type="primary" ghost @click="handleExportClause('条款')">
{{ $t('export') }}
</a-button>
<!-- 批量删除 -->
<a-button icon="delete" type="danger" ghost @click="handleClauseBatchDel">
{{$t('batchDelete')}}
</a-button>
</div>
<div class="table-container mb-20">
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="clauseColumns"
:dataSource="clauseDataSource"
:pagination="clauseIpagination"
:row-selection="{ selectedRowKeys: selectedClauseRowKeys, onChange: onSelectClauseChange }"
@change="handleClauseTableChange">
<!--条文内容-->
<template slot="item_content" slot-scope="{text, record}">
<div class="table-text" style="cursor: pointer" v-if="text || text === 0" @click="showContent('item_content', text,record)">
{{ text && text !== 'null' ? text.replace(/<.*?>/ig, ' ') : '' }}
</div>
<div class="table-text" v-else>{{ global.emptyLine }}</div>
</template>
<!--各涉及部门解读人-->
<template slot="interpretPersonIds" slot-scope="{text, record, index}">
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardInterpretationProcess.departInterpretingPeople')"
v-model="record.interpretPersonIds"
:disabled="disabled"
filedName="interpretPersonIds"
@nameChange="(...arg) => userSelectNameChange(...arg, index)"
type="checkbox"
:nameStr="record.interpretPersonIds_dictText" />
</template>
<template v-slot:action="{text, record}">
<a @click="handleClauseDelete(record.id)" class="table-ope-btn">{{ $t('delete') }}</a>
</template>
</j-table>
</div>
</template>
<!-- 不分发的部分 -->
<template v-else-if="isDistribute === false">
<template v-slot:action="{text, record}">
<a @click="handleClauseDelete(record.id)" class="table-ope-btn">{{ $t('delete') }}</a>
</template>
</j-table>
</div>
</template>
<!-- 不分发的部分 -->
<template v-else-if="isDistribute === false">
</template>
</template>
</a-spin>
<!--条文内容-->
<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>
</template>
@@ -177,7 +181,7 @@ export default {
// 解读任务是否下发
isDistribute: {
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'
}
@@ -236,25 +240,51 @@ export default {
showSizeChanger: true,
total: 0
},
selectedClauseRowKeys: []
selectedClauseRowKeys: [],
selectedClauseRows: []
}
},
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) {
console.log(data)
this.dataSource = [data.data.processStandardInterpret]
this.formInline = data.data.processStandardInterpret
this.clauseDataSource = data.data.processStandardInterpretClauseList
},
// 是否下发
hanldeChangeIsDistribute (val) {
if (val + '' === '1') {
this.isDistribute = true
} else if (val + '' === '2') {
this.isDistribute = false
} else {
this.isDistribute = null
}
// 下一步
handleNextStep () {
this.form.validateFields((err, values) => {
if (!err) {
this.isDistribute = values.isDistribute === '1'
this.isNextStep = true
}
})
},
// 条款导出
handleExportClause () {
@@ -271,7 +301,9 @@ export default {
content: this.$t('deleteAData'),
onOk: () => {
this.clauseDataSource = this.clauseDataSource.filter(item => !this.selectedClauseRowKeys.includes(item.id))
this.clauseIpagination.total = this.clauseDataSource.length
this.selectedClauseRowKeys = []
this.selectedClauseRows = []
// 重新计算分页问题
that.handleClauseReCalculatePage(that.selectedClauseRowKeys.length)
}
@@ -307,8 +339,9 @@ export default {
}
},
// 勾选条款
onSelectClauseChange (keys) {
onSelectClauseChange (keys, rows) {
this.selectedClauseRowKeys = keys
this.selectedClauseRows = rows
},
/**
* 显示条款内容、条文解读弹框
@@ -334,19 +367,21 @@ export default {
this.$refs.userSelectModal.open()
},
// 批量选择人员回调
handleClauseBatchSelectUserCallback (user) {
// this.clauseDataSource.forEach(item => {
// if (this.selectedClauseRowKeys.includes(item.id)) {
// item.interpretPersonIds = user
// }
// })
console.log(user)
handleClauseBatchSelectUserCallback (userList) {
const ids = userList.map(item => item.id).join(',')
const names = userList.map(item => `${item.realname}(${item.username})`).join(',')
this.selectedClauseRows.forEach(item => {
item.interpretPersonIds = ids
item.interpretPersonIds_dictText = names
})
}
}
}
</script>
<style scoped>
<style lang="less" scoped>
.mb-20 {
margin-bottom: 20px;
}
</style>