From d23ab1d66456d5dd8aa8645bb262deef4e70a9eb Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期五, 17 一月 2025 19:02:01 +0800
Subject: [PATCH] 2

---
 src/views/hosp/order/index.vue |  248 ++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 210 insertions(+), 38 deletions(-)

diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 4c6f0cf..9d7b6c4 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -141,20 +141,25 @@
         >
       </el-form-item>
     </el-form>
-    <template v-for="(item, index) in shijianlist"  >
-  <div  :key="index" style="margin-bottom: 20px" v-if="shijianlist.length > 0">
-    {{findNameByTjnum(item.tjNUm) }}
-    <el-steps :space="200" :active="item.sjz" finish-status="success" align-center>
-      <el-step title="鏈"></el-step>
-      <el-step title="鍦ㄦ"></el-step>
-      <el-step title="宸插畬鎴�"></el-step>
-      <el-step title="宸插鏍�"></el-step>
-      <el-step title="鐢熸垚鎶ュ憡"></el-step>
-      <el-step title="鎶ュ憡鏍告敹"></el-step>
-      <el-step title="宸插嚭鎶ュ憡"></el-step>
-    </el-steps>
-  </div>
-</template>
+
+    <div v-if="shijianlist.length > 0" style="margin-bottom: 20px">
+      {{ findNameByTjnum(shijianlist[shijianlist.length - 1].tjNUm) }}
+      <el-steps
+        :space="200"
+        :active="shijianlist[shijianlist.length - 1].sjz"
+        finish-status="success"
+        align-center
+      >
+        <el-step title="鏈"></el-step>
+        <el-step title="鍦ㄦ"></el-step>
+        <el-step title="宸插畬鎴�"></el-step>
+        <el-step title="宸插鏍�"></el-step>
+        <el-step title="鐢熸垚鎶ュ憡"></el-step>
+        <el-step title="鎶ュ憡鏍告敹"></el-step>
+        <el-step title="宸插嚭鎶ュ憡"></el-step>
+      </el-steps>
+    </div>
+
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
@@ -225,6 +230,16 @@
           :disabled="single"
           v-hasPermi="['hosp:order:export']"
           >鎵撳嵃琛ュ綍鍗�</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          size="mini"
+          @click="ForceChexiao"
+          :disabled="single"
+          v-hasPermi="['qzcx']"
+          >寮哄埗鎾ら攢</el-button
         >
       </el-col>
       <right-toolbar
@@ -643,6 +658,7 @@
                       width="260px"
                     >
                     </el-table-column>
+                  
                     <el-table-column prop="proPrice" label="鍘熶环" width="56px">
                     </el-table-column>
 
@@ -747,7 +763,9 @@
                 >
                   <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
                   </el-table-column>
-                  <el-table-column prop="proPrice" label="鍘熶环" width="56px">
+                  <el-table-column prop="sl" label="鏁伴噺" width="56px">
+                  </el-table-column>
+                    <el-table-column prop="proPrice" label="鍘熶环" width="56px">
                   </el-table-column>
                   <el-table-column
                     prop="proName"
@@ -755,6 +773,7 @@
                     width="260px"
                   >
                   </el-table-column>
+             
 
                   <el-table-column
                     label="鎿嶄綔"
@@ -826,7 +845,7 @@
                         style="width: 90px"
                       ></el-input>
                     </el-form-item>
-                    <el-form-item label="浠樻绫诲瀷" prop="payType">
+                    <el-form-item label="浠樻绫诲瀷">
                       <el-select
                         style="width: 120px"
                         v-model="payType"
@@ -1096,7 +1115,9 @@
           >
             <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
             </el-table-column>
-            <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px">
+            <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="200px">
+            </el-table-column>
+            <el-table-column prop="sl" label="鏁伴噺" width="56px">
             </el-table-column>
             <el-table-column prop="proPrice" label="鍘熶环" width="56px">
             </el-table-column>
@@ -1123,7 +1144,90 @@
         </div>
       </div>
 
