From b989da3c3a99fef9068c20ac55467d7ce25523af Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期五, 08 三月 2024 14:25:04 +0800
Subject: [PATCH] su

---
 src/views/hosp/about/index.vue |  280 ++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 204 insertions(+), 76 deletions(-)

diff --git a/src/views/hosp/about/index.vue b/src/views/hosp/about/index.vue
index 046b9b0..abbc99b 100644
--- a/src/views/hosp/about/index.vue
+++ b/src/views/hosp/about/index.vue
@@ -1,52 +1,154 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
-      <el-form-item label="浜ゆ鍛�" prop="tollCollectorName">
-        <el-select v-model="queryParams.tollCollectorName" filterable style="width: 200px" placeholder="璇烽�夋嫨浜ゆ鍛�" clearable
-          @clear="getCompanyList" @change="idFn">
-          <el-option v-for="dict in CompanyList" :key="dict.userId" :label="dict.nickName" :value="dict.userId" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="浜よ处鏃堕棿" prop="tollCollectorName">
-        <el-date-picker v-model="value1" type="datetimerange" :picker-options="pickerOptions"
-          value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="璧锋鏃ユ湡" end-placeholder="缁堟鏃ユ湡" :default-time="['12:00:00']">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
-      </el-form-item>
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="110px"
+    >
+      <el-row>
+        <el-col :span="6">
+          <el-form-item
+            label="浜ゆ鍛�"
+            prop="tollCollectorName"
+            style="display: flex"
+          >
+            <el-select
+              v-model="queryParams.tollCollectorName"
+              filterable
+              placeholder="璇烽�夋嫨浜ゆ鍛�"
+              clearable
+              @clear="getCompanyList"
+              @change="idFn"
+            >
+              <el-option
+                v-for="dict in CompanyList"
+                :key="dict.userId"
+                :label="dict.nickName"
+                :value="dict.userId"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="14">
+          <el-form-item
+            label="浜よ处鏃堕棿"
+            prop="tollCollectorName"
+            style="display: flex"
+          >
+            <el-date-picker
+              v-model="value1"
+              type="datetimerange"
+              :picker-options="pickerOptions"
+              :default-time="['00:00:00', '23:59:00']"
+              format="yyyy-MM-dd HH:mm"
+              value-format="yyyy-MM-dd HH:mm"
+              start-placeholder="璧锋鏃ユ湡"
+              end-placeholder="缁堟鏃ユ湡"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="3">
+          <el-form-item>
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="mini"
+              @click="handleQuery"
+              >鎼滅储</el-button
+            >
+          </el-form-item>
+        </el-col>
+      </el-row>
     </el-form>
 
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button icon="el-icon-edit" size="mini" @click="handleDelete" >鎾ら攢</el-button>
+        <el-button icon="el-icon-edit" size="mini" @click="handleDelete"
+          >鎾ら攢</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button icon="el-icon-edit" size="mini" @click="handledocument"
-         >琛ユ墦鍗曟嵁</el-button>
+          >琛ユ墦鍗曟嵁</el-button
+        >
       </el-col>
     </el-row>
 
-    <el-table :row-class-name="tableRowClassName" style="width: 80%" :data="tableData" @selection-change="handleSelect"
-      ref="multipleTable" border>
+    <el-table
+      :row-class-name="tableRowClassName"
+      style="width: 80%"
+      :data="tableData"
+      @selection-change="handleSelect"
+      ref="multipleTable"
+      border
+    >
       <el-table-column type="selection" width="55"> </el-table-column>
