往来单位 费用代码 调整

szh-new
张同海 3 months ago
parent 758fa53013
commit 6eb668f6c9

@ -57,25 +57,20 @@
}) })
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
console.log(data, 3333333333333333333333333)
resetFields() resetFields()
setModalProps({ confirmLoading: false, loading: true }) setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate isUpdate.value = !!data?.isUpdate
rowId.value = data.record.id
if (unref(isUpdate)) { if (unref(isUpdate)) {
setModalProps({ confirmLoading: true }) setModalProps({ confirmLoading: true })
rowId.value = data.record.id
const res: API.DataResult = await getClientBankInfo({ id: unref(rowId) }) const res: API.DataResult = await getClientBankInfo({ 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 }) setModalProps({ confirmLoading: false })
} else { } else {
rowId.value = data.record.id
setFieldsValue({ permissionIdentity: unref(2), clientId: data.record.id }) setFieldsValue({ permissionIdentity: unref(2), clientId: data.record.id })
} }
setModalProps({ loading: false }) setModalProps({ loading: false })
@ -97,11 +92,11 @@
// //
if (!exit) { if (!exit) {
if (unref(isUpdate)) { if (unref(isUpdate)) {
await refresh() // await refresh()
} else { } else {
rowId.value = res.data rowId.value = res.data
isUpdate.value = true isUpdate.value = true
await refresh() // await refresh()
} }
} }
} }
@ -111,12 +106,12 @@
setModalProps({ confirmLoading: false, loading: false }) setModalProps({ confirmLoading: false, loading: false })
} }
} }
async function refresh() { // async function refresh() {
// const res: API.DataResult = await getClientBankInfo({ id: unref(rowId) }) // const res: API.DataResult = await getClientBankInfo({ id: unref(rowId) })
// if (res.succeeded) { // if (res.succeeded) {
// await setFieldsValue({ // await setFieldsValue({
// ...res.data, // ...res.data,
// }) // })
// } // }
} // }
</script> </script>

