Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9504ac13a9
@ -20,7 +20,7 @@ export function getQuestion(id) {
|
||||
// 新增问卷基本信息
|
||||
export function addQuestion(data) {
|
||||
return request({
|
||||
url: '/system/question',
|
||||
url: '/system/question/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@ -29,8 +29,8 @@ export function addQuestion(data) {
|
||||
// 修改问卷基本信息
|
||||
export function updateQuestion(data) {
|
||||
return request({
|
||||
url: '/system/question',
|
||||
method: 'put',
|
||||
url: '/system/question/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@ -227,17 +227,16 @@
|
||||
prop="serviceWayFrequencyList"
|
||||
:key="keyTable"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope">
|
||||
<!-- <div
|
||||
v-for="(itemx, index) in scope.row.serviceWayFrequencyList"
|
||||
:key="index"
|
||||
> -->
|
||||
<div v-if="scope.row.serviceWayFrequencyList[0].serviceFrequencyType == 'TEXT'">
|
||||
<!-- <div v-if="scope.row.serviceWayFrequencyList[0].serviceFrequencyType == 'TEXT'">
|
||||
<el-select
|
||||
size="mini"
|
||||
@click="getSuppliers()"
|
||||
@change="blurInputs()"
|
||||
|
||||
@change="blurInputs()"
|
||||
v-model="scope.row.valuePlusMax"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
@ -250,32 +249,43 @@
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div v-if="scope.row.serviceWayFrequencyList[0].serviceFrequencyType == 'DIGIT'">
|
||||
<el-select
|
||||
size="mini"
|
||||
@click="getSuppliers()"
|
||||
@change="blurInputs(scope.row.valuePlusMax)"
|
||||
|
||||
v-model="scope.row.valuePlusMax"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
|
||||
<!-- label里面就是展示的值 value是选中的 value是拼接的 这里处理一下为null的情况 为null咋显示呀以后应该不会有null 是必填的 那就先不用管了好-->
|
||||
<el-option
|
||||
v-for="item in scope.row.serviceWayFrequencyList"
|
||||
:key="item.id"
|
||||
:label="JSON.parse(item.serviceFrequencyStart) +
|
||||
</div> -->
|
||||
<!-- <div v-if="scope.row.serviceWayFrequencyList[0].serviceFrequencyType == 'DIGIT'"> -->
|
||||
<el-select
|
||||
size="mini"
|
||||
@click="getSuppliers()"
|
||||
@change="blurInputs(scope.row.valuePlusMax)"
|
||||
v-model="scope.row.valuePlusMax"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<!-- :label="item.serviceFrequencyType == 'TEXT'?item.serviceFrequencyText:JSON.parse(item.serviceFrequencyStart) +
|
||||
'~' +
|
||||
JSON.parse(item.serviceFrequencyEnd)"
|
||||
:value="
|
||||
item.id
|
||||
"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
JSON.parse(item.serviceFrequencyEnd)"
|
||||
-->
|
||||
<!-- label里面就是展示的值 value是选中的 value是拼接的-->
|
||||
|
||||
<!-- :label="item.serviceFrequencyType == 'TEXT'?item.serviceFrequencyText:JSON.parse(item.serviceFrequencyStart) +
|
||||
'~' +
|
||||
JSON.parse(item.serviceFrequencyEnd) : item.serviceFrequencyType == 'DIGIT'?"
|
||||
== text ? 不变 : ==big ?拼接的那个 :‘ ’ -->
|
||||
<el-option
|
||||
v-for="item in scope.row.serviceWayFrequencyList"
|
||||
:key="item.id"
|
||||
:label="
|
||||
item.serviceFrequencyType == 'TEXT'
|
||||
? item.serviceFrequencyText
|
||||
: item.serviceFrequencyType == 'DIGIT'
|
||||
? JSON.parse(item.serviceFrequencyStart) +
|
||||
'~' +
|
||||
JSON.parse(item.serviceFrequencyEnd)
|
||||
: ''
|
||||
"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
</template>
|
||||
|
||||
@ -336,19 +346,35 @@
|
||||
|
||||
<!-- 添加或修改服务方式内容对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="70px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<!-- <el-form-item label="服务方式名称" prop="serviceWayName">
|
||||
<el-input v-model="form.serviceWayName" placeholder="请输入服务方式名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务方式编码" prop="serviceWayCode">
|
||||
<el-input v-model="form.serviceWayCode" placeholder="请输入服务方式编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属服务方式id" prop="serviceWayId">
|
||||
<el-input v-model="form.serviceWayId" placeholder="请输入所属服务方式id" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="所属服务方式" prop="serviceWayId">
|
||||
<el-select
|
||||
v-model="form.serviceWayId"
|
||||
clearable
|
||||
:disabled="disableedit"
|
||||
placeholder="请选择服务方式"
|
||||
style="width: 250px"
|
||||
@change="change"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in DepartmentoList"
|
||||
:key="item.id"
|
||||
:label="item.serviceWayName"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="form.serviceWayId" placeholder="请输入所属服务方式id" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="服务内容" prop="serviceContent" label-width="80">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:disabled="disabledcontent"
|
||||
style="width: 400px"
|
||||
placeholder="请输入服务内容"
|
||||
v-model="form.serviceContent"
|
||||
@ -447,10 +473,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
disableedit:false,
|
||||
serviceFrequencyStart: "",
|
||||
serviceFrequencyEnd: "",
|
||||
serviceFrequencyType: "",
|
||||
// disabled: "",
|
||||
disabledcontent:false,
|
||||
titles: "",
|
||||
DIGIT: true,
|
||||
TEXT: false,
|
||||
@ -506,23 +534,24 @@ export default {
|
||||
serviceFrequencyType: [
|
||||
{ required: true, message: "请选中服务频次", trigger: "blur" },
|
||||
],
|
||||
serviceContent:[
|
||||
{ required: true, message: "请输入服务内容", trigger: "blur" },
|
||||
serviceContent: [
|
||||
{ required: true, message: "请输入服务内容", trigger: "blur" },
|
||||
],
|
||||
// serviceFrequencyEnd:[
|
||||
// { required: true, message: "请输入结束值", trigger: "blur" },
|
||||
// ],
|
||||
},
|
||||
itemname: null,
|
||||
serviceWayName: null,
|
||||
querydepartmen: {
|
||||
serviceWayName: "",
|
||||
},
|
||||
disabled: true,
|
||||
disabledb: false,
|
||||
disableda: false,
|
||||
valuePlus:'',
|
||||
serviceFrequencyText:'',
|
||||
keyTable:'',
|
||||
valuePlus: "",
|
||||
serviceFrequencyText: "",
|
||||
keyTable: "",
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -540,13 +569,10 @@ export default {
|
||||
console.log(e);
|
||||
},
|
||||
blurInput(val) {
|
||||
// this.servicewaycontentList.serviceFrequencyText=val
|
||||
|
||||
// this.servicewaycontentList.serviceFrequencyText=val
|
||||
},
|
||||
blurInputs() {
|
||||
this.keyTable = Math.random()
|
||||
// console.log(val, "666");
|
||||
// this.form.id = val;
|
||||
this.keyTable = Math.random();
|
||||
},
|
||||
textlist(e) {
|
||||
if (e == true) {
|
||||
@ -605,11 +631,15 @@ export default {
|
||||
this.DepartmentoList = response.data;
|
||||
// this.count=this.DepartmentoList.length
|
||||
console.log(this.DepartmentoList);
|
||||
|
||||
// this.Option
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
change(e) {
|
||||
console.log(e);
|
||||
// this.form.serviceWayId=e
|
||||
},
|
||||
// 左侧科室
|
||||
itemdata(item) {
|
||||
if (item) {
|
||||
@ -620,10 +650,12 @@ export default {
|
||||
// this.disabled=true
|
||||
// }
|
||||
this.itemname = item.id;
|
||||
this.serviceWayName = item.serviceWayName;
|
||||
this.form.serviceWayId = item.id;
|
||||
|
||||
// this.departmentName = item.serviceWayName;
|
||||
this.loading = true;
|
||||
this.queryParams.serviceWayId = item.id;
|
||||
this.form.serviceWayId=item.id
|
||||
this.getList();
|
||||
} else {
|
||||
this.queryParams.serviceWayId = "";
|
||||
@ -637,30 +669,26 @@ export default {
|
||||
listServicewaycontent(this.queryParams).then((response) => {
|
||||
this.servicewaycontentList = response.rows;
|
||||
// this.serviceFrequencyText= this.servicewaycontentList[0].serviceFrequencyText
|
||||
console.log(this.servicewaycontentList,'****')
|
||||
console.log(this.servicewaycontentList, "****");
|
||||
// if(e.serviceWayFrequencyList[0].serviceFrequencyType == 'TEXT'){
|
||||
this.servicewaycontentList.forEach((e) => {
|
||||
e.valuePlusMax = e.serviceWayFrequencyList[0].id
|
||||
e.valuePlusMax = e.serviceWayFrequencyList[0].id;
|
||||
});
|
||||
|
||||
// }
|
||||
// if(e.serviceWayFrequencyList[0].serviceFrequencyType == 'DIGIT'){
|
||||
// e.serviceFrequencyText = JSON.parse(e.serviceWayFrequencyList[0].serviceFrequencyStart) +
|
||||
// '~' +
|
||||
// JSON.parse(e.serviceWayFrequencyList[0].serviceFrequencyEnd)
|
||||
// }
|
||||
|
||||
// }
|
||||
// if(e.serviceWayFrequencyList[0].serviceFrequencyType == 'DIGIT'){
|
||||
// e.serviceFrequencyText = JSON.parse(e.serviceWayFrequencyList[0].serviceFrequencyStart) +
|
||||
// '~' +
|
||||
// JSON.parse(e.serviceWayFrequencyList[0].serviceFrequencyEnd)
|
||||
// }
|
||||
|
||||
// e.serviceWayFrequencyList[0].forEach(el=>{
|
||||
// console.log(el)
|
||||
// // this.serviceFrequencyText = el.serviceFrequencyText;
|
||||
|
||||
|
||||
// e.serviceWayFrequencyList[0].forEach(el=>{
|
||||
// console.log(el)
|
||||
// // this.serviceFrequencyText = el.serviceFrequencyText;
|
||||
|
||||
// })
|
||||
// })
|
||||
// this.serviceFrequencyText= this.servicewaycontentList[0].serviceFrequencyText
|
||||
|
||||
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@ -712,28 +740,46 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.disableedit=false
|
||||
this.disabledcontent=false
|
||||
console.log(this.itemname, "itemname");
|
||||
if (this.itemname) {
|
||||
this.form.serviceWayName = this.serviceWayName;
|
||||
this.form.serviceWayId = this.itemname;
|
||||
console.log(this.form, " this.form");
|
||||
}
|
||||
// else if (this.itemname == null) {
|
||||
// this.form.serviceWayId = "请选择服务方式"
|
||||
// }
|
||||
this.form.serviceFrequencyType = "DIGIT";
|
||||
this.open = true;
|
||||
this.title = "添加服务方式内容";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
console.log(row,'99999');
|
||||
this.disableedit=true
|
||||
this.disabledcontent=true
|
||||
console.log(row, "99999");
|
||||
this.reset();
|
||||
// const id = row.id
|
||||
getServicewaycontent(row.valuePlusMax).then((response) => {
|
||||
this.form = response.data;
|
||||
// this.form.serviceWayId=row.serviceWayId
|
||||
this.form.id = response.data.serviceFrequencyId;
|
||||
this.form.serviceWayId = response.data.serviceWayId;
|
||||
// ----------
|
||||
|
||||
if (response.data.serviceFrequencyType == "DIGIT") {
|
||||
this.DIGIT = true;
|
||||
this.TEXT = false;
|
||||
|
||||
}else{
|
||||
this.TEXT=true
|
||||
this.disableda = false;
|
||||
this.disabledb = false;
|
||||
this.disabled = true;
|
||||
} else {
|
||||
this.TEXT = true;
|
||||
this.DIGIT = false;
|
||||
|
||||
this.disableda = true;
|
||||
this.disabledb = true;
|
||||
this.disabled = false;
|
||||
}
|
||||
|
||||
// ---------------
|
||||
@ -744,42 +790,56 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
console.log(this.form)
|
||||
|
||||
this.$refs["form"].validate((valid) => {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.serviceFrequencyType=="DIGIT"&&this.form.serviceFrequencyStart==null&&this.form.serviceFrequencyEnd==null){
|
||||
this.$message.error("请输入服务频次起始值和结束值")
|
||||
}else if(this.form.serviceFrequencyType=="DIGIT"&&this.form.serviceFrequencyStart==null){
|
||||
this.$message.error("请输入服务频次起始值")
|
||||
|
||||
}else if(this.form.serviceFrequencyType=="DIGIT"&&this.form.serviceFrequencyEnd==null){
|
||||
this.$message.error("请输入服务频次结束值")
|
||||
|
||||
}else if(this.form.serviceFrequencyType=="TEXT"&&this.form.serviceFrequencyText==null){
|
||||
this.$message.error("请输入服务频次文本")
|
||||
|
||||
}else if(this.form.serviceFrequencyType!="TEXT"&&this.form.serviceFrequencyType!="DIGIT"){
|
||||
this.$message.error("请选择数字还是文本")}else{
|
||||
console.log(this.form.id, "555555");
|
||||
if (this.form.serviceContentId != null) {
|
||||
updateServicewaycontent(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
if (
|
||||
this.form.serviceFrequencyType == "DIGIT" &&
|
||||
this.form.serviceFrequencyStart == null &&
|
||||
this.form.serviceFrequencyEnd == null
|
||||
) {
|
||||
this.$message.error("请输入服务频次起始值和结束值");
|
||||
} else if (
|
||||
this.form.serviceFrequencyType == "DIGIT" &&
|
||||
this.form.serviceFrequencyStart == null
|
||||
) {
|
||||
this.$message.error("请输入服务频次起始值");
|
||||
} else if (
|
||||
this.form.serviceFrequencyType == "DIGIT" &&
|
||||
this.form.serviceFrequencyEnd == null
|
||||
) {
|
||||
this.$message.error("请输入服务频次结束值");
|
||||
} else if (
|
||||
this.form.serviceFrequencyType == "TEXT" &&
|
||||
this.form.serviceFrequencyText == null
|
||||
) {
|
||||
this.$message.error("请输入服务频次文本");
|
||||
} else if (
|
||||
this.form.serviceFrequencyType != "TEXT" &&
|
||||
this.form.serviceFrequencyType != "DIGIT"
|
||||
) {
|
||||
this.$message.error("请选择数字还是文本");
|
||||
} else {
|
||||
addServicewaycontent(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
console.log(this.form, "555555");
|
||||
console.log(this.form.serviceWayId);
|
||||
|
||||
if (this.form.serviceContentId != null) {
|
||||
updateServicewaycontent(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.mentlist();
|
||||
});
|
||||
} else {
|
||||
addServicewaycontent(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.mentlist();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
// 修改服务方式
|
||||
handleedit() {
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
<div class="options">
|
||||
<span>选项: </span>
|
||||
<div>
|
||||
<el-select v-model="item.optionNumber" placeholder="请选择"
|
||||
<el-select v-model="item.optionCount" placeholder="请选择"
|
||||
@change="selectchange($event, item)" style="padding-left:10px">
|
||||
<el-option v-for="item in optionlist" :key="item.value"
|
||||
:label="item.label" :value="item.value">
|
||||
@ -161,11 +161,11 @@
|
||||
</div>
|
||||
<div class="more">
|
||||
<el-radio-group>
|
||||
<el-radio :label="1" disabled v-if="item.optionNumber > 0">1</el-radio>
|
||||
<el-radio :label="2" disabled v-if="item.optionNumber > 1">2</el-radio>
|
||||
<el-radio :label="3" disabled v-if="item.optionNumber > 2">3</el-radio>
|
||||
<el-radio :label="4" disabled v-if="item.optionNumber > 3">4</el-radio>
|
||||
<el-radio :label="5" disabled v-if="item.optionNumber > 4">5</el-radio>
|
||||
<el-radio :label="1" disabled v-if="item.optionCount > 0">1</el-radio>
|
||||
<el-radio :label="2" disabled v-if="item.optionCount > 1">2</el-radio>
|
||||
<el-radio :label="3" disabled v-if="item.optionCount > 2">3</el-radio>
|
||||
<el-radio :label="4" disabled v-if="item.optionCount > 3">4</el-radio>
|
||||
<el-radio :label="5" disabled v-if="item.optionCount > 4">5</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
@ -237,7 +237,7 @@
|
||||
<span>选项: </span>
|
||||
<div>
|
||||
<div v-for="(uitem, uindex) in aitem.questionSubjectOptionList"
|
||||
:key="uindex" style="display:flex">
|
||||
:key="uindex" style="display:flex;margin-bottom:10px">
|
||||
<el-input placeholder="请输入内容" v-model="uitem.optionName"
|
||||
clearable>
|
||||
</el-input>
|
||||
@ -311,7 +311,7 @@
|
||||
<div class="options">
|
||||
<span>选项: </span>
|
||||
<div>
|
||||
<el-select v-model="aitem.optionNumber" placeholder="请选择"
|
||||
<el-select v-model="aitem.optionCount" placeholder="请选择"
|
||||
@change="selectchange($event, aitem)" style="padding-left:10px">
|
||||
<el-option v-for="yitem in optionlist" :key="yitem.value"
|
||||
:label="yitem.label" :value="yitem.value">
|
||||
@ -322,15 +322,15 @@
|
||||
<div class="more">
|
||||
<el-radio-group>
|
||||
<el-radio :label="1" disabled
|
||||
v-if="aitem.optionNumber > 0">1</el-radio>
|
||||
v-if="aitem.optionCount > 0">1</el-radio>
|
||||
<el-radio :label="2" disabled
|
||||
v-if="aitem.optionNumber > 1">2</el-radio>
|
||||
v-if="aitem.optionCount > 1">2</el-radio>
|
||||
<el-radio :label="3" disabled
|
||||
v-if="aitem.optionNumber > 2">3</el-radio>
|
||||
v-if="aitem.optionCount > 2">3</el-radio>
|
||||
<el-radio :label="4" disabled
|
||||
v-if="aitem.optionNumber > 3">4</el-radio>
|
||||
v-if="aitem.optionCount > 3">4</el-radio>
|
||||
<el-radio :label="5" disabled
|
||||
v-if="aitem.optionNumber > 4">5</el-radio>
|
||||
v-if="aitem.optionCount > 4">5</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
@ -384,7 +384,7 @@
|
||||
</div>
|
||||
<div class="totalScore">
|
||||
<div class="totalscore-title">
|
||||
总分:0分
|
||||
总分:{{ questionnaireTotalScore }}分
|
||||
</div>
|
||||
<div class="totalscore-title" style="font-size:14px">
|
||||
Q{{ questionitem.index + 1 }}
|
||||
@ -443,7 +443,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getQuestion } from "@/api/system/question";
|
||||
import { getQuestion, addQuestion, updateQuestion } from "@/api/system/question";
|
||||
import draggable from 'vuedraggable'
|
||||
export default {
|
||||
name: "addQuestionnaire",
|
||||
@ -514,7 +514,7 @@ export default {
|
||||
list: {
|
||||
questionnaireName: undefined,
|
||||
questionnaireDescription: undefined,
|
||||
questionnaireTotalScore: undefined, //总分
|
||||
questionnaireTotalScore: 0, //总分
|
||||
questionSubjectList: [],
|
||||
},
|
||||
//题目arr
|
||||
@ -545,15 +545,45 @@ export default {
|
||||
watch: {
|
||||
},
|
||||
created() {
|
||||
if(this.$route.query.id){
|
||||
if (this.$route.query.id) {
|
||||
this.info();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
questionnaireTotalScore: function () {
|
||||
var score = 0
|
||||
this.questionlist.forEach(e => {
|
||||
if (!e.list) {
|
||||
if (e.questionSubjectOptionList.length > 0) {
|
||||
e.questionScore = e.questionSubjectOptionList[0].optionScore
|
||||
e.questionSubjectOptionList.forEach(el => {
|
||||
if (el.optionScore > e.questionScore) {
|
||||
e.questionScore = el.optionScore
|
||||
}
|
||||
})
|
||||
score += e.questionScore
|
||||
}
|
||||
} else {
|
||||
e.list.forEach(el => {
|
||||
el.questionScore = el.questionSubjectOptionList[0].optionScore
|
||||
el.questionSubjectOptionList.forEach(ele => {
|
||||
if (ele.optionScore > el.questionScore) {
|
||||
el.questionScore = ele.optionScore
|
||||
}
|
||||
})
|
||||
score += el.questionScore
|
||||
})
|
||||
}
|
||||
})
|
||||
this.list.questionnaireTotalScore = score
|
||||
return score
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
addquestion(item) {
|
||||
this.id++
|
||||
if (this.questionlist.length > 0) {
|
||||
if (this.questionlist[this.questionlist.length - 1].questionName == '') {
|
||||
if (this.questionlist[this.questionlist.length - 1].questionName == '' || this.questionlist[this.questionlist.length - 1].questionDescription == '') {
|
||||
return this.$message.error('请填写完在继续添加');
|
||||
}
|
||||
}
|
||||
@ -569,7 +599,6 @@ export default {
|
||||
disabled: false,
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
optionCount: 0, //选项个数
|
||||
questionSubjectOptionList: [{
|
||||
optionid: ++this.optionid,
|
||||
optionName: '',
|
||||
@ -640,6 +669,7 @@ export default {
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
disabled: false,
|
||||
optionCount: '',
|
||||
//计分方式
|
||||
scoringMethod: '',
|
||||
questionSubjectOptionList: [],
|
||||
@ -828,7 +858,7 @@ export default {
|
||||
id: this.id++,
|
||||
questionName: '',
|
||||
questionDescription: '',
|
||||
optionNumber: '',
|
||||
optionCount: '',
|
||||
title: '打分题',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
@ -840,7 +870,7 @@ export default {
|
||||
questionType: 'COMBINATION_SCORING_SUBJECT',
|
||||
id: this.id++,
|
||||
questionDescription: '',
|
||||
optionNumber: '',
|
||||
optionCount: '',
|
||||
questionName: '',
|
||||
title: '打分题',
|
||||
//是否计分
|
||||
@ -861,7 +891,6 @@ export default {
|
||||
title: '日期填空题',
|
||||
//是否计分
|
||||
whetherScore: false,
|
||||
optionCount: 0, //选项个数
|
||||
disabled: true,
|
||||
})
|
||||
} else if (item.id == 'TIME_BLANKS_SUBJECT') {
|
||||
@ -872,7 +901,6 @@ export default {
|
||||
questionName: '',
|
||||
title: '时间填空题',
|
||||
//是否计分
|
||||
optionCount: 0, //选项个数
|
||||
whetherScore: false,
|
||||
disabled: true,
|
||||
})
|
||||
@ -991,11 +1019,71 @@ export default {
|
||||
this.list.questionSubjectList.push(e)
|
||||
}
|
||||
})
|
||||
console.log(this.list)
|
||||
this.list.questionSubjectList.forEach(e => {
|
||||
e.questionNumber = Number(e.questionNumber)
|
||||
e.questionSubjectOptionList.forEach(el => {
|
||||
el.questionNumber = Number(el.questionNumber)
|
||||
})
|
||||
})
|
||||
this.list.questionCount = this.questionlist.length
|
||||
if (this.$route.query.id) {
|
||||
updateQuestion(this.list).then(res => {
|
||||
|
||||
})
|
||||
} else {
|
||||
addQuestion(this.list).then(res => {
|
||||
})
|
||||
}
|
||||
},
|
||||
info() {
|
||||
getQuestion(this.$route.query.id).then(res => {
|
||||
|
||||
this.list = res.data
|
||||
res.data.questionSubjectList.forEach(e => {
|
||||
if (e.questionType == 'MULTIPLE_CHOICE') {
|
||||
e.title = '单选题'
|
||||
this.questionlist.push(e)
|
||||
} else if (e.questionType == 'MULTIPLE_CHOICE_QUESTIONS') {
|
||||
e.title = '多选题'
|
||||
this.questionlist.push(e)
|
||||
} else if (e.questionType == 'FILL_IN_THE_BLANKS') {
|
||||
e.title = '填空题'
|
||||
this.questionlist.push(e)
|
||||
} else if (e.questionType == 'SCORING_QUESTIONS') {
|
||||
e.title = '打分题'
|
||||
this.questionlist.push(e)
|
||||
} else if (e.questionType == 'DATE_BLANKS_SUBJECT') {
|
||||
e.title = '日期填空题'
|
||||
this.questionlist.push(e)
|
||||
} else if (e.questionType == 'TIME_BLANKS_SUBJECT') {
|
||||
e.title = '时间填空题'
|
||||
this.questionlist.push(e)
|
||||
} else if (e.questionType == 'COMBINATION_RADIO_SUBJECT') {
|
||||
e.title = '单选题'
|
||||
} else if (e.questionType == 'COMBINATION_MULTIPLE_SUBJECT') {
|
||||
e.title = '多选题'
|
||||
} else if (e.questionType == 'COMBINATION_BLANKS_SUBJECT') {
|
||||
e.title = '填空题'
|
||||
} else if (e.questionType == 'COMBINATION_SCORING_SUBJECT') {
|
||||
e.title = '打分题'
|
||||
}
|
||||
})
|
||||
var data = res.data.questionSubjectList
|
||||
var echararr = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var arrindex = echararr.findIndex((item, index, arr) => { return item.questionDescription === data[i].questionDescription })//获取下标
|
||||
if (arrindex == -1) {//不存在盘符数据的添加盘符数据
|
||||
echararr.push({
|
||||
title: data[i].questionType == 'COMBINATION_RADIO_SUBJECT' ? '组合单选题' : data[i].questionType == 'COMBINATION_MULTIPLE_SUBJECT' ? '组合多选题' : data[i].questionType == 'COMBINATION_BLANKS_SUBJECT' ? '组合填空题' : data[i].questionType == 'COMBINATION_SCORING_SUBJECT' ? '组合打分题' : '',
|
||||
questionType: data[i].questionType,
|
||||
id: this.id++,
|
||||
questionDescription: data[i].questionDescription,
|
||||
list: [data[i]]
|
||||
});
|
||||
} else {//有盘符则往盘符数据中添加
|
||||
echararr[arrindex].list.push(data[i])
|
||||
}
|
||||
}
|
||||
this.questionlist = [...this.questionlist, ...echararr]
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
@ -642,8 +642,8 @@ export default {
|
||||
agencyName: [
|
||||
{ required: true, message: "机构名称能为空", trigger: "blur" },
|
||||
],
|
||||
// areaCode:[{ required: true, message: "行政区划不能为空", trigger: "blur" },
|
||||
// ],
|
||||
areaCode:[{ required: true, message: "行政区划不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
treeOptionsagencyCategoryId: [],
|
||||
treeOptions: [],
|
||||
@ -747,7 +747,7 @@ export default {
|
||||
|
||||
//点击街道
|
||||
clickstreet(item) {
|
||||
// this.form.areaCode = item.areaCode;
|
||||
this.form.communityName =''
|
||||
getSecondaryLevelInfo(item.id).then((res) => {
|
||||
this.streetlists = res.data;
|
||||
});
|
||||
@ -760,6 +760,9 @@ export default {
|
||||
clickarea(item) {
|
||||
this.form.areaCode = "";
|
||||
this.form.streetCode = "";
|
||||
// this.form.streetName=''
|
||||
this.form.communityCode =''
|
||||
|
||||
getSecondaryLevelInfo(item.id).then((res) => {
|
||||
this.streetlist = res.data;
|
||||
});
|
||||
@ -769,6 +772,10 @@ export default {
|
||||
this.form.regionName = "";
|
||||
this.form.areaCode = "";
|
||||
this.form.streetCode = "";
|
||||
this.form.streetName = "";
|
||||
this.form.communityCode =''
|
||||
|
||||
|
||||
getSecondaryLevelInfo(item.id).then((res) => {
|
||||
this.arealist = res.data;
|
||||
});
|
||||
@ -782,7 +789,8 @@ export default {
|
||||
//点击省
|
||||
province(item) {
|
||||
this.form.cityName = "";
|
||||
this.form.streeName = "";
|
||||
// this.form.streeName = "";
|
||||
// this.form.communityCode =''
|
||||
|
||||
this.form.areaName = "";
|
||||
this.form.communityName = "";
|
||||
|
||||
@ -154,6 +154,9 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$router.push({
|
||||
path: "/question/addQuestionnaire",
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user