2025-09-11 18:16:50 +08:00
|
|
|
|
<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">
|
2025-09-12 10:06:44 +08:00
|
|
|
|
<el-form-item label="档案类型" prop="id">
|
|
|
|
|
|
<el-select class="form-item" v-model="form.id" filterable clearable
|
|
|
|
|
|
placeholder="请选择档案类型">
|
|
|
|
|
|
<el-option v-for="item in fileSetList" :key="item.id" :label="item.name"
|
|
|
|
|
|
:value="item.id"></el-option>
|
|
|
|
|
|
</el-select>
|
2025-09-11 18:16:50 +08:00
|
|
|
|
</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 {
|
2025-09-12 10:06:44 +08:00
|
|
|
|
updateContentsNameAPI,
|
|
|
|
|
|
getFileCatalogSelectAPI
|
|
|
|
|
|
} from '@/api/archivesManagement/project'
|
2025-09-11 18:16:50 +08:00
|
|
|
|
export default {
|
2025-09-12 10:06:44 +08:00
|
|
|
|
name: "FileSetForm",
|
2025-09-11 18:16:50 +08:00
|
|
|
|
props: ["width", "dataForm", "title", "disabled", "isAdd", "rowData"],
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
lDialog: this.width > 500 ? "w700" : "w500",
|
|
|
|
|
|
dialogVisible: true,
|
|
|
|
|
|
isDisabled: true,
|
|
|
|
|
|
form: {
|
2025-09-12 10:06:44 +08:00
|
|
|
|
id: undefined,
|
|
|
|
|
|
proId:this.rowData.id,
|
2025-09-11 18:16:50 +08:00
|
|
|
|
},
|
2025-09-12 10:06:44 +08:00
|
|
|
|
fileSetList: [],
|
2025-09-11 18:16:50 +08:00
|
|
|
|
loading: null,
|
|
|
|
|
|
rules: {
|
2025-09-12 10:06:44 +08:00
|
|
|
|
id: [
|
|
|
|
|
|
{ required: true, message: '请选择档案类型', trigger: 'change' }
|
2025-09-11 18:16:50 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
this.initFormData();
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
/** 初始化表单数据 */
|
2025-09-12 10:06:44 +08:00
|
|
|
|
async initFormData() {
|
|
|
|
|
|
await getFileCatalogSelectAPI().then(res => {
|
|
|
|
|
|
this.fileSetList = res.data;
|
|
|
|
|
|
});
|
2025-09-11 18:16:50 +08:00
|
|
|
|
if (this.isAdd === 'edit' && this.rowData) {
|
|
|
|
|
|
// 编辑模式:填充表单数据
|
|
|
|
|
|
this.form = {
|
2025-09-12 10:06:44 +08:00
|
|
|
|
id: undefined,
|
|
|
|
|
|
proId:this.rowData.id,
|
2025-09-11 18:16:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/*关闭弹窗 */
|
|
|
|
|
|
handleClose() {
|
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
|
this.$emit("closeDialog");
|
2025-09-29 14:18:40 +08:00
|
|
|
|
/* setTimeout(() => {
|
2025-09-11 18:16:50 +08:00
|
|
|
|
this.dialogVisible = true;
|
2025-09-29 14:18:40 +08:00
|
|
|
|
}); */
|
2025-09-11 18:16:50 +08:00
|
|
|
|
},
|
|
|
|
|
|
/**确认弹窗 */
|
|
|
|
|
|
sureBtnClick() {
|
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
|
|
this.$emit("closeDialog");
|
2025-09-29 14:18:40 +08:00
|
|
|
|
/* setTimeout(() => {
|
2025-09-11 18:16:50 +08:00
|
|
|
|
this.dialogVisible = true;
|
2025-09-29 14:18:40 +08:00
|
|
|
|
}); */
|
2025-09-11 18:16:50 +08:00
|
|
|
|
},
|
|
|
|
|
|
/**重置表单*/
|
|
|
|
|
|
reset() {
|
|
|
|
|
|
this.form = {
|
2025-09-12 10:06:44 +08:00
|
|
|
|
id: null,
|
|
|
|
|
|
proId:null,
|
2025-09-11 18:16:50 +08:00
|
|
|
|
};
|
|
|
|
|
|
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);
|
2025-09-12 10:06:44 +08:00
|
|
|
|
const selected = this.fileSetList.find(item => item.id === this.form.id);
|
|
|
|
|
|
params.contentsName = selected.name;
|
|
|
|
|
|
console.log(params);
|
2025-09-11 18:16:50 +08:00
|
|
|
|
|
2025-09-12 10:06:44 +08:00
|
|
|
|
updateContentsNameAPI(params).then(res => {
|
|
|
|
|
|
this.loading.close();
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.handleReuslt(res);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$modal.msgError(res.msg);
|
2025-09-11 18:16:50 +08:00
|
|
|
|
}
|
2025-09-12 10:06:44 +08:00
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
this.loading.close();
|
|
|
|
|
|
// this.$modal.msgError('提交失败,请重试');
|
|
|
|
|
|
});
|
2025-09-11 18:16:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
2025-09-22 10:50:09 +08:00
|
|
|
|
<style lang="scss" scoped>
|
2025-09-22 11:13:52 +08:00
|
|
|
|
.w700 ::v-deep .el-dialog {
|
2025-09-11 18:16:50 +08:00
|
|
|
|
width: 700px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-22 11:13:52 +08:00
|
|
|
|
.w500 ::v-deep .el-dialog {
|
2025-09-11 18:16:50 +08:00
|
|
|
|
width: 500px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-22 11:13:52 +08:00
|
|
|
|
.w500 ::v-deep .el-dialog__header,
|
|
|
|
|
|
.w700 ::v-deep .el-dialog__header {
|
2025-09-11 18:16:50 +08:00
|
|
|
|
// 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>
|