@ -160,7 +160,7 @@
</div> </div>
</div> </div>
<div> <div>
<Tabs3 :client-id="clientId" /> <Tabs3 :client-id="clientId" :saleId="saleId" :sourceId="sourceId" />
</div> </div>
</a-tab-pane> </a-tab-pane>
<!-- <a-tab-pane key="3" tab="账期信息"> <!-- <a-tab-pane key="3" tab="账期信息">
@ -455,13 +455,19 @@
createTime: '', createTime: '',
}) })
const auditStatusText = ref('') const auditStatusText = ref('')
// id
const saleId = ref('')
// id
const sourceId = ref('')
async function getData(type) { async function getData(type) {
list.value.splice(0) list.value.splice(0)
const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) }) const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) })
if (res.succeeded) { if (res.succeeded) {
clientId.value = res.data.id clientId.value = res.data.id
saleId.value = res.data.saleId
sourceId.value = res.data.sourceId
customerName.value = res.data.shortName customerName.value = res.data.shortName
auditStatusText.value = res.data.auditStatusText
res.data.ArrclientTag = [] res.data.ArrclientTag = []
if (res.data.clientTag) { if (res.data.clientTag) {
res.data.others = res.data.clientTag.others res.data.others = res.data.clientTag.others
@ -490,61 +496,6 @@
Arr.push({ label: item.detailName, value: item.id }) Arr.push({ label: item.detailName, value: item.id })
}) })
}) })
// updateSchema(
// rowId.value
// ? {
// label: '',
// field: 'sourceDetailId',
// component: 'DEdit',
// required: false,
// dynamicDisabled: ({ values }) => {
// return !values.sourceId
// },
// colProps: { span: 4 },
// componentProps: async (e) => {
// const { formModel } = e
// console.log(formModel, 2222)
// return {
// formModel: formModel,
// onEdit: () => {
// const { formActionType } = e
// formActionType ? formActionType.linkageForm(e) : null
// },
// }
// },
// }
// : {
// label: '',
// field: 'sourceDetailId',
// component: 'Select',
// required: false,
// dynamicDisabled: ({ values }) => {
// return !values.sourceId
// },
// colProps: { span: 4 },
// componentProps: ({ formModel }) => {
// return {
// allowClear: true,
// options: Arr,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// onChange: (e, obj) => {
// if (e && obj) {
// formModel.sourceDetailId = obj.value
// formModel.sourceDetailName = obj.label
// }
// if (!e && !obj) {
// formModel.sourceDetailId = ''
// formModel.sourceDetailName = ''
// }
// },
// }
// },
// },
// )
activeKey.value = '2' activeKey.value = '2'
await setFieldsValue1({ await setFieldsValue1({
...res.data, ...res.data,
@ -552,16 +503,6 @@
activeKey.value = '1' activeKey.value = '1'
reload() reload()
} }
// if (res.data.clientTag) {
// await getClientBankList({
// clientId: res.data.clientTag.clientId,
// }).then((res) => {
// setTableData(res.data)
// })
// }
// setFieldsValue({ trainId: unref(res.data.trainId) });
} }
} }
onMounted(async () => { onMounted(async () => {
@ -599,79 +540,6 @@
await setFieldsValue1({}) await setFieldsValue1({})
} }
}) })
// const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
// // activeKey.value = '1'
// // selectedKeys.value = ['menu1']
// // resetFields()
// // resetFields1()
// // setModalProps({ confirmLoading: false, loading: true })
// isUpdate.value = !!data?.isUpdate
// if (unref(isUpdate)) {
// // setModalProps({ confirmLoading: true });
// rowId.value = data.record.id
// activeKey.value = '2'
// list.value.splice(0)
// const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) })
// if (res.succeeded) {
// clientId.value = res.data.id
// customerName.value = res.data.shortName
// res.data.ArrclientTag = []
// if (res.data.clientTag) {
// res.data.others = res.data.clientTag.others
// Object.keys(res.data.clientTag).forEach((item) => {
// if (item.indexOf('is') != -1) {
// if (res.data.clientTag[item]) {
// res.data.ArrclientTag.push(item)
// }
// } else {
// clientTag_o.value[item] = res.data.clientTag[item]
// }
// })
// }
// //
// res.data.invoiceHeaders.forEach((item) => {
// list.value.push(item)
// })
// await setFieldsValue({
// ...res.data,
// })
// activeKey.value = '2'
// await setFieldsValue1({
// ...res.data,
// })
// activeKey.value = '1'
// reload()
// // if (res.data.clientTag) {
// // await getClientBankList({
// // clientId: res.data.clientTag.clientId,
// // }).then((res) => {
// // setTableData(res.data)
// // })
// // }
// // setFieldsValue({ trainId: unref(res.data.trainId) });
// }
// // setModalProps({ confirmLoading: false });
// } else {
// list.value.splice(0)
// setTableData([])
// clientId.value = ''
// clientTag_o.value = {
// id: '',
// clientId: '',
// others: '',
// note: '',
// createTime: '',
// }
// rowId.value = ''
// activeKey.value = '2'
// await setFieldsValue({})
// activeKey.value = '1'
// await setFieldsValue1({})
// }
// setModalProps({ loading: false })
// })
const getTitle = computed(() => (!rowId.value ? '新增往来单位' : '编辑往来单位')) const getTitle = computed(() => (!rowId.value ? '新增往来单位' : '编辑往来单位'))
// //
function handleCreate() { function handleCreate() {
@ -679,15 +547,12 @@
go(`/infoclientDetail?addNum=${addNum}`) go(`/infoclientDetail?addNum=${addNum}`)
} }
// //
async function handleSave(exit) { async function handleSave() {
// try { // try {
const values = await validate().catch(() => { const values = await validate().catch(() => {
notification.warning({ message: '请补全基本信息中必填内容!', duration: 3 }) notification.warning({ message: '请补全基本信息中必填内容!', duration: 3 })
}) })
// const values1 = await validate1().catch(() => {
// notification.warning({ message: '', duration: 3 })
// })
// if (values && values1) {
if (values) { if (values) {
// setModalProps({ confirmLoading: true, loading: true }) // setModalProps({ confirmLoading: true, loading: true })
// TODO custom api // TODO custom api
@ -727,7 +592,7 @@
invoiceHeaders, invoiceHeaders,
}) })
if (res.succeeded) { if (res.succeeded) {
if (!exit && !rowId.value) { if (!rowId.value) {
rowId.value = res.data rowId.value = res.data
clientId.value = res.data clientId.value = res.data
// isUpdate.value = true // isUpdate.value = true
@ -735,7 +600,6 @@
...getFieldsValue(), ...getFieldsValue(),
id: res.data, id: res.data,
}) })
auditStatusText.value = getFieldsValue().auditStatusText
} }
getData(false) getData(false)
notification.success({ message: res.message, duration: 3 }) notification.success({ message: res.message, duration: 3 })

