This commit is contained in:
parent
6fd15f6a47
commit
8c40879895
|
|
@ -167,7 +167,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { getBackList, submitBackApply, backApplyRemove } from '../../services/back.js'
|
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'
|
import { debounce } from 'lodash-es'
|
||||||
const total = ref(0) // 数据总量
|
const total = ref(0) // 数据总量
|
||||||
const active = ref(1) // tap索引
|
const active = ref(1) // tap索引
|
||||||
|
|
@ -398,7 +398,7 @@ const handleItem = (item) => {
|
||||||
const finish = computed(() => {
|
const finish = computed(() => {
|
||||||
if (total.value === tableList.value.length) return true
|
if (total.value === tableList.value.length) return true
|
||||||
})
|
})
|
||||||
onLoad(() => {
|
onShow(() => {
|
||||||
tableList.value = []
|
tableList.value = []
|
||||||
total.value = 0
|
total.value = 0
|
||||||
getTableList(true)
|
getTableList(true)
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { getRepairListAPI, repairSubmitAPI, repairRejectAPI } from '@/services/repair/repair.js'
|
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'
|
import { debounce } from 'lodash-es'
|
||||||
|
|
||||||
const total = ref(0) // 数据总<EFBFBD><EFBFBD>
|
const total = ref(0) // 数据总<EFBFBD><EFBFBD>
|
||||||
|
|
@ -236,12 +236,8 @@ const getTableList = async (isTap = false) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// // 页面加载完毕
|
|
||||||
// onLoad(() => {
|
|
||||||
// getTableList()
|
|
||||||
// })
|
|
||||||
|
|
||||||
onLoad(() => {
|
onShow(() => {
|
||||||
tableList.value = []
|
tableList.value = []
|
||||||
total.value = 0
|
total.value = 0
|
||||||
getTableList(true)
|
getTableList(true)
|
||||||
|
|
|
||||||
|
|
@ -241,15 +241,15 @@ const handleAllPass = async () => {
|
||||||
ids.push(obj)
|
ids.push(obj)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(ids)
|
console.log('🚀 ~ handleAllPass ~ ids:', ids)
|
||||||
// 二次确认
|
// 二次确认
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要通过选中的数据吗?',
|
content: '确定要通过选中的数据吗?',
|
||||||
success: async (res) => {
|
success: async (req) => {
|
||||||
if (res.confirm) {
|
if (req.confirm) {
|
||||||
try {
|
try {
|
||||||
uni.showModal({ title: '操作中...', mask: true })
|
uni.showLoading({ title: '操作中...', mask: true })
|
||||||
const res = await batchPassApi({"scrapApplyDetailsList":ids})
|
const res = await batchPassApi({"scrapApplyDetailsList":ids})
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
|
@ -294,8 +294,8 @@ const handleAllFail = async () => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要驳回选中的数据吗?',
|
content: '确定要驳回选中的数据吗?',
|
||||||
success: async (res) => {
|
success: async (req) => {
|
||||||
if (res.confirm) {
|
if (req.confirm) {
|
||||||
try {
|
try {
|
||||||
uni.showLoading({ title: '操作中...', mask: true })
|
uni.showLoading({ title: '操作中...', mask: true })
|
||||||
const res = await batchRejectApi({"scrapApplyDetailsList":ids})
|
const res = await batchRejectApi({"scrapApplyDetailsList":ids})
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@
|
||||||
<uni-col :span="17">
|
<uni-col :span="17">
|
||||||
<view class="cont" v-if="item.maStatus == 5">待入库</view>
|
<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 == 1">在库</view>
|
||||||
|
<view class="cont" v-if="item.maStatus == 3" style="color: red">退料检修</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -81,7 +82,7 @@
|
||||||
<view class="outbound-btn" @tap="onHandleInbound"> 入库 </view>
|
<view class="outbound-btn" @tap="onHandleInbound"> 入库 </view>
|
||||||
<view class="reject-btn" @tap="onRejectOutbound"> 驳回 </view>
|
<view class="reject-btn" @tap="onRejectOutbound"> 驳回 </view>
|
||||||
<view class="checked-btn" @tap="checkedAll">
|
<view class="checked-btn" @tap="checkedAll">
|
||||||
<span>全选</span><span>({{ total }})</span>
|
<span>全选</span><span>({{ selectedCount }})</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -115,6 +116,7 @@ const isSubmit = ref(false)
|
||||||
// const maTypeName = ref('')
|
// const maTypeName = ref('')
|
||||||
// const typeName = ref('')
|
// const typeName = ref('')
|
||||||
|
|
||||||
|
const selectedCount = computed(() => (codeDeviceList.value || []).filter(e => e.checked).length)
|
||||||
// 二维码扫码
|
// 二维码扫码
|
||||||
const codeScan = async () => {
|
const codeScan = async () => {
|
||||||
if (codeDeviceList.value.length == 0) {
|
if (codeDeviceList.value.length == 0) {
|
||||||
|
|
@ -407,17 +409,23 @@ const onChangeChecked = (item) => {
|
||||||
}
|
}
|
||||||
// 复选框事件
|
// 复选框事件
|
||||||
const checkedAll = () => {
|
const checkedAll = () => {
|
||||||
if (total.value < codeDeviceList.value.length) {
|
// if (total.value < codeDeviceList.value.length) {
|
||||||
total.value = codeDeviceList.value.length
|
// total.value = codeDeviceList.value.length
|
||||||
codeDeviceList.value.forEach((e) => {
|
// codeDeviceList.value.forEach((e) => {
|
||||||
e.checked = true
|
// e.checked = true
|
||||||
})
|
// })
|
||||||
} else if (total.value == codeDeviceList.value.length) {
|
// } else if (total.value == codeDeviceList.value.length) {
|
||||||
total.value = 0
|
// total.value = 0
|
||||||
codeDeviceList.value.forEach((e) => {
|
// codeDeviceList.value.forEach((e) => {
|
||||||
e.checked = false
|
// 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 = e.maStatus == '5' ? e.checked = !iaAllChecked : e.checked = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 入库按钮
|
// 入库按钮
|
||||||
|
|
@ -449,36 +457,44 @@ const onHandleInbound = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
try {
|
uni.showModal({
|
||||||
if (isSubmit.value) return
|
title: '提示',
|
||||||
isSubmit.value = true
|
content: '是否确定入库?',
|
||||||
uni.showLoading({ title: '操作中...', mask: true })
|
success: async (req) => {
|
||||||
let param = {
|
if (req.confirm) {
|
||||||
taskId: queryParams.value.taskId,
|
try {
|
||||||
typeId: queryParams.value.typeId,
|
if (isSubmit.value) return
|
||||||
agreementId: queryParams.value.agreementId,
|
isSubmit.value = true
|
||||||
maCodeList: paramsList,
|
uni.showLoading({ title: '操作中...', mask: true })
|
||||||
|
let param = {
|
||||||
|
taskId: queryParams.value.taskId,
|
||||||
|
typeId: queryParams.value.typeId,
|
||||||
|
agreementId: queryParams.value.agreementId,
|
||||||
|
maCodeList: paramsList,
|
||||||
|
}
|
||||||
|
console.log(param)
|
||||||
|
const res = await repairInputWarehouseApi(param)
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '入库成功!',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
queryParams.value.pendingInputNum =
|
||||||
|
Number(queryParams.value.pendingInputNum) - paramsList.length
|
||||||
|
getCodeDeviceListData()
|
||||||
|
uni.$emit('onUpdate')
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ onHandleInbound ~ error:', error)
|
||||||
|
} finally {
|
||||||
|
isSubmit.value = false
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
console.log(param)
|
})
|
||||||
const res = await repairInputWarehouseApi(param)
|
|
||||||
if (res.code === 200) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '入库成功!',
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
queryParams.value.pendingInputNum =
|
|
||||||
Number(queryParams.value.pendingInputNum) - paramsList.length
|
|
||||||
getCodeDeviceListData()
|
|
||||||
uni.$emit('onUpdate')
|
|
||||||
}, 800)
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log('🚀 ~ onHandleInbound ~ error:', error)
|
|
||||||
} finally {
|
|
||||||
isSubmit.value = false
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 驳回按钮
|
// 驳回按钮
|
||||||
|
|
@ -510,36 +526,44 @@ const onRejectOutbound = async () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
try {
|
uni.showModal({
|
||||||
if (isSubmit.value) return
|
title: '提示',
|
||||||
isSubmit.value = true
|
content: '是否确定驳回?',
|
||||||
uni.showLoading({ title: '操作中...', mask: true })
|
success: async (req) => {
|
||||||
let param = {
|
if (req.confirm) {
|
||||||
taskId: queryParams.value.taskId,
|
try {
|
||||||
typeId: queryParams.value.typeId,
|
if (isSubmit.value) return
|
||||||
agreementId: queryParams.value.agreementId,
|
isSubmit.value = true
|
||||||
maCodeList: paramsList,
|
uni.showLoading({ title: '操作中...', mask: true })
|
||||||
}
|
let param = {
|
||||||
console.log(param)
|
taskId: queryParams.value.taskId,
|
||||||
const res = await rejectWarehouseApi(param)
|
typeId: queryParams.value.typeId,
|
||||||
if (res.code === 200) {
|
agreementId: queryParams.value.agreementId,
|
||||||
uni.showToast({
|
maCodeList: paramsList,
|
||||||
title: '驳回成功!',
|
}
|
||||||
icon: 'none',
|
console.log(param)
|
||||||
})
|
const res = await rejectWarehouseApi(param)
|
||||||
setTimeout(() => {
|
if (res.code === 200) {
|
||||||
queryParams.value.pendingInputNum =
|
uni.showToast({
|
||||||
Number(queryParams.value.pendingInputNum) - paramsList.length
|
title: '驳回成功!',
|
||||||
getCodeDeviceListData()
|
icon: 'none',
|
||||||
uni.$emit('onUpdate')
|
})
|
||||||
}, 800)
|
setTimeout(() => {
|
||||||
}
|
queryParams.value.pendingInputNum =
|
||||||
} catch (error) {
|
Number(queryParams.value.pendingInputNum) - paramsList.length
|
||||||
console.log('🚀 ~ onRejectOutbound ~ error:', error)
|
getCodeDeviceListData()
|
||||||
} finally {
|
uni.$emit('onUpdate')
|
||||||
isSubmit.value = false
|
}, 800)
|
||||||
uni.hideLoading()
|
}
|
||||||
}
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ onRejectOutbound ~ error:', error)
|
||||||
|
} finally {
|
||||||
|
isSubmit.value = false
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue