From 073edc90c84ee4e8b3efe18db4ecfdbf039fdcb6 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期一, 24 三月 2025 15:27:33 +0800 Subject: [PATCH] 测试完成 --- src/api/AiCentre/indicator.js | 8 + src/views/login.vue | 2 src/views/sfstatistics/analyse/index.vue | 168 ++++++++++++++++++++++++--- src/views/followvisit/discharge/index.vue | 142 +++++++++++++--------- 4 files changed, 241 insertions(+), 79 deletions(-) diff --git a/src/api/AiCentre/indicator.js b/src/api/AiCentre/indicator.js index 0556f92..17eb8d3 100644 --- a/src/api/AiCentre/indicator.js +++ b/src/api/AiCentre/indicator.js @@ -40,6 +40,14 @@ data: data, }); } +// 鎸囨爣缁熻 +export function Labelstatistics(Id) { + return request({ + url: "/smartor/serviceSubtaskDetail/countPatByTarget/" + Id, + method: "get", + }); + } + // 鍒犻櫎鎸囨爣 export function deletetarget(userId) { return request({ diff --git a/src/views/followvisit/discharge/index.vue b/src/views/followvisit/discharge/index.vue index 118c58a..9587017 100644 --- a/src/views/followvisit/discharge/index.vue +++ b/src/views/followvisit/discharge/index.vue @@ -480,7 +480,7 @@ key="remark" prop="remark" > - <template slot-scope="scope" v-if="scope.row.remark"> + <template slot-scope="scope" v-if="scope.row.remark"> <el-tooltip :content="scope.row.remark" placement="top" @@ -541,6 +541,14 @@ ><i class="el-icon-s-order"></i>鏌ョ湅璇︽儏</span ></el-button > + <el-button + size="medium" + type="text" + @click="handleUpdate(scope.row)" + ><span class="button-textxga" + ><i class="el-icon-edit"></i>鎮h�呰繃婊�</span + ></el-button + > </template> </el-table-column> </el-table> @@ -555,56 +563,59 @@ </el-row> <!-- 娣诲姞鎴栦慨鏀瑰奖鍍忛殢璁垮璇濇 --> <el-dialog - :title="title" - :visible.sync="addalteropen" - width="700px" - append-to-body + :title="amendtag ? '淇敼鎮h�呬俊鎭�' : '鏂板鎮h��'" + :visible.sync="Labelchange" + width="900px" > - <el-form ref="form" :model="form" label-width="100px"> - <el-row :gutter="20"> - <el-col :span="12" - ><el-form-item label="浠诲姟鍚嶇О"> - <el-input v-model="form.name"></el-input> </el-form-item - ></el-col> - </el-row> - <el-row :gutter="20"> - <el-col :span="24" - ><el-form-item label="鎵�灞炵瀹�"> - <el-select v-model="form.region" placeholder="璇烽�夋嫨绉戝"> - <el-option label="鍖哄煙涓�" value="shanghai"></el-option> - <el-option label="鍖哄煙浜�" value="beijing"></el-option> - </el-select> </el-form-item></el-col - ></el-row> - <el-row :gutter="20"> - <el-col :span="24" - ><el-form-item label="闅忚绫诲瀷"> - <el-select v-model="form.region" placeholder="璇烽�夋嫨闅忚绫诲瀷"> - <el-option label="鍖哄煙涓�" value="shanghai"></el-option> - <el-option label="鍖哄煙浜�" value="beijing"></el-option> - </el-select> </el-form-item - ></el-col> - </el-row> - <el-row :gutter="20"> - <el-col :span="24"> - <el-form-item label="鏈嶅姟妯″潡"> - <el-select v-model="form.region" placeholder="璇烽�夋嫨妯″潡"> - <el-option label="鍖哄煙涓�" value="shanghai"></el-option> - <el-option label="鍖哄煙浜�" value="beijing"></el-option> + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> + <el-row> + <el-col :span="8"> + <el-form-item label="濮撳悕" width="100" prop="name"> + <el-input + v-model="form.name" + placeholder="璇疯緭鍏ュ鍚�" + maxlength="30" + /> + </el-form-item> + </el-col> + <el-col :span="8"> + <el-form-item label="鎬у埆" width="100" prop="sex"> + <el-select v-model="form.sex" placeholder="璇烽�夋嫨鎬у埆"> + <el-option + v-for="dict in sextype" + :key="dict.value" + :label="dict.label" + :value="dict.value" + ></el-option> </el-select> </el-form-item> </el-col> + <el-col :span="8"> + <el-form-item label="骞撮緞" prop="age"> + <el-input + v-model="form.age" + placeholder="璇疯緭鍏ュ勾榫�" + maxlength="30" + /> + </el-form-item> + </el-col> </el-row> - <el-row :gutter="20"> + + <el-row> <el-col :span="24"> - <el-form-item label="褰卞儚闅忚瑕佹眰"> - <el-input type="textarea" v-model="form.desc"></el-input> + <el-form-item label="杩囨护鍘熷洜"> + <el-input + v-model="form.notrequiredreason" + type="textarea" + placeholder="璇疯緭鍏ヨ繃婊ゅ師鍥�" + ></el-input> </el-form-item> </el-col> </el-row> </el-form> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitForm">鎻� 浜�</el-button> - <el-button @click="cancel">杩� 鍥�</el-button> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> </div> </el-dialog> <!-- 淇敼鍙戦�佹椂闂村璇濇 --> @@ -809,6 +820,7 @@ zcform: {}, dynamicTags: ["閫夐」涓�", "閫夐」浜�", "閫夐」涓�"], //閫夐」 inputVisible: false, + Labelchange: false, ycvalue: "", yfsvalue: "", inputValue: "", @@ -913,6 +925,10 @@ topicoptions: [ { + value: null, + label: "鍏ㄩ儴", + }, + { value: 1, label: "琛ㄥ崟宸查鍙�", }, @@ -987,7 +1003,7 @@ this.getList(1); }, methods: { - /** 鏌ヨ褰卞儚闅忚鏈嶅姟鍒楄〃 */ + /** 鏌ヨ闅忚鏈嶅姟鍒楄〃 */ getList(refresh) { // 榛樿鍏ㄩ儴 if (this.topqueryParams.searchscope == 3) { @@ -1148,11 +1164,7 @@ row.status = row.status === "0" ? "1" : "0"; }); }, - // 鍙栨秷鎸夐挳 - cancel() { - this.addalteropen = false; - this.reset(); - }, + // 琛ㄥ崟閲嶇疆 reset() { this.form = { @@ -1273,24 +1285,28 @@ }) .catch(() => {}); }, - + // 鍙栨秷鎸夐挳 + cancel() { + this.Labelchange = false; + this.reset(); + }, /** 鎻愪氦鎸夐挳 */ submitForm: function () { this.$refs["form"].validate((valid) => { if (valid) { - if (this.form.userId != undefined) { - updateUser(this.form).then((response) => { - this.$modal.msgSuccess("淇敼鎴愬姛"); - this.open = false; + this.form.isoperation = 2; + this.form.notrequiredFlag = 1; + alterpatient(this.form) + .then((response) => { + console.log(response); + }) + .then(() => { this.getList(1); + this.$modal.msgSuccess("鎮h�呰繃婊ゆ垚鍔�"); }); - } else { - addUser(this.form).then((response) => { - this.$modal.msgSuccess("鏂板鎴愬姛"); - this.open = false; - this.getList(1); - }); - } + + this.reset(); + this.Labelchange = false; } }); }, @@ -1406,6 +1422,14 @@ }) .catch(() => {}); }, + // 鎮h�呰繃婊よЕ鍙� + handleUpdate(row) { + particularpatient(row.patid).then((response) => { + this.form = response.data; + }); + this.amendtag = true; + this.Labelchange = true; + }, // 渚挎嵎鎸夐挳 toleadExport(too) { if (too == 1) { @@ -1441,7 +1465,7 @@ if (valid) { let form = structuredClone(this.zcform); form.longSendTime = this.formatTime(form.date1); - form.finishtime = ''; + form.finishtime = ""; if (form.resource) { if (form.resource == 2) { form.serviceType = 10; diff --git a/src/views/login.vue b/src/views/login.vue index 0d9aa10..8bfe9b0 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -195,7 +195,7 @@ .dispatch("Login", this.loginForm) .then(() => { // this.$router.push({ path: this.redirect || "/" }).catch(() => {}); - this.$router.push({ path:"/patient/patient" }).catch(() => {}); + this.$router.push({ path:"/followvisit/discharge" }).catch(() => {}); }) .catch(() => { this.loading = false; diff --git a/src/views/sfstatistics/analyse/index.vue b/src/views/sfstatistics/analyse/index.vue index c4b52eb..601d735 100644 --- a/src/views/sfstatistics/analyse/index.vue +++ b/src/views/sfstatistics/analyse/index.vue @@ -3,14 +3,22 @@ <div class="analysis-top"> <div class="title-top">鏌ヨ鏉′欢</div> <div class="value"> - <el-form ref="form" :model="form" label-width="120px"> + <el-form ref="form" :model="queryParams" label-width="120px"> <el-form-item label="閫夋嫨鎸囨爣鍚嶇О"> - <el-select v-model="value" filterable placeholder="璇烽�夋嫨"> + <el-select + remote + :remote-method="remoteMethod" + default-first-option + v-model="targetvalue" + @change="Labelstatistics" + filterable + placeholder="璇烽�夋嫨" + > <el-option - v-for="item in options" - :key="item.value" - :label="item.label" - :value="item.value" + v-for="item in targetList" + :key="item.id" + :label="item.targetname" + :value="item.id" > </el-option> </el-select> @@ -19,24 +27,37 @@ </div> </div> <div class="formindex"> - <el-table :data="tableData" border style="width: 100%"> - <el-table-column prop="date" label="鎸囨爣鍚嶇О"> </el-table-column> - <el-table-column prop="name" label="鍗曢」鍚嶇О"> </el-table-column> - <el-table-column prop="address" label="鍗曢」鍑虹幇娆℃暟"> </el-table-column> - <el-table-column prop="times" label="鎸囨爣鍑虹幇娆℃暟"> + <el-table + v-loading="loading" + :data="tableData" + :span-method="objectSpanMethod" + border + :summary-method="getSummaries" + show-summary + style="width: 100%" + > + <el-table-column prop="targetname" label="鎸囨爣鍚嶇О"> </el-table-column> + <el-table-column prop="targetShowCount" label="鎸囨爣鍑虹幇娆℃暟"> </el-table-column> - <el-table-column prop="proportion" label="鍗犳瘮"> </el-table-column> + <el-table-column prop="matchedtext" label="鍗曢」鍚嶇О"> </el-table-column> + <el-table-column prop="count" label="鍗曢」閫変腑娆℃暟"> </el-table-column> + <el-table-column prop="percentage" label="鍗犳瘮"> + <template slot-scope="scope"> + <span>{{ (Number(scope.row.percentage) * 100).toFixed(2) }}%</span> + </template> + </el-table-column> </el-table> </div> </div> </template> <script> +import { gettargetInfo, Labelstatistics } from "@/api/AiCentre/index"; export default { name: "indexanalysis", data() { return { - options: [ + targetList: [ { value: "閫夐」1", label: "鍙戠儹鏈夋棤", @@ -56,29 +77,138 @@ name: "鏈�", address: 1, times: 2, - proportion: "50%", + proportion: "50", }, { date: "鍙戠儹鏈夋棤", name: "鏃�", address: 1, times: 2, - proportion: "50%", + proportion: "50", }, { date: "鍙戠儹鏈夋棤", name: "鍏朵粬", address: 0, times: 2, - proportion: "0%", + proportion: "0", }, ], + targetvalue: "", + queryParams: { + pageNum: 1, + pageSize: 66, + scriptType: "1", + }, }; }, - created() {}, + created() { + this.getList(); + }, - methods: {}, + methods: { + getList() { + this.loading = true; + gettargetInfo(this.queryParams).then((res) => { + this.targetList = res.rows; + this.Labelstatistics(res.rows[0].id); + }); + }, + Labelstatistics(id) { + console.log(id, "id"); + + Labelstatistics(id).then((res) => { + if (res.data.length > 0) { + this.tableData = res.data; + } else { + gettargetInfo({ id: id }).then((res) => { + console.log(res, "鏇挎崲灞曠ず鍊�"); + this.tableData = []; + res.rows[0].targetoptionList.forEach((item) => { + this.tableData.push({ + targetname: res.rows[0].targetname, + targetShowCount:0, + count:0, + percentage:0, + matchedtext:item.targetvalue, + }); + }); + }); + } + this.loading = false; + }); + }, + remoteMethod(value) { + const illnessqueryParams = { + pageNum: 1, + pageSize: 66, + targetname: value, + scriptType: "1", + }; + setTimeout(() => { + gettargetInfo(illnessqueryParams).then((res) => { + this.targetList = res.rows; + }); + }, 200); + }, + objectSpanMethod({ row, column, rowIndex, columnIndex }) { + if (columnIndex === 0 || columnIndex === 1) { + const totalRows = this.tableData.length; + if (rowIndex === 0) { + return [totalRows, 1]; + } else { + // 鍏朵粬琛岄殣钘� + return [0, 0]; + } + } + }, + getSummaries(param) { + const { columns, data } = param; + const sums = []; + columns.forEach((column, index) => { + console.log(data, "data"); + + if (index === 0) { + sums[index] = "鍚堣"; // 淇敼涓衡�滃悎璁♀�濇洿绗﹀悎璇箟 + return; + } + if (column.property === "percentage") { + // 瀵瑰崰姣斿垪杩涜鐗规畩澶勭悊 + const values = data.map((item) => Number(item[column.property])); + const total = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + value; + } else { + return prev; + } + }, 0); + sums[index] = `${total * 100}%`; // 鐩存帴娣诲姞鐧惧垎鍙� + } else if (column.property === "targetShowCount") { + sums[index] = data[0].targetShowCount + " 娆�"; // 涓烘鏁扮浉鍏冲垪娣诲姞鍗曚綅 + } else { + const values = data.map((item) => Number(item[column.property])); + if (!values.every((value) => isNaN(value))) { + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + if (column.property === "count") { + sums[index] += " 娆�"; // 涓烘鏁扮浉鍏冲垪娣诲姞鍗曚綅 + } + } else { + sums[index] = "/"; + } + } + }); + return sums; + }, + }, }; </script> @@ -89,7 +219,7 @@ 0 0 6px 0 rgba(0, 0, 0, 0.04); margin: 15px; .title-top { - background-color: #00bbd3; + background-color: #6784f2; color: #fff; padding: 10px 20px; font-size: 20px; -- Gitblit v1.9.3