zhangxiaoxu
2026-06-17 9697dfd0004335bab3bf5626425eab3130a55ec6
pages/home/home.vue
@@ -4,11 +4,240 @@
      <view class="home_swipe"><u-swiper :list="list3" indicator indicatorMode="line" circular></u-swiper></view>
      <!-- 图表 -->
      <combined-title title="煤仓库存明细"></combined-title>
      <view class="charts-box">
      <combined-title v-if="uchartsData && uchartsData.length > 0" title="煤仓库存明细"></combined-title>
      <view class="charts-box" v-if="uchartsData && uchartsData.length > 0">
         <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" v-if="uchartsData.length > 0" />
         <u-empty mode="data" iconSize="200" textSize="25" width="350" height="350" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="uchartsData.length == 0"></u-empty>
      </view>
    <view class="huoshiju-box" v-if="roles && roles.includes(2000144)">
      <!-- 产品当前价格 -->
      <view class="price-group" v-if="coalData && coalData.length > 0">
        <combined-title title="产品当前价格"></combined-title>
        <view class="price-box">
          <div class="price-box-inside">
            <uni-table border stripe emptyText="暂无更多数据" >
              <uni-tr>
                <uni-th width="100" align="center">煤种</uni-th>
                <uni-th width="100" align="center">长协户(元)</uni-th>
                <uni-th width="100" align="center">普通户(元)</uni-th>
              </uni-tr>
              <uni-tr v-for="(item,index) in coalData" :key="index">
                <uni-td align="left">{{item.coalName}}</uni-td>
                <uni-td align="center">{{item.price1 || ''}}</uni-td>
                <uni-td align="center">{{item.price2 || ''}}</uni-td>
              </uni-tr>
            </uni-table>
<!--            <view class="price-line">
              <view class="name">中煤</view>
              <view class="price"><view class="priceNum">344</view><view class="priceUnit">元</view></view>
            </view>
            <view class="price-line">
              <view class="name">中煤</view>
              <view class="price"><view class="priceNum">344</view><view class="priceUnit">元</view></view>
            </view>
            <view class="price-line">
              <view class="name">中煤</view>
              <view class="price"><view class="priceNum">344</view><view class="priceUnit">元</view></view>
            </view>
            <view class="price-line">
              <view class="name">中煤</view>
              <view class="price"><view class="priceNum">344</view><view class="priceUnit">元</view></view>
            </view>-->
          </div>
        </view>
      </view>
      <!-- 当日收款情况 -->
      <view class="shoukuan-group" v-if="shoukuanJiluTemp && shoukuanJiluTemp.length > 0">
        <view class="currentDay-box">
          <combined-title title="当日收款情况">
          </combined-title>
          <view class="total-box">
            <view class="total1">小计:</view>
            <view class="total2">{{shoukuanToatl}}
              <view class="small">元</view>
            </view>
          </view>
        </view>
        <view class="shoukuan-box">
          <div class="shoukuan-box-inside">
            <view class="shoukuan-main" v-for="(item,index) in shoukuanJilu" :key="index">
              <view class="shoukuan-line shoukuanFirst-line">
                <view class="text1">{{item.customerName || ''}}</view>
              </view>
              <view class="shoukuan-line">
                <view class="name">金额:</view>
                <view class="text1 num">{{item.money || ''}}
                   <view class="small">元</view>
                </view>
              </view>
              <view class="shoukuan-line">
                <view class="name">账套:</view>
                <view class="text1">{{item.ledgerName || ''}}</view>
              </view>
            </view>
            <view v-if="shoukuanJiluTemp && shoukuanJiluTemp.length > 2" class="shouqiIcon" @click="handleShouKuanIsMore">
              <image v-if="!shoukuanIsMore" src="@/static/home/xialaIcon.png"></image>
              <image v-else src="@/static/home/shouqiIcon.png"></image>
            </view>
          </div>
        </view>
      </view>
      <!-- 煤种发运情况 -->
      <view class="shoukuan-group" v-if="coalLoaded || coalLoading">
        <view class="currentDay-box">
          <combined-title title="煤种发运情况">
          </combined-title>
          <view class="date-pick-box" @click="openCoalCalendar">
            <text class="date-pick-text">{{coalRangeText}}</text>
            <image class="date-pick-icon" src="@/static/home/dateIcon.png"></image>
          </view>
        </view>
        <view class="block-loading" v-if="coalLoading">
          <u-loading-icon mode="circle" color="#1987FF" size="40"></u-loading-icon>
        </view>
        <view class="shoukuan-box" v-if="coalLoaded && !coalLoading">
          <view class="coalFayun-total">
            <view class="total-block">
              <view class="num">{{d2Sum || 0}}</view>
              <view class="name">总计金额(元)</view>
            </view>
            <view class="total-block">
              <view class="num">{{dsumSum || 0}}</view>
              <view class="name">汽运总计(吨)</view>
            </view>
            <view class="total-block">
              <view class="num">{{lyDSumSum || 0}}</view>
              <view class="name">路运总计(吨)</view>
            </view>
            <view class="total-block">
              <view class="num">{{d1Sum || 0}}</view>
              <view class="name">总吨数(吨)</view>
            </view>
          </view>
          <div class="shoukuan-box-inside">
            <view class="shoukuan-main" v-for="(item,index) in coalTongji" :key="index">
              <view class="shoukuan-line shoukuanFirst-line">
                <view class="text1">{{item.coalName}}</view>
              </view>
              <view class="shoukuan-line">
                <view class="name">账套:</view>
                <view class="text1">{{item.ledgerName || ''}}</view>
              </view>
              <view class="coalTongji-box">
                <view class="shoukuan-line">
                  <view class="name">单价:</view>
                  <view class="text1 num">
                    {{item.d3 || 0}}
                    <view class="small">元</view>
                  </view>
                </view>
                <view class="shoukuan-line">
                  <view class="name">金额:</view>
                  <view class="text1 num">
                    {{item.d2 || 0}}
                    <view class="small">元</view>
                  </view>
                </view>
              </view>
              <view class="coalTongji-box marginTop">
                <view class="caol-block">
                  <view class="name">日汽运量(吨)</view>
                  <view class="num">{{item.dSum || 0}}</view>
                </view>
                <view class="caol-block">
                  <view class="name">日路运量(吨)</view>
                  <view class="num">{{item.lyDSum || 0}}</view>
                </view>
                <view class="caol-block">
                  <view class="name">日合计(吨)</view>
                  <view class="num">{{item.d1 || 0}}</view>
                </view>
              </view>
            </view>
            <view class="shouqiIcon"  v-if="coalTongjiTemp && coalTongjiTemp.length > 2" @click="handleCoalIsMore">
              <image v-if="!coalShowIsMore" src="@/static/home/xialaIcon.png"></image>
              <image v-else src="@/static/home/shouqiIcon.png"></image>
            </view>
          </div>
        </view>
      </view>
      <!-- 分客户煤种发运情况 -->
      <view class="shoukuan-group" v-if="kehuLoaded || kehuLoading">
        <view class="currentDay-box">
          <combined-title title="分客户煤种发运情况">
          </combined-title>
          <view class="date-pick-box" @click="openKehuCalendar">
            <text class="date-pick-text">{{kehuRangeText}}</text>
            <image class="date-pick-icon" src="@/static/home/dateIcon.png"></image>
          </view>
        </view>
        <view class="block-loading" v-if="kehuLoading">
          <u-loading-icon mode="circle" color="#1987FF" size="40"></u-loading-icon>
        </view>
        <view class="shoukuan-box" v-if="kehuLoaded && !kehuLoading">
          <div class="shoukuan-box-inside">
            <view class="shoukuan-main" v-for="(item,index) in kehuTongji" :key="index">
              <view class="shoukuan-line">
