最近的提交添加了新的属性 extend
到 props
,并在 setKey
方法中进行了处理。此外,还在 oa_Initiate
的 detail.vue
和 edit.vue
文件中进行了修改,并更新了 oa_Initiate
的 index.vue
页面。
commit message: 添加 `extend` 属性并更新相关页面
This commit is contained in:
parent
0a701defe0
commit
78d55ef751
@ -58,6 +58,9 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
},
|
||||||
|
extend: {
|
||||||
|
type: Object,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -93,13 +96,21 @@ const selectChange = (lab) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setKey = () => {
|
const setKey = () => {
|
||||||
props.config.forEach(item => {
|
if (Object.keys(props.extend).length) {
|
||||||
props.formData[item.value] = {
|
for (let key in props.extend) {
|
||||||
label: item.label,
|
props.formData[key] = props.extend[key]
|
||||||
value: "",
|
|
||||||
text: ""
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
else {
|
||||||
|
props.config.forEach(item => {
|
||||||
|
props.formData[item.value] = {
|
||||||
|
label: item.label,
|
||||||
|
value: "",
|
||||||
|
text: ""
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setKey()
|
setKey()
|
||||||
|
|
||||||
</script>
|
</script>
|
@ -55,7 +55,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="审批意见" label-align="left" align="left" v-if="showTextarea()">
|
<el-descriptions-item label="审批意见" label-align="left" align="left"
|
||||||
|
v-if="showTextarea() && formData.admin_id != userStore.id">
|
||||||
<el-input type="textarea" v-model="form.content"></el-input>
|
<el-input type="textarea" v-model="form.content"></el-input>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
<el-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
审批内容
|
审批内容
|
||||||
</template>
|
</template>
|
||||||
<generateForm :config="formData.data" :form-data="formData.extends" :type="type"></generateForm>
|
<generateForm :config="formData.data" :extend="extend" :form-data="formData.extends" :type="type">
|
||||||
|
</generateForm>
|
||||||
</el-card>
|
</el-card>
|
||||||
<oaFlow :form-data="formData" :flow_cate="formData.id"></oaFlow>
|
<oaFlow :form-data="formData" :flow_cate="formData.id"></oaFlow>
|
||||||
</popup>
|
</popup>
|
||||||
@ -32,6 +33,7 @@ const formRef = shallowRef<FormInstance>();
|
|||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||||
const mode = ref("add");
|
const mode = ref("add");
|
||||||
const showDialog = ref(false)
|
const showDialog = ref(false)
|
||||||
|
const extend = ref({})
|
||||||
|
|
||||||
// 弹窗标题
|
// 弹窗标题
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
@ -63,6 +65,11 @@ const setFormData = async (data: Record<any, any>) => {
|
|||||||
formData.id = data.id;
|
formData.id = data.id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
const setExtend = async (data: Record<any, any>) => {
|
||||||
|
extend.value = data
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
@ -88,5 +95,6 @@ const handleClose = () => {
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
setFormData,
|
setFormData,
|
||||||
|
setExtend
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
@ -22,7 +22,8 @@
|
|||||||
<el-select v-model="queryParams.type" clearable placeholder="请选择类型" class="flex-1">
|
<el-select v-model="queryParams.type" clearable placeholder="请选择类型" class="flex-1">
|
||||||
<el-option label="全部" :value="1" />
|
<el-option label="全部" :value="1" />
|
||||||
<el-option label="待审核" :value="2" />
|
<el-option label="待审核" :value="2" />
|
||||||
<el-option label="审核通过," :value="3" />
|
<!-- <el-option label="审核中" :value="2" /> -->
|
||||||
|
<el-option label="审核通过" :value="3" />
|
||||||
<el-option label="审核不通过" :value="4" />
|
<el-option label="审核不通过" :value="4" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -86,13 +87,16 @@ const queryParams = reactive({
|
|||||||
|
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
const handleEdit = async (id: any, cate = '') => {
|
const handleEdit = async (id: any, cate = '', extend = '') => {
|
||||||
type.value = cate
|
type.value = cate
|
||||||
let res = await apiOaFlowTypeDetail({ id })
|
let res = await apiOaFlowTypeDetail({ id })
|
||||||
showEdit.value = true
|
showEdit.value = true
|
||||||
await nextTick()
|
await nextTick()
|
||||||
editRef.value?.open('edit')
|
editRef.value?.open('edit')
|
||||||
editRef.value?.setFormData(res)
|
editRef.value?.setFormData(res)
|
||||||
|
if (Object.keys(extend).length) {
|
||||||
|
editRef.value?.setExtend(extend)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handDetail = async (id: any, data = {}) => {
|
const handDetail = async (id: any, data = {}) => {
|
||||||
@ -105,9 +109,8 @@ const handDetail = async (id: any, data = {}) => {
|
|||||||
|
|
||||||
const reEdit = async (data) => {
|
const reEdit = async (data) => {
|
||||||
showDetail.value = false
|
showDetail.value = false
|
||||||
console.log(data)
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
handleEdit(data?.flow_info?.flow_cate)
|
handleEdit(data?.flow_info?.flow_cate, '', data.extends)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
|
Loading…
x
Reference in New Issue
Block a user