This commit is contained in:
parent
6fd15f6a47
commit
8c40879895
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue