diff --git a/src/components/CostEntry/actionBar.vue b/src/components/CostEntry/actionBar.vue index 24850943..c79be7e1 100644 --- a/src/components/CostEntry/actionBar.vue +++ b/src/components/CostEntry/actionBar.vue @@ -125,6 +125,7 @@ 刷新 diff --git a/src/components/CostEntry/feeTable.vue b/src/components/CostEntry/feeTable.vue index 3788ac5b..a0016cf3 100644 --- a/src/components/CostEntry/feeTable.vue +++ b/src/components/CostEntry/feeTable.vue @@ -67,6 +67,7 @@ import { getDictOption } from '/@/utils/dictUtil' // 汇率列表接口 import { GetFeeCurrencyExchangeList } from '/@/views/fee/exchangeRate/api' + import { updateColumns } from '/@/hooks/web/common' const { createMessage } = useMessage() defineComponent({ HotTable, @@ -119,7 +120,7 @@ return item.ctn }) b = a.map(item => { - return { label: item.ctn, value: item.ctnCode, name: item.ctn } + return { label: item.ctn, value: item.ctnCode, name: item.ctn, isCtn: true } }) } unitDict.value = [...b, ...res] @@ -160,7 +161,7 @@ // 部分勾选 const someCheck = ref(false) // 定义表格所有列 - const columns = [ + const columns = ref([ { data: 'selected', type: 'checkbox', @@ -476,7 +477,7 @@ data: 'auditDate', readOnly: true, }, - ] + ]) // 表格配置项 const settings = { height: props.height, @@ -510,7 +511,7 @@ // } } }, - columns: columns, + columns: columns.value, // 此行直接复制,必须(非商用) licenseKey: 'non-commercial-and-evaluation', // 定义所有单元格发生变化的回调处理 @@ -596,10 +597,12 @@ return list.value[changes[0][0]]['unitText'].includes(item.name) }) if (uItem) dict = uItem[0] - if (dict && dict?.value) { - GetUnitSelectInfo({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => { + if (dict && dict?.value && dict.isCtn) { + GetUnitSelectInfo({ code: dict?.name, businessId: props.id, businessType: props.type }).then(res => { list.value[changes[0][0]]['quantity'] = res.data.quantity }) + } else { + list.value[changes[0][0]]['quantity'] = 0 } } // 根据客户类别带出相应的费用对象 @@ -658,9 +661,13 @@ if (item) dict = item[0] list.value[changes[0][0]]['unit'] = dict?.value list.value[changes[0][0]]['unitText'] = changes[0][3].split('-')[0] - GetUnitSelectInfo({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => { - list.value[changes[0][0]]['quantity'] = res.data.quantity - }) + if (dict && dict?.value && dict.isCtn) { + GetUnitSelectInfo({ code: dict?.name, businessId: props.id, businessType: props.type }).then(res => { + list.value[changes[0][0]]['quantity'] = res.data.quantity + }) + } else { + list.value[changes[0][0]]['quantity'] = 0 + } // 业务数据有件数,修改单位,带出件数 // const text = list.value[changes[0][0]]['unitText'] // if (text == '单票') { @@ -1069,6 +1076,16 @@ } } }) + columns.value = [] + hot.updateSettings({ + columns: [] + }) + const ucols = updateColumns(props.tbType == 'receive' ? 'ds_receive_fee' : 'ds_pay_fee', columns.value) + console.log(ucols) + if (ucols && ucols.length) { + columns.value = ucols + console.log(ucols) + } // 数据初始化 if (props.isShowBtn) init() }) diff --git a/src/components/HColSet/api.ts b/src/components/HColSet/api.ts new file mode 100644 index 00000000..5ee379d8 --- /dev/null +++ b/src/components/HColSet/api.ts @@ -0,0 +1,20 @@ +// @ts-ignore +import { request } from '/@/utils/request' +enum Api { + edit = '/mainApi/CustomColumnSet/EditCustomColumnSet', + info = '/mainApi/CustomColumnSet/GetCustomColumnSetInfoByCode' +} +export function EditCustomColumnSet(data) { + return request({ + url: Api.edit, + method: 'post', + data + }) +} +export function GetCustomColumnSetInfo(params) { + return request({ + url: Api.info, + method: 'get', + params + }) +} diff --git a/src/components/HColSet/index.vue b/src/components/HColSet/index.vue index f210e909..1d0e3330 100644 --- a/src/components/HColSet/index.vue +++ b/src/components/HColSet/index.vue @@ -39,21 +39,37 @@ // 引入表格列容器组件 import TableColDrag from './components/tableColDrag.vue' import TableColSet from './components/tableColSet.vue' + import { EditCustomColumnSet } from './api' const { t } = useI18n() const props = defineProps({ + // 表格列数据 columns: { type: Array, default: () => { return [] } + }, + // 表格唯一编码 + code: { + type: String, + default: null } }) const visible = ref(false) const init = () => { visible.value = true } + const colData = ref([]) + // onMounted(() => { + // colData.value = props.columns + // }) const handleOk = () => { - + const content = JSON.stringify(props.columns) + EditCustomColumnSet({ + customTableCode: props.code, + templateName: props.code, + content + }) } diff --git a/src/hooks/web/common.ts b/src/hooks/web/common.ts index 56c37bbf..91f27734 100644 --- a/src/hooks/web/common.ts +++ b/src/hooks/web/common.ts @@ -245,3 +245,93 @@ export function formatParams(params = {}, equal: any = [], otherQuery: any = []) postData.queryCondition = JSON.stringify(conditions) return postData } +// 获取列表设置详情接口 +import { GetCustomColumnSetInfo } from '/@/components/HColSet/api' +import type { FormSchema } from '/@/types/form' +import { deepMerge } from '/@/utils' +// 重组列配置 +export function updateColumns(code, data) { + // 获取数据列 + GetCustomColumnSetInfo({ + code + }).then(res => { + const oldSchema = data + let updateData = [] + if (res.data) { + updateData = JSON.parse(res.data.content) + } + // 重组的表单 + const schema: FormSchema[] = [] + if (updateData.length == oldSchema.length) { + // 如果原始表单和赋值表单长度相同,则用赋值表单排序 + updateData.forEach((item) => { + let _val + oldSchema.forEach((val) => { + if (item.data === val.data) { + _val = val + } + }) + if (_val !== undefined && item.data === _val.data) { + const newSchema = deepMerge(_val, item) + schema.push(newSchema as FormSchema) + } else { + schema.push(_val) + } + }) + } else { + // 如果原始表单和赋值表单长度不同,则不考虑排序,用原始表单进行赋值 + oldSchema.forEach((val) => { + let _val + updateData.forEach((item) => { + if (val.data === item.data) { + _val = item + } + }) + if (_val !== undefined && val.field === _val.field) { + const newSchema = deepMerge(val, _val) + schema.push(newSchema as FormSchema) + } else { + schema.push(val) + } + }) + } + return schema + }) + // // 重组的表单 + // const schema: FormSchema[] = [] + // // 原始的表单 + // const oldSchema = unref(getSchema) + // if (updateData.length == oldSchema.length) { + // // 如果原始表单和赋值表单长度相同,则用赋值表单排序 + // updateData.forEach((item) => { + // let _val + // oldSchema.forEach((val) => { + // if (item.field === val.field) { + // _val = val + // } + // }) + // if (_val !== undefined && item.field === _val.field) { + // const newSchema = deepMerge(_val, item) + // schema.push(newSchema as FormSchema) + // } else { + // schema.push(_val) + // } + // }) + // } else { + // // 如果原始表单和赋值表单长度不同,则不考虑排序,用原始表单进行赋值 + // oldSchema.forEach((val) => { + // let _val + // updateData.forEach((item) => { + // if (val.field === item.field) { + // _val = item + // } + // }) + // if (_val !== undefined && val.field === _val.field) { + // const newSchema = deepMerge(val, _val) + // schema.push(newSchema as FormSchema) + // } else { + // schema.push(val) + // } + // }) + // } +} \ No newline at end of file diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue index 989904a6..b0bd494c 100644 --- a/src/views/operation/seaexport/detail/index.vue +++ b/src/views/operation/seaexport/detail/index.vue @@ -520,16 +520,20 @@ if (goodsForm.ctnPriceInfo && goodsForm.ctnPriceInfo.length && ctnPriceData.value.length && ctnPriceData.value[0].show !== false) { for (let i = 0; i < goodsForm.ctnPriceInfo.length; i++) { if (!goodsForm.ctnPriceInfo[i].ctn) { - return createMessage.warning('请填写箱型价格!') + createMessage.warning('请填写箱型价格!') + return false } if (!goodsForm.ctnPriceInfo[i].ctnNum) { - return createMessage.warning('请填写箱量!') + createMessage.warning('请填写箱量!') + return false } if (!goodsForm.ctnPriceInfo[i].quotePrice && goodsForm.ctnPriceInfo[i].quotePrice !== 0) { - return createMessage.warning('请填写报价!') + createMessage.warning('请填写卖单价!') + return false } if (route.query.status == 'WAIT_ORDER_AUDIT' && !goodsForm.ctnPriceInfo[i].floorPrice && goodsForm.ctnPriceInfo[i].floorPrice !== 0) { - return createMessage.warning('请填写底价!') + createMessage.warning('请填写底价!') + return false } } } @@ -1099,27 +1103,29 @@ // } // 订舱审核 const approveDc = async (remark) => { - await save('dc') - if (!remark) { - IsLastMarker({ - bsType: 1, - bsId: id.value, - taskType: route.query.status - }).then(res => { - if (res.data) { - // 是最后一个审批人,若果此票是现舱,弹窗选择现舱弹窗 - if (bookingDetails.value.shippingSpaceType == 'xc') { - // 选择现舱 - sspace.value.init() + const flag = await save('dc') + if (flag || flag === undefined) { + if (!remark) { + IsLastMarker({ + bsType: 1, + bsId: id.value, + taskType: route.query.status + }).then(res => { + if (res.data) { + // 是最后一个审批人,若果此票是现舱,弹窗选择现舱弹窗 + if (bookingDetails.value.shippingSpaceType == 'xc') { + // 选择现舱 + sspace.value.init() + } else { + // 非现舱直接审核通过 + seaExportTaskAudit(remark, true) + } } else { - // 非现舱直接审核通过 - seaExportTaskAudit(remark, true) + // 不是最后一个审批人,直接审核 + seaExportTaskAudit(remark, false) } - } else { - // 不是最后一个审批人,直接审核 - seaExportTaskAudit(remark, false) - } - }) + }) + } } } // 审单接口 diff --git a/src/views/operation/seaexport/detail/modules/operationArea.vue b/src/views/operation/seaexport/detail/modules/operationArea.vue index 3749a197..fa6cfa93 100644 --- a/src/views/operation/seaexport/detail/modules/operationArea.vue +++ b/src/views/operation/seaexport/detail/modules/operationArea.vue @@ -1049,6 +1049,7 @@ if (res.succeeded) { createMessage.success(res.message) fileFlag.value = false + emit('refresh') } }) .catch((err) => {