-      <el-table-column label="浜ゆ鍛�" align="center" prop="tollCollector" :show-overflow-tooltip="true" />
-      <el-table-column label="鏀惰垂閲戦" align="center" prop="amountReceived" :show-overflow-tooltip="true" />
-      <el-table-column label="閫�璐归噾棰�" align="center" prop="refundAmount" :show-overflow-tooltip="true" />
-      <el-table-column label="搴斾氦娆�" align="center" prop="payable" :show-overflow-tooltip="true" />
-      <el-table-column label="浜よ处鏃堕棿" align="center" prop="createTime" :show-overflow-tooltip="true" />
-      <el-table-column label="璧锋鏃ユ湡" align="center" prop="accountBeginTime" :show-overflow-tooltip="true" />
-      <el-table-column label="缁堟鏃ユ湡" align="center" prop="accountEndTime" :show-overflow-tooltip="true" />
+      <el-table-column
+        label="浜ゆ鍛�"
+        align="center"
+        prop="tollCollector"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="鏀惰垂閲戦"
+        align="center"
+        prop="amountReceived"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="閫�璐归噾棰�"
+        align="center"
+        prop="refundAmount"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="搴斾氦娆�"
+        align="center"
+        prop="payable"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="浜よ处鏃堕棿"
+        align="center"
+        prop="createTime"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="璧锋鏃堕棿"
+        align="center"
+        prop="accountBeginTime"
+        :show-overflow-tooltip="true"
+      />
+      <el-table-column
+        label="鎴鏃堕棿"
+        align="center"
+        prop="accountEndTime"
+        :show-overflow-tooltip="true"
+      />
     </el-table>
 
     <div class="pag">
       <div class="pag1">
-        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-          @pagination="getList" />
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
       </div>
     </div>
 
-    <el-table :data="allList" style="margin-top: 60px; width: 80%" show-summary border>
+    <el-table
+      :data="allList"
+      style="margin-top: 60px; width: 80%"
+      show-summary
+      border
+    >
       <el-table-column label="浠樻鏂瑰紡" align="center" prop="payType" />
       <el-table-column label="鏀惰垂閲戦" align="center" prop="amountReceived">
       </el-table-column>
@@ -57,7 +159,13 @@
 </template>
   
 <script>
-import { getcolllist, getdatalist, delById } from "@/api/hosp/water";
+import { getNewDateList } from "@/api/hosp/order";
+import {
+  getcolllist,
+  getdatalist,
+  delById,
+  getNewDate,
+} from "@/api/hosp/water";
 import { getInfo } from "@/api/login";
 import moment from "moment";
 
