From 227e8ccf0cdf2babb84a043ab1e7b5bc32fc762c Mon Sep 17 00:00:00 2001 From: jia <1451658316@qq.com> Date: Fri, 22 Dec 2023 17:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=EF=BC=8C=E6=96=BD=E5=B7=A5=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E9=A1=B9=E7=9B=AE=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/build/build_division.ts | 2 +- src/api/build/build_plan.ts | 27 ++ src/api/build/build_process_settings.ts | 5 + src/api/project_member.ts | 5 + src/api/project_personnel.ts | 26 ++ src/components/build_process/index.vue | 77 +++++ src/components/project-member/index.vue | 70 ++++ src/views/InvoicingRequests/detail.vue | 21 +- src/views/InvoicingRequests/edit.vue | 24 +- src/views/administrativeContracts/detail.vue | 25 ++ src/views/administrativeContracts/edit.vue | 3 +- src/views/bid_bidding_decision/edit.vue | 21 +- src/views/bidbbond/edit.vue | 24 +- src/views/build/build_plan/detail.vue | 68 +++- src/views/build/build_plan/edit.vue | 315 ++++++++---------- src/views/build/build_plan/index.vue | 90 +++-- .../build/build_process_settings/detail.vue | 31 ++ .../build/build_process_settings/edit.vue | 58 +--- src/views/build/build_report/edit.vue | 259 ++++++++------ src/views/competitor/edit.vue | 2 +- src/views/contract/detail.vue | 7 +- src/views/contract/edit.vue | 98 ++++-- src/views/contract/index.vue | 16 +- src/views/contract_negotiation/edit.vue | 16 +- src/views/custom_follow/detail.vue | 2 +- src/views/customer_demand/edit.vue | 2 +- src/views/customer_demand_solution/edit.vue | 2 +- .../Management/editadjust.vue | 24 +- .../Management/editcost.vue | 28 +- src/views/paymentplan/detail.vue | 21 +- src/views/paymentplan/edit.vue | 24 +- src/views/paymentrequest/edit.vue | 24 +- src/views/procurement_contract/detail.vue | 2 +- src/views/procurement_contract/edit.vue | 2 +- src/views/project_document/detail.vue | 20 +- src/views/project_document/edit.vue | 33 +- src/views/project_document/index.vue | 13 +- src/views/project_estimate/edit.vue | 2 +- src/views/project_logs/edit.vue | 2 +- .../project_manager_appointment/detail.vue | 25 +- .../project_manager_appointment/edit.vue | 44 ++- src/views/project_personnel/detail.vue | 161 +++++++++ src/views/project_personnel/edit.vue | 273 +++++++++++++++ src/views/project_personnel/index.vue | 147 ++++++++ src/views/project_plan/detail.vue | 26 +- src/views/project_plan/edit.vue | 23 +- src/views/purchaseContracts/edit.vue | 2 +- src/views/purchaseContracts/index.vue | 6 +- .../qualitycontrol/quality_detection/edit.vue | 29 ++ src/views/quotation/edit.vue | 2 +- src/views/recordsPayment/detail.vue | 21 +- src/views/recordsPayment/edit.vue | 24 +- src/views/remittance/detail.vue | 21 +- src/views/remittance/edit.vue | 24 +- src/views/subcontract/detail.vue | 14 +- src/views/subcontract/edit.vue | 49 ++- src/views/subcontract/index.vue | 7 +- src/views/subcontracting_contract/edit.vue | 2 +- src/views/subcontracting_contract/index.vue | 4 +- 59 files changed, 1675 insertions(+), 720 deletions(-) create mode 100644 src/api/build/build_plan.ts create mode 100644 src/api/project_personnel.ts create mode 100644 src/components/build_process/index.vue create mode 100644 src/components/project-member/index.vue create mode 100644 src/views/project_personnel/detail.vue create mode 100644 src/views/project_personnel/edit.vue create mode 100644 src/views/project_personnel/index.vue diff --git a/src/api/build/build_division.ts b/src/api/build/build_division.ts index 42e4c6c..f68f351 100644 --- a/src/api/build/build_division.ts +++ b/src/api/build/build_division.ts @@ -1,6 +1,6 @@ import request from '@/utils/request' -// 分部分项划分表列表 +// 分项划分表列表 export function builddivisionLists(params: any) { return request.get({ url: '/build.build_division/lists', params }) } diff --git a/src/api/build/build_plan.ts b/src/api/build/build_plan.ts new file mode 100644 index 0000000..3cdfd78 --- /dev/null +++ b/src/api/build/build_plan.ts @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +// 施工计划表列表 +export function buildplanLists(params: any) { + return request.get({ url: '/build.build_plan/lists', params }) +} + +// 添加施工计划 +export function buildplanAdd(params: any) { + return request.post({ url: '/build.build_plan/add', params }) +} + +// 编辑施工计划 +export function buildplanEdit(params: any) { + return request.post({ url: '/build.build_plan/edit', params }) +} + +// 删除施工计划 +export function buildplanDelete(params: any) { + return request.post({ url: '/build.build_plan/delete', params }) +} + + +// 施工计划详情 +export function buildplanDetail(params: any) { + return request.get({ url: '/build.build_plan/detail', params }) +} \ No newline at end of file diff --git a/src/api/build/build_process_settings.ts b/src/api/build/build_process_settings.ts index d2517e6..3c17f7b 100644 --- a/src/api/build/build_process_settings.ts +++ b/src/api/build/build_process_settings.ts @@ -24,4 +24,9 @@ export function buildprocesssettingsDelete(params: any) { // 施工工序详情 export function buildprocesssettingsDetail(params: any) { return request.get({ url: '/build.build_process_settings/detail', params }) +} + +//获取某个分部工程下的工序列表 +export function listToDivision(params: any) { + return request.get({ url: '/build.build_process_settings/listToDivision', params }) } \ No newline at end of file diff --git a/src/api/project_member.ts b/src/api/project_member.ts index 0ac2f7c..3777b10 100644 --- a/src/api/project_member.ts +++ b/src/api/project_member.ts @@ -24,3 +24,8 @@ export function apiProjectmemberDelete(params: any) { export function apiProjectmemberDetail(params: any) { return request.get({ url: '/project.project_member/detail', params }) } + +//获取某个项目下的所有成员 +export function listToProject(params: any) { + return request.get({ url: '/project.project_member/listToProject', params }) +} diff --git a/src/api/project_personnel.ts b/src/api/project_personnel.ts new file mode 100644 index 0000000..a2d1bdb --- /dev/null +++ b/src/api/project_personnel.ts @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 项目人员表列表 +export function projectpersonnelLists(params: any) { + return request.get({ url: '/project.project_personnel/lists', params }) +} + +// 添加项目人员 +export function projectpersonnelAdd(params: any) { + return request.post({ url: '/project.project_personnel/add', params }) +} + +// 编辑项目人员 +export function projectpersonnelEdit(params: any) { + return request.post({ url: '/project.project_personnel/edit', params }) +} + +// 删除项目人员 +export function projectpersonnelDelete(params: any) { + return request.post({ url: '/project.project_personnel/delete', params }) +} + +// 项目人员详情 +export function projectpersonnelDetail(params: any) { + return request.get({ url: '/project.project_personnel/detail', params }) +} diff --git a/src/components/build_process/index.vue b/src/components/build_process/index.vue new file mode 100644 index 0000000..6912f2d --- /dev/null +++ b/src/components/build_process/index.vue @@ -0,0 +1,77 @@ + + + \ No newline at end of file diff --git a/src/components/project-member/index.vue b/src/components/project-member/index.vue new file mode 100644 index 0000000..f19dd8f --- /dev/null +++ b/src/components/project-member/index.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/src/views/InvoicingRequests/detail.vue b/src/views/InvoicingRequests/detail.vue index 6e6b61d..1bf2e38 100644 --- a/src/views/InvoicingRequests/detail.vue +++ b/src/views/InvoicingRequests/detail.vue @@ -210,20 +210,15 @@ const formData = reactive({ // 获取详情 const setFormData = async (data: Record) => { if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } // for (const key in formData) { diff --git a/src/views/InvoicingRequests/edit.vue b/src/views/InvoicingRequests/edit.vue index 00b9100..1e495d0 100644 --- a/src/views/InvoicingRequests/edit.vue +++ b/src/views/InvoicingRequests/edit.vue @@ -368,20 +368,15 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } @@ -411,8 +406,9 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { if (formDataannex.length > 0) { - formData.annex = formDataannex.map((item: any) => item.uri).toString() + formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri)) } + console.log(formRef.value?.validate(), '22222222') await formRef.value?.validate() diff --git a/src/views/administrativeContracts/detail.vue b/src/views/administrativeContracts/detail.vue index b071e14..4353fc8 100644 --- a/src/views/administrativeContracts/detail.vue +++ b/src/views/administrativeContracts/detail.vue @@ -70,7 +70,17 @@ + + +
+
+ {{ item.name }} + x +
+
+
+
@@ -93,6 +103,7 @@ defineProps({ default: () => ({}) } }) +const formDataannex = reactive([]) const emit = defineEmits(['success', 'close']) const formRef = shallowRef() const popupRef = shallowRef>() @@ -116,7 +127,21 @@ const setFormData = async (data: Record) => { Object.assign(formData, data) + if (data.annex && data.annex.length > 0) { + if (data.annex.includes(",")) { + const arry1 = data.annex.split(',').map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } else { + const arry1 = [{ name: `文件1`, uri: data.annex }] + Object.assign(formDataannex, arry1) + } + } } const getDetail = async (row: Record) => { diff --git a/src/views/administrativeContracts/edit.vue b/src/views/administrativeContracts/edit.vue index 03e85ff..632d66e 100644 --- a/src/views/administrativeContracts/edit.vue +++ b/src/views/administrativeContracts/edit.vue @@ -188,6 +188,7 @@ const popupTitle = computed(() => { // 表单数据 const formData = reactive({ + id: '', supplier_id: 0, contract_no: "", contract_name: "", @@ -224,7 +225,7 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { - if (data.annex.length > 0) { + if (data.annex && data.annex.length > 0) { if (data.annex.includes(",")) { const arry1 = data.annex.split(',').map((item: any, index: any) => { return { diff --git a/src/views/bid_bidding_decision/edit.vue b/src/views/bid_bidding_decision/edit.vue index 7d09c35..b3ec744 100644 --- a/src/views/bid_bidding_decision/edit.vue +++ b/src/views/bid_bidding_decision/edit.vue @@ -88,7 +88,7 @@
-
+ @@ -136,6 +136,7 @@ import configs from "@/config" const base_url = configs.baseUrl + configs.urlPrefix import useUserStore from "@/stores/modules/user"; const userStore = useUserStore(); +const formDataannex = reactive([]) // 上传文件 const handleAvatarSuccess_four = ( response, @@ -145,14 +146,14 @@ const handleAvatarSuccess_four = ( ElMessage.error(response.msg); return; } - formData.annex.push( + formDataannex.push( { uri: response.data.uri, name: response.data.name } ); }; // 删除上传的文件 const delFileFn = (index: number) => { - formData.annex.splice(index, 1) + formDataannex.splice(index, 1) } //获取值 const customEvent = (e: any) => { @@ -201,6 +202,17 @@ const setFormData = async (data: Record) => { matsname.value = data.project.person project_name.value = data.project.name project_code.value = data.project.project_code + if (data.annex && data.annex.length > 0) { + + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + + } for (const key in formData) { if (data[key] != null && data[key] != undefined) { //@ts-ignore @@ -221,6 +233,9 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { + if (formDataannex.length > 0) { + formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri)) + } await formRef.value?.validate() const data = { ...formData, } mode.value == 'edit' diff --git a/src/views/bidbbond/edit.vue b/src/views/bidbbond/edit.vue index be40640..13d53f5 100644 --- a/src/views/bidbbond/edit.vue +++ b/src/views/bidbbond/edit.vue @@ -264,20 +264,15 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } @@ -309,8 +304,9 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { if (formDataannex.length > 0) { - formData.annex = formDataannex.map((item: any) => item.uri).toString() + formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri)) } + console.log(formRef.value?.validate(), '22222222') await formRef.value?.validate() diff --git a/src/views/build/build_plan/detail.vue b/src/views/build/build_plan/detail.vue index cb15d2f..accc901 100644 --- a/src/views/build/build_plan/detail.vue +++ b/src/views/build/build_plan/detail.vue @@ -1,7 +1,7 @@ + diff --git a/src/views/project_personnel/edit.vue b/src/views/project_personnel/edit.vue new file mode 100644 index 0000000..98dcdfc --- /dev/null +++ b/src/views/project_personnel/edit.vue @@ -0,0 +1,273 @@ + + + diff --git a/src/views/project_personnel/index.vue b/src/views/project_personnel/index.vue new file mode 100644 index 0000000..f151429 --- /dev/null +++ b/src/views/project_personnel/index.vue @@ -0,0 +1,147 @@ + + + + diff --git a/src/views/project_plan/detail.vue b/src/views/project_plan/detail.vue index cb15d2f..ba0f9fa 100644 --- a/src/views/project_plan/detail.vue +++ b/src/views/project_plan/detail.vue @@ -31,6 +31,20 @@ {{ formData.project_manager_name }} + + + + + +
+
+ {{ item.name }} + x +
+
+ +
+
@@ -54,7 +68,7 @@ defineProps({ const emit = defineEmits(['success', 'close']) const formRef = shallowRef() const popupRef = shallowRef>() - +const formDataannex = reactive([]) const datas = reactive({ provinceOptions: [], cityOptions: [], @@ -72,7 +86,17 @@ const formData = reactive({ // 获取详情 const setFormData = async (data: Record) => { Object.assign(formData, data) + if (data.annex && data.annex.length > 0) { + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + + } } diff --git a/src/views/project_plan/edit.vue b/src/views/project_plan/edit.vue index e94c70a..ecf455b 100644 --- a/src/views/project_plan/edit.vue +++ b/src/views/project_plan/edit.vue @@ -254,20 +254,15 @@ const getlist1 = (id: any) => { // 获取详情 const setFormData = async (data: Record) => { if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } @@ -300,7 +295,7 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { if (formDataannex.length > 0) { - formData.annex = formDataannex.map((item: any) => item.uri).toString() + formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri)) } await formRef.value?.validate() diff --git a/src/views/purchaseContracts/edit.vue b/src/views/purchaseContracts/edit.vue index e537e50..0666127 100644 --- a/src/views/purchaseContracts/edit.vue +++ b/src/views/purchaseContracts/edit.vue @@ -340,7 +340,7 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { - if (data.annex.length > 0) { + if (data.annex && data.annex.length > 0) { if (data.annex.includes(",")) { const arry1 = data.annex.split(',').map((item: any, index: any) => { return { diff --git a/src/views/purchaseContracts/index.vue b/src/views/purchaseContracts/index.vue index 2622932..5a03082 100644 --- a/src/views/purchaseContracts/index.vue +++ b/src/views/purchaseContracts/index.vue @@ -48,11 +48,11 @@ - + - - + + diff --git a/src/views/qualitycontrol/quality_detection/edit.vue b/src/views/qualitycontrol/quality_detection/edit.vue index ceb2227..df4a061 100644 --- a/src/views/qualitycontrol/quality_detection/edit.vue +++ b/src/views/qualitycontrol/quality_detection/edit.vue @@ -176,6 +176,7 @@ const list1 = reactive([]) const list2 = reactive([]) const showDialog = ref(false) const project_name = ref('') +import feedback from '@/utils/feedback' import { deptAll } from '@/api/org/department' import { getAll } from '@/api/org/organization' const userInfo = userStore.userInfo @@ -321,6 +322,34 @@ const handleSubmit = async () => { formData.file = JSON.stringify(formDataannex.map((item: any) => item.uri)) } + + + const startTime = new Date(formData.actual_start_time) + const endTime = new Date(formData.actual_end_time) + if (endTime < startTime) { + feedback.msgError("实际结束时间不能小于实际开始时间"); + return + } else if (startTime > endTime) { + feedback.msgError("实际开始时间不能大于实际结束时间"); + return + } else { + console.log("实际开始时间和实际结束时间合法"); + } + + + const startTime1 = new Date(formData.scheduled_start_time) + const endTime1 = new Date(formData.scheduled_end_time) + if (endTime1 < startTime1) { + feedback.msgError("计划结束时间不能小于计划开始时间"); + return + } else if (startTime1 > endTime1) { + feedback.msgError("计划开始时间不能大于计划结束时间"); + return + } else { + console.log("计划开始时间和计划结束时间合法"); + } + + await formRef.value?.validate() diff --git a/src/views/quotation/edit.vue b/src/views/quotation/edit.vue index 5c59daa..ac62dce 100644 --- a/src/views/quotation/edit.vue +++ b/src/views/quotation/edit.vue @@ -260,7 +260,7 @@ const handleDelete = (row: any) => { }; // 获取详情 const setFormData = async (data: Record) => { - if (data.annex.length > 0) { + if (data.annex && data.annex.length > 0) { if (data.annex.includes(",")) { const arry1 = data.annex.split(',').map((item: any, index: any) => { return { diff --git a/src/views/recordsPayment/detail.vue b/src/views/recordsPayment/detail.vue index c0a8cae..704a48c 100644 --- a/src/views/recordsPayment/detail.vue +++ b/src/views/recordsPayment/detail.vue @@ -130,20 +130,15 @@ const formData = reactive({ const setFormData = async (data: Record) => { Object.assign(formData, data) if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } diff --git a/src/views/recordsPayment/edit.vue b/src/views/recordsPayment/edit.vue index 3dfdaca..d8ab736 100644 --- a/src/views/recordsPayment/edit.vue +++ b/src/views/recordsPayment/edit.vue @@ -346,20 +346,15 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } @@ -392,8 +387,9 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { if (formDataannex.length > 0) { - formData.annex = formDataannex.map((item: any) => item.uri).toString() + formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri)) } + console.log(formRef.value?.validate(), '22222222') await formRef.value?.validate() diff --git a/src/views/remittance/detail.vue b/src/views/remittance/detail.vue index 0828693..8e67493 100644 --- a/src/views/remittance/detail.vue +++ b/src/views/remittance/detail.vue @@ -117,20 +117,15 @@ const formData = reactive({ const setFormData = async (data: Record) => { Object.assign(formData, data) if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } diff --git a/src/views/remittance/edit.vue b/src/views/remittance/edit.vue index 5faf64b..022e260 100644 --- a/src/views/remittance/edit.vue +++ b/src/views/remittance/edit.vue @@ -200,20 +200,15 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { if (data.annex && data.annex.length > 0) { - if (data.annex.includes(",")) { - const arry1 = data.annex.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.annex }] - Object.assign(formDataannex, arry1) - console.log(formDataannex) - } + const arry1 = data.annex.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) + } @@ -239,8 +234,9 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { if (formDataannex.length > 0) { - formData.annex = formDataannex.map((item: any) => item.uri).toString() + formData.annex = JSON.stringify(formDataannex.map((item: any) => item.uri)) } + console.log(formRef.value?.validate(), '22222222') await formRef.value?.validate() diff --git a/src/views/subcontract/detail.vue b/src/views/subcontract/detail.vue index 92bf599..b53fc2d 100644 --- a/src/views/subcontract/detail.vue +++ b/src/views/subcontract/detail.vue @@ -7,22 +7,22 @@ - {{ formData.contract_name }} + {{ formData.project.name }} - {{ formData.contract_name }} + {{ formData.project.project_code }} - {{ formData.contract_name }} + {{ formData.contract.contract_name }} - {{ formData.contract_code }} + {{ formData.contract.contract_no }} @@ -31,11 +31,7 @@ - - - {{ formData.supplier_contract_no }} - - + {{ formData.negotiation_name }} diff --git a/src/views/subcontract/edit.vue b/src/views/subcontract/edit.vue index 72df86b..a825b69 100644 --- a/src/views/subcontract/edit.vue +++ b/src/views/subcontract/edit.vue @@ -211,7 +211,7 @@ const formData = reactive({ }) const customEvent = (e: any) => { - project_name.value = e.name + project_name.value = e.project_name; formData.project_id = e.id project_code.value = e.project_code showDialog.value = false; @@ -228,37 +228,28 @@ const formRules = reactive({ // 获取详情 const setFormData = async (data: Record) => { if (data.negotiation_quotation.length > 0) { - if (data.negotiation_quotation.includes(",")) { - const arry1 = data.negotiation_quotation.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.negotiation_quotation }] - Object.assign(formDataannex, arry1) - } + const arry1 = data.negotiation_quotation.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex, arry1) } if (data.negotiation_basis.length > 0) { - if (data.negotiation_basis.includes(",")) { - const arry1 = data.negotiation_basis.split(',').map((item: any, index: any) => { - return { - name: `文件${index + 1}`, - uri: item - }; - }); - Object.assign(formDataannex1, arry1) - } else { - const arry1 = [{ name: `文件1`, uri: data.negotiation_basis }] - Object.assign(formDataannex1, arry1) - } + const arry1 = data.negotiation_basis.map((item: any, index: any) => { + return { + name: `文件${index + 1}`, + uri: item + }; + }); + Object.assign(formDataannex1, arry1) + } - // project_name.value = data.project.name - // project_code.value = data.project.project_code + project_name.value = data.project.name + project_code.value = data.project.project_code for (const key in formData) { if (data[key] != null && data[key] != undefined) { @@ -282,10 +273,10 @@ const getDetail = async (row: Record) => { // 提交按钮 const handleSubmit = async () => { if (formDataannex.length > 0) { - formData.negotiation_quotation = formDataannex.map((item) => item.uri).toString() + formData.negotiation_quotation = JSON.stringify(formDataannex.map((item) => item.uri)) } if (formDataannex1.length > 0) { - formData.negotiation_basis = formDataannex1.map((item) => item.uri).toString() + formData.negotiation_basis = JSON.stringify(formDataannex1.map((item) => item.uri)) } await formRef.value?.validate() const data = { ...formData, } diff --git a/src/views/subcontract/index.vue b/src/views/subcontract/index.vue index 52b3b09..b9d0632 100644 --- a/src/views/subcontract/index.vue +++ b/src/views/subcontract/index.vue @@ -51,9 +51,10 @@ - - - + + + + diff --git a/src/views/subcontracting_contract/edit.vue b/src/views/subcontracting_contract/edit.vue index eda4111..e7373cd 100644 --- a/src/views/subcontracting_contract/edit.vue +++ b/src/views/subcontracting_contract/edit.vue @@ -342,7 +342,7 @@ const setFormData = async (data: Record) => { formData[key] = data[key] } } - if (data.annex.length > 0) { + if (data.annex && data.annex.length > 0) { if (data.file.includes(",")) { const arry1 = data.annex.split(',').map((item: any, index: any) => { return { diff --git a/src/views/subcontracting_contract/index.vue b/src/views/subcontracting_contract/index.vue index bc85d5e..1ee7caf 100644 --- a/src/views/subcontracting_contract/index.vue +++ b/src/views/subcontracting_contract/index.vue @@ -27,8 +27,8 @@
- - + +