维修,审核驳回
This commit is contained in:
parent
ae9cb79421
commit
00608ce3cd
|
|
@ -10,12 +10,12 @@
|
|||
<uni-col :span="4">
|
||||
<view class="search search-btn" @click="search">查询</view>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="4">
|
||||
<view class="search qualified" @click="onQualified">定损</view>
|
||||
</uni-col> -->
|
||||
<uni-col :span="4">
|
||||
<view class="search reject" @click="onQualified">驳回</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<!-- <view class="checkbox-group">
|
||||
<view class="checkbox-group">
|
||||
<checkbox-group @change="onChangeAllChecked">
|
||||
<label>
|
||||
全选
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
/>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y class="scroll-container">
|
||||
<view
|
||||
|
|
@ -35,15 +35,15 @@
|
|||
class="table-list-item"
|
||||
@tap="onRepairItem(item)"
|
||||
>
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item @click="onClick($event, item)" :right-options="active==1 ? options : []">
|
||||
<!-- <uni-swipe-action>-->
|
||||
<!-- <uni-swipe-action-item @click="onClick($event, item)" :right-options="active==1 ? options : []">-->
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">定损任务</span>
|
||||
<!-- <span :style="{ color: active == 1 ? '#3784fb' : '#ff4d4f' }">{{active == 1 ? '已完成' : '未完成'}}</span> -->
|
||||
</div>
|
||||
<view class="line"></view>
|
||||
<uni-row :gutter="24">
|
||||
<!-- <uni-col :span="2">
|
||||
<uni-col :span="2">
|
||||
<checkbox-group @change="onChangeChecked(item)">
|
||||
<label>
|
||||
<checkbox
|
||||
|
|
@ -53,8 +53,8 @@
|
|||
/>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</uni-col> -->
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>-->
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeName }}</view>
|
||||
|
|
@ -124,8 +124,8 @@
|
|||
/>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
<!-- </uni-swipe-action-item>-->
|
||||
<!-- </uni-swipe-action>-->
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
|
@ -214,31 +214,44 @@ const onQualified = async () => {
|
|||
const isSelect = detailsList.value.some((e) => e.isChecked == true)
|
||||
if (!isSelect) {
|
||||
uni.showToast({
|
||||
title: '请勾选需要需要合格的数据!',
|
||||
title: '请选择要驳回的数据!',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
// 组装参数
|
||||
const ids = []
|
||||
detailsList.value.forEach((e) => {
|
||||
if (e.isChecked) {
|
||||
// 提示
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定驳回吗?',
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
// 获取选中数据
|
||||
// 组装参数
|
||||
const ids = []
|
||||
detailsList.value.forEach((e) => {
|
||||
if (e.isChecked) {
|
||||
if (e.ids.length > 0) {
|
||||
e.ids.forEach((f) => {
|
||||
ids.push(f)
|
||||
})
|
||||
e.ids.forEach((f) => {
|
||||
ids.push(f)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(ids)
|
||||
const parm = {
|
||||
ids: ids
|
||||
}
|
||||
})
|
||||
console.log(ids)
|
||||
const res = await auditRepairPass(ids)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
const res = await repairRejectAPI(parm)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '操作成功!',
|
||||
icon: 'none',
|
||||
})
|
||||
getRepairDetailsData()
|
||||
})
|
||||
await getRepairDetailsData()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 点击跳转维修页面
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@
|
|||
import { ref, onUnmounted, computed } from 'vue'
|
||||
import { getRepairDetailsAPI, auditRepairPass } from '@/services/repair/repair.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import {repairRejectAPI} from "../../../services/repair/repair";
|
||||
const detailsList = ref([])
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const taskId = ref('')
|
||||
|
|
@ -224,25 +225,48 @@ const onRepairItem = (item) => {
|
|||
|
||||
}
|
||||
// 驳回
|
||||
const handleReject = () => {
|
||||
// 未选择 提示
|
||||
if (!detailsList.value.some(item => item.isChecked)) {
|
||||
uni.showToast({
|
||||
title: '请选择要驳回的数据',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
const handleReject = async () => {
|
||||
const isSelect = detailsList.value.some((e) => e.isChecked == true)
|
||||
if (!isSelect) {
|
||||
uni.showToast({
|
||||
title: '请选择要驳回的数据',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
// 提示
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定驳回吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
// 获取选中数据
|
||||
const checkedRows = detailsList.value.filter(item => item.isChecked)
|
||||
console.log('🚀 ~ handleReject ~ checkedRows:', checkedRows)
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
// 获取选中数据
|
||||
// const checkedRows = detailsList.value.filter(item => item.isChecked)
|
||||
// console.log('🚀 ~ handleReject ~ checkedRows:', checkedRows)
|
||||
// 组装参数
|
||||
const ids = []
|
||||
detailsList.value.forEach((e) => {
|
||||
if (e.isChecked) {
|
||||
if (e.ids.length > 0) {
|
||||
e.ids.forEach((f) => {
|
||||
ids.push(f)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(ids)
|
||||
const parm = {
|
||||
ids: ids
|
||||
}
|
||||
const res = await repairRejectAPI(parm)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '操作成功!',
|
||||
icon: 'none',
|
||||
})
|
||||
await getRepairDetailsData()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,12 @@ const onClick = async (e, item) => {
|
|||
} else {
|
||||
// 驳回逻辑
|
||||
console.log('驳回')
|
||||
const res = await repairRejectAPI(item.taskId)
|
||||
const parm ={
|
||||
taskIds:[
|
||||
item.taskId,
|
||||
]
|
||||
}
|
||||
const res = await repairRejectAPI(parm)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '驳回成功!',
|
||||
|
|
@ -234,7 +239,7 @@ const changeTab = (index) => {
|
|||
// 点击跳转详情
|
||||
const handleItem = (item) => {
|
||||
console.log(item)
|
||||
if(item.repairStatusCode=="0" || item.repairStatusCode=="4"){
|
||||
if(item.repairStatusCode=="0" || item.repairStatusCode=="4" || item.repairStatusCode=="3"){
|
||||
uni.navigateTo({ url: `/pages/repair/repairManage/details?taskId=${item.taskId}` })
|
||||
}else{
|
||||
uni.navigateTo({ url: `/pages/repair/repairManage/view?taskId=${item.taskId}` })
|
||||
|
|
|
|||
Loading…
Reference in New Issue