c7a2353b by lihua

合同进度支持非创建人只能查看

1 parent 60716932
......@@ -444,9 +444,11 @@ const handleTableEdit = (scope) => {
drawerInfo.value.visible = true;
drawerInfo.value.type = 'edit';
drawerInfo.value.header.title = '编辑合同';
drawerInfo.value.footer.visible = true;
currTableData.value = scope.row;
contractEditFormItems.value.forEach(item => {
item.default = scope.row[item.field];
item.disabled = false;
if (item.field == 'contractNodeCodes') {
item.default = scope.row.contractNodeCodes?.map(c => c.code) || [];
item.options = scope.row.contractTypeCode == '1' ? registerContractNodesList.value : (!scope.row.contractTypeCode ? [] : tradeContractNodesList.value);
......@@ -455,6 +457,7 @@ const handleTableEdit = (scope) => {
nodesInfo.value = scope.row.contractNodes?.map(node => {
let items = cloneDeep(nodeFormItems.value);
items.forEach(item => {
item.disabled = false;
item.default = node[item.field];
if (item.field == 'dateRange') {
item.default = [node.startDate, node.endDate];
......@@ -483,12 +486,44 @@ const handleTableDel = (scope) => {
})
}
const handleTableView = (scope) => {
drawerInfo.value.visible = true;
drawerInfo.value.type = 'view';
drawerInfo.value.header.title = '查看合同';
currTableData.value = scope.row;
contractEditFormItems.value.forEach(item => {
item.default = scope.row[item.field];
item.disabled = true;
if (item.field == 'contractNodeCodes') {
item.default = scope.row.contractNodeCodes?.map(c => c.code) || [];
item.options = scope.row.contractTypeCode == '1' ? registerContractNodesList.value : (!scope.row.contractTypeCode ? [] : tradeContractNodesList.value);
}
})
nodesInfo.value = scope.row.contractNodes?.map(node => {
let items = cloneDeep(nodeFormItems.value);
items.forEach(item => {
item.default = node[item.field];
item.disabled = true;
if (item.field == 'dateRange') {
item.default = [node.startDate, node.endDate];
}
})
return Object.assign({}, node, {
nodeFormItems: items,
nodeFormRules: nodeFormRules.value
})
}) || [];
drawerInfo.value.footer.visible = false;
}
const handleCreate = () => {
drawerInfo.value.visible = true;
drawerInfo.value.type = 'add';
drawerInfo.value.header.title = '新增合同';
drawerInfo.value.footer.visible = true;
contractEditFormItems.value.forEach(item => {
item.default = '';
item.disabled = false;
if (item.field == 'partyBGuid') {
item.default = userData.tenantGuid;
}
......@@ -701,8 +736,9 @@ onBeforeMount(() => {
</el-table-column>
<el-table-column label="操作" width="100px" align="left" fixed="right" show-overflow-tooltip>
<template #default="scope">
<span class="text_btn" @click="handleTableEdit(scope)">编辑</span>
<span class="text_btn ml4" @click="handleTableDel(scope)">删除</span>
<span v-if="!scope.row.createUserId || scope.row.createUserId == userData.staffGuid" class="text_btn" @click="handleTableEdit(scope)">编辑</span>
<span v-if="!scope.row.createUserId || scope.row.createUserId == userData.staffGuid" class="text_btn ml4" @click="handleTableDel(scope)">删除</span>
<span v-if="scope.row.createUserId && scope.row.createUserId != userData.staffGuid" class="text_btn ml4" @click="handleTableView(scope)">查看</span>
</template>
</el-table-column>
</el-table>
......@@ -722,7 +758,7 @@ onBeforeMount(() => {
</div>
<!-- 新增按钮 -->
<div class="bottm_tools" v-show="nodesInfo.length < contractNodeCodes?.length" @click="addNode">
<div class="bottm_tools" v-show="nodesInfo.length < contractNodeCodes?.length && drawerInfo.type != 'view'" @click="addNode">
<el-icon>
<Plus />
</el-icon>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!