回填联系人

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

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

@ -37,6 +37,8 @@
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { getDictOption } from '/@/utils/dictUtil'
//
import { ApiEdit } from '/@/views/baseinfo/infoclient/menu2/api'
import emitter from '/@/utils/Bus'
//
import { personFormSchema } from './baseInfo'
@ -91,10 +93,11 @@
})
let changeType = ''
//
const linkageForm = (v) => {
console.log(v)
changeType = v
emit('getBaseInfo', v)
const linkageForm = (item) => {
if (item.key == 'customerType') {
changeType = item.value
emit('getBaseInfo', item.value)
}
}
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
//
@ -107,6 +110,19 @@
async function handleSave(exit) {
try {
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
loading.value = true
setModalProps({ confirmLoading: true, loading: true })

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

@ -16,18 +16,6 @@
</a-button>
</a-dropdown>
</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>
<a-row :gutter="15">
<a-col :span="24">
@ -93,7 +81,7 @@
</BasicForm>
</a-col>
</a-row>
<a-modal
<!-- <a-modal
:visible="visible"
:maskClosable="false"
title="品名维护"
@ -102,7 +90,7 @@
@cancel="visible = false"
>
<GoodsTable source="modal"></GoodsTable>
</a-modal>
</a-modal> -->
</div>
</template>
<script lang="ts" setup>
@ -132,9 +120,6 @@
cargoId: 'S'
}
},
rules: { type: Object, default: {} },
isLockBooking: { type: Boolean, default: false },
inSave: { type: Boolean, default: false },
isPreOrder: { type: Boolean, default: false }, // 使
})
//

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

@ -32,7 +32,7 @@
<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>
</div>
<BasicForm @register="registerForm">
<BasicForm @register="registerForm" @linkageForm="linkageForm">
</BasicForm>
<slot></slot>
<!-- <ConfigForm
@ -144,6 +144,12 @@
})
})
})
// edi
const linkageForm = (item) => {
if (item.key === 'operatorName') {
emitter.emit('setEdiForm' , item.value)
}
}
defineExpose({
// RefbasicFrom,
getFieldsValue,

Loading…
Cancel
Save