su
su1124
2024-03-08 b989da3c3a99fef9068c20ac55467d7ce25523af
src/views/hosp/settlement/index.vue
@@ -1,46 +1,151 @@
<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-input v-model="queryParams.tollCollectorName" placeholder="请输入收费员" clearable @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="结账时间" prop="tollCollectorName">
        <el-date-picker v-model="value1" type="datetimerange" start-placeholder="起止日期" end-placeholder="终止日期" :default-time="['12:00:00']">
        </el-date-picker>
      </el-form-item>
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="100px"
    >
      <el-row>
        <el-col :span="6">
          <el-form-item
            label="收费员"
            prop="tollCollectorName"
            style="display: flex"
          >
            <el-input
              v-model="queryParams.tollCollectorName"
              placeholder="请输入收费员"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-form-item
            label="结账时间"
            prop="tollCollectorName"
            style="display: flex"
          >
            <el-date-picker
              v-model="value1"
              type="datetimerange"
              start-placeholder="起止日期"
              end-placeholder="终止日期"
              :default-time="['00:00:00', '23:00:00']"
              format="yyyy-MM-dd HH:mm:ss"
              value-format="yyyy-MM-dd HH:mm:ss"
              @change="dateChangebirthday1"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-edit" size="mini" @click="handleUpdate" v-hasPermi="['hosp:water:edit']">统计</el-button>
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="mini"
          @click="handleUpdate"
          >统计</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-check" size="mini" @click="handlesettle" :disabled="discode === 200 ? true : false" v-hasPermi="['hosp:water:export']" >结账</el-button>
        <el-button
          type="primary"
          icon="el-icon-check"
          size="mini"
          @click="handlesettle"
          :disabled="discode === 200 ? true : false"
          >结账</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" size="mini" v-hasPermi="['hosp:water:remove']" @click="handleabout">日结查询</el-button>
        <el-button type="primary" size="mini" @click="handleabout"
          >日结查询</el-button
        >
      </el-col>
    </el-row>
    <el-table :data="dataList" border style="width: 75%">
      <el-table-column label="姓名" align="center" prop="cusName" width="140px" :show-overflow-tooltip="true"/>
      <el-table-column label="订单流水号" align="center" prop="waterId" width="149px" :show-overflow-tooltip="true"/>
      <el-table-column label="应收金额" align="center" prop="copeWith" width="90px" :show-overflow-tooltip="true"/>
      <el-table-column label="折扣" align="center" prop="discount" width="90px" :show-overflow-tooltip="true"/>
      <el-table-column label="实收金额" align="center" prop="paidIn" width="90px" :show-overflow-tooltip="true"/>
      <el-table-column label="付款状态" align="center" prop="payStasus" width="100px" :show-overflow-tooltip="true"/>
      <el-table-column label="付款方式" align="center" prop="payType" width="100px" :show-overflow-tooltip="true"/>
      <el-table-column label="收费员" align="center" prop="updateBy" width="140px" :show-overflow-tooltip="true"/>
      <el-table-column label="收费时间" align="center" prop="updateTime" width="180px" :show-overflow-tooltip="true"/>
      <el-table-column label="退费时间" align="center" prop="refundTime" width="180px" :show-overflow-tooltip="true"/>
      <el-table-column
        label="姓名"
        align="center"
        prop="cusName"
        width="91px"
      />
      <el-table-column
        label="订单流水号"
        align="center"
        prop="waterId"
        width="186px"
      />
      <el-table-column
        label="应收金额"
        align="center"
        prop="copeWith"
        width="90px"
      />
      <el-table-column
        label="折扣"
        align="center"
        prop="discount"
        width="90px"
      />
      <el-table-column
        label="实收金额"
        align="center"
        prop="paidIn"
        width="90px"
      />
      <el-table-column
        label="付款状态"
        align="center"
        prop="payStasus"
        width="100px"
      />
      <el-table-column
        label="付款方式"
        align="center"
        prop="payType"
        width="100px"
      />
      <el-table-column
        label="收费员"
        align="center"
        prop="updateBy"
        width="140px"
      />
      <el-table-column
        label="收费时间"
        align="center"
        prop="updateTime"
        width="180px"
      />
      <el-table-column
        label="退费时间"
        align="center"
        prop="refundTime"
        width="200px"
      />
    </el-table>
    <div class="pag">
          <div class="pag1">
            <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
              :limit.sync="queryParams.pageSize" @pagination="handleUpdate"  />
          </div>
        </div>
      <div class="pag1">
        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="handleUpdate"
        />
      </div>
    </div>
    <el-table
      border