@ -1069,7 +1069,7 @@ export const formSchema: FormSchema[] = [
colProps: { span: 4 }, colProps: { span: 4 },
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
api: GetAllClientList, api: GetAllClientList(),
labelField: 'shortName', labelField: 'shortName',
valueField: 'id', valueField: 'id',
resultField: 'data', resultField: 'data',

@ -55,38 +55,35 @@
schemas: formSchema, schemas: formSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
}) })
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields() resetFields()
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), clientId: data.clientId }) console.log(data)
setFieldsValue({
permissionIdentity: unref(2),
clientId: data.clientId,
saleId: data.saleId,
sourceId: data.sourceId,
})
} }
setModalProps({ loading: false }) setModalProps({ loading: false })
}) })
const getTitle = computed(() => (!unref(isUpdate) ? '新增账期信息' : '编辑账期信息')) const getTitle = computed(() => (!unref(isUpdate) ? '新增账期信息' : '编辑账期信息'))
async function handleSave(exit) { async function handleSave(exit) {
try { try {
const values = await validate() const values = await validate()
setModalProps({ confirmLoading: true, loading: true }) setModalProps({ confirmLoading: true, loading: true })
// TODO custom api
// loading.value = true;
const res: API.DataResult = await ApiEdit(values) const res: API.DataResult = await ApiEdit(values)
if (res.succeeded) { if (res.succeeded) {
notification.success({ message: res.message, duration: 3 }) notification.success({ message: res.message, duration: 3 })
@ -102,10 +99,8 @@
} }
} }
} }
exit && closeModal() exit && closeModal()
} finally { } finally {
// loading.value = false;
setModalProps({ confirmLoading: false, loading: false }) setModalProps({ confirmLoading: false, loading: false })
} }
} }

@ -417,6 +417,7 @@ export const formSchema: FormSchema[] = [
{ {
field: 'commissionRate', field: 'commissionRate',
label: '运杂费比例', label: '运杂费比例',
required: true,
component: 'InputNumber', component: 'InputNumber',
colProps: { span: 8 }, colProps: { span: 8 },
defaultValue: '', defaultValue: '',

@ -58,6 +58,8 @@
const { notification } = useMessage() const { notification } = useMessage()
const props = defineProps({ const props = defineProps({
clientId: { type: String }, clientId: { type: String },
saleId: { type: String },
sourceId: { type: String },
}) })
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const visible = ref(false) const visible = ref(false)
@ -140,7 +142,8 @@
function handleCreate() { function handleCreate() {
openModal(true, { openModal(true, {
clientId: props.clientId, clientId: props.clientId,
isParent: false, saleId: props.saleId,
sourceId: props.sourceId,
isUpdate: false, isUpdate: false,
}) })
} }

@ -6,9 +6,7 @@
<template> <template>
<div> <div>
<BasicTable <BasicTable @register="registerTable">
@register="registerTable"
>
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> </a-button>
</template> </template>
@ -38,9 +36,10 @@
import { GetFeeCodeList } from './api' import { GetFeeCodeList } from './api'
import { useModal } from '/@/components/Modal' import { useModal } from '/@/components/Modal'
import Modal from './components/Modal.vue' import Modal from './components/Modal.vue'
import { formatParams } from '/@/hooks/web/common'
import { columns, searchFormSchema } from './columns' import { columns, searchFormSchema } from './columns'
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({ const [registerTable, { reload }] = useTable({
title: '费用代码', title: '费用代码',
api: async (p) => { api: async (p) => {
const res: API.DataResult = await GetFeeCodeList(p) const res: API.DataResult = await GetFeeCodeList(p)
@ -49,35 +48,8 @@
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
}) })
}, },
beforeFetch: () => { beforeFetch: (p) => {
var currentPageInfo: any = getPaginationRef() return formatParams(p)
var data = getForm().getFieldsValue()
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: currentPageInfo.current,
pageSize: currentPageInfo.pageSize,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
if (!!data.UserName) {
condition.push({
FieldName: 'UserName',
FieldValue: data.UserName,
ConditionalType: 1,
})
}
if (!!data.UserCode) {
condition.push({
FieldName: 'UserCode',
FieldValue: data.UserCode,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition)
// console.log(postParam);
return postParam
}, },
columns, columns,
formConfig: { formConfig: {

Loading…
Cancel
Save