委托单位

szh-new
lijingjia 4 months ago
parent dd56064186
commit f14d250ca7

@ -126,13 +126,7 @@
} }
id = ids[index + 1] id = ids[index + 1]
} }
closePage() closePage(route.path + '?id=' + id)
go({
path: route.path,
query: {
id
}
})
} else { } else {
createMessage.warning('列表页面数据丢失,请回退列表页面后重试!') createMessage.warning('列表页面数据丢失,请回退列表页面后重试!')
} }

@ -1,6 +1,9 @@
.icon-locksuo { .icon-locksuo, .icon-duihao1 {
color: #17a6a3; color: #17a6a3;
} }
.icon-lock-openkaisuo { .icon-lock-openkaisuo, .icon-chahao {
color: #7a8798; color: @msg-color;
}
.icon-bingtu3 {
color: #257afa;
} }

@ -19,8 +19,7 @@ export function formatTableData(v) {
*/ */
export function closePage(topath) { export function closePage(topath) {
const tabStore = useMultipleTabStore() const tabStore = useMultipleTabStore()
// 当前路由 tabStore.closeTab(router.currentRoute._value, router)
const fullPath = router?.currentRoute?._value?.fullPath
// 有目标路径则跳转 // 有目标路径则跳转
if (topath) { if (topath) {
router.push(topath) router.push(topath)

@ -5,7 +5,6 @@ enum Api {
list = '/mainApi/OrderContact/GetOrderContactList', list = '/mainApi/OrderContact/GetOrderContactList',
edit = '/mainApi/OrderContact/EditOrderContact', edit = '/mainApi/OrderContact/EditOrderContact',
info = '/mainApi/OrderContact/GetOrderContactInfo', info = '/mainApi/OrderContact/GetOrderContactInfo',
OrderContact = '/mainApi/OrderContact/GetOrderContactListByClientId', OrderContact = '/mainApi/OrderContact/GetOrderContactListByClientId',
Del = '/mainApi/OrderContact/BatchDelOrderContact', Del = '/mainApi/OrderContact/BatchDelOrderContact',

@ -1999,10 +1999,19 @@ export function EditBusinessOrderContact(params) {
} }
// 委托单位联系人详情 // 委托单位联系人详情
export function GetBusinessOrderContactInfo(data) { export function GetBusinessOrderContactInfo(params) {
return request({ return request({
url: '/opApi/BusinessOrderContact/GetBusinessOrderContactInfo', url: '/opApi/BusinessOrderContact/GetBusinessOrderContactInfo',
method: 'post', method: 'get',
data params
})
}
// 联系人下拉
export function GetOrderContactListByClientId(params) {
return request({
url: '/mainApi/OrderContact/GetOrderContactListByClientId',
method: 'get',
params
}) })
} }

@ -221,6 +221,7 @@ export const formSchema2: FormSchema[] = [
}) })
}, },
labelField: 'ediCode', labelField: 'ediCode',
showName: 'portName',
valueField: 'id', valueField: 'id',
resultField: 'data', resultField: 'data',
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {

@ -3,13 +3,24 @@
v-bind="$attrs" v-bind="$attrs"
:use-wrapper="true" :use-wrapper="true"
:title="getTitle" :title="getTitle"
:form-schema="formSchema" :form-schema="personFormSchema"
width="50%" width="50%"
@register="registerModal" @register="registerModal"
@ok="handleSave" @ok="handleSave"
> >
<!-- 包装表单 --> <!-- 包装表单 -->
<BasicForm @register="registerForm" /> <BasicForm @register="registerForm">
<template #service="item">
<a-select show-search v-model:value="item.opid"
:default-active-first-option="false" :show-arrow="false" allowClear
:filter-option="false" :not-found-content="null"
>
<a-select-option v-for="item in personList" :key="item.id" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</template>
</BasicForm>
<!--右下角按钮--> <!--右下角按钮-->
<template #footer> <template #footer>
<a-button <a-button
@ -47,10 +58,11 @@
// //
import { BasicModal, useModalInner } from '/@/components/Modal' import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil'
// //
import { personFormSchema } from './baseInfo' import { personFormSchema } from './baseInfo'
// //
import { EditBusinessOrderContact, GetBusinessOrderContactInfo } from '/@/views/operation/seaexport/api/BookingLedger' import { EditBusinessOrderContact, GetBusinessOrderContactInfo, GetOrderContactListByClientId } from '/@/views/operation/seaexport/api/BookingLedger'
// //
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
// Emits // Emits
@ -59,6 +71,8 @@
// loading // loading
const loading = ref(false) const loading = ref(false)
const rowId = ref('') const rowId = ref('')
//
const personList = ref([])
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({ useForm({
@ -68,6 +82,10 @@
}) })
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
//
GetOrderContactListByClientId({ id: data.companyId }).then(res => {
personList.value = res.data
})
resetFields() resetFields()
setModalProps({ confirmLoading: false, loading: true }) setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate isUpdate.value = !!data?.isUpdate
@ -82,7 +100,17 @@
}) })
} }
} else { } else {
setFieldsValue({ permissionIdentity: unref(2) }) //
const arr = await getDictOption('djy_cust_prop')
console.log(arr)
if (data.companyType) {
const res = arr.filter(item => {
return item.label == data.companyType
})
if (res && res.length) {
setFieldsValue({ customerType: res[0].value })
}
}
} }
setModalProps({ loading: false }) setModalProps({ loading: false })
}) })