@@ -59,8 +164,9 @@
</template>
<script>
import { getLastTime, getList, collector } from "@/api/hosp/water";
import { getLastTime, getList, collector, getNewDate } from "@/api/hosp/water";
import { getInfo } from "@/api/login";
import { getNewDateList } from "@/api/hosp/order";
import moment from "moment";
export default {
@@ -115,8 +221,18 @@
  },
  created() {
    this.getList();
    this.getdate();
  },
  methods: {
    getdate() {
      getNewDateList().then((res) => {
        this.value1 = [
          moment(res.data).format("YYYY-MM-DD 00:00:00"),
          moment(res.data).format("YYYY-MM-DD 23:59:00"),
        ];
        console.log(this.createTimeList, 111);
      });
    },
    /** 查询体检流水列表 */
    getList() {
      this.loading = true;
@@ -124,74 +240,36 @@
        this.userId = response.user.userId;
        this.queryParams.tollCollectorName = response.user.nickName;
      });
      getLastTime().then((response) => {
        if (response.code === 200) {
          this.time = response.data;
          this.value1 = [
            moment(this.time).format("YYYY-MM-DD HH:mm:ss"),
            new Date(new Date().getTime() + 8 * 3600 * 1000)
              .toJSON()
              .substr(0, 19)
              .replace("T", " "),
          ];
        } else {
          this.time = response.msg;
          this.value1 = [
            this.time,
            new Date(new Date().getTime() + 8 * 3600 * 1000)
              .toJSON()
              .substr(0, 19)
              .replace("T", " "),
          ];
        }
      });
      // listWater(this.queryParams).then(response => {
      //   this.waterList = response.rows;
      //   for (let i = 0; i < response.rows.length; i++) {
      //     response.rows[i].nweID = i + 1;
      // getLastTime().then((response) => {
      //   if (response.code === 200) {
      //     this.time = response.data;
      //     getNewDate().then((response) => {
      //       if (response.code === 200) {
      //         this.value1 = [
      //           moment(this.time).format("YYYY-MM-DD HH:mm:ss"),
      //           moment(response.data).format("YYYY-MM-DD HH:mm:ss")
      //         ];
      //       }
      //     });
      //   }
      //   this.total = response.total;
      //   this.loading = false;
      // });
      // getDaily().then(res => {
      //   this.tableData = res.data.list
      //   this.tableData.forEach(item => {
      //     if (item.payStasus == "0") {
      //       item.payStasus = "未付款"
      //     } else if (item.payStasus == "1") {
      //       item.payStasus = "已付款"
      //     } else {
      //       item.payStasus = "退费"
      //     }
      //     if (item.payType == "0") {
      //       item.payType = "现金"
      //     } else if (item.payType == "1") {
      //       item.payType = "刷卡"
      //     } else if (item.payType == "2") {
      //       item.payType = "支付宝"
      //     } else if (item.payType == "3") {
      //       item.payType = "微信"
      //     } else {
      //       item.payType = "云闪付"
      //     }
      //   })
      //   this.loading = false;
      // })
    },
    // 时间
    dateChangebirthday1(val) {
      this.value1 = val;
      console.log(this.value1);
    },
    /** 统计 */
    handleUpdate() {
      this.loading = true;
      let data = {
        pageNum:this.queryParams.pageNum,
        pageSize:this.queryParams.pageSize,
        pageNum: this.queryParams.pageNum,
        pageSize: this.queryParams.pageSize,
        userId: this.userId.toString(),
        beginTime: moment(this.time).format("YYYY-MM-DD HH:mm:ss"),
        endTime: new Date(new Date().getTime() + 8 * 3600 * 1000)
          .toJSON()
          .substr(0, 19)
          .replace("T", " "),
        beginTime: this.value1[0],
        endTime: this.value1[1],
      };
      getList(data).then((res) => {
        this.dataList = res.data.list;
@@ -311,7 +389,7 @@
              type: "success",
            });
            this.$forceUpdate();
            this.handleUpdate();
            this.getList();
            const accountId = res.msg;
            const viewNum = "809743614817824768";
            const params = { viewNum, accountId };