From 39c8b288ec8294e026459dfb1955f0bbc49ebb52 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 19 十月 2026 11:10:40 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/archives/maternalHealth/MRSScoreTable.vue |  154 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 128 insertions(+), 26 deletions(-)

diff --git a/src/views/patient/archives/maternalHealth/MRSScoreTable.vue b/src/views/patient/archives/maternalHealth/MRSScoreTable.vue
index 39b2d05..3554193 100644
--- a/src/views/patient/archives/maternalHealth/MRSScoreTable.vue
+++ b/src/views/patient/archives/maternalHealth/MRSScoreTable.vue
@@ -1,37 +1,139 @@
 <template>
-  <div>
-    <el-table :data="items" border size="small">
-      <el-table-column prop="item" label="鏉$洰" width="220" />
-      <el-table-column label="璇勫垎" align="center" width="120">
-        <template slot-scope="scope">
-          <el-select v-if="editing" v-model="scope.row.score" size="small">
-            <el-option v-for="s in scoreOptions" :key="s" :label="s" :value="s" />
-          </el-select>
-          <span v-else>{{ scope.row.score }}</span>
-        </template>
+  <div class="scale-wrap">
+    <div class="scale-title">鏇村勾鏈熻瘎瀹氶噺琛紙MRS锛�</div>
+
+    <!-- 绾歌川琛ㄨ〃澶达細鎮h�呭熀鏈俊鎭� -->
+    <el-descriptions :column="3" border size="small" class="scale-head">
+      <el-descriptions-item label="濮撳悕">{{ patient.name || "-" }}</el-descriptions-item>
+      <el-descriptions-item label="鎬у埆">{{ patient.sex || "-" }}</el-descriptions-item>
+      <el-descriptions-item label="骞撮緞">{{ patient.age || "-" }}</el-descriptions-item>
+      <el-descriptions-item label="绉戝">{{ patient.dept || "-" }}</el-descriptions-item>
+      <el-descriptions-item label="涓村簥璇婃柇">{{ patient.diagnosis || "-" }}</el-descriptions-item>
+      <el-descriptions-item label="璇勪及鏃ユ湡">
+        <el-date-picker v-if="editing" v-model="local.date" value-format="yyyy-MM-dd" size="mini" style="width:160px" placeholder="閫夋嫨鏃ユ湡" />
+        <span v-else>{{ local.date || "-" }}</span>
+      </el-descriptions-item>
+    </el-descriptions>
+
+    <div class="scale-tip">鎸囧璇細璇锋牴鎹偍杩� 1 涓湀鐨勬儏鍐碉紝瀵逛笅鍒楀悇椤圭棁鐘剁殑涓ラ噸绋嬪害杩涜璇勫垎锛�0 鍒� = 鏃犵棁鐘讹紝4 鍒� = 鍗佸垎涓ラ噸锛夈��</div>
+
+    <!-- 绾歌川琛ㄤ富浣擄細鐥囩姸鏉$洰 + 0~4 鎵撳垎鏍� -->
+    <el-table :data="items" border size="small" class="mrs-table">
+      <el-table-column type="index" label="搴忓彿" width="60" align="center" />
+      <el-table-column prop="label" label="鐥囩姸" min-width="220" />
+      <el-table-column label="0 鏃犵棁鐘�" align="center" width="90">
+        <template slot-scope="scope"><el-radio v-if="editing" v-model="local[scope.row.key]" :label="0">&nbsp;</el-radio><span v-else>{{ local[scope.row.key] === 0 ? "鉁�" : "" }}</span></template>
+      </el-table-column>
+      <el-table-column label="1 杞诲井" align="center" width="90">
+        <template slot-scope="scope"><el-radio v-if="editing" v-model="local[scope.row.key]" :label="1">&nbsp;</el-radio><span v-else>{{ local[scope.row.key] === 1 ? "鉁�" : "" }}</span></template>
+      </el-table-column>
+      <el-table-column label="2 涓瓑" align="center" width="90">
+        <template slot-scope="scope"><el-radio v-if="editing" v-model="local[scope.row.key]" :label="2">&nbsp;</el-radio><span v-else>{{ local[scope.row.key] === 2 ? "鉁�" : "" }}</span></template>
+      </el-table-column>
+      <el-table-column label="3 涓ラ噸" align="center" width="90">
+        <template slot-scope="scope"><el-radio v-if="editing" v-model="local[scope.row.key]" :label="3">&nbsp;</el-radio><span v-else>{{ local[scope.row.key] === 3 ? "鉁�" : "" }}</span></template>
+      </el-table-column>
+      <el-table-column label="4 鍗佸垎涓ラ噸" align="center" width="100">
+        <template slot-scope="scope"><el-radio v-if="editing" v-model="local[scope.row.key]" :label="4">&nbsp;</el-radio><span v-else>{{ local[scope.row.key] === 4 ? "鉁�" : "" }}</span></template>
+      </el-table-column>
+      <el-table-column label="寰楀垎" align="center" width="70">
+        <template slot-scope="scope">{{ Number(local[scope.row.key]) || 0 }}</template>
       </el-table-column>
     </el-table>
