78371669 by lihua

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

1 parent ab419302
...@@ -444,9 +444,11 @@ const handleTableEdit = (scope) => { ...@@ -444,9 +444,11 @@ const handleTableEdit = (scope) => {
444 drawerInfo.value.visible = true; 444 drawerInfo.value.visible = true;
445 drawerInfo.value.type = 'edit'; 445 drawerInfo.value.type = 'edit';
446 drawerInfo.value.header.title = '编辑合同'; 446 drawerInfo.value.header.title = '编辑合同';
447 drawerInfo.value.footer.visible = true;
447 currTableData.value = scope.row; 448 currTableData.value = scope.row;
448 contractEditFormItems.value.forEach(item => { 449 contractEditFormItems.value.forEach(item => {
449 item.default = scope.row[item.field]; 450 item.default = scope.row[item.field];
451 item.disabled = false;
450 if (item.field == 'contractNodeCodes') { 452 if (item.field == 'contractNodeCodes') {
451 item.default = scope.row.contractNodeCodes?.map(c => c.code) || []; 453 item.default = scope.row.contractNodeCodes?.map(c => c.code) || [];
452 item.options = scope.row.contractTypeCode == '1' ? registerContractNodesList.value : (!scope.row.contractTypeCode ? [] : tradeContractNodesList.value); 454 item.options = scope.row.contractTypeCode == '1' ? registerContractNodesList.value : (!scope.row.contractTypeCode ? [] : tradeContractNodesList.value);
...@@ -455,6 +457,7 @@ const handleTableEdit = (scope) => { ...@@ -455,6 +457,7 @@ const handleTableEdit = (scope) => {
455 nodesInfo.value = scope.row.contractNodes?.map(node => { 457 nodesInfo.value = scope.row.contractNodes?.map(node => {
456 let items = cloneDeep(nodeFormItems.value); 458 let items = cloneDeep(nodeFormItems.value);
457 items.forEach(item => { 459 items.forEach(item => {
460 item.disabled = false;
458 item.default = node[item.field]; 461 item.default = node[item.field];
459 if (item.field == 'dateRange') { 462 if (item.field == 'dateRange') {
460 item.default = [node.startDate, node.endDate]; 463 item.default = [node.startDate, node.endDate];
...@@ -483,12 +486,44 @@ const handleTableDel = (scope) => { ...@@ -483,12 +486,44 @@ const handleTableDel = (scope) => {
483 }) 486 })
484 } 487 }
485 488
489 const handleTableView = (scope) => {
490 drawerInfo.value.visible = true;
491 drawerInfo.value.type = 'view';
492 drawerInfo.value.header.title = '查看合同';
493 currTableData.value = scope.row;
494 contractEditFormItems.value.forEach(item => {
495 item.default = scope.row[item.field];
496 item.disabled = true;
497 if (item.field == 'contractNodeCodes') {
498 item.default = scope.row.contractNodeCodes?.map(c => c.code) || [];
499 item.options = scope.row.contractTypeCode == '1' ? registerContractNodesList.value : (!scope.row.contractTypeCode ? [] : tradeContractNodesList.value);
500 }
501 })
502 nodesInfo.value = scope.row.contractNodes?.map(node => {
503 let items = cloneDeep(nodeFormItems.value);
504 items.forEach(item => {
505 item.default = node[item.field];
506 item.disabled = true;
507 if (item.field == 'dateRange') {
508 item.default = [node.startDate, node.endDate];
509 }
510 })
511 return Object.assign({}, node, {
512 nodeFormItems: items,
513 nodeFormRules: nodeFormRules.value
514 })
515 }) || [];
516 drawerInfo.value.footer.visible = false;
517 }
518
486 const handleCreate = () => { 519 const handleCreate = () => {
487 drawerInfo.value.visible = true; 520 drawerInfo.value.visible = true;
488 drawerInfo.value.type = 'add'; 521 drawerInfo.value.type = 'add';
489 drawerInfo.value.header.title = '新增合同'; 522 drawerInfo.value.header.title = '新增合同';
523 drawerInfo.value.footer.visible = true;
490 contractEditFormItems.value.forEach(item => { 524 contractEditFormItems.value.forEach(item => {
491 item.default = ''; 525 item.default = '';
526 item.disabled = false;
492 if (item.field == 'partyBGuid') { 527 if (item.field == 'partyBGuid') {
493 item.default = userData.tenantGuid; 528 item.default = userData.tenantGuid;
494 } 529 }
...@@ -701,8 +736,9 @@ onBeforeMount(() => { ...@@ -701,8 +736,9 @@ onBeforeMount(() => {
701 </el-table-column> 736 </el-table-column>
702 <el-table-column label="操作" width="100px" align="left" fixed="right" show-overflow-tooltip> 737 <el-table-column label="操作" width="100px" align="left" fixed="right" show-overflow-tooltip>
703 <template #default="scope"> 738 <template #default="scope">
704 <span class="text_btn" @click="handleTableEdit(scope)">编辑</span> 739 <span v-if="!scope.row.createUserId || scope.row.createUserId == userData.staffGuid" class="text_btn" @click="handleTableEdit(scope)">编辑</span>
705 <span class="text_btn ml4" @click="handleTableDel(scope)">删除</span> 740 <span v-if="!scope.row.createUserId || scope.row.createUserId == userData.staffGuid" class="text_btn ml4" @click="handleTableDel(scope)">删除</span>
741 <span v-if="scope.row.createUserId && scope.row.createUserId != userData.staffGuid" class="text_btn ml4" @click="handleTableView(scope)">查看</span>
706 </template> 742 </template>
707 </el-table-column> 743 </el-table-column>
708 </el-table> 744 </el-table>
...@@ -722,7 +758,7 @@ onBeforeMount(() => { ...@@ -722,7 +758,7 @@ onBeforeMount(() => {
722 </div> 758 </div>
723 759
724 <!-- 新增按钮 --> 760 <!-- 新增按钮 -->
725 <div class="bottm_tools" v-show="nodesInfo.length < contractNodeCodes?.length" @click="addNode"> 761 <div class="bottm_tools" v-show="nodesInfo.length < contractNodeCodes?.length && drawerInfo.type != 'view'" @click="addNode">
726 <el-icon> 762 <el-icon>
727 <Plus /> 763 <Plus />
728 </el-icon> 764 </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!