12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163 |
- <template>
- <view>
- <zj-page-layout
- :hasFooter="false"
- :isScroll="true"
- :refresherTriggered="refresherTriggered"
- @refresherrefresh="refresherrefresh"
- @scrolltolower="scrolltolower"
- >
- <template slot="header">
- <view class="top-container">
- <scroll-view class="tab-scroll-view" scroll-x scroll-with-animation :scroll-left="scrollLeft">
- <view class="left-nav">
- <view
- class="item"
- v-for="(item, index) in mainTabs"
- :key="index"
- :class="[curMainTab === item.value ? 'active' : '', 'tab-item-' + index]"
- @tap="changeMainTab(item.value)"
- >
- <view class="name">{{ item.name }}</view>
- <view class="num">{{ item.num || '' }}</view>
- </view>
- </view>
- </scroll-view>
- <view class="right-search">
- <u-icon name="search" color="#ffffff" size="28" @tap="toSearchPage()"></u-icon>
- </view>
- </view>
- </template>
- <view>
- <view class="status-container">
- <u-tabs
- :list="smallTabs"
- @change="changeSmallTab"
- :current="curSmallTabIndex"
- lineWidth="0"
- lineHeight="0"
- activeStyle="height: 68rpx; display: flex; align-items: center; justify-content: center; padding: 0 24rpx; border-radius: 24rpx; background: #E7EFFF; color: #3D8FFD; border: 1px solid #3D8FFD; box-sizing: border-box;"
- inactiveStyle="height: 68rpx; display: flex; align-items: center; justify-content: center; padding: 0 24rpx; border-radius: 24rpx; border: 1px solid #eaeaea; box-sizing: border-box;"
- itemStyle="padding: 0; border-radius: 24rpx; color: #999999; margin-right: 16rpx; font-size: 28rpx;"
- >
- </u-tabs>
- <view class="date" :class="startDate ? 'active' : ''" @tap="isShowDatePicker = true">
- <view class="text">按日期</view>
- <text class="iconfont icon-jinru"></text>
- </view>
- </view>
- <view class="order-list-container">
- <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
- <view class="item-top">
- <view class="left">
- <view class="title" v-if="item.orderSmallTypeText">
- {{ item.orderSmallTypeText.slice(0, 2) }}
- </view>
- <view class="tags">
- <view class="tag red_solid" v-for="(it, idx) in item.orderFlags" :key="idx">{{ it.tagName }}</view>
- </view>
- </view>
- <view class="status">{{ item.orderStatusText }}</view>
- </view>
- <view class="item-main">
- <view class="row">
- <view class="label">服务单号</view>
- <view class="value" style="position: relative">
- <view class="val">{{ item.id }}</view>
- <view
- class="num"
- style="position: absolute; right: 0; color: #3d8ffd"
- @click.stop="
- () => {
- $copy(item.id)
- }
- "
- >复制</view
- >
- </view>
- </view>
- <view class="row" v-if="item.appointmentTime">
- <view class="label">预约时间</view>
- <view class="value">
- <view class="val">{{ item.appointmentTime.slice(0, 10) }}</view>
- </view>
- </view>
- <view class="row">
- <view class="label">服务项目</view>
- <view class="value">
- <view class="val">{{
- item.pgOrderProducts.map(o => `${o.mainName || ''}${item.orderSmallTypeText}x${o.num}`).join(',')
- }}</view>
- </view>
- </view>
- <view class="row">
- <view class="label">客户姓名</view>
- <view class="value">
- <view class="val">{{ item.userName }} {{ item.userMobile }}</view>
- <view class="num" v-if="item.customerTotalNum > 0">
- (共<text>{{ item.customerSortNum || 0 }}</text
- >/{{ item.customerTotalNum || 0 }}单)</view
- >
- <view
- class="fun"
- v-if="orderStatus_v(item.orderStatus, item) !== 'DQD'"
- @tap.stop="$callPhone(item.userMobile)"
- >
- <text class="iconfont icon-call"></text>
- <view class="text">联系Ta</view>
- </view>
- </view>
- </view>
- <view class="row address-row">
- <!-- // name: item.userName, -->
- <view class="label">服务地址</view>
- <view class="value">
- <view class="val address ellipsis-3">{{ item.address || item.gpsAddress }}</view>
- <view
- class="fun"
- v-if="orderStatus_v(item.orderStatus, item) !== 'DQD'"
- @tap.stop="
- $openLocation({
- lat: item.lat,
- lng: item.lng,
- address: item.address || item.gpsAddress
- })
- "
- >
- <text class="iconfont icon-daohang"></text>
- <view class="text">导航</view>
- </view>
- </view>
- </view>
- </view>
- <view class="item-btn" @tap.stop>
- <!-- 接单 ok-->
- <u-button
- v-if="
- // ---------------
- (item.isImportExcel &&
- !item.isMeet &&
- item.attr == 'SELF' &&
- (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
- // ---------------
- (item.isImportExcel && !item.isMeet && item.attr != 'SELF') ||
- // ---------------
- (!item.isImportExcel &&
- item.attr == 'SELF' &&
- ['DYY', 'DJD'].includes(orderStatus_v(item.orderStatus, item)) &&
- (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
- // ---------------
- (!item.isImportExcel &&
- item.attr != 'SELF' &&
- (['DYY'].includes(orderStatus_v(item.orderStatus, item)) ||
- (['DJD'].includes(orderStatus_v(item.orderStatus, item))
- ? item.orderType == 'INSTALL'
- ? !!userInfo.workerNumber
- : true
- : false)))
- "
- type="primary"
- text="接单"
- @tap="actionReceive(item)"
- ></u-button>
- <!-- 待抢单 ok-->
- <u-button
- v-if="
- // ---------------
- (!item.isImportExcel &&
- item.attr == 'SELF' &&
- ['DQD'].includes(orderStatus_v(item.orderStatus, item)) &&
- (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
- // ---------------
- (!item.isImportExcel &&
- item.attr != 'SELF' &&
- ['DQD'].includes(orderStatus_v(item.orderStatus, item)))
- "
- type="primary"
- text="抢单"
- @tap="qdOrder(item)"
- ></u-button>
- <!-- 配件申请 -->
- <u-button
- v-if="
- // ---------------
- ((item.isImportExcel &&
- item.orderType != 'INSTALL' &&
- (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
- (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
- !userInfo.workerNumber))) ||
- // ---------------
- (item.isImportExcel &&
- item.orderType != 'INSTALL' &&
- ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
- isTodayOrYesterday(item.overTime)) ||
- // ---------------
- (!item.isImportExcel && ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)))) &&
- (item.isImportExcel ? item.isMeet : true)
- "
- plain
- type="primary"
- text="配件申请"
- @tap="toPartsApply(item.id)"
- ></u-button>
- <!-- 变更小工 -->
- <u-button
- v-if="
- // ---------------
- ((item.isImportExcel &&
- ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
- (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
- // ---------------
- (item.isImportExcel &&
- ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
- item.orderType != 'INSTALL' &&
- !userInfo.workerNumber) ||
- // ---------------
- (!item.isImportExcel &&
- ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
- (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true))) &&
- (item.isImportExcel ? item.isMeet : true)
- "
- plain
- type="primary"
- text="变更小工"
- @tap="biangengxiaogong(item)"
- ></u-button>
- <!-- 辅材收费 ok-->
- <u-button
- plain
- type="primary"
- text="辅材收费"
- @tap="toCharge(item.id, 'M')"
- v-if="
- ((item.isImportExcel &&
- ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
- (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
- //----------
- (item.isImportExcel &&
- ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
- item.orderType != 'INSTALL' &&
- !userInfo.workerNumber) ||
- //----------
- (!item.isImportExcel &&
- ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
- !!userInfo.workerNumber) ||
- //----------
- (((item.isImportExcel &&
- ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
- (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
- (!item.isImportExcel &&
- ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
- !!userInfo.workerNumber)) &&
- isTodayOrYesterday(item.overTime))) &&
- (item.isImportExcel ? item.isMeet : true)
- "
- ></u-button>
- <!-- 配件收费 -->
- <u-button
- v-if="
- ((item.isImportExcel &&
- item.orderType != 'INSTALL' &&
- (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
- (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
- !userInfo.workerNumber))) ||
- //----------
- (!item.isImportExcel &&
- item.orderType != 'INSTALL' &&
- ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
- !!userInfo.workerNumber) ||
- //----------
- (((item.isImportExcel &&
- item.orderType != 'INSTALL' &&
- ['YWG'].includes(orderStatus_v(item.orderStatus, item))) ||
- (!item.isImportExcel &&
- item.orderType != 'INSTALL' &&
- ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
- !!userInfo.workerNumber)) &&
- isTodayOrYesterday(item.overTime))) &&
- (item.isImportExcel ? item.isMeet : true)
- "
- plain
- type="primary"
- text="配件收费"
- @tap="toCharge(item.id, 'P')"
- ></u-button>
- <!-- 过程反馈 -->
- <u-button
- v-if="
- (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
- (item.isImportExcel &&
- item.orderType != 'INSTALL' &&
- !userInfo.workerNumber &&
- ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)))) &&
- (item.isImportExcel ? item.isMeet : true)
- "
- type="primary"
- text="过程反馈"
- @tap="toFeedback(item.id)"
- ></u-button>
- <!-- ------------------------------------ -->
- <!-- <block v-if="orderStatus_v(item.orderStatus,item) == 'DJD'">
- <u-button
- plain
- type="primary"
- text="取消加急"
- @tap="actionUrgent(item.id, false)"
- v-if="item.orderFlags && item.orderFlags.some(o => o.tag == 'JIA_JI')"
- ></u-button>
- <u-button plain type="primary" text="加急" @tap="actionUrgent(item.id, true)" v-else></u-button>
- </block> -->
- </view>
- </view>
- </view>
- <Loading :loadStatus="loadStatus" :dataList="dataList" />
- </view>
- </zj-page-layout>
- <zj-dialog-dateRangePicker v-model="isShowDatePicker" @confirm="confirmDate"></zj-dialog-dateRangePicker>
- <selectionWorkers
- v-if="item"
- :title="title"
- :detail="item"
- :type="selectionWorkersType"
- :callback="callback"
- @close="
- () => {
- item = null
- selectionWorkersType = null
- callback = null
- }
- "
- />
- </view>
- </template>
- <script>
- import zjDialogDateRangePicker from '@/components/zj-dialog/zj-dialog-dateRangePicker.vue'
- import selectionWorkers from '@/components/selectionWorkers.vue'
- import { getStorage } from '@/common/utils/storage.js'
- export default {
- components: {
- selectionWorkers,
- zjDialogDateRangePicker
- },
- data() {
- return {
- mainTabs: [
- { name: '全部', value: '', num: 0 },
- { name: '待抢单', value: 'DQD', num: 0 },
- { name: '待接单', value: 'DJD', num: 0 },
- { name: '服务中', value: 'FWZ', num: 0 },
- { name: '已完工', value: 'YWG', num: 0 },
- { name: '异常待处理', value: 'YCD', num: 0 }
- ],
- curMainTab: '',
- curSmallTab: 0,
- curSmallTabIndex: 0,
- smallTabs: [
- { id: 0, name: '全部' },
- { id: 1, name: '今天' },
- { id: 2, name: '明天' },
- { id: 3, name: '其他' }
- ],
- curOrderType: '',
- isShowDatePicker: false,
- startDate: '',
- endDate: '',
- dataList: [],
- pageNum: 1,
- loadStatus: 0,
- refresherTriggered: false, // 下拉刷新状态
- scrollLeft: 0,
- scrollViewWidth: 0,
- tabsRect: {
- left: 0
- },
- isYb: false, // 是否延保单
- isWb: false, // 是否维保单
- selectionWorkersType: '',
- item: null,
- callback: null,
- title: ''
- }
- },
- onLoad({ tab, isYb, isWb, smallTab }) {
- this.crossPage.$on('refreshWorkorderList', data => {
- if (data && data.tab) {
- this.curMainTab = data.tab
- }
- if (data && data.smallTab) {
- this.curSmallTab = Number(data.smallTab)
- this.curSmallTabIndex = Number(data.smallTab)
- }
- this.refreshList()
- })
- if (isYb) {
- this.isYb = true
- }
- if (isWb) {
- this.isWb = true
- }
- this.getCount()
- this.curMainTab = tab || ''
- this.curSmallTab = smallTab ? Number(smallTab) : 0
- this.curSmallTabIndex = smallTab ? Number(smallTab) : 0
- this.refreshList()
- },
- onReady() {
- this.resize()
- },
- onUnload() {
- this.crossPage.$off('refreshWorkorderList')
- },
- computed: {
- userInfo() {
- return getStorage('user')
- }
- },
- methods: {
- isToday(dateString) {
- const inputDate = new Date(dateString)
- const today = new Date()
- return (
- inputDate.getFullYear() === today.getFullYear() &&
- inputDate.getMonth() === today.getMonth() &&
- inputDate.getDate() === today.getDate()
- )
- },
- orderStatus_v(orderStatus, item) {
- if (item?.isImportExcel && item?.isMeet === false) {
- return 'DJD'
- }
- if (['DYY'].includes(orderStatus)) {
- // 待预约
- return 'DYY'
- } else if (['DQD'].includes(orderStatus)) {
- // 待抢单
- return 'DQD'
- } else if (
- [
- 'DSHPG',
- 'CJ',
- 'YPD',
- 'DXSPD',
- 'DZBPG',
- 'DWDSPGP',
- 'DXSSPGP',
- 'DTJXSSPGP',
- 'DZBSPGP',
- 'DFZXPD',
- 'DFZXSPGP',
- 'XSBH',
- 'TJXSBH',
- 'ZBBH',
- 'FZXBH',
- 'FL'
- ].includes(orderStatus)
- ) {
- // 待商户派工
- return 'DSHPG'
- } else if (['DWDPG', 'DWDPD', 'WDBH'].includes(orderStatus)) {
- // 待网点派工
- return 'DWDPG'
- } else if (['DJD'].includes(orderStatus)) {
- // 待接单
- return 'DJD'
- } else if (['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP'].includes(orderStatus)) {
- // 服务中
- return 'FWZ'
- } else if (['YCD'].includes(orderStatus)) {
- // 异常单
- return 'YCD'
- } else if (['YWG', 'GCSZX', 'WDWG', 'YWGO'].includes(orderStatus)) {
- // 已完工待结算
- return 'YWG'
- } else if (['YJS', 'LRCD'].includes(orderStatus)) {
- // 已结算
- return 'YJS'
- } else if (['YQX', 'FWZT', 'YCGB', 'FWQX'].includes(orderStatus)) {
- // 已取消
- return 'YQX'
- }
- return ''
- },
- // 触发下拉刷新
- async refresherrefresh(e) {
- this.refresherTriggered = true
- this.refreshList()
- },
- // 滚动到底部
- scrolltolower(e) {
- if (this.loadStatus === 0) {
- this.pageNum++
- this.getList()
- }
- },
- // 获取统计数量
- getCount() {
- this.$api
- .post('/pg/order/base/status/count', {
- isYb: this.isYb,
- isWb: this.isWb
- })
- .then(res => {
- if (!res.data) return false
- const data = res.data
- this.mainTabs[0].num = data.all || 0
- this.mainTabs[1].num = data.dqd || 0
- this.mainTabs[2].num = data.djd || 0
- this.mainTabs[3].num = data.fwz || 0
- this.mainTabs[4].num = data.ywg || 0
- this.mainTabs[5].num = data.ycd || 0
- })
- },
- // 获取列表
- getList() {
- this.loadStatus = 1
- this.$api
- .post('/pg/order/base/list', {
- pageNum: this.pageNum,
- pageSize: 5,
- keyword: '',
- orderBaseStatus: this.curMainTab,
- byDay: this.curSmallTab || '',
- startTime: this.startDate ? this.startDate + ' 00:00:00' : '',
- endTime: this.endDate ? this.endDate + ' 23:59:59' : '',
- isYb: this.isYb,
- isWb: this.isWb
- })
- .then(res => {
- this.loadStatus = 0
- let list = res.data.records
- if (list.length < 5) {
- this.loadStatus = 2
- }
- this.dataList = this.pageNum === 1 ? list : this.dataList.concat(list)
- })
- .catch(() => {
- this.loadStatus = 2
- })
- .finally(res => {
- this.refresherTriggered = false
- })
- },
- findMainTabIndex(val) {
- for (var i = 0; i < this.mainTabs.length; i++) {
- if (this.mainTabs[i]['value'] == val) {
- return i
- }
- }
- },
- setScrollLeft() {
- // 当前活动tab的布局信息,有tab菜单的width和left(为元素左边界到父元素左边界的距离)等信息
- const tabRect = this.mainTabs[this.findMainTabIndex(this.curMainTab)]
- // 累加得到当前item到左边的距离
- const offsetLeft = this.mainTabs.slice(0, this.findMainTabIndex(this.curMainTab)).reduce((total, curr) => {
- return total + curr.rect.width
- }, 0)
- // 此处为屏幕宽度
- const windowWidth = uni.$u.sys().windowWidth
- // 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
- let scrollLeft =
- offsetLeft -
- (this.tabsRect.width - tabRect.rect.width) / 2 -
- (windowWidth - this.tabsRect.right) / 2 +
- this.tabsRect.left / 2
- // 这里做一个限制,限制scrollLeft的最大值为整个scroll-view宽度减去tabs组件的宽度
- scrollLeft = Math.min(scrollLeft, this.scrollViewWidth)
- this.scrollLeft = Math.max(0, scrollLeft)
- },
- // 获取所有标签的尺寸
- resize() {
- if (this.mainTabs.length === 0) {
- return
- }
- Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(([tabsRect, itemRect = []]) => {
- this.tabsRect = tabsRect
- this.scrollViewWidth = 0
- itemRect.map((item, index) => {
- // 计算scroll-view的宽度,这里
- this.scrollViewWidth += item.width
- // 另外计算每一个item的中心点X轴坐标
- this.mainTabs[index].rect = item
- })
- // 获取了tabs的尺寸之后,设置滑块的位置
- this.setScrollLeft()
- })
- },
- // 获取导航菜单的尺寸
- getTabsRect() {
- return new Promise(resolve => {
- this.queryRect('tab-scroll-view').then(size => resolve(size))
- })
- },
- // 获取所有标签的尺寸
- getAllItemRect() {
- return new Promise(resolve => {
- const promiseAllArr = this.mainTabs.map((item, index) => this.queryRect(`tab-item-${index}`, true))
- Promise.all(promiseAllArr).then(sizes => resolve(sizes))
- })
- },
- // 获取各个标签的尺寸
- queryRect(el, item) {
- return new Promise(resolve => {
- this.$uGetRect(`.${el}`).then(size => {
- resolve(size)
- })
- })
- },
- // 切换大状态
- changeMainTab(val) {
- this.curMainTab = val
- // this.curMainTab = val.value;
- if (this.startDate == '' || this.endDate == '') {
- this.curSmallTab = 0
- this.curSmallTabIndex = 0
- } else {
- this.curSmallTab = ''
- this.curSmallTabIndex = ''
- }
- this.refreshList()
- this.resize()
- },
- // 切换小状态
- changeSmallTab(item) {
- this.curSmallTab = item.id
- this.curSmallTabIndex = item.index
- this.startDate = ''
- this.endDate = ''
- this.refreshList()
- },
- // 选择日期
- confirmDate(item) {
- let [start, end] = item
- if (start == '' || end == '') {
- this.curSmallTab = 0
- this.curSmallTabIndex = 0
- this.startDate = ''
- this.endDate = ''
- return
- }
- this.curSmallTab = ''
- this.curSmallTabIndex = ''
- this.startDate = start
- this.endDate = end
- this.refreshList()
- },
- // 刷新列表
- refreshList() {
- this.dataList = []
- this.pageNum = 1
- this.getList()
- this.getCount()
- },
- // 去搜索页面
- toSearchPage() {
- this.$navToPage({
- url: '/packageWorkorder/pages/search'
- })
- },
- // 加急
- actionUrgent(id, flag) {
- this.$modal({
- title: '加急操作',
- content: '加急操作,会消息通知所有订单相关人员,请谨慎操作。'
- })
- .then(() => {
- this.$api
- .post('/pg/order/base/flag', {
- orderBaseId: id,
- orderFlagEnum: 'JIA_JI',
- flag: flag
- })
- .then(res => {
- this.$successToast()
- this.refreshList()
- })
- })
- .catch(() => {})
- },
- // 接单
- actionReceive(item) {
- this.title = '接收确认'
- this.selectionWorkersType = 1
- this.item = { ...item }
- this.callback = () => {
- this.$successToast()
- this.refreshList()
- this.toDetail(item.id)
- this.$nextTick(() => {
- this.item = null
- this.selectionWorkersType = null
- this.callback = null
- this.title = null
- })
- }
- },
- // 变更小工
- biangengxiaogong(item) {
- this.title = '更换小工'
- this.selectionWorkersType = 3
- this.item = { ...item }
- this.callback = () => {
- this.$successToast()
- this.refreshList()
- this.toDetail(item.id)
- this.$nextTick(() => {
- this.item = null
- this.selectionWorkersType = null
- this.callback = null
- this.title = null
- })
- }
- },
- // 抢单
- qdOrder(item) {
- // this.title = '接收确认'
- // this.selectionWorkersType = 2
- // this.item = { ...item }
- // this.callback = () => {
- // this.$successToast()
- // this.refreshList()
- // this.toDetail(item.id)
- // this.item = null
- // this.selectionWorkersType = null
- // this.callback = null
- // }
- this.$modal({
- title: '抢单确认',
- content: '确认抢单?'
- })
- .then(() => {
- this.$api
- .post('/pg/order/base/qd', {
- orderBaseId: item.id
- })
- .then(res => {
- this.$successToast()
- this.refreshList()
- this.toDetail(item.id)
- })
- })
- .catch(() => {})
- },
- // 去收费
- toCharge(id, type) {
- if (type == 'M') {
- this.$navToPage({
- url: `/packageMaterial/pages/sale/orderList?type=${type}&oid=${id}`
- })
- } else if (type == 'P') {
- this.$navToPage({
- url: `/packageMaterial/pages/newSale/orderList?type=${type}&oid=${id}`
- })
- }
- },
- // 去配件申请
- toPartsApply(id) {
- this.$navToPage({
- url: `/packageMaterial/pages/partsApply/form?id=${id}`
- })
- },
- // 去过程反馈
- toFeedback(id) {
- this.$navToPage({
- url: `/packageWorkorder/pages/processFeedback?id=${id}`
- })
- },
- toDetail(id) {
- this.$navToPage({
- url: `/packageWorkorder/pages/orderDetail?id=${id}`
- })
- }
- }
- }
- </script>
- <style lang="scss" scopeds>
- .all-container {
- width: 100%;
- height: 100vh;
- display: flex;
- flex-direction: column;
- .main-container {
- flex: 1;
- }
- }
- .top-container {
- display: flex;
- background: $theme-color;
- height: 100rpx;
- align-items: center;
- justify-content: space-between;
- padding: 0 30rpx 10rpx;
- position: relative;
- .left-nav {
- flex: 1;
- display: flex;
- align-items: flex-end;
- // overflow-x: scroll;
- // overflow-y: hidden;
- padding: 20rpx 0;
- .item {
- flex-shrink: 0;
- display: flex;
- margin-right: 32rpx;
- position: relative;
- // &:last-child {
- // margin-right: 0;
- // }
- .name {
- font-size: 30rpx;
- color: #ffffff;
- }
- .num {
- color: #ffffff;
- margin-top: -8rpx;
- margin-left: 2rpx;
- }
- &.active {
- &::after {
- content: '';
- width: 44rpx;
- height: 6rpx;
- background: #ffffff;
- border-radius: 6rpx;
- position: absolute;
- bottom: -16rpx;
- left: calc((100% - 44rpx) / 2);
- }
- .name {
- font-size: 40rpx;
- font-weight: bolder;
- position: relative;
- }
- }
- }
- }
- .right-search {
- margin-left: 30rpx;
- margin-top: 10rpx;
- .iconfont {
- font-size: 36rpx;
- color: #ffffff;
- }
- }
- }
- .status-container {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx;
- .date {
- height: 68rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0 24rpx;
- border-radius: 24rpx;
- border: 1px solid #eaeaea;
- box-sizing: border-box;
- .text {
- font-size: 28rpx;
- color: $reg-font;
- }
- .iconfont {
- font-size: 28rpx;
- color: $reg-font;
- }
- &.active {
- background: #e7efff;
- border: 1px solid #3d8ffd;
- .text {
- color: #3d8ffd;
- }
- .iconfont {
- color: #3d8ffd;
- }
- }
- }
- }
- .order-list-container {
- padding: 0 30rpx;
- .item {
- @include zj-card;
- background: #ffffff;
- border-radius: 20rpx;
- margin-bottom: 30rpx;
- padding: 0 30rpx;
- &:last-child {
- margin-bottom: 0;
- }
- .item-top {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- border-bottom: 1px solid #d6e0f2;
- padding: 30rpx 0 20rpx;
- .left {
- flex: 1;
- width: 0;
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- .title {
- font-size: 40rpx;
- font-weight: 600;
- color: $theme-color;
- margin-right: 12rpx;
- }
- .text {
- line-height: 48rpx;
- padding: 0 16rpx;
- background: #f4f5f9;
- border-radius: 8rpx;
- margin-right: 12rpx;
- text {
- color: $assist-color;
- }
- }
- .tags {
- display: flex;
- align-items: center;
- margin-bottom: 10rpx;
- .tag {
- margin-top: 10rpx;
- flex-shrink: 0;
- height: 36rpx;
- line-height: 36rpx;
- border-radius: 8rpx;
- border: 1px solid $theme-color;
- color: $theme-color;
- font-size: 24rpx;
- padding: 0 10rpx;
- box-sizing: border-box;
- font-weight: 500;
- margin-right: 10rpx;
- &:last-child {
- margin-right: 0;
- }
- &.red {
- border: 1px solid $minor-color;
- color: $minor-color;
- }
- &.red_solid {
- border: 1px solid $minor-color;
- color: #ffffff;
- background: $minor-color;
- }
- &.orange {
- border: 1px solid $assist-color;
- color: $assist-color;
- }
- &.green {
- border: 1px solid $success-color;
- color: $success-color;
- }
- }
- }
- }
- .right {
- float: right;
- flex-shrink: 0;
- height: 56rpx;
- display: flex;
- align-items: center;
- .iconfont {
- color: $minor-color;
- }
- .time {
- color: $minor-color;
- margin-left: 4rpx;
- }
- }
- .status {
- color: $minor-color;
- line-height: 56rpx;
- }
- }
- .item-main {
- .row {
- display: flex;
- align-items: center;
- margin-top: 20rpx;
- &.address-row {
- align-items: flex-start;
- .value {
- align-items: flex-start;
- }
- }
- .label {
- color: $sec-font;
- flex-shrink: 0;
- margin-right: 20rpx;
- line-height: 36rpx;
- font-size: 28rpx;
- }
- .value {
- flex: 1;
- display: flex;
- align-items: center;
- .val {
- line-height: 32rpx;
- font-size: 28rpx;
- }
- .num {
- margin-left: 4rpx;
- text {
- color: $theme-color;
- }
- }
- .tag {
- height: 36rpx;
- padding: 0 10rpx;
- border-radius: 4rpx;
- background: #ecf5ff;
- color: $theme-color;
- font-size: 20rpx;
- font-weight: 500;
- margin-left: 10rpx;
- line-height: 36rpx;
- box-sizing: border-box;
- }
- .fun {
- flex-shrink: 0;
- display: flex;
- align-items: center;
- padding: 0 20rpx;
- .iconfont {
- color: $theme-color;
- margin-right: 6rpx;
- }
- .text {
- font-size: 28rpx;
- color: $theme-color;
- }
- }
- }
- }
- }
- .item-btn {
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- flex-wrap: wrap;
- padding: 20rpx 20rpx 20rpx 0;
- ::v-deep .u-button {
- width: 175rpx;
- box-sizing: border-box;
- padding: 10rpx;
- margin: 0;
- margin-left: 10rpx;
- margin-bottom: 10rpx;
- }
- }
- }
- }
- </style>
|