最近的提交添加了新的属性 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: Number,
|
||||
},
|
||||
extend: {
|
||||
type: Object,
|
||||
}
|
||||
})
|
||||
|
||||
@ -93,13 +96,21 @@ const selectChange = (lab) => {
|
||||
}
|
||||
|
||||
const setKey = () => {
|
||||
props.config.forEach(item => {
|
||||
props.formData[item.value] = {
|
||||
label: item.label,
|
||||
value: "",
|
||||
text: ""
|
||||
if (Object.keys(props.extend).length) {
|
||||
for (let key in props.extend) {
|
||||
props.formData[key] = props.extend[key]
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
props.config.forEach(item => {
|
||||
props.formData[item.value] = {
|
||||
label: item.label,
|
||||
value: "",
|
||||
text: ""
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
setKey()
|
||||
|
||||
</script>
|
@ -55,7 +55,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</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-descriptions-item>
|
||||
<el-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
||||
|
@ -5,7 +5,8 @@
|
||||
<template #header>
|
||||
审批内容
|
||||
</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>
|
||||
<oaFlow :form-data="formData" :flow_cate="formData.id"></oaFlow>
|
||||
</popup>
|
||||
@ -32,6 +33,7 @@ const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
const showDialog = ref(false)
|
||||
const extend = ref({})
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
@ -63,6 +65,11 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData.id = data.id;
|
||||
};
|
||||
|
||||
// 获取详情
|
||||
const setExtend = async (data: Record<any, any>) => {
|
||||
extend.value = data
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 提交按钮
|
||||
@ -88,5 +95,6 @@ const handleClose = () => {
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
setExtend
|
||||
});
|
||||
</script>
|
@ -22,7 +22,8 @@
|
||||
<el-select v-model="queryParams.type" clearable placeholder="请选择类型" class="flex-1">
|
||||
<el-option label="全部" :value="1" />
|
||||
<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-select>
|
||||
</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
|
||||
let res = await apiOaFlowTypeDetail({ id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
if (Object.keys(extend).length) {
|
||||
editRef.value?.setExtend(extend)
|
||||
}
|
||||
}
|
||||
|
||||
const handDetail = async (id: any, data = {}) => {
|
||||
@ -105,9 +109,8 @@ const handDetail = async (id: any, data = {}) => {
|
||||
|
||||
const reEdit = async (data) => {
|
||||
showDetail.value = false
|
||||
console.log(data)
|
||||
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