委托单位

szh-new
lijingjia 4 months ago
parent dd56064186
commit f14d250ca7

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

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

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

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

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

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

@ -3,13 +3,24 @@
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
:form-schema="formSchema"
:form-schema="personFormSchema"
width="50%"
@register="registerModal"
@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>
<a-button
@ -47,10 +58,11 @@
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil'
//
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'
// Emits
@ -59,6 +71,8 @@
// loading
const loading = ref(false)
const rowId = ref('')
//
const personList = ref([])
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({
@ -68,6 +82,10 @@
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
//
GetOrderContactListByClientId({ id: data.companyId }).then(res => {
personList.value = res.data
})
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
@ -82,7 +100,17 @@
})
}
} 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 })
})

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

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

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

@ -52,6 +52,33 @@
<Icon icon="ant-design:copy-outlined" @click="FnCopy(record.mblno)" />
</div>
</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'">
<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