合规性手续新增,进度类别模板更新
This commit is contained in:
@ -46,6 +46,9 @@
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['formalities:listOfFormalities:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
@ -213,6 +216,28 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="新增合规性手续合账" v-model="templateVisbile" width="450">
|
||||
<el-form-item label="合规性手续模板">
|
||||
<el-cascader
|
||||
v-model="tempValue"
|
||||
:options="tempTreeList"
|
||||
:props="{
|
||||
multiple: true,
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
disabled: (node: any) => {
|
||||
return (node.pid == 0 && !node.children.length) || node.status == 1; // 有 parent 的是二级,没有 parent 的是一级,禁用一级
|
||||
}
|
||||
}"
|
||||
/>
|
||||
</el-form-item>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="templateVisbile = false">取消</el-button>
|
||||
<el-button type="primary" @click="setTemp">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -225,7 +250,8 @@ import {
|
||||
updateFormalitiesAreConsolidated,
|
||||
listFormalitiesAnnex,
|
||||
delFormalitiesAnnex,
|
||||
editStatus
|
||||
editStatus,
|
||||
getTemplateTreeList
|
||||
} from '@/api/formalities/formalitiesAreConsolidated';
|
||||
import {
|
||||
FormalitiesAreConsolidatedVO,
|
||||
@ -272,6 +298,8 @@ const statusForm = ref({
|
||||
projectId: currentProject.value?.id,
|
||||
processingStatus: undefined
|
||||
});
|
||||
const templateVisbile = ref(false);
|
||||
const tempTreeList = ref([]);
|
||||
|
||||
const initFormData: FormalitiesAreConsolidatedForm = {
|
||||
id: undefined,
|
||||
@ -307,6 +335,8 @@ const data = reactive<PageData<FormalitiesAreConsolidatedForm, FormalitiesAreCon
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const tempValue = ref(null);
|
||||
|
||||
/** 查询合规性手续合账列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
@ -367,6 +397,39 @@ const handleUpdate = async (row?: FormalitiesAreConsolidatedVO) => {
|
||||
dialog.title = '修改合规性手续合账';
|
||||
};
|
||||
|
||||
//新增
|
||||
const handleAdd = async () => {
|
||||
tempValue.value = null;
|
||||
const res = await getTemplateTreeList({ projectId: currentProject.value.id });
|
||||
tempTreeList.value = res.data;
|
||||
templateVisbile.value = true;
|
||||
};
|
||||
|
||||
// 选择模板
|
||||
const setTemp = async () => {
|
||||
// form.value.formalitiesPid = tempValue.value[tempValue.value.length - 1];
|
||||
if (!tempValue.value || !tempValue.value.length) {
|
||||
proxy?.$modal.msgWarning('请选择模板');
|
||||
return;
|
||||
}
|
||||
let addBusFormalitiesAreConsolidatedBos = tempValue.value.map((item) => {
|
||||
return {
|
||||
formalitiesId: item[1],
|
||||
formalitiesPid: item[0]
|
||||
};
|
||||
});
|
||||
const data = {
|
||||
addBusFormalitiesAreConsolidatedBos,
|
||||
projectId: currentProject.value.id
|
||||
};
|
||||
const res = await addFormalitiesAreConsolidated(data);
|
||||
if (res.code == 200) {
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
templateVisbile.value = false;
|
||||
getList();
|
||||
}
|
||||
};
|
||||
|
||||
/** 上传按钮操作 */
|
||||
const handleUpload = (row) => {
|
||||
form.value.id = row.id;
|
||||
|
Reference in New Issue
Block a user