冲突合并

This commit is contained in:
BianLzhaoMin 2024-11-21 10:49:14 +08:00
commit 7528f80bcb
6 changed files with 641 additions and 0 deletions

View File

@ -175,6 +175,22 @@
"style": {
"navigationBarTitleText": "退料数量查看"
}
},
/* */
// 1.
{
"path": "pages/repair/index",
"style": {
"navigationBarTitleText": "维修任务"
}
},
// 2.
{
"path": "pages/repair/details",
"style": {
"navigationBarTitleText": "维修任务"
}
}
],
"tabBar": {

View File

@ -0,0 +1,258 @@
<template>
<!-- 领料出库详情 -->
<view class="page-container">
<uni-row :gutter="24" class="search-form">
<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">
<checkbox-group @change="onChangeAllChecked">
<label>
全选
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
:checked="allChecked"
value="all"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</view>
<scroll-view scroll-y class="scroll-container">
<view
v-for="(item, index) in detailsList"
:key="index"
class="table-list-item"
@tap="onCodingItem(item)"
>
<view class="line"></view>
<uni-row :gutter="24">
<uni-col :span="2">
<checkbox-group @change="onChangeChecked(item.isChecked)">
<label>
<checkbox
color="#409eff"
borderColor="#409eff"
activeBorderColor="#409eff"
:checked="item.isChecked"
value="all"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</uni-col>
<uni-col :span="6">物资名称</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.typeName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<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.type }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<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.repairNum }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<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.unitName }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
<uni-col :span="6">管理模式</uni-col>
<uni-col :span="16">
<uni-tag
text="编码"
type="warning"
v-if="item.manageType === 0"
size="small"
/>
<uni-tag
text="数量"
type="success"
v-if="item.manageType === 1"
size="small"
/>
</uni-col>
</uni-row>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref, onUnmounted } from 'vue'
import { getRepairDetailsAPI } from '@/services/repair/repair.js'
import { onLoad } from '@dcloudio/uni-app'
const detailsList = ref([])
const query = defineProps() //
const allChecked = ref(false)
//
const leaseApplyInfo = ref({
leaseUnit: '', //
leaseProject: '', //
maTypeName: '', //
typeName: '', //
unitName: '', //
storageNum: '', //
preNum: '', //
parentId: query.id, // id
id: '', // id
typeId: '', // typeId
manageType: '', // manageType
})
//
const getOutboundDetailsData = async () => {
const res = await getRepairDetailsAPI({ taskId: query.taskId })
detailsList.value = res.data
detailsList.value = detailsList.value.map((e) => {
return { ...e, isChecked: false }
})
}
//
const onChangeAllChecked = (e) => {
console.log('全选', e.detail.value)
}
//
const onChangeChecked = (val) => {
val = !val
}
//
const onCodingItem = (item) => {
//
const {
status,
manageType,
maTypeName,
typeName,
storageNum,
preNum,
alNum,
unitName,
id,
typeId,
} = item
leaseApplyInfo.value.maTypeName = maTypeName
leaseApplyInfo.value.typeName = typeName
leaseApplyInfo.value.unitName = unitName
leaseApplyInfo.value.storageNum = storageNum
leaseApplyInfo.value.preNum = preNum
leaseApplyInfo.value.alNum = alNum
leaseApplyInfo.value.id = id
leaseApplyInfo.value.typeId = typeId
leaseApplyInfo.value.manageType = manageType
if (status == 2) {
uni.showToast({ title: '该物资已完成出库!', icon: 'none' })
return
}
let codingUrl = ''
if (manageType === 0) {
codingUrl = '/pages/picking/outbound/code-outbound' //
}
if (manageType == 1) {
codingUrl = '/pages/picking/outbound/num-outbound' //
}
// leaseApplyInfo json
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
}
//
onLoad(() => {
getOutboundDetailsData()
//
uni.$on('onUpdate', () => {
// console.log('')
//
getOutboundDetailsData()
})
})
//
onUnmounted(() => {
uni.$off('onUpdate') //
})
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
background-color: #e8f5fb;
.search-form {
margin: 10rpx 0;
display: flex;
align-items: center;
box-sizing: content-box;
}
.search {
height: 60rpx;
background-color: #3784fb;
text-align: center;
line-height: 60rpx;
color: #fff;
border-radius: 10rpx;
}
.table-list-item {
margin-bottom: 20rpx;
padding: 20rpx;
background-color: #fff;
// min-height: 300rpx;
border-radius: 10rpx;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
.title {
display: flex;
justify-content: space-between;
align-items: center;
}
.line {
margin: 20rpx 0;
height: 1px;
background-color: #e8e8e8;
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
</style>

324
src/pages/repair/index.vue Normal file
View File

@ -0,0 +1,324 @@
<template>
<!-- 维修列表 -->
<view class="page-container">
<view class="complete-btn">
<view class="btn" @click="changeTab(1)">
<span>已完成</span>
<view v-if="active == 1" class="bt-line"></view>
</view>
<view class="btn" style="margin-left: 120rpx" @click="changeTab(2)">
<span>未完成</span>
<view v-if="active == 2" class="bt-line"></view>
</view>
</view>
<uni-row :gutter="24" class="search-form">
<uni-col :span="12">
<view>
<uni-datetime-picker
v-model="dateArray"
type="daterange"
@maskClick="maskClick"
@change="onChangeDate"
placeholder="选择日期范围"
/>
</view>
</uni-col>
<uni-col :span="8">
<view>
<uni-easyinput placeholder="请输入内容" v-model="queryParams.keyWord" />
</view>
</uni-col>
<uni-col :span="4">
<view class="search" @click="getTableList()">搜索</view>
</uni-col>
</uni-row>
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
<view
class="table-list-item"
:key="index"
@click="handleItem(item)"
v-for="(item, index) in tableList"
>
<uni-swipe-action>
<uni-swipe-action-item @click="onClick($event, item)" :right-options="options">
<view class="line"></view>
<uni-row :gutter="24">
<uni-col :span="6">退料人</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.createBy }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">任务时间</uni-col>
<uni-col :span="18"
><view class="cont">{{ item.createTime }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">维修单号</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.repairCode }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">退料物资</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.type }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">退料单位</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.backUnit }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">工程名称</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.backPro }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">任务创建人</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.createBy }}</view>
</uni-col>
</uni-row>
<!-- <uni-row :gutter="24">
<uni-col :span="6">维修班组</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.preCountNum }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">已修数量</uni-col>
<uni-col :span="18">
<view class="cont">{{ item.alNum }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24">
<uni-col :span="6">待修数量</uni-col>
<uni-col :span="18">
<view class="cont"></view>
</uni-col>
</uni-row> -->
<uni-row :gutter="24">
<uni-col :span="6">状态</uni-col>
<uni-col :span="18">
<view class="cont">
<uni-tag
text="未完成"
type="warning"
v-if="item.repairStatusCode == 0"
/>
<uni-tag
text="已完成"
type="success"
v-if="item.repairStatusCode == 1"
/>
</view>
</uni-col>
</uni-row>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view class="loading-text">
{{ finish ? '没有更多数据了~' : '正在加载...' }}
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue'
import { getRepairListAPI } from '@/services/repair/repair.js'
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
const total = ref(0) //
const active = ref(1) // tap
const tableList = ref([]) //
const dateArray = ref([]) //
//
const queryParams = ref({
startTime: '', //
endTime: '', //
keyWord: '', //
// statusList: [4], //
pageNum: 1,
pageSize: 3,
})
//
const options = ref([
{
text: '提交',
style: {
backgroundColor: '#84c649',
color: '#fff',
fontSize: '30rpx',
},
},
{
text: '撤回',
style: {
backgroundColor: '#ed6042',
color: '#fff',
fontSize: '30rpx',
},
},
])
//
const onClick = (e, item) => {
console.log('**')
}
// change
const onChangeDate = (val) => {
const [val_1, val_2] = val
queryParams.value.startTime = val_1
queryParams.value.endTime = val_2
}
//
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
} else {
if (res.rows.length == 0) {
tableList.value = []
} else {
tableList.value.push(...res.rows)
}
}
}
// //
// onLoad(() => {
// getTableList()
// })
onShow(() => {
tableList.value = []
total.value = 0
getTableList()
})
//
const onScrollTolower = debounce(() => {
console.log('触底事件')
if (total.value > tableList.value.length) {
queryParams.value.pageNum++
getTableList()
}
}, 500)
// tap
const changeTab = (index) => {
active.value = index
if (index == 1) {
queryParams.value.statusList = [4] //
queryParams.value.pageNum = 1
getTableList(true)
} else if (index == 2) {
queryParams.value.statusList = [3] //
queryParams.value.pageNum = 1
getTableList(true)
}
}
//
const handleItem = (item) => {
uni.navigateTo({ url: `/pages/repair/details?taskId=${item.taskId}` })
}
//
const finish = computed(() => {
if (total.value === tableList.value.length) return true
})
const maskClick = () => {}
</script>
<style lang="scss" scoped>
.page-container {
display: flex;
height: 100%;
padding: 0 15rpx;
flex-direction: column;
.complete-btn {
display: flex;
padding: 20rpx;
.btn {
display: flex;
flex-direction: column;
align-items: center;
font-size: 30rpx;
font-weight: 800;
}
.bt-line {
width: 80rpx;
height: 4rpx;
background-color: #3784fb;
}
}
.search-form {
display: flex;
align-items: center;
box-sizing: content-box;
}
.search {
height: 65rpx;
background-color: #3784fb;
text-align: center;
line-height: 65rpx;
color: #fff;
}
.scroll-container {
.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;
height: 1px;
background-color: #e8e8e8;
}
}
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
::v-deep .uni-swipe_button {
writing-mode: vertical-rl;
padding: 0 18rpx;
}
</style>

View File

@ -27,6 +27,19 @@
</text>
</view>
</view>
<view class="new-purchase">
<view
class="purchase-item"
:key="index"
@tap="onNavigateTo(item.url)"
v-for="(item, index) in repairList"
>
<image :src="item.iconSrc" mode="scaleToFill" />
<text>
{{ item.title }}
</text>
</view>
</view>
</view>
</template>
@ -60,6 +73,14 @@ const pickingList = ref([
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
},
])
//
const repairList = ref([
{
title: '维修',
url: '/pages/repair/index',
iconSrc: '../../static/workbench/fix.png',
},
])
const onNavigateTo = (url) => {
uni.navigateTo({ url })

View File

@ -0,0 +1,22 @@
import { http } from '@/utils/http'
/**
* 维修 ---- 列表查询
*/
export const getRepairListAPI = (data) => {
return http({
method: 'GET',
url: '/material/repair/getRepairTaskList',
data,
})
}
/**
* 维修 ---- 列表详情
*/
export const getRepairDetailsAPI = (data) => {
return http({
method: 'GET',
url: '/material/repair/getAppRepairMaTypeList',
data,
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB