|
@@ -169,6 +169,7 @@ let user: Ref<{ _id: string; name: string; unit_name: string; account: string; u
|
|
|
// 表单
|
|
|
let form: Ref<{ is_studio: string; prove: Array<[]>; direction: Array<[]> }> = ref({ is_studio: '', prove: [], direction: [] });
|
|
|
let uform: Ref<{
|
|
|
+ _id: string;
|
|
|
card: Array<any>;
|
|
|
unit_phone: { phone: string; is_show: string };
|
|
|
unit_email: { email: string; is_show: string };
|
|
@@ -182,6 +183,7 @@ let uform: Ref<{
|
|
|
unit_contact: string;
|
|
|
address: string;
|
|
|
}> = ref({
|
|
|
+ _id: '',
|
|
|
card: [],
|
|
|
unit_phone: { phone: '', is_show: '' },
|
|
|
unit_email: { email: '', is_show: '' },
|
|
@@ -225,6 +227,7 @@ const search = async () => {
|
|
|
if (res.errcode == 0) {
|
|
|
if (res.total > 0) {
|
|
|
uform.value = res.data[0] as {
|
|
|
+ _id: '';
|
|
|
card: [];
|
|
|
unit_phone: { phone: ''; is_show: '' };
|
|
|
unit_email: { email: ''; is_show: '' };
|
|
@@ -311,11 +314,21 @@ const uonChange = (e: { model: string; value: Array<[]> }) => {
|
|
|
uform.value[model] = value;
|
|
|
};
|
|
|
// 添加
|
|
|
-const toSave = async (data: object) => {
|
|
|
+const toSave = async (data: any) => {
|
|
|
let res: IQueryResult = await unit.update(data);
|
|
|
if (res.errcode == 0) {
|
|
|
ElMessage({ type: 'success', message: '维护信息成功' });
|
|
|
- search();
|
|
|
+ // 同步修改依托单位信息
|
|
|
+ let form = {
|
|
|
+ _id: uform.value._id,
|
|
|
+ unit_contact: data.name,
|
|
|
+ unit_phone: { phone: data.phone },
|
|
|
+ unit_email: { email: data.email },
|
|
|
+ company: data.unit_name,
|
|
|
+ address: data.unit_address,
|
|
|
+ };
|
|
|
+ await utoSave(form);
|
|
|
+ await search();
|
|
|
} else ElMessage({ type: 'warning', message: `${res.errmsg}` });
|
|
|
};
|
|
|
// 查询其他信息
|