|
@@ -89,7 +89,7 @@
|
|
|
|
|
|
<!-- 添加或修改审查事项对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="850px" @close="cancel"
|
|
|
- :append-to-body="false">
|
|
|
+ @open="handleDialogOpen" append-to-body>
|
|
|
<el-form ref="formDataref" :model="formData" :rules="rules" label-width="80px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
@@ -210,8 +210,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 添加或修改问题对话框 -->
|
|
|
- <el-dialog title="问题题目配置" :visible.sync="addProblem" :close-on-click-modal="false" width="850px"
|
|
|
- :append-to-body="true">
|
|
|
+ <el-dialog title="问题题目配置" :visible.sync="addProblem" :close-on-click-modal="false" width="850px" append-to-body>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="addItem"
|
|
@@ -243,11 +242,17 @@
|
|
|
|
|
|
<!-- 添加或修改问题选项对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="problemopen" @close="cancelproblem" :close-on-click-modal="false"
|
|
|
- width="850px" :append-to-body="true">
|
|
|
+ width="850px" @open="handleDialogOpen" append-to-body>
|
|
|
<el-form ref="prblemformref" :model="prblemform" :rules="rulesproblem" label-width="80px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="问题题目" :prop="'title'" :rules="{required: true, message: '问题题目不能为空', trigger: 'blur'}">
|
|
|
+ <el-form-item label="问题题目" :prop="'title'" :rules="[{required: true, message: '问题题目不能为空', trigger: 'blur'},
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ transform: (value) => value && value.trim(),
|
|
|
+ message: '问题题目不能全部为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }]">
|
|
|
<el-input v-model="prblemform.title" type="textarea" placeholder="请输入问题题目" :maxlength="255"
|
|
|
:autosize="{minRows: 1, maxRows: 4}" :style="{width: '100%'}"></el-input>
|
|
|
</el-form-item>
|
|
@@ -266,14 +271,19 @@
|
|
|
<div style="border: 1px solid #ccc;margin-top:10px;padding: 10px;box-sizing: border-box;"
|
|
|
v-for="(domain, index) in prblemform.optionlist" :key="domain.key" v-if="prblemform.type===1">
|
|
|
<el-row>
|
|
|
- <el-col :span="14">
|
|
|
- <el-form-item :label="'选项'+(index+1)" :prop="'optionlist['+index+'].option'"
|
|
|
- :rules="{required: true, message: '选项不能为空', trigger: 'blur'}">
|
|
|
+ <el-col :span="13">
|
|
|
+ <el-form-item :label="'选项'+(index+1)" :prop="'optionlist['+index+'].option'" :rules="[{required: true, message: '选项不能为空', trigger: 'blur'},
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ transform: (value) => value && value.trim(),
|
|
|
+ message: '选项不能全部为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }]">
|
|
|
<el-input v-model="domain.option" placeholder="请输入选择选项" clearable :style="{width: '100%'}">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="10">
|
|
|
+ <el-col :span="11">
|
|
|
<el-form-item label="排序号" :prop="'optionlist['+index+'].number'"
|
|
|
:rules="[{required: true, message: '排序号不能为空', trigger: 'blur'}]">
|
|
|
<el-input v-model="domain.number" placeholder="请输入排序号(数字越大越靠前)" type="number"
|
|
@@ -323,7 +333,13 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="材料名称" :prop="'optionlist['+index+'].materialListPro['+indexp+'].listName'"
|
|
|
- :rules="{required: true, message: '材料名称不能为空', trigger: 'blur'}">
|
|
|
+ :rules="[{required: true, message: '材料名称不能为空', trigger: 'blur'},
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ transform: (value) => value && value.trim(),
|
|
|
+ message: '材料名称不能全部为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }]">
|
|
|
<el-input v-model="domainp.listName" placeholder="请输入材料名称" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -497,13 +513,33 @@
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
deptId: [
|
|
|
- { required: true, message: "请选择归属部门", trigger: "input" },
|
|
|
+ { required: true, message: "请选择归属部门", trigger: "input" }
|
|
|
],
|
|
|
itemName: [
|
|
|
{ required: true, message: "事项名称不能为空", trigger: "blur" },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ transform: (value) => value && value.trim(),
|
|
|
+ message: '事项名称不能全部为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ contacts: [{ required: true, message: "联系人不能为空", trigger: "blur" },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ transform: (value) => value && value.trim(),
|
|
|
+ message: '联系人不能全部为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ contactsPhone: [{ required: true, message: "联系电话不能为空", trigger: "blur" },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ transform: (value) => value && value.trim(),
|
|
|
+ message: '联系电话不能全部为空',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
],
|
|
|
- contacts: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
|
|
- contactsPhone: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
|
|
|
sort: [
|
|
|
{ type: 'number', required: true, message: "排序号不能为空", trigger: "blur" }],
|
|
|
prefixQuestion: [
|
|
@@ -529,6 +565,16 @@
|
|
|
this.getDeptTree();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleDialogOpen() {
|
|
|
+ // 使用Vue.nextTick确保DOM已经更新
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const dialogBody = document.getElementsByClassName("el-dialog__body");
|
|
|
+ console.log(dialogBody)
|
|
|
+ if (dialogBody) {
|
|
|
+ dialogBody[0].scrollTop = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
changedetId() {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.formDataref.validateField('deptId')
|
|
@@ -610,6 +656,7 @@
|
|
|
this.open = true;
|
|
|
this.title = "添加审查事项";
|
|
|
this.reset();
|
|
|
+ try { this.$refs.formDataref.clearValidate('deptId') } catch (e) { }
|
|
|
},
|
|
|
addItem() {
|
|
|
this.title = "添加问题题目"
|
|
@@ -620,6 +667,7 @@
|
|
|
handleDeploy(row) {
|
|
|
this.problemParams.matterId = row.id;
|
|
|
this.addProblem = true;
|
|
|
+ this.problemParams.pageNum = 1;
|
|
|
this.getPrblemList();
|
|
|
},
|
|
|
submitFormproblem() {
|
|
@@ -689,7 +737,6 @@
|
|
|
const ids = row.id || this.ids;
|
|
|
getMatter(ids).then((response) => {
|
|
|
var data = response.data;
|
|
|
- console.log(data)
|
|
|
var material = [];
|
|
|
if (data.material) {
|
|
|
var materialList = data.material.materialList;
|
|
@@ -704,7 +751,6 @@
|
|
|
this.materialList = material;
|
|
|
}
|
|
|
if (data.prefixQuestion == "Y") {
|
|
|
- console.log(data.prefixQuestion)
|
|
|
this.materialList = [{
|
|
|
customError: "",
|
|
|
listName: "",
|
|
@@ -797,7 +843,13 @@
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除所选择的数据项?').then(function () {
|
|
|
+ this.$confirm('是否确认删除所选择的数据项?', '提示', {
|
|
|
+ type: 'warning',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'custom-confirm-class',
|
|
|
+ closeOnClickModal: false // 设置为false表示点击modal区域不关闭
|
|
|
+ }).then(function () {
|
|
|
return delMatter(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
@@ -806,10 +858,21 @@
|
|
|
},
|
|
|
problemDelete(row) {
|
|
|
var matterId = row.id;
|
|
|
- delQuestion(matterId).then((response) => {
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
+ this.$confirm('是否确认删除所选择的数据项?', '提示', {
|
|
|
+ type: 'warning',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'custom-confirm-class',
|
|
|
+ closeOnClickModal: false // 设置为false表示点击modal区域不关闭
|
|
|
+ }).then(function () {
|
|
|
+ return delQuestion(matterId).then((response) => {
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ this.getPrblemList();
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
this.getPrblemList();
|
|
|
- });
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
@@ -880,21 +943,54 @@
|
|
|
this.$message.info("至少要有一个选项")
|
|
|
return;
|
|
|
}
|
|
|
- this.prblemform.optionlist.splice(itme, 1)
|
|
|
+ var _this = this;
|
|
|
+ this.$confirm('是否确认删除所选择的数据项?', '提示', {
|
|
|
+ type: 'warning',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'custom-confirm-class',
|
|
|
+ closeOnClickModal: false // 设置为false表示点击modal区域不关闭
|
|
|
+ }).then(function () {
|
|
|
+ return _this.prblemform.optionlist.splice(itme, 1)
|
|
|
+ }).then(() => {
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
reommaterialList(itme) {
|
|
|
if (this.materialList.length === 1) {
|
|
|
this.$message.info("至少要有一个材料")
|
|
|
return;
|
|
|
}
|
|
|
- this.materialList.splice(itme, 1)
|
|
|
+ var _this = this;
|
|
|
+ this.$confirm('是否确认删除所选择的数据项?', '提示', {
|
|
|
+ type: 'warning',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'custom-confirm-class',
|
|
|
+ closeOnClickModal: false // 设置为false表示点击modal区域不关闭
|
|
|
+ }).then(function () {
|
|
|
+ return _this.materialList.splice(itme, 1)
|
|
|
+ }).then(() => {
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
reommaterialListPro(itme, index) {
|
|
|
if (this.prblemform.optionlist[index].materialListPro.length === 1) {
|
|
|
this.$message.info("至少要有一个材料")
|
|
|
return;
|
|
|
}
|
|
|
- this.prblemform.optionlist[index].materialListPro.splice(itme, 1)
|
|
|
+ var _this = this;
|
|
|
+ this.$confirm('是否确认删除所选择的数据项?', '提示', {
|
|
|
+ type: 'warning',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ customClass: 'custom-confirm-class',
|
|
|
+ closeOnClickModal: false // 设置为false表示点击modal区域不关闭
|
|
|
+ }).then(function () {
|
|
|
+ return _this.prblemform.optionlist[index].materialListPro.splice(itme, 1)
|
|
|
+ }).then(() => {
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm: function () {
|
|
@@ -1069,4 +1165,12 @@
|
|
|
input[type="number"] {
|
|
|
-moz-appearance: textfield;
|
|
|
}
|
|
|
+
|
|
|
+ .el-input .el-input__suffix {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-select-dropdown.el-popper {
|
|
|
+ max-width: 600px;
|
|
|
+ }
|
|
|
</style>
|