This commit is contained in:
hongchao 2025-06-23 14:40:17 +08:00
commit 462b293f49
11 changed files with 134 additions and 26 deletions

View File

@ -413,7 +413,8 @@
{ {
"path": "pages/repair/testExamine/index", "path": "pages/repair/testExamine/index",
"style": { "style": {
"navigationBarTitleText": "修试审核" // "navigationBarTitleText": "修试审核"
"navigationStyle": "custom"
} }
}, },
//- //-

View File

@ -33,8 +33,8 @@
@clear="clearPro" @clear="clearPro"
></eselect> ></eselect>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="制单人员:" name="backPerson"> <uni-forms-item label="退料人员:" name="backPerson">
<uni-easyinput v-model="backPerson" maxlength="10" placeholder="请输入制单人" /> <uni-easyinput v-model="backPerson" maxlength="10" placeholder="请输入退料人" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="联系电话:" name="phone"> <uni-forms-item label="联系电话:" name="phone">
<uni-easyinput v-model="phone" maxlength="11" placeholder="请输入联系电话" /> <uni-easyinput v-model="phone" maxlength="11" placeholder="请输入联系电话" />
@ -59,6 +59,8 @@ import {
getAgreementInfoById, getAgreementInfoById,
} from '../../services/back.js' } from '../../services/back.js'
import eselect from '@/components/tree-select/eselect.vue' import eselect from '@/components/tree-select/eselect.vue'
import { useMemberStore } from '@/stores'
const memberStore = useMemberStore()
const treeSelect = ref(null) const treeSelect = ref(null)
const treeSelect2 = ref(null) const treeSelect2 = ref(null)
const formData = ref({}) const formData = ref({})
@ -167,7 +169,7 @@ const confirmAdd = () => {
if (agreementId.value == '') { if (agreementId.value == '') {
uni.showToast({ title: '请确认退料单位,退料工程!', icon: 'none' }) uni.showToast({ title: '请确认退料单位,退料工程!', icon: 'none' })
} else if (backPerson.value == '') { } else if (backPerson.value == '') {
uni.showToast({ title: '请确认制单人!', icon: 'none' }) uni.showToast({ title: '请确认退料人!', icon: 'none' })
} else { } else {
let obj = { let obj = {
backApplyInfo: { backApplyInfo: {
@ -207,6 +209,7 @@ onLoad((options) => {
getUnit() getUnit()
getProject() getProject()
// formData.value = JSON.parse(options.item) // formData.value = JSON.parse(options.item)
backPerson.value = memberStore.userInfo.nickName
}) })
</script> </script>

View File

@ -22,7 +22,7 @@
taskInfo.code taskInfo.code
}}</span> }}</span>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="制单人员:" name="backPerson"> <uni-forms-item label="退料人员:" name="backPerson">
<span style="height: 100%; display: flex; align-items: center">{{ <span style="height: 100%; display: flex; align-items: center">{{
taskInfo.backPerson taskInfo.backPerson
}}</span> }}</span>

View File

@ -37,9 +37,9 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24" style="display: flex; align-items: center; margin-bottom: 20px"> <uni-row :gutter="24" style="display: flex; align-items: center; margin-bottom: 20px">
<uni-col :span="6">制单</uni-col> <uni-col :span="6">退料</uni-col>
<uni-col :span="16"> <uni-col :span="16">
<uni-easyinput placeholder="请输入制单人" maxlength="10" v-model="backPerson" /> <uni-easyinput placeholder="请输入退料人" maxlength="10" v-model="backPerson" />
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24" style="display: flex; align-items: center; margin-bottom: 20px"> <uni-row :gutter="24" style="display: flex; align-items: center; margin-bottom: 20px">
@ -103,6 +103,8 @@ import { onLoad } from '@dcloudio/uni-app'
import { getMachine, insertBack, getMachineByQrCodeApi } from '../../services/back.js' import { getMachine, insertBack, getMachineByQrCodeApi } from '../../services/back.js'
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue' import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
import { baseURL } from '@/utils/http' import { baseURL } from '@/utils/http'
import { useMemberStore } from '@/stores'
const memberStore = useMemberStore()
const backPerson = ref('') const backPerson = ref('')
const phone = ref('') const phone = ref('')
const apDetection = ref('完好') // const apDetection = ref('完好') //
@ -313,6 +315,7 @@ const getMaInfoScan = async () => {
onLoad((options) => { onLoad((options) => {
console.log(options) console.log(options)
backPerson.value = memberStore.userInfo.nickName
}) })
</script> </script>

View File

@ -14,7 +14,7 @@
<uni-forms-item label="退料单号:" name="code"> <uni-forms-item label="退料单号:" name="code">
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.code }}</span> <span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.code }}</span>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="制单人员:" name="backPerson"> <uni-forms-item label="退料人员:" name="backPerson">
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.backPerson }}</span> <span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.backPerson }}</span>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="退料电话:" name="phone"> <uni-forms-item label="退料电话:" name="phone">

