From 5319d5b95497b5b546947ac340c14c71e5b54ca6 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 10 十二月 2025 09:57:58 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/patient/index.vue |  571 +++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 431 insertions(+), 140 deletions(-)

diff --git a/src/views/patient/patient/index.vue b/src/views/patient/patient/index.vue
index 44a9947..3092bca 100644
--- a/src/views/patient/patient/index.vue
+++ b/src/views/patient/patient/index.vue
@@ -1,7 +1,7 @@
 <template>
   <div class="Questionnairemanagement">
     <!-- 宸︿晶鏍� -->
-    <div class="sidecolumn">
+    <!-- <div class="sidecolumn">
       <div class="sidecolumn-top">
         <div class="top-wj">鍖婚櫌鎮h��</div>
       </div>
@@ -12,13 +12,12 @@
           v-model="queryParams.allhosp"
           @tab-click="handleClick"
         >
-          <!-- <el-tab-pane label="鎮h�呭垪琛�" name="0"></el-tab-pane> -->
           <el-tab-pane label="鍑哄叆闄㈡偅鑰�" name="1"></el-tab-pane>
           <el-tab-pane label="闂ㄨ瘖鎮h��" name="2"></el-tab-pane>
           <el-tab-pane label="浣撴鎮h��" name="3"></el-tab-pane>
         </el-tabs>
       </div>
-    </div>
+    </div> -->
     <!-- 鍙充晶鏁版嵁 -->
 
     <div class="leftvlue">
@@ -58,49 +57,6 @@
               v-show="showSearch"
               label-width="98px"
             >
-              <!-- <el-form-item label="闄㈠尯" prop="userName">
-                <el-select v-model="queryParams.value1" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item> -->
-              <!-- <el-form-item label="绉戝/鐥呭尯" prop="userName">
-                <el-select v-model="queryParams.value2" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item> -->
-              <el-form-item
-                label-width="138px"
-                label="涓绘不鍖荤敓"
-                prop="userName"
-              >
-                <el-input
-                  v-model="queryParams.drname"
-                  placeholder="璇疯緭鍏ュ尰鐢熷鍚�"
-                  maxlength="30"
-                  @keyup.enter.native="handleQuery"
-                />
-              </el-form-item>
-
-              <el-form-item label="闂ㄨ瘖缂栧彿" prop="visitno">
-                <el-input
-                  v-model="queryParams.visitno"
-                  placeholder="璇疯緭鍏ョ紪鍙�"
-                  maxlength="30"
-                  @keyup.enter.native="handleQuery"
-                />
-              </el-form-item>
               <el-form-item label="鎮h�呭鍚�" prop="name">
                 <el-input
                   v-model="queryParams.name"
@@ -109,20 +65,30 @@
                   @keyup.enter.native="handleQuery"
                 />
               </el-form-item>
-              <el-form-item label="鎮h�呰寖鍥�" prop="tagId">
-            <el-select
-                v-model="queryParams.searchscope"
-                placeholder="璇烽�夋嫨鎮h�呰寖鍥�"
-              >
-                <el-option
-                  v-for="item in source"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+              <el-form-item label="鎮h�呮爣绛�" prop="tagname">
+                <el-input
+                  v-model="queryParams.tagname"
+                  placeholder="杈撳叆杩涜妯$硦鏌ヨ"
+                  maxlength="30"
+                  @keyup.enter.native="handleQuery"
+                />
+              </el-form-item>
+              <el-form-item label="鎮h�呮�у埆" prop="tagId">
+                <el-select
+                  v-model="queryParams.sex"
+                  placeholder="璇烽�夋嫨鎮h�呮�у埆"
                 >
