This commit is contained in:
bb_pan 2025-09-01 22:13:41 +08:00
parent 6fd15f6a47
commit 8c40879895
4 changed files with 105 additions and 85 deletions

View File

@ -167,7 +167,7 @@
<script setup>
import { ref, computed } from 'vue'
import { getBackList, submitBackApply, backApplyRemove } from '../../services/back.js'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
const total = ref(0) //
const active = ref(1) // tap
@ -398,7 +398,7 @@ const handleItem = (item) => {
const finish = computed(() => {
if (total.value === tableList.value.length) return true
})
onLoad(() => {
onShow(() => {
tableList.value = []
total.value = 0
getTableList(true)

View File

@ -120,7 +120,7 @@
<script setup>
import { ref, computed } from 'vue'
import { getRepairListAPI, repairSubmitAPI, repairRejectAPI } from '@/services/repair/repair.js'
import { onLoad } from '@dcloudio/uni-app'
import { onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
const total = ref(0) // <EFBFBD><EFBFBD>
@ -236,12 +236,8 @@ const getTableList = async (isTap = false) => {
}
}
// //
// onLoad(() => {
// getTableList()
// })
onLoad(() => {
onShow(() => {
tableList.value = []
total.value = 0
getTableList(true)

View File

@ -241,15 +241,15 @@ const handleAllPass = async () => {
ids.push(obj)
}
})
console.log(ids)
console.log('🚀 ~ handleAllPass ~ ids:', ids)
//
uni.showModal({
title: '提示',
content: '确定要通过选中的数据吗?',
success: async (res) => {
if (res.confirm) {
success: async (req) => {
if (req.confirm) {
try {
uni.showModal({ title: '操作中...', mask: true })
uni.showLoading({ title: '操作中...', mask: true })
const res = await batchPassApi({"scrapApplyDetailsList":ids})
console.log(res)
if (res.code === 200) {
@ -294,8 +294,8 @@ const handleAllFail = async () => {
uni.showModal({
title: '提示',
content: '确定要驳回选中的数据吗?',
success: async (res) => {
if (res.confirm) {
success: async (req) => {
if (req.confirm) {
try {
uni.showLoading({ title: '操作中...', mask: true })
const res = await batchRejectApi({"scrapApplyDetailsList":ids})

View File

@ -74,6 +74,7 @@
<uni-col :span="17">
<view class="cont" v-if="item.maStatus == 5">待入库</view>
<view class="cont" v-if="item.maStatus == 1">在库</view>
<view class="cont" v-if="item.maStatus == 3" style="color: red">退料检修</view>
</uni-col>
</uni-row>
</view>
@ -81,7 +82,7 @@
<view class="outbound-btn" @tap="onHandleInbound"> 入库 </view>
<view class="reject-btn" @tap="onRejectOutbound"> 驳回 </view>
<view class="checked-btn" @tap="checkedAll">
<span>全选</span><span>({{ total }})</span>
<span>全选</span><span>({{ selectedCount }})</span>
</view>
</view>
</template>
@ -115,6 +116,7 @@ const isSubmit = ref(false)
// const maTypeName = ref('')
// const typeName = ref('')
const selectedCount = computed(() => (codeDeviceList.value || []).filter(e => e.checked).length)
//
const codeScan = async () => {
if (codeDeviceList.value.length == 0) {
@ -407,17 +409,23 @@ const onChangeChecked = (item) => {
}
//
const checkedAll = () => {
if (total.value < codeDeviceList.value.length) {
total.value = codeDeviceList.value.length
// if (total.value < codeDeviceList.value.length) {
// total.value = codeDeviceList.value.length
// codeDeviceList.value.forEach((e) => {
// e.checked = true
// })
// } else if (total.value == codeDeviceList.value.length) {
// total.value = 0
// codeDeviceList.value.forEach((e) => {
// e.checked = false
// })
// }
const list = codeDeviceList.value.filter((e) => e.maStatus == 5)
const iaAllChecked = list.every((e) => e.checked)
console.log('🚀 ~ checkedAll ~ iaAllChecked:', iaAllChecked)
codeDeviceList.value.forEach((e) => {
e.checked = true
e.checked = e.maStatus == '5' ? e.checked = !iaAllChecked : e.checked = false
})
} else if (total.value == codeDeviceList.value.length) {
total.value = 0
codeDeviceList.value.forEach((e) => {
e.checked = false
})
}
}
//
@ -449,6 +457,11 @@ const onHandleInbound = async () => {
})
}
})
uni.showModal({
title: '提示',
content: '是否确定入库?',
success: async (req) => {
if (req.confirm) {
try {
if (isSubmit.value) return
isSubmit.value = true
@ -480,6 +493,9 @@ const onHandleInbound = async () => {
uni.hideLoading()
}
}
}
})
}
//
const onRejectOutbound = async () => {
@ -510,6 +526,11 @@ const onRejectOutbound = async () => {
})
}
})
uni.showModal({
title: '提示',
content: '是否确定驳回?',
success: async (req) => {
if (req.confirm) {
try {
if (isSubmit.value) return
isSubmit.value = true
@ -541,6 +562,9 @@ const onRejectOutbound = async () => {
uni.hideLoading()
}
}
},
})
}
</script>
<script>