This commit is contained in:
Vinjor 2024-12-16 14:25:54 +08:00
parent 971e75fef4
commit 88d57578a0
3 changed files with 191 additions and 13 deletions

View File

@ -139,8 +139,8 @@
</view> </view>
</view> </view>
<!-- 服务顾问角色 --> <!-- 服务顾问角色 -->
<view class="orderCount" v-if="userInfo.roleCodes.includes('service_advisor') || userInfo.roleCodes.includes('weixiu')|| userInfo.roleCodes.includes('general_inspection')" @click="serviceWork"> <view class="orderCount" v-if="userInfo.roleCodes.includes('service_advisor') || userInfo.roleCodes.includes('weixiu')|| userInfo.roleCodes.includes('general_inspection')" >
<view class="orderCountItem"> <view class="orderCountItem" style="line-height: 90rpx" @click="serviceWork">
<view class="label">待审批配件单<view class="number-box">{{serviceNum}}</view></view> <view class="label">待审批配件单<view class="number-box">{{serviceNum}}</view></view>
</view> </view>
<!-- <view class="orderCountItem">--> <!-- <view class="orderCountItem">-->
@ -148,7 +148,7 @@
<!-- </view>--> <!-- </view>-->
</view> </view>
<view class="orderCount"> <view class="orderCount">
<view class="orderCountItem"> <view class="orderCountItem" style="line-height: 90rpx" @click="waitingWork">
<view class="label">待办工单<view class="number-box">{{total}}</view></view> <view class="label">待办工单<view class="number-box">{{total}}</view></view>
</view> </view>
</view> </view>
@ -932,6 +932,14 @@ export default {
url: '/pages-home/service/applyList' url: '/pages-home/service/applyList'
}) })
}, },
/**
* 待办工单
*/
waitingWork(){
uni.navigateTo({
url: '/pages-order/orderList/orderList'
})
},
/** /**
* 获取未读消息数量 * 获取未读消息数量
* @returns {Promise<void>} * @returns {Promise<void>}
@ -997,7 +1005,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
padding-top: 60rpx; padding-top: 80rpx;
background-color: #F3F5F7; background-color: #F3F5F7;

View File

@ -15,8 +15,8 @@
<!-- <text class="searchBtn" @click="onRefresherrefresh">搜索</text>--> <!-- <text class="searchBtn" @click="onRefresherrefresh">搜索</text>-->
<text class="searchBtn" @click="clearText">清空</text> <text class="searchBtn" @click="clearText">清空</text>
</view> </view>
<uni-datetime-picker v-model="range" type="daterange" @maskClick="maskClick" /> <uni-datetime-picker style="line-height: 80rpx;" v-model="range" type="daterange" @maskClick="maskClick" />
<view class="body-top-tab"> <view class="body-top-tab" style="line-height: 80rpx">
<view class="body-top-tab-item"> <view class="body-top-tab-item">
<picker @change="bindCusFromChange" :value="cusFromIndex" :range="cusFromList"> <picker @change="bindCusFromChange" :value="cusFromIndex" :range="cusFromList">
<view class="uni-input">{{cusFromList[cusFromIndex]}}</view> <view class="uni-input">{{cusFromList[cusFromIndex]}}</view>
@ -39,22 +39,22 @@
<view class="orderList" v-if="!isRepairWarehouse && activeKey==1"> <view class="orderList" v-if="!isRepairWarehouse && activeKey==1">
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus" <scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered"> refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></order-card> <order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @startWork="startWork" @addProj="addProj"></order-card>
<view style="text-align: center" v-if="orderList.length==0"> <view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image> <image class="" src="@/static/images/nothing.png" ></image>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="orderList" style="height: calc(100% - 86rpx)" v-if="!isRepairWarehouse && activeKey==0"> <view class="orderList" style="height: calc(100% - 86rpx)" v-else-if="!isRepairWarehouse && activeKey==0">
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus" <scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered"> refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></order-card> <order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @startWork="startWork" @addProj="addProj"></order-card>
<view style="text-align: center" v-if="orderList.length==0"> <view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image> <image class="" src="@/static/images/nothing.png" ></image>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="orderList" v-else> <view class="orderList" style="height: calc(100% - 90rpx)" v-else>
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus" <scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered"> refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<repair-so-card v-for="(item, index) in repairSoList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></repair-so-card> <repair-so-card v-for="(item, index) in repairSoList" :key="index" :order="item" @childEvent="onRefresherrefresh" @startWork="startWork"></repair-so-card>
@ -64,6 +64,28 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<!-- 提示窗示例 -->
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog type="success" cancelText="线下告知" confirmText="去签字" title="系统提示" content="客户是否在厂进行签字确认?" @confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup>
<!-- 提示窗示例 -->
<uni-popup ref="addProjDialog" type="dialog">
<uni-popup-dialog type="success" cancelText="修改已有项目" confirmText="新增项目" title="系统提示" content="是否需要新增项目?" @confirm="addProjDialogConfirm"
@close="cancelDialogClose"></uni-popup-dialog>
</uni-popup>
<!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="线下告知" value=""
placeholder="请填入告知方式!" @confirm="dialogInputConfirm"></uni-popup-dialog>
</uni-popup>
<!-- 作废modal框-->
<view >
<u-modal showCancelButton @cancel="doVoidCancel" @confirm = "doVoidConfirm" :show="show" :title="title">
<input type="text" v-model="voidData.remark" placeholder="请输入作废原因" >
</u-modal>
</view>
<project-picker ref="proj" @confirm="projConfirm"></project-picker>
<tabBarVue v-if="isRepairWarehouse" title="采购单" msg="2"></tabBarVue> <tabBarVue v-if="isRepairWarehouse" title="采购单" msg="2"></tabBarVue>
<tabBarVue v-else msg="2"></tabBarVue> <tabBarVue v-else msg="2"></tabBarVue>
</view> </view>
@ -72,6 +94,7 @@
<script> <script>
import VNavigationBar from '@/components/VNavigationBar.vue' import VNavigationBar from '@/components/VNavigationBar.vue'
import tabBarVue from '@/components/tabBar/tabBar.vue' import tabBarVue from '@/components/tabBar/tabBar.vue'
import ProjectPicker from "@/components/projectPicker.vue";
import OrderCard from "@/components/orderCard.vue"; import OrderCard from "@/components/orderCard.vue";
import request from '@/utils/request'; import request from '@/utils/request';
import {formatTimestamp,getOrderStatusText,builderOrder,saveTicketsRecords} from "@/utils/utils"; import {formatTimestamp,getOrderStatusText,builderOrder,saveTicketsRecords} from "@/utils/utils";
@ -80,6 +103,8 @@ import {
getUserInfo, getUserInfo,
getStrData, getStrData,
getTenantId, getTenantId,
setJSONData,
getJSONData,
getStorageWithExpiry, getStorageWithExpiry,
setStorageWithExpiry setStorageWithExpiry
} from '@/utils/auth' } from '@/utils/auth'
@ -90,10 +115,20 @@ export default {
OrderCard, OrderCard,
tabBarVue, tabBarVue,
VNavigationBar, VNavigationBar,
ProjectPicker,
RepairSoCard RepairSoCard
}, },
data() { data() {
return { return {
show:false,
title:'作废',
voidData:{},
//id
ticketId: null,
//
selectedProj: [],
//
tellCusText:"",
searchText:"", searchText:"",
payShow: false, payShow: false,
activeKey: 0, activeKey: 0,
@ -196,6 +231,140 @@ export default {
} }
}, },
methods: { methods: {
/**
* 去签字
*/
dialogConfirm() {
uni.navigateTo({
url: '/pages-home/service/sign-agin'
})
},
/**
* 客户不在厂手动输入
*/
dialogClose() {
this.$refs.inputDialog.open()
},
/**
* 卡片的 修改项目 按钮点击
*/
addProj(order){
this.ticketId = order.id
this.$refs.addProjDialog.open()
},
/**
* 新增项目
*/
addProjDialogConfirm(){
this.$refs.proj.open()
},
/**
* 修改已有项目
*/
cancelDialogClose(){
this.$refs.addProjDialog.close()
uni.navigateTo({
url: `/pages-order/orderDetail/orderDetail?id=${this.ticketId}&isDetail=0`
});
},
/**
* 添加项目回调
*/
projConfirm(proj) {
this.selectedProj = proj
if(this.selectedProj.length>0){
setJSONData("newProject",this.formatItem(this.selectedProj))
this.$refs.alertDialog.open()
}
console.log(this.selectedProj,"selectedProj")
console.log(this.ticketId,"this.ticketId")
},
//
formatItem(list) {
if (!(list && list.length > 0)) {
return []
}
return list.map(item => {
const temp = {
...item,
ticketId:this.ticketId,
itemName: item.name,
itemCount: 1,
itemUnit: item.unit,
itemPrice: item.price,
itemDiscount:1,
itemMoney: item.price,
itemTypeId: item.type,
remark: item.remark,
itemType: "01",
itemStatus:"01",
projectId: item.id,
id: null
}
return temp;
})
},
/**
* 保存当前项目
*/
dialogInputConfirm(val) {
//
this.$refs.inputDialog.close()
const newData = {itemList:getJSONData("newProject"),remark:val}
request({
url: '/admin-api/repair/titem/addNewProj',
method: 'post',
data:newData
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '添加维修项目成功!',
icon: 'success'
})
uni.navigateTo({
url: `/pages-order/orderDetail/orderDetail?id=${res.data}&isDetail=0`
});
}else{
uni.showToast({
title: '操作失败,请联系管理员',
icon: 'none'
})
}
})
},
/**
* 作废
*/
doVoidReq(row){
this.show = true
this.voidData = {
id : row.id,
remark : '',
ticketsStatus : '03'
}
},
/**
* 作废请求后台方法
*/
doVoidConfirm(){
request({
url: '/admin-api/repair/tickets/void',
method: 'POST',
data:this.voidData
}).then((res) => {
if (res.code == 200){
uni.showToast({
title: "操作成功",
icon: "success",
})
}
this.doVoidCancel()
this.onRefresherrefresh()
})
},
doVoidCancel(){
this.show = false
},
maskClick(e){ maskClick(e){
console.log('maskClick事件:', e); console.log('maskClick事件:', e);
}, },
@ -469,6 +638,7 @@ export default {
background: #F3F5F7; background: #F3F5F7;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-top: 80rpx;
color: #333333; color: #333333;
.header { .header {
@ -573,7 +743,7 @@ export default {
.orderList { .orderList {
//padding: 30rpx 0; //padding: 30rpx 0;
padding-top: 10rpx; padding-top: 10rpx;
height: calc(100% - 340rpx); height: calc(100% - 390rpx);
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -444,7 +444,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
padding-top: 60rpx; padding-top: 80rpx;
background-color: #F3F5F7; background-color: #F3F5F7;
@ -603,7 +603,7 @@ export default {
.todoListBox { .todoListBox {
flex: 1; flex: 1;
height: 0; height: 0;
margin: 40rpx 32rpx; margin: 40rpx 32rpx 0 32rpx;
} }
.body-top-banner { .body-top-banner {