航线 调整

szh-new
张同海 2 months ago
parent 217d5ded31
commit 81702e466f

@ -417,7 +417,7 @@ export const searchFormSchema: FormSchema[] = [
label: '客户属性', label: '客户属性',
field: 'clientTag', field: 'clientTag',
component: 'ApiSelect', component: 'ApiSelect',
colProps: { span: 4 }, colProps: { span: 8 },
componentProps: () => { componentProps: () => {
return { return {
api: () => { api: () => {

@ -51,40 +51,41 @@
const loading = ref(false) const loading = ref(false)
const rowId = ref('') const rowId = ref('')
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] = useForm({ const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
labelWidth: 100, useForm({
schemas: formSchema, labelWidth: 100,
showActionButtonGroup: false, schemas: formSchema,
}) showActionButtonGroup: false,
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => { })
resetFields() const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(
setModalProps({ confirmLoading: false, loading: true }) async (data) => {
updateFormField(updateSchema) resetFields()
isUpdate.value = !!data?.isUpdate setModalProps({ confirmLoading: false, loading: true })
if (unref(isUpdate)) { updateFormField(updateSchema)
// setModalProps({ confirmLoading: true }); isUpdate.value = !!data?.isUpdate
rowId.value = data.record.id if (unref(isUpdate)) {
const res: API.DataResult = await ApiInfo({ id: unref(rowId) }) // setModalProps({ confirmLoading: true });
// getFieldList() rowId.value = data.record.id
if (res.succeeded) { const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
setFieldsValue({ // getFieldList()
...res.data if (res.succeeded) {
}) setFieldsValue({
// console.log('Form', getFieldsValue()); ...res.data,
// setFieldsValue({ trainId: unref(res.data.trainId) }); })
// console.log('Form', getFieldsValue());
// setFieldsValue({ trainId: unref(res.data.trainId) });
}
// setModalProps({ confirmLoading: false });
} else {
setFieldsValue({ permissionIdentity: unref(2) })
} }
// setModalProps({ confirmLoading: false }); setModalProps({ loading: false })
} else { },
setFieldsValue({ permissionIdentity: unref(2) }) )
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增航线信息' : '编辑航线信息')) const getTitle = computed(() => (!unref(isUpdate) ? '新增航线信息' : '编辑航线信息'))
async function handleSave(exit) { async function handleSave(exit) {
console.log(getFieldsValue())
return
try { try {
const values = await validate() const values = await validate()
setModalProps({ confirmLoading: true, loading: true }) setModalProps({ confirmLoading: true, loading: true })

Loading…
Cancel
Save