This commit is contained in:
hayu 2025-08-21 17:36:50 +08:00
parent ed0f491dc7
commit c786014c3c
6 changed files with 128 additions and 87 deletions

View File

@ -31,47 +31,6 @@
</uni-col>
</uni-row>
<scroll-view scroll-y style="padding-bottom: 20rpx">
<!-- -->
<view class="table-list-item">
<!-- 维修人员 -->
<h2 style="padding: 4rpx 0; font-weight: bold">维修信息</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="维修人员">
<uni-data-select
:localdata="repairPersonData"
v-model="repairPerson"
placeholder="请选择维修人员"
/>
</uni-forms-item>
<uni-forms-item label="费用合计">
<uni-easyinput placeholder="请填写费用合计" maxlength="50" v-model="costAll" disabled/>
</uni-forms-item>
<uni-forms-item label="备注">
<uni-easyinput placeholder="请填写备注" maxlength="50" v-model="remark" />
</uni-forms-item>
<!-- <uni-forms-item label="附件">
<div class="upload" @click="uploadImg" v-if="imgBeseUrl == ''">+</div>
<div class="upload" @click="uploadImg" v-else>
<image
:src="imgBeseUrl"
style="width: 160rpx; height: 160rpx"
mode=""
></image>
</div>
</uni-forms-item> -->
<uni-forms-item label="附件">
<div class="upload-container">
<div class="upload" @click="uploadImg2" v-if="imgList2.length < 3">+</div>
<div class="image-preview" v-for="(img, index) in imgList2" :key="index">
<image :src="img.url" mode="aspectFill"></image>
<view class="delete-btn" @click.stop="deleteImage2(index)">×</view>
<PreviewImg :imgUrl="img.url" />
</div>
</div>
</uni-forms-item>
</uni-forms>
</view>
<!-- 内部维修 -->
<view class="table-list-item" v-if="repairType == 1">
@ -111,14 +70,56 @@
@input="costCheckNum(item)"
/>
<div class="operation-btns">
<span class="add" @click="addPart">+</span>
<span class="remove" @click="delPart(index)">-</span>
<span class="add" @click="addPart">增加</span>
<span class="remove" @click="delPart(index)">删除</span>
</div>
</div>
</uni-forms-item>
</div>
</uni-forms>
</view>
<!-- -->
<view class="table-list-item">
<!-- 维修人员 -->
<h2 style="padding: 4rpx 0; font-weight: bold">维修信息</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="维修人员">
<uni-data-select
:localdata="repairPersonData"
v-model="repairPerson"
placeholder="请选择维修人员"
/>
</uni-forms-item>
<uni-forms-item label="费用合计">
<uni-easyinput placeholder="请填写费用合计" maxlength="50" v-model="costAll" disabled/>
</uni-forms-item>
<uni-forms-item label="备注">
<uni-easyinput placeholder="请填写备注" maxlength="50" v-model="remark" />
</uni-forms-item>
<!-- <uni-forms-item label="附件">
<div class="upload" @click="uploadImg" v-if="imgBeseUrl == ''">+</div>
<div class="upload" @click="uploadImg" v-else>
<image
:src="imgBeseUrl"
style="width: 160rpx; height: 160rpx"
mode=""
></image>
</div>
</uni-forms-item> -->
<uni-forms-item label="附件">
<div class="upload-container">
<div class="upload" @click="uploadImg2" v-if="imgList2.length < 3">+</div>
<div class="image-preview" v-for="(img, index) in imgList2" :key="index">
<image :src="img.url" mode="aspectFill"></image>
<view class="delete-btn" @click.stop="deleteImage2(index)">×</view>
<PreviewImg :imgUrl="img.url" />
</div>
</div>
</uni-forms-item>
</uni-forms>
</view>
</scroll-view>
</view>
</template>
@ -711,7 +712,7 @@ const saveCodeApi = async () => {
margin-left: 24rpx;
span {
width: 48rpx;
width: 90rpx;
height: 48rpx;
display: flex;
align-items: center;

View File

@ -32,38 +32,7 @@
</view>
<scroll-view scroll-y style="padding-bottom: 20rpx">
<!-- -->
<view class="table-list-item">
<!-- 维修人员 -->
<h2 style="padding: 4rpx 0; font-weight: bold">定损信息</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="维修人员">
<uni-data-select :localdata="repairPersonData" v-model="repairPerson" placeholder="请选择维修人员" />
</uni-forms-item>
<uni-forms-item label="费用合计">
<uni-easyinput placeholder="请填写费用合计" maxlength="50" v-model="costAll" disabled/>
</uni-forms-item>
<uni-forms-item label="备注">
<uni-easyinput placeholder="请填写备注" maxlength="50" v-model="remark"/>
</uni-forms-item>
<!-- <uni-forms-item label="附件">
<div class="upload" @click="uploadImg" v-if="imgBeseUrl==''">+</div>
<div class="upload" @click="uploadImg" v-else>
<image :src="imgBeseUrl" style="width: 160rpx;height: 160rpx;" mode=""></image>
</div>
</uni-forms-item> -->
<uni-forms-item label="附件">
<div class="upload-container">
<div class="upload" @click="uploadImg2" v-if="imgList2.length < 3">+</div>
<div class="image-preview" v-for="(img, index) in imgList2" :key="index">
<image :src="img.url" mode="aspectFill"></image>
<view class="delete-btn" @click.stop="deleteImage2(index)">×</view>
<PreviewImg :imgUrl="img.url" />
</div>
</div>
</uni-forms-item>
</uni-forms>
</view>
<!-- 定损 -->
<view class="table-list-item">
@ -103,14 +72,47 @@
@input="costCheckNum(item)"
/>
<div class="operation-btns">
<span class="add" @click="addPart">+</span>
<span class="remove" @click="delPart(index)">-</span>
<span class="add" @click="addPart">增加</span>
<span class="remove" @click="delPart(index)">删除</span>
</div>
</div>
</uni-forms-item>
</div>
</uni-forms>
</view>
<!-- -->
<view class="table-list-item">
<!-- 维修人员 -->
<h2 style="padding: 4rpx 0; font-weight: bold">定损信息</h2>
<uni-forms ref="baseForm" label-align="right">
<uni-forms-item label="维修人员">
<uni-data-select :localdata="repairPersonData" v-model="repairPerson" placeholder="请选择维修人员" />
</uni-forms-item>
<uni-forms-item label="费用合计">
<uni-easyinput placeholder="请填写费用合计" maxlength="50" v-model="costAll" disabled/>
</uni-forms-item>
<uni-forms-item label="备注">
<uni-easyinput placeholder="请填写备注" maxlength="50" v-model="remark"/>
</uni-forms-item>
<!-- <uni-forms-item label="附件">
<div class="upload" @click="uploadImg" v-if="imgBeseUrl==''">+</div>
<div class="upload" @click="uploadImg" v-else>
<image :src="imgBeseUrl" style="width: 160rpx;height: 160rpx;" mode=""></image>
</div>
</uni-forms-item> -->
<uni-forms-item label="附件">
<div class="upload-container">
<div class="upload" @click="uploadImg2" v-if="imgList2.length < 3">+</div>
<div class="image-preview" v-for="(img, index) in imgList2" :key="index">
<image :src="img.url" mode="aspectFill"></image>
<view class="delete-btn" @click.stop="deleteImage2(index)">×</view>
<PreviewImg :imgUrl="img.url" />
</div>
</div>
</uni-forms-item>
</uni-forms>
</view>
</scroll-view>
<!-- 返厂维修 -->
<!-- <view class="table-list-item">
@ -748,7 +750,7 @@ const calculateCostAll = () => {
margin-left: 24rpx;
span {
width: 48rpx;
width: 90rpx;
height: 48rpx;
display: flex;
align-items: center;

View File

@ -539,7 +539,7 @@ const saveCodeApi = async () => {
if (response.code == 200) {
uni.showToast({ title: '保存成功', icon: 'none' })
uni.navigateBack({
delta: 2, //
delta: 1, //
})
}
loading.value = false

View File

@ -822,7 +822,7 @@ const saveCodeApi = async () => {
if (response.code == 200) {
uni.showToast({ title: '保存成功', icon: 'none' })
uni.navigateBack({
delta: 2, //
delta: 1, //
})
}
}).catch((error) => {

View File

@ -3,11 +3,11 @@
<uni-row :gutter="24" class="search-form">
<uni-col :span="10">
<view>
<uni-easyinput placeholder="请输入内容" />
<uni-easyinput placeholder="请输入内容" v-model="keyWord" maxlength="10"/>
</view>
</uni-col>
<uni-col :span="4">
<view class="search">查询</view>
<view class="search" @click="search">查询</view>
</uni-col>
<uni-col :span="4">
<view class="search" style="background: #19be6b" @click="onQualified">合格</view>
@ -34,7 +34,7 @@
<uni-col :span="6">待修数量</uni-col>
<uni-col :span="18">
<view class="cont">{{
queryParams.typeRepairNum - queryParams.typeRepairedNum
queryParams.waitRepairNum
}}</view>
</uni-col>
</uni-row>
@ -94,25 +94,51 @@
<script setup>
import { computed, ref } from 'vue'
import { auditRepairPass } from '@/services/repair/repair.js'
import { onLoad } from '@dcloudio/uni-app'
import {onLoad, onShow} from '@dcloudio/uni-app'
import {getAppRepairMaTypeListByTaskIdAndTypeId} from "../../../services/repair/repair";
const queryParams = ref({})
const allChecked = ref(false)
const repairDeviceList = ref([])
const selectedItems = ref([])
const ids = ref([])
const taskId = ref('')
const typeId = ref('')
const keyWord = ref('')
const selectableItems = computed(() => {
return repairDeviceList.value.filter(item => item.status === '0').map(item => item.code)
})
onShow(() => {
getRepairDetailsData()
})
onLoad((options) => {
queryParams.value = JSON.parse(options.queryParams)
console.log('🚀 ~ onLoad ~ queryParams.value:', queryParams.value)
repairDeviceList.value = queryParams.value.repairDeviceList;
console.log(repairDeviceList.value)
// repairDeviceList.value = queryParams.value.repairDeviceList;
// console.log(repairDeviceList.value)
taskId.value = queryParams.value.taskId
typeId.value = queryParams.value.typeId
getRepairDetailsData()
})
const search = () => {
console.log('🚀 ~ search ~ keyWord:', keyWord.value)
getRepairDetailsData()
}
//
const getRepairDetailsData = async () => {
const res = await getAppRepairMaTypeListByTaskIdAndTypeId({ taskId: taskId.value,typeId:typeId.value,keyword:keyWord.value })
repairDeviceList.value = res.data
//repairDeviceList.value,status=0
const statusZeroCount = repairDeviceList.value.filter(item => item.status === '0').length;
console.log('status 为 0 的个数:', statusZeroCount);
queryParams.value.waitRepairNum=statusZeroCount
}
const handleSelectAll = (e) => {
console.log('🚀 ~ handleSelectAll ~ e:', e)
const checked = e.detail.value.length > 0

View File

@ -20,6 +20,18 @@ export const getRepairDetailsAPI = (data) => {
data,
})
}
/**
* 维修 ---- 列表详情,3
*/
export const getAppRepairMaTypeListByTaskIdAndTypeId = (data) => {
return http({
method: 'GET',
url: '/material/repair/getAppRepairMaTypeListByTaskIdAndTypeId',
data,
})
}
/**
* 维修 ---- 合格操作(废弃)
*/