@ -10,6 +10,7 @@ import {
GetDeptList, GetDeptList,
GetPackageSelectList, GetPackageSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger' } from '/@/views/operation/seaexport/api/BookingLedger'
import { useOptionsStore } from '/@/store/modules/options' import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore() const optionsStore = useOptionsStore()
const LockType = [ const LockType = [
@ -414,7 +415,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false, dynamicDisabled: false,
// defaultValue: '', // defaultValue: '',
colProps: { span: 3 }, colProps: { span: 3 },
componentProps: () => { componentProps: ({ formModel }) => {
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
@ -434,8 +435,21 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
onChange: (e, obj) => {
if (obj) {
formModel.operatorName = obj.label
} else {
formModel.operatorName = ''
}
} }
}
},
}, },
{
field: 'operatorName',
label: '',
component: 'Input',
show: false
}, },
{ {
label: '客服员', label: '客服员',
@ -445,7 +459,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false, dynamicDisabled: false,
// defaultValue: '', // defaultValue: '',
colProps: { span: 3 }, colProps: { span: 3 },
componentProps: () => { componentProps: ({ formModel }) => {
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
@ -464,8 +478,21 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
onChange: (e, obj) => {
if (obj) {
formModel.customerServiceName = obj.label
} else {
formModel.customerServiceName = ''
}
} }
}
},
}, },
{
field: 'customerServiceName',
label: '',
component: 'Input',
show: false
}, },
{ {
label: '单证', label: '单证',
@ -475,7 +502,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false, dynamicDisabled: false,
// defaultValue: '', // defaultValue: '',
colProps: { span: 3 }, colProps: { span: 3 },
componentProps: () => { componentProps: ({ formModel }) => {
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
@ -492,9 +519,22 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
onChange: (e, obj) => {
if (obj) {
formModel.docName = obj.label
} else {
formModel.docName = ''
}
}
} }
}, },
}, },
{
field: 'docName',
label: '',
component: 'Input',
show: false
},
{ {
label: '海外客服', label: '海外客服',
field: 'foreignCustomerService', field: 'foreignCustomerService',
@ -503,7 +543,7 @@ export const basicInfoFormSchema: FormSchema[] = [
dynamicDisabled: false, dynamicDisabled: false,
// defaultValue: '', // defaultValue: '',
colProps: { span: 3 }, colProps: { span: 3 },
componentProps: () => { componentProps: ({ formModel }) => {
return { return {
option: optionsStore.getOptionsByCode('GetSaleList'), option: optionsStore.getOptionsByCode('GetSaleList'),
allowClear: true, allowClear: true,
@ -513,9 +553,22 @@ export const basicInfoFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
onChange: (e, obj) => {
if (obj) {
formModel.foreignCustomerServiceName = obj.label
} else {
formModel.foreignCustomerServiceName = ''
}
}
} }
}, },
}, },
{
field: 'foreignCustomerServiceName',
label: '',
component: 'Input',
show: false
},
{ {
field: 'saleDeptId', field: 'saleDeptId',
label: '所属部门', label: '所属部门',
@ -532,9 +585,9 @@ export const basicInfoFormSchema: FormSchema[] = [
valueField: 'id', valueField: 'id',
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
} }
}, }
}
}, },
{ {
label: '所属分部', label: '所属分部',
@ -593,6 +646,7 @@ export const basicInfoFormSchema: FormSchema[] = [
{ {
field: 'truckerId', field: 'truckerId',
label: '车队', label: '车队',
labelSlot: 'truckerId',
component: 'ApiSelect', component: 'ApiSelect',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
@ -631,6 +685,7 @@ export const basicInfoFormSchema: FormSchema[] = [
{ {
label: '船公司', label: '船公司',
field: 'carrierId', field: 'carrierId',
labelSlot: 'carrierId',
component: 'ApiSelect', component: 'ApiSelect',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
@ -670,6 +725,7 @@ export const basicInfoFormSchema: FormSchema[] = [
{ {
label: '订舱代理', label: '订舱代理',
field: 'forwarderId', field: 'forwarderId',
labelSlot: 'forwarder',
component: 'ApiSelect', component: 'ApiSelect',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
@ -711,6 +767,7 @@ export const basicInfoFormSchema: FormSchema[] = [
label: '船代', label: '船代',
field: 'shipAgencyId', field: 'shipAgencyId',
component: 'ApiSelect', component: 'ApiSelect',
labelSlot: 'shipAgencyId',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
// defaultValue: '', // defaultValue: '',
@ -753,6 +810,7 @@ export const basicInfoFormSchema: FormSchema[] = [
label: '场站', label: '场站',
component: 'ApiSelect', component: 'ApiSelect',
required: false, required: false,
labelSlot: 'yardId',
dynamicDisabled: false, dynamicDisabled: false,
// defaultValue: '', // defaultValue: '',
colProps: { span: 3 }, colProps: { span: 3 },
@ -790,6 +848,7 @@ export const basicInfoFormSchema: FormSchema[] = [
field: 'customserId', field: 'customserId',
label: '报关行', label: '报关行',
component: 'ApiSelect', component: 'ApiSelect',
labelSlot: 'customserId',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
// defaultValue: '', // defaultValue: '',
@ -2619,20 +2678,26 @@ export const personFormSchema: FormSchema[] = [
component: 'ApiSelect', component: 'ApiSelect',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
slot: 'service',
// defaultValue: '', // defaultValue: '',
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: () => { // componentProps: () => {
return { // return {
option: optionsStore.getOptionsByCode('GetServiceSelectList'), // api: GetOrderContact,
allowClear: true, // params: {
showSearch: true, // id: ''
labelField: 'enName', // },
valueField: 'id', // allowClear: true,
filterOption: (input: string, option: any) => { // showSearch: true,
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 // labelField: 'enName',
}, // resultField: 'data',
} // valueField: 'id',
} // immediate: false,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// }
// }
}, },
{ {
label: '邮箱', label: '邮箱',

@ -22,8 +22,26 @@
<BasicForm @register="registerForm"> <BasicForm @register="registerForm">
<!-- label插槽 --> <!-- label插槽 -->
<template #customerId="item"> <template #customerId="item">
<span class="iconfont icon-tuandui" @click="openPersonModal(item)"></span> <span class="iconfont icon-tuandui" @click="openPersonModal(item, '委托单位', 'customerId')"></span>
</template> </template>
<!-- <template #truckerId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #carrierId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #forwarder>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #shipAgencyId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template>
<template #yardId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template> -->
<!-- <template #customserId>
<span class="iconfont icon-tuandui" @click="openPersonModal"></span>
</template> -->
<template #isBusinessLocking="item"> <template #isBusinessLocking="item">
<a-input disabled :value="item.isBusinessLocking ? '已锁定' : '未锁定'"></a-input> <a-input disabled :value="item.isBusinessLocking ? '已锁定' : '未锁定'"></a-input>
<span v-if="item.isBusinessLocking" class="iconfont icon-chenggong"></span> <span v-if="item.isBusinessLocking" class="iconfont icon-chenggong"></span>
@ -35,8 +53,9 @@
</BasicForm> </BasicForm>
<a-modal <a-modal
v-model:visible="visible" v-model:visible="visible"
title="费用模版" title="关系人"
width="80%" width="80%"
v-if="visible"
> >
<BasicTable <BasicTable
@register="registerTable" @register="registerTable"
@ -94,8 +113,8 @@
size: 'small', size: 'small',
}) })
const visible = ref(false) const visible = ref(false)
// id // id
let customerId = '' let companyId = ''
// //
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({ const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
api: async (p) => { api: async (p) => {
@ -116,8 +135,8 @@
} }
let condition: API.ConditionItem[] = [] let condition: API.ConditionItem[] = []
condition.push({ condition.push({
FieldName: 'customerId', FieldName: 'businessId',
FieldValue: customerId, FieldValue: props.details.id,
ConditionalType: 1, ConditionalType: 1,
}) })
postParam.queryCondition = JSON.stringify(condition) postParam.queryCondition = JSON.stringify(condition)
@ -131,10 +150,12 @@
showTableSetting: false, showTableSetting: false,
bordered: true, bordered: true,
showIndexColumn: true, showIndexColumn: true,
rowSelection: {
type: 'checkbox'
},
canResize: false, canResize: false,
immediate: false,
actionColumn: { actionColumn: {
width: 80, width: 50,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
@ -153,22 +174,24 @@
}) })
RefChilrenRef.value.FnaddFormToSet(Arr) RefChilrenRef.value.FnaddFormToSet(Arr)
} }
//
let companyType = ''
// //
const openPersonModal = (item) => { const openPersonModal = (item, type, field) => {
console.log(item.values) if (item?.values[field]) {
if (item?.values?.customerId) { companyId = item.values[field]
customerId = item.values.customerId
} else { } else {
return createMessage.warning('请选择委托单位!') return createMessage.warning(`请选择${type}`)
} }
companyType = type
visible.value = true visible.value = true
reload()
} }
// //
const create = () => { const create = () => {
openModal(true, { openModal(true, {
isParent: false,
isUpdate: false, isUpdate: false,
companyType,
companyId
}) })
} }
function handleSuccess() { function handleSuccess() {
@ -179,6 +202,8 @@
openModal(true, { openModal(true, {
record, record,
isUpdate: true, isUpdate: true,
companyType,
companyId
}) })
} }
// //

@ -660,9 +660,10 @@
) )
function init() { function init() {
//
Getremark() Getremark()
if (route.query.id && !route.query.isCopy) { if (route.query.id && !route.query.isCopy) {
//
getServiceItemList(1, null) getServiceItemList(1, null)
getStatusServiceList(1, null) getStatusServiceList(1, null)
} else { } else {
@ -735,14 +736,13 @@
GetServiceProjectList(data).then((res) => { GetServiceProjectList(data).then((res) => {
if (res.success) { if (res.success) {
bookingServiceItem.value = res.data.ext bookingServiceItem.value = res.data.ext
// this.$bus.$emit('bookingServiceItem', res.data.ext) // this.$bus.$emit('bookingServiceItem', res.data.ext)
emit('bookingServiceItem', res.data.ext) emit('bookingServiceItem', res.data.ext)
} else { } else {
createMessage.error(res.data.msg) createMessage.error(res.data.msg)
} }
seriveLoading.value = false seriveLoading.value = false
}) }).chath
} else { } else {
spinning.value = true spinning.value = true
getStatusServiceList(1, null) getStatusServiceList(1, null)

@ -52,6 +52,33 @@
<Icon icon="ant-design:copy-outlined" @click="FnCopy(record.mblno)" /> <Icon icon="ant-design:copy-outlined" @click="FnCopy(record.mblno)" />
</div> </div>
</template> </template>
<!-- 应收开票 -->
<template v-if="column.dataIndex == 'arInvoiceStatus'">
<a-tooltip>
<template #title>{{ record.arInvoiceStatusName }}</template>
<i v-if="record.arInvoiceStatus == 2" class="iconfont icon-bingtu3"></i>
<i v-else-if="record.arInvoiceStatus == 1" class="iconfont icon-duihao1"></i>
<i v-else class="iconfont icon-chahao"></i>
</a-tooltip>
</template>
<!-- 应付开票 -->
<template v-if="column.dataIndex == 'apInvoiceStatus'">
<a-tooltip>
<template #title>{{ record.apInvoiceStatusName }}</template>
<i v-if="record.apInvoiceStatus == 2" class="iconfont icon-bingtu3"></i>
<i v-else-if="record.apInvoiceStatus == 1" class="iconfont icon-duihao1"></i>
<i v-else class="iconfont icon-chahao"></i>
</a-tooltip>
</template>
<!-- 应收对账 -->
<template v-if="column.dataIndex == 'arCheckStatus'">
<a-tooltip>
<template #title>{{ record.arCheckStatusName }}</template>
<i v-if="record.arCheckStatus == 2" class="iconfont icon-bingtu3"></i>
<i v-else-if="record.arCheckStatus == 1" class="iconfont icon-duihao1"></i>
<i v-else class="iconfont icon-chahao"></i>
</a-tooltip>
</template>
<!-- 业务锁定 --> <!-- 业务锁定 -->
<template v-if="column.dataIndex == 'isBusinessLocking'"> <template v-if="column.dataIndex == 'isBusinessLocking'">
<span v-if="record.isBusinessLocking"> <span v-if="record.isBusinessLocking">

@ -0,0 +1,56 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-25 15:48:33
*/
import { request } from '/@/utils/request'
import { DataResult, PageRequest } from '/@/api/model/baseModel'
enum Api {
list = '/mainApi/ClientParam/GetClientParamList',
edit = '/mainApi/ClientParam//EditClientParam',
info = '/mainApi/ClientParam/GetClientParamInfo',
delete = '/mainApi/ClientParam/BatchDelClientParam',
GetTenantParamDataSelectList = '/mainApi/ClientParam/GetTenantParamDataSelectList'
}
// 列表 (Auth)
export function GetClientParamList(data: PageRequest) {
return request<DataResult>({
url: Api.list,
method: 'post',
data
})
}
// 编辑 (Auth)
export function EditClientParam(data: PageRequest) {
return request<DataResult>({
url: Api.edit,
method: 'post',
data
})
}
// 详情 (Auth)
export function GetClientParamInfo(query) {
return request<DataResult>({
url: Api.info,
method: 'get',
params: query
})
}
// 删除 (Auth)
export function BatchDelClientParam(data: PageRequest) {
return request<DataResult>({
url: Api.delete,
method: 'post',
data
})
}
export function GetTenantParamDataSelectList(query) {
return request<DataResult>({
url: Api.GetTenantParamDataSelectList,
method: 'get',
params: query
})
}

@ -0,0 +1,190 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-25 15:48:33
*/
import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
// 引入字典数据
import { getDictOption } from '/@/utils/dictUtil'
// 下拉数据
import { getOptions } from '/@/hooks/dict'
import { useOptionsStore } from '/@/store/modules/options'
import { GetTenantParamDataSelectList } from './api'
const optionsStore = useOptionsStore()
const itemNameOption = ref([])
// 模块字典
const modulesDict = await getDictOption('modules')
export const columns: BasicColumn[] = [
{
title: '客户名称',
dataIndex: 'customerName',
width: 150
},
{
title: '客户参数类型',
dataIndex: 'paramType',
width: 150
},
{
title: '客户参数名称',
dataIndex: 'paramName',
width: 200
},
{
title: '备注',
dataIndex: 'note',
width: 200
}
]
export const searchFormSchema: FormSchema[] = [
{
field: 'paramName',
label: '客户参数名称',
colProps: { span: 6 },
component: 'Input'
},
]
export const formSchema: FormSchema[] = [
{
label: '',
field: 'id',
component: 'Input',
defaultValue: '',
show: false
},
{
field: 'paramCode',
label: '客户参数类别',
required: true,
component: 'ApiSelect',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
option: optionsStore.getOptionsByCode('GetTenantParamSelectList'),
labelField: 'paramName',
valueField: 'paramCode',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
GetTenantParamDataSelectList({ code: e }).then(res => {
itemNameOption.value = res.data
})
if (obj) {
formModel.paramName = obj.label
formModel.paramId = obj.id
formModel.paramType = obj.type
} else {
formModel.paramName = ''
formModel.paramId = ''
formModel.paramType = ''
}
}
}
}
},
{
field: 'itemCode',
label: '客户参数名称',
required: true,
component: 'ApiSelect',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
option: itemNameOption.value,
labelField: 'itemName',
valueField: 'itemCode',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
formModel.itemName = obj.label
} else {
formModel.itemName = ''
}
}
}
}
},
{
label: '',
field: 'itemName',
component: 'Input',
defaultValue: '',
show: false
},
{
label: '',
field: 'customerName',
component: 'Input',
defaultValue: '',
show: false
},
{
label: '',
field: 'paramId',
component: 'Input',
defaultValue: '',
show: false
},
{
label: '',
field: 'paramName',
component: 'Input',
defaultValue: '',
show: false
},
{
label: '',
field: 'paramType',
component: 'Input',
defaultValue: '',
show: false
},
{
field: 'customerId',
label: '客户名称',
required: true,
component: 'ApiSelect',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
const arr = getOptions('custom')
resolve(arr)
})
},
labelField: 'shortName',
valueField: 'codeName',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
formModel.customerName = obj.label
} else {
formModel.customerName = ''
}
}
}
}
},
{
field: 'orderNo',
label: '排序',
required: true,
component: 'Input',
colProps: { span: 12 }
},
{
field: 'note',
label: '备注',
component: 'InputTextArea',
colProps: { span: 24 }
}
]

