From edb5616505a118523882a83f53f00e88d03bd373 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期一, 20 五月 2024 12:07:51 +0800 Subject: [PATCH] qxtj --- src/views/hosp/surveyTemplate/index.vue | 200 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 132 insertions(+), 68 deletions(-) diff --git a/src/views/hosp/surveyTemplate/index.vue b/src/views/hosp/surveyTemplate/index.vue index 14c0dc5..e0c6917 100644 --- a/src/views/hosp/surveyTemplate/index.vue +++ b/src/views/hosp/surveyTemplate/index.vue @@ -194,59 +194,98 @@ /> </el-select> </el-form-item> + <el-form-item label="澶囨敞" prop="remark"> <el-input v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" /> </el-form-item> - <div v-if="DaTianYa == false"> - <el-divider content-position="center">闂嵎妯℃澘闂淇℃伅</el-divider> - <el-row :gutter="10" class="mb8"> - <el-col :span="1.5"> - <el-button - type="primary" - icon="el-icon-plus" - size="mini" - @click="addmembers()" - >娣诲姞 - </el-button> - </el-col> - <el-col :span="1.5"> - <el-button - type="danger" - icon="el-icon-delete" - size="mini" - @click.native.prevent="Delete()" - >鍒犻櫎 - </el-button> - </el-col> - </el-row> - <el-table - style="width: 450px" - border - :data="form.tjSurveyTempQuesList" - @selection-change="handleTjSurveyTempQuesSelectionChange" - > - <el-table-column type="selection" width="40" align="center" /> - <el-table-column label="闂id" prop="qid" width="179"> - <template slot-scope="scope"> - <el-input v-model="scope.row.qid" placeholder="璇疯緭鍏ラ棶棰榠d" /> - </template> - </el-table-column> - <el-table-column label="闂鍚�" prop="qname" width="190"> - <template slot-scope="scope"> - <el-input - v-model="scope.row.qname" - placeholder="璇疯緭鍏ラ棶棰樺悕" - /> - </template> - </el-table-column> - </el-table> - </div> </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> <el-button @click="cancel">鍙� 娑�</el-button> </div> </el-dialog> + <!-- 闂嵎璇︽儏鎶藉眽 --> + <el-drawer + title="闂嵎璇︽儏" + :visible.sync="drawer" + :with-header="true" + size="40%" + > + <el-form + v-for="(item, index) in intList" + :key="index" + style="margin-left: 15px" + > + <el-form-item> + <span + style="color: red; margin-left: 5px" + v-if="item.isRequired == 'Y'" + >*</span + > + {{ index + 1 > 9 ? index + 1 : "0" + (index + 1) }}.{{ + item.question + }} + <span v-if="item.type == '0'">(鍗曢��)</span> + <span v-if="item.type == '1'">(澶氶��)</span><br /> + <label + v-for="(item5, index) in item.tjSurveyOptionsList" + :key="index" + > + <!-- <img v-show="item.type == '1'" v-if="item5.qid ==item.qid" class="select-radio" src="../../../assets/images/weixuanzhong.png" alt=""> + <img v-show="item.type == '1'" v-else class="select-radio1" src="../../../assets/images/xuanzhong.png" alt=""> --> + <input + v-show="item.type == '0'" + type="radio" + :name="item5.qid" + :value="item5.oid" + /><label class="inp" v-show="item.type == '0'">{{ + item5.ooption + }}</label> + <input + v-show="item.type == '1'" + type="checkbox" + :name="item5.qid" + :value="item5.oid" + /><label class="inp" v-show="item.type == '1'">{{ + item5.ooption + }}</label> + <el-rate + v-show="item.type == '2'" + v-model="myscore" + show-text + ></el-rate> + <el-input + v-show="item.type == '3'" + v-model="inpu" + style="width: 280px" + /> + <!-- <el-date-picker + v-show="item.type == '4'" + v-model="value2" + align="right" + type="date" + placeholder="閫夋嫨鏃ユ湡" + :picker-options="pickerOptions" + > + </el-date-picker> --> + <!-- <el-input-number + v-show="item.type == '5'" + v-model="num" + :min="1" + :max="10000" + ></el-input-number> + <el-input-number + v-show="item.type == '6'" + v-model="numf" + :precision="2" + :step="0.0" + :max="10000" + ></el-input-number> --> + </label> + </el-form-item> + </el-form> + <!-- <el-button type="primary" size="mini" @click="tijiao">鎻愪氦</el-button> --> + </el-drawer> <el-drawer :visible.sync="previewDialogVisible" :before-close="handleClose" @@ -269,6 +308,7 @@ getneedDesign, getcanDelete, updateQybz, + getQuesByMid } from "@/api/hosp/surveyTemplate"; import { Message } from "element-ui"; export default { @@ -292,10 +332,14 @@ } }; return { + inpu:"", + num: 0, + myscore: null, // 閬僵灞� loading: true, + drawer:false, previewKey: +new Date(), - previewDialogVisible:false, + previewDialogVisible: false, // 閫変腑鏁扮粍 ids: [], // 瀛愯〃閫変腑鏁版嵁 @@ -315,6 +359,7 @@ selectionList: [], // 寮瑰嚭灞傛爣棰� title: "", + intList: [], // 鏄惁鏄剧ず寮瑰嚭灞� open: false, DaTianYa: false, @@ -404,6 +449,7 @@ handleAdd() { this.reset(); this.title = "娣诲姞闂嵎妯℃澘"; + getneedDesign().then((res) => { if (res.msg == "false") { this.DaTianYa = false; @@ -443,7 +489,6 @@ if (!that.selectionList) { that.$modal.msgSuccess("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁"); } else { - console.log(that.form.tjSurveyTempQuesList); that.selectionList.forEach((item) => { that.form.tjSurveyTempQuesList.forEach((item1, index) => { if (item.qid == item1.qid) { @@ -454,17 +499,31 @@ } }, xiangqing(row) { - const mid = row.mid + const mid = row.mid; getSurveyTemplate(mid).then((response) => { - if (response.data.designId == null) { - - } else { - this.$router.push({ - query: { key:response.data.designId}, - }); - this.previewDialogVisible = true; - } - }) + if (response.data.designId == null) { + this.drawer = true; + getQuesByMid(mid) + .then((res) => { + res.data.sort( + (a, b) => + new Date(a.createTime).getTime() - + new Date(b.createTime).getTime() + ); //杩欐槸鍗囧簭锛屽�掑簭鐨勮瘽缈昏繃鏉� + this.intList = res.data; + + }) + .catch((err) => { + // 閫氳繃catch鎹曡幏閿欒娑堟伅 + return err; + }); + } else { + this.$router.push({ + query: { key: response.data.designId }, + }); + this.previewDialogVisible = true; + } + }); }, handleClose() { this.reload(); @@ -487,22 +546,23 @@ /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.reset(); + const mid = row.mid || this.ids; getSurveyTemplate(mid).then((response) => { this.form = response.data; if (response.data.tjSurveyTempQuesList.length >= 1) { this.form.tjSurveyTempQuesList = response.data.tjSurveyTempQuesList; } - if ( this.form.designId == null) { - this.DaTianYa = false; - this.title = "淇敼闂嵎妯℃澘"; - this.open = true; - } else { - this.DaTianYa = true; - this.form.formKey = this.form.designId; - this.form.type = 1; - this.toProjectHandle(this.form, "editor"); - } + if (this.form.designId == null) { + this.DaTianYa = false; + this.title = "淇敼闂嵎妯℃澘"; + this.open = true; + } else { + this.DaTianYa = true; + this.form.formKey = this.form.designId; + this.form.type = 1; + this.toProjectHandle(this.form, "editor"); + } }); }, /** 鎻愪氦鎸夐挳 */ @@ -517,8 +577,12 @@ }); } else { addSurveyTemplate(this.form).then((response) => { - // this.$modal.msgSuccess("鏂板鎴愬姛"); - this.toProjectHandle(response.data, "editor"); + if (this.DaTianYa == false) { + this.$modal.msgSuccess("鏂板鎴愬姛"); + } else { + this.toProjectHandle(response.data, "editor"); + } + this.open = false; this.getList(); }); -- Gitblit v1.8.0