diff --git a/src/api/common/index.ts b/src/api/common/index.ts
index a39a5de1..cd528398 100644
--- a/src/api/common/index.ts
+++ b/src/api/common/index.ts
@@ -87,6 +87,8 @@ enum Api {
GetClientFrtSelectList = '/mainApi/Common/GetClientFrtSelectList',
// 委托单位下拉
GetControllerClientList = '/mainApi/ClientCommon/GetControllerClientListByKey',
+ // 根据权限id获取表单设置
+ GetFormSetListByModule = '/mainApi/FormSet/GetFormSetListByModule'
}
// 委托单位下拉数据
@@ -469,6 +471,14 @@ export function GetCarrierSelectList(params) {
})
}
+export function GetFormSetListByModule(params) {
+ return request({
+ url: Api.GetFormSetListByModule,
+ method: 'get',
+ params
+ })
+}
+
/**
* 上传api路径
*/
diff --git a/src/components/Table/src/BasicTable.vue b/src/components/Table/src/BasicTable.vue
index 46de8ed3..3ebc07d3 100644
--- a/src/components/Table/src/BasicTable.vue
+++ b/src/components/Table/src/BasicTable.vue
@@ -9,7 +9,7 @@
-
diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts
index 84f996a6..91180592 100644
--- a/src/store/modules/app.ts
+++ b/src/store/modules/app.ts
@@ -38,7 +38,6 @@ interface AppState {
deleteId: string
FlowInstanceHistory:any
inBookingDetailsSave: boolean
- topDown: boolean
saveFlag: boolean
ctnallList: any
FlowInstancesDetailsType:String
@@ -70,7 +69,6 @@ export const useAppStore = defineStore({
saveNeedNumber: '',
deleteId: '',
inBookingDetailsSave: false,
- topDown: false,
saveFlag: false,
ctnallList: [],
needSavePages: {},
@@ -119,9 +117,6 @@ export const useAppStore = defineStore({
getsaveFlag(): any {
return this.saveFlag
},
- gettopDown(): any {
- return this.topDown
- },
getinBookingDetailsSave(): any {
return this.inBookingDetailsSave
},
@@ -214,9 +209,6 @@ export const useAppStore = defineStore({
setctnallList(data): void {
this.ctnallList = data
},
- settopDown(data): void {
- this.topDown = data
- },
setinBookingDetailsSave(data): void {
this.inBookingDetailsSave = data
},
diff --git a/src/views/baseinfo/formset/component/form.vue b/src/views/baseinfo/formset/component/form.vue
index 49666fdf..955484ff 100644
--- a/src/views/baseinfo/formset/component/form.vue
+++ b/src/views/baseinfo/formset/component/form.vue
@@ -236,6 +236,8 @@ import { FormSchema } from '/@/components/Table'
}
.table-box {
padding: 0 15px;
+ height: 65vh;
+ overflow: auto;
flex: 1;
.ant-input-disabled {
cursor: pointer;
diff --git a/src/views/baseinfo/sendReciveTem/TenantAuditStepModal.vue b/src/views/baseinfo/sendReciveTem/TenantAuditStepModal.vue
index 36dfb885..30d0843a 100644
--- a/src/views/baseinfo/sendReciveTem/TenantAuditStepModal.vue
+++ b/src/views/baseinfo/sendReciveTem/TenantAuditStepModal.vue
@@ -65,6 +65,7 @@
rowId.value = data.record.id
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
+ if (res.data.type) res.data.type = res.data.type.split(',')
setFieldsValue({
...res.data,
})
@@ -83,10 +84,8 @@
async function handleSave(exit) {
try {
const values = await validate()
+ if (values.type) values.type = String(values.type)
setModalProps({ confirmLoading: true, loading: true })
- // TODO custom api
- console.log(values)
- // loading.value = true;
const res: API.DataResult = await ApiEdit(values)
console.log(res)
if (res.succeeded) {
@@ -115,6 +114,7 @@
async function refresh() {
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
+ if (res.data.type) res.data.type = res.data.type.split(',')
await setFieldsValue({
...res.data,
})
diff --git a/src/views/baseinfo/sendReciveTem/columns.tsx b/src/views/baseinfo/sendReciveTem/columns.tsx
index 742219c6..a320e16b 100644
--- a/src/views/baseinfo/sendReciveTem/columns.tsx
+++ b/src/views/baseinfo/sendReciveTem/columns.tsx
@@ -1,3 +1,4 @@
+import { multiply } from 'lodash-es'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetCountrySelectList } from '/@/views/baseinfo/port/api'
import { ref } from 'vue'
@@ -53,11 +54,12 @@ export const columns: BasicColumn[] = [
width: 200,
customRender: ({ record }) => {
let RData = ''
- TypeList.forEach((item) => {
- if (item.value == record.type) {
- RData = item.label
- }
- })
+ if (record.type) {
+ RData = record.type
+ }
+ RData = RData.replace("1", "收货人")
+ RData = RData.replace("2", "发货人")
+ RData = RData.replace("3", "通知人")
return RData
},
},
@@ -169,7 +171,7 @@ export const formSchema: FormSchema[] = [
field: 'type',
label: '类型',
component: 'Select',
- required: false,
+ required: true,
dynamicDisabled: false,
colProps: { span: 12 },
componentProps: ({ formModel }) => {
@@ -177,6 +179,7 @@ export const formSchema: FormSchema[] = [
options: TypeList,
allowClear: true,
showSearch: true,
+ mode: 'multiple',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
diff --git a/src/views/operation/seaexport/detail/components/journal.vue b/src/views/operation/seaexport/detail/components/journal.vue
index d12058e8..df9a287a 100644
--- a/src/views/operation/seaexport/detail/components/journal.vue
+++ b/src/views/operation/seaexport/detail/components/journal.vue
@@ -36,6 +36,12 @@
const props = defineProps({
id: {
type: String
+ },
+ data: {
+ type: Array,
+ default: () => {
+ return []
+ }
}
})
// 日志列表数据
@@ -43,19 +49,11 @@
const logLoading = ref(false)
// 初始化日志数据
const init = () => {
- if (props.id) {
- logLoading.value = true
- GetSeaExportLogList({ id: props.id }).then((res) => {
- const { data } = res
- data.forEach(item => {
- if (item.createTime) item.createTime = item.createTime.split(' ')[0]
- })
- logList.value = data
- logLoading.value = false
- }).catch(() => {
- logLoading.value = false
- })
- }
+ const data = props.data
+ data.forEach(item => {
+ if (item.createTime) item.createTime = item.createTime.split(' ')[0]
+ })
+ logList.value = data
}
onMounted(() => {
init()
diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue
index a2d89e66..098d60c8 100644
--- a/src/views/operation/seaexport/detail/index.vue
+++ b/src/views/operation/seaexport/detail/index.vue
@@ -7,7 +7,6 @@
-
+
bookingDetails.value,
- (val) => {
- console.log(val)
- },
- {
- deep: true,
- },
- )
+ // 获取表单设置数据
+ const getFormSet = () => {
+ GetFormSetListByModule({ permissionId: permissionsInfo().permissionId }).then(res => {
+ const { data } = res
+ if (data && data.length) {
+ const content = JSON.parse(data[0].content).columns
+ // 存在修改实则表单规则
+ RefNoteInfo.value.updateSchema(content)
+ RefbasicInfo.value.updateSchema(content)
+ RefmailingInfo.value.updateSchemaL(content)
+ RefmailingInfo.value.updateSchemaR(content)
+ RefcargoInfo.value.updateSchema(content)
+ OtherInfo.value.updateSchema(content)
+ }
+ })
+ }
onMounted(() => {
+ // 根据permission获取表单设置数据
+ getFormSet()
// 如果详情页,隐藏主页面tab标签页
if (source.value != 'edit') document.getElementsByClassName('main-tab')[0].getElementsByClassName('ant-tabs-nav-wrap')[0].style.display = 'none'
})
@@ -291,13 +300,16 @@
if (route.query.id && !id.value) {
id.value = route.query.id
}
- bookingDetails.value = {}
- excuteRules.value = []
- excuteRulesType.value = ''
- Showtabs.value = false
+ bookingDetails.value = {
+ orderContactList: []
+ }
if (id.value) {
+ // 详情
+ excuteRules.value = []
+ excuteRulesType.value = ''
getDetail()
} else {
+ // 新增
detailsLoadOver.value = false
isLockBooking.value = false
}
@@ -329,121 +341,16 @@
res.data.ctnPriceInfo = [{}]
}
bookingDetails.value = res.data
- appStore.settopDown(false)
inPageLoading.value = false
- // 解决 业务来源 联动问题
- // if (res.data.sourceId) {
- // let sourceDetailIdArr: any = []
- // await GetClientSourceDetailSelectList({ id: res.data.sourceId }).then((res) => {
- // res.data.forEach((item) => {
- // sourceDetailIdArr.push({ label: item.detailName, value: item.id })
- // })
- // })
- // RefbasicInfo.value.updateSchema({
- // label: '来源明细',
- // field: 'sourceDetailId',
- // component: 'Select',
- // required: false,
- // dynamicDisabled: ({ values }) => {
- // return !values.sourceId || source.value != 'edit'
- // },
- // colProps: { span: 4 },
- // componentProps: {
- // allowClear: true,
- // options: sourceDetailIdArr,
- // showSearch: true,
- // filterOption: (input: string, option: any) => {
- // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
- // },
- // },
- // })
- // }
- // if (res.data.saleId) {
- // const FnsaleId: any = await GetSaleList()
- // FnsaleId.data.forEach(async (item) => {
- // if (item.id == res.data.saleId) {
- // let saleDeptIdArr: any = []
- // let saleOrgIdArr: any = []
- // item.saleOrgList.forEach((item) => {
- // saleOrgIdArr.push({ label: item.orgName, value: item.orgId })
- // })
- // if (item.defaultOrgId) {
- // await GetDeptList({ orgId: item.defaultOrgId }).then((res) => {
- // console.log(res, '所属分部 查询 所属部门')
- // res.data.forEach((item) => {
- // saleDeptIdArr.push({ label: item.orgName, value: item.id })
- // })
- // })
- // }
- // RefbasicInfo.value.updateSchema([
- // {
- // label: '所属分部',
- // field: 'saleOrgId',
- // component: 'Select',
- // required: false,
- // dynamicDisabled: source.value == 'edit' ? false : true,
- // // defaultValue: '',
- // colProps: { span: 4 },
- // componentProps: {
- // allowClear: true,
- // options: saleOrgIdArr,
- // showSearch: true,
- // filterOption: (input: string, option: any) => {
- // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
- // },
- // onChange: (e, obj) => {
- // // formModel.saleDeptId = ''
- // GetDeptList({ orgId: e }).then((res) => {
- // console.log(res, '所属分部 查询 所属部门')
- // let Arr: any = []
- // res.data.forEach((item) => {
- // Arr.push({ label: item.orgName, value: item.id })
- // })
- // updateSchema({
- // label: '所属部门',
- // field: 'saleDeptId',
- // component: 'Select',
- // required: false,
- // dynamicDisabled: source.value == 'edit' ? false : true,
- // // defaultValue: '',
- // colProps: { span: 4 },
- // componentProps: {
- // allowClear: true,
- // options: Arr,
- // showSearch: true,
- // filterOption: (input: string, option: any) => {
- // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
- // },
- // },
- // })
- // })
- // },
- // },
- // },
- // {
- // label: '所属部门',
- // field: 'saleDeptId',
- // component: 'Select',
- // required: false,
- // dynamicDisabled: source.value == 'edit' ? false : true,
- // // defaultValue: '',
- // colProps: { span: 4 },
- // componentProps: {
- // allowClear: true,
- // options: saleDeptIdArr,
- // showSearch: true,
- // filterOption: (input: string, option: any) => {
- // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
- // },
- // },
- // },
- // ])
- // }
- // })
- // }
+ // 如果存在表单修改规则,重新更新表单
+ if (res.data.formSetList && res.data.formSetList.length) {
+ const formSetContent = JSON.parse(res.data.formSetList[0].content)
+ console.log(formSetContent)
+
+ // RefbasicInfo.value.updateSchema()
+ }
})
.catch(() => {
- appStore.settopDown(false)
loading.value = false
})
}
@@ -600,23 +507,23 @@
// 组件的值发生变化时
function changeDetailFun(data) {
const { detail } = data
- // if (ifCompare(bookingDetails.value, detail.value) && !inChildLoading.value) {
- // checkSaveFun({ type: 'details', hasChange: true })
- // }
- // bookingDetails.value = detail.value
- }
- // // 校验两个对象是否一致
- // // function ifCompare(object1, object2) {
- // // var o1keys = Object.keys(object1)
- // // var o2keys = Object.keys(object2)
- // // if (o2keys.length !== o1keys.length) return false
- // // for (let i = 0; i <= o1keys.length - 1; i++) {
- // // const key = o1keys[i]
- // // if (!o2keys.includes(key)) return false
- // // if (object2[key] !== object1[key]) return false
- // // }
- // // return true
- // // }
+ if (ifCompare(bookingDetails.value, detail.value) && !inChildLoading.value) {
+ checkSaveFun({ type: 'details', hasChange: true })
+ }
+ bookingDetails.value = detail.value
+ }
+ // 校验两个对象是否一致
+ function ifCompare(object1, object2) {
+ var o1keys = Object.keys(object1)
+ var o2keys = Object.keys(object2)
+ if (o2keys.length !== o1keys.length) return false
+ for (let i = 0; i <= o1keys.length - 1; i++) {
+ const key = o1keys[i]
+ if (!o2keys.includes(key)) return false
+ if (object2[key] !== object1[key]) return false
+ }
+ return true
+ }
function checkSaveFun(data) {
if (inGoodsSave.value) {
return false
@@ -751,9 +658,6 @@
bookingDetails.value.atd = time + ':00'
}
}
- function handleComplete() {
- checkSaveFun({ type: 'details', hasChange: false })
- }
function inGoodsSaveFun(data) {
inGoodsSave.value = data
}
@@ -828,7 +732,6 @@
const { rows, type } = data
excuteRules.value = rows
excuteRulesType.value = type
- console.log(excuteRules.value, excuteRulesType.value)
}
// 提交订舱
const submitDc = (v) => {
diff --git a/src/views/operation/seaexport/detail/modules/PersonModal.vue b/src/views/operation/seaexport/detail/modules/PersonModal.vue
index ae9f8ddd..acd70231 100644
--- a/src/views/operation/seaexport/detail/modules/PersonModal.vue
+++ b/src/views/operation/seaexport/detail/modules/PersonModal.vue
@@ -10,7 +10,7 @@
@ok="handleSave"
>
-
+
@@ -89,6 +89,10 @@
setModalProps({ loading: false })
})
+ // 选择客户属性带出客户名称
+ const linkageForm = (v) => {
+ console.log(v)
+ }
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
// 选择联系人
const personChange = (e, obj) => {
@@ -107,7 +111,7 @@
loading.value = false
if (res.succeeded) {
createMessage.success(res.message)
- emit('success')
+ emit('success', values)
}
exit && closeModal()
} finally {
diff --git a/src/views/operation/seaexport/detail/modules/baseInfo.tsx b/src/views/operation/seaexport/detail/modules/baseInfo.tsx
index 00da45c6..cfe0100a 100644
--- a/src/views/operation/seaexport/detail/modules/baseInfo.tsx
+++ b/src/views/operation/seaexport/detail/modules/baseInfo.tsx
@@ -270,6 +270,7 @@ export const basicInfoFormSchema: FormSchema[] = [
field: 'forwarder',
component: 'ApiSelect',
required: false,
+ defaultValue: null,
dynamicDisabled: false,
colProps: { span: 5 },
componentProps: ({ formModel }) => {
@@ -1187,7 +1188,7 @@ export const noteFormSchema: FormSchema[] = [
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
- // defaultValue: '',
+ defaultValue: null,
colProps: { span: 5 },
componentProps: ({ formModel }) => {
return {
@@ -1210,7 +1211,7 @@ export const noteFormSchema: FormSchema[] = [
}
}
}
- },
+ }
},
{
field: 'serviceCode',
@@ -1224,7 +1225,7 @@ export const noteFormSchema: FormSchema[] = [
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
- // defaultValue: '',
+ defaultValue: null,
colProps: { span: 5 },
componentProps: ({ formModel }) => {
return {
@@ -1827,6 +1828,7 @@ export const cargoInfoFormSchema3: FormSchema[] = [
label: '',
field: 'cargoId',
component: 'Input',
+ defaultValue: 'S',
show: false
},
// 危险品
@@ -1834,21 +1836,25 @@ export const cargoInfoFormSchema3: FormSchema[] = [
label: '危险品等级',
field: 'dangerClass',
component: 'Input',
- required: false,
+ required: ({ values }) => {
+ return values.cargoId == 'D'
+ },
colProps: { span: 5 },
show: ({ values }) => {
return values.cargoId == 'D'
- },
+ }
},
{
label: '危险品编号',
field: 'dangerNo',
component: 'Input',
- required: false,
+ required: ({ values }) => {
+ return values.cargoId == 'D'
+ },
colProps: { span: 5 },
show: ({ values }) => {
return values.cargoId == 'D'
- },
+ }
},
{
label: '危险品页号',
@@ -2729,7 +2735,7 @@ export const personFormSchema: FormSchema[] = [
label: '客户类型',
component: 'Select',
colProps: { span: 12 },
- componentProps: ({ formModel }) => {
+ componentProps: ({ formModel, formActionType }) => {
return {
options: customTypeDict.value,
allowClear: true,
@@ -2752,12 +2758,11 @@ export const personFormSchema: FormSchema[] = [
// 情况联系人和
formModel.customerTypeName = ''
}
- formModel.customerId = ''
- formModel.customerName = ''
formModel.customerContactId = ''
formModel.name = ''
formModel.email = ''
formModel.tel = ''
+ formActionType ? formActionType.linkageForm(v) : null
},
}
},
@@ -2841,12 +2846,15 @@ export const personFormSchema: FormSchema[] = [
field: 'email',
component: 'Input',
colProps: { span: 12 },
+ required: true,
+ rules: [{ type: 'email', message: '请填写正确的邮箱地址' }]
},
{
label: '电话',
field: 'tel',
component: 'Input',
- colProps: { span: 12 },
+ required: true,
+ colProps: { span: 12 }
},
{
field: 'customerTypeName',
@@ -2877,7 +2885,7 @@ export const personColumns: BasicColumn[] = [
dataIndex: 'email',
title: '邮箱',
sorter: true,
- width: 150,
+ width: 150
},
{
dataIndex: 'tel',
@@ -2904,3 +2912,15 @@ export const personColumns: BasicColumn[] = [
width: 220,
},
]
+
+// 海运出口基础信息总表单
+export const basicInfoFormAllSchema: FormSchema[] = [
+ ...basicInfoFormSchema,
+ ...mailingInfoFormSchemaL,
+ ...mailingInfoFormSchemaR,
+ ...noteFormSchema,
+ ...cargoInfoFormSchema1,
+ ...cargoInfoFormSchema2,
+ ...cargoInfoFormSchema4,
+ ...otherInfoFormSchema
+]
\ No newline at end of file
diff --git a/src/views/operation/seaexport/detail/modules/basicInfo.vue b/src/views/operation/seaexport/detail/modules/basicInfo.vue
index b2df74fc..a4dd06f3 100644
--- a/src/views/operation/seaexport/detail/modules/basicInfo.vue
+++ b/src/views/operation/seaexport/detail/modules/basicInfo.vue
@@ -7,7 +7,7 @@