维修模块 驳回提交等功能完善
This commit is contained in:
parent
800cab1c18
commit
1513352f40
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)}` })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue