From c36ada6253862acaa44a1dc0eb5b9cbb28e68fd8 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期二, 21 一月 2025 11:08:41 +0800
Subject: [PATCH] 1

---
 src/views/hosp/order/index.vue |  146 +++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 137 insertions(+), 9 deletions(-)

diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 6aa8be0..8aae299 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -177,6 +177,7 @@
           type="primary"
           size="mini"
           @click="handleRevoke"
+          :loading="isLoading"
           :disabled="single"
           >鎾ら攢绛惧埌</el-button
         >
@@ -658,6 +659,7 @@
                       width="260px"
                     >
                     </el-table-column>
+
                     <el-table-column prop="proPrice" label="鍘熶环" width="56px">
                     </el-table-column>
 
@@ -762,6 +764,8 @@
                 >
                   <el-table-column prop="propinName" label="妫�鏌ラ」鐩�">
                   </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>
                   <el-table-column
@@ -841,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"
@@ -861,6 +865,7 @@
                         type="primary"
                         @click="submitPrice"
                         :disabled="confirm"
+                        :loading="isSubmit"
                         style="margin-top: 34px"
                         >鎻愪氦</el-button
                       >
@@ -1111,7 +1116,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>
@@ -1138,7 +1145,95 @@
         </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"
+            :loading="isSubmit1"
+            @click="submitPrice1"
+            :disabled="confirm"
+          >
+            鎻愪氦
+          </el-button>
+        </el-form-item>
+      </el-form>
+
+      <!-- <div class="heji">
         <div class="o">
           <el-form
             :model="form"
@@ -1193,6 +1288,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"
@@ -1203,7 +1313,7 @@
             </el-form-item>
           </el-form>
         </div>
-      </div>
+      </div> -->
     </el-dialog>
 
     <!-- 娣诲姞鎴栦慨鏀逛綋妫�璁板綍瀵硅瘽妗� -->
@@ -1539,7 +1649,7 @@
   components: {
     ViewPdf,
   },
-  dicts: ["dict_pay_type", "dict_team"],
+  dicts: ["dict_pay_type", "dict_team", "reservation_pay_type"],
   name: "Order",
   data() {
     return {
@@ -1555,6 +1665,9 @@
       DataList3: [],
       bldhid: "",
       budadaozhen: false,
+      isLoading: false,
+      isSubmit: false,
+      isSubmit1: false,
       huizongList: [],
       DataLists: [],
       infoList: [],
@@ -1582,6 +1695,7 @@
       packagedataList: [],
       cusId: "",
       payType: "0",
+      jsType: "0",
       packageList: [],
       checkedkeys: [],
       dialogVisible: false,
@@ -1844,7 +1958,6 @@
       // 鑾峰彇鍗曚綅淇℃伅闆嗗悎
       getCompany(this.queryParams).then((response) => {
         this.CompanyList = response.data;
-        console.log(this.CompanyList, 555);
 
         this.loading = false;
       });
@@ -1981,6 +2094,7 @@
     },
 
     handleRevoke() {
+      this.isLoading = true;
       this.$confirm("鎮ㄧ‘璁よ鎾ら攢锛�", "纭淇℃伅", {
         distinguishCancelAndClose: true,
         confirmButtonText: "纭",
@@ -1989,6 +2103,7 @@
         .then(() => {
           revokeTjOrderByTjNum(this.tjnumbers).then((res) => {
             this.$modal.msgSuccess("鎾ら攢鎴愬姛");
+            // this.isLoading = false;
             this.getList();
           });
         })
@@ -1999,6 +2114,10 @@
               message: "宸插彇娑�",
             });
           }
+        })
+        .finally(() => {
+          // 涓嶈鎿嶄綔鎴愬姛杩樻槸澶辫触锛岄兘浼氭墽琛�
+          this.isLoading = false;
         });
     },
     /** 鐐瑰嚮鏄剧ず浣撴鎶ュ憡鎶ヨ〃*/
@@ -2362,8 +2481,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) => {
@@ -2515,7 +2636,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) {
@@ -2526,7 +2646,7 @@
           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;
@@ -2579,7 +2699,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;
@@ -2588,6 +2707,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) {
@@ -2714,6 +2836,7 @@
     // 鏀惰垂鎸夐挳
     submitPrice() {
       this.proIds = [];
+      this.isSubmit = true;
       if (this.DataList.length != 0) {
         this.DataList.forEach((item) => {
           this.proIds.push(item.proId);
@@ -2749,6 +2872,7 @@
             payType: this.payType,
           };
           getwater(data).then((res) => {
+            this.isSubmit = false;
             this.$modal.msgSuccess("鎻愪氦鎴愬姛");
             this.mobanId = res.data.mobanId;
             this.waterId = res.data.waterId;
@@ -2764,6 +2888,7 @@
     // 鏀惰垂鎸夐挳
     submitPrice1() {
       this.proIds = [];
+      this.isSubmit1 = true;
       if (this.DataList.length != 0) {
         this.DataList.forEach((item) => {
           this.proIds.push(item.proId);
@@ -2793,10 +2918,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;
@@ -2806,6 +2933,7 @@
             const params = { viewNum, tjnumber };
             this.$tab.openPage("鏀舵灏忕エ", "/report/charge", params);
             this.Projectopen1 = false;
+            this.isSubmit1 = false;
           });
         }
       });

--
Gitblit v1.8.0