<!--                <view class="name">客户:</view>-->
                <view class="text1">{{item.customerName}}</view>
<!--                <view class="meizhong">
                  <view class="coal">{{item.coalName}}</view>
                </view>-->
              </view>
              <view class="shoukuan-line coal-line">
                <view class="coal" v-if="item.coalName">{{item.coalName}}</view>
                <view class="coal" v-if="item.type">{{item.type || ''}}</view>
                <view class="coal" v-if="item.carSize">{{item.carSize || ''}}车</view>
              </view>
              <view class="shoukuan-line">
                <view class="name">账套:</view>
                <view class="text1">{{item.ledgerName || ''}}</view>
              </view>
<!--              <view class="coalTongji-box">
                <view class="shoukuan-line kehu-block">
                  <view class="name">车数:</view>
                  <view class="text1 num">{{item.carSize || ''}}</view>
                </view>
                <view class="shoukuan-line kehu-block">
                  <view class="name">方式:</view>
                  <view class="text1 num">{{item.type || ''}}</view>
                </view>
&lt;!&ndash;                <view class="shoukuan-line kehu-block">
                  <view class="name">煤种:</view>
                  <view class="text1">{{item.coalName}}</view>
                </view>&ndash;&gt;
              </view>-->
              <view class="coalTongji-box marginTop">
                <view class="caol-block">
                  <view class="name">发运量(吨)</view>
                  <view class="num">{{item.executive || 0}}</view>
                </view>
                <view class="caol-block">
                  <view class="name">单价(元)</view>
                  <view class="num">{{item.coalPrice || 0}}</view>
                </view>
                <view class="caol-block">
                  <view class="name">金额(元)</view>
                  <view class="num">{{item.amount || 0}}</view>
                </view>
              </view>
            </view>
            <view class="shouqiIcon" v-if="kehuTongjiTemp && kehuTongjiTemp.length > 2" @click="handlekehuTongjiShowIsMore">
              <image v-if="!kehuTongjiShowIsMore" src="@/static/home/xialaIcon.png"></image>
              <image v-else src="@/static/home/shouqiIcon.png"></image>
            </view>
          </div>
        </view>
      </view>
    </view>
      <!-- 我的申请 -->
      <combined-title title="我的申请" detailsPath="/pages/my-application/my-application" v-if="shenqingMenu"></combined-title>
      <view class="card-group">