-                </el-option>
-              </el-select>
-          </el-form-item>
+                  <el-option label="鐢�" :value="1"> </el-option>
+                  <el-option label="濂�" :value="2"> </el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="鎮h�呭勾榫�" prop="telcode">
+                <el-input
+                  v-model="queryParams.age"
+                  placeholder="璇疯緭鍏ユ煡璇㈠勾榫�"
+                  @keyup.enter.native="handleQuery"
+                />
+              </el-form-item>
               <el-form-item label="鑱旂郴鐢佃瘽" prop="telcode">
                 <el-input
                   v-model="queryParams.telcode"
@@ -150,7 +116,7 @@
             </el-form>
 
             <el-row :gutter="10" class="mb8">
-              <el-col :span="1.5">
+              <!-- <el-col :span="1.5">
                 <el-button
                   type="primary"
                   plain
@@ -160,7 +126,7 @@
                   v-hasPermi="['system:user:add']"
                   >鏂板</el-button
                 >
-              </el-col>
+              </el-col> -->
 
               <el-col :span="1.5">
                 <el-button
@@ -215,17 +181,10 @@
             <el-table
               v-loading="loading"
               :data="userList"
-               height="660"
+              height="660"
               @selection-change="handleSelectionChange"
             >
               <el-table-column type="selection" width="50" align="center" />
-              <!-- <el-table-column
-                fixed
-                label="搴忓彿"
-                align="center"
-                key="id"
-                prop="id"
-              /> -->
               <el-table-column
                 fixed
                 label="濮撳悕"
@@ -233,6 +192,14 @@
                 key="name"
                 prop="name"
               />
+              <el-table-column
+                label="鎮h�呯紪鍙�"
+                align="center"
+                key="patientno"
+                prop="patientno"
+                width="180"
+              />
+
               <el-table-column label="鎬у埆" align="center" key="sex" prop="sex">
                 <template slot-scope="scope">
                   <span>{{ scope.row.sex == 1 ? "鐢�" : "濂�" }}</span>
@@ -243,8 +210,16 @@
                 align="center"
                 key="age"
                 prop="age"
-                width="60"
-              />
+                width="160"
+              >
+                <template slot-scope="scope">
+                  <span v-if="scope.row.age"
+                    >{{ scope.row.age }}{{ scope.row.ageUnit }}</span
+                  ><span v-if="scope.row.age2"
+                    >{{ scope.row.age2 }}{{ scope.row.ageUnit2 }}</span
+                  >
+                </template>
+              </el-table-column>
               <el-table-column
                 label="鍑虹敓骞存湀"
                 align="center"
@@ -275,7 +250,7 @@
                   </span>
                 </template>
               </el-table-column>
-             <el-table-column
+              <el-table-column
                 label="璇佷欢鍙风爜"
                 align="center"
                 key="idcardno"
@@ -297,7 +272,7 @@
                 prop="createTime"
                 width="160"
               >
-              <template slot-scope="scope">
+                <template slot-scope="scope">
                   <span>{{ formatTime(scope.row.createTime) }}</span>
                 </template>
               </el-table-column>
@@ -343,11 +318,19 @@
                   <el-button
                     size="medium"
                     type="text"
-                    @click="Distributionservice(scope.row)"
+                    @click="openContractDialog(scope.row)"
                     ><span class="button-textxg"
-                      ><i class="el-icon-menu"></i>鏈嶅姟</span
+                      ><i class="el-icon-menu"></i>鎮h�呯绾�</span
                     ></el-button
                   >
+                  <!-- <el-button
+                    size="medium"
+                    type="text"
+                    @click="RiskMarker(scope.row)"
+                    ><span class="button-textxg"
+                      ><i class="el-icon-menu"></i>椋庨櫓鏍囪</span
+                    ></el-button
+                  > -->
                 </template>
               </el-table-column>
             </el-table>
@@ -524,7 +507,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row  v-if="!amendtag">
+        <el-row v-if="!amendtag">
           <el-col :span="8">
             <el-form-item label="姘戞棌" prop="name">
               <el-input
@@ -556,7 +539,7 @@
 
         <el-row v-if="!amendtag">
           <el-col :span="12">
