dzl vor 10 Monaten
Ursprung
Commit
53d85a6630

+ 8 - 0
src/api/xiehui/jxjy/PaperInfo.js

@@ -58,4 +58,12 @@ export function searchClNum(data){
 		url:"/jxjy/PaperPolicy/questCatagoryCount",
 		params:data,
 	})
+}
+
+
+//试卷预览
+export function previewSj(id){
+	return request({
+		url:"/system/PaperInfo/previewPaper?id="+id
+	})
 }

+ 35 - 7
src/views/xiehui/jxjy/PaperInfo/index.vue

@@ -51,15 +51,17 @@
 			<el-table-column label="试卷总分" align="center" prop="PaperMark" />
 			<el-table-column label="创建日期" align="center" prop="CreateDate" width="180">
 				<template slot-scope="scope">
-					<span>{{ parseTime(scope.row.CreateDate, '{y}-{m}-{d}') }}</span>
+					<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
 				</template>
 			</el-table-column>
 			<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 				<template slot-scope="scope">
 					<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
-						v-hasPermi="['system:PaperInfo:edit']">修改</el-button>
+						>修改</el-button>
+					<el-button size="mini" type="text" icon="el-icon-view" @click="yvlan(scope.row)"
+						 >预览</el-button>
 					<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-						v-hasPermi="['system:PaperInfo:remove']">删除</el-button>
+						>删除</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -127,8 +129,8 @@
 								<el-option label="使用题库中试题分数,将总分折算为试卷总分" value="1"></el-option>
 							</el-select> -->
 							<el-radio-group v-model="form.MarkDefine">
-								<el-radio value="2" label="2">忽略题库中试题分数,按题型指定分数折算</el-radio>
-								<el-radio value="1"  label="1">使用题库中试题分数,将总分折算为试卷总分</el-radio>
+								<el-radio value="2" :label="2">忽略题库中试题分数,按题型指定分数折算</el-radio>
+								<el-radio value="1"  :label="1">使用题库中试题分数,将总分折算为试卷总分</el-radio>
 							</el-radio-group>
 						</el-form-item>
 					</el-col>
@@ -346,7 +348,8 @@
 		addPaperInfo,
 		updatePaperInfo,
 		delCl,
-		searchClNum
+		searchClNum,
+		previewSj
 	} from "@/api/xiehui/jxjy/PaperInfo";
 
 	export default {
@@ -567,6 +570,9 @@
 										index = i
 									}
 								}) 
+								if(this.form.PaperID != null){
+									typeObj.PaperID = this.form.PaperID
+								}
 								if(index == -1){
 									this.form.paperTestType.push(typeObj)
 								}else{
@@ -578,6 +584,8 @@
 							}
 						})
 					
+					}else{
+						this.form.paperTestType = []
 					}
 				},  
 				// 可选的其他选项  
@@ -619,7 +627,7 @@
 					AutoSave: 0,
 					ExamAccount: null,
 					ManagerAccount: null,
-					TestCount: null,
+					TestCount: 0,
 					AutoJudge: null,
 					CreateWay: null,
 					CreateUserID: null,
@@ -681,6 +689,7 @@
 							if(item.TestTypeOrder == null ){
 								item.TestTypeOrder = index+1
 							}
+							this.form.TestCount += Number(item.TestAmount)
 						})
 						if (this.form.PaperID != null) {
 							updatePaperInfo(this.form).then(response => {
@@ -783,6 +792,25 @@
 				this.clIndex = index
 				this.searchNum()
 				this.clShow = true
+			},
+			//删除试题策略
+			shanchu(row,index){
+				if(row.PaperID != null){
+					this.$modal.confirm('确定要删除选择策略吗?').then(function() {
+						return delCl(row.PaperPolicyID);
+					}).then(() => {
+						this.form.paperPolicy.splice(index,1)
+						this.$modal.msgSuccess("删除成功");
+					}).catch(() => {});
+				}else{
+					this.form.paperPolicy.splice(index,1)
+				}
+			},
+			//预览试卷
+			yvlan(row){
+				previewSj(row.PaperID).then(res=>{
+					
+				})
 			}
 		}
 	};

+ 73 - 7
src/views/xiehui/jxjy/Training/index.vue

@@ -168,20 +168,20 @@
 					<el-col :span="24">
 						<el-form-item label="配置课程" prop="Undef1">
 							<el-input v-model="form.Undef1" placeholder="请输入内容" style="width: 60%;" >
-								<el-button slot="append" @click="chooseClass">配置课程</el-button>
+								<el-button slot="append" readonly @click="chooseClass">配置课程</el-button>
 							</el-input>
 						</el-form-item>
 					</el-col>
 					<el-col :span="24">
-						<el-form-item label="配置考试" prop="QiciYear">
-							<el-input v-model="form.ZYIdList" placeholder="请输入内容" style="width: 60%;">
-								<el-button slot="append">配置考试</el-button>
+						<el-form-item label="配置考试" prop="Undef2">
+							<el-input v-model="form.Undef2" readonly placeholder="请输入内容" style="width: 60%;">
+								<el-button slot="append"  @click="chooseSj">配置考试</el-button>
 							</el-input>
 						</el-form-item>
 					</el-col>
 					<el-col :span="24">
