update 企标稽查计划

This commit is contained in:
danshihao
2023-11-21 19:56:01 +08:00
parent ad6a76f34b
commit ca633ac032
4 changed files with 61 additions and 32 deletions
+4 -1
View File
@@ -217,6 +217,8 @@ const saveInspectPlan = (params) => postAction('/process/esInspectPlanFlow/flowS
const addInspectPlanTable = (params) => postAction('/process/processEsInspectPlan/add', params) const addInspectPlanTable = (params) => postAction('/process/processEsInspectPlan/add', params)
// 稽查计划表-编辑 // 稽查计划表-编辑
const editInspectPlanTable = (params) => postAction('/process/processEsInspectPlan/edit', params) const editInspectPlanTable = (params) => postAction('/process/processEsInspectPlan/edit', params)
// 稽查计划表-填写意见
const fillInOpinionInspectPlanTable = (params) => postAction('/process/processEsInspectPlanOpinion/fillInOpinion', params)
export { export {
getProcessNodeList, getProcessNodeList,
@@ -327,5 +329,6 @@ export {
transferInspectPlan, transferInspectPlan,
saveInspectPlan, saveInspectPlan,
addInspectPlanTable, addInspectPlanTable,
editInspectPlanTable editInspectPlanTable,
fillInOpinionInspectPlanTable
} }
@@ -247,6 +247,7 @@ export default {
loadPage (params) { loadPage (params) {
this.currentNode = this.$route.query.nodeId this.currentNode = this.$route.query.nodeId
this.projectId = this.$route.query.projectId this.projectId = this.$route.query.projectId
this.initPersonInfoData(this.currentNode === EsInspectionPlan.initiate.value)
switch (this.currentNode) { switch (this.currentNode) {
case EsInspectionPlan.initiate.value: case EsInspectionPlan.initiate.value:
this.btn = EsInspectionPlan.initiate.btn this.btn = EsInspectionPlan.initiate.btn
@@ -264,6 +265,7 @@ export default {
this.btn = EsInspectionPlan.liaisonLeaderApproval.btn this.btn = EsInspectionPlan.liaisonLeaderApproval.btn
break break
} }
this.loading = true
getInspectPlanDetail(params).then(res => { getInspectPlanDetail(params).then(res => {
if (res.success) { if (res.success) {
const data = res.result || {} const data = res.result || {}
@@ -274,6 +276,8 @@ export default {
prcMes: data.processAll.prcMes prcMes: data.processAll.prcMes
}) })
} }
}).finally(() => {
this.loading = false
}) })
}, },
switchChange (value) { switchChange (value) {
@@ -361,6 +365,10 @@ export default {
continueTurnTo () { continueTurnTo () {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
// const params = {
// taskId: this.$route.query.taskId,
// userId: this.$route.query.taskId,
// }
this.getPageParams().then(res => { this.getPageParams().then(res => {
console.log(res) console.log(res)
return transferInspectPlan(res) return transferInspectPlan(res)
@@ -402,12 +410,14 @@ export default {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
let fn let fn
if (this.currentNode === EsInspectionPlan.initiate.value) { switch (this.currentNode) {
fn = startInspectPlan case EsInspectionPlan.initiate.value:
} else if (this.currentNode === EsInspectionPlan.fillInComments.value) { fn = startInspectPlan
fn = approvalInspectPlan break
} else if (this.currentNode === EsInspectionPlan.liaisonCollect.value) { case EsInspectionPlan.fillInComments.value:
fn = approvalInspectPlan case EsInspectionPlan.liaisonCollect.value:
fn = approvalInspectPlan
break
} }
this.getPageParams().then(res => { this.getPageParams().then(res => {
console.log(res) console.log(res)
@@ -17,6 +17,7 @@
:dataSource="dataSource" :dataSource="dataSource"
:can-drag="true" :can-drag="true"
rowKey="id" rowKey="id"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:scroll="{x: '100%'}" :scroll="{x: '100%'}"
@change="tableOnChange"> @change="tableOnChange">
@@ -51,7 +52,7 @@
</template> </template>
<!-- 意见 or 填写意见:节点2非自己创建的就是意见和填写意见 --> <!-- 意见 or 填写意见:节点2非自己创建的就是意见和填写意见 -->
<template v-else-if="currentNode === EsInspectionPlan.fillInComments.value"> <template v-else-if="currentNode === EsInspectionPlan.fillInComments.value">
<a v-if="!!record.opinion" @click="handleShowOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.opinion') }}</a> <a v-if="record.processEsInspectPlanOpinionList.length" @click="handleShowOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.opinion') }}</a>
<a v-else @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a> <a v-else @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
</template> </template>
</template> </template>
@@ -61,10 +62,10 @@
<!-- 新增/编辑稽查计划 --> <!-- 新增/编辑稽查计划 -->
<inspection-plan-drawer ref="modalForm" @ok="modalFormOk" :project-id="projectId"/> <inspection-plan-drawer ref="modalForm" @ok="modalFormOk" :project-id="projectId"/>
<!-- 填写意见、意见回显 --> <!-- 节点2:填写意见、意见回显 -->
<write-opinion-modal ref="writeOpinionModal" @ok="modalFormOk"/> <write-opinion-modal ref="writeOpinionModal" v-if="currentNode === EsInspectionPlan.fillInComments.value" @ok="modalFormOk"/>
<!-- 节点3:所属部门意见-查看 --> <!-- 节点3:所属部门意见-查看 -->
<show-opinion-modal ref="showOpinionModal" @ok="modalFormOk"/> <show-opinion-modal ref="showOpinionModal" v-if="currentNode === EsInspectionPlan.liaisonCollect.value" @ok="modalFormOk"/>
</div> </div>
</template> </template>
@@ -133,21 +134,21 @@ export default {
title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'), title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'),
align: 'center', align: 'center',
width: 120, width: 120,
dataIndex: 'inspectObject', dataIndex: 'inspectObject_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 主责标准化工作组 { // 主责标准化工作组
title: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup'), title: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup'),
align: 'center', align: 'center',
width: 150, width: 150,
dataIndex: 'standardizationWorkGroup', dataIndex: 'standardizationWorkGroup_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 所属部门 { // 所属部门
title: this.$t('workCenter.esInspectionPlan.department'), title: this.$t('workCenter.esInspectionPlan.department'),
align: 'center', align: 'center',
width: 120, width: 120,
dataIndex: 'belongDept', dataIndex: 'belongDept_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 计划稽查日期 { // 计划稽查日期
@@ -161,14 +162,14 @@ export default {
title: this.$t('workCenter.esInspectionPlan.inspectionDirector'), title: this.$t('workCenter.esInspectionPlan.inspectionDirector'),
align: 'center', align: 'center',
width: 120, width: 120,
dataIndex: 'inspectUser', dataIndex: 'inspectUser_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 标准化组对接人 { // 标准化组对接人
title: this.$t('workCenter.esInspectionPlan.standardizationGroupContactPerson'), title: this.$t('workCenter.esInspectionPlan.standardizationGroupContactPerson'),
align: 'center', align: 'center',
width: 140, width: 140,
dataIndex: 'standardizationDockingUser', dataIndex: 'standardizationDockingUser_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 所属部门人员 { // 所属部门人员
@@ -226,9 +227,15 @@ export default {
}, },
watch: { watch: {
// 列表查询带上项目id // 列表查询带上项目id
projectId () { projectId: {
this.filters.projectId = this.projectId immediate: true,
this.loadData() handler () {
this.filters.projectId = this.projectId
if (this.currentNode === EsInspectionPlan.fillInComments.value) {
this.filters.nodeId = this.$route.query.nodeId
}
this.loadData()
}
} }
}, },
computed: { computed: {
@@ -14,6 +14,7 @@
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:can-drag="true" :can-drag="true"
:pagination="false"
rowKey="id" rowKey="id"
ref="table" ref="table"
size="middle" size="middle"
@@ -29,12 +30,12 @@
</a-tooltip> </a-tooltip>
</template> </template>
</j-table> </j-table>
<a-form-model ref="form" :model="model" :rules="validatorRules"> <a-form-model ref="form" :model="formData" :rules="validatorRules">
<a-form-model-item <a-form-model-item
prop="opinion" prop="opinion"
:label="$t('workCenter.esInspectionPlan.opinion')"> :label="$t('workCenter.esInspectionPlan.opinion')">
<a-textarea :max-length="500" :rows="4" :disabled="disabled" <a-textarea :max-length="500" :rows="4" :disabled="disabled"
:placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionPlan.opinion')" v-model="model.opinion"/> :placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionPlan.opinion')" v-model="formData.opinion"/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</a-spin> </a-spin>
@@ -44,6 +45,7 @@
<script> <script>
import JTable from '@comp/jero/JTable' import JTable from '@comp/jero/JTable'
import { fillInOpinionInspectPlanTable } from '@api/workCenter'
export default { export default {
name: 'WriteOpinionModal', name: 'WriteOpinionModal',
components: { JTable }, components: { JTable },
@@ -60,47 +62,50 @@ export default {
{ required: true, message: this.$t('pleaseEnter') + this.$t('workCenter.esInspectionPlan.opinion'), trigger: 'blur' } { required: true, message: this.$t('pleaseEnter') + this.$t('workCenter.esInspectionPlan.opinion'), trigger: 'blur' }
] ]
}, },
formData: {
opinion: ''
},
columns: [ columns: [
{ // 稽查依据标准号 { // 稽查依据标准号
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'), title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'inspectionBasisStandardNumber', dataIndex: 'inspectNo',
scopedSlots: { customRender: 'standard' } scopedSlots: { customRender: 'standard' }
}, },
{ // 稽查依据标准名称 { // 稽查依据标准名称
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'), title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'inspectionBasisStandardName', dataIndex: 'inspectName',
scopedSlots: { customRender: 'standard' } scopedSlots: { customRender: 'standard' }
}, },
{ // 计划稽查对象 { // 计划稽查对象
title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'), title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'),
align: 'center', align: 'center',
width: 120, width: 120,
dataIndex: 'planInspectionObjects', dataIndex: 'inspectObject_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 主责标准化工作组 { // 主责标准化工作组
title: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup'), title: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup'),
align: 'center', align: 'center',
width: 150, width: 150,
dataIndex: 'mainDutyStandardizationGroup', dataIndex: 'standardizationWorkGroup_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 所属部门 { // 所属部门
title: this.$t('workCenter.esInspectionPlan.department'), title: this.$t('workCenter.esInspectionPlan.department'),
align: 'center', align: 'center',
width: 120, width: 120,
dataIndex: 'department', dataIndex: 'belongDept_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 计划稽查日期 { // 计划稽查日期
title: this.$t('workCenter.esInspectionPlan.planInspectionDate'), title: this.$t('workCenter.esInspectionPlan.planInspectionDate'),
align: 'center', align: 'center',
width: 120, width: 120,
dataIndex: 'planInspectionDate', dataIndex: 'planInspectDate',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
} }
], ],
@@ -111,6 +116,9 @@ export default {
show (record, disabled) { show (record, disabled) {
// 是否禁用表单 // 是否禁用表单
this.disabled = disabled this.disabled = disabled
if (disabled) {
this.formData.opinion = (record.processEsInspectPlanOpinionList.find(item => item.createBy === this.$store.getters.userInfo.username) || {}).opinion
}
this.dataSource = [record] this.dataSource = [record]
this.model = Object.assign({}, record) this.model = Object.assign({}, record)
this.visible = true this.visible = true
@@ -122,18 +130,19 @@ export default {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
that.confirmLoading = true that.confirmLoading = true
const fun = () => {} const formData = Object.assign({}, {
const formData = Object.assign({}, this.model) inspectPlanId: this.model.id
fun(formData).then((res) => { }, this.formData)
fillInOpinionInspectPlanTable(formData).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
that.$emit('ok') that.$emit('ok')
that.close()
} else { } else {
that.$message.warning(res.message) that.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false that.confirmLoading = false
that.close()
}) })
} else { } else {
return false return false
@@ -146,8 +155,8 @@ export default {
}, },
close () { close () {
this.$emit('close') this.$emit('close')
this.visible = false
this.$refs.form.resetFields() this.$refs.form.resetFields()
this.visible = false
}, },
// 跳转详情 // 跳转详情
detailClick (record) { detailClick (record) {