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