@@ -314,6 +543,14 @@
      <!-- 菜单栏 -->
      <!-- <popup-menu @menuShow="menushow" ref="menuRef"></popup-menu> -->
      <u-gap height="15" bgColor="#eeeeee"></u-gap>
    <view class="editorPass" @click="handlePwd">
        <image class="icon" src="@/static/home/editorIcon.png"></image>
        <view class="">修改密码</view>
    </view>
    <view class="huiseBox"></view>
      <view class="utils">
         <view class="utils-container">
            <view class="utils-container-body" @click="redirectLogin">
@@ -327,6 +564,102 @@
         </view>
      </view>
      <u-gap height="60" bgColor="#eeeeee"></u-gap>
    <!-- 煤种发运情况 时间段选择 -->
    <u-calendar
        :key="'coal-' + coalCalendarKey"
        rowHeight="100"
        :show="coalCalendarShow"
        mode="range"
        :defaultDate="coalDefaultDate"
        :minDate="minDateTimestamp"
        :maxDate="maxDateTimestamp"
        :monthNum="calendarMonthNum"
        allowSameDay
        title="选择时间段"
        startText="开始"
        endText="结束"
        @confirm="coalCalendarConfirm"
        @close="coalCalendarShow = false"
    ></u-calendar>
    <!-- 分客户煤种发运情况 时间段选择 -->
    <u-calendar
        :key="'kehu-' + kehuCalendarKey"
        rowHeight="100"
        :show="kehuCalendarShow"
        mode="range"
        :defaultDate="kehuDefaultDate"
        :minDate="minDateTimestamp"
        :maxDate="maxDateTimestamp"
        :monthNum="calendarMonthNum"
        allowSameDay
        title="选择时间段"
        startText="开始"
        endText="结束"
        @confirm="kehuCalendarConfirm"
        @close="kehuCalendarShow = false"
    ></u-calendar>
    <view class="passWord-main-box">
      <u-popup :show="passShow"
               :closeable="true"
               :closeOnClickOverlay="true"
               @close="handleClosePassShow"
               mode="center"
               width="90%"
               class="passBox">
        <view class="popup-box">
          <u-form :model="formData" ref="uForm" borderBottom :rules="rules" :label-width="150">
            <u-form-item prop="password" label="原密码" borderBottom>
              <u-input
                  class="flex-1"
                  type="password"
                  v-model="formData.password"
                  :border="false"
                  placeholder="请输入原来的密码"
              />
            </u-form-item>
            <u-form-item prop="newpassword1" label="新密码" borderBottom>
              <u-input
                  class="flex-1"
                  type="password"
                  v-model="formData.newpassword1"
                  placeholder="密码应由8-16位数字、字母、符号组成。请不要使用容易被猜到的密码"
                  :border="false"
              />
            </u-form-item>
            <view class="intensity">
              <view class="psdText">密码强度</view>
              <view
                  class="line"
                  :class="[level.includes('low') ? 'low' : '']"></view>
              <view
                  class="line"
                  :class="[level.includes('middle') ? 'middle' : '']"></view>
              <view
                  class="line"
                  :class="[level.includes('high') ? 'high' : '']"></view>
              <div class="warningtext">
                密码应由8-16位数字、字母、符号组成。请不要使用容易被猜到的密码
              </div>
            </view>
            <u-form-item prop="newpassword2" label="确认密码" borderBottom>
              <u-input
                  class="flex-1"
                  type="password"
                  v-model="formData.newpassword2"
                  placeholder="再次输入新密码"
                  :border="false"
              />
            </u-form-item>
          </u-form>
          <view class="sumbmit-box">
            <u-button type="primary" shape="circle" @click="handlePassConfirm" :loading="sumbLoading"> 确定 </u-button>
          </view>
        </view>
      </u-popup>
    </view>
   </view>
