移交申请

This commit is contained in:
cwchen 2025-09-18 18:02:29 +08:00
parent fdfd284434
commit 7e5c7390e7
2 changed files with 37 additions and 59 deletions

View File

@ -3,28 +3,13 @@
<el-dialog class="l-dialog" :class="lDialog" :title="title" :visible.sync="dialogVisible" :showClose="true" <el-dialog class="l-dialog" :class="lDialog" :title="title" :visible.sync="dialogVisible" :showClose="true"
:closeOnClickModal="false" @close="handleClose" :append-to-body="true"> :closeOnClickModal="false" @close="handleClose" :append-to-body="true">
<div> <div>
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="110px">
<el-form-item label="项目" prop="proId">
<el-select class="form-item" v-model="form.proId" filterable clearable placeholder="请选择项目">
<el-option v-for="item in proList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择移交档案">
<el-button plain type="primary" size="mini" icon="el-icon-plus" @click="handleAddFile">选择</el-button>
</el-form-item>
<el-form-item label="接收组织" prop="deptId">
<treeselect v-model="form.deptId" :options="treeDataList" placeholder="请选择上级节点" value-key="id"
noChildrenText="没有数据了" noOptionsText="没有数据了" noResultsText="没有搜索结果" />
</el-form-item>
</el-form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button> <el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button>
<el-button type="primary" class="search-btn" :disabled="disabled" <el-button type="primary" class="search-btn" :disabled="disabled"
@click="submitForm('ruleForm')">确认</el-button> @click="submitForm('ruleForm')">确认</el-button>
</span> </span>
<FileTree v-if="fileTreeVisible" />
</el-dialog> </el-dialog>
</template> </template>
@ -40,7 +25,7 @@ import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "FileTree", name: "FileTree",
props: ["width", "dataForm", "title", "disabled", "isAdd", "rowData"], props: ["width", "dataForm", "title", "disabled", "rowData"],
dicts: ['data_class_type'], dicts: ['data_class_type'],
components: { Treeselect}, components: { Treeselect},
data() { data() {
@ -48,37 +33,15 @@ export default {
lDialog: this.width > 500 ? "w700" : "w500", lDialog: this.width > 500 ? "w700" : "w500",
dialogVisible: true, dialogVisible: true,
isDisabled: true, isDisabled: true,
form: {
proId: undefined,
deptId: undefined,
remark: '',
},
treeDataList: [],
proList: [],
loading: null,
rules: {
proId: [
{ required: true, message: '请选择项目', trigger: 'change' }
],
deptId: [
{ required: true, message: '请选择接收组织', trigger: 'change' }
],
},
fileTreeVisible: false,
}; };
}, },
created() { created() {
this.initFormData(); // this.initFormData();
}, },
methods: { methods: {
/** 初始化表单数据 */ /** 初始化表单数据 */
async initFormData() { async initFormData() {
await getDeptSelectApi().then(res => {
this.treeDataList = res.data;
});
await getProSelectApi().then(res => {
this.proList = res.data;
});
if (this.isAdd === 'edit' && this.rowData) { if (this.isAdd === 'edit' && this.rowData) {
// //
this.form = { this.form = {

View File

@ -14,8 +14,16 @@
<el-button plain type="primary" size="mini" icon="el-icon-plus" @click="handleAddFile">选择</el-button> <el-button plain type="primary" size="mini" icon="el-icon-plus" @click="handleAddFile">选择</el-button>
</el-form-item> </el-form-item>
<el-form-item label="接收组织" prop="deptId"> <el-form-item label="接收组织" prop="deptId">
<treeselect v-model="form.deptId" :options="treeDataList" placeholder="请选择上级节点" value-key="id" <treeselect
noChildrenText="没有数据了" noOptionsText="没有数据了" noResultsText="没有搜索结果" /> v-model="form.deptId"
:options="treeDataList"
placeholder="请选择接收组织"
value-key="id"
:disable-branch-nodes="true"
noChildrenText="没有数据了"
noOptionsText="没有数据了"
noResultsText="没有搜索结果"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -24,9 +32,9 @@
<el-button type="primary" class="search-btn" :disabled="disabled" <el-button type="primary" class="search-btn" :disabled="disabled"
@click="submitForm('ruleForm')">确认</el-button> @click="submitForm('ruleForm')">确认</el-button>
</span> </span>
<!-- <FileTree v-if="fileTreeVisible" /> --> <FileTree v-if="isflag" :isAdd="isAdd" :rowData="fileTreeRow" :title="fileTreeTitle"
@closeDialog="closeDialog" :dataForm="fileTreeRow" :width="800" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import _ from 'lodash' import _ from 'lodash'
@ -65,7 +73,9 @@ export default {
{ required: true, message: '请选择接收组织', trigger: 'change' } { required: true, message: '请选择接收组织', trigger: 'change' }
], ],
}, },
fileTreeVisible: false, fileTreeTitle: "",
isflag: false,
fileTreeRow: {},
}; };
}, },
created() { created() {
@ -99,7 +109,15 @@ export default {
}, },
// //
handleAddFile(){ handleAddFile(){
this.fileTreeVisible = true; this.fileTreeTitle = "选择";
this.fileTreeRow = {};
this.isflag = true;
},
closeDialog() {
this.isflag = false;
},
showColose() {
this.isflag = false;
}, },
/*关闭弹窗 */ /*关闭弹窗 */
handleClose() { handleClose() {
@ -175,30 +193,27 @@ export default {
}); });
}, },
// - // -
convertToVueTree(data) { convertToVueTree(data, level = 1) {
if (!data || !Array.isArray(data)) { if (!data || !Array.isArray(data)) {
return []; return []
} }
return data.map(item => { return data.map(item => {
const node = { const node = {
id: item.deptId, id: item.deptId,
label: item.deptName, label: item.deptName,
}; }
//
if (item.children && Array.isArray(item.children) && item.children.length > 0) { if (item.children && Array.isArray(item.children) && item.children.length > 0) {
const children = this.convertToVueTree(item.children); // 33 children disable-branch-nodes 3
// null3 if (level < 3) {
const filteredChildren = children.filter(child => child !== null); const children = this.convertToVueTree(item.children, level + 1)
// children if (children.length > 0) node.children = children
if (filteredChildren.length > 0) {
node.children = filteredChildren;
} }
} }
return node; return node
}).filter(node => node !== null); // null })
}, },
} }
}; };