-    <div style="margin-top:10px;font-size:14px">MRS鎬诲垎锛歿{ totalScore }}</div>
+
+    <!-- 缁撴灉 -->
+    <el-descriptions :column="3" border size="small" class="scale-result">
+      <el-descriptions-item label="MRS 鎬诲垎"><b :class="levelClass">{{ totalScore }}</b> 鍒�</el-descriptions-item>
+      <el-descriptions-item label="绋嬪害">{{ severity }}</el-descriptions-item>
+      <el-descriptions-item label="璇勫垎浜哄憳">
+        <el-input v-if="editing" v-model="local.evaluator" size="mini" style="width:160px" placeholder="璇疯緭鍏�" />
+        <span v-else>{{ local.evaluator || "-" }}</span>
+      </el-descriptions-item>
+    </el-descriptions>
+    <div class="mrs-range">绋嬪害鍒嗙骇锛�0~4 鏃犵棁鐘�/鏋佽交寰紝5~8 杞诲害锛�9~15 涓害锛屸墺16 閲嶅害</div>
   </div>
 </template>
+
 <script>
+const MRS_ITEMS = [
+  { key: "mrs_0", label: "1. 鐕ョ儹銆佹祦姹�" },
+  { key: "mrs_1", label: "2. 蹇冭剰涓嶉��" },
+  { key: "mrs_2", label: "3. 鐫$湢澶卞父" },
+  { key: "mrs_3", label: "4. 鎯呯华浣庤惤" },
+  { key: "mrs_4", label: "5. 鏄撴��" },
+  { key: "mrs_5", label: "6. 鐒﹁檻" },
+  { key: "mrs_6", label: "7. 韬綋鎴栫簿绁炵柌鎯�" },
+  { key: "mrs_7", label: "8. 鎬х敓娲婚棶棰�" },
+  { key: "mrs_8", label: "9. 鑶�鑳变笉閫�" },
+  { key: "mrs_9", label: "10. 闃撮亾骞叉订" },
+  { key: "mrs_10", label: "11. 鍏宠妭鍜岃倢鑲変笉閫�" },
+];
+
+const KEYS = MRS_ITEMS.map((i) => i.key);
+
 export default {
-  name:"MRSScoreTable",
-  props:{ value:{ type:Object, default:()=>({}) }, editing:Boolean },
-  data(){ return { scoreOptions:[0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] }; },
-  computed:{
-    items(){
-      const names=["娼儹鍑烘睏","蹇冭剰涓嶉��","鐫$湢闅滅","鎯呯华鎶戦儊","鏄撴縺鎯�","鐒﹁檻","浣撳姏/绮惧姏涓嬮檷","鎬у姛鑳�","娉屽翱绯荤棁鐘�","闃撮亾骞叉订","鍏宠妭鑲岃倝涓嶉��"];
-      return names.map((n,i)=>({ item:n, key:'mrs_'+i, score:this.value['mrs_'+i]||0 }));
-    },
-    totalScore(){ return this.items.reduce((s,i)=>s+i.score,0).toFixed(1); },
+  name: "MRSScoreTable",
+  props: {
+    value: { type: Object, default: () => ({}) },
+    patient: { type: Object, default: () => ({}) },
+    editing: Boolean,
   },
-  watch:{
-    items:{ deep:true, handler(v){
-      const obj={...this.value, mrsTotal:this.totalScore};
-      v.forEach(i=>{ obj[i.key]=i.score; });
-      this.$emit('input',obj);
-    }},
+  data() {
+    return { items: MRS_ITEMS, local: this.normalize(this.value) };
+  },
+  computed: {
+    totalScore() { return KEYS.reduce((s, k) => s + (Number(this.local[k]) || 0), 0); },
+    severity() {
+      const t = this.totalScore;
+      if (t <= 4) return "鏃犵棁鐘�/鏋佽交寰�";
+      if (t <= 8) return "杞诲害";
+      if (t <= 15) return "涓害";
+      return "閲嶅害";
+    },
+    levelClass() {
+      const t = this.totalScore;
+      return t <= 4 ? "lv-good" : t <= 8 ? "lv-mid" : t <= 15 ? "lv-warn" : "lv-bad";
+    },
+  },
+  watch: {
+    value: {
+      deep: true,
+      handler(v) {
+        const n = this.normalize(v);
+        if (JSON.stringify(n) !== JSON.stringify(this.local)) this.local = n;
+      },
+    },
+    local: {
+      deep: true,
+      handler(v) {
+        const out = this.buildOut(v);
+        if (JSON.stringify(out) !== JSON.stringify(this.value)) this.$emit("input", out);
+      },
+    },
+  },
+  methods: {
+    normalize(v) {
+      const src = v || {};
+      const out = { date: src.date || "", evaluator: src.evaluator || "" };
+      KEYS.forEach((k) => { out[k] = Number(src[k]) || 0; });
+      return out;
+    },
+    buildOut(v) {
+      return Object.assign({}, v, { mrsTotal: this.totalScore, mrsSeverity: this.severity });
+    },
   },
 };
 </script>
+
+<style scoped>
+.scale-title { margin-bottom: 10px; font-size: 16px; font-weight: 700; text-align: center; color: #303133; }
+.scale-head { margin-bottom: 10px; }
+.scale-tip { margin-bottom: 10px; padding: 6px 10px; font-size: 13px; color: #606266; line-height: 1.6; background: #f8f9fb; border-left: 3px solid #c0c4cc; }
+.mrs-table { margin-bottom: 12px; }
+.scale-result { margin-top: 6px; }
+.mrs-range { margin-top: 8px; font-size: 12px; color: #909399; }
+.lv-good { color: #67c23a; }
+.lv-mid { color: #409eff; }
+.lv-warn { color: #e6a23c; }
+.lv-bad { color: #f56c6c; }
+</style>

--
Gitblit v1.9.3