View File

@ -111,7 +111,7 @@
> >
</uni-row> </uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="8">制单</uni-col> <uni-col :span="8">退料</uni-col>
<uni-col :span="16" <uni-col :span="16"
><div class="cont">{{ item.backPerson }}</div></uni-col ><div class="cont">{{ item.backPerson }}</div></uni-col
> >

View File

@ -153,7 +153,7 @@ const confirmAdd = () => {
if (agreementId.value == '') { if (agreementId.value == '') {
uni.showToast({ title: '请确认单位名称,工程名称!', icon: 'none' }) uni.showToast({ title: '请确认单位名称,工程名称!', icon: 'none' })
} else if (fieldPerson.value == '') { } else if (fieldPerson.value == '') {
uni.showToast({ title: '请确认制单人!', icon: 'none' }) uni.showToast({ title: '请确认退料人!', icon: 'none' })
} else if (phone.value == '') { } else if (phone.value == '') {
uni.showToast({ title: '请确认联系电话!', icon: 'none' }) uni.showToast({ title: '请确认联系电话!', icon: 'none' })
} else { } else {

View File

@ -477,7 +477,7 @@ const formMiddle = ref({
// //
const formRight = ref({ const formRight = ref({
// scrapNum:0, // scrapNum:0,
scrapType: 0, scrapType: 1,
scrapId: null, // id scrapId: null, // id
scrapReason: '', // scrapReason: '', //
fileList: [], fileList: [],

View File

@ -436,7 +436,7 @@ const delMidPart = (index) => {
// //
const formRight = ref({ const formRight = ref({
scrapNum: 0, scrapNum: 0,
scrapType: 0, scrapType: 1,
scrapReason: '', scrapReason: '',
fileList:[] fileList:[]
}) })

View File

@ -1,5 +1,6 @@
<template> <template>
<!-- 维修列表 --> <!-- 维修列表 -->
<uni-nav-bar status-bar leftIcon="left" right-text="通过" title="退料任务详情" backgroundColor="#dcf4ff" :border="false" fixed @clickLeft="back" @clickRight="submitAll"/>
<view class="page-container"> <view class="page-container">
<view class="complete-btn"> <view class="complete-btn">
<view class="btn" @click="changeTab(1)"> <view class="btn" @click="changeTab(1)">
@ -35,12 +36,29 @@
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24" class="search-form">
<uni-col :span="24" style="display: flex;">
<div>全选</div>
<checkbox-group v-if="active == 1" @change="onChangeAllChecked" style="margin: 0 10px;">
<checkbox :checked="isAllChecked"/>
</checkbox-group>
<div>{{ isCheckedNum }}</div>
<div style="margin: 0 5px;">/</div>
<div>{{ tableList.length }}</div>
</uni-col>
</uni-row>
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container"> <scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
<view class="table-list-item" :key="index" @click="handleItem(item)" v-for="(item, index) in tableList"> <view class="table-list-item" :key="index" @click="handleItem(item)" v-for="(item, index) in tableList">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item @click="onClick($event, item)" :right-options="item.taskStatus==10 ? options:[]"> <uni-swipe-action-item @click="onClick($event, item)" :right-options="item.taskStatus==10 ? options:[]">
<div class="title"> <div class="title">
<div style="display: flex;">
<checkbox-group v-if="active == 1" @change="onChangeChecked(item)">
<checkbox :checked="item.checked"/>
</checkbox-group>
<span style="font-size: 15px; font-weight: 800;color: #3784fb;">{{ item.repairNum }}</span> <span style="font-size: 15px; font-weight: 800;color: #3784fb;">{{ item.repairNum }}</span>
</div>
<div class="title-right"> <div class="title-right">
<uni-tag v-if="item.taskStatus == 10" text="未完成" type="warning" custom-style="warningStyle"/> <uni-tag v-if="item.taskStatus == 10" text="未完成" type="warning" custom-style="warningStyle"/>
<uni-tag v-if="item.taskStatus == 11" text="已完成" type="success" custom-style="successStyle"/> <uni-tag v-if="item.taskStatus == 11" text="已完成" type="success" custom-style="successStyle"/>
@ -137,6 +155,7 @@ import { getListTestExamineApply,outerAudit } from '@/services/repair/testExamin
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
const loading = ref(false)
const total = ref(0) // const total = ref(0) //
const active = ref(1) // tap const active = ref(1) // tap
const tableList = ref([]) // const tableList = ref([]) //
@ -173,6 +192,81 @@ const options = ref([
}, },
]) ])
const isAllChecked = ref(false)
const isCheckedNum = computed(() => tableList.value.filter(item => item.checked).length)
const back = () => {
//
uni.navigateBack({
delta: 1, //
})
}
const updateAllChecked = () => {
isAllChecked.value = tableList.value.length > 0 && tableList.value.every(item => item.checked)
}
//
const onChangeAllChecked = () => {
isAllChecked.value = !isAllChecked.value
tableList.value = tableList.value.map(item => ({
...item,
checked: isAllChecked.value
}))
}
const onChangeChecked = (row) => {
row.checked = !row.checked
updateAllChecked()
}
const submitAll = () => {
//
if (!tableList.value.some(item => item.checked)) {
uni.showToast({
title: '请至少勾选一条审核数据',
icon: 'none'
})
return
}
//
uni.showModal({
title: '提示',
content: '确定提交审核吗?',
success: async (res) => {
if (res.confirm) {
const params = tableList.value.filter(item => item.checked).map(item => {
return {
status: '1',
taskId: item.taskId,
}
})
console.log('🚀 ~ params ~ params:', params)
if (loading.value) return
loading.value = true
uni.showLoading({
mask: true
})
try {
const res = await outerAudit(params)
if (res.code === 200) {
uni.showToast({
title: '操作成功!',
icon: 'none',
})
onSearchBtn()
}
loading.value = false
uni.hideLoading()
} catch (error) {
console.log('🚀 ~ submitAll ~ error:', error)
loading.value = false
uni.hideLoading()
}
}
}
})
}
// //
const onClick = async (e, item) => { const onClick = async (e, item) => {
console.log(item) console.log(item)
@ -216,16 +310,23 @@ const onSearchBtn = () => {
// //
const getTableList = async (isTap = false) => { const getTableList = async (isTap = false) => {
console.log('queryParams.value查询参数', queryParams.value) console.log('queryParams.value查询参数', queryParams.value)
const checkedIds = Array.isArray(tableList.value)
? tableList.value.filter(item => item && item.checked).map(item => item.taskId)
: []
try {
const res = await getListTestExamineApply(queryParams.value) const res = await getListTestExamineApply(queryParams.value)
total.value = res.data.total total.value = res?.data?.total || 0
if (isTap) { tableList.value = Array.isArray(res?.data?.rows) ? res.data.rows : []
tableList.value = res.data.rows //
} else { tableList.value.forEach(item => {
if (res.data.rows.length == 0) { item.checked = checkedIds.includes(item.taskId)
})
console.log('🚀 ~ getTableList ~ tableList.value:', tableList.value)
updateAllChecked()
} catch (error) {
console.error('获取列表数据失败:', error)
total.value = 0
tableList.value = [] tableList.value = []
} else {
tableList.value.push(...res.data.rows)
}
} }
} }
@ -244,7 +345,7 @@ onShow(() => {
const onScrollTolower = debounce(() => { const onScrollTolower = debounce(() => {
console.log('触底事件') console.log('触底事件')
if (total.value > tableList.value.length) { if (total.value > tableList.value.length) {
queryParams.value.pageNum++ queryParams.value.pageSize += 5
getTableList() getTableList()
} }
}, 500) }, 500)

View File

@ -8,9 +8,9 @@ import { useMemberStore } from '@/stores'
const ENV = process.env.NODE_ENV const ENV = process.env.NODE_ENV
// export const baseURL = ENV === 'development' ? 'http://192.168.0.244:18580' : 'http://192.168.0.244:18580'//测试 // export const baseURL = ENV === 'development' ? 'http://192.168.0.244:18580' : 'http://192.168.0.244:18580'//测试
// export const baseURL = ENV === 'development' ? 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/' : 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/'//生产 // export const baseURL = ENV === 'development' ? 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/' : 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api/'//生产
// export const baseURL = ENV === 'development' ? '/api' : '/iws/jiju-api'; // 宏源服务 export const baseURL = ENV === 'development' ? 'http://192.168.1.114:18080' : '/iws/jiju-api'; // 宏源服务
// export const baseURL = ENV === 'development' ? 'http://192.168.0.234:18080' : '***' // export const baseURL = ENV === 'development' ? 'http://192.168.0.234:18080' : '***'
export const baseURL = ENV === 'development' ? 'http://192.168.1.117:18080' : 'http://192.168.1.117:18080'//马 // export const baseURL = ENV === 'development' ? 'http://192.168.1.114:18080' : 'http://192.168.1.117:18080'//马
// export const baseURL = ENV === 'development' ? '/api' : '***' // export const baseURL = ENV === 'development' ? '/api' : '***'
// **********OCR识别为NVUE文件页面请求URL需要同步配置********** // **********OCR识别为NVUE文件页面请求URL需要同步配置**********