@ -0,0 +1,110 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
:form-schema="formSchema"
width="50%"
@register="registerModal"
@ok="handleSave"
>
<!-- 包装表单 -->
<BasicForm @register="registerForm" />
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>
取消
</a-button>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>
仅保存
</a-button>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>
保存并关闭
</a-button>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue'
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
//
import { formSchema } from '../columns'
//
import { EditClientParam, GetClientParamInfo } from '../api'
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
// loading
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
setModalProps({ confirmLoading: true });
updateFormField(updateSchema)
rowId.value = data.record.id
const res: API.DataResult = await GetClientParamInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
async function handleSave(exit) {
try {
const values = await validate()
loading.value = true
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await EditClientParam(values)
loading.value = false
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
} else {
createMessage.error(res.message)
}
exit && closeModal()
} finally {
setModalProps({ confirmLoading: false, loading: false })
}
}
</script>

@ -0,0 +1,115 @@
<template>
<div>
<BasicTable
class="ds-table"
@register="registerTable"
>
<template #toolbar>
<a-button type="link" @click="handleCreate">
<span class="iconfont icon-tianjia"></span>
新建
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
tooltip: '删除',
color: 'error',
popConfirm: {
title: '是否要删除此条数据?',
okText: '是',
cancelText: '否',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
</template>
</BasicTable>
<Modal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { onMounted } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common'
import { GetClientParamList, BatchDelClientParam } from './api'
import { useModal } from '/@/components/Modal'
import Modal from './components/Modal.vue'
import { columns, searchFormSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage()
const [registerModal, { openModal }] = useModal()
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetClientParamList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
return formatParams(p)
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
canResize: false,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
})
function handleCreate() {
openModal(true, {
isParent: false,
isUpdate: false,
})
}
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
})
}
//
async function handleDelete(record: Recordable) {
const res: API.DataResult = await BatchDelClientParam({
id: '',
ids: [record.id],
})
if (res.succeeded) {
notification.success({ message: res.message, duration: 3 })
reload()
} else {
notification.error({ message: res.message, duration: 3 })
}
}
onMounted(() => {
//
})
function handleSuccess() {
reload()
}
</script>
Loading…
Cancel
Save