资产审批
This commit is contained in:
@@ -27,7 +27,6 @@ let userInfo = reactive({
|
||||
});
|
||||
let unitName = ref('');
|
||||
const userId = ref<number | string>(0);
|
||||
const unitId = ref<number | string>(0);
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
@@ -70,7 +69,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (isUpdate.value && id) {
|
||||
const record = await personInfo(id);
|
||||
userId.value = record.userId;
|
||||
unitId.value = record.unitId;
|
||||
console.log(userId.value,'====================1111')
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -88,12 +87,10 @@ async function handleConfirm() {
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
let data = cloneDeep(await formApi.getValues());
|
||||
if (userInfo) {
|
||||
if (!isUpdate.value) {
|
||||
data.userName = userInfo.userName
|
||||
data.phone = userInfo.phone
|
||||
data.gender = userInfo.gender
|
||||
}
|
||||
if(unitName.value){
|
||||
data.unitName = unitName.value
|
||||
}
|
||||
await (isUpdate.value ? personUpdate(data) : personAdd(data));
|
||||
@@ -128,7 +125,7 @@ function getUnitInfo(unit: { name: string }) {
|
||||
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userId="userId"/>
|
||||
</template>
|
||||
<template #unitId="slotProps">
|
||||
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :isUpdate="isUpdate" :unitId="unitId"/>
|
||||
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :disabled="isUpdate"/>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
|
Reference in New Issue
Block a user