bcb479b8 by lihua

合同进度一览接口联调

1 parent 5213f28d
...@@ -451,6 +451,27 @@ export const getContractList = (params) => request({ ...@@ -451,6 +451,27 @@ export const getContractList = (params) => request({
451 data: params 451 data: params
452 }) 452 })
453 453
454 /** 新增合同 */
455 export const saveDamContract = (params) => request({
456 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-contract/save`,
457 method: 'post',
458 data: params
459 })
460
461 /** 更新合同 */
462 export const updateDamContract = (params) => request({
463 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-contract/update`,
464 method: 'put',
465 data: params
466 })
467
468 /** 删除合同 */
469 export const delDamContract = (params) => request({
470 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-contract/delete`,
471 method: 'delete',
472 data: params
473 })
474
454 /** 获取会员列表 */ 475 /** 获取会员列表 */
455 export const getTenantList = (params) => request({ 476 export const getTenantList = (params) => request({
456 url: `${import.meta.env.VITE_APP_PERSONAL_URL}/tenant/singlePage`, 477 url: `${import.meta.env.VITE_APP_PERSONAL_URL}/tenant/singlePage`,
...@@ -458,12 +479,6 @@ export const getTenantList = (params) => request({ ...@@ -458,12 +479,6 @@ export const getTenantList = (params) => request({
458 data: params 479 data: params
459 }) 480 })
460 481
461 /** 获取当前用户所在的企业 */
462 export const getOwnerTenantList = (userGuid) => request({
463 url: `${import.meta.env.VITE_APP_PERSONAL_URL}/tenant/get-tenant-by-user?userGuid=${userGuid}`,
464 method: 'get'
465 })
466
467 // API详情 482 // API详情
468 /** 查询域名和文根 */ 483 /** 查询域名和文根 */
469 /** api类型,有表单类型,自定义sql. */ 484 /** api类型,有表单类型,自定义sql. */
......
...@@ -106,7 +106,7 @@ const getDrawerConRef = (refName) => { ...@@ -106,7 +106,7 @@ const getDrawerConRef = (refName) => {
106 } 106 }
107 // const drawerForm = drawerFormRef.value[0] || drawerFormRef.value; 107 // const drawerForm = drawerFormRef.value[0] || drawerFormRef.value;
108 if (refName == 'drawerFormRef') { 108 if (refName == 'drawerFormRef') {
109 const drawerForm = drawerFormRef.value[0] || drawerFormRef.value; 109 const drawerForm = drawerFormRef.value?.[0] || drawerFormRef.value;
110 return drawerForm 110 return drawerForm
111 } 111 }
112 } 112 }
...@@ -153,11 +153,13 @@ const tableBtnClick = (scope, btn) => { ...@@ -153,11 +153,13 @@ const tableBtnClick = (scope, btn) => {
153 const submitForm = async (formEl: FormInstance | undefined, btn) => { 153 const submitForm = async (formEl: FormInstance | undefined, btn) => {
154 if (!formEl) return; 154 if (!formEl) return;
155 await formEl.validate((valid, fields) => { 155 await formEl.validate((valid, fields) => {
156 if (valid) {
157 const drawerForm = drawerFormRef.value[0] || drawerFormRef.value; 156 const drawerForm = drawerFormRef.value[0] || drawerFormRef.value;
157 if (valid) {
158 const formInfo = drawerForm.formInline; 158 const formInfo = drawerForm.formInline;
159 emits("drawerBtnClick", btn, formInfo); 159 emits("drawerBtnClick", btn, formInfo);
160 } else { 160 } else {
161 var obj = fields && Object.keys(fields);
162 obj?.[0] && formEl?.scrollToField(obj?.[0])
161 console.log("error submit!", fields); 163 console.log("error submit!", fields);
162 } 164 }
163 }); 165 });
......
...@@ -1452,7 +1452,8 @@ const panelChange = (scope, row) => { ...@@ -1452,7 +1452,8 @@ const panelChange = (scope, row) => {
1452 :disabled="item.disabled || readonly" @change="(val) => cascaderChange(val, item)" /> 1452 :disabled="item.disabled || readonly" @change="(val) => cascaderChange(val, item)" />
1453 <template v-else-if="item.type && item.type.indexOf('date') > -1"> 1453 <template v-else-if="item.type && item.type.indexOf('date') > -1">
1454 <el-date-picker :class="[item.col, { is_block: item.block }]" v-if="item.type == 'date-picker'" 1454 <el-date-picker :class="[item.col, { is_block: item.block }]" v-if="item.type == 'date-picker'"
1455 v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" 1455 v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" :format="item.format ?? ''"
1456 :value-format="item.valueFormat ?? ''"
1456 end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []" 1457 end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []"
1457 :default-value="item.defaultDate" :disabled="item.disabled ?? false" /> 1458 :default-value="item.defaultDate" :disabled="item.disabled ?? false" />
1458 <el-date-picker :class="[item.col, { is_block: item.block }]" v-else-if="item.type == 'date-year'" 1459 <el-date-picker :class="[item.col, { is_block: item.block }]" v-else-if="item.type == 'date-year'"
......
...@@ -182,6 +182,10 @@ onMounted(() => { ...@@ -182,6 +182,10 @@ onMounted(() => {
182 <el-date-picker v-model="formInline[item.field]" type="datetimerange" start-placeholder="开始时间" 182 <el-date-picker v-model="formInline[item.field]" type="datetimerange" start-placeholder="开始时间"
183 end-placeholder="结束时间" /> 183 end-placeholder="结束时间" />
184 </template> 184 </template>
185 <template v-else-if="item.type == 'date-range'">
186 <el-date-picker v-model="formInline[item.field]" type="daterange" start-placeholder="开始日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
187 end-placeholder="结束日期" />
188 </template>
185 <template v-else-if="item.type == 'radio-button'"> 189 <template v-else-if="item.type == 'radio-button'">
186 <el-radio-group v-model="formInline[item.field]" @change="radioGroupChange"> 190 <el-radio-group v-model="formInline[item.field]" @change="radioGroupChange">
187 <el-radio-button v-for="opts in item.options" :label="opts.label" /> 191 <el-radio-button v-for="opts in item.options" :label="opts.label" />
......
...@@ -6,15 +6,19 @@ ...@@ -6,15 +6,19 @@
6 import { ref } from 'vue'; 6 import { ref } from 'vue';
7 import { TableColumnWidth, commonPageConfig } from '@/utils/enum'; 7 import { TableColumnWidth, commonPageConfig } from '@/utils/enum';
8 import { 8 import {
9 saveDamContract,
10 updateDamContract,
11 delDamContract,
9 getContractList, 12 getContractList,
10 getParamsList, 13 getParamsList,
11 getTenantList, 14 getTenantList
12 getOwnerTenantList
13 } from "@/api/modules/dataAsset"; 15 } from "@/api/modules/dataAsset";
14 import { Plus } from "@element-plus/icons-vue"; 16 import { Plus } from "@element-plus/icons-vue";
15 import TableTools from "@/components/Tools/table_tools.vue"; 17 import TableTools from "@/components/Tools/table_tools.vue";
16 import { useValidator } from '@/hooks/useValidator'; 18 import { useValidator } from '@/hooks/useValidator';
17 import useUserStore from "@/store/modules/user"; 19 import useUserStore from "@/store/modules/user";
20 import { cloneDeep } from 'lodash-es';
21 import { onUploadFileDownload } from '@/api/modules/common';
18 22
19 const { proxy } = getCurrentInstance() as any; 23 const { proxy } = getCurrentInstance() as any;
20 const userStore = useUserStore(); 24 const userStore = useUserStore();
...@@ -28,10 +32,9 @@ const tradeContractNodesList: any = ref([]); ...@@ -28,10 +32,9 @@ const tradeContractNodesList: any = ref([]);
28 /** 资产合同节点 */ 32 /** 资产合同节点 */
29 const registerContractNodesList: any = ref([]); 33 const registerContractNodesList: any = ref([]);
30 34
35 /** 甲方乙方的下拉会员列表 */
31 const partyAList: any = ref([]); 36 const partyAList: any = ref([]);
32 37
33 const partyBList: any = ref([]);
34
35 const searchItemList = ref([ 38 const searchItemList = ref([
36 { 39 {
37 type: "input", 40 type: "input",
...@@ -62,7 +65,7 @@ const searchItemList = ref([ ...@@ -62,7 +65,7 @@ const searchItemList = ref([
62 clearable: true 65 clearable: true
63 }, 66 },
64 { 67 {
65 type: "date-time", 68 type: "date-range",
66 field: "dateRange", 69 field: "dateRange",
67 default: null, 70 default: null,
68 placeholder: "开始日期~结束日期", 71 placeholder: "开始日期~结束日期",
...@@ -96,36 +99,47 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -96,36 +99,47 @@ const toSearch = (val: any, clear: boolean = false) => {
96 getTableData(); 99 getTableData();
97 }; 100 };
98 101
102 const tableTools = ref();
103
104 const handleSearchChange = (val, row, info) => {
105 if (row.field == 'contractTypeCode') {
106 tableTools.value.toolSearch.formInline.contractNodeCode = '';
107 searchItemList.value[2].options = val == '1' ? registerContractNodesList.value : tradeContractNodesList.value;
108 }
109 }
110
99 const getTableData = () => { 111 const getTableData = () => {
100 //tableInfo.value.loading = true; 112 tableInfo.value.loading = true;
101 // getContractList({ 113 getContractList({
102 // pageSize: page.value.limit, 114 pageSize: page.value.limit,
103 // pageIndex: page.value.curr, 115 pageIndex: page.value.curr,
104 // contractName: page.value.contractName, 116 contractName: page.value.contractName,
105 // contractTypeCode: page.value.contractTypeCode, 117 contractTypeCode: page.value.contractTypeCode,
106 // contractNodeCode: page.value.contractNodeCode, 118 contractNodeCode: page.value.contractNodeCode,
107 // startDate: page.value.dateRange?.[0] || '', 119 startDate: page.value.dateRange?.[0] || '',
108 // endDate: page.value.dateRange?.[1] || '', 120 endDate: page.value.dateRange?.[1] || '',
109 // }).then((res: any) => { 121 }).then((res: any) => {
110 // tableInfo.value.loading = false 122 tableInfo.value.loading = false
111 // if (res.code == proxy.$passCode) { 123 if (res.code == proxy.$passCode) {
112 // const data = res.data || {} 124 const data = res.data || {}
113 // tableInfo.value.data = data.records || []; 125 tableInfo.value.data = data.records || [];
114 // tableInfo.value.page.curr = data.pageIndex; 126 tableInfo.value.page.curr = data.pageIndex;
115 // tableInfo.value.page.rows = data.totalRows || 0; 127 tableInfo.value.page.rows = data.totalRows || 0;
116 // } else { 128 } else {
117 // proxy.$ElMessage.error(res.msg); 129 proxy.$ElMessage.error(res.msg);
118 // } 130 }
119 // }) 131 })
120 } 132 }
121 133
134 const currTableData: any = ref({});
135
122 const tableInfo = ref({ 136 const tableInfo = ref({
123 id: 'contract-data-table', 137 id: 'contract-data-table',
124 rowKey: 'guid', 138 rowKey: 'guid',
125 loading: false, 139 loading: false,
126 fields: [ 140 fields: [
127 { label: "合同名称", field: "contractName", width: 180, align: "left" }, 141 { label: "合同名称", field: "contractName", width: 160, align: "left" },
128 { label: "合同类型", field: "contractTypeName", width: 140 }, 142 { label: "合同类型", field: "contractTypeName", width: 120 },
129 { label: "甲方名称", field: "partyAName", width: 180 }, 143 { label: "甲方名称", field: "partyAName", width: 180 },
130 { label: "乙方名称", field: "partyBName", width: 180 }, 144 { label: "乙方名称", field: "partyBName", width: 180 },
131 { label: "签约日期", field: "signContractDate", width: TableColumnWidth.DATE }, 145 { label: "签约日期", field: "signContractDate", width: TableColumnWidth.DATE },
...@@ -134,7 +148,7 @@ const tableInfo = ref({ ...@@ -134,7 +148,7 @@ const tableInfo = ref({
134 { label: "进展节点", field: "contractNodeName", width: 140, align: "left" }, 148 { label: "进展节点", field: "contractNodeName", width: 140, align: "left" },
135 { label: "开始日期", field: "startDate", width: TableColumnWidth.DATE }, 149 { label: "开始日期", field: "startDate", width: TableColumnWidth.DATE },
136 { label: "结束日期", field: "endDate", width: TableColumnWidth.DATE }, 150 { label: "结束日期", field: "endDate", width: TableColumnWidth.DATE },
137 { label: "工作内容描述", field: "endDate", width: 280 }, 151 { label: "工作内容描述", field: "contentDescribe", width: 280 },
138 ], 152 ],
139 data: [], 153 data: [],
140 page: { 154 page: {
...@@ -145,7 +159,22 @@ const tableInfo = ref({ ...@@ -145,7 +159,22 @@ const tableInfo = ref({
145 }); 159 });
146 160
147 const getNodeSteps = (scope) => { 161 const getNodeSteps = (scope) => {
148 return []; 162 let contractNodeCodes = scope.row.contractNodeCodes || [];
163 return {
164 list: contractNodeCodes.map((n, index) => {
165 return {
166 tooltip: {
167 placement: 'top',
168 content: n.name,
169 className: 'step_title_tooltip',
170 effect: 'light',
171 },
172 title: n.name,
173 value: index + 1
174 }
175 }),
176 step: scope.row.contractNodes.length - 1
177 }
149 } 178 }
150 179
151 const contractEditFormItems = ref([ 180 const contractEditFormItems = ref([
...@@ -190,7 +219,7 @@ const contractEditFormItems = ref([ ...@@ -190,7 +219,7 @@ const contractEditFormItems = ref([
190 type: "select", 219 type: "select",
191 placeholder: "请选择", 220 placeholder: "请选择",
192 field: "partyBGuid", 221 field: "partyBGuid",
193 options: partyBList.value, 222 options: partyAList.value,
194 props: { 223 props: {
195 value: 'guid', 224 value: 'guid',
196 label: 'tenantName' 225 label: 'tenantName'
...@@ -206,13 +235,11 @@ const contractEditFormItems = ref([ ...@@ -206,13 +235,11 @@ const contractEditFormItems = ref([
206 placeholder: "请选择", 235 placeholder: "请选择",
207 field: "contractNodeCodes", 236 field: "contractNodeCodes",
208 options: [], 237 options: [],
209 props: {
210 value: 'paramValue',
211 label: 'paramName'
212 },
213 multiple: true, 238 multiple: true,
214 default: [], 239 default: [],
215 filterable: true, 240 filterable: true,
241 collapse: true,
242 tagsTooltip: true,
216 clearable: true, 243 clearable: true,
217 required: true, 244 required: true,
218 }, 245 },
...@@ -275,59 +302,235 @@ const drawerInfo = ref({ ...@@ -275,59 +302,235 @@ const drawerInfo = ref({
275 } 302 }
276 }) 303 })
277 304
305 const validate = async () => {
306 if (!nodesInfo.value?.length) {
307 return true;
308 }
309 let taskIndex = 0;
310 for (const task of nodesInfo.value) {
311 let res = await depFormRef.value['ref-' + task.contractNodeCode]?.ruleFormRef?.validate((valid, errorItem) => {
312 if (!valid) {
313 var obj = Object.keys(errorItem);
314 depFormRef.value['ref-' + task.contractNodeCode]?.ruleFormRef?.scrollToField(obj[0]);
315 return false;
316 }
317 })
318 if (!res) {
319 return res;
320 }
321 taskIndex++;
322 }
323 return true;
324 }
325
278 const drawerBtnClick = async (btn, info) => { 326 const drawerBtnClick = async (btn, info) => {
279 if (btn.value == 'cancel') { 327 if (btn.value == 'cancel') {
280 drawerInfo.value.visible = false; 328 drawerInfo.value.visible = false;
281 } else { 329 } else {
282 330 let res = await validate();
331 if (!res) {
332 return
333 }
334 info.contractNodes = [];
335 let index = 0;
336 for (const n of nodesInfo.value) {
337 let formInline = depFormRef.value['ref-' + n.contractNodeCode].formInline;
338 if (index != 0) {
339 if (formInline.dateRange[0] < info.contractNodes[index - 1].endDate) {
340 proxy.$ElMessage.error(`【${n.contractNodeName}】的开始日期应大于等于上一个节点的结束日期`);
341 depFormRef.value['ref-' + n.contractNodeCode]?.ruleFormRef?.scrollToField('dateRange');
342 return;
343 }
344 }
345 info.contractNodes.push(Object.assign({}, formInline, {
346 contractNodeCode: n.contractNodeCode,
347 contractGuid: currTableData.value.guid,
348 contractTypeCode: info.contractTypeCode,
349 startDate: formInline.dateRange[0],
350 endDate: formInline.dateRange[1],
351 nodeAchievement: formInline.nodeAchievement?.map(n => {
352 return {
353 name: n.name,
354 url: n.url
355 }
356 }) || []
357 }))
358 index++;
359 }
360 drawerInfo.value.footer.btns[1].loading = true;
361 if (drawerInfo.value.type == 'add') {
362 saveDamContract(info).then((res: any) => {
363 drawerInfo.value.footer.btns[1].loading = false;
364 if (res.code == proxy.$passCode) {
365 page.value.curr = 1;
366 getTableData();
367 proxy.$ElMessage.success('新增合同成功');
368 drawerInfo.value.visible = false;
369 } else {
370 proxy.$ElMessage.error(res.msg);
371 }
372 })
373 } else {
374 const params = { ...info };
375 params.guid = currTableData.value.guid;
376 updateDamContract(params).then((res: any) => {
377 drawerInfo.value.footer.btns[1].loading = false;
378 if (res.code == proxy.$passCode) {
379 getTableData();
380 proxy.$ElMessage.success('修改合同成功');
381 drawerInfo.value.visible = false;
382 } else {
383 proxy.$ElMessage.error(res.msg);
384 }
385 })
386 }
283 } 387 }
284 } 388 }
285 389
286 const drawerSelectChange = (val, row, info) => { 390 const drawerSelectChange = (val, row, info) => {
287 391 if (row.field == 'contractTypeCode') {
392 contractEditFormItems.value.forEach(item => {
393 item.default = info[item.field];
394 if (item.field == 'contractNodeCodes') {
395 item.default = '';
396 nodesInfo.value = [];
397 item.options = val == '1' ? registerContractNodesList.value : tradeContractNodesList.value;
398 }
399 });
400 } else if (row.field == 'contractNodeCodes') {
401 info.contractNodeCodes = val?.sort((a, b) => parseInt(a) - parseInt(b));
402 let oldNodesInfo = nodesInfo.value;
403 let nodeInfo: any[] = [];
404 info.contractNodeCodes?.forEach(code => {
405 let node = oldNodesInfo.find(on => on.contractNodeCode == code);
406 if (node) {
407 let formInline = depFormRef.value['ref-' + node.contractNodeCode]?.formInline || {};
408 node.nodeFormItems.forEach(item => {
409 item.default = formInline[item.field];
410 })
411 nodeInfo.push(node);
412 } else {
413 if (oldNodesInfo.length > 0 && parseInt(code) < parseInt(oldNodesInfo[oldNodesInfo.length - 1].contractNodeCode)) {
414 nodeInfo.push({
415 contractNodeCode: code,
416 contractNodeName: registerContractNodesList.value.find(r => r.value == code)?.label || tradeContractNodesList.value.find(r => r.value == code)?.label,
417 nodeFormItems: cloneDeep(nodeFormItems.value),
418 nodeFormRules: nodeFormRules.value
419 });
420 }
421 }
422 }) || [];
423 nodesInfo.value = nodeInfo;
424 }
288 } 425 }
289 426
290 const handleNodeFileView = (scope) => { 427 const contractNodeCodes = computed(() => {
428 return drawerRef.value?.getDrawerConRef('drawerFormRef')?.formInline?.contractNodeCodes;
429 })
291 430
431 const handleNodeFileView = (scope) => {
432 let file = scope.row?.nodeAchievement?.[0];
433 onUploadFileDownload(file);
292 } 434 }
293 435
294 const handleTableEdit = (scope) => { 436 const handleTableEdit = (scope) => {
295 437 drawerInfo.value.visible = true;
438 drawerInfo.value.type = 'edit';
439 drawerInfo.value.header.title = '编辑合同';
440 currTableData.value = scope.row;
441 contractEditFormItems.value.forEach(item => {
442 item.default = scope.row[item.field];
443 if (item.field == 'contractNodeCodes') {
444 item.default = scope.row.contractNodeCodes?.map(c => c.code) || [];
445 item.options = scope.row.contractTypeCode == '1' ? registerContractNodesList.value : tradeContractNodesList.value;
446 }
447 })
448 nodesInfo.value = scope.row.contractNodes?.map(node => {
449 let items = cloneDeep(nodeFormItems.value);
450 items.forEach(item => {
451 item.default = node[item.field];
452 if (item.field == 'dateRange') {
453 item.default = [node.startDate, node.endDate];
454 }
455 })
456 return Object.assign({}, node, {
457 nodeFormItems: items,
458 nodeFormRules: nodeFormRules.value
459 })
460 }) || [];
296 } 461 }
297 462
298 const handleTableDel = (scope) => { 463 const handleTableDel = (scope) => {
299 464 proxy.$openMessageBox("确定要删除该登记合同吗?", () => {
465 delDamContract([scope.row.guid]).then((res: any) => {
466 if (res.code == proxy.$passCode) {
467 page.value.curr = 1;
468 getTableData();
469 proxy.$ElMessage.success('删除登记合同成功');
470 } else {
471 proxy.$ElMessage.error(res.msg);
472 }
473 });
474 }, () => {
475 proxy.$ElMessage.info("已取消删除");
476 })
300 } 477 }
301 478
302 const handleCreate = () => { 479 const handleCreate = () => {
303 drawerInfo.value.visible = true; 480 drawerInfo.value.visible = true;
481 drawerInfo.value.type = 'add';
304 drawerInfo.value.header.title = '新增合同'; 482 drawerInfo.value.header.title = '新增合同';
305 483 contractEditFormItems.value.forEach(item => {
484 item.default = '';
485 if (item.field == 'partyBGuid') {
486 item.default = userData.tenantGuid;
487 }
488 })
306 } 489 }
307 490
308 const nodesInfo: any = ref([]); 491 const nodesInfo: any = ref([]);
309 492
493 const depFormRef = ref({});
494 const setDepItemRef = (el: any, index: string) => {
495 if (el) {
496 depFormRef.value['ref-' + index] = el;
497 }
498 }
499
310 const nodeFormItems = ref([{ 500 const nodeFormItems = ref([{
311 label: '开始日期', 501 label: "开始日期~结束日期",
312 type: 'date', 502 type: "date-picker",
313 placeholder: '请输入', 503 field: "dateRange",
314 field: 'startDate', 504 default: [],
315 default: "", 505 placeholder: "开始日期~结束日期",
316 unlink: true,
317 disabled: false,
318 clearable: true,
319 required: true
320 }, {
321 label: '结束日期',
322 type: 'date',
323 placeholder: '请输入',
324 field: 'endDate',
325 default: "",
326 unlink: true,
327 disabled: false,
328 clearable: true, 506 clearable: true,
329 required: true 507 format: 'YYYY-MM-DD',
330 }, { 508 valueFormat: 'YYYY-MM-DD',
509 block: true,
510 required: true,
511 },
512 // {
513 // label: '开始日期',
514 // type: 'date',
515 // placeholder: '请选择',
516 // field: 'startDate',
517 // default: "",
518 // unlink: true,
519 // disabled: false,
520 // clearable: true,
521 // required: true
522 // }, {
523 // label: '结束日期',
524 // type: 'date',
525 // placeholder: '请选择',
526 // field: 'endDate',
527 // default: "",
528 // unlink: true,
529 // disabled: false,
530 // clearable: true,
531 // required: true
532 // },
533 {
331 label: '节点成果上传', 534 label: '节点成果上传',
332 tip: '支持格式:xls .xlsx .doc .docx .rar .zip', 535 tip: '支持格式:xls .xlsx .doc .docx .rar .zip',
333 type: 'upload-file', 536 type: 'upload-file',
...@@ -342,14 +545,19 @@ const nodeFormItems = ref([{ ...@@ -342,14 +545,19 @@ const nodeFormItems = ref([{
342 label: '工作内容描述', 545 label: '工作内容描述',
343 type: 'textarea', 546 type: 'textarea',
344 placeholder: '请输入', 547 placeholder: '请输入',
345 field: 'description', 548 field: 'contentDescribe',
346 default: '', 549 default: '',
550 maxlength: 200,
551 block: true,
347 clearable: true, 552 clearable: true,
348 },]); 553 },]);
349 554
350 const nodeFormRules = ref({ 555 const nodeFormRules = ref({
351 startDate: [required('请填写开始日期')], 556 dateRange: [{
352 endDate: [required('请填写结束日期')], 557 type: 'array', required: true, message: '请填写开始日期~结束日期', trigger: 'change',
558 }],
559 // startDate: [required('请填写开始日期')],
560 // endDate: [required('请填写结束日期')],
353 nodeAchievement: [{ 561 nodeAchievement: [{
354 validator: (rule: any, value: any, callback: any) => { 562 validator: (rule: any, value: any, callback: any) => {
355 if (!value?.length) { 563 if (!value?.length) {
...@@ -362,7 +570,22 @@ const nodeFormRules = ref({ ...@@ -362,7 +570,22 @@ const nodeFormRules = ref({
362 }); 570 });
363 571
364 const addNode = () => { 572 const addNode = () => {
573 let len = nodesInfo.value.length;
574 let code = contractNodeCodes.value[len];
575 nodesInfo.value.push({
576 contractNodeCode: code,
577 contractNodeName: registerContractNodesList.value.find(r => r.value == code)?.label || tradeContractNodesList.value.find(r => r.value == code)?.label,
578 nodeFormItems: cloneDeep(nodeFormItems.value),
579 nodeFormRules: nodeFormRules.value
580 })
581 }
365 582
583 const handleDelNode = (index) => {
584 proxy.$openMessageBox("确定要删除该进展阶段节点信息录入吗?", () => {
585 nodesInfo.value.splice(index, 1);
586 }, () => {
587 proxy.$ElMessage.info("已取消删除");
588 })
366 } 589 }
367 590
368 onBeforeMount(() => { 591 onBeforeMount(() => {
...@@ -379,7 +602,7 @@ onBeforeMount(() => { ...@@ -379,7 +602,7 @@ onBeforeMount(() => {
379 } 602 }
380 }) 603 })
381 getParamsList({ 604 getParamsList({
382 dictType: "登记合同节点" 605 dictType: "交易合同节点"
383 }).then((res: any) => { 606 }).then((res: any) => {
384 tradeContractNodesList.value = []; 607 tradeContractNodesList.value = [];
385 if (res.code == proxy.$passCode) { 608 if (res.code == proxy.$passCode) {
...@@ -389,7 +612,7 @@ onBeforeMount(() => { ...@@ -389,7 +612,7 @@ onBeforeMount(() => {
389 } 612 }
390 }) 613 })
391 getParamsList({ 614 getParamsList({
392 dictType: "交易合同节点" 615 dictType: "登记合同节点"
393 }).then((res: any) => { 616 }).then((res: any) => {
394 registerContractNodesList.value = []; 617 registerContractNodesList.value = [];
395 if (res.code == proxy.$passCode) { 618 if (res.code == proxy.$passCode) {
...@@ -406,15 +629,7 @@ onBeforeMount(() => { ...@@ -406,15 +629,7 @@ onBeforeMount(() => {
406 if (res.code == proxy.$passCode) { 629 if (res.code == proxy.$passCode) {
407 partyAList.value = res.data?.records || []; 630 partyAList.value = res.data?.records || [];
408 contractEditFormItems.value[2].options = partyAList.value; 631 contractEditFormItems.value[2].options = partyAList.value;
409 } else { 632 contractEditFormItems.value[3].options = partyAList.value;
410 proxy.$ElMessage.error(res.msg);
411 }
412 })
413 getOwnerTenantList(userData.userGuid).then((res: any) => {
414 partyAList.value = [];
415 if (res.code == proxy.$passCode) {
416 partyBList.value = res.data || [];
417 contractEditFormItems.value[3].options = partyBList.value;
418 } else { 633 } else {
419 proxy.$ElMessage.error(res.msg); 634 proxy.$ElMessage.error(res.msg);
420 } 635 }
...@@ -426,15 +641,16 @@ onBeforeMount(() => { ...@@ -426,15 +641,16 @@ onBeforeMount(() => {
426 <template> 641 <template>
427 <div class="container_wrap"> 642 <div class="container_wrap">
428 <div class="table_tool_wrap"> 643 <div class="table_tool_wrap">
429 <TableTools :searchItems="searchItemList" :searchId="'contract-data-search'" @search="toSearch" :init="true" /> 644 <TableTools ref="tableTools" :searchItems="searchItemList" :searchId="'contract-data-search'" @search="toSearch"
645 :init="true" @select-change="handleSearchChange" />
430 </div> 646 </div>
431 <div class="tools_btns"> 647 <div class="tools_btns">
432 <el-button type="primary" @click="handleCreate">新增</el-button> 648 <el-button type="primary" @click="handleCreate">新增</el-button>
433 </div> 649 </div>
434 <div class="table_panel_wrap"> 650 <div class="table_panel_wrap">
435 <el-table v-loading="tableInfo.loading" ref="tableRef" :data="tableInfo.data" :highlight-current-row="true" stripe 651 <el-table v-loading="tableInfo.loading" ref="tableRef" :data="tableInfo.data" :highlight-current-row="true" stripe
436 border height="100%" tooltip-effect="light" row-key="guid" 652 border height="100%" tooltip-effect="light" row-key="guid" class="expand-table"
437 :style="{ width: '100%', height: 'calc(100% - 8px)', marginTop: '8px', display: 'inline-block', }"> 653 :style="{ width: '100%', height: 'calc(100% - 8px)', margin: '8px 0px', display: 'inline-block', }">
438 <el-table-column type="expand"> 654 <el-table-column type="expand">
439 <template #default="scope"> 655 <template #default="scope">
440 <el-table ref="fieldsTableRef" :data="scope.row.contractNodes" :highlight-current-row="true" stripe border 656 <el-table ref="fieldsTableRef" :data="scope.row.contractNodes" :highlight-current-row="true" stripe border
...@@ -451,7 +667,7 @@ onBeforeMount(() => { ...@@ -451,7 +667,7 @@ onBeforeMount(() => {
451 <span>{{ scope.row[field.field || ''] || '--' }}</span> 667 <span>{{ scope.row[field.field || ''] || '--' }}</span>
452 </template> 668 </template>
453 </el-table-column> 669 </el-table-column>
454 <el-table-column label="附件信息" minWidth="120px" align="left" fixed="right" show-overflow-tooltip> 670 <el-table-column label="附件信息" width="120px" align="left" fixed="right" show-overflow-tooltip>
455 <template #default="scope"> 671 <template #default="scope">
456 <span class="text_btn" @click="handleNodeFileView(scope)">查看</span> 672 <span class="text_btn" @click="handleNodeFileView(scope)">查看</span>
457 </template> 673 </template>
...@@ -467,9 +683,9 @@ onBeforeMount(() => { ...@@ -467,9 +683,9 @@ onBeforeMount(() => {
467 <span>{{ scope.row[field.field || ''] || '--' }}</span> 683 <span>{{ scope.row[field.field || ''] || '--' }}</span>
468 </template> 684 </template>
469 </el-table-column> 685 </el-table-column>
470 <el-table-column label="进展阶段" width="320px" align="center"> 686 <el-table-column label="进展阶段" width="370px" align="center">
471 <template #default="scope"> 687 <template #default="scope">
472 <div class="custom-steps" v-if="scope.row.contractNodes?.length"> 688 <div class="custom-steps" v-if="scope.row.contractNodeCodes?.length">
473 <StepBar :steps-info="getNodeSteps(scope)" /> 689 <StepBar :steps-info="getNodeSteps(scope)" />
474 </div> 690 </div>
475 <span v-else>--</span> 691 <span v-else>--</span>
...@@ -487,18 +703,18 @@ onBeforeMount(() => { ...@@ -487,18 +703,18 @@ onBeforeMount(() => {
487 @drawerSelectChange='drawerSelectChange'> 703 @drawerSelectChange='drawerSelectChange'>
488 <!-- 传递到 Form 组件中的默认插槽 --> 704 <!-- 传递到 Form 组件中的默认插槽 -->
489 <template v-slot:default> 705 <template v-slot:default>
490 <template v-if="drawerRef.getDrawerConRef()?.formInline?.contractNodeCodes?.length > 0"> 706 <template v-if="contractNodeCodes?.length > 0">
491 <div class="title-label">进展阶段录入</div> 707 <div class="title-label">进展阶段录入</div>
492 <!-- 渲染行 --> 708 <!-- 渲染行 -->
493 <div v-for="(row, index) in nodesInfo" :key="index" class="match-content-wrapper"> 709 <div v-for="(row, index) in nodesInfo" :key="index" class="match-content-wrapper">
494 <div class="title-row"><span>{{ row.contractNodeName }}</span><span>删除</span></div> 710 <div class="title-row"><span class="title">{{ row.contractNodeName }}</span><span class="btns"
495 <Form ref="nodeFormRef" :itemList="nodeFormItems" formId="node-form" :rules="nodeFormRules" col="col2" /> 711 v-show="index == nodesInfo.length - 1" @click="handleDelNode(index)">删除</span></div>
712 <Form :ref="(el: any) => { setDepItemRef(el, row.contractNodeCode) }" :itemList="row.nodeFormItems"
713 :formId="'node-form' + index" :rules="row.nodeFormRules" col="col2" />
496 </div> 714 </div>
497 715
498 <!-- 新增按钮 --> 716 <!-- 新增按钮 -->
499 <div class="bottm_tools" 717 <div class="bottm_tools" v-show="nodesInfo.length < contractNodeCodes?.length" @click="addNode">
500 v-show="nodesInfo.length < drawerRef.getDrawerConRef()?.formInline?.contractNodeCodes?.length"
501 @click="addNode">
502 <el-icon> 718 <el-icon>
503 <Plus /> 719 <Plus />
504 </el-icon> 720 </el-icon>
...@@ -510,13 +726,13 @@ onBeforeMount(() => { ...@@ -510,13 +726,13 @@ onBeforeMount(() => {
510 </div> 726 </div>
511 </template> 727 </template>
512 728
513 <style lang="scss"> 729 <style lang="scss" scoped>
514 .container_wrap { 730 .container_wrap {
515 padding: 0 16px; 731 padding: 0 16px;
516 } 732 }
517 733
518 .table_panel_wrap { 734 .table_panel_wrap {
519 height: calc(100% - 48px); 735 height: calc(100% - 94px);
520 } 736 }
521 737
522 .ml4 { 738 .ml4 {
...@@ -525,7 +741,7 @@ onBeforeMount(() => { ...@@ -525,7 +741,7 @@ onBeforeMount(() => {
525 741
526 :deep(.custom-steps) { 742 :deep(.custom-steps) {
527 width: 100%; 743 width: 100%;
528 height: 60px; 744 height: 64px;
529 display: flex; 745 display: flex;
530 746
531 .el-steps { 747 .el-steps {
...@@ -535,6 +751,27 @@ onBeforeMount(() => { ...@@ -535,6 +751,27 @@ onBeforeMount(() => {
535 751
536 .title-label { 752 .title-label {
537 margin-bottom: 4px; 753 margin-bottom: 4px;
754 font-size: 18px;
755 color: #212121;
756 }
757
758 .title-row {
759 height: 48px;
760 display: flex;
761 justify-content: space-between;
762 align-items: center;
763
764 .title {
765 color: #212121;
766 font-size: 16px;
767 font-weight: 600;
768 }
769
770 .btns {
771 cursor: pointer;
772 color: var(--el-color-primary);
773 font-size: 14px;
774 }
538 } 775 }
539 776
540 .bottm_tools { 777 .bottm_tools {
...@@ -558,4 +795,18 @@ onBeforeMount(() => { ...@@ -558,4 +795,18 @@ onBeforeMount(() => {
558 border: 1px dashed var(--el-color-primary); 795 border: 1px dashed var(--el-color-primary);
559 } 796 }
560 } 797 }
798
799 :deep(.el-table.expand-table) {
800 .el-table__expanded-cell.el-table__cell {
801 background: #fff !important;
802 padding-left: 48px;
803 padding-right: 8px;
804 }
805 }
806
807 :deep(.el-steps) {
808 .el-step__head.is-finish .el-step__icon.is-icon {
809 background-color: transparent;
810 }
811 }
561 </style> 812 </style>
...\ No newline at end of file ...\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!