This commit is contained in:
Vinjor 2024-11-18 20:02:18 +08:00
parent 11736fa216
commit 03c860ae5c
7 changed files with 244 additions and 15 deletions

View File

@ -135,7 +135,27 @@
</text>
</view>
<view class="todoList">
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
<view class="body-top-tab" v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
<view class="body-top-tab-item">
<picker @change="bindCusFromChange" :value="cusFromIndex" :range="cusFromList">
<view class="uni-input">{{cusFromList[cusFromIndex]}}</view>
</picker>
</view>
<view class="line"></view>
<view class="body-top-tab-item">
<picker @change="bindRepairTypeChange" :value="repairTypeIndex" :range="repairTypeList">
<view class="uni-input">{{repairTypeList[repairTypeIndex]}}</view>
</picker>
</view>
</view>
<scroll-view v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')" scroll-y="true" style="height: calc(100% - 50px)" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @getOrder="openFile" @startWork="startWork" @addProj="addProj"></order-card>
<view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
</scroll-view>
<scroll-view v-else scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
refresher-enabled @refresherrefresh="onRefresherrefresh" :refresher-triggered="isTriggered">
<order-card :userInfo="userInfo" v-for="(item, index) in orderList" :key="index" :order="item" @childEvent="onRefresherrefresh" @doVoid="doVoidReq" @getOrder="openFile" @startWork="startWork" @addProj="addProj"></order-card>
<view style="text-align: center" v-if="orderList.length==0">
@ -195,7 +215,9 @@ import {
getStrData,
getTenantId,
setJSONData,
getJSONData
getJSONData,
getStorageWithExpiry,
setStorageWithExpiry
} from '@/utils/auth'
export default {
@ -284,6 +306,18 @@ export default {
companyInfo:{},
//
range: ['2021-02-01', '2021-03-28'],
//
repairTypeList:['按维修类别'],
//--
repairTypeValueList:[''],
//
repairTypeIndex:0,
//
cusFromList:['按客户来源'],
//---
cusFromValueList:[''],
//
cusFromIndex:0,
}
},
watch: {
@ -301,6 +335,9 @@ export default {
})
}else{
this.companyInfo = getJSONData("companyInfo")
//2----cus_sign_type-repair_type
this.initDict("repair_type")
this.initDict("cus_sign_type")
if(!this.$msgSocket){
this.$startMsgSocket(getTenantId(),getStrData("userId"))
}
@ -333,6 +370,59 @@ export default {
}
},
methods: {
/**
* 切换客户来源
*/
bindCusFromChange(e){
this.cusFromIndex = e.detail.value
this.onRefresherrefresh()
},
/**
* 切换维修项目类型
*/
bindRepairTypeChange(e){
this.repairTypeIndex = e.detail.value
this.onRefresherrefresh()
},
/**
* 查2个数据字典备用---客户注册方式-cus_sign_type维修业务分类-repair_type
*/
initDict(dictCode){
let dictArray = getStorageWithExpiry(dictCode);
if(null==dictArray || undefined==dictArray){
request({
url: '/admin-api/system/dict-data/type',
method: 'get',
params:{type:dictCode}
}).then((res) => {
if (res.code == 200) {
setStorageWithExpiry(dictCode,res.data,3600)
this.$nextTick(()=>{
res.data.map(item=>{
this.setDictItem(dictCode,item)
})
})
}
})
}else{
this.$nextTick(()=>{
dictArray.map(item=>{
this.setDictItem(dictCode,item)
})
})
}
},
setDictItem(dictCode,item){
if("repair_type"==dictCode){
//
this.repairTypeList.push(item.label)
this.repairTypeValueList.push(item.value)
}else{
//
this.cusFromList.push(item.label)
this.cusFromValueList.push(item.value)
}
},
maskClick(e){
console.log('maskClick事件:', e);
},
@ -727,7 +817,7 @@ export default {
* 查本人待处理工单
*/
getOrderList(){
let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0"}
let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0",cusFrom:this.cusFromValueList[this.cusFromIndex],repairType:this.repairTypeValueList[this.repairTypeIndex]}
request({
url: '/admin-api/repair/tickets/pageType',
method: 'get',
@ -1115,7 +1205,7 @@ export default {
.todoList {
display: flex;
flex-direction: column;
row-gap: 20rpx;
//row-gap: 20rpx;
height: 98%;
}
}
@ -1210,6 +1300,12 @@ export default {
font-size: 30rpx;
margin: 0 32rpx;
.line {
width: 2rpx;
height: 60rpx;
background-color: #DDDDDD;
}
.body-top-tab-item {
flex: 1;
width: 0;
@ -1299,5 +1395,6 @@ export default {
}
}
}
}
</style>

View File

@ -189,7 +189,7 @@
.tabItem {
padding: 30rpx;
flex: 1;
z-index: 9999999;
//z-index: 9999999;
text-align: center;
position: relative;
font-size: 28rpx;

View File

@ -203,7 +203,7 @@ export default {
.tabItem {
padding: 30rpx;
flex: 1;
z-index: 9999999;
//z-index: 9999999;
text-align: center;
position: relative;
font-size: 24rpx;

View File

@ -17,7 +17,27 @@
</view>
</view>
<view class="orderList" v-if="!isRepairWarehouse">
<scroll-view scroll-y="true" style="height: 100%" class="itemContent" @scrolltolower="onReachBottomCus"
<view class="body-top-tab" v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')">
<view class="body-top-tab-item">
<picker @change="bindCusFromChange" :value="cusFromIndex" :range="cusFromList">
<view class="uni-input">{{cusFromList[cusFromIndex]}}</view>
</picker>
</view>
<view class="line"></view>
<view class="body-top-tab-item">
<picker @change="bindRepairTypeChange" :value="repairTypeIndex" :range="repairTypeList">
<view class="uni-input">{{repairTypeList[repairTypeIndex]}}</view>
</picker>
</view>
</view>
<scroll-view v-if="userInfo.roleCodes.includes('general_inspection') || userInfo.roleCodes.includes('weixiu')" scroll-y="true" style="height: calc(100% - 50px)" class="itemContent" @scrolltolower="onReachBottomCus"
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>
<view style="text-align: center" v-if="orderList.length==0">
<image class="" src="@/static/images/nothing.png" ></image>
</view>
</scroll-view>
<scroll-view v-else scroll-y="true" style="height:100%" class="itemContent" @scrolltolower="onReachBottomCus"
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>
<view style="text-align: center" v-if="orderList.length==0">
@ -50,7 +70,9 @@ import {
getToken,
getUserInfo,
getStrData,
getTenantId
getTenantId,
getStorageWithExpiry,
setStorageWithExpiry
} from '@/utils/auth'
import RepairSoCard from "@/components/repairSoCard.vue";
@ -87,9 +109,21 @@ export default {
],
repairSoList: [],
userInfo:{},
//
repairTypeList:['按维修类别'],
//--
repairTypeValueList:[''],
//
repairTypeIndex:0,
//
cusFromList:['按客户来源'],
//---
cusFromValueList:[''],
//
cusFromIndex:0,
}
},
onShow() {
onLoad(){
if(!getToken()){
uni.reLaunch({
url: '/pages/login/login'
@ -106,10 +140,74 @@ export default {
]
this.isRepairWarehouse = true
}
//2----cus_sign_type-repair_type
this.initDict("repair_type")
this.initDict("cus_sign_type")
}
},
onShow() {
if(!getToken()){
uni.reLaunch({
url: '/pages/login/login'
})
}else{
this.onRefresherrefresh()
}
},
methods: {
/**
* 切换客户来源
*/
bindCusFromChange(e){
this.cusFromIndex = e.detail.value
this.onRefresherrefresh()
},
/**
* 切换维修项目类型
*/
bindRepairTypeChange(e){
this.repairTypeIndex = e.detail.value
this.onRefresherrefresh()
},
/**
* 查2个数据字典备用---客户注册方式-cus_sign_type维修业务分类-repair_type
*/
initDict(dictCode){
let dictArray = getStorageWithExpiry(dictCode);
if(null==dictArray || undefined==dictArray){
request({
url: '/admin-api/system/dict-data/type',
method: 'get',
params:{type:dictCode}
}).then((res) => {
if (res.code == 200) {
setStorageWithExpiry(dictCode,res.data,3600)
this.$nextTick(()=>{
res.data.map(item=>{
this.setDictItem(dictCode,item)
})
})
}
})
}else{
this.$nextTick(()=>{
dictArray.map(item=>{
this.setDictItem(dictCode,item)
})
})
}
},
setDictItem(dictCode,item){
if("repair_type"==dictCode){
//
this.repairTypeList.push(item.label)
this.repairTypeValueList.push(item.value)
}else{
//
this.cusFromList.push(item.label)
this.cusFromValueList.push(item.value)
}
},
/**
* 上滑加载数据
*/
@ -197,7 +295,7 @@ export default {
}
},
getOrderList(){
let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0"}
let paramsObj = {pageNo: this.pageNo, pageSize: this.pageSize, isFinish: "0",cusFrom:this.cusFromValueList[this.cusFromIndex],repairType:this.repairTypeValueList[this.repairTypeIndex]}
console.log("this.searchText",this.searchText)
if(''!=this.searchText){
paramsObj['ticketNo'] = this.searchText
@ -333,6 +431,41 @@ export default {
overflow: auto;
}
.body-top-tab {
display: flex;
font-size: 30rpx;
margin: 0 32rpx;
.line {
width: 2rpx;
height: 60rpx;
background-color: #DDDDDD;
}
.body-top-tab-item {
flex: 1;
width: 0;
text-align: center;
padding: 16rpx 20rpx;
position: relative;
&.active {
color: #0174F6;
}
.activeLine {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 96rpx;
height: 6rpx;
background: #0174F6;
border-radius: 4rpx 4rpx 0rpx 0rpx;
}
}
}
.tabList {
background: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
@ -343,7 +476,7 @@ export default {
.tabItem {
padding: 30rpx;
flex: 1;
z-index: 9999999;
//z-index: 9999999;
text-align: center;
position: relative;
font-size: 28rpx;
@ -371,7 +504,6 @@ export default {
height: calc(100% - 90rpx);
display: flex;
flex-direction: column;
row-gap: 20rpx;
.orderItem {
}

View File

@ -124,7 +124,7 @@
.tabItem {
padding: 30rpx;
flex: 1;
z-index: 9999999;
//z-index: 9999999;
text-align: center;
position: relative;
font-size: 28rpx;

View File

@ -219,7 +219,7 @@
.tabItem {
padding: 30rpx;
flex: 1;
z-index: 9999999;
//z-index: 9999999;
text-align: center;
position: relative;
font-size: 28rpx;

View File

@ -282,7 +282,7 @@ export default {
.tabItem {
padding: 30rpx;
flex: 1;
z-index: 9999999;
//z-index: 9999999;
text-align: center;
position: relative;
font-size: 24rpx;