Commit 1775baac by linjinhong

Merge remote-tracking branch 'origin/lin-task' into dev

parents b340eb76 2e5863e6
......@@ -37,7 +37,6 @@
</ElSelect>
</div>
<div class="form-item">
<ElSelect
v-model="warehouseId"
placeholder="请选择仓库"
......@@ -73,24 +72,10 @@
<div class="basic-info-item">
<span>物流跟踪号:</span>
<span>{{ podOrderDetailsData?.trackingNumber }}</span>
<el-icon
v-if="podOrderDetailsData?.trackingNumber"
class="icon"
@click="copy(podOrderDetailsData?.trackingNumber || '')"
>
<DocumentCopy />
</el-icon>
</div>
<div class="basic-info-item">
<span>店铺单号:</span>
<span>{{ podOrderDetailsData?.shopNumber }}</span>
<el-icon
v-if="podOrderDetailsData?.shopNumber"
class="icon"
@click="copy(podOrderDetailsData?.shopNumber || '')"
>
<DocumentCopy />
</el-icon>
</div>
<div class="basic-info-item">
<span>商品总数量:</span>
......@@ -115,15 +100,6 @@
<div class="basic-info-item">
<span>订单号:</span>
<span>{{ podOrderDetailsData?.factoryOrderNumber }}</span>
<el-icon
v-if="podOrderDetailsData?.factoryOrderNumber"
class="icon"
@click="
copy((podOrderDetailsData.factoryOrderNumber as string) || '')
"
>
<DocumentCopy />
</el-icon>
</div>
</div>
......@@ -243,8 +219,6 @@
<script setup lang="ts">
import { computed, nextTick, ref, watch } from 'vue'
import { DocumentCopy } from '@element-plus/icons-vue'
import useLodop from '@/utils/hooks/useLodop'
import TableView from '@/components/TableView.vue'
import type { WebSocketMessage } from '@/utils/websocket'
......@@ -358,16 +332,8 @@ watch(visible, async (value: boolean) => {
if (value) {
podOrderDetailsData.value = {}
currentCode = ''
// warehouseId.value = props.warehouseList[0].id
// _warehouseId.value = props.warehouseList[0].id
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
// 设置仓库ID,优先使用本地存储的值,否则使用列表中的第一个仓库
warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
_warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
warehouseId.value = props.warehouseList[0].id
_warehouseId.value = props.warehouseList[0].id
if (userStore.user?.factory.id) {
try {
......@@ -391,9 +357,9 @@ watch(visible, async (value: boolean) => {
initOrderDetailBox()
initPrintDevice()
const locaclPrinter = localStorage.getItem('sheetPrinter')
// const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter)
// if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId)
if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId)
} else {
if (userStore.user?.factory.id) {
socket.send({
......@@ -876,17 +842,43 @@ const handleClearBox = async () => {
}
}
const handlePrintFinish = async () => {
try {
await ElMessageBox.alert('确定打单完成吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
})
submitInspection(() => {
productionOrderRef.value.focus()
})
} catch {
productionOrderRef.value.focus()
return
if (podOrderDetailsData.value?.productList?.length) {
const { productList } = podOrderDetailsData.value
const bool = productList.some((el) => !el.power)
if (bool) {
try {
await ElMessageBox.alert(
'商品数量未配齐无法打单完成,请检查!',
'提示',
{
confirmButtonText: '确定',
},
)
} catch {
return
}
} else {
try {
await ElMessageBox.alert('确定打单完成吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
})
submitInspection(() => {
productionOrderRef.value.focus()
})
} catch {
productionOrderRef.value.focus()
return
}
}
} else {
try {
await ElMessageBox.alert('未检测到商品,请检查!', '提示', {
confirmButtonText: '确定',
})
} catch {
return
}
}
}
const handlePrinterChange = (value: string) => {
......@@ -979,15 +971,6 @@ const handleWarehouseChange = (value: string | number) => {
_warehouseId.value = value
initOrderDetailBox()
}
const copy = (text: string) => {
try {
navigator.clipboard.writeText(text)
ElMessage.success('复制成功')
} catch (err) {
console.error('复制失败:', err)
}
}
</script>
<style scoped lang="scss">
......@@ -1171,13 +1154,10 @@ const copy = (text: string) => {
display: flex;
flex-direction: column;
height: calc(100% - 60px);
width: calc(100% - 40px);
margin-left: 0;
}
.el-dialog__body {
flex: 1;
overflow: hidden;
display: flex;
}
}
</style>
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