-      <div class="heji">
+      <el-form
+        :model="form"
+        inline
+        style="display: flex; justify-content: space-between; margin-top: 20px"
+      >
+        <!-- 浣撴绫诲瀷 -->
+        <el-form-item label="浣撴绫诲瀷" prop="tjType" style="display: flex">
+          <div class="type">
+            {{ { 1: "鍥㈤槦", 2: "涓汉", 3: "鍥綋绁�" }[form.tjType] }}
+          </div>
+        </el-form-item>
+
+        <!-- 鍘熶环 -->
+        <el-form-item label="鍘熶环" style="display: flex">
+          <el-input
+            placeholder="鍘熶环"
+            :value="TotalPrice1"
+            disabled
+            style="width: 90px"
+          ></el-input>
+        </el-form-item>
+
+        <!-- 鎶樻墸璁惧畾 -->
+        <el-form-item label="鎶樻墸" style="display: flex">
+          <el-input
+            style="width: 90px"
+            type="number"
+            v-model="discount"
+            :value="discount"
+          ></el-input>
+        </el-form-item>
+
+        <!-- 搴斾粯閲戦 -->
+        <el-form-item label="搴斾粯" style="display: flex">
+          <el-input
+            placeholder="搴斾粯閲戦"
+            :value="TotalPrice1 * (discount / 10)"
+            style="width: 90px"
+          ></el-input>
+        </el-form-item>
+
+        <!-- 浠樻绫诲瀷 -->
+        <el-form-item label="浠樻绫诲瀷" prop="payType" style="display: flex">
+          <el-select
+            style="width: 120px"
+            v-model="payType"
+            placeholder="璇烽�夋嫨浠樻绫诲瀷"
+            @change="onPayTypeChange"
+          >
+            <el-option
+              v-for="dict in dict.type.dict_pay_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <!-- 缁撶畻鏂瑰紡 -->
+        <el-form-item label="缁撶畻鏂瑰紡" prop="jsType" style="display: flex">
+          <el-select
+            v-model="jsType"
+            placeholder="璇烽�夋嫨缁撶畻鏂瑰紡"
+            style="width: 130px"
+            clearable
+          >
+            <el-option
+              v-for="dict in dict.type.reservation_pay_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+
+        <!-- 鎻愪氦鎸夐挳 -->
+        <el-form-item style="display: flex">
+          <el-button type="primary" @click="submitPrice1" :disabled="confirm">
+            鎻愪氦
+          </el-button>
+        </el-form-item>
+      </el-form>
+
+      <!-- <div class="heji">
         <div class="o">
           <el-form
             :model="form"
@@ -1178,6 +1282,21 @@
                 ></el-option>
               </el-select>
             </el-form-item>
+            <el-form-item label="缁撶畻鏂瑰紡" prop="payType">
+              <el-select
+                v-model="payType"
+                placeholder="璇烽�夋嫨缁撶畻鏂瑰紡"
+                style="width: 130px"
+                clearable
+              >
+                <el-option
+                  v-for="dict in dict.type.reservation_pay_type"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
             <el-form-item style="display: flex">
               <el-button
                 type="primary"
@@ -1188,7 +1307,7 @@
             </el-form-item>
           </el-form>
         </div>
-      </div>
+      </div> -->
     </el-dialog>
 
     <!-- 娣诲姞鎴栦慨鏀逛綋妫�璁板綍瀵硅瘽妗� -->
@@ -1501,6 +1620,7 @@
   getTransitionInfo,
   getBlproByTjh,
   revokeBlProByBldhAndTjh,
+  getForceChexiao,
 } from "@/api/hosp/order";
 import moment from "moment";
 import { getZhList, getlistByZhId } from "@/api/system/package";
@@ -1519,12 +1639,11 @@
   queryCompany,
   addbatch,
 } from "@/api/team/tuanti";
