From 708a208e87e4e580d7a80c7f8b2c11f25dec7ff2 Mon Sep 17 00:00:00 2001 From: qx <2540746708@qq.com> Date: 星期五, 15 十二月 2023 20:50:54 +0800 Subject: [PATCH] qxtj --- src/views/hosp/history/index.vue | 73 +++++++++++++++++++++++------------- 1 files changed, 46 insertions(+), 27 deletions(-) diff --git a/src/views/hosp/history/index.vue b/src/views/hosp/history/index.vue index 9645e50..d871618 100644 --- a/src/views/hosp/history/index.vue +++ b/src/views/hosp/history/index.vue @@ -255,12 +255,12 @@ <el-input size="mini" v-model="scope.row.workType" placeholder="璇疯緭鍏ュ伐绉�" /> </template> </el-table-column> - <el-table-column label="鏈夊鍥犵礌" prop="workLogs"> + <el-table-column label="鏈夊鍥犵礌" prop="harmTypeLogs"> <template slot-scope="scope"> <!-- <el-input v-model="scope.row.isOk" placeholder="璇疯緭鍏ユ槸鍚︾棅鎰�" /> --> - <el-select filterable size="mini" v-model="scope.row.workLogs" placeholder="璇烽�夋嫨鏈夊鍥犵礌" clearable> - <el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label" - :value="dict.value" /> + <el-select filterable size="mini" v-model="scope.row.harmTypeLogs" multiple placeholder="璇烽�夋嫨鏈夊鍥犵礌" clearable> + <el-option v-for="dict in harmTypeList" :key="dict.aid" :label="dict.harmType" + :value="dict.aid" /> </el-select> </template> </el-table-column> @@ -293,13 +293,27 @@ } from "@/api/hosp/history"; import { Message } from "element-ui"; import { getOrderList } from "@/api/hosp/order"; - +import { + listHarmType, +} from "@/api/hosp/harmType"; export default { name: "History", dicts: ["tj_smoking_pinlv", "sys_yes_no", "tj_work_status", "tj_work", "dict_ageunit", "dict_job"], data() { + let checkPhoneNum = (rule, value, callback) => { + console.log( value) + let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/); + if (value == "" && value == undefined && !value) { + return callback(''); + } else if(value != undefined && value != ""){ + return callback(); + }else if (!patter.test(value)) { + return callback(''); + } + }; return { selectList: [], + dataList:[], pickerOptions: { disabledDate(time) { return time.getTime() > Date.now(); @@ -362,6 +376,7 @@ pageSize: 20, cusName: null, }, + harmTypeList:[], // 琛ㄥ崟鍙傛暟 form: {}, chageall: [], @@ -372,7 +387,7 @@ deleted: [ { required: true, - message: "$comment涓嶈兘涓虹┖", + validator: checkPhoneNum, trigger: "blur", }, ], @@ -401,6 +416,10 @@ /** 鏌ヨ浣撴璁板綍鍒楄〃 */ getList() { this.loading = true; + listHarmType().then(response => { + this.harmTypeList = response.rows; + this.loading = false; + }); getOrderList(this.queryParams).then((response) => { this.orderList = response.data.list; if (this.orderList) { @@ -417,7 +436,9 @@ this.orderList[0], true ); + }); + this.dataList = this.orderList[0] } else { this.$refs.multipleTable.clearSelection(); } @@ -480,6 +501,7 @@ }, // 鍗曢�夋閫変腑鏁版嵁 handleSelectionChange(selection) { + this.dataList = [] this.selectList = selection; // this.ids = selection.map((item) => item.askId); // this.single = selection.length !== 1; @@ -501,8 +523,8 @@ this.sex = false; } }) - let userId = selection.map((item) => item.userId); - getInfoById(userId).then((response) => { + let tjNumber = selection.map((item) => item.tjNumber); + getInfoById(tjNumber).then((response) => { this.form = response.data; if (this.form.xiyan == null) { this.form.xiyan = "1" @@ -570,18 +592,18 @@ }, delemembers() { - this.form.tjAskHistorysList.forEach((item, index) => { - this.bingshiall.forEach((item1, index1) => { - if (item.id == item1.id) { - if (this.bingshiall.length == 1) { - this.form.tjAskHistorysList.splice(index, 1) - } else { - this.form.tjAskHistorysList.splice(index, index1) + let that = this + if (that.form.tjAskHistorysList.length == that.bingshiall.length) { + that.form.tjAskHistorysList = [] + } else { + that.bingshiall.forEach((item1, index1) => { + that.form.tjAskHistorysList.forEach((item, index) => { + if (item == item1) { + that.form.tjAskHistorysList.splice(index, 1) } - - } + }) }) - }) + } }, @@ -590,30 +612,29 @@ if (!this.form.workLogs) { this.form.workLogs = []; this.form.workLogs.push({ - id: parseInt(this.form.workLogs.length + 1), + id: parseInt(length), beginTime: "", endTime: "", workCompany: "", workDept: "", workType: "", - workLogs: "", + harmTypeLogs: "", fangHu: "", Selection, }); } else { this.form.workLogs.push({ - id: parseInt(this.form.workLogs.length + 1), + id: parseInt(length), beginTime: "", endTime: "", workCompany: "", workDept: "", workType: "", - workLogs: "", + harmTypeLogs: "", fangHu: "", Selection, }); } - console.log(that.form.workLogs) } else { Message.warning("璇峰厛濉啓瀹㈡埛鍚�"); } @@ -628,15 +649,12 @@ delememberss() { let that = this - console.log(that.chageall) - if (that.form.workLogs.length == that.chageall.length) { that.form.workLogs = [] } else { that.chageall.forEach((item1, index1) => { that.form.workLogs.forEach((item, index) => { - if (item.id == item1.id) { - console.log(111111) + if (item == item1) { that.form.workLogs.splice(index, 1) } }) @@ -646,6 +664,7 @@ }, /** 鎻愪氦鎸夐挳 */ submitForm() { + this.form.tjNum = this.dataList[0].tjNumber updateHistory(this.form).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); }); -- Gitblit v1.8.0