This commit is contained in:
许允枞 2025-04-10 17:46:39 +08:00
parent b1fba5d056
commit 1abdae0f3f

View File

@ -8,7 +8,8 @@
</view> -->
<view class="t-input">
<!-- <uni-icons type="search" color="#BCBCBC" size="22"></uni-icons>-->
<u-search v-model="carNum" @custom="getList" @search="getList" clearabled placeholder="搜索车牌号....."></u-search>
<u-search v-model="carNum" @custom="getList" @search="getList" clearabled
placeholder="搜索车牌号....."></u-search>
</view>
<view class="icon1" @click="goNotice()">
<image src="/static/imgs/staffxiaoxi.png" style="width: 50rpx;height: 50rpx;" mode=""></image>
@ -19,22 +20,29 @@
<scroll-view scroll-x="true" style="width: 100%;">
<view style="display: flex; align-items: center; white-space: nowrap;">
<view class="tap-box" v-for="(item, index) in tapList" :key="index" @click="tapqh(index)">
<view v-if="isExamine || getValueByText(item.text) !== '7'">
<view class="xhuihui" :class="{'xzhei': tapindex == index}"
style="white-space: nowrap;margin-right: 0.5rem">
{{ item.text }}{{ countMap.length !== 0 ? ('(' + countMap.get(index + 1 + "") + ')') : '' }}
{{ item.text }}{{ countMap.length !== 0 ? ('(' + countMap.get(getValueByText(item.text)) + ')') : '' }}
</view>
<view class="gang" v-if="tapindex == index"></view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="mub">
<view class="top-ail">
<!-- 使用 scroll-view 包裹 SchoolInfo 组件 -->
<scroll-view class="school-scroll-view" scroll-y @scrolltolower="onReachBottomCus"
:style="{ height: scrollHeight + 'px' }" refresher-enabled @refresherrefresh="onRefresherrefresh"
:refresher-triggered="isTriggered">
<view class="jsy" v-if="infoDatas.length == 0">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
<u-empty mode="list">
</u-empty>
</view>
<view class="m-box" v-for="(item,index) in infoDatas" :key="index">
<view class="m-box" v-for="(item,index) in infoDatas" :key="index" v-else>
<view class="sshi" v-if="item.isPass == '0'">
<image v-if="item.status == 1" :src="imgurl + '/noPass.png'" mode=""></image>
<view v-else class="">
@ -87,33 +95,38 @@
</view>
<view class="on-input" v-if="item.nodeNames">
<uni-icons type="more" color="#999999" size="16"></uni-icons>
<text class="single-line">检测内容</text>
<text class="multi-line">{{ item.nodeNames }}</text>
<text class="single-line" v-if="tapValue != '7'">检测内容</text>
<text class="single-line" style="color: red;" v-else>需重审项目</text>
<text class="multi-line"
:style="tapValue == '7' ? 'color:red' : ''">{{ item.nodeNames }}</text>
</view>
<view class="bottom-di">
<view class="button-container">
<u-button class="button" v-if="beginButtonShow.includes(tapindex)" @click="orderTakingBefore(item)"
size="10">
<u-button class="button" v-if="beginButtonShow.includes(tapValue)"
@click="orderTakingBefore(item)" size="10">
开始检测
</u-button>
<u-button class="button" v-if="cancelButtonShow.includes(tapindex)" @click="cancelAnOrder(item)"
size="10">
<u-button class="button" v-if="cancelButtonShow.includes(tapValue)"
@click="cancelAnOrder(item)" size="10">
取消接单
</u-button>
<u-button class="button" v-if="meetCarButtonShow.includes(tapindex)" @click="meetCarPhoto(item);openMeetCar = true"
size="10">
<u-button class="button" v-if="meetCarButtonShow.includes(tapValue)"
@click="meetCarPhoto(item);openMeetCar = true" size="10">
接车拍照
</u-button>
<u-button class="button" v-if="meetCarButtonShow.includes(tapindex)" @click="getMeetMan();meetCarPhoto(item);showMeetMan = true"
size="10">
<u-button class="button" v-if="meetCarButtonShow.includes(tapValue)"
@click="getMeetMan();meetCarPhoto(item);showMeetMan = true" size="10">
更换人员
</u-button>
<u-button class="button" @click="hge=true;getProject(item.id)"
v-if="isExamine && tapValue == '7'" size="10">重审项目</u-button>
<u-button class="button" @click="godetails(item)" size="10">查看详情</u-button>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<u-popup :show="openMeetCar" @close="openMeetCar = false" :round="10">
@ -130,7 +143,8 @@
</view>
</view>
</u-popup>
<u-picker :show="showMeetMan" keyName="nickname" title="更换接车人" :columns="[columnsMeetMan]" @confirm="confirmsMeetMan" @cancel="cancelsMeetMan"></u-picker>
<u-picker :show="showMeetMan" keyName="nickname" title="更换接车人" :columns="[columnsMeetMan]"
@confirm="confirmsMeetMan" @cancel="cancelsMeetMan"></u-picker>
<view class="lanniu-container2">
<u-picker :show="show" :columns="chooseWorkNodes" @confirm="confirms" @cancel="cancels"
@ -145,9 +159,37 @@
<text>+ 补录</text>
</view>
</view>
<view class="lanniu-container" v-else>
<view class="lanniu" @click="gogogo">
<text>接车创建</text>
</view>
</view>
<view style="width: 100%; height: 50px;"></view>
<tabBar :msg="msg"></tabBar>
<u-popup :show="hge" @close="closehge" :round="10">
<view class="popup-box">
<view v-if="isExamine">
<view class="t-title">重审/退办</view>
<view class="on-inputx">
<view class="anniu" :class="{'an':isRetrial == item.value}" v-for="(item,index) in cstb"
:key="index" @click="shenmowanyi(item.value,index)">
<text>{{ item.text }}</text>
</view>
</view>
<view class="t-title" v-if="tbindex == 1 && isRetrial == 1">选择复检的项目</view>
<view class="box_ on-inputx" v-if="tbindex == 1 && isRetrial == 1">
<view class="box_button " :class="{ 'box_button_x' :csId.includes(item.id) }"
v-for="item in selectProject" @click="clickProject(item)">{{ item.projectName }}
</view>
</view>
</view>
<view class="bottomx" @click="submitRecheck()">
<uni-icons type="compose" color="#0174F6" size="20"></uni-icons>
<text>提交</text>
</view>
</view>
</u-popup>
</view>
</template>
@ -155,7 +197,9 @@
import config from '@/config'
import request from '../../utils/request';
import tabBar from '../../components/staffTabBer/tabBar.vue'
import {type} from "../../uni_modules/uni-forms/components/uni-forms/utils";
import {
type
} from "../../uni_modules/uni-forms/components/uni-forms/utils";
import upload from "@/utils/upload";
import USearch from "@/uni_modules/uview-ui/components/u-search/u-search.vue";
@ -168,14 +212,16 @@ export default {
baseUrl: this.$baseUrl,
infoDatas: {},
openMeetCar: false,
isTriggered: false,
selectedInfoId: undefined,
partnerId: uni.getStorageSync("partnerId"),
goodsTitle: '',
tapindex: 0,
fileList1: [],
fileList2: [],
tapValue: 1,
inspectionInfoId: undefined,
isExamine: false,
hge: false,
msg: '1',
carNum: '',
pageNum: 1, //
@ -183,6 +229,8 @@ export default {
pageSize: 20, //
totalPages: 0, //
remark: '',
scrollHeight: 0,
selectProject: [],
// tapList: [
// {
// text: "",
@ -203,11 +251,18 @@ export default {
// text: "",
// value: "1"
// },
{
text: "待审核重检",
value: "7",
},
{
text: "待检测",
value: "1"
},
{
text: "待接车",
value: "6",
},
{
text: "检测中",
value: "2",
@ -224,33 +279,55 @@ export default {
text: "已完成",
value: "5",
},
{
text: "待接车",
value: "6",
},
],
tapValue: 1,
chooseWorkNodes: [],
columnsMeetMan: [],
tbindex: 1,
isRetrial: 1,
show: false,
showMeetMan: false,
takingData: {
workNodeId: null,
id: null
},
beginButtonShow: [0, 2, 3],
cancelButtonShow: [1],
meetCarButtonShow: [5],
countMap: []
beginButtonShow: ['1', '3', '4'],
cancelButtonShow: ['2'],
meetCarButtonShow: ['6'],
countMap: [],
csId: [],
cstb: [{
text: '重检',
value: "2"
}, {
text: '复检',
value: "1"
},
{
text: '退办理',
value: "0"
},
],
}
},
onLoad() {
async onLoad() {
this.$startSocketConnect(uni.getStorageSync('userId'))
await this.isExamines()
this.msgInfo()
this.getWarnCount()
this.tapValue = this.isExamine ? this.tapList[0].value : this.tapList[1].value
this.tapindex = this.isExamine ? 0 : 1
this.getList()
uni.$on('refresh', () => {
this.getList()
})
},
onShow() {
this.getList()
this.isExamines()
// this.getList()
},
onReady() {
//
this.calculateScrollHeight();
},
watch: {
msgSocket(newVal, oldVal) {
@ -276,6 +353,76 @@ export default {
tabBar,
},
methods: {
calculateScrollHeight() {
//
const screenHeight = uni.getSystemInfoSync().windowHeight;
//
const topHeight = 270;
//
this.scrollHeight = screenHeight - topHeight;
},
//
getProject(id) {
this.inspectionInfoId = id
request({
url: '/system/info/getWeorkNodesById',
method: 'get',
params: {
inspectionId: id
}
}).then(res => {
this.selectProject = res.data
})
},
closehge() {
this.hge = false
this.csId = []
},
Nnimamadewen(value, index) {
this.geindex = index
this.type = value
},
shenmowanyi(value, index) {
this.tbindex = value
this.isRetrial = value
},
clickProject(data) {
//idcsId
let index = this.csId.indexOf(data.id)
if (index !== -1) {
//
this.csId.splice(index, 1);
} else {
//
this.csId.push(data.id);
}
},
/**
* 上滑加载数据
*/
onReachBottomCus() {
// *
if (this.pageNum >= this.totalPages) {
uni.$u.toast('没有更多数据了')
return
}
//+1,
this.pageNum++
//
this.getList()
//
this.clearTime()
},
/**
* 下拉刷新数据
*/
onRefresherrefresh() {
this.isTriggered = true
this.pageNum = 1
this.total = 0
this.infoDatas = []
this.getList()
},
async getCount() {
await request({
url: '/system/info/getCountByType?partnerId=' + this.partnerId,
@ -293,6 +440,65 @@ export default {
this.noReadNum = res.data
}
})
},
async submitRecheck(id) {
console.log(this.isRetrial);
let inspectionInfo = {
inspectionInfoId: this.inspectionInfoId,
id: this.workNodeId,
type: this.isRetrial,
}
let status = 0
if (this.isExamine && this.tbindex == 1 && this.isRetrial == 1) {
if (this.csId == '' || this.csId == undefined) {
uni.showToast({
title: '请选择要复检的项目',
icon: 'none'
})
return
}
const workNodes = []
this.csId.forEach(item => {
let a = {
id: item,
status: "3"
}
workNodes.push(a)
})
inspectionInfo.workNodes = workNodes
await request({
url: '/system/info/recheck',
method: 'post',
data: inspectionInfo
})
this.onRefresherrefresh()
this.closehge()
return
} else if (this.isExamine && this.tbindex == 2 && this.isRetrial == 2) {
//
status = 2
} else if (this.tbindex == 0 && this.isRetrial == 0) {
status = 1
}
inspectionInfo.selectType = status
let res = await request({
// url: '/partnerOwn/partner/stopInspection',
url: '/system/info/controls',
method: 'post',
data: inspectionInfo
})
if (res.code == 200) {
uni.showToast({
title: "成功",
})
}
this.onRefresherrefresh()
this.closehge()
console.log(data);
},
/** 接车拍照提交*/
submit() {
@ -316,7 +522,7 @@ export default {
this.openMeetCar = false
this.remark = ''
this.fileList1 = []
this.getList()
this.onRefresherrefresh()
}
})
},
@ -413,7 +619,7 @@ export default {
id: item.id
}
let res = await request({
url: `/system/info/getWorkNodeByIdAndNow?id=${item.id}&status=${(this.tapindex === 4 ? "3" : "0")}${(this.tapindex === 3 ? "&flag=false" : "")}`,
url: `/system/info/getWorkNodeByIdAndNow?id=${item.id}&status=${(this.tapValue === '4' ? "3" : "0")}${(this.tapValue === '3' ? "&flag=false" : "")}`,
method: 'get',
})
if (res.data) {
@ -442,14 +648,23 @@ export default {
}
},
/**
* 根据 text 查找对应的 value
* @param {string} text - 要查找的文本
* @param {Array} list - 数据列表默认使用 tapList
* @returns {string|null} 返回对应的 value找不到则返回 null
*/
getValueByText(text, list = this.tapList) {
const item = list.find(item => item.text === text);
return item ? item.value : null;
},
/*判断是否是收费登陆人*/
isExamines() {
request({
async isExamines() {
const res = await request({
url: '/system/info/isExamine',
method: 'get'
}).then(res => {
this.isExamine = res.data
})
this.isExamine = res.data
},
callUser(phone) {
uni.makePhoneCall({
@ -474,7 +689,9 @@ export default {
} else {
this.infoDatas = res.rows
}
console.log('此时的tapindex', this.tapindex);
const ids = this.infoDatas.filter(item => !item.nodeNames).map(item => item.id)
if (this.tapValue != '7') {
if (ids && ids.length > 0) {
const response = await request({
url: "/partnerOwn/partner/getProjectByIds?ids=" + ids,
@ -487,12 +704,28 @@ export default {
})
}
}
} else {
//
if (ids && ids.length > 0) {
const response = await request({
url: "/partnerOwn/partner/getProjectBelowStandardByIds?ids=" + ids,
method: 'get'
})
if (response.data) {
const data = response.data
this.infoDatas.forEach(item => {
this.$set(item, 'nodeNames', data[item.id])
})
}
}
}
let total = res.total
this.totalPages = Math.ceil(total / this.pageSize);
}
await this.getCount()
this.isTriggered = false
},
getfan() {
uni.navigateBack()
@ -517,7 +750,11 @@ export default {
icon: 'none'
})
// this.tapindex = 1
this.godetails({id: data.id, workNodeId: data.workNodeId, workNodeStatus: 1})
this.godetails({
id: data.id,
workNodeId: data.workNodeId,
workNodeStatus: 1
})
}
})
},
@ -630,7 +867,7 @@ export default {
.mub {
background-color: #F4F4F4;
height: calc(100vh);
// height: calc(100vh);
}
.tap {
@ -692,9 +929,7 @@ export default {
justify-content: space-between;
}
.top-left {
}
.top-left {}
.top-right {
z-index: 9999;
@ -775,7 +1010,8 @@ export default {
bottom: 60px;
display: flex;
align-items: center;
justify-content: space-between; /* 控制子元素之间的间距,可以改为 center/space-around */
justify-content: space-between;
/* 控制子元素之间的间距,可以改为 center/space-around */
transform: translate(-50%);
left: 50%;
z-index: 10074;
@ -785,7 +1021,8 @@ export default {
position: fixed;
display: flex;
align-items: center;
justify-content: space-between; /* 控制子元素之间的间距,可以改为 center/space-around */
justify-content: space-between;
/* 控制子元素之间的间距,可以改为 center/space-around */
z-index: 999999;
}
@ -798,8 +1035,10 @@ export default {
height: 44px;
border-radius: 8px;
font-weight: bold;
flex: 1; /* 子元素均分宽度 */
margin: 0 5px; /* 控制子元素之间的间距 */
flex: 1;
/* 子元素均分宽度 */
margin: 0 5px;
/* 控制子元素之间的间距 */
}
@ -817,8 +1056,10 @@ export default {
/* 允许 item.nodeNames 多行显示 */
.multi-line {
white-space: pre-line; /* 保留换行符,但允许文本换行 */
word-break: break-all; /* 长单词或 URL 会在必要时断开 */
white-space: pre-line;
/* 保留换行符,但允许文本换行 */
word-break: break-all;
/* 长单词或 URL 会在必要时断开 */
}
.msg-num {
@ -827,20 +1068,26 @@ export default {
top: -20rpx;
color: white;
background: #d74a43;
padding: 5rpx 10rpx; /* 使用 padding 确保有足够的空间 */
min-width: 35rpx; /* 最小宽度 */
line-height: 1.2; /* 调整行高以适应不同内容 */
padding: 5rpx 10rpx;
/* 使用 padding 确保有足够的空间 */
min-width: 35rpx;
/* 最小宽度 */
line-height: 1.2;
/* 调整行高以适应不同内容 */
text-align: center;
font-weight: 800;
font-size: 11px;
border-radius: 20rpx; /* 椭圆效果 */
white-space: nowrap; /* 确保文本不换行 */
border-radius: 20rpx;
/* 椭圆效果 */
white-space: nowrap;
/* 确保文本不换行 */
}
.icon1 {
position: relative;
width: 56rpx;
height: 56rpx;
//margin-left: 30rpx;
.msg-num {
position: absolute;
@ -875,6 +1122,7 @@ export default {
background-color: white;
margin-bottom: 80rpx;
}
.bottomx {
margin: 0 auto;
width: 225px;
@ -887,4 +1135,89 @@ export default {
justify-content: center;
//color: #0174F6;
}
.popup-box {
overflow: hidden;
border-radius: 8px;
box-sizing: border-box;
padding: 15px;
width: 100%;
background-color: white;
}
.t-title {
font-size: 17px;
font-weight: bold;
color: #333333;
}
.box_ {
width: 100%;
display: flex;
flex-wrap: wrap;
}
.box_button {
border-radius: 6px;
border: 1px solid #999;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
box-sizing: border-box;
padding: 5px 10px;
margin-right: 5px;
margin-bottom: 5px;
}
.box_button_x {
border-radius: 6px;
border: 1px solid #0D2E8D;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
box-sizing: border-box;
padding: 5px 10px;
margin-right: 5px;
margin-bottom: 5px;
background: #0D2E8D;
color: #fff;
}
.on-inputx {
width: 100%;
display: flex;
align-items: center;
margin: 15px auto;
}
.anniu {
box-sizing: border-box;
padding: 2px 10px;
margin: 0px 10px;
// background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
border: 1px solid #0D2E8D;
border-radius: 23px;
font-size: 15px;
color: #0D2E8D;
display: flex;
align-items: center;
justify-content: center;
}
.an {
box-sizing: border-box;
padding: 2px 10px;
margin: 0px 10px;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%) !important;
border-radius: 23px;
font-size: 15px;
color: white !important;
display: flex;
align-items: center;
justify-content: center;
}
</style>