-import { createLogger } from "vuex";
 export default {
   components: {
     ViewPdf,
   },
-  dicts: ["dict_pay_type", "dict_team"],
+  dicts: ["dict_pay_type", "dict_team", "reservation_pay_type"],
   name: "Order",
   data() {
     return {
@@ -1567,6 +1686,7 @@
       packagedataList: [],
       cusId: "",
       payType: "0",
+      jsType: "0",
       packageList: [],
       checkedkeys: [],
       dialogVisible: false,
@@ -1705,9 +1825,11 @@
   },
   methods: {
     findNameByTjnum(tjnum) {
-    const order = this.orderList.find(orderItem => orderItem.tjNumber === tjnum);
-    return order ? order.tjCustomerName : '鏈壘鍒�';  // 濡傛灉鎵句笉鍒板搴旂殑椤癸紝杩斿洖涓�涓粯璁ゅ��
-  },
+      const order = this.orderList.find(
+        (orderItem) => orderItem.tjNumber === tjnum
+      );
+      return order ? order.tjCustomerName : "鏈壘鍒�"; // 濡傛灉鎵句笉鍒板搴旂殑椤癸紝杩斿洖涓�涓粯璁ゅ��
+    },
     // 鎼滅储
     getRemoteData(query) {
       if (query) {
@@ -1827,7 +1949,6 @@
       // 鑾峰彇鍗曚綅淇℃伅闆嗗悎
       getCompany(this.queryParams).then((response) => {
         this.CompanyList = response.data;
-        console.log(this.CompanyList, 555);
 
         this.loading = false;
       });
@@ -1922,6 +2043,45 @@
         .catch(() => {
           this.$message.error("鏃犳硶鑾峰彇鐢ㄦ埛淇℃伅锛�");
         });
+    },
+
+    // 寮哄埗鎾ら攢鎸夐挳
+    ForceChexiao() {
+      const tjNum = this.tjnumbers;
+      this.$confirm(
+        "鎮ㄦ槸鍚﹂渶瑕佸己鍒舵挙閿�锛熸挙閿�鍚庤浜哄憳鏈浣撴璁板綍涓嶅彲鎭㈠锛�",
+        "纭淇℃伅",
+        {
+          distinguishCancelAndClose: true,
+          confirmButtonText: "纭",
+          cancelButtonText: "鍙栨秷",
+          customClass: "custom-message-box",
+        }
+      )
+
+        .then(() => {
+          getForceChexiao(tjNum).then((res) => {
+            this.$modal.msgSuccess("鎾ら攢鎴愬姛");
+            this.getList();
+          });
+        })
+        .catch((action) => {
+          if (action === "cancel") {
+            this.$message({
+              type: "warning",
+              message: "宸插彇娑�",
+            });
+          }
+        });
+      this.$nextTick(() => {
+        // 纭繚寮规娓叉煋鍚庡簲鐢ㄦ牱寮�
+        const messageBox = document.querySelector(
+          ".custom-message-box .el-message-box__message"
+        );
+        if (messageBox) {
+          messageBox.style.color = "red"; // 閫氳繃 JS 寮哄埗璁剧疆棰滆壊
+        }
+      });
     },
 
     handleRevoke() {
@@ -2128,13 +2288,11 @@
       this.multiple = !selection.length;
       if (tjNUms.length > 0) {
         shijianzhou(tjNUms).then((res) => {
-        this.shijianlist = res.data
-      });
-      } else{
-        this.shijianlist = []
+          this.shijianlist = res.data;
+        });
+      } else {
+        this.shijianlist = [];
       }
-      
-
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
     // handleAdd() {
@@ -2156,7 +2314,7 @@
         var discount = "";
         response.data.water.forEach((item) => {
           copeWith += item.copeWith;
-          paidIn += item.copeWith;
+          paidIn += item.paidIn;
           discount = item.discount;
         });
         this.bill.push({
@@ -2197,7 +2355,7 @@
         var discount = "";
         response.data.water.forEach((item) => {
           copeWith += item.copeWith;
-          paidIn += item.copeWith;
+          paidIn += item.paidIn;
           discount = item.discount;
         });
         this.bill.push({
@@ -2308,8 +2466,10 @@
         let datas = {
           zhId: data.id,
         };
+        
         getlistByZhId(datas).then((res) => {
           this.packagedataList = res.data.tjProjectList;
+          
           for (var i = 0; i < this.packagedataList.length; i++) {
             let proId = this.packagedataList[i].proId;
             getProSonDxList(proId).then((res) => {
@@ -2461,7 +2621,6 @@
             this.checkedListkey.push(item.proId);
             this.DataList.push(item);
             this.DataList3 = this.DataList.concat(this.Datalists);
-            console.log(this.DataList, 77777);
             this.spliceData();
             this.DataList.forEach((item1) => {
               if (item1.proParentId == data.proId) {
@@ -2472,7 +2631,8 @@
           this.TotalPrice1 = 0;
           if (this.DataList3.length != 0) {
             this.DataList3.forEach((item) => {
-              this.TotalPrice1 += item.proPrice;
+              
+              this.TotalPrice1 += item.proPrice * item.sl;
             });
           }
           // this.TotalPrice1 = 0;
@@ -2516,7 +2676,9 @@
             this.DataList.splice(index, 1);
             this.TotalPrice1 = 0;
             this.DataList.forEach((item1) => {
+                          
               this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+              
             });
             if (this.marryalls != 0) {
               this.TotalPrice1 += this.marryalls;
@@ -2525,7 +2687,6 @@
         });
       } else if (checked == true) {
         this.DataList.push(data);
-        console.log(this.DataList, 6666);
         this.DataList.forEach((item1) => {
           if (item1.proParentId == this.dataObj.proId) {
             item1.propinName = this.dataObj.proName;
@@ -2534,6 +2695,9 @@
         this.spliceData();
         this.TotalPrice1 = 0;
         this.DataList.forEach((item1) => {
+          console.log(item1.proPrice,3322);
+          console.log(this.TotalPrice1,1122);
+          
           this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
         });
         if (this.marryalls != 0) {
@@ -2739,10 +2903,12 @@
             discount,
             copeWith,
             tjType,
+            payStasus:this.jsType,
             orderId: this.orderIds,
             tjProIds: this.proIds,
             payType: this.payType,
           };
+          
           getwater(data).then((res) => {
             this.$modal.msgSuccess("鎻愪氦鎴愬姛");
             this.mobanId = res.data.mobanId;
@@ -2866,6 +3032,12 @@
 // .el-dialog__body {
 //   padding: 20px;
 // }
+::v-deep .el-message-box__message {
+  color: red !important; /* 寮哄埗璁剧疆棰滆壊涓虹孩鑹� */
+}
+// .custom-message-box .el-message-box__message {
+//   color: red !important; /* 璁剧疆鏂囧瓧涓虹孩鑹� */
+// }
 .o {
   margin-top: 8px;
 }
@@ -2913,6 +3085,7 @@
   display: flex;
   flex-direction: column;
 }
+
 ::v-deep .el-step__title.is-process {
   color: rgb(24, 144, 255);
 }
@@ -2920,9 +3093,8 @@
   color: rgb(24, 144, 255);
   border-color: rgb(24, 144, 255);
 }
-.shijian{
+.shijian {
   display: flex;
   align-items: flex-start;
- 
 }
 </style>

--
Gitblit v1.8.0