-						<el-form-item label="培训分院范围及参训人员分配" prop="QiciYear">
-							<el-input v-model="form.ZYIdList" type="textarea" placeholder="请输入内容" />
+						<el-form-item label="培训分院范围及参训人员分配" prop="TContent">
+							<el-input v-model="form.TContent" type="textarea" placeholder="请输入内容" />
 						</el-form-item>
 					</el-col>
 					<el-col :span="6">
@@ -224,7 +224,7 @@
 				<el-button @click="cancel">取 消</el-button>
 			</div>
 		</el-dialog>
-		<el-dialog title="提示" :visible.sync="classShow" width="50vw" >
+		<el-dialog title="课程列表" :visible.sync="classShow" width="50vw" >
 			<el-table ref="classList" v-loading="classLoading" :data="classList" @selection-change="classChange">
 				<el-table-column type="selection" width="55" align="center" />
 				<el-table-column label="课程名称" align="center" prop="ClassName" width="350px" />
@@ -256,6 +256,28 @@
 				<el-button @click="classShow = false">取 消</el-button>
 			</span>
 		</el-dialog>
+		<el-dialog title="试卷列表" :visible.sync="sjShow" width="50vw" >
+			<el-table v-loading="sjLoading" ref="sjList" :data="sjList" @selection-change="sjChange">
+				<el-table-column type="selection" width="55" align="center" />
+				<el-table-column label="试卷名称" align="center" prop="PaperName" width="300px" />
+				<!-- <el-table-column label="注册专业分类" align="center" prop="ProduceWay">
+					<template slot-scope="scope">
+						<dict-tag :options="dict.type.jxjy_zhuanye" :value="scope.row.SubjectID" />
+					</template>
+				</el-table-column> -->
+				<el-table-column label="几个分数" align="center" prop="PassMark" />
+				<el-table-column label="试卷总分" align="center" prop="PaperMark" />
+				<el-table-column label="创建日期" align="center" prop="CreateDate" width="180">
+					<template slot-scope="scope">
+						<span>{{ parseTime(scope.row.CreateDate, '{y}-{m}-{d}') }}</span>
+					</template>
+				</el-table-column>
+			</el-table>
+			<span slot="footer" class="dialog-footer">
+				<el-button type="primary" :disabled="selectSjIds.length>1" @click="sjConfiem">确 定</el-button>
+				<el-button @click="sjShow = false">取 消</el-button>
+			</span>
+		</el-dialog>
 	</div>
 </template>
 
@@ -270,6 +292,9 @@
 	import {
 		listClass
 	} from "@/api/xiehui/jxjy/kcgl";
+	import {
+		listPaperInfo
+	} from "@/api/xiehui/jxjy/PaperInfo";
 	export default {
 		name: "Training",
 		dicts: ['jxjy_zhuanye','jxjy_pxzy','jxjy_kclx'],
@@ -362,6 +387,11 @@
 						message: '请配置课程',
 						trigger: ['blur', 'change']
 					},
+					Undef2:{
+						required: true,
+						message: '请配置考试',
+						trigger: ['blur', 'change']
+					},
 					StartDate:{
 						required: true,
 						message: '请选择报名开始时间',
@@ -395,6 +425,12 @@
 				selectIds:[],//被选中的课程列表
 				selectNames:[],//被选中的课程列表
 				classShow:false,
+				//试卷列表
+				sjLoading:false,
+				sjList:[],
+				selectSjIds:[],//被选中的课程列表
+				selectSjNames:[],//被选中的课程列表
+				sjShow:false,
 			};
 		},
 		created() {
@@ -578,6 +614,36 @@
 				}
 				this.$refs["form"].validateField("Undef1")
 				this.classShow = false
+			},
+			//试卷配置
+			chooseSj(){
+				this.sjLoading = true;
+				this.selectSjIds = []
+				this.selectSjNames = []
+				listPaperInfo({pageNum:1,pageSize:100}).then(response => {
+					this.sjList = response.rows;
+					this.sjShow = true
+					if(this.form.ECId !== null && this.form.ECId !== "" ){
+						setTimeout(()=>{
+							let index = this.sjList.findIndex(obj=> obj.PaperID == this.form.ECId)
+							this.$refs.sjList.toggleRowSelection(this.sjList[index]);
+						},500)
+						
+					}
+					this.sjLoading = false;
+				});
+			},
+			sjChange(selection){
+				this.selectSjIds = selection.map(item => item.PaperID)
+				this.selectSjNames = selection.map(item => item.PaperName)
+			},
+			sjConfiem(){
+				if(this.selectSjIds.length>0){
+					this.form.ECId = this.selectSjIds.join(",")
+					this.form.Undef2 = this.selectSjNames.join(",")
+				}
+				this.$refs["form"].validateField("Undef2")
+				this.sjShow = false
 			}
 		}
 	};