-            <el-form-item label="鍑虹敓鍦�" prop="idcardno">
+            <el-form-item label="鍑虹敓鍦�" prop="birthplace">
               <el-input
                 v-model="form.birthplace"
                 placeholder="鍥姐�佺渷銆佸湴甯傘�佸尯鍘裤�佽閬撶瓑璇︾粏淇℃伅"
@@ -564,7 +547,7 @@
               />
             </el-form-item> </el-col
           ><el-col :span="12">
-            <el-form-item label="灞呬綇鍦�" prop="idcardno">
+            <el-form-item label="灞呬綇鍦�" prop="placeOfResidence">
               <el-input
                 v-model="form.placeOfResidence"
                 placeholder="鍥姐�佺渷銆佸湴甯傘�佸尯鍘裤�佽閬撶瓑璇︾粏淇℃伅"
@@ -575,7 +558,7 @@
         </el-row>
 
         <el-row>
-          <el-col :span="amendtag?12:24"v-if="!amendtag" >
+          <el-col :span="amendtag ? 12 : 24" v-if="!amendtag">
             <el-form-item label="鎮h�呯被鍨�">
               <el-select v-model="form.pattype" placeholder="璇烽�夋嫨绫诲瀷">
                 <el-option
@@ -649,20 +632,19 @@
           :limit="1"
           accept=".xlsx, .xls"
           :headers="upload.headers"
-          :action="upload.url + '?updateSupport=' + upload.updateSupport"
+          :action="upload.url"
           :disabled="upload.isUploading"
           :on-progress="handleFileUploadProgress"
           :on-success="handleFileSuccess"
-          :auto-upload="false"
           drag
         >
           <i class="el-icon-upload"></i>
           <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
           <div class="el-upload__tip text-center" slot="tip">
-            <div class="el-upload__tip" slot="tip">
+            <!-- <div class="el-upload__tip" slot="tip">
               <el-checkbox v-model="upload.updateSupport" />
               鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
-            </div>
+            </div> -->
             <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
             <el-link
               type="primary"
@@ -671,7 +653,7 @@
               @click="importTemplate"
               >涓嬭浇妯℃澘
             </el-link>
-            <el-link
+            <!-- <el-link
               type="success"
               :underline="false"
               style="font-size: 24px; vertical-align: baseline"
@@ -679,7 +661,7 @@
               target="_blank"
             >
               鏌ョ湅妯℃澘</el-link
-            >
+            > -->
           </div>
         </el-upload>
       </div>
@@ -758,20 +740,149 @@
       </div>
     </el-dialog>
     <!-- 璺宠浆鏈嶅姟瀵硅瘽妗� -->
