回填联系人

szh-new
lijingjia 3 months ago
parent 5a2fa83f00
commit f4f1c07da5

@ -107,6 +107,11 @@ export function useForm(props?: Props): UseFormReturnType {
return form.submit() return form.submit()
}, },
linkageForm: async (): Promise<any> => {
const form = await getForm()
return form.linkageForm()
},
validate: async (nameList?: NamePath[]): Promise<Recordable> => { validate: async (nameList?: NamePath[]): Promise<Recordable> => {
const form = await getForm() const form = await getForm()
return form.validate(nameList) return form.validate(nameList)

@ -37,6 +37,8 @@
import { BasicModal, useModalInner } from '/@/components/Modal' import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil' import { getDictOption } from '/@/utils/dictUtil'
//
import { ApiEdit } from '/@/views/baseinfo/infoclient/menu2/api'
import emitter from '/@/utils/Bus' import emitter from '/@/utils/Bus'
// //
import { personFormSchema } from './baseInfo' import { personFormSchema } from './baseInfo'
@ -91,10 +93,11 @@
}) })
let changeType = '' let changeType = ''
// //
const linkageForm = (v) => { const linkageForm = (item) => {
console.log(v) if (item.key == 'customerType') {
changeType = v changeType = item.value
emit('getBaseInfo', v) emit('getBaseInfo', item.value)
}
} }
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑')) const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
// //
@ -107,6 +110,19 @@
async function handleSave(exit) { async function handleSave(exit) {
try { try {
const values = await validate() const values = await validate()
// const postData = {}
// postData['clientId'] = values.customerId
// postData['tel'] = values.tel
// postData['email'] = values.email
// postData['note'] = values.note
// postData['name'] = values.name
// if (values.customerContactId) {
// //
// postData['id'] = values.customerContactId
// }
// ApiEdit(postData).then(res => {
// console.log(res)
// })
values['businessId'] = id.value values['businessId'] = id.value
loading.value = true loading.value = true
setModalProps({ confirmLoading: true, loading: true }) setModalProps({ confirmLoading: true, loading: true })

@ -1717,7 +1717,6 @@ export const cargoInfoFormSchema2: FormSchema[] = [
label: '', label: '',
field: 'isPreOrder', field: 'isPreOrder',
component: 'Input', component: 'Input',
defaultValue: false,
show: false show: false
}, },
{ {
@ -1730,7 +1729,7 @@ export const cargoInfoFormSchema2: FormSchema[] = [
show: ({ values }) => { show: ({ values }) => {
return !values.isPreOrder return !values.isPreOrder
}, },
defaultValue: null, // defaultValue: '',
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
@ -2082,7 +2081,7 @@ export const otherInfoFormSchema: FormSchema[] = [
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: ({ formModel }) => { componentProps: ({ formModel, formActionType }) => {
return { return {
api: GetCustomerServiceList, api: GetCustomerServiceList,
labelField: 'pinYinCode', labelField: 'pinYinCode',
@ -2093,6 +2092,7 @@ export const otherInfoFormSchema: FormSchema[] = [
immediate: false, immediate: false,
resultField: 'data', resultField: 'data',
onChange: (e, obj) => { onChange: (e, obj) => {
formActionType ? formActionType.linkageForm({ key: 'operatorName', value: obj}) : null
if (e && obj) { if (e && obj) {
formModel.operatorId = obj.id formModel.operatorId = obj.id
} }
@ -2705,7 +2705,7 @@ export const personFormSchema: FormSchema[] = [
formModel.name = '' formModel.name = ''
formModel.email = '' formModel.email = ''
formModel.tel = '' formModel.tel = ''
formActionType ? formActionType.linkageForm(v) : null formActionType ? formActionType.linkageForm({ key: 'customerType', value: v }) : null
}, },
} }
}, },
@ -2713,7 +2713,7 @@ export const personFormSchema: FormSchema[] = [
{ {
field: 'customerId', field: 'customerId',
label: '客户名称', label: '客户名称',
defaultValue: '', defaultValue: null,
component: 'Select', component: 'Select',
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
@ -2730,6 +2730,7 @@ export const personFormSchema: FormSchema[] = [
formModel.email = '' formModel.email = ''
formModel.tel = '' formModel.tel = ''
} }
console.log(v, 222)
// 设置关系人下拉 // 设置关系人下拉
GetOrderContactListByClientId({ id: v }).then(res => { GetOrderContactListByClientId({ id: v }).then(res => {
personList.value = res.data.map(item => { personList.value = res.data.map(item => {
@ -2740,6 +2741,7 @@ export const personFormSchema: FormSchema[] = [
mobile: item.mobile mobile: item.mobile
} }
}) })
console.log(personList.value)
}) })
} }
} }
@ -2752,26 +2754,30 @@ export const personFormSchema: FormSchema[] = [
show: false show: false
}, },
{ {
field: 'customerContactId', field: 'name',
label: '联系人', label: '联系人',
component: 'Select', component: 'ApiSelect',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: ({ formModel }) => { componentProps: ({ formModel, formActionType }) => {
return { return {
options: personList.value, option: personList.value,
mode: 'SECRET_COMBOBOX_MODE_DO_NOT_USE',
labelField: 'label',
valueField: 'label',
immediate: false,
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
mode: 'SECRET_COMBOBOX_MODE_DO_NOT_USE',
onChange: (v, obj) => { onChange: (v, obj) => {
if (obj) { if (v && obj) {
formModel.name = obj.label formModel.customerContactId = obj.value
formModel.email = obj.email formModel.email = obj.email
formModel.mobile = obj.mobile formModel.mobile = obj.mobile
} else { }
formModel.name = null if (!v && (!obj || obj == {})){
formModel.customerContactId = null
formModel.email = null formModel.email = null
formModel.mobile = null formModel.mobile = null
} }
@ -2780,7 +2786,7 @@ export const personFormSchema: FormSchema[] = [
} }
}, },
{ {
field: 'name', field: 'customerContactId',
label: '', label: '',
component: 'Input', component: 'Input',
show: false show: false
@ -2813,7 +2819,12 @@ export const personFormSchema: FormSchema[] = [
label: '备注', label: '备注',
defaultValue: '', defaultValue: '',
component: 'InputTextArea', component: 'InputTextArea',
colProps: { span: 24 } colProps: { span: 24 },
componentProps: {
autoSize: {
minRows: 10
}
}
} }
] ]

@ -16,18 +16,6 @@
</a-button> </a-button>
</a-dropdown> </a-dropdown>
</h4> </h4>
<!-- <ConfigForm
v-if="source == 'edit' && !isPreOrder"
style="position: absolute; right: 0; top: -5px;"
:form-schema="cargoInfoFormSchema2"
name="货物信息"
formNo="12"
>
<a-button type="link">
<span class="iconfont icon-icon_tianjia"></span>
添加到表单设置
</a-button>
</ConfigForm> -->
</div> </div>
<a-row :gutter="15"> <a-row :gutter="15">
<a-col :span="24"> <a-col :span="24">
@ -93,7 +81,7 @@
</BasicForm> </BasicForm>
</a-col> </a-col>
</a-row> </a-row>
<a-modal <!-- <a-modal
:visible="visible" :visible="visible"
:maskClosable="false" :maskClosable="false"
title="品名维护" title="品名维护"
@ -102,7 +90,7 @@
@cancel="visible = false" @cancel="visible = false"
> >
<GoodsTable source="modal"></GoodsTable> <GoodsTable source="modal"></GoodsTable>
</a-modal> </a-modal> -->
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -132,9 +120,6 @@
cargoId: 'S' cargoId: 'S'
} }
}, },
rules: { type: Object, default: {} },
isLockBooking: { type: Boolean, default: false },
inSave: { type: Boolean, default: false },
isPreOrder: { type: Boolean, default: false }, // 使 isPreOrder: { type: Boolean, default: false }, // 使
}) })
// //

@ -19,6 +19,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { ediMoreFormSchema } from './baseInfo.tsx' import { ediMoreFormSchema } from './baseInfo.tsx'
import emitter from '/@/utils/Bus'
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import { ref, watch, defineProps, defineExpose, onMounted } from 'vue' import { ref, watch, defineProps, defineExpose, onMounted } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
@ -61,11 +62,15 @@
// props.details[type] = value || '' // props.details[type] = value || ''
// } // }
onMounted(() => { onMounted(() => {
// if (source.value != 'edit') { emitter.on('setEdiForm', (v) => {
// ediMoreFormSchema.forEach(item => { const form = {}
// item.dynamicDisabled = true if (v.userEnName) form['opEName'] = v.userEnName
// }) if (v.phone) form['opTel'] = v.phone
// } if (v.email) form['opEmail'] = v.email
setFieldsValue({
...form
})
})
}) })
defineExpose({ defineExpose({
// RefediFrom, // RefediFrom,

@ -32,7 +32,7 @@
<span class="iconfont" :class="{ 'icon-locksuo': details.isBusinessLocking, 'icon-a-jiesuo1_jiesuo': !details.isBusinessLocking }"> 业务</span> <span class="iconfont" :class="{ 'icon-locksuo': details.isBusinessLocking, 'icon-a-jiesuo1_jiesuo': !details.isBusinessLocking }"> 业务</span>
<span class="iconfont ml15" :class="{ 'icon-locksuo': details.isFeeLocking, 'icon-a-jiesuo1_jiesuo': !details.isFeeLocking }"> 费用</span> <span class="iconfont ml15" :class="{ 'icon-locksuo': details.isFeeLocking, 'icon-a-jiesuo1_jiesuo': !details.isFeeLocking }"> 费用</span>
</div> </div>
<BasicForm @register="registerForm"> <BasicForm @register="registerForm" @linkageForm="linkageForm">
</BasicForm> </BasicForm>
<slot></slot> <slot></slot>
<!-- <ConfigForm <!-- <ConfigForm
@ -144,6 +144,12 @@
}) })
}) })
}) })
// edi
const linkageForm = (item) => {
if (item.key === 'operatorName') {
emitter.emit('setEdiForm' , item.value)
}
}
defineExpose({ defineExpose({
// RefbasicFrom, // RefbasicFrom,
getFieldsValue, getFieldsValue,

Loading…
Cancel
Save