Commit f513c076 by wusiyi

Merge branch 'wusiyi/debug' into dev

parents 33359940 ed9f76cb
...@@ -401,9 +401,10 @@ export function applyForReplenishmentApi( ...@@ -401,9 +401,10 @@ export function applyForReplenishmentApi(
data: { data: {
id: number id: number
productId: number productId: number
factorySubOrderNumber: string factorySubOrderNumber: string | number
replenishmentNum: string replenishmentNum: string
podJomallOrderUsStatus: string podJomallOrderUsStatus: string
replenishmentReason: string
}[], }[],
) { ) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
v-model="searchForm.factorySubOrderNumber" v-model="searchForm.factorySubOrderNumber"
placeholder="生产单号" placeholder="生产单号"
clearable clearable
style="width: 150px" style="width: 400px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="店铺单号"> <ElFormItem label="店铺单号">
...@@ -1278,6 +1278,23 @@ ...@@ -1278,6 +1278,23 @@
>排版 >排版
</el-button> </el-button>
</div> </div>
<div
v-if="status === 'WAIT_SHIPMENT'"
style="
display: flex;
flex-direction: column;
align-items: start;
"
>
<el-button
link
size="small"
type="success"
style="height: 23px"
@click="printProductionOrder(item)"
>打印生产单
</el-button>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -1579,6 +1596,9 @@ ...@@ -1579,6 +1596,9 @@
> >
下载 下载
</ElButton> </ElButton>
<el-icon v-if="row.downloadStatus" class="check-icon"
><CircleCheckFilled
/></el-icon>
</span> </span>
<!-- <span class="operate-item"> <!-- <span class="operate-item">
<ElButton <ElButton
...@@ -1598,6 +1618,9 @@ ...@@ -1598,6 +1618,9 @@
> >
打印拣货单 打印拣货单
</ElButton> </ElButton>
<el-icon v-if="row.printPickOrder" class="check-icon"
><CircleCheckFilled
/></el-icon>
</span> </span>
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
...@@ -1607,6 +1630,9 @@ ...@@ -1607,6 +1630,9 @@
> >
打印生产单 打印生产单
</ElButton> </ElButton>
<el-icon v-if="row.printProductOrder" class="check-icon"
><CircleCheckFilled
/></el-icon>
</span> </span>
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
...@@ -2481,9 +2507,9 @@ ...@@ -2481,9 +2507,9 @@
> >
<el-form :model="typesettingForm"> <el-form :model="typesettingForm">
<el-form-item <el-form-item
v-if="typesettingType == 2"
label="自动排版 (烫画工艺推荐自动排版)" label="自动排版 (烫画工艺推荐自动排版)"
prop="bool" prop="bool"
v-if="typesettingType == 2"
> >
<el-switch <el-switch
v-model="isAuto" v-model="isAuto"
...@@ -2523,6 +2549,45 @@ ...@@ -2523,6 +2549,45 @@
<el-button type="primary" @click="submitTypesetting">确认</el-button> <el-button type="primary" @click="submitTypesetting">确认</el-button>
</template> </template>
</ElDialog> </ElDialog>
<!-- 补胚数量输入对话框 -->
<ElDialog
v-model="replenishmentDialogVisible"
title="申请补胚"
width="400px"
@close="resetReplenishmentForm"
>
<ElForm
ref="replenishmentFormRef"
:model="replenishmentForm"
:rules="replenishmentRules"
label-width="80px"
>
<ElFormItem label="补胚数量" prop="replenishmentNum">
<ElInputNumber
v-model="replenishmentForm.replenishmentNum"
placeholder="请输入补胚数量"
style="width: 100%"
:step="1"
:precision="0"
:min="1"
clearable
/>
</ElFormItem>
<ElFormItem label="补胚原因" prop="replenishmentReason">
<ElInput
v-model="replenishmentForm.replenishmentReason"
placeholder="请输入补胚原因"
style="width: 100%"
clearable
/>
</ElFormItem>
</ElForm>
<template #footer>
<ElButton @click="replenishmentDialogVisible = false">取消</ElButton>
<ElButton type="primary" @click="confirmReplenishment">确定</ElButton>
</template>
</ElDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
...@@ -2624,7 +2689,11 @@ import { ...@@ -2624,7 +2689,11 @@ import {
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { DocumentCopy, EditPen } from '@element-plus/icons-vue' import {
DocumentCopy,
EditPen,
CircleCheckFilled,
} from '@element-plus/icons-vue'
import { Column, ElFormItem } from 'element-plus' import { Column, ElFormItem } from 'element-plus'
import { computed, onMounted, ref, nextTick, reactive } from 'vue' import { computed, onMounted, ref, nextTick, reactive } from 'vue'
import FastProduction from './FastProduction.vue' import FastProduction from './FastProduction.vue'
...@@ -2785,6 +2854,23 @@ const interceptionStatus = ref<{ ...@@ -2785,6 +2854,23 @@ const interceptionStatus = ref<{
production: {}, production: {},
}) })
// 补胚对话框相关数据
const replenishmentDialogVisible = ref(false)
const replenishmentFormRef = ref()
const currentReplenishmentRow = ref<ProductList | null>(null)
const replenishmentForm = ref({
replenishmentNum: '1',
replenishmentReason: '',
})
const replenishmentRules = {
replenishmentNum: [
{ required: true, message: '请输入补胚数量', trigger: 'blur' },
],
replenishmentReason: [
{ required: true, message: '请输入补胚原因', trigger: 'blur' },
],
}
const detailData = ref({}) const detailData = ref({})
const [searchForm, resetSearchForm] = useValue<SearchForm>({ const [searchForm, resetSearchForm] = useValue<SearchForm>({
timeType: 1, timeType: 1,
...@@ -3408,6 +3494,34 @@ const { ...@@ -3408,6 +3494,34 @@ const {
} = usePageList({ } = usePageList({
initPageSize: initPageSize.value, initPageSize: initPageSize.value,
query: (page, pageSize) => { query: (page, pageSize) => {
// 批量查询生产单号
const factorySubOrderNumber = (() => {
const originalValue = searchForm.value?.factorySubOrderNumber || ''
if (!originalValue) return ''
// 用中英文逗号或中英文分号分割
const values = originalValue.split(/[,,;;]/).filter((v) => v.trim())
// 处理每个值
const processedValues = values.map((value) => {
const trimmedValue = value.trim()
const underscoreCount = (trimmedValue.match(/_/g) || []).length
if (underscoreCount >= 3) {
// 如果有3个或更多下划线,取第三个下划线后的值
const parts = trimmedValue.split('_')
return parts[3]
} else {
// 如果没有3个下划线,取原值
return trimmedValue
}
})
// 用英文逗号连接
return processedValues.join(',')
})()
// 批量下载 // 批量下载
if (status.value === 'BATCH_DOWNLOAD') { if (status.value === 'BATCH_DOWNLOAD') {
return batchDownloadApi(page, pageSize).then((res) => { return batchDownloadApi(page, pageSize).then((res) => {
...@@ -3421,6 +3535,7 @@ const { ...@@ -3421,6 +3535,7 @@ const {
) { ) {
const params = { const params = {
...searchForm.value, ...searchForm.value,
factorySubOrderNumber,
startTime: startTime:
timeRange.value && timeRange.value.length > 0 timeRange.value && timeRange.value.length > 0
? timeRange.value[0] ? timeRange.value[0]
...@@ -3447,6 +3562,7 @@ const { ...@@ -3447,6 +3562,7 @@ const {
} else { } else {
const params = { const params = {
...searchForm.value, ...searchForm.value,
factorySubOrderNumber,
startTime: startTime:
timeRange.value && timeRange.value.length > 0 timeRange.value && timeRange.value.length > 0
? timeRange.value[0] ? timeRange.value[0]
...@@ -4011,11 +4127,11 @@ const assignOrder = async () => { ...@@ -4011,11 +4127,11 @@ const assignOrder = async () => {
// loading.close() // loading.close()
// } // }
// } // }
const printProductionOrder = async () => { const printProductionOrder = async (item?: PodUsOrderListData) => {
if (cardSelection.value.length === 0) { if (status.value !== 'WAIT_SHIPMENT' && cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
const orderIds = cardSelection.value.map((item) => item.id) const orderIds = item ? [item.id] : cardSelection.value.map((item) => item.id)
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '操作中...', text: '操作中...',
...@@ -4080,6 +4196,8 @@ const printPickingOrderItem = async ( ...@@ -4080,6 +4196,8 @@ const printPickingOrderItem = async (
if (res?.code !== 200) return if (res?.code !== 200) return
ElMessage.success('操作成功') ElMessage.success('操作成功')
window.open(filePath + res?.message) window.open(filePath + res?.message)
search()
loadTabData()
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} finally { } finally {
...@@ -5331,30 +5449,33 @@ const handleWaitTrackCommand = (command: number) => { ...@@ -5331,30 +5449,33 @@ const handleWaitTrackCommand = (command: number) => {
loadTabData() loadTabData()
} }
const applyForReplenishment = async (row: ProductList | undefined) => { // 重置补胚表单
if (!row) { const resetReplenishmentForm = () => {
if (cardSelection.value.length === 0) { replenishmentForm.value.replenishmentNum = '1'
return ElMessage.warning('请至少选择一条数据') replenishmentForm.value.replenishmentReason = ''
} currentReplenishmentRow.value = null
} replenishmentFormRef.value?.clearValidate()
ElMessageBox.prompt('请输入补胚数量', '提示', { }
confirmButtonText: '确定',
cancelButtonText: '取消', // 确认补胚申请
inputPattern: /.+/, const confirmReplenishment = async () => {
inputValue: row ? String(row.replenishmentSumNum || '') : '', if (!replenishmentFormRef.value) return
inputErrorMessage: '请输入补胚数量',
inputPlaceholder: '补胚数量', try {
}).then(async (res) => { await replenishmentFormRef.value.validate()
if (res.value) {
const row = currentReplenishmentRow.value
let data = [] let data = []
if (!row) { if (!row) {
data = cardSelection.value.map((item) => { data = cardSelection.value.map((item) => {
return { return {
id: item.podJomallOrderUsId, id: item.podJomallOrderUsId,
productId: item.id, productId: item.id,
factorySubOrderNumber: item.factorySubOrderNumber || '', factorySubOrderNumber: item.factorySubOrderNumber || '',
replenishmentNum: res.value, replenishmentNum: replenishmentForm.value.replenishmentNum,
podJomallOrderUsStatus: status.value, podJomallOrderUsStatus: status.value,
replenishmentReason: replenishmentForm.value.replenishmentReason,
} }
}) })
} else { } else {
...@@ -5363,16 +5484,19 @@ const applyForReplenishment = async (row: ProductList | undefined) => { ...@@ -5363,16 +5484,19 @@ const applyForReplenishment = async (row: ProductList | undefined) => {
id: row.podJomallOrderUsId, id: row.podJomallOrderUsId,
productId: row.id, productId: row.id,
factorySubOrderNumber: row.factorySubOrderNumber || '', factorySubOrderNumber: row.factorySubOrderNumber || '',
replenishmentNum: res.value, replenishmentNum: replenishmentForm.value.replenishmentNum,
podJomallOrderUsStatus: status.value, podJomallOrderUsStatus: status.value,
replenishmentReason: replenishmentForm.value.replenishmentReason,
}, },
] ]
} }
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
text: '操作中...', text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
}) })
try { try {
const result = await applyForReplenishmentApi(data) const result = await applyForReplenishmentApi(data)
if (result.code !== 200) return if (result.code !== 200) return
...@@ -5380,13 +5504,29 @@ const applyForReplenishment = async (row: ProductList | undefined) => { ...@@ -5380,13 +5504,29 @@ const applyForReplenishment = async (row: ProductList | undefined) => {
cardSelection.value = [] cardSelection.value = []
search() search()
loadTabData() loadTabData()
replenishmentDialogVisible.value = false
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} finally { } finally {
loading.close() loading.close()
} }
} catch (error) {
console.error('表单验证失败:', error)
} }
}) }
// 打开补胚弹窗
const applyForReplenishment = async (row: ProductList | undefined) => {
if (!row) {
if (cardSelection.value.length === 0) {
return ElMessage.warning('请至少选择一条数据')
}
}
currentReplenishmentRow.value = row || null
// 显示对话框
replenishmentDialogVisible.value = true
} }
/** /**
...@@ -6088,4 +6228,15 @@ useRouter().beforeEach((to, from, next) => { ...@@ -6088,4 +6228,15 @@ useRouter().beforeEach((to, from, next) => {
top: -10px; top: -10px;
right: 0px; right: 0px;
} }
.operate-item {
position: relative;
}
.check-icon {
color: var(--el-color-success);
position: absolute;
right: -9px;
top: 30%;
transform: translateY(-50%);
}
</style> </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