Commit bfee1467 by linjinhong Committed by qinjianhui

申报规则页面完成

parent 7f916e31
...@@ -49,7 +49,6 @@ export function deleteLogisticsWay(ids: string) { ...@@ -49,7 +49,6 @@ export function deleteLogisticsWay(ids: string) {
params: { ids: ids }, params: { ids: ids },
}) })
} }
//获取申报规则列表 //获取申报规则列表
export function getRuleList() { export function getRuleList() {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
...@@ -163,3 +162,34 @@ export function getLogisticsQuotationByID(params: any) { ...@@ -163,3 +162,34 @@ export function getLogisticsQuotationByID(params: any) {
{ params }, { params },
) )
} }
/**
* @description 申报规则
*/
//列表
export function getLogisticsCustomsRuleList(params: any) {
return axios.post<never, BaseRespData<never>>(
'/logisticsCustomsRule/list_page',
params,
)
}
//新增
export function addLogisticsCustomsRule(params: any) {
return axios.post<never, BaseRespData<never>>(
'/logisticsCustomsRule/add',
params,
)
}
//修改
export function updateLogisticsCustomsRule(params: any) {
return axios.post<never, BaseRespData<never>>(
'/logisticsCustomsRule/update',
params,
)
}
//删除
export function deleteLogisticsCustomsRule(params: any) {
return axios.get<never, BaseRespData<never>>('/logisticsCustomsRule/delete', {
params,
})
}
...@@ -13,12 +13,14 @@ import type { FormItemRule } from 'element-plus' ...@@ -13,12 +13,14 @@ import type { FormItemRule } from 'element-plus'
// 定义表单项配置接口 // 定义表单项配置接口
export interface IFormConfig { export interface IFormConfig {
fixed?: string
title?: string title?: string
prop?: string prop?: string
label?: string label?: string
type?: string type?: string
btn?: JSX.Element | (() => JSX.Element) btn?: JSX.Element | (() => JSX.Element)
attrs?: Record<string, unknown> attrs?: Record<string, unknown>
isIncludeProp?: boolean
rules?: FormItemRule | FormItemRule[] rules?: FormItemRule | FormItemRule[]
render?: ( render?: (
item?: IFormConfig, item?: IFormConfig,
...@@ -77,7 +79,15 @@ export default defineComponent({ ...@@ -77,7 +79,15 @@ export default defineComponent({
setup(props, { emit, attrs }) { setup(props, { emit, attrs }) {
const formRef = ref<FormInstance>() const formRef = ref<FormInstance>()
const formData = ref<Record<string, unknown>>(props.modelValue) const formData = ref<Record<string, unknown>>(props.modelValue)
const tableConfig = ref<any[]>([])
watch(
() => props.config,
(val) => {
tableConfig.value = val
},
{ immediate: true, deep: true },
)
// 监听表单数据变化 // 监听表单数据变化
watch( watch(
() => formData.value, () => formData.value,
...@@ -91,7 +101,7 @@ export default defineComponent({ ...@@ -91,7 +101,7 @@ export default defineComponent({
watch( watch(
() => props.modelValue, () => props.modelValue,
(val) => { (val) => {
// console.log(84, val) console.log(84, val)
formData.value = val formData.value = val
}, },
...@@ -120,6 +130,22 @@ export default defineComponent({ ...@@ -120,6 +130,22 @@ export default defineComponent({
await formRef.value?.resetFields() await formRef.value?.resetFields()
} }
function refashConfig(showFields: string[]) {
if (showFields.length) {
const filterArr = props.config.filter((item) =>
showFields.includes(item.prop as string),
)
tableConfig.value = [
...props.config.filter((item) => !item.isIncludeProp),
...filterArr,
]
.filter((item) => !item.fixed)
.concat(tableConfig.value.filter((item) => item.fixed))
}
console.log('tableConfig', tableConfig.value)
}
return { return {
formRef, formRef,
formData, formData,
...@@ -127,6 +153,8 @@ export default defineComponent({ ...@@ -127,6 +153,8 @@ export default defineComponent({
resetFields, resetFields,
getFormAttrs, getFormAttrs,
getComponentAttrs, getComponentAttrs,
refashConfig,
tableConfig,
} }
}, },
render() { render() {
...@@ -142,7 +170,7 @@ export default defineComponent({ ...@@ -142,7 +170,7 @@ export default defineComponent({
style={{ display: 'flex', flexWrap: 'wrap' }} style={{ display: 'flex', flexWrap: 'wrap' }}
class="customForm" class="customForm"
> >
{this.config.map((item, index) => {this.tableConfig.map((item, index) =>
item.title ? ( item.title ? (
<div <div
style={{ style={{
......
...@@ -36,6 +36,7 @@ const props = withDefaults( ...@@ -36,6 +36,7 @@ const props = withDefaults(
initChange?: boolean // 首次是否触发change事件 initChange?: boolean // 首次是否触发change事件
modelValue?: string | number modelValue?: string | number
isRefresh?: boolean isRefresh?: boolean
isValueKey?: boolean
load?: (arg: (val: boolean) => void) => void // focus后再加载数据的 load?: (arg: (val: boolean) => void) => void // focus后再加载数据的
}>(), }>(),
{ {
...@@ -48,6 +49,7 @@ const props = withDefaults( ...@@ -48,6 +49,7 @@ const props = withDefaults(
modelValue: '', modelValue: '',
isRefresh: false, isRefresh: false,
load: null, load: null,
isValueKey: false,
}, },
) )
...@@ -91,6 +93,7 @@ const getOptions = computed(() => { ...@@ -91,6 +93,7 @@ const getOptions = computed(() => {
const changeFn = (id) => { const changeFn = (id) => {
const value = props.labelIsValue ? fields.label : fields.value const value = props.labelIsValue ? fields.label : fields.value
const findItem = props.options.find((item) => item[value] === id) const findItem = props.options.find((item) => item[value] === id)
if (findItem) { if (findItem) {
emits('change', findItem, id) emits('change', findItem, id)
} }
......
...@@ -176,6 +176,49 @@ const router = createRouter({ ...@@ -176,6 +176,49 @@ const router = createRouter({
component: () => import('@/views/logistics/logisticsQuotation.vue'), component: () => import('@/views/logistics/logisticsQuotation.vue'),
}, },
{
path: '/logistics/declarationRule',
meta: {
title: '申报规则',
},
component: () => import('@/views/logistics/declarationRule.vue'),
},
{
path: '/warehouse/manage',
meta: {
title: '仓库管理',
},
component: WarehouseManage,
},
{
path: '/warehouse/receipt-doc',
meta: {
title: '入库单',
},
component: receiptDoc,
},
{
path: '/warehouse/issue-doc',
meta: {
title: '出库单',
},
component: issueDoc,
},
{
path: '/warehouse/warning',
meta: {
title: '仓库预警',
},
component: WarehouseWarning,
},
{
path: '/warehouse/position',
meta: {
title: '库位管理',
},
component: WarehousePosition,
},
], ],
}, },
// 登录 // 登录
......
...@@ -144,7 +144,11 @@ const menu: MenuItem[] = [ ...@@ -144,7 +144,11 @@ const menu: MenuItem[] = [
id: 1, id: 1,
label: '物流报价', label: '物流报价',
}, },
{
index: '/logistics/declarationRule',
id: 1,
label: '申报规则',
},
], ],
}, },
// { // {
......
export interface DeclarationRuleList {
countries: string
createTime: string
currency: string
defaulted: string
fixedValue: string
fixedWeight: string
id: number
name: string
orderPercent: number
remark: string
shops: string
type: number
valueUp: number
wayIds: string
wayNames: string
weightPercent: number
weightUp: number
}
export interface AddDeclarationRuleObj {
currency?: string
fixedValue?: string
fixedWeight?: string
id?: number
limitAmountType?: string
limitWeightType?: string
name?: string
orderPercent?: number | string | null
remark?: string
shops?: string
type?: number
valueUp?: number | string | null
weightPercent?: number | string | null
weightUp?: number | string | null
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment