123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450 |
- <template>
- <view class="page-box">
- <view class="list-box">
- <u--form label-width="auto" ref="uForm" :model="form" labelAlign="right">
- <!-- <u-subsection :list="list" mode="subsection" :current="curNow" @change="sectionChange"></u-subsection> -->
- <u-tabs :list="tablist"
- :itemStyle="{
- width: '330rpx',
- height: '80rpx'
- }"
- :activeStyle="{
- color:'#4573FC'
- }"
- lineColor="#4573FC"
- lineWidth="40"
- @click="({index}) => {
- curNow = index
- anewQueryMyList()
- }"
- >
- </u-tabs>
- <u-cell-group customStyle="margin-top: 2px">
- <template>
- <u-cell title="排班日期" :border="true" :isLink="true"
- @click="calendarShow = true">
- <view slot="value">
- <u-form-item label="" prop="form.startTime">
- <template v-if="form.endDate">
- {{ form.startTime }} - {{ form.endDate }}</template>
- <template v-else></template>
- </u-form-item>
- </view>
- </u-cell>
- </template>
- <template>
- <u-cell title="执行状态" :border="true" :isLink="true"
- @click="$refs.workStatusRef.show()">
- <view slot="value">
- <u-form-item label="" prop="form.endTime">
- {{ form.workStatusName }}
- </u-form-item>
- </view>
- </u-cell>
- <tq-select ref="workStatusRef"
- :columns="workStatusList"
- @confirm="(data) => {
- form.workStatus = data.value
- form.workStatusName = data.label
- anewQueryMyList()
- }">
- </tq-select>
- </template>
- <template v-if="curNow === 1">
- <view class="search-box-item">
- <u--input
- placeholder="查询"
- shape="circle"
- prefixIcon="search"
- v-model="form.param"></u--input>
- <view class="search-box-item vehicle-model" @click="$refs.vehTypeRef.show()">
- <view>车型</view>
- <u-icon name="arrow-down-fill" color="rgb(60, 156, 255)" size="16"></u-icon>
- <tq-select ref="vehTypeRef"
- workTypeId="1"
- api="dropDown"
- @confirm="(data) => {
- form.vehType = data.value
- form.vehTypeName = data.label
- anewQueryMyList()
- }"></tq-select>
- </view>
- </view>
- </template>
- </u-cell-group>
- </u--form>
- </view>
- <view class="item-list-box">
- <view class="info-box" v-for="(item, index) in queryMyListdata" :key="index">
- <view class="title">{{ item.scheduleDate }}</view>
- <view class="sub-title">{{ item.deptName }}</view>
- <view class="item-list">
- <view class="item">
- <view class="label">编号</view>
- <view class="value">{{ item.code }}</view>
- </view>
- <view class="item">
- <view class="label">计划名称</view>
- <view class="value">{{ item.planName }}</view>
- </view>
- <view class="item">
- <view class="label">作业班次</view>
- <view class="value">{{ item.classTime }}</view>
- </view>
- <view class="item">
- <view class="label">作业范围</view>
- <view class="value">{{ item.workRangeName }}</view>
- </view>
- <view class="item">
- <view class="label">车辆类型</view>
- <view class="value">{{ item.vehTypeName }}</view>
- </view>
- <view class="item">
- <view class="label">车牌号</view>
- <view class="value" style="color: #4573FC;">{{ item.plate }}</view>
- </view>
- <view class="hide-warp" v-if="item.openOther">
- <view class="item">
- <view class="label">姓名/电话</view>
- <view class="value" style="color: #4573FC;">{{ item.driverName }}/{{ item.driverPhone }}</view>
- </view>
- <view class="item">
- <view class="label">已完成趟次</view>
- <view class="value" style="color: #4573FC;">{{ item.runTrips }}(趟)</view>
- </view>
- <view class="item">
- <view class="label">已完成里程</view>
- <view class="value" style="color: #4573FC;">{{ item.workMileage }}km</view>
- </view>
- <view class="item">
- <view class="label">状态</view>
- <view class="value">
- <!-- 作业状态:0.未开始 1.执行中 2.已结束 -->
- <text style="color: #68D100;" v-if="item.workStatus === 2">{{ item.workStatusName }}</text>
- <text style="color: #FF8000;" v-if="item.workStatus === 1">{{ item.workStatusName }}</text>
- <text style="color: #EB4141;" v-if="item.workStatus === 0">{{ item.workStatusName }}</text>
- </view>
- </view>
- </view>
- <view @click="item.openOther = !item.openOther" class="open-warp">
- {{ item.openOther?'收起':'展开' }}
- </view>
-
-
- <view class="item">
-
- <view class="value" style="color: #4573FC;">
- <view style="color: #4573FC;display: flex;" @click="goWorkDetails(item)">作业界面 <u-icon name="arrow-right-double" color="#4573FC" size="14"></u-icon></view>
- </view>
- </view>
- </view>
- <!-- 操作 -->
- <view class="item-btn">
- <view class="u-button" @click="phoneCall(item)">
- <image class="icon" src="@/static/icon/iPhone.png" mode=""></image>
- 电话
- </view>
- <view class="u-button" @click="handleTask(item)" v-if="!intercomState">
- <image class="icon" src="@/static/icon/voice.png" mode=""></image>
- 对讲
- </view>
- <view class="u-button intercom" @click="handleTask(item)" v-if="intercomState">
- <image class="icon" src="@/static/icon/voice-close.png" mode=""></image>
- 挂断
- </view>
- <view class="u-button">
- <image class="icon" src="@/static/icon/video.png" mode=""></image>
- 视频
- </view>
- </view>
- </view>
- <u-loadmore :status="status" />
- </view>
- <u-calendar :show="calendarShow" mode="range" :defaultDate="defaultDate" :maxDate="maxDate" minDate="2023-10-01"
- monthNum="24"
- @confirm="calendarChange" @close="calendarShow = false"></u-calendar>
- <intercom ref="intercom" @oNstate="(e)=>intercomState=e"></intercom>
- </view>
- </template>
- <script>
- import Intercom from '@/components/Intercom'
- import { transportWorkRecord } from "@/api/system/workPlan";
- export default {
- components: {
- Intercom
- },
- data() {
- return {
- intercomState:false,//对接状态
- calendarStart: this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'),// 开始时间
- calendarEnd: this.dayjs().subtract(0, 'day').format('YYYY-MM-DD'), // 结束时间
- defaultDate: [this.dayjs().subtract(6, 'day').format('YYYY-MM-DD'), this.dayjs().subtract(0, 'day').format('YYYY-MM-DD')],
- maxDate: this.dayjs().add(365, 'day').format('YYYY-MM-DD'),
- calendarShow: false,
- curNow: 0,
- form: {
- startTime: '',//开始时间
- endDate: '', //结束时间
- workStatus: '',//部门审核状态:1.审核通过、2.审核不通过
- workStatusName: '',
- vehType: '',
- vehTypeName: '',
- param: '' //模糊搜索
- },
- // 作业状态:0.未开始 1.执行中 2.已结束
- workStatusList: [
- { label: '全部', value: '' },
- { label: '未开始', value: 0 },
- { label: '执行中', value: 1 },
- { label: '已结束', value: 2 },
- ],
- status: 'nomore', //loading nomore loadmore
- list: ['我的记录', '全部记录'],
- tablist: [
- { name: '我的记录'},
- { name: '全部记录'},
- ],
- bothSidesMap: {
- 1: '是',
- 0: '否'
- },
- queryMyListdata: []
- }
- },
- // 触底
- onReachBottom() {
- console.log('当前条数', this.queryMyListdata.length, '总条数', this.total)
- if (this.queryMyListdata.length >= this.total) return;
- this.pageIndex++
- this.queryMyList();
- },
- methods: {
- goWorkDetails(row) {
- const {schId} = row
- uni.navigateTo({
- url: `/pagesSanitation/workDetails/index?schId=${schId}`
- })
- },
- handleTask(item) {
- this.$refs.intercom.toIntercom(item.deviceId);
- },
- phoneCall({driverPhone}) {
- uni.makePhoneCall({
- phoneNumber: driverPhone //仅为示例
- });
- },
- calendarChange(e) {
- console.info('选择的时间', e)
- // 修改日期
- this.form.startTime = e[0]; // 开始时间
- this.form.endDate = e[e.length - 1]; // 结束时间
- this.defaultDate = [e[0], e[e.length - 1]]
- this.calendarShow = false;
- this.anewQueryMyList();
- },
- sectionChange(index) {
- this.curNow = index;
- this.anewQueryMyList()
- },
- anewQueryMyList() {
- this.pageIndex = 1;
- this.queryMyListdata = [];
- this.queryMyList();
- },
- async queryMyList() {
- this.loading = 'loading'
- let { startTime, endDate } = this.form
- let obj = {
- ...this.form,
- startTime: undefined,
- page: this.pageIndex,
- size: 10,
- startDate: startTime ? startTime : '',
- endDate: endDate ? endDate : '',
- queryType: this.curNow === 0 ? 1 : 0 //查询类型:0.全部记录 1.我的记录 默认为0
- }
- for (let key in obj) {
- if (obj[key] === '') delete obj[key]
- }
- if (this.curNow === 0) {
- delete obj.param
- delete obj.vehType
- delete obj.vehTypeName
- }
- let { data, code } = await transportWorkRecord(obj)
- if (code == "0") {
- let list = data.list.map(item=>
- {
- return {
- ...item,
- openOther:false
- }
- }
- )
- this.queryMyListdata = this.queryMyListdata.concat(list)
- this.total = Number(data.total)
- this.loading = 'loadmore'
- if (this.queryMyListdata.length >= this.total) {
- this.status = 'nomore'
- }
- console.log('数据', this.queryMyListdata)
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .page-box {
- .list-box {
- border-radius: 10rpx;
- background: #fff;
- padding: 20rpx;
- position: sticky;
- box-sizing: border-box;
- // align-items: center;
- // display: flex;
- top: 0px;
- width: 100%;
- z-index: 999;
- /deep/ {
- .u-form-item__body {
- padding: 0;
- }
- }
- .search-box-item {
- display: flex;
- align-items: center;
- color: rgb(60, 156, 255);
- padding-top: 20rpx;
- padding-left: 20rpx;
- /deep/ .u-input {
- border: 0;
- background: #F2F2F2;
- }
- }
- .vehicle-model {
- padding: 0 20rpx;
- }
- }
- .item-list-box {
- padding: 24rpx;
- box-sizing: border-box;
- .info-box {
- width: 100%;
- background: #FFFFFF;
- box-shadow: 0rpx 4 8rpx 0rpx rgba(0, 117, 247, 0.16);
- border-radius: 20rpx;
- margin-bottom: 24rpx;
- padding: 32rpx 24rpx;
- box-sizing: border-box;
- .title {
- font-size: 36rpx;
- line-height: 52rpx;
- font-style: normal;
- font-weight: 500;
- height: 52rpx;
- color: #4573FC;
- padding-left: 32rpx;
- }
- .sub-title {
- margin-top: 8rpx;
- font-weight: 600;
- font-size: 28rpx;
- color: #666666;
- line-height: 44rpx;
- height: 44rpx;
- text-align: left;
- font-style: normal;
- padding-left: 32rpx;
- }
- .item-list {
- width: 100%;
- background: #F6FAFF;
- border-radius: 10rpx;
- margin-top: 20rpx;
- padding: 24rpx 32rpx;
- box-sizing: border-box;
- .item {
- display: flex;
- justify-content: space-between;
- margin-top: 16rpx;
- .label {
- color: #666666;
- font-size: 28rpx;
- flex-shrink: 0;
- padding-right: 4rpx;
- }
- .value {
- font-size: 28rpx;
- color: #333333;
- }
- }
- }
- .item-btn {
- display: flex;
- margin-top: 24rpx;
- .u-button {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 68rpx;
- background: #4573FC;
- border-radius: 34rpx;
- color: #fff;
- &:not(:last-child) {
- margin-right: 20rpx;
- }
- .icon{
- width: 48rpx;
- height: 48rpx;
- margin-right: 2rpx;
- }
- }
- .intercom{
- background: #EB4141;
- }
- }
- }
- }
- .hide-warp{
- width: 100%;
- }
- .open-warp{
- width: 100%;
- padding: 20rpx 0 10rpx;
- display: flex;
- justify-content: flex-end;
- color: #4573FC;
- font-size: 28rpx;
- }
- }
- </style>
|