Commit 71920388 by wusiyi

feat: podus 待排单优化

parent 9f5792ba
...@@ -1983,7 +1983,7 @@ ...@@ -1983,7 +1983,7 @@
class="operate-box-vertical" class="operate-box-vertical"
> >
<el-link <el-link
:disabled="row.isUpload" :disabled="row.isUpload || row.enableArrange === false"
underline="never" underline="never"
type="success" type="success"
@click="uploadFile(row)" @click="uploadFile(row)"
...@@ -1997,7 +1997,7 @@ ...@@ -1997,7 +1997,7 @@
<Loading /> <Loading />
</el-icon> </el-icon>
<el-link <el-link
:disabled="!row.prnUrl" :disabled="!row.prnUrl || row.enableArrange === false"
style="margin-left: 8px" style="margin-left: 8px"
underline="never" underline="never"
:title="fileName(row)" :title="fileName(row)"
...@@ -2051,7 +2051,9 @@ ...@@ -2051,7 +2051,9 @@
</span> </span>
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
:disabled="!row.url && !row.tiffUrl" :disabled="
(!row.url && !row.tiffUrl) || row.enableArrange === false
"
link link
type="primary" type="primary"
@click="handleDownload(row)" @click="handleDownload(row)"
...@@ -2064,7 +2066,7 @@ ...@@ -2064,7 +2066,7 @@
</span> </span>
<span class="operate-item"> <span class="operate-item">
<ElButton <ElButton
:disabled="row.productNum > 50" :disabled="row.productNum > 50 || row.enableArrange === false"
link link
title="重新排版" title="重新排版"
type="warning" type="warning"
...@@ -3264,7 +3266,7 @@ import { ...@@ -3264,7 +3266,7 @@ import {
CircleCheckFilled, CircleCheckFilled,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { Column, ElFormItem, ElMessage } from 'element-plus' 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 FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue' import PodMakeOrder from './PodMakeOrder.vue'
...@@ -5317,44 +5319,68 @@ const showArrange = async (type: number, data?: PodUsOrderListData) => { ...@@ -5317,44 +5319,68 @@ const showArrange = async (type: number, data?: PodUsOrderListData) => {
offset: window.innerHeight / 2, 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[]) { // 是否全是cp类
if (items.length <= 1) return false const allCP = cardSelection.value.every(
(item) =>
item.productMark !== 'custom_normal' && item.productMark !== 'normal',
)
const seen = new Set() // cb和g类排单
for (const item of items) { if (allCBOrG) {
if (seen.has(item.craftType)) { ElMessageBox.confirm('确认对所选择生产单进行排单?', '提示', {
if (seen.size > 1) return true confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
isAuto.value = false
submitTypesetting()
})
} else if (allCP) {
typesettingVisible.value = true
} else { } 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 arrangeFinish = async () => {
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, 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