Commit ed638dda by qinjianhui

fix: 问题修改

parent 0a232b26
...@@ -47,6 +47,14 @@ export function confirmOrderApi(data: number[]) { ...@@ -47,6 +47,14 @@ export function confirmOrderApi(data: number[]) {
data, data,
) )
} }
export function updateExceptionOrderApi(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateExceptionOrders',
{
orderIds: data,
},
)
}
export function changeExceptionOrderApi(ids: number[], value: string) { export function changeExceptionOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/exceptionOrders', 'factory/podJomallOrderUs/exceptionOrders',
......
...@@ -466,7 +466,7 @@ const changeStatus = async () => { ...@@ -466,7 +466,7 @@ const changeStatus = async () => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
setData(TrackingNumber.value) setData(detail.value.factorySubOrderNumber || '')
}) })
} }
const setData = async (orderNumber: string) => { const setData = async (orderNumber: string) => {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
top="140px" top="140px"
:fullscreen="true" :fullscreen="true"
:close-on-click-modal="false" :close-on-click-modal="false"
@opened="onOpened"
@close="emit('close')" @close="emit('close')"
> >
<div class="detail-div"> <div class="detail-div">
...@@ -50,9 +51,9 @@ ...@@ -50,9 +51,9 @@
:placeholder="placeholderText" :placeholder="placeholderText"
style="width: 660px; margin-right: 10px" style="width: 660px; margin-right: 10px"
clearable clearable
@keydown.enter="trackcodeInput()" @keydown.enter="trackCodeInput()"
></el-input> ></el-input>
<el-button type="primary" @click="trackcodeInput()"> <el-button type="primary" @click="trackCodeInput()">
查询 查询
</el-button> </el-button>
</div> </div>
...@@ -194,14 +195,12 @@ import { ...@@ -194,14 +195,12 @@ import {
import { cardImages, PodOrderRes } from '@/types/api/podUsOrder' import { cardImages, PodOrderRes } from '@/types/api/podUsOrder'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
import { ref, watch, defineProps, nextTick, defineEmits } from 'vue' import { ref, watch, defineProps, defineEmits } from 'vue'
interface HistoryDataItem { interface HistoryDataItem {
orderNumber: string orderNumber: string
finished: boolean finished: boolean
} }
const trackingNumberRef = ref(null) const trackingNumberRef = ref()
// const shipForm = ref({ shipmentType: '1' })
// const logistics = ref([])
const historyData = ref<HistoryDataItem[]>([]) const historyData = ref<HistoryDataItem[]>([])
const placeholderText = ref('') const placeholderText = ref('')
const sendNum = ref(0) const sendNum = ref(0)
...@@ -230,7 +229,6 @@ const audios = { ...@@ -230,7 +229,6 @@ const audios = {
import.meta.url, import.meta.url,
).href, ).href,
} }
const productInfo = ref({})
const TrackingNumber = ref('') const TrackingNumber = ref('')
const props = defineProps({ const props = defineProps({
title: { title: {
...@@ -261,20 +259,14 @@ watch( ...@@ -261,20 +259,14 @@ watch(
if (len.length > 0) { if (len.length > 0) {
confirmQuery(len, 0) confirmQuery(len, 0)
} }
TrackingNumber.value = ''
isAutoSure.value = false
placeholderText.value = placeholderText.value =
'扫描枪输入生产单号,录入下一单本单自动生产完成,最后一单扫两次完成生产' '扫描枪输入生产单号,录入下一单本单自动生产完成,最后一单扫两次完成生产'
sendNum.value = 0 trackingNumberRef.value && trackingNumberRef.value.focus()
nextTick(() => { TrackingNumber.value = ''
if (trackingNumberRef.value) { isAutoSure.value = false
;(trackingNumberRef.value as HTMLInputElement).focus() sendNum.value = 0
}
})
} }
}, },
) )
...@@ -288,7 +280,7 @@ const confirmQuery = (len: HistoryDataItem[], i: number) => { ...@@ -288,7 +280,7 @@ const confirmQuery = (len: HistoryDataItem[], i: number) => {
}) })
.then(async () => { .then(async () => {
TrackingNumber.value = el.orderNumber TrackingNumber.value = el.orderNumber
await trackcodeInput() await trackCodeInput()
await setData(el.orderNumber) await setData(el.orderNumber)
ElMessage.success('生产完成') ElMessage.success('生产完成')
if (len[i + 1]) { if (len[i + 1]) {
...@@ -306,6 +298,7 @@ const confirmQuery = (len: HistoryDataItem[], i: number) => { ...@@ -306,6 +298,7 @@ const confirmQuery = (len: HistoryDataItem[], i: number) => {
if (len[i + 1]) { if (len[i + 1]) {
confirmQuery(len, i + 1) confirmQuery(len, i + 1)
} }
trackingNumberRef.value && trackingNumberRef.value.focus()
}) })
} }
...@@ -318,45 +311,46 @@ const changeStatus = async () => { ...@@ -318,45 +311,46 @@ const changeStatus = async () => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
setData(TrackingNumber.value) setData(detail.value.factorySubOrderNumber || '')
}) })
} }
const setData = async (orderNumber: string) => { const setData = async (orderNumber: string) => {
if (detail.value && detail.value?.id != -1) { if (!detail.value || detail.value?.id === -1) return
try { try {
const id = detail.value.id const id = detail.value.id
const podJomallOrderUsId = detail.value.podJomallOrderUsId const podJomallOrderUsId = detail.value.podJomallOrderUsId
await productionQueryApi(id, podJomallOrderUsId) await productionQueryApi(id, podJomallOrderUsId)
if (orderNumber) { if (orderNumber) {
const index = historyData.value.findIndex( const index = historyData.value.findIndex(
(el: HistoryDataItem) => el.orderNumber === orderNumber, (el: HistoryDataItem) => el.orderNumber === orderNumber,
) )
if (index >= 0) { if (index >= 0) {
// 扫单完成删除 // 扫单完成删除
historyData.value.splice(index, 1) historyData.value.splice(index, 1)
localStorage.setItem( localStorage.setItem('historyUsData', JSON.stringify(historyData.value))
'historyUsData',
JSON.stringify(historyData.value),
)
}
}
emit('onSuccess')
playAudio('weight_success')
detail.value = {
id: -1,
podJomallOrderUsId: -1,
imgList: [] as cardImages[],
}
} catch (e) {
console.error(e)
detail.value = {
id: -1,
podJomallOrderUsId: -1,
imgList: [] as cardImages[],
} }
playAudio('weight_search_error')
} }
emit('onSuccess')
playAudio('weight_success')
detail.value = {
id: -1,
podJomallOrderUsId: -1,
imgList: [] as cardImages[],
}
TrackingNumber.value = ''
isAutoSure.value = false
isDownloadImage.value = false
trackingNumberRef.value && trackingNumberRef.value.focus()
} catch (e) {
console.error(e)
detail.value = {
id: -1,
podJomallOrderUsId: -1,
imgList: [] as cardImages[],
}
trackingNumberRef.value && trackingNumberRef.value.focus()
playAudio('weight_search_error')
} }
} }
...@@ -419,10 +413,11 @@ const playAudio = (key: AudioKey, message?: string) => { ...@@ -419,10 +413,11 @@ const playAudio = (key: AudioKey, message?: string) => {
} }
} }
const trackcodeInput = async () => { const trackCodeInput = async () => {
if (!TrackingNumber.value) { if (!TrackingNumber.value) {
// ElMessage.warning('请扫描生产单号') // ElMessage.warning('请扫描生产单号')
playAudio('weight_search_error') playAudio('weight_search_error')
trackingNumberRef.value && trackingNumberRef.value.focus()
return return
} }
const item = historyData.value.find( const item = historyData.value.find(
...@@ -438,10 +433,11 @@ const trackcodeInput = async () => { ...@@ -438,10 +433,11 @@ const trackcodeInput = async () => {
} }
const orderNumber = TrackingNumber.value const orderNumber = TrackingNumber.value
TrackingNumber.value = ''
if (isAutoSure.value) { if (isAutoSure.value) {
await setData(orderNumber) await setData(
historyData.value[historyData.value.length - 1].orderNumber || '',
)
} }
try { try {
...@@ -467,37 +463,20 @@ const trackcodeInput = async () => { ...@@ -467,37 +463,20 @@ const trackcodeInput = async () => {
download() download()
} }
playAudio('weight_search_success') playAudio('weight_search_success')
nextTick(() => {
if (trackingNumberRef.value) { trackingNumberRef.value && trackingNumberRef.value.focus()
;(trackingNumberRef.value as HTMLInputElement).focus() TrackingNumber.value = ''
}
})
} catch (e) { } catch (e) {
console.error(e) console.error(e)
productInfo.value = {} trackingNumberRef.value && trackingNumberRef.value.focus()
nextTick(() => { TrackingNumber.value = ''
if (trackingNumberRef.value) {
;(trackingNumberRef.value as HTMLInputElement).focus()
}
})
} }
} }
const onOpened = () => {
trackingNumberRef.value && trackingNumberRef.value.focus()
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-dialog__body {
box-sizing: border-box;
flex: 1;
flex-shrink: 0;
overflow: hidden;
}
::v-deep .el-dialog {
display: flex;
height: calc(100% - 50px);
margin-top: 50px;
flex-direction: column;
}
.sure-btn { .sure-btn {
position: absolute; position: absolute;
right: 62px; right: 62px;
...@@ -569,10 +548,6 @@ const trackcodeInput = async () => { ...@@ -569,10 +548,6 @@ const trackcodeInput = async () => {
.detail-content { .detail-content {
display: flex; display: flex;
width: 100%; width: 100%;
flex: 1;
margin-bottom: 10px;
flex-shrink: 0;
justify-content: space-between;
} }
.right { .right {
...@@ -708,28 +683,24 @@ const trackcodeInput = async () => { ...@@ -708,28 +683,24 @@ const trackcodeInput = async () => {
} }
} }
::v-deep .el-carousel__container { .left-images {
height: 100%; :deep(.el-carousel__container) {
} height: 100%;
}
::v-deep .el-form-item__label { :deep(.el-dialog__title) {
font-weight: bold; font-weight: bold;
color: white; font-size: 37px;
} color: black;
position: relative;
::v-deep .el-dialog__title { left: 47%;
font-weight: bold; top: 13px;
font-size: 37px; }
color: black;
position: relative;
left: 47%;
top: 13px;
} }
.btn { .btn {
position: relative; position: relative;
::v-deep .el-button { :deep(.el-button) {
span { span {
position: relative; position: relative;
left: -30px; left: -30px;
...@@ -737,18 +708,18 @@ const trackcodeInput = async () => { ...@@ -737,18 +708,18 @@ const trackcodeInput = async () => {
} }
.check { .check {
::v-deep .el-checkbox__inner { :deep(.el-checkbox__inner) {
background-color: transparent !important; background-color: transparent !important;
border-color: white !important; border-color: white !important;
width: 12px; width: 12px;
height: 12px; height: 12px;
} }
::v-deep .el-checkbox__inner::after { :deep(.el-checkbox__inner::after) {
left: 3px; left: 3px;
} }
::v-deep .el-checkbox__label { :deep(.el-checkbox__label) {
padding-left: 5px; padding-left: 5px;
font-size: 12px; font-size: 12px;
color: white !important; color: white !important;
......
...@@ -88,12 +88,12 @@ ...@@ -88,12 +88,12 @@
</div> </div>
<div class="order-content flex-1 flex-column overflow-hidden mt-10"> <div class="order-content flex-1 flex-column overflow-hidden mt-10">
<div class="operation-box mb-10"> <div class="operation-box mb-10">
<span <span v-if="status === 'TO_BE_CONFIRMED'" class="item">
v-if="status === 'EXCEPTION' || status === 'TO_BE_CONFIRMED'"
class="item"
>
<ElButton type="success" @click="confirmOrder"> 确认 </ElButton> <ElButton type="success" @click="confirmOrder"> 确认 </ElButton>
</span> </span>
<span v-if="status === 'EXCEPTION'" class="item">
<ElButton type="success" @click="updateOrder"> 更新 </ElButton>
</span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item"> <span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="warning" @click="changeExceptionOrder"> <ElButton type="warning" @click="changeExceptionOrder">
转为异常单 转为异常单
...@@ -511,6 +511,7 @@ import { ...@@ -511,6 +511,7 @@ import {
cancelOrderApi, cancelOrderApi,
getOperationLogApi, getOperationLogApi,
downloadMaterialApi, downloadMaterialApi,
updateExceptionOrderApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
...@@ -698,6 +699,30 @@ const confirmOrder = async () => { ...@@ -698,6 +699,30 @@ const confirmOrder = async () => {
console.error(e) console.error(e)
} }
} }
const updateOrder = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
try {
await showConfirm('确定更新吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selection.value.map((item) => item.id)
try {
const res = await updateExceptionOrderApi(ids)
if (res.code !== 200) return
ElMessage.success('操作成功')
search()
loadTabData()
} catch (e) {
console.error(e)
}
}
const changeExceptionOrder = async () => { const changeExceptionOrder = async () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
...@@ -789,7 +814,9 @@ const onFastProduction = () => { ...@@ -789,7 +814,9 @@ const onFastProduction = () => {
const downloadMaterial = async () => { const downloadMaterial = async () => {
let selectedIds = [] let selectedIds = []
if (status.value === 'IN_PRODUCTION') { if (status.value === 'IN_PRODUCTION') {
selectedIds = cardSelection.value.map((item: ProductList) => item.podJomallOrderUsId) selectedIds = cardSelection.value.map(
(item: ProductList) => item.podJomallOrderUsId,
)
} else { } else {
selectedIds = selection.value.map((item: PodUsOrderListData) => item.id) selectedIds = selection.value.map((item: PodUsOrderListData) => item.id)
} }
...@@ -912,6 +939,7 @@ onMounted(() => { ...@@ -912,6 +939,7 @@ onMounted(() => {
.card-list { .card-list {
display: grid; display: grid;
grid-template-columns: repeat(6, 1fr); grid-template-columns: repeat(6, 1fr);
grid-template-rows: max-content;
gap: 10px; gap: 10px;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment