From 1bff9afb2dfda9824c3956c4a491a1b2261ad306 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期日, 27 四月 2025 14:37:54 +0800 Subject: [PATCH] 1 --- src/components/jianqianwenzhen/index.vue | 569 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 515 insertions(+), 54 deletions(-) diff --git a/src/components/jianqianwenzhen/index.vue b/src/components/jianqianwenzhen/index.vue index a669b7f..acaed3a 100644 --- a/src/components/jianqianwenzhen/index.vue +++ b/src/components/jianqianwenzhen/index.vue @@ -1,6 +1,6 @@ <template> <div> - <span class="txt">闂瘖淇℃伅</span> + <span class="txt"></span> <el-form ref="form" :model="form" @@ -53,15 +53,44 @@ </el-select> </el-form-item> <el-form-item label="宸ョ" prop="gongZhong"> - <el-input v-model="form.gongZhong" placeholder="璇疯緭鍏ュ伐绉�" /> + <el-input + v-model="form.gongZhong" + placeholder="璇疯緭鍏ュ伐绉�" + style="width: 710px" + /> </el-form-item> - <el-form-item label="宸ラ緞" prop="gongLing"> + <el-form-item label="宸ヤ綔鍗曚綅鍚嶇О" prop="gongZhong" > + <el-input + v-model="form.gongZhong" + placeholder="璇疯緭鍏ュ伐绉�" + style="width: 710px" + /> + </el-form-item> + <el-form-item label="鎬诲伐榫�" prop="gongLing"> <!-- <el-input v-model="form.cusName" placeholder="璇疯緭鍏ュ伐榫�" style="width: 150px" />骞� --> <el-input-number v-model="form.gongLing" label="璇疯緭鍏ュ伐榫�" ></el-input-number >骞� + </el-form-item> + <el-form-item + label="鎺ヨЕ鏈夊鐗╁伐榫�" + prop="gongLing" + label-width="150px" + > + <!-- <el-input v-model="form.cusName" placeholder="璇疯緭鍏ュ伐榫�" style="width: 150px" />骞� --> + <el-input-number + v-model="form.gongLing" + label="璇疯緭鍏ユ帴瑙︽湁瀹崇墿宸ラ緞" + ></el-input-number + >骞� + </el-form-item> + <el-form-item label="鏄惁澶嶈瘖" prop=""> + <el-radio-group v-model="radio"> + <el-radio :label="1">鏄�</el-radio> + <el-radio :label="2">鍚�</el-radio> + </el-radio-group> </el-form-item> <el-form-item label="鎺ヨЕ姣掔墿" prop="contactPoison"> <el-input @@ -81,6 +110,23 @@ style="width: 700px" /> </el-form-item> + <el-form-item label="鐥囩姸" prop="zzsjj"> + <el-select + multiple + filterable + v-model="form.zzsjj" + placeholder="璇烽�夋嫨鐥囩姸" + clearable + style="width: 700px" + > + <el-option + v-for="dict in zhenghuzangList" + :key="dict.id" + :label="dict.proName" + :value="dict.proName" + /> + </el-select> + </el-form-item> </div> </el-collapse-item> <el-collapse-item title="鏈堢粡鍙�" name="2" v-show="sex"> @@ -96,6 +142,22 @@ </el-form-item> <el-form-item label="鏈鏈堢粡" prop="mociage"> <el-input v-model="form.mociage" style="width: 100px" /> + </el-form-item> + <el-form-item label="鏄惁寮傚父" prop="yjsfyc"> + <el-select + filterable + v-model="form.yjsfyc" + placeholder="璇烽�夋嫨鏄惁寮傚父" + clearable + style="width: 150px" + > + <el-option + v-for="dict in dict.type.sys_yes_no" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> </el-form-item> </div> </el-collapse-item> @@ -180,7 +242,7 @@ </el-form-item> </div> </el-collapse-item> - <el-collapse-item title="鏃㈠線鐥呭彶" name="5"> + <el-collapse-item title="鑱屼笟鐥�" name="5" v-show="zhiyebingshi"> <div style="width: 900px"> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> @@ -216,6 +278,48 @@ prop="index" width="50" /> --> + <el-table-column label="鐤剧梾绫诲瀷" prop="type"> + <template slot-scope="scope"> + <!-- <el-input + size="mini" + v-model="scope.row.diseaseName" + placeholder="璇疯緭鍏ョ柧鐥呭悕绉�" + /> --> + <el-select + v-model="scope.row.type" + remote + filterable + placeholder="璇烽�夋嫨鐤剧梾绫诲瀷" + clearable + > + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> + </template> + </el-table-column> + <el-table-column label="鐤剧梾id" prop="icdId" v-if="false"> + <!-- <template slot-scope="scope"> --> + <el-select + :remote-method="getRemoteData" + v-model="icdId" + remote + filterable + placeholder="璇烽�夋嫨鐥呯鍚�" + clearable + > + <el-option + v-for="dict in rulesList" + :key="dict.id" + :label="dict.icdname" + :value="dict.id" + /> + </el-select> + <!-- </template> --> + </el-table-column> <el-table-column label="鐤剧梾鍚嶇О" prop="diseaseName"> <template slot-scope="scope"> <!-- <el-input @@ -230,12 +334,175 @@ filterable placeholder="璇烽�夋嫨鐥呯鍚�" clearable + @change="jibing" > <el-option v-for="dict in rulesList" - :key="dict.aid" - :label="dict.bingzhong" - :value="dict.bingzhong" + :key="dict.id" + :label="dict.icdname" + :value="dict.icdname" + /> + </el-select> + </template> + </el-table-column> + <el-table-column label="璇婃柇鏃ユ湡" prop="diseaseData"> + <template slot-scope="scope"> + <!-- <el-input + v-model="scope.row.diseaseData" + placeholder="璇疯緭鍏ヨ瘖鏂棩鏈�" + /> --> + <el-date-picker + size="mini" + v-model="scope.row.diseaseData" + align="right" + type="date" + placeholder="閫夋嫨鏃ユ湡" + :picker-options="pickerOptions" + style="width: 130px" + value-format="yyyy-MM-dd" + > + </el-date-picker> + </template> + </el-table-column> + <el-table-column label="璇婃柇鍗曚綅" prop="diseaseCompany"> + <template slot-scope="scope"> + <el-input + size="mini" + v-model="scope.row.diseaseCompany" + placeholder="璇疯緭鍏ヨ瘖鏂崟浣�" + /> + </template> + </el-table-column> + <el-table-column label="鏄惁鐥婃剤" prop="isOk"> + <template slot-scope="scope"> + <!-- <el-input v-model="scope.row.isOk" placeholder="璇疯緭鍏ユ槸鍚︾棅鎰�" /> --> + <el-select + filterable + size="mini" + v-model="scope.row.isOk" + placeholder="璇烽�夋嫨鏄惁鐥婃剤" + clearable + > + <el-option + v-for="dict in dict.type.sys_yes_no" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </template> + </el-table-column> + <el-table-column label="澶囨敞" prop="remark"> + <template slot-scope="scope"> + <el-input + size="mini" + v-model="scope.row.remark" + placeholder="璇疯緭鍏ュ娉�" + /> + </template> + </el-table-column> + </el-table> + </div> + </el-collapse-item> + <el-collapse-item title="鏃㈠線鐥呭彶" name="5" v-show="jiwangbingshi"> + <div style="width: 900px"> + <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="delemembers()" + >鍒犻櫎 + </el-button> + </el-col> + </el-row> + <el-table + border + :data="form.tjAskHistorysList" + ref="tjAskHistorys" + style="width: 98%" + @selection-change="handlebingChange" + > + <el-table-column type="selection" width="40" align="center" /> + <!-- <el-table-column + label="搴忓彿" + align="center" + prop="index" + width="50" + /> --> + <el-table-column label="鐤剧梾绫诲瀷" prop="type"> + <template slot-scope="scope"> + <!-- <el-input + size="mini" + v-model="scope.row.diseaseName" + placeholder="璇疯緭鍏ョ柧鐥呭悕绉�" + /> --> + <el-select + v-model="scope.row.type" + remote + filterable + placeholder="璇烽�夋嫨鐤剧梾绫诲瀷" + clearable + > + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> + </template> + </el-table-column> + <el-table-column label="鐤剧梾id" prop="icdId" v-if="false"> + <!-- <template slot-scope="scope"> --> + <el-select + :remote-method="getRemoteData" + v-model="icdId" + remote + filterable + placeholder="璇烽�夋嫨鐥呯鍚�" + clearable + > + <el-option + v-for="dict in rulesList" + :key="dict.id" + :label="dict.icdname" + :value="dict.id" + /> + </el-select> + <!-- </template> --> + </el-table-column> + <el-table-column label="鐤剧梾鍚嶇О" prop="diseaseName"> + <template slot-scope="scope"> + <!-- <el-input + size="mini" + v-model="scope.row.diseaseName" + placeholder="璇疯緭鍏ョ柧鐥呭悕绉�" + /> --> + <el-select + :remote-method="getRemoteData" + v-model="scope.row.diseaseName" + remote + filterable + placeholder="璇烽�夋嫨鐥呯鍚�" + clearable + @change="jibing" + > + <el-option + v-for="dict in rulesList" + :key="dict.id" + :label="dict.icdname" + :value="dict.icdname" /> </el-select> </template> @@ -300,7 +567,7 @@ </div> </el-collapse-item> - <el-collapse-item title="鑱屼笟鍙�" name="7"> + <el-collapse-item title="鑱屼笟鍙�" name="7" v-show="zhiye"> <div style="width: 900px"> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> @@ -344,7 +611,6 @@ type="date" placeholder="閫夋嫨鏃ユ湡" :picker-options="pickerOptions" - style="width: 130px" value-format="yyyy-MM-dd" > </el-date-picker> @@ -359,7 +625,6 @@ type="date" placeholder="閫夋嫨鏃ユ湡" :picker-options="pickerOptions" - style="width: 130px" value-format="yyyy-MM-dd" > </el-date-picker> @@ -439,21 +704,20 @@ </template> <script> -import { listRules } from "@/api/hosp/rules"; +import { updateHistory, getInfoById, getZhengZhuang } from "@/api/hosp/history"; +import { list } from "@/api/hosp/rules"; import { listIcd } from "@/api/system/icd"; -import { updateHistory } from "@/api/hosp/history"; export default { dicts: ["tj_smoking_pinlv", "sys_yes_no", "tj_work_status", "tj_work"], name: "jianqianwenzhen", props: { jianqianwenzhendata: { type: Array, //鏁扮粍绫诲瀷 - default: () => [], + default: null, }, }, 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(""); @@ -464,9 +728,26 @@ } }; return { + zhiyebingshi: true, + jiwangbingshi: true, + diseaseNames: "", + zhenghuzangList: [], + options: [ + { + value: "鏃㈠線鐥�", + label: "鏃㈠線鐥�", + }, + { + value: "鑱屼笟鐥�", + label: "鑱屼笟鐥�", + }, + ], + icdId: "", + radio: '1', + zhiye: true, queryParams: { pageNum: 1, - pageSize: 10, + pageSize: 100, }, dataList: [], pickerOptions: { @@ -531,57 +812,121 @@ watch: { jianqianwenzhendata(val, newVla) { if (val) { - console.log(val); + val.forEach((item) => { + let tjNumber = item; + getInfoById(tjNumber).then((response) => { + this.form = response.data; + if (this.form.cusSex === "1") { + this.sex = true; + } else { + this.sex = false; + } + if (this.form.tjLx === "02") { + this.zhiye = true; + this.zhiyebingshi = true; + this.jiwangbingshi = false; + } else { + this.zhiye = false; + this.zhiyebingshi = false; + this.jiwangbingshi = true; + } + if (this.form.xiyan == null) { + this.form.xiyan = "1"; + } + if (this.form.yjsfyc == null) { + this.form.yjsfyc = "N"; + } + if (this.form.xiyanpinlv == null) { + this.form.xiyanpinlv = "0"; + } + if (this.form.xiyanyear == null) { + this.form.xiyanyear = "0"; + } + if (this.form.yinjiu == null) { + this.form.yinjiu = "1"; + } + if (this.form.yinjiupinlv == null) { + this.form.yinjiupinlv = "0"; + } + if (this.form.yinjiuyear == null) { + this.form.yinjiuyear = "0"; + } + // 璁剧疆榛樿鍊� + if (this.form.gongLing == null) { + this.form.gongLing = 1; // 宸ラ緞榛樿鍊� + } + this.form.tjAskHistorysList = response.data.tjAskHistorysList; + // this.isdisabled= true + }); + }); this.loading = false; - this.form = val; - if (this.form.xiyan == null) { - this.form.xiyan = "1"; - } - if (this.form.xiyanpinlv == null) { - this.form.xiyanpinlv = "0"; - } - if (this.form.xiyanyear == null) { - this.form.xiyanyear = "0"; - } - if (this.form.yinjiu == null) { - this.form.yinjiu = "1"; - } - if (this.form.yinjiupinlv == null) { - this.form.yinjiupinlv = "0"; - } - if (this.form.yinjiuyear == null) { - this.form.yinjiuyear = "0"; - } - this.form.tjAskHistorysList = val.tjAskHistorysList; } - - // if (this.fList) { - // this.getList() - // } }, }, created() { this.getList(); + this.getzhenzhuangList(); + console.log("鎺ユ敹", this.jianqianwenzhendata); + if (this.jianqianwenzhendata.length == 1) { + this.jianqianwenzhendata.forEach((item) => { + let tjNumber = item; + getInfoById(tjNumber).then((response) => { + this.form = response.data; + if (this.form.cusSex === "1") { + this.sex = true; + } else { + this.sex = false; + } + if (this.form.tjLx === "02") { + this.zhiye = true; + this.zhiyebingshi = true; + this.jiwangbingshi = false; + } else { + this.zhiye = false; + this.zhiyebingshi = false; + this.jiwangbingshi = true; + } + if (this.form.xiyan == null) { + this.form.xiyan = "1"; + } + if (this.form.yjsfyc == null) { + this.form.yjsfyc = "N"; + } + if (this.form.xiyanpinlv == null) { + this.form.xiyanpinlv = "0"; + } + if (this.form.xiyanyear == null) { + this.form.xiyanyear = "0"; + } + if (this.form.yinjiu == null) { + this.form.yinjiu = "1"; + } + if (this.form.yinjiupinlv == null) { + this.form.yinjiupinlv = "0"; + } + if (this.form.yinjiuyear == null) { + this.form.yinjiuyear = "0"; + } + this.form.tjAskHistorysList = response.data.tjAskHistorysList; + // this.isdisabled= true + }); + }); + this.loading = false; + } }, methods: { /** 鏌ヨ鐤剧梾瀛楀吀鍒楄〃 */ getList() { - listRules(this.queryParams).then((response) => { + list(this.queryParams).then((response) => { this.rulesList = response.rows; }); }, - // 鎼滅储 - getRemoteData(query) { - if (query) { - let data = { - bingzhong: query, - }; - listRules(data).then((response) => { - this.rulesList = response.rows; - }); - } - }, + getzhenzhuangList() { + getZhengZhuang().then((response) => { + this.zhenghuzangList = response.data; + }); + }, // 鏂板琛� addmembers() { if (this.form.cusName) { @@ -594,6 +939,8 @@ diseaseCompany: "", isOk: "", remark: "", + icdId: "", + type: "", Selection, }); } else { @@ -604,6 +951,8 @@ diseaseCompany: "", isOk: "", remark: "", + icdId: "", + type: "", Selection, }); } @@ -611,6 +960,95 @@ Message.warning("璇峰厛濉啓瀹㈡埛鍚�"); } this.$forceUpdate(); + }, + addmemberss() { + if (this.form.cusName) { + if (!this.form.workLogs) { + this.form.workLogs = []; + this.form.workLogs.push({ + // id: parseInt(length), + beginTime: "", + endTime: "", + workCompany: "", + workDept: "", + workType: "", + harmTypeLogs: "", + fangHu: "", + Selection, + }); + } else { + this.form.workLogs.push({ + // id: parseInt(length), + beginTime: "", + endTime: "", + workCompany: "", + workDept: "", + workType: "", + harmTypeLogs: "", + fangHu: "", + Selection, + }); + } + } else { + Message.warning("璇峰厛濉啓瀹㈡埛鍚�"); + } + this.$forceUpdate(); + }, + + jibing(sel) { + this.diseaseNames = sel; + this.rulesList.forEach((item) => { + if (sel == item.icdname) { + this.icdId = item.id; + } + }); + this.form.tjAskHistorysList.forEach((item) => { + if (item.diseaseName == sel) { + item.icdId = this.icdId; + } + }); + }, + // 鎼滅储 + getRemoteData(query) { + if (query) { + let data = { + icdname: query, + pageNum: 1, + pageSize: 200, + }; + list(data).then((response) => { + this.rulesList = response.rows; + }); + } + }, + + delememberss() { + let that = this; + 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 == item1) { + that.form.workLogs.splice(index, 1); + } + }); + }); + } + }, + delemembers() { + 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); + } + }); + }); + } }, handlebingChange(selection) { this.bingshiall = []; @@ -621,10 +1059,33 @@ this.chageall = selection; }, /** 鎻愪氦鎸夐挳 */ - submitForm() { - this.form.tjNum = this.jianqianwenzhendata.tjNum; + /* submitForm() { + // this.form.tjAskHistorysList.forEach(element=>{ + // element.icdId = this.icdId; + // }) updateHistory(this.form).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); + this.form = response.data; + }); + }, */ + submitForm() { + this.$refs.form.validate((valid) => { + if (valid) { + this.$emit("submitLoading", true); + updateHistory(this.form) + .then((response) => { + this.$message.success("淇敼鎴愬姛"); + this.form = response.data; // 鏇存柊琛ㄥ崟鏁版嵁 + }) + .catch((error) => { + this.$message.error("淇敼澶辫触"); + }) + .finally(() => { + this.$emit("submitLoading", false); + }); + } else { + this.$message.error("璇锋鏌ヨ〃鍗曞唴瀹�"); + } }); }, }, -- Gitblit v1.8.0