-    <el-dialog title="閫夋嫨鏈嶅姟绫诲瀷" :visible.sync="serviceVisible">
-      <el-card class="box-card">
-        <el-radio-group v-model="serviceradio">
-          <el-radio :label="1">瀹f暀闅忚</el-radio>
-          <el-radio :label="2">闂ㄨ瘖鏈嶅姟</el-radio>
-          <el-radio :label="3">鍑洪櫌鏈嶅姟</el-radio>
-          <el-radio :label="4">澶嶈瘖鏈嶅姟</el-radio>
-          <el-radio :label="5">浣撴閫氱煡</el-radio>
-          <el-radio :label="6">闂嵎鏈嶅姟</el-radio>
+    <!-- 绠�鍖栫増鎮h�呯绾﹀璇濇 -->
+    <el-dialog
+      title="鎮h�呯绾︽湇鍔�"
+      :visible.sync="contractDialogVisible"
+      width="600px"
+    >
+      <!-- 姝ラ鎸囩ず鍣� -->
+      <el-steps
+        :active="contractStep"
+        align-center
+        simple
+        style="margin-bottom: 20px"
+      >
+        <el-step title="閫夋嫨鏈嶅姟" icon="el-icon-document"></el-step>
+        <el-step title="纭绛剧害" icon="el-icon-finished"></el-step>
+      </el-steps>
+
+      <!-- 姝ラ1: 鏈嶅姟閫夋嫨 -->
+      <div v-if="contractStep === 1" class="step-content">
+        <h4>璇蜂负 {{ currentPatient.name }} 閫夋嫨绛剧害鏈嶅姟濂楅锛�</h4>
+
+        <el-radio-group
+          v-model="tempContractData.servicePackage"
+          style="width: 100%"
+        >
+          <el-row :gutter="16">
+            <el-col :span="8" v-for="pkg in servicePackages" :key="pkg.id">
+              <el-card
+                :class="[
+                  'package-card',
+                  { active: tempContractData.servicePackage === pkg.id },
+                ]"
+                @click.native="tempContractData.servicePackage = pkg.id"
+                shadow="hover"
+                style="margin-bottom: 16px; cursor: pointer"
+              >
+                <div style="text-align: center">
+                  <h4>{{ pkg.name }}</h4>
+                  <p style="color: #666; font-size: 12px; margin: 8px 0">
+                    {{ pkg.description }}
+                  </p>
+                  <p style="color: #e6a23c; font-weight: bold">
+                    {{ pkg.price > 0 ? `楼${pkg.price}/骞碻 : "鍏嶈垂" }}
+                  </p>
+                  <el-tag
+                    v-for="feature in pkg.features"
+                    :key="feature"
+                    size="mini"
+                    style="margin: 2px"
+                    type="info"
+                    >{{ feature }}</el-tag
+                  >
+                </div>
+              </el-card>
+            </el-col>
+          </el-row>
         </el-radio-group>
+
+        <el-form label-width="80px" style="margin-top: 20px">
+          <el-form-item label="绛剧害鍛ㄦ湡">
+            <el-select
+              v-model="tempContractData.contractPeriod"
+              placeholder="璇烽�夋嫨"
+            >
+              <el-option label="1骞�" :value="1"></el-option>
+              <el-option label="2骞�" :value="2"></el-option>
+              <el-option label="3骞�" :value="3"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="澶囨敞淇℃伅">
+            <el-input
+              type="textarea"
+              :rows="2"
+              v-model="tempContractData.remark"
+              placeholder="鍙~鍐欑壒娈婂仴搴烽渶姹傛垨澶囨敞淇℃伅"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <!-- 姝ラ2: 绛剧害纭 -->
+      <div v-if="contractStep === 2" class="step-content">
+        <el-card>
+          <h4>绛剧害淇℃伅纭</h4>
+          <el-descriptions :column="1" border>
+            <el-descriptions-item label="鎮h�呭鍚�">{{
+              currentPatient.name
+            }}</el-descriptions-item>
+            <el-descriptions-item label="鎮h�呯紪鍙�">{{
+              currentPatient.patientno
+            }}</el-descriptions-item>
+            <el-descriptions-item label="鏈嶅姟濂楅">
+              {{ getSelectedPackage().name }}
+            </el-descriptions-item>
+            <el-descriptions-item label="绛剧害鍛ㄦ湡"
+              >{{ tempContractData.contractPeriod }}骞�</el-descriptions-item
+            >
+            <el-descriptions-item label="绛剧害鏃ユ湡">{{
+              new Date().toLocaleDateString()
+            }}</el-descriptions-item>
+            <el-descriptions-item label="澶囨敞淇℃伅">{{
+              tempContractData.remark || "鏃�"
+            }}</el-descriptions-item>
+          </el-descriptions>
+        </el-card>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="prevStep" v-if="contractStep > 1">涓婁竴姝�</el-button>
+        <el-button @click="closeContractDialog">鍙栨秷</el-button>
+        <el-button
+          type="primary"
+          @click="nextStep"
+          :disabled="contractStep === 1 && !tempContractData.servicePackage"
+        >
+          {{ contractStep === 2 ? "纭绛剧害" : "涓嬩竴姝�" }}
+        </el-button>
+      </div>
+    </el-dialog>
+    <!-- 椋庨櫓绫诲瀷 -->
+    <el-dialog title="閫夋嫨椋庨櫓绫诲瀷" :visible.sync="RiskVisible">
+      <el-card class="box-card">
+        <el-form>
+          <el-form-item label="椋庨櫓绫诲瀷">
+            <el-radio-group v-model="Riskradio">
+              <el-radio :label="1">姝e父</el-radio>
+              <el-radio :label="2">杞诲井</el-radio>
+              <el-radio :label="3">楂樺嵄</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="娲诲姩鎬ц川">
+            <el-checkbox-group v-model="Risklist">
+              <el-checkbox label="鎯呭喌1" name="type"></el-checkbox>
+              <el-checkbox label="鎯呭喌2" name="type"></el-checkbox>
+              <el-checkbox label="鎯呭喌3" name="type"></el-checkbox>
+              <el-checkbox label="鎯呭喌4" name="type"></el-checkbox>
+            </el-checkbox-group>
+          </el-form-item>
+        </el-form>
       </el-card>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="serviceVisible = false">鍙� 娑�</el-button>
-        <el-button type="primary" @click="CreateService">鍒涘缓鏈嶅姟</el-button>
+        <el-button @click="RiskVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="RiskService">纭淇敼</el-button>
       </div>
     </el-dialog>
   </div>
@@ -798,7 +909,12 @@
 
 export default {
   name: "Patient",
-  dicts: ["sys_normal_disable", "task_status", "sys_user_sex",'futter_patient'],
+  dicts: [
+    "sys_normal_disable",
+    "task_status",
+    "sys_user_sex",
+    "futter_patient",
+  ],
   components: { Treeselect },
   data() {
     return {
@@ -815,6 +931,7 @@
       // 鎬绘潯鏁�
       total: 0,
       tasktotal: 0,
+      Risklist: [],
       // 鐢ㄦ埛琛ㄦ牸鏁版嵁
       userList: null,
       taskuserList: null,
@@ -833,18 +950,88 @@
       serviceVisible: false,
       serviceradio: 1,
       distributeVisible: false,
-      tasktopic: "5", //鏂板绫诲瀷
+      RiskVisible: false,
+      tasktopic: "2", //鏂板绫诲瀷
+      Riskradio: 1,
+      RiskObj: {},
       // 鏌ヨ鍙傛暟
       topqueryParams: {
         pageNum: 1,
         pageSize: 10,
+        type: 2,
         userName: undefined,
         tagid: undefined,
         topic: undefined,
       },
       // 鏃ユ湡鑼冨洿
       dateRange: [],
-      taskoptions: [],
+      contractDialogVisible: false, // 鎺у埗绛剧害瀵硅瘽妗嗘樉绀�
+      contractStep: 1, // 绛剧害姝ラ锛�1-閫夋嫨鏈嶅姟 2-纭淇℃伅
+      currentPatient: {}, // 褰撳墠绛剧害鐨勬偅鑰呬俊鎭�
+      tempContractData: {
+        // 涓存椂瀛樺偍鐨勭绾︽暟鎹�
+        servicePackage: null, // 閫変腑鐨勬湇鍔″椁�
+        contractPeriod: 1, // 绛剧害鍛ㄦ湡锛堝勾锛�
+        remark: "", // 澶囨敞淇℃伅
+      },
+      // 妯℃嫙鏁版嵁锛氬彲閫夌殑绛剧害鏈嶅姟濂楅
+      servicePackages: [
+        {
+          id: 1,
+          name: "鍩虹鍋ュ悍绠$悊鍖�",
+          description: "鍖呭惈瀹氭湡鍋ュ悍璇勪及銆佸熀鏈挩璇�",
+          price: 0,
+          features: ["骞村害鍋ュ悍璇勪及", "鍦ㄧ嚎鍜ㄨ"],
+        },
+        {
+          id: 2,
+          name: "鎱㈡�х梾绠$悊鍖�",
+          description: "涓撲负鎱㈡�х梾鎮h�呰璁�",
+          price: 299,
+          features: ["涓撳睘鍖荤敓", "鐢ㄨ嵂鎻愰啋", "瀹氭湡闅忚"],
+        },
+        {
+          id: 3,
+          name: "鑰佸勾浜哄仴搴峰寘",
+          description: "鍏虫敞鑰佸勾浜哄仴搴烽棶棰�",
+          price: 499,
+          features: ["璺屽�掗闄╄瘎浼�", "搴峰鎸囧", "绱ф�ヨ仈绯�"],
+        },
+      ],
+      taskoptions: [
+        // {
+        //   value: "1",
+        //   label: "鐩戞祴璇勪及",
+        // },
+        {
+          value: "2",
+          label: "鍑洪櫌闅忚",
+        },
+        {
+          value: "3",
+          label: "闂ㄨ瘖闅忚",
+        },
+        {
+          value: "4",
+          label: "瀹f暀鍏虫��",
+        },
+        {
+          value: "5",
+          label: "澶嶈瘖绠$悊",
+        },
+        // {
+        //   value: "6",
+        //   label: "婊℃剰搴﹁皟鏌�",
+        // },
+        {
+          value: "7",
+          label: "鎮h�呮姤鍛�",
+        },
+        {
+          value: "8",
+          label: "鍏朵粬閫氱煡",
+        },
+      ],
       paperstypes: [
         { papersname: "韬唤璇�" },
         { papersname: "鎶ょ収" },
@@ -875,7 +1062,6 @@
           value: 2,
           label: "濂�",
         },
-
       ],
 
       cardlist: [
@@ -950,14 +1136,17 @@
         // 璁剧疆涓婁紶鐨勮姹傚ご閮�
         headers: { Authorization: "Bearer " + getToken() },
         // 涓婁紶鐨勫湴鍧�
-        url: process.env.VUE_APP_BASE_API + "/system/user/importData",
+        url: process.env.VUE_APP_BASE_API + "/smartor/import/importPatInfo",
       },
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
-        allhosp: "1",
+        allhosp: "0",
+        sex: 1,
         pageSize: 10,
-        searchscope:2,
+        searchscope: 2,
+        notrequiredFlag: 0,
+        tagname: "",
         idcardno: undefined,
         name: undefined,
         status: undefined,
@@ -989,7 +1178,7 @@
         ],
 
         idcardno: [
-          { required: true, message: "璇佷欢鍙疯兘涓虹┖", trigger: "blur" },
+          { required: true, message: "璇佷欢鍙峰彲鑳戒负绌�", trigger: "blur" },
           {
             pattern:
               /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/,
@@ -999,6 +1188,9 @@
         ],
         placeOfResidence: [
           { required: true, message: "灞呬綇鍦颁笉鑳戒负绌�", trigger: "blur" },
+        ],
+        birthplace: [
+          { required: true, message: "鍑虹敓鍦颁笉鑳戒负绌�", trigger: "blur" },
         ],
       },
     };
@@ -1012,8 +1204,12 @@
   created() {
     this.getList();
     this.gettabList();
+    this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
+      (obj) => obj.deptCode
+    );
+    this.topqueryParams.leavehospitaldistrictcodes =
+      store.getters.belongWards.map((obj) => obj.districtCode);
     //鑾峰彇宸茬瓫閫夊悗鐨勫彲閫変换鍔$被鍨�
-    this.taskoptions = store.getters.Serviceauthority;
   },
   methods: {
     /** 鏌ヨ鎮h�呭垪琛� */
@@ -1022,11 +1218,11 @@
         this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
           (obj) => obj.deptCode
         );
-        this.queryParams.leavehospitaldistrictcodes=null;
+        this.queryParams.leavehospitaldistrictcodes = null;
       } else if (this.queryParams.searchscope == 2) {
         this.queryParams.leavehospitaldistrictcodes =
           store.getters.belongWards.map((obj) => obj.districtCode);
-          this.queryParams.leaveldeptcodes=null;
+        this.queryParams.leaveldeptcodes = null;
       } else {
         this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
           (obj) => obj.deptCode
@@ -1071,8 +1267,80 @@
         this.loading = false;
       });
     },
-    Distributionservice(row) {
-      this.serviceVisible = true;
+    openContractDialog(row) {
+      this.currentPatient = { ...row }; // 璁剧疆褰撳墠鎮h��
+      this.contractDialogVisible = true;
+      this.contractStep = 1;
+      // 閲嶇疆琛ㄥ崟鏁版嵁
+      this.tempContractData = {
+        servicePackage: null,
+        contractPeriod: 1,
+        remark: "",
+      };
+    },
+    // 涓嬩竴姝ユ搷浣�
+    nextStep() {
+      if (this.contractStep < 2) {
+        this.contractStep++;
+      } else {
+        this.submitContract();
+      }
+    },
+
+    // 涓婁竴姝ユ搷浣�
+    prevStep() {
+      if (this.contractStep > 1) {
+        this.contractStep--;
+      }
+    },
+    // 鑾峰彇閫変腑鐨勬湇鍔″椁愪俊鎭�
+    getSelectedPackage() {
+      return (
+        this.servicePackages.find(
+          (pkg) => pkg.id === this.tempContractData.servicePackage
+        ) || {}
+      );
+    },
+
+    // 妯℃嫙鎻愪氦绛剧害淇℃伅
+    submitContract() {
+      // 杩欓噷鏄墠绔ā鎷熸搷浣滐紝瀹為檯寮�鍙戜腑搴旈�氳繃API鎻愪氦鏁版嵁
+      const contractInfo = {
+        patientId: this.currentPatient.id,
+        patientName: this.currentPatient.name,
+        package: this.getSelectedPackage(),
+        period: this.tempContractData.contractPeriod,
+        signDate: new Date().toISOString().split("T")[0],
+        remark: this.tempContractData.remark,
+      };
+
+      console.log("妯℃嫙绛剧害鏁版嵁:", contractInfo);
+
+      // 妯℃嫙鎴愬姛鎻愮ず
+      this.$message.success(
+        `宸叉垚鍔熶负 ${this.currentPatient.name} 绛剧害 ${
+          this.getSelectedPackage().name
+        }`
+      );
+
+      // 鍏抽棴瀵硅瘽妗�
+      this.closeContractDialog();
+
+      // 鍙互鍦ㄨ繖閲岃Е鍙戝叾浠栨搷浣滐紝濡傚埛鏂版偅鑰呭垪琛ㄧ瓑
+    },
+    // 鍏抽棴瀵硅瘽妗嗗苟閲嶇疆鐘舵��
+    closeContractDialog() {
+      this.contractDialogVisible = false;
+      this.contractStep = 1;
+      this.tempContractData = {
+        servicePackage: null,
+        contractPeriod: 1,
+        remark: "",
+      };
+    },
+    RiskMarker(row) {
+      this.RiskVisible = true;
+      this.RiskObj = row;
     },
 
     // 鍙栨秷鎸夐挳
@@ -1096,15 +1364,18 @@
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
-
       this.queryParams.pageNum = 1;
       this.getList();
     },
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
       this.dateRange = [];
-      this.resetForm("queryForm");
-      this.$refs.tree.setCurrentKey(null);
+      this.queryParams = {
+        pageNum: 1,
+        allhosp: "0",
+        pageSize: 10,
+        searchscope: 2,
+      };
       this.handleQuery();
     },
     // 澶氶�夋閫変腑鏁版嵁
@@ -1122,13 +1393,12 @@
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
-      const userIds = row.id || this.ids;
-      particularpatient(userIds).then((response) => {
-        console.log(response);
-        this.form = response.data;
-      });
-      this.amendtag = true;
-      this.Labelchange = true;
+      // const userIds = row.id || this.ids;
+      // particularpatient(userIds).then((response) => {
+      //   this.form = response.data;
+      // });
+      // this.amendtag = true;
+      // this.Labelchange = true;
     },
     //淇敼/鏂板鎮h��
     submitForm() {
@@ -1184,25 +1454,34 @@
         query: { type: this.serviceradio },
       });
     },
+    RiskService() {
+      this.RiskObj.visitFlag = this.Risklist.join(", ");
+      this.RiskObj.visitType = this.Riskradio;
+      alterpatient(this.RiskObj).then((res) => {
+        if (res.code == 200) {
+          this.getList();
+          this.Risklist = [];
+          this.Riskradio = 1;
+          this.$modal.msgSuccess("寮傚父璁板綍鎴愬姛");
+        }
+      });
+    },
     distribute() {
       this.distributeVisible = true;
-      if (this.tasktopic == 1) {
-        this.topqueryParams.type = 3;
-      } else if (this.tasktopic == 2) {
-        this.topqueryParams.type = 1;
-      } else if (this.tasktopic == 3) {
-        this.topqueryParams.type = 1;
-      } else if (this.tasktopic == 4) {
-        this.topqueryParams.type = 1;
+      if (
+        this.tasktopic == 2 ||
+        this.tasktopic == 3 ||
+        this.tasktopic == 1 ||
+        this.tasktopic == 7 ||
+        this.tasktopic == 6
+      ) {
+        this.topqueryParams.type = "2";
+      } else if (this.tasktopic == 4 || this.tasktopic == 8) {
+        this.topqueryParams.type = "3";
       } else if (this.tasktopic == 5) {
-        this.topqueryParams.type = 1;
-      } else if (this.tasktopic == 6) {
-        this.topqueryParams.type = 2;
+        this.topqueryParams.type = "1";
       }
-      this.topqueryParams.typename = this.findLabelByValue(
-        this.taskoptions,
-        this.tasktopic
-      );
+      this.topqueryParams.serviceType = Number(this.tasktopic);
       getTasklist(this.topqueryParams).then((response) => {
         this.taskuserList = response.rows;
         this.tasktotal = response.total;
@@ -1227,7 +1506,7 @@
     /** 涓嬭浇妯℃澘鎿嶄綔 */
     importTemplate() {
       this.download(
-        "system/user/importTemplate",
+        "smartor/import/getImportPatTemplate",
         {},
         `user_template_${new Date().getTime()}.xlsx`
       );
@@ -1269,9 +1548,9 @@
 </script>
 
 <style lang="scss" scoped>
-.Questionnairemanagement {
-  display: flex;
-}
+// .Questionnairemanagement {
+//   display: flex;
+// }
 .sidecolumn {
   width: 180px;
   min-height: 100vh;
@@ -1307,6 +1586,18 @@
     margin-top: 30px;
     display: center !important;
   }
+}
+.package-card.active {
+  border-color: #409EFF;
+  background-color: #f0f9ff;
+}
+
+.step-content {
+  min-height: 300px;
+}
+
+.dialog-footer {
+  text-align: right;
 }
 .preview-left {
   margin: 20px;
@@ -1351,8 +1642,8 @@
   cursor: pointer; /* 榧犳爣鎮诞鏃跺彉涓烘墜褰� */
 }
 .leftvlue {
-  width: 80%;
-  margin-top: 10px;
+  width: 100%;
+  // margin-top: 10px;
 }
 .leftvlue-bg {
   //   display: flex;

--
Gitblit v1.9.3