</template>
@@ -338,6 +671,7 @@
import combinationCard from '@/components/common/combination-card/combination-card.vue';
import { setAccessToken, redirectLogin } from '@/utils/status.js';
import { logout } from '@/api/global.js';
import UText from "../../uni_modules/uview-ui/components/u-text/u-text.vue";
export default {
   name: 'home',
@@ -357,10 +691,156 @@
      },
      shenqingMenu() {
         return this.$store.state.shenqingMenu;
      }
      },
    // 当天日期(YYYY-MM-DD)
    todayStr() {
      return this.todayDate();
    },
    // 默认时间使用用一天的日期(YYYY-MM-DD 23:59:59)
    endTodaydayStr() {  //默认时间使用用一天的日期
      // const date = new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
      const date = new Date(new Date().getTime());
      const y = date.getFullYear();
      let m = date.getMonth() + 1;
      m = m < 10 ? '0' + m : m;
      let d = date.getDate();
      d = d < 10 ? '0' + d : d;
      let time = `${y}-${m}-${d} 23:59:59`
      return time;
    },
    // 默认起始时间(当天 00:00:00)。注意 todayStr 是 computed(取值用 this.todayStr,不能加括号当函数调)
    startTodayStr() {
      return `${this.todayStr}`;
    },
    // 可选最早日期:当前日期往前推 1 年(去年同月),允许翻到上一年的历史月份
    minDateTimestamp() {
      const d = new Date();
      d.setFullYear(d.getFullYear() - 1);
      return d.getTime();
    },
    // 可选最晚日期:当前日期往后推 1 年(明年同月)(u-calendar 要求 maxDate 必须大于当前时间)
    maxDateTimestamp() {
      const d = new Date();
      d.setFullYear(d.getFullYear() + 1);
      return d.getTime();
    },
    // u-calendar 月份滑动列表最多展示的月数。渲染量与可翻范围正相关(月数×约42格):
    // 设 60 时点击/关闭的 setData 会卡(约 2500 格),故缩到 25(约 1000 格),今天大致居中。
    // 需与 minDate~maxDate 跨度一致(前后各 1 年 + 当月 = 25),否则部分月份翻不到
    calendarMonthNum() {
      // 前后各 1 年,含当月共 25 个月;调整范围时同步改上面 minDate/maxDate 的年数
      return 25;
    },
    // 煤种发运情况:日期(YYYY-MM-DD)区间。日历按天比较/高亮、文本回显都用纯日期,
    // 故从带时分秒的存储值里截取前 10 位(YYYY-MM-DD);为空时默认今天
    coalDateRange() {
      const start = (this.coalStartTime || this.todayStr).slice(0, 10);
      const end = (this.coalEndTime || this.todayStr).slice(0, 10);
      return [start, end];
    },
    // 煤种发运情况:回显时间段文本(仅日期)
    coalRangeText() {
      const [start, end] = this.coalDateRange;
      return start === end ? start : `${start} ~ ${end}`;
    },
    // 煤种发运情况:日历默认选中日期(range 模式返回数组,仅日期)
    coalDefaultDate() {
      return this.coalDateRange;
    },
    // 分客户煤种发运情况:日期(YYYY-MM-DD)区间(同 coalDateRange,去掉时分秒)
    kehuDateRange() {
      const start = (this.kehuStartTime || this.todayStr).slice(0, 10);
      const end = (this.kehuEndTime || this.todayStr).slice(0, 10);
      return [start, end];
    },
    // 分客户煤种发运情况:回显时间段文本(仅日期)
    kehuRangeText() {
      const [start, end] = this.kehuDateRange;
      return start === end ? start : `${start} ~ ${end}`;
    },
    // 分客户煤种发运情况:日历默认选中日期(range 模式返回数组,仅日期)
    kehuDefaultDate() {
      return this.kehuDateRange;
    }
   },
   data() {
    const validatePass = (rule, value, callback) => {
      if (this.formData.newpassword1 !== "") {
        if (value !== this.formData.newpassword1) {
          callback(new Error("两次输入密码不一致!"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    const checkPassword = (rule, value, callback) => {
      // let roles = this.$store.getters.roles;//当前用户角色id
      // let passL = 8;
      // if (roles.concat(1)){
      //   passL = 10
      // }
      let passL = 8;
      this.level = []
      if(!value) {
        return callback('密码不能为空')
      }
      if(value.length < passL) {
        return callback(`密码不能少于${passL}位`)
      }
      if(value.length > 16) {
        return callback('密码不能大于16位')
      }
      //校验是数字
      const regex1 = /^\d+$/
      // 校验字母
      const regex2 = /^[A-Za-z]+$/
      // 校验符号
      const regex3 =
          /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/
      if(regex1.test(value)) {
        this.level.push('low')
        return callback('密码强度过低')
      }else if(regex2.test(value)) {
        this.level.push('low')
        return callback('密码强度过低')
      }else if(regex3.test(value)) {
        this.level.push('low')
        return callback('密码强度过低')
      }else if(/^[A-Za-z\d]+$/.test(value)) {
        this.level.push('low')
        this.level.push('middle')
        return callback('密码强度过低')
      }else if(
          /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、\d]+$/.test(
              value
          )
      ) {
        this.level.push('low')
        this.level.push('middle')
        return callback('密码强度过低')
      }else if(
          /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、A-Za-z]+$/.test(
              value
          )
      ) {
        this.level.push('low')
        this.level.push('middle')
        return callback('密码强度过低')
      } else if (
          /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、A-Za-z\d]+$/.test(
              value
          )
      ) {
        this.level.push('low')
        this.level.push('middle')
        this.level.push('high')
      }
      return callback()
    };
      return {
      level:[],
         // ucharts图表
         chartData: {},
         opts: {
@@ -436,7 +916,6 @@
         procInstId: '',
         // 选择器
         statusSeletShow: false,
         statusList: [['中国', '美国', '日本']],
         // data
         shenqingData: [],
         daibanData: [],
@@ -461,13 +940,68 @@
            pageSize: 2,
            // sort: 'createTime',
            // order: 'desc'
         }
         },
      coalData:[],
      shoukuanJilu:[],
      shoukuanJiluTemp:[],
      shoukuanIsMore:false,  //
      shoukuanToatl:0,
      coalTongji:[], //煤种统计
      coalTongjiTemp:[], //煤种统计
      coalShowIsMore: false,
      kehuTongji:[], //煤种统计
      kehuTongjiTemp:[], //煤种统计
      kehuTongjiShowIsMore: false,
      // 煤种发运情况 时间段选择
      coalLoaded: false,    //是否已查询过(控制区块显隐)
      coalLoading: false,   //区块内转圈(加载中)
      coalCalendarShow: false,
      coalCalendarKey: 0,   //每次打开自增,强制 u-calendar 重新挂载,规避微信 scroll-view 重复打开不重滚、默认停在 minDate 月的 bug
      coalStartTime: '',    //开始日期(YYYY-MM-DD 00:00:00),默认当天
      coalEndTime: '',      //结束日期(YYYY-MM-DD 23:59:59),默认当天
      // 分客户煤种发运情况 时间段选择
      kehuLoaded: false,    //是否已查询过(控制区块显隐)
      kehuLoading: false,   //区块内转圈(加载中)
      kehuCalendarShow: false,
      kehuCalendarKey: 0,   //每次打开自增,强制 u-calendar 重新挂载(同 coalCalendarKey)
      kehuStartTime: '',    //开始日期(YYYY-MM-DD 00:00:00),默认当天
      kehuEndTime: '',      //结束日期(YYYY-MM-DD 23:59:59),默认当天
      roles:[],
      d2Sum:0,  //总计金额
      d1Sum:0,  //总计
      lyDSumSum:0,  //路运
      dsumSum:0,  //汽运
      passShow: false,  //密码弹框
      sumbLoading: false,
      formData: {
        password:'',
        newpassword1:'',
        newpassword2:'',
      },
      rules: {
        password: [{
          type: 'string',
          required: true,
          message: '请填写密码',
          trigger: ['blur', 'change']
        }],
        newpassword1: [{
          required: true,
          validator: checkPassword,
          trigger: 'change'
        }],
        newpassword2: [{
          required: true,
          validator: validatePass,
          trigger: "blur"
        }]
      }
      };
   },
   // 监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
   // onReady() {
   // },
   onReady() {
    this.$refs.uForm.setRules(this.rules)
   },
   // 点击导航栏菜单后
   onNavigationBarButtonTap(e) {
      console.log('退出导航栏按钮事件', e);
@@ -487,11 +1021,118 @@
      this.init();
   },
   components: {
    UText,
      combinedTitle,
      combinationCard
      // popupMenu
   },
  watch: {
    shoukuanIsMore: {
      handler(newVal,oldVal) {
        let temp = newVal.toString() || ''
        if(this.shoukuanJiluTemp && this.shoukuanJiluTemp.length > 0) {
          if(temp == 'false') {
            this.shoukuanJilu = this.shoukuanJiluTemp.slice(0,2)
            console.log(this.shoukuanJilu,'this.shoukuanJilu------收款情况')
            this.coalShowIsMore = false
          }else if(temp == 'true') {
            this.shoukuanJilu = this.shoukuanJiluTemp
            this.coalShowIsMore = true
          }
        }
      },
      immediate: true,
      deep: true
    },
    coalShowIsMore: {
      handler(newVal,oldVal) {
        let temp = newVal.toString() || ''
        if(this.coalTongjiTemp && this.coalTongjiTemp.length > 0) {
          if(temp == 'false') {
            this.coalTongji = this.coalTongjiTemp.slice(0,2)
            this.coalShowIsMore = false
          }else if(temp == 'true') {
            this.coalTongji = this.coalTongjiTemp
            this.coalShowIsMore = true
          }
        }
      },
      immediate: true,
      deep: true
    },
    kehuTongjiShowIsMore: {
      handler(newVal,oldVal) {
        let temp = newVal.toString() || ''
        if(this.kehuTongjiTemp && this.kehuTongjiTemp.length > 0) {
          if(temp == 'false') {
            this.kehuTongji = this.kehuTongjiTemp.slice(0,2)
            this.kehuTongjiShowIsMore = false
          }else if(temp == 'true') {
            this.kehuTongji = this.kehuTongjiTemp
            this.kehuTongjiShowIsMore = true
          }
        }
      },
      immediate: true,
      deep: true
    },
  },
   methods: {
    handlePassConfirm() { //修改密码
      //列表查询
      this.$refs.uForm.validate().then(res => {
        this.sumbLoading = true
        uni.showLoading({
          title: '正在加载...'
        });
        this.formData.deptId = uni.getStorageSync('userInfo')?.deptId
        this.formData.username = uni.getStorageSync('userInfo')?.username
        this.$reqPut('editInfo',this.formData).then(res => {
          if (res.code == 0) {
            this.passShow = false
            this.sumbLoading = false
            this.$u.toast('修改密码成功!');
            setTimeout(() => {
              uni.reLaunch({
                url:"/pages/login/login"
              })
            }, 1000)
            uni.hideLoading();
          }else {
            this.$u.toast(res.msg || '修改密码失败');
            this.sumbLoading = false
            uni.hideLoading();
          }
        })
      })
    },
    handleClosePassShow() {
      this.passShow = false
    },
    handlePwd() {
      this.passShow = true
    },
    // 打开煤种发运情况 时间段日历:自增 key 强制 u-calendar 重新挂载,
    // 规避微信端重复打开时 scroll-view 因 scroll-top 未变而不重滚、默认停在 minDate 月的 bug
    openCoalCalendar() {
      this.coalCalendarKey++
      this.coalCalendarShow = true
    },
    // 打开分客户煤种发运情况 时间段日历(原理同 openCoalCalendar)
    openKehuCalendar() {
      this.kehuCalendarKey++
      this.kehuCalendarShow = true
    },
    handleShouKuanIsMore() {  //当日收款情况
      this.shoukuanIsMore = !this.shoukuanIsMore
    },
    handleCoalIsMore() {  //煤种发运情况
      this.coalShowIsMore = !this.coalShowIsMore
    },
    handlekehuTongjiShowIsMore() {  //煤种发运情况
      this.kehuTongjiShowIsMore = !this.kehuTongjiShowIsMore
    },
      watchRouter() {
         console.log('路由跳转');
      },
@@ -501,10 +1142,114 @@
         this.todoList(); // 我的待办
         this.doneList(); // 我的已办
         this.xscarshippingdayplan(); // 日计划
      this.currentCoalPrice()  //煤种价格
      this.getSkList()  //当天收款记录
      this.getStatistics1()   //按煤种统计
      this.getStatistics2()   //按客户发运统计
      },
    //煤种价格
    currentCoalPrice() {
      this.$reqGet('currentCoalPrice').then(res => {
        console.log(res.data,'res.data')
        if (res.code == 0) {
           this.coalData = res.data || []
        }
      })
    },
    getSkList() {  //当天收款记录
      this.$reqGet('getSkList').then(res => {
        if (res.code == 0) {
          this.shoukuanJiluTemp = res.data || []
          if(this.shoukuanJiluTemp && this.shoukuanJiluTemp.length > 0) {
            this.shoukuanToatl = this.shoukuanJiluTemp[0]?.money2 || 0
            if(this.shoukuanJiluTemp.length > 0) {
              this.shoukuanJilu = this.shoukuanJiluTemp.slice(0,2)
              this.shoukuanIsMore = false
            }
          }
        }
      })
    },
    getStatistics1() {  //按煤种统计
      console.log('按煤种统计------开始时间',this.coalStartTime,this.startTodayStr)
      console.log('按煤种统计------开始时间',this.coalEndTime,this.endTodaydayStr)
      this.coalLoading = true
      this.$reqGet('getStatistics1', {
        startTime: this.coalStartTime || this.startTodayStr,
        endTime: this.coalEndTime || this.endTodaydayStr
      }).then(res => {
        if (res.code == 0) {
          this.coalLoaded = true
          this.coalTongjiTemp = res.data || []
          if(this.coalTongjiTemp && this.coalTongjiTemp.length > 0){
            this.d2Sum = this.coalTongjiTemp[0]?.d2Sum || 0
            this.d1Sum = this.coalTongjiTemp[0]?.d1Sum || 0
            this.lyDSumSum = this.coalTongjiTemp[0]?.lyDSumSum || 0
            this.dsumSum = this.coalTongjiTemp[0]?.dsumSum || 0
            if(this.coalTongjiTemp.length > 0) {
              this.coalTongji = this.coalTongjiTemp.slice(0,2)
              this.coalShowIsMore = false
            }
          } else {
            this.resetCoalStat()
          }
        }
      }).finally(() => {
        this.coalLoading = false
      })
    },
    resetCoalStat() {  //清空煤种发运情况统计
      this.coalTongji = []
      this.coalTongjiTemp = []
      this.d2Sum = 0
      this.d1Sum = 0
      this.lyDSumSum = 0
      this.dsumSum = 0
    },
    // 煤种发运情况 时间段确认(开始补 00:00:00、结束补 23:59:59)
    coalCalendarConfirm(e) {
      this.coalCalendarShow = false
      const arr = Array.isArray(e) ? e : (e && e.result) || []
      if (arr.length < 2) return
      this.coalStartTime = `${arr[0]} 00:00:00`
      this.coalEndTime = `${arr[arr.length - 1]} 23:59:59`
      this.getStatistics1()
    },
    getStatistics2() {  //按客户发运统计
      console.log('发运统计------开始时间',this.kehuStartTime,this.startTodayStr)
      console.log('发运统计------开始时间',this.kehuEndTime,this.endTodaydayStr)
      this.kehuLoading = true
      this.$reqGet('getStatistics2', {
        startTime: this.kehuStartTime || this.startTodayStr,
        endTime: this.kehuEndTime || this.endTodaydayStr
      }).then(res => {
        if (res.code == 0) {
          this.kehuLoaded = true
          this.kehuTongjiTemp = res.data || []
          if(this.kehuTongjiTemp && this.kehuTongjiTemp.length > 0){
            if(this.kehuTongjiTemp.length > 0) {
              this.kehuTongji = this.kehuTongjiTemp.slice(0,2)
              this.kehuTongjiShowIsMore = false
            }
          } else {
            this.kehuTongji = []
          }
        }
      }).finally(() => {
        this.kehuLoading = false
      })
    },
    // 分客户煤种发运情况 时间段确认(开始补 00:00:00、结束补 23:59:59)
    kehuCalendarConfirm(e) {
      this.kehuCalendarShow = false
      const arr = Array.isArray(e) ? e : (e && e.result) || []
      if (arr.length < 2) return
      this.kehuStartTime = `${arr[0]} 00:00:00`
      this.kehuEndTime = `${arr[arr.length - 1]} 23:59:59`
      this.getStatistics2()
    },
    //代办详情
    daibanDetail(item) {
      console.log(item,'item=====------000000')
      if(item?.actBusiness?.actType == 'Offsetting') {  //收款 actType = ‘Offsetting’
        uni.navigateTo({
          url: `/pages/payment-form-data/payment-form-data?id=${item.tableId}`,
@@ -537,7 +1282,9 @@
               uni.setStorageSync('userInfo', res.data.sysUser);
          this.$store.commit('SET_PERMISSIONS',res.data.permissions)
               //uni.setStorageSync('permissions', res.data.permissions);
               this.userId = res.data.sysUser.userId;
               this.userId = res.data.sysUser?.userId;
          this.roles = res.data?.roles;
          console.log(this.roles,'this.roles---111')
               this.$nextTick(() => {
                  this.coalbunker();
               });
@@ -604,7 +1351,8 @@
         m = m < 10 ? '0' + m : m;
         let d = date.getDate();
         d = d < 10 ? '0' + d : d;
         const time = y + '-' + m + '-' + d;
         // const time = y + '-' + m + '-' + d;
         const time = `${y}-${m}-${d} 00:00:00`;
         console.log('todayDate---------', time);
         return time;
      },
@@ -869,13 +1617,35 @@
};
</script>
<style lang="scss" scoped>
::v-deep{
  .uni-table-td,.uni-table-th{
    color: #000;
  }
  .passWord-main-box{
    .u-popup__content{
      width: 85%;
      padding: 40rpx;
      box-sizing: border-box;
      border-radius: 10rpx;
    }
    .u-icon__icon{
      font-size: 28rpx!important;
    }
  }
}
::v-deep.home {
   width: 100%;
   display: flex;
   flex-direction: column;
  .marginTop{
    margin-top: 16rpx;
  }
  .small{
    font-size: 20rpx;
    margin-left: 6rpx;
    font-weight: normal;
  }
   // 横向菜单栏
   .utils {
      .utils-container {
@@ -1161,4 +1931,312 @@
      }
   }
}
.huoshiju-box{
  width: 100%;
  display: flex;
  flex-direction: column;
  .price-group{
    width: 100%;
    display: flex;
    flex-direction: column;
    .price-title{
      width: 100%;
      display: flex;
      justify-content: space-between;
      font-size: 32rpx;
    }
    .price-box{
      width: 100%;
      padding: 0 20rpx 20rpx 20rpx;
      box-sizing: border-box;
      .price-box-inside{
        width: 100%;
        display: flex;
        flex-direction: column;
        padding: 30rpx;
        box-sizing: border-box;
        border-radius: 18rpx;
        box-shadow: 0 2rpx 20rpx #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
      }
      .price-line{
        width: 100%;
        display: flex;
        justify-content: space-between;
        height: 60rpx;
        line-height: 60rpx;
        .name{
          font-size: 26rpx;
          color: #606266;
        }
        .price{
          display: flex;
          align-items: baseline;
          .priceNum{
            font-size: 28rpx;
          }
          .priceUnit{
            font-size: 20rpx;
            margin-left: 10rpx;
          }
        }
      }
    }
  }
  .shoukuan-group{
    width: 100%;
    display: flex;
    flex-direction: column;
    .currentDay-box{
      width: 100%;
      position: relative;
      .total-box{
        position: absolute;
        right: 20rpx;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: baseline;
        .total1{
          font-size: 22rpx;
        }
        .total2{
          font-size: 32rpx;
          margin-top: 6rpx;
          color: #000;
          font-weight: 540;
          display: flex;
          align-items: baseline;
        }
      }
      .date-pick-box{
        position: absolute;
        right: 20rpx;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        max-width: 55%;
        .date-pick-text{
          font-size: 26rpx;
          color: #4b6cfa;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
        .date-pick-icon{
          width: 32rpx;
          height: 32rpx;
          margin-left: 8rpx;
        }
      }
    }
    .block-loading{
      width: 100%;
      padding: 60rpx 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .shoukuan-box{
      width: 100%;
      padding: 0 20rpx 20rpx 20rpx;
      box-sizing: border-box;
      .coalFayun-total{
        width: 100%;
        display: flex;
        background: #4b6cfa;
        padding: 20rpx 10rpx;
        box-sizing: border-box;
        border-radius: 16rpx;
        margin-bottom: 20rpx;
        .total-block{
          width: 50%;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          .num{
            font-size: 32rpx;
            color: #fff;
            font-weight: 540;
            display: flex;
            align-items: baseline;
            height: 38rpx;
          }
          .name{
            font-size: 22rpx;
            color: #fff;
            margin-top: 10rpx;
          }
        }
      }
      .shoukuan-box-inside{
        width: 100%;
        display: flex;
        flex-direction: column;
        padding: 0 40rpx;
        box-sizing: border-box;
        border-radius: 18rpx;
        box-shadow: 0 2rpx 20rpx #e5e5e5, 0 0 1px #e5e5e5, 0 0 1px #e5e5e5;
        transition: all 0.3s;
        .shoukuan-main{
          width: 100%;
          display: flex;
          flex-direction: column;
          border-bottom: 1px solid #e5e5e5;
          padding: 20rpx 0;
          &:nth-last-child(2){
            border-bottom: none;
          }
        }
        .shoukuan-line{
          width: 100%;
          display: flex;
          align-items: baseline;
          height: 60rpx;
          line-height: 60rpx;
          position: relative;
          .coal{
            font-size: 26rpx;
            color: #3884ff;
            border: 1px solid #3884ff;
            margin-right: 26rpx;
            padding: 0 32rpx;
            height: 38rpx;
            line-height: 38rpx;
            border-radius: 8rpx;
            letter-spacing: 2px;
            font-weight: 500;
          }
          .name{
            font-size: 24rpx;
            color: #606266;
          }
          .text1{
            font-size: 30rpx;
          }
          .num{
            font-size: 32rpx;
            margin-top: 6rpx;
            color: #000;
            font-weight: 540;
            display: flex;
            align-items: baseline;
          }
        }
        .coal-line{
          display: flex;
          align-items: center;
        }
        .kehu-block{
          width: 33%;
          .text1{
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }
          &:nth-child(2){
            width: 67%;
          }
        }
        .shoukuanFirst-line{
          font-weight: bolder;
        }
      }
      .coalTongji-box{
        width: 100%;
        display: flex;
        align-items: center;
        .caol-block{
          width: 33.3%;
          display: flex;
          flex-direction: column;
          .name{
            font-size: 22rpx;
            color: #606266;
          }
          .num{
            font-size: 32rpx;
            margin-top: 6rpx;
            color: #000;
            font-weight: 540;
            display: flex;
            align-items: baseline;
          }
        }
      }
    }
    .shouqiIcon{
      width: 100%;
      display: flex;
      justify-content: center;
      transition: all 0.3s;
      image{
        width: 50rpx;
        height: 34rpx;
        margin: 10rpx 0;
      }
    }
  }
}
.sumbmit-box{
  margin-top: 40rpx;
}
.editorPass{
  width: 100%;
  justify-content: center;
  display: flex;
  margin: 20rpx 0;
  align-items: center;
  .icon{
    width: 46rpx;
    height: 46rpx;
    margin-right: 10rpx;
  }
}
.huiseBox{
  width: 100%;
  height: 12rpx;
  background: #eeeeee;
}
.intensity {
  width: 100%;
  margin-top: 10rpx;
  .psdText {
    font-size: 14px;
    margin-right: 10px;
  }
  .line {
    display: inline-block;
    width: 70rpx;
    height: 8rpx;
    background: #d8d8d8;
    border-radius: 6rpx;
    margin-right: 16rpx;
    &.low {
      background: #f4664a;
    }
    &.middle {
      background: #ffb700;
    }
    &.high {
      background: #2cbb79;
    }
  }
  .level {
    margin: 0 32rpx 0 16rpx;
  }
  .warningtext {
    color: #5a5a5a;
    font-size: 24rpx;
    margin-top: 10rpx;
  }
}
</style>