From 49d6496fe67c752000474cd30ad1b6947857df4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?=
<14166000+zhangtonghai@user.noreply.gitee.com>
Date: Fri, 10 May 2024 17:02:01 +0800
Subject: [PATCH] 05/10
---
.env.development | 12 +-
.../operation/seaexport/detail/index.vue | 221 ++++++++++++++++++
.../seaexport/detail/modules/basicInfo.vue | 15 +-
.../seaexport/detail/modules/cargoInfo.vue | 11 +
.../seaexport/detail/modules/ediMore.vue | 15 +-
.../seaexport/detail/modules/mailingInfo.vue | 4 +
.../seaexport/detail/modules/mastetMore.vue | 12 +-
.../detail/modules/operationArea.vue | 17 ++
8 files changed, 280 insertions(+), 27 deletions(-)
diff --git a/.env.development b/.env.development
index ecbdea06..302ad8cd 100644
--- a/.env.development
+++ b/.env.development
@@ -1,11 +1,3 @@
-###
- # @Author: 张同海 14166000+zhangtonghai@user.noreply.gitee.com
- # @Date: 2024-04-17 10:30:29
- # @LastEditors: 张同海 14166000+zhangtonghai@user.noreply.gitee.com
- # @LastEditTime: 2024-05-09 15:50:33
- # @FilePath: \ds-wms-client-web\.env.development
- # @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-###
# Whether to open mock
VITE_USE_MOCK = true
@@ -22,8 +14,8 @@ VITE_PROXY=[["/api","http://60.209.125.238:3008"],["/stage-api","https://www.666
VITE_DROP_CONSOLE = false
# 后台接口父地址(必填)
-VITE_GLOB_API_URL=http://localhost:3008
-# VITE_GLOB_API_URL="/api" # 开发 测试环境
+# VITE_GLOB_API_URL=http://localhost:3008
+VITE_GLOB_API_URL="/api" # 开发 测试环境
# File upload address, optional
#VITE_GLOB_UPLOAD_URL=http://localhost:8091/api/Common/UploadFile
diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue
index 3464ec98..aa958a97 100644
--- a/src/views/operation/seaexport/detail/index.vue
+++ b/src/views/operation/seaexport/detail/index.vue
@@ -29,6 +29,8 @@
@handleSaveCtnList="handleSaveCtnList"
@handleSetCtnList="handleSetCtnList"
@frompre="frompre"
+ @SetDefault="setDefault"
+ @GetDefault="getDefault"
>
@@ -234,6 +236,19 @@
import pending from './modules/pending.vue'
import rightContent from './modules/rightContent.vue'
import sedOrder from './modules/sedOrder.vue'
+ import { permissionsInfo } from '/@/hooks/web/usePermission'
+ import { editCodeGoodsType, getFormSetInfoByModule } from '/@/views/baseinfo/formset/api'
+ import {
+ basicInfoFormSchema,
+ mailingInfoFormSchemaL,
+ mailingInfoFormSchemaR,
+ cargoInfoFormSchema1,
+ cargoInfoFormSchema2,
+ cargoInfoFormSchema3,
+ cargoInfoFormSchema4,
+ ediMoreFormSchema,
+ mastetMoreFormSchema,
+ } from '/@/views/operation/seaexport/columns'
const initDetail = {
cntrNo: '',
// ----------
@@ -806,6 +821,211 @@
lastPages[key] = $data
appStore.setneedSavePages(lastPages)
}
+ //存默认值
+ function setDefault() {
+ let _data: any = []
+ basicInfoFormSchema.forEach((item) => {
+ Object.keys(RefbasicInfo.value.getFieldsValue()).forEach((e) => {
+ if (
+ item.field == e &&
+ e !== 'id' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ // _data.push({ ...item, defaultValue: RefbasicInfo.value.getFieldsValue()[e] })
+ }
+ })
+ })
+ console.log(_data)
+
+ mailingInfoFormSchemaL.forEach((item) => {
+ Object.keys(RefmailingInfo.value.getFieldsValueL()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ mailingInfoFormSchemaR.forEach((item) => {
+ Object.keys(RefmailingInfo.value.getFieldsValueR()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ cargoInfoFormSchema1.forEach((item) => {
+ Object.keys(RefcargoInfo.value.getFieldsValue()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ cargoInfoFormSchema2.forEach((item) => {
+ Object.keys(RefcargoInfo.value.getFieldsValue()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ cargoInfoFormSchema3.forEach((item) => {
+ Object.keys(RefcargoInfo.value.getFieldsValue()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ cargoInfoFormSchema4.forEach((item) => {
+ Object.keys(RefcargoInfo.value.getFieldsValue()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ ediMoreFormSchema.forEach((item) => {
+ Object.keys(RefediMore.value.getFieldsValue()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ mastetMoreFormSchema.forEach((item) => {
+ Object.keys(RefmastetMore.value.getFieldsValue()).forEach((e) => {
+ if (
+ item.field == e &&
+ RefbasicInfo.value.getFieldsValue()[e] !== '' &&
+ RefbasicInfo.value.getFieldsValue()[e] !== null
+ ) {
+ _data.push({
+ defaultValue: RefbasicInfo.value.getFieldsValue()[e],
+ field: item.field || '',
+ label: item.label || '',
+ required: item.required || false,
+ colProps: item.colProps || { span: 24 },
+ component: item.component,
+ })
+ }
+ })
+ })
+ console.log(_data)
+
+ const Apidata: any = {
+ // id: 0,
+ permissionId: permissionsInfo().permissionId,
+ templateName: permissionsInfo().permissionName,
+ permissionName: permissionsInfo().permissionName,
+ content: JSON.stringify({
+ columns: _data,
+ }),
+ }
+ editCodeGoodsType(Apidata).then((res) => {
+ if (res.succeeded) {
+ notification.success({ message: '添加成功!', duration: 3 })
+ }
+ })
+ }
+ function updateSchema(data) {
+ console.log(data, 'updateSchema')
+
+ RefbasicInfo.value.updateSchema(data)
+ // RefmailingInfo.value.updateSchemaL(data)
+ // RefmailingInfo.value.updateSchemaR(data)
+ // RefcargoInfo.value.updateSchema(data)
+ // RefediMore.value.updateSchema(data)
+ // RefmastetMore.value.updateSchema(data)
+ }
+ function getDefault() {
+ console.log('getDefault')
+ getFormSetInfoByModule({ permissionId: permissionsInfo().permissionId }).then((res) => {
+ if (res?.data?.content) {
+ const content = JSON.parse(res.data.content)
+ updateSchema(content.columns)
+ }
+ })
+ }
// ============================================
function getRouterHis() {
inChildLoading.value = true
@@ -1973,6 +2193,7 @@
diff --git a/src/views/operation/seaexport/detail/modules/cargoInfo.vue b/src/views/operation/seaexport/detail/modules/cargoInfo.vue
index 5ca7ca87..d45ffd95 100644
--- a/src/views/operation/seaexport/detail/modules/cargoInfo.vue
+++ b/src/views/operation/seaexport/detail/modules/cargoInfo.vue
@@ -636,6 +636,7 @@
registerForm1,
{
getFieldsValue: getFieldsValue1,
+ updateSchema: updateSchema1,
validateFields: validateFields1,
setFieldsValue: setFieldsValue1,
},
@@ -648,6 +649,7 @@
registerForm2,
{
getFieldsValue: getFieldsValue2,
+ updateSchema: updateSchema2,
validateFields: validateFields2,
setFieldsValue: setFieldsValue2,
},
@@ -660,6 +662,7 @@
registerForm3,
{
getFieldsValue: getFieldsValue3,
+ updateSchema: updateSchema3,
validateFields: validateFields3,
setFieldsValue: setFieldsValue3,
validate: validate3,
@@ -834,6 +837,7 @@
registerForm4,
{
getFieldsValue: getFieldsValue4,
+ updateSchema: updateSchema4,
validateFields: validateFields4,
setFieldsValue: setFieldsValue4,
},
@@ -1225,10 +1229,17 @@
validateFields3()
validateFields4()
}
+ function updateSchema(data) {
+ updateSchema1(data)
+ updateSchema2(data)
+ updateSchema3(data)
+ updateSchema4(data)
+ }
defineExpose({
// RefcargoFrom,
validateFields,
getFieldsValue,
+ updateSchema,
})