@@ -68,7 +176,7 @@
       pickerOptions: {
         shortcuts: [
           {
-            text: "鏈�杩戜竴鍛�",
+            text: "杩戜竴鍛�",
             onClick(picker) {
               const end = new Date();
               const start = new Date();
@@ -77,7 +185,7 @@
             },
           },
           {
-            text: "鏈�杩戜竴涓湀",
+            text: "杩戜竴鏈�",
             onClick(picker) {
               const end = new Date();
               const start = new Date();
@@ -86,7 +194,7 @@
             },
           },
           {
-            text: "鏈�杩戜笁涓湀",
+            text: "杩戜笁鏈�",
             onClick(picker) {
               const end = new Date();
               const start = new Date();
@@ -121,6 +229,7 @@
       showSearch: true,
       // 鎬绘潯鏁�
       total: 0,
+      item: "",
       userId: "",
       // 寮瑰嚭灞傛爣棰�
       title: "",
@@ -148,7 +257,6 @@
   created() {
     this.getList();
     this.getCompanyList();
-
   },
   methods: {
     /** 鏌ヨ浣撴娴佹按鍒楄〃 */
@@ -157,42 +265,57 @@
         this.userId = response.user.userId;
         this.queryParams.tollCollectorName = response.user.nickName;
       });
-      let data = {
-        tollCollectorId: this.tollCollectorId,
-        accountBeginTime: this.value1[0],
-        accountEndTime: new Date(new Date().getTime() + 8 * 3600 * 1000)
-          .toJSON()
-          .substr(0, 19)
-          .replace("T", " "),
-        pageNum: this.queryParams.pageNum,
-        pageSize: this.queryParams.pageSize,
-      };
-      getcolllist(data).then((res) => {
-        this.tableData = res.data.list;
-        if (this.tableData.length === 0) {
-          this.$message({
-            message: '璇锋悳绱㈣鎾ら攢鏁版嵁鐨勬椂闂存鍝',
-            type: 'warning'
-          });
-        }
-        if (res.code === 200) {
-          if (this.tableData.length != 0) {
-            this.$nextTick(() => {
-              this.$refs.multipleTable.toggleRowSelection(
-                this.tableData[0],
-                true
-              );
-            });
-          } else {
-            this.$refs.multipleTable.clearSelection();
-          }
-        }
 
-        // this.tableData.forEach(item => {
-        //   this.allList = item.tjTollCollectorDetailList
-        // })
-        this.total = res.data.total;
+      // getNewDate().then((response) => {
+      //   if (response.code === 200) {
+      //     this.value1 = [
+      //       moment(response.data).format("YYYY-MM-DD 00:00:00"),
+      //       moment(response.data).format("YYYY-MM-DD HH:mm:ss"),
+      //     ];
+      //   }
+      // });
+      getNewDateList().then((response) => {
+        if (response.code === 200) {
+          this.value1 = [
+            moment(response.data).format("YYYY-MM-DD 00:00:00"),
+            moment(response.data).format("YYYY-MM-DD 23:59:00"),
+          ];
+        }
       });
+
+      // let data = {
+      //   tollCollectorId: this.tollCollectorId,
+      //   accountBeginTime: this.value1[0],
+      //   accountEndTime: this.value1[1],
+      //   pageNum: this.queryParams.pageNum,
+      //   pageSize: this.queryParams.pageSize,
+      // };
+      // getcolllist(data).then((res) => {
+      //   this.tableData = res.data.list;
+      //   if (this.tableData.length === 0) {
+      //     this.$message({
+      //       message: '璇锋悳绱㈣鎾ら攢鏁版嵁鐨勬椂闂存鍝',
+      //       type: 'warning'
+      //     });
+      //   }
+      //   if (res.code === 200) {
+      //     if (this.tableData.length != 0) {
+      //       this.$nextTick(() => {
+      //         this.$refs.multipleTable.toggleRowSelection(
+      //           this.tableData[0],
+      //           true
+      //         );
+      //       });
+      //     } else {
+      //       this.$refs.multipleTable.clearSelection();
+      //     }
+      //   }
+
+      //   // this.tableData.forEach(item => {
+      //   //   this.allList = item.tjTollCollectorDetailList
+      //   // })
+      //   this.total = res.data.total;
+      // });
     },
     // 閫変腑涓嬫媺妗咺d
     idFn(value) {
@@ -212,15 +335,13 @@
       let data = {
         tollCollectorId: this.tollCollectorId,
         accountBeginTime: this.value1[0],
-        accountEndTime: new Date(new Date().getTime() + 8 * 3600 * 1000)
-          .toJSON()
-          .substr(0, 19)
-          .replace("T", " "),
+        accountEndTime: this.value1[1],
         pageNum: this.queryParams.pageNum,
         pageSize: this.queryParams.pageSize,
       };
       getcolllist(data).then((res) => {
         this.tableData = res.data.list;
+        this.allList = [];
         if (this.tableData.length != 0) {
           this.$nextTick(() => {
             this.$refs.multipleTable.toggleRowSelection(
@@ -241,7 +362,7 @@
         this.total = res.data.total;
       });
     },
-    handleUpdate() { },
+    handleUpdate() {},
 
     // 琛ㄦ牸鍗曢��
     handleSelect(selection, val) {
@@ -259,7 +380,7 @@
     },
     handledocument() {
       const viewNum = "809743614817824768";
-      let accountId =  this.selectList[0].accountId
+      let accountId = this.selectList[0].accountId;
       const params = { viewNum, accountId };
       this.$tab.openPage("缁撹处鍗�", "/report/settlement", params);
     },
@@ -282,6 +403,7 @@
           type: "success",
         });
         this.getList();
+        this.handleQuery();
       });
     },
   },
@@ -291,6 +413,11 @@
 <style>
 .el-table__header-wrapper .el-checkbox {
   display: none;
+}
+
+.el-date-editor--datetimerange.el-input,
+.el-date-editor--datetimerange.el-input__inner {
+  width: 100%;
 }
 
 .pag {
@@ -303,7 +430,7 @@
   width: 30%;
 }
 
-.el-table__body tr.current-row>td {
+.el-table__body tr.current-row > td {
   background-color: #f19944 !important;
   /* color: #f19944; */
   /* 璁剧疆鏂囧瓧棰滆壊锛屽彲浠ラ�夋嫨涓嶈缃� */
@@ -311,4 +438,5 @@
 
 .el-table .warning-row {
   background: #e5f3ff !important;
-}</style>
\ No newline at end of file
+}
+</style>
\ No newline at end of file

--
Gitblit v1.8.0