Commit 71920388 by wusiyi

feat: podus 待排单优化

parent 9f5792ba
......@@ -1983,7 +1983,7 @@
class="operate-box-vertical"
>
<el-link
:disabled="row.isUpload"
:disabled="row.isUpload || row.enableArrange === false"
underline="never"
type="success"
@click="uploadFile(row)"
......@@ -1997,7 +1997,7 @@
<Loading />
</el-icon>
<el-link
:disabled="!row.prnUrl"
:disabled="!row.prnUrl || row.enableArrange === false"
style="margin-left: 8px"
underline="never"
:title="fileName(row)"
......@@ -2051,7 +2051,9 @@
</span>
<span class="operate-item">
<ElButton
:disabled="!row.url && !row.tiffUrl"
:disabled="
(!row.url && !row.tiffUrl) || row.enableArrange === false
"
link
type="primary"
@click="handleDownload(row)"
......@@ -2064,7 +2066,7 @@
</span>
<span class="operate-item">
<ElButton
:disabled="row.productNum > 50"
:disabled="row.productNum > 50 || row.enableArrange === false"
link
title="重新排版"
type="warning"
......@@ -3264,7 +3266,7 @@ import {
CircleCheckFilled,
} from '@element-plus/icons-vue'
import { Column, ElFormItem, ElMessage } from 'element-plus'
import { computed, onMounted, ref, nextTick, reactive } from 'vue'
import { computed, onMounted, ref, nextTick, reactive, h } from 'vue'
import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue'
......@@ -5317,44 +5319,68 @@ const showArrange = async (type: number, data?: PodUsOrderListData) => {
offset: window.innerHeight / 2,
})
}
const bool = hasDifferentCraftCodeWithSet(cardSelection.value)
if (bool) {
try {
await ElMessageBox.confirm(
'选中排单的生产单存在多个工艺类型, 是否继续排单?',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
},
)
typesettingVisible.value = true
} catch (error) {
return (typesettingVisible.value = false)
}
}
}
typesettingVisible.value = true
}
// 是否全是cb和g类
const allCBOrG = cardSelection.value.every(
(item) =>
item.productMark === 'custom_normal' || item.productMark === 'normal',
)
function hasDifferentCraftCodeWithSet(items: ProductList[]) {
if (items.length <= 1) return false
// 是否全是cp类
const allCP = cardSelection.value.every(
(item) =>
item.productMark !== 'custom_normal' && item.productMark !== 'normal',
)
const seen = new Set()
for (const item of items) {
if (seen.has(item.craftType)) {
if (seen.size > 1) return true
// cb和g类排单
if (allCBOrG) {
ElMessageBox.confirm('确认对所选择生产单进行排单?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
isAuto.value = false
submitTypesetting()
})
} else if (allCP) {
typesettingVisible.value = true
} else {
seen.add(item.craftType)
if (seen.size > 1) return true
// 不支持混排
await ElMessageBox.alert(
h('p', null, [
h('span', null, '无法排单。'),
h('br'),
h(
'span',
null,
'原因:你选择的生产单包含多种商品类型,排单不支持多种商品类型混排,请选择同一类型的商品对应的生产单后再试!',
),
]),
'提示',
{
confirmButtonText: '确定',
},
)
return
}
}
return false
}
// function hasDifferentCraftCodeWithSet(items: ProductList[]) {
// if (items.length <= 1) return false
// const seen = new Set()
// for (const item of items) {
// if (seen.has(item.craftType)) {
// if (seen.size > 1) return true
// } else {
// seen.add(item.craftType)
// if (seen.size > 1) return true
// }
// }
// return false
// }
const arrangeFinish = async () => {
const loading = ElLoading.service({
fullscreen: true,
......
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