移交申请

This commit is contained in:
cwchen 2025-09-18 17:20:40 +08:00
parent 43ee101b96
commit a65786aa1a
5 changed files with 316 additions and 30 deletions

View File

@ -35,3 +35,12 @@ export function delTransferApplyApi(data) {
data
})
}
// 已移交确认工程下拉选
export async function getProSelectApi(data) {
return await request({
url: '/smartArchives/transferApply/getProSelect',
method: 'GET',
data
})
}

View File

@ -8,3 +8,12 @@ export async function getClassifyMarkSelApi(params) {
params,
})
}
// 部门下拉树
export async function getDeptSelectApi(params) {
return await request({
url: '/smartArchives/transferApply/getDeptSelect',
method: 'get',
params,
})
}

View File

@ -27,11 +27,7 @@ export const formLabel = [
export const columnsList = [
{ t_props: 'proName', t_label: '项目名称' },
{ t_props: 'singleProName', t_label: '单项工程名称' },
{ t_props: 'proTypeName', t_label: '工程类型' },
{ t_props: 'voltageLevelName', t_label: '电压等级' },
{ t_props: 'planStartDate', t_label: '计划开工日期' },
{ t_props: 'planEndDate', t_label: '计划竣工日期' },
{ t_props: 'planTcDate', t_label: '计划投产日期' },
{ t_props: 'proStatusName', t_label: '工程状态' },
{ t_slot: 'contentsName', t_label: '匹配档案目录类型' },
{ t_props: 'applyUser', t_label: '申请人' },
{ t_props: 'applyTime', t_label: '申请时间' },
{ t_slot: 'auditStatus', t_label: '审批状态' },
]

View File

@ -1,25 +1,33 @@
<template>
<!-- 档案移交申请 -->
<div class="app-container">
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="proTableRef"
:columnsList="columnsList" :request-api="getProListAPI">
<template slot="contentsName" slot-scope="{ data }">
<el-tag
size="mini"
:type="data.contentsName ? 'success' : 'danger'"
>
{{ data.contentsName ? data.contentsName : '未配置' }}
<TableModel :formLabel="formLabel" :showOperation="true" :showRightTools="true" ref="applyTableRef"
:columnsList="columnsList" :request-api="getTransferApplyListApi">
<template slot="btn">
<el-button plain size="mini" type="primary" icon="el-icon-plus" v-hasPermi="['transfer:apply:add']"
@click="handleAdd">
新增
</el-button>
</template>
<template slot="auditStatus" slot-scope="{ data }">
<el-tag size="mini" :type="getStatusType(data.fileStatus)">
{{ getStatusText(data.fileStatus) }}
</el-tag>
</template>
<template slot="handle" slot-scope="{ data }">
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['data:classify:update']"
@click="handleUpdate(data)" v-if="!data.contentsName">
配置档案类型
<el-button plain size="mini" type="primary" icon="el-icon-edit" v-hasPermi="['transfer:apply:edit']"
@click="handleUpdate(data)">
修改
</el-button>
<el-button plain size="mini" type="danger" icon="el-icon-delete" v-hasPermi="['transfer:apply:del']"
@click="handleDelete(data)">
删除
</el-button>
</template>
</TableModel>
<!-- 配置 -->
<FileSetForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
<!-- 新增/编辑 -->
<ApplyForm v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title"
@closeDialog="closeDialog" @showColose="showColose" :dataForm="row" :disabled="loading" :width="600" />
</div>
</template>
@ -28,23 +36,24 @@
import TableModel from '@/components/TableModel'
import { columnsList, formLabel } from './config'
import {
getProListAPI
} from '@/api/archivesManagement/project'
// import FileSetForm from './prop/fileSetForm'
delTransferApplyApi,
getTransferApplyListApi,
} from '@/api/filesTransfer/apply.js'
import ApplyForm from './prop/applyForm'
export default {
name: 'ProManager',
name: 'Apply',
dicts: ['pro_type', 'voltage_level'],
components: {
TableModel,
// FileSetForm
ApplyForm
},
data() {
return {
formLabel,
columnsList,
getProListAPI,
getTransferApplyListApi,
title: "",
isflag: false,
isAdd: '',
@ -65,23 +74,78 @@ export default {
},
methods: {
/** 新增按钮操作 */
handleAdd() {
this.title = "新增";
this.isAdd = 'add';
this.isflag = true;
},
closeDialog() {
this.isflag = false;
},
showColose() {
this.isflag = false;
},
/** 配置档案类型 */
/** 修改操作 */
handleUpdate(row) {
this.title = "配置档案类型";
this.title = "修改";
this.isAdd = 'edit';
this.row = row;
this.isflag = true;
},
/* 搜索操作 */
handleQuery() {
this.$refs.proTableRef.getTableList()
this.$refs.applyTableRef.getTableList()
},
/** 删除操作 */
handleDelete(row) {
this.$modal.confirm(`是否确认删除数据类型名称为"${row.dataTypeName}"的数据项?`).then(() => {
//
this.$modal.loading("正在删除,请稍候...");
delTransferApplyApi({ id: row.id }).then(res => {
this.$modal.closeLoading();
if (res.code === 200) {
this.$modal.msgSuccess("删除成功");
this.handleQuery();
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.$modal.closeLoading();
this.$modal.msgError("删除失败,请重试");
console.error('删除失败:', error);
});
}).catch(() => {
//
});
},
//
getStatusText(status) {
switch (status) {
case '0':
return '待审批'
case '1':
return '审批通过'
case '2':
return '审批驳回'
default:
return '未知状态'
}
},
//
getStatusType(status) {
switch (status) {
case '0':
return 'danger'
case '1':
return 'warning'
case '2':
return 'success'
default:
return 'info'
}
}
},
}
</script>

View File

@ -0,0 +1,208 @@
<template>
<!-- 小型弹窗用于完成删除保存等操作 -->
<el-dialog class="l-dialog" :class="lDialog" :title="title" :visible.sync="dialogVisible" :showClose="true"
:closeOnClickModal="false" @close="handleClose" :append-to-body="true">
<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>
<span slot="footer" class="dialog-footer">
<el-button class="clear-btn" @click="handleClose" :disabled="disabled">取消</el-button>
<el-button type="primary" class="search-btn" :disabled="disabled"
@click="submitForm('ruleForm')">确认</el-button>
</span>
</el-dialog>
</template>
<script>
import _ from 'lodash'
import {
saveTransferApplyApi,
editTransferApplyApi,
getProSelectApi
} from '@/api/filesTransfer/apply'
import { getDeptSelectApi } from '@/api/select'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "ApplyForm",
props: ["width", "dataForm", "title", "disabled", "isAdd", "rowData"],
dicts: ['data_class_type'],
components: { Treeselect },
data() {
return {
lDialog: this.width > 500 ? "w700" : "w500",
dialogVisible: 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' }
],
},
};
},
created() {
this.initFormData();
},
methods: {
/** 初始化表单数据 */
async initFormData() {
await getDeptSelectApi().then(res => {
this.treeDataList = res.data;
});
await getProSelectApi().then(res => {
this.proList = res.data;
});
if (this.isAdd === 'edit' && this.rowData) {
//
this.form = {
id: this.rowData.id,
proId: this.rowData.proId || undefined,
deptId: this.rowData.deptId || undefined,
};
} else {
//
this.form = {
proId: undefined,
deptId: undefined,
};
}
},
//
handleAddFile(){
},
/*关闭弹窗 */
handleClose() {
this.dialogVisible = false;
this.$emit("closeDialog");
setTimeout(() => {
this.dialogVisible = true;
});
},
/**确认弹窗 */
sureBtnClick() {
this.dialogVisible = false;
this.$emit("closeDialog");
setTimeout(() => {
this.dialogVisible = true;
});
},
/**重置表单*/
reset() {
this.form = {
id: null,
pid: null,
dataTypeName: '',
remark: '',
};
this.resetForm("ruleForm");
},
handleReuslt(res) {
this.$modal.msgSuccess(res.msg);
this.reset();
this.$emit('handleQuery');
this.handleClose();
},
/**验证 */
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
//
this.loading = this.$loading({
lock: true,
text: "数据提交中,请稍候...",
background: 'rgba(0,0,0,0.5)',
target: this.$el.querySelector('.el-dialog') || document.body
})
let params = _.cloneDeep(this.form);
if (this.isAdd === 'add') {
saveTransferApplyApi(params).then(res => {
this.loading.close();
if (res.code === 200) {
this.handleReuslt(res);
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.loading.close();
// this.$modal.msgError('');
});
} else {
editTransferApplyApi(params).then(res => {
this.loading.close();
if (res.code === 200) {
this.handleReuslt(res);
} else {
this.$modal.msgError(res.msg);
}
}).catch(error => {
this.loading.close();
// this.$modal.msgError('');
});
}
}
});
}
}
};
</script>
<style lang="scss">
.w700 .el-dialog {
width: 700px;
}
.w500 .el-dialog {
width: 500px;
}
.w500 .el-dialog__header,
.w700 .el-dialog__header {
// background: #eeeeee;
.el-dialog__title {
font-size: 16px;
}
}
.yxq .el-range-separator {
margin-right: 7px !important;
}
.el-date-editor--daterange.el-input__inner {
width: 260px;
}
.form-item {
width: 100%;
}
.select-style {
display: flex;
justify-content: space-between;
}
</style>