lijingjia 3 months ago
commit 3390c99751

@ -1,4 +1,4 @@
import { router } from "/@/router" import { router } from '/@/router'
import { useMultipleTabStore } from '/@/store/modules/multipleTab' import { useMultipleTabStore } from '/@/store/modules/multipleTab'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
// 获取表单更改过的字段接口 // 获取表单更改过的字段接口
@ -20,7 +20,7 @@ export function formatTableData(v) {
/* () /* ()
* topath: path * topath: path
*/ */
export function closePage(topath) { export function closePage(topath) {
const tabStore = useMultipleTabStore() const tabStore = useMultipleTabStore()
tabStore.closeTab(router.currentRoute._value, router) tabStore.closeTab(router.currentRoute._value, router)
@ -42,19 +42,19 @@ export function closePage(topath) {
/* excel() /* excel()
* api: params: columes: name: excel * api: params: columes: name: excel
*/ */
export function exportExcel(api, params = {}, columns = [], name = '未命名') { export function exportExcel(api, params = {}, columns = [], name = '未命名') {
if (!api) return createMessage.warning('缺少api') if (!api) return createMessage.warning('缺少api')
params['pageCondition']['isExport'] = true params['pageCondition']['isExport'] = true
// 过滤出需要显示的列 // 过滤出需要显示的列
const cols = columns.filter(item => { const cols = columns.filter((item) => {
return !item.defaultHidden || item.visible return !item.defaultHidden || item.visible
}) })
api(params).then(res => { api(params).then((res) => {
const { data } = res const { data } = res
const fileData = data.map(row => { const fileData = data.map((row) => {
const obj = {} const obj = {}
cols.forEach(item => { cols.forEach((item) => {
for (var key in row) { for (var key in row) {
if (item.dataIndex === key) { if (item.dataIndex === key) {
obj[item.title] = row[key] obj[item.title] = row[key]
@ -77,15 +77,15 @@ function s2ab(s) {
/* excel() /* excel()
* data: columes: name: excel * data: columes: name: excel
*/ */
export function exportExcelByData(data = [], columns = [], name = '未命名') { export function exportExcelByData(data = [], columns = [], name = '未命名') {
// 过滤出需要显示的列 // 过滤出需要显示的列
const cols = columns.filter(item => { const cols = columns.filter((item) => {
return !item.defaultHidden || item.visible return !item.defaultHidden || item.visible
}) })
const fileData = data.map(row => { const fileData = data.map((row) => {
const obj = {} const obj = {}
cols.forEach(item => { cols.forEach((item) => {
for (var key in row) { for (var key in row) {
if (item.dataIndex === key) { if (item.dataIndex === key) {
obj[item.title] = row[key] obj[item.title] = row[key]
@ -124,7 +124,7 @@ function toBlob(fileData, name) {
// 更新表单数据 // 更新表单数据
export function updateFormItem(updateSchema, formNo) { export function updateFormItem(updateSchema, formNo) {
getFormSetInfoByModule({ permissionId: permissionsInfo().permissionId, formNo }).then(res => { getFormSetInfoByModule({ permissionId: permissionsInfo().permissionId, formNo }).then((res) => {
if (res?.data?.content) { if (res?.data?.content) {
const content = JSON.parse(res.data.content) const content = JSON.parse(res.data.content)
console.log(content) console.log(content)
@ -134,14 +134,14 @@ export function updateFormItem(updateSchema, formNo) {
} }
// 返回表格查询的参数 multipleList(需要多选查询的字段名数组) // 返回表格查询的参数 multipleList(需要多选查询的字段名数组)
export function formatParams(params = {}) { export function formatParams(params = {}, equal:any = []) {
const postData = { const postData = {
queryCondition: '', queryCondition: '',
pageCondition: { pageCondition: {
pageIndex: params?.page, pageIndex: params?.page,
pageSize: params?.pageSize, pageSize: params?.pageSize,
sortConditions: [] sortConditions: [],
} },
} }
const conditions = [] as any const conditions = [] as any
for (let key in params) { for (let key in params) {
@ -157,25 +157,25 @@ export function formatParams(params = {}) {
// 判定为日期 // 判定为日期
if (isDate != 'Invalid Date' && isDate.getFullYear() > 1000) { if (isDate != 'Invalid Date' && isDate.getFullYear() > 1000) {
//替换时分秒 查询用 //替换时分秒 查询用
params[key][0] = params[key][0].substring(0, 11) + "00:00:00"; params[key][0] = params[key][0].substring(0, 11) + '00:00:00'
params[key][1] = params[key][1].substring(0, 11) + "23:59:59"; params[key][1] = params[key][1].substring(0, 11) + '23:59:59'
conditions.push({ conditions.push({
FieldName: key, FieldName: key,
FieldValue: params[key][0], FieldValue: params[key][0],
ConditionalType: 3 ConditionalType: 3,
}) })
conditions.push({ conditions.push({
FieldName: key, FieldName: key,
FieldValue: params[key][1], FieldValue: params[key][1],
ConditionalType: 5 ConditionalType: 5,
}) })
} else { } else {
// 判定为筛选 // 判定为筛选
params[key].forEach(item => { params[key].forEach((item) => {
conditions.push({ conditions.push({
FieldName: key, FieldName: key,
FieldValue: item, FieldValue: item,
ConditionalType: 1 ConditionalType: 1,
}) })
}) })
} }
@ -184,26 +184,31 @@ export function formatParams(params = {}) {
const orKeys = key.split(':') const orKeys = key.split(':')
const ConditionalList = { ConditionalList: [] } const ConditionalList = { ConditionalList: [] }
if (params[key]) { if (params[key]) {
orKeys.forEach(item => { orKeys.forEach((item) => {
let obj = { let obj = {
Key: 1, Key: 1,
Value: { Value: {
FieldName: item, FieldName: item,
FieldValue: params[key], FieldValue: params[key],
ConditionalType: 1 ConditionalType: 1,
} },
} }
ConditionalList.ConditionalList.push(obj) ConditionalList.ConditionalList.push(obj)
}) })
conditions.push(ConditionalList) conditions.push(ConditionalList)
} }
} else { } else {
// 其他普通查询 let isEqual = false
if (equal.length) {
isEqual = equal.includes(key)
}
// 其他普通查询(模糊/等于) 1-模糊 0-等于
if (params[key] || params[key] === 0) { if (params[key] || params[key] === 0) {
conditions.push({ conditions.push({
FieldName: key, FieldName: key,
FieldValue: params[key], FieldValue: params[key],
ConditionalType: 1 ConditionalType: !isEqual ? 1 : 0,
}) })
} }
} }
@ -212,10 +217,12 @@ export function formatParams(params = {}) {
} }
// 排序 // 排序
if (params?.field) { if (params?.field) {
postData.pageCondition.sortConditions = [{ postData.pageCondition.sortConditions = [
sortField: params.field, {
listSortDirection: params.order == "ascend" ? 0 : 1 sortField: params.field,
}] listSortDirection: params.order == 'ascend' ? 0 : 1,
},
]
} else { } else {
postData.pageCondition.sortConditions = [] postData.pageCondition.sortConditions = []
} }

@ -62,17 +62,13 @@
setModalProps({ confirmLoading: false, loading: true }) setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) { if (unref(isUpdate)) {
// setModalProps({ confirmLoading: true });
rowId.value = data.record.id rowId.value = data.record.id
const res: API.DataResult = await ApiInfo({ id: unref(rowId) }) const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) { if (res.succeeded) {
setFieldsValue({ setFieldsValue({
...res.data, ...res.data,
}) })
// console.log('Form', getFieldsValue());
// setFieldsValue({ trainId: unref(res.data.trainId) });
} }
// setModalProps({ confirmLoading: false });
} else { } else {
setFieldsValue({ permissionIdentity: unref(2) }) setFieldsValue({ permissionIdentity: unref(2) })
} }
@ -83,11 +79,8 @@
try { try {
const values = await validate() const values = await validate()
setModalProps({ confirmLoading: true, loading: true }) setModalProps({ confirmLoading: true, loading: true })
// TODO custom api
console.log(values)
// loading.value = true;
const res: API.DataResult = await ApiEdit(values) const res: API.DataResult = await ApiEdit(values)
console.log(res)
if (res.succeeded) { if (res.succeeded) {
createMessage.success(res.message) createMessage.success(res.message)
emit('success') emit('success')
@ -107,7 +100,6 @@
exit && closeModal() exit && closeModal()
} finally { } finally {
// loading.value = false;
setModalProps({ confirmLoading: false, loading: false }) setModalProps({ confirmLoading: false, loading: false })
} }
} }

@ -33,7 +33,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['ctnCode'])
}, },
columns, columns,
formConfig: { formConfig: {
@ -53,12 +53,6 @@
canResize: true, canResize: true,
resizeHeightOffset: 35, resizeHeightOffset: 35,
immediate: true, immediate: true,
// actionColumn: {
// width: 80,
// title: '',
// dataIndex: 'action',
// fixed: 'right',
// },
}) })
function handleCreate() { function handleCreate() {
openModal(true, { openModal(true, {

@ -266,17 +266,9 @@
queryCondition: `[{ FieldName: 'Pid', FieldValue: '${rowId.value}', ConditionalType: 1 }]`, queryCondition: `[{ FieldName: 'Pid', FieldValue: '${rowId.value}', ConditionalType: 1 }]`,
pageCondition: { pageIndex: 1, pageSize: 999, sortConditions: [] }, pageCondition: { pageIndex: 1, pageSize: 999, sortConditions: [] },
}).then((res) => { }).then((res) => {
// console.log(res)
// list.value.splice(0)
// res.data.forEach((item) => {
// list.value.push(item)
// })
// ------------------
list.value.splice(0) list.value.splice(0)
let Arr = ['pickupDate', 'dropoffDate', 'feeStartDate', 'bsdate'] let Arr = ['pickupDate', 'dropoffDate', 'feeStartDate', 'bsdate']
res.data.forEach((item) => { res.data.forEach((item) => {
console.log(item)
Arr.forEach((e) => { Arr.forEach((e) => {
if (item[e]) { if (item[e]) {
item[e] = item[e].split(' ')[0] item[e] = item[e].split(' ')[0]
@ -369,9 +361,7 @@
}) })
}) })
if (values.bsdate) { if (values.bsdate) {
console.log(values.bsdate)
values.bsdate = moment(values.bsdate).format('YYYY-MM-DD 00:00:00') values.bsdate = moment(values.bsdate).format('YYYY-MM-DD 00:00:00')
console.log(values.bsdate)
} }
if (values.accdate) { if (values.accdate) {
values.accdate = moment(values.bsdate).format('YYYY-MM') values.accdate = moment(values.bsdate).format('YYYY-MM')
@ -578,8 +568,6 @@
: await getDictOption('CM_CtnFlowState') : await getDictOption('CM_CtnFlowState')
if (!CtnFlowStateDict.value.length) CtnFlowStateDict.value = res if (!CtnFlowStateDict.value.length) CtnFlowStateDict.value = res
const dict = res.map((res) => { const dict = res.map((res) => {
console.log(res)
return res.label return res.label
}) })
process(dict) process(dict)
@ -641,17 +629,6 @@
] ]
const settings = { const settings = {
height: 260, height: 260,
// height: () => {
// // 28
// let RData = 260
// if (list.value.length) {
// RData = 28 + list.value.length * 26
// }
// console.log(RData)
// // list.value
// return RData
// },
autoWrapRow: true, autoWrapRow: true,
autoWrapCol: true, autoWrapCol: true,
// //
@ -754,140 +731,6 @@
}) })
} }
} }
//--------------------------------------- tab1 View ---------------------------------------
// const [
// registerSearchBoxForm,
// { resetFields: resetSearchBoxFields, validate: validateSearchBox },
// ] = useForm({
// labelWidth: 100,
// schemas: formSearchBoxSchema,
// showActionButtonGroup: false,
// submitFunc: submit,
// })
// const Viewlist = ref<any>([])
// //
// const ViewlallCheck = ref(false)
//
// const ViewlsomeCheck = ref(false)
// watchEffect(() => {
// //
// if (ViewlallCheck.value) {
// Viewlist.value.forEach((item: any) => {
// item.selected = true
// })
// } else {
// //
// Viewlist.value.forEach((item: any) => {
// item.selected = false
// })
// }
// })
// watch(
// Viewlist.value,
// (val) => {
// let a = 0
// let b = 0
// val.forEach((item: any) => {
// if (item.selected) {
// a += 1
// } else {
// b += 1
// }
// })
// if (a == 0) {
// ViewlallCheck.value = false
// }
// if (b == 0) {
// ViewlallCheck.value = true
// }
// if (a != 0 && b != 0) {
// ViewlsomeCheck.value = true
// } else {
// ViewlsomeCheck.value = false
// }
// },
// {
// deep: true,
// },
// )
// const Viewsettings = {
// height: '163',
// readOnly: true,
// // autoWrapRow: true,
// // autoWrapCol: true,
// //
// rowHeights: 26,
// fixedColumnsLeft: 1,
// //
// hiddenColumns: {
// columns: [1, 2, 3, 4, 5, 6, 7, 8],
// indicators: true,
// },
// // //
// // enterMoves: 'row',
// // columnSorting: false,
// // //
// // afterValidate: function (isValid, value, row, prop, source) {
// // if (!isValid) {
// // hotTb.value.hotInstance.setDataAtRowProp(row, prop, '')
// // }
// // },
// columns: columns,
// // ()
// licenseKey: 'non-commercial-and-evaluation',
// // //
// // async afterChange(changes, source) {},
// }
// function handleReset() {
// resetSearchBoxFields()
// handleSearch()
// }
// async function handleSearch() {
// const values = await validateSearchBox()
// console.log(values)
// let ApiData: any = []
// Object.keys(values).forEach((item) => {
// if (values[item]) {
// console.log(values[item].split(','))
// if (item == 'cntrno') {
// ApiData.push({ FieldName: item, FieldValue: values[item], ConditionalType: 15 })
// } else {
// ApiData.push({ FieldName: item, FieldValue: values[item], ConditionalType: 1 })
// }
// }
// })
// GetViewListDetail(JSON.stringify(ApiData))
// }
// function ViewTableAdd() {
// let ApiData: any = { id: rowId.value, ids: [] }
// Viewlist.value.forEach((e: any, i) => {
// if (e.selected) {
// ApiData.ids.push(e.id)
// }
// })
// console.log(ApiData.ids)
// if (ApiData.ids.length) {
// ApiAddCtn(ApiData).then(async (res) => {
// if (res.succeeded) {
// const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
// if (res.succeeded) {
// allCheck.value = false
// someCheck.value = false
// ViewlallCheck.value = false
// ViewlsomeCheck.value = false
// submit()
// GetListDetail()
// handleReset()
// GetViewListDetail('[]')
// }
// // getData(false)
// notification.success({ message: res.message, duration: 3 })
// }
// })
// }
// }
//--------------------------------------- tab3 ---------------------------------------
// //
const broReceiveData = ref([]) const broReceiveData = ref([])
// //
@ -906,13 +749,4 @@
position: absolute; position: absolute;
left: 15px; left: 15px;
} }
// .SearchBox {
// display: flex;
// .Form {
// flex: 1;
// }
// .mt-4 {
// margin-left: 10px;
// }
// }
</style> </style>

@ -65,7 +65,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['oldContainerOwner', 'bsdate', 'accdate'])
}, },
columns, columns,
formConfig: { formConfig: {
@ -150,7 +150,6 @@
} }
ApiDel(ApiData).then((res) => { ApiDel(ApiData).then((res) => {
console.log(res)
notification.success({ message: res.message, duration: 3 }) notification.success({ message: res.message, duration: 3 })
reload() reload()
}) })

@ -143,6 +143,9 @@ export const formSchema: FormSchema[] = [
label: '箱型箱量', label: '箱型箱量',
component: 'Input', component: 'Input',
colProps: { span: 6 }, colProps: { span: 6 },
dynamicDisabled: ({}) => {
return true
},
}, },
{ {
field: 'billState', field: 'billState',

@ -65,7 +65,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['bsdate', 'accdate'])
}, },
columns, columns,
formConfig: { formConfig: {

@ -222,7 +222,6 @@ export const searchFormSchema: FormSchema[] = [
label: '箱来源', label: '箱来源',
component: 'ApiSelect', component: 'ApiSelect',
colProps: { span: 4 }, colProps: { span: 4 },
defaultValue: '',
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
api: () => { api: () => {

@ -50,39 +50,8 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['ctnOwner', 'ctnSourceId', 'isOnlineId', 'portid'])
}, },
// beforeFetch: (p) => {
// var data = getForm().getFieldsValue()
// const postParam: API.PageRequest = {
// queryCondition: '',
// pageCondition: {
// pageIndex: p.page,
// pageSize: p.pageSize,
// sortConditions: [],
// },
// }
// if (p.field) {
// postParam.pageCondition.sortConditions = [
// {
// sortField: p.field,
// listSortDirection: p.order == 'ascend' ? 0 : 1,
// },
// ]
// } else {
// postParam.pageCondition.sortConditions = []
// }
// let condition: API.ConditionItem[] = []
// if (!!data.CtnName) {
// condition.push({
// FieldName: 'CtnName',
// FieldValue: data.CtnName,
// ConditionalType: 1,
// })
// }
// postParam.queryCondition = JSON.stringify(condition)
// return postParam
// },
columns, columns,
formConfig: { formConfig: {
labelWidth: 120, labelWidth: 120,

@ -57,7 +57,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['oldContainerOwner', 'rentDirectId'])
}, },
columns, columns,
formConfig: { formConfig: {

@ -65,7 +65,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['oldContainerOwner', 'rentDirectId', 'bsdate', 'accdate'])
}, },
columns, columns,
formConfig: { formConfig: {

@ -65,7 +65,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['rentCustomerName', 'bsdate', 'accdate'])
}, },
columns, columns,
formConfig: { formConfig: {

@ -65,7 +65,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['rentCustomerName', 'rentDirectId', 'bsdate', 'accdate'])
}, },
columns, columns,
formConfig: { formConfig: {

@ -65,7 +65,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['bsdate', 'accdate'])
}, },
columns, columns,
formConfig: { formConfig: {

@ -43,7 +43,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['ctnBizState', 'changeSourceId'])
}, },
columns, columns,
rowSelection: { type: 'checkbox' }, rowSelection: { type: 'checkbox' },

@ -32,7 +32,7 @@
}) })
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p, ['ctnall', 'ctnSourceId', 'isOnlineId'])
}, },
columns, columns,
rowSelection: { type: 'checkbox' }, rowSelection: { type: 'checkbox' },

Loading…
Cancel
Save