维修模块 驳回提交等功能完善

This commit is contained in:
BianLzhaoMin 2024-11-21 18:17:36 +08:00
parent 800cab1c18
commit 1513352f40
5 changed files with 124 additions and 35 deletions

View File

@ -2,8 +2,16 @@
<!-- 数量出库 -->
<view class="page-container">
<uni-row :gutter="24" class="search-form">
<uni-col :span="6">
<view class="search" style="background-color: #19be6b"> 维修完成 </view>
<uni-col :span="12">
<view>
<uni-easyinput placeholder="请输入内容" />
</view>
</uni-col>
<uni-col :span="4">
<view class="search">查询</view>
</uni-col>
<uni-col :span="4">
<view class="search" style="background-color: #19be6b">合格</view>
</uni-col>
</uni-row>
<view class="table-list-item">
@ -26,6 +34,43 @@
</uni-col>
</uni-row>
</view>
<view class="table-list-item" style="margin: 0">
<checkbox-group>
<label>
全选
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
:checked="allChecked"
value="all"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</view>
<view class="table-list-item">
<uni-row :gutter="24">
<uni-col :span="2">
<checkbox-group>
<label>
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</uni-col>
<uni-col :span="2">1</uni-col>
<uni-col :span="14">物资名称</uni-col>
<uni-col :span="6">
<view class="cont">66</view>
</uni-col>
</uni-row>
</view>
</view>
</template>
@ -34,6 +79,7 @@ import { computed, ref } from 'vue'
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
const query = defineProps() //
const queryParams = JSON.parse(query.queryParams)
const allChecked = ref(false)
</script>
<style lang="scss" scoped>
@ -74,28 +120,26 @@ const queryParams = JSON.parse(query.queryParams)
color: #fff;
}
.scroll-container {
.table-list-item {
.table-list-item {
margin: 20rpx 0;
padding: 20rpx;
background-color: #fff;
// min-height: 300rpx;
border-radius: 10rpx;
.title {
display: flex;
justify-content: space-between;
align-items: center;
}
.cont {
display: flex;
justify-content: flex-end;
line-height: 1.9;
}
.line {
margin: 20rpx 0;
padding: 20rpx;
background-color: #fff;
// min-height: 300rpx;
border-radius: 10rpx;
.title {
display: flex;
justify-content: space-between;
align-items: center;
}
.cont {
display: flex;
justify-content: flex-end;
line-height: 1.9;
}
.line {
margin: 20rpx 0;
height: 1px;
background-color: #e8e8e8;
}
height: 1px;
background-color: #e8e8e8;
}
}
}

View File

@ -180,11 +180,11 @@ const onRepairItem = (item) => {
}
if (manageType == 1) {
codingUrl = '/pages/repair/num-operate' //
queryParams = {
repairNum,
typeName,
type,
}
}
queryParams = {
repairNum,
typeName,
type,
}
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}` })
}

View File

@ -29,7 +29,7 @@
</view>
</uni-col>
<uni-col :span="4">
<view class="search" @click="getTableList()">搜索</view>
<view class="search" @click="onSearchBtn()">搜索</view>
</uni-col>
</uni-row>
@ -132,7 +132,7 @@
<script setup>
import { ref, computed } from 'vue'
import { getRepairListAPI } from '@/services/repair/repair.js'
import { getRepairListAPI, repairSubmitAPI, repairRejectAPI } from '@/services/repair/repair.js'
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
@ -162,7 +162,7 @@ const options = ref([
},
{
text: '回',
text: '回',
style: {
backgroundColor: '#ed6042',
color: '#fff',
@ -172,9 +172,27 @@ const options = ref([
])
//
const onClick = (e, item) => {
console.log('**')
const onClick = async (e, item) => {
if (e.index === 0) {
//
const res = await repairSubmitAPI([{ taskId: item.taskId }])
if (res.code === 200) {
uni.showToast({
title: '提交成功!',
icon: 'none',
})
}
} else {
//
console.log('驳回')
const res = await repairRejectAPI(item.taskId)
if (res.code === 200) {
uni.showToast({
title: '驳回成功!',
icon: 'none',
})
}
}
}
// change
@ -184,11 +202,17 @@ const onChangeDate = (val) => {
queryParams.value.endTime = val_2
}
//
const onSearchBtn = () => {
queryParams.value.pageNum = 1
tableList.value = []
getTableList()
}
//
const getTableList = async (isTap = false) => {
// console.log('queryParams.value', queryParams.value)
const res = await getRepairListAPI(queryParams.value)
console.log('res列表数据', res)
total.value = res.total
if (isTap) {
tableList.value = res.rows

View File

@ -30,3 +30,23 @@ export const setQualifiedAPI = (data) => {
data,
})
}
/**
* 维修 ---- 提交
*/
export const repairSubmitAPI = (data) => {
return http({
method: 'POST',
url: '/material/repair/endRepairTask',
data,
})
}
/**
* 维修 ---- 驳回
*/
export const repairRejectAPI = (id) => {
return http({
method: 'delete',
url: '/material/repair/' + id,
data: [id],
})
}

View File

@ -49,6 +49,7 @@ export const http = (options) => {
uni.request({
...options,
success(res) {
console.log('res', res)
// 1. 判断是否请求成功
if (res.statusCode >= 200 && res.statusCode < 300) {
if (res.data.code >= 200 && res.data.code < 300) {