Commit 262558ab by wusiyi

feat: 订单添加质检流程 #1009863

parent 0173ae9a
......@@ -731,6 +731,16 @@ export function deliveryCompleteApi(data: { id: number; version?: number }[]) {
)
}
/** 重新生产 */
export function remanufactureApi(data: {
updateParams: { id: number; version?: number }[]
}) {
return axios.post<never, BaseRespData<void>>(
'factory/podOrderOperation/remanufacture',
data,
)
}
/** 质检通过 / 质检不通过 */
export function qualityPodOrderOperationApi(data: QualityParams) {
return axios.post<never, BaseRespData<never>>(
......
......@@ -507,7 +507,8 @@ const normalizeDetail = (value: unknown): FastProductionDetail => {
}
}
if (!Array.isArray(d.note)) d.note = []
const imageSource = d.imageAry || d.designImages || d.imgList || d.variantImage
const imageSource =
d.imageAry || d.designImages || d.imgList || d.variantImage
d.imgList = parseImages(imageSource)
return d as unknown as FastProductionDetail
}
......@@ -896,74 +897,12 @@ function setProductMark(productMark: string) {
}
</script>
<style lang="scss" scoped>
.sure-btn {
position: absolute;
right: 62px;
top: 14px;
}
.detail-div {
display: flex;
height: 100%;
flex-direction: column;
justify-content: space-between;
.detail-images {
.scroll-list {
background: #ececec;
display: flex;
height: 100px;
width: 100%;
padding: 5px;
.scroll-content {
margin-left: 10px;
overflow-x: auto;
overflow-y: hidden;
flex: 1;
display: flex;
flex-wrap: nowrap;
flex-shrink: 0;
.scroll-item {
height: 100%;
min-width: 100px;
background: white;
margin-right: 5px;
}
}
.img-title {
display: flex;
flex-direction: column;
justify-content: center;
background: white;
padding: 10px;
b {
text-align: center;
color: black;
font-weight: bold;
font-size: 16px;
margin-bottom: 15px;
}
.id {
display: flex;
align-items: center;
padding: 3px 5px;
background: #ececec;
justify-content: center;
img {
width: 15px;
margin-right: 8px;
}
}
}
}
}
.detail-content {
display: flex;
width: 100%;
......@@ -1102,14 +1041,6 @@ function setProductMark(productMark: string) {
:deep(.el-carousel__container) {
height: 100%;
}
:deep(.el-dialog__title) {
font-weight: bold;
font-size: 37px;
color: black;
position: relative;
left: 47%;
top: 13px;
}
}
.btn {
......@@ -1141,11 +1072,4 @@ function setProductMark(productMark: string) {
}
}
}
.warning {
font-size: 18px;
font-weight: bold;
color: #ff9900;
margin-left: 10px;
cursor: pointer;
}
</style>
......@@ -148,8 +148,6 @@ const handleSubmit = async () => {
: (form.reasonKey as number | string),
qualityPassed: qualityPassed.value,
}
console.log(params)
return
const res = await qualityPodOrderOperationApi(params)
if (res.code !== 200) return
ElMessage.success('操作成功')
......
......@@ -580,7 +580,7 @@
class="item"
>
<ElButton type="success" @click="handlePrintProductionOrder"
>打印生产</ElButton
>打印操作</ElButton
>
</span>
<span v-if="status === 'PENDING_PICK'" class="item">
......@@ -607,16 +607,16 @@
>补胚失败</ElButton
>
</span>
<span v-if="status === 'IN_PRODUCTION' && isEnableSorting" class="item">
<span
v-if="status === 'PENDING_PACKING' && isEnableSorting"
class="item"
>
<ElButton type="primary" @click="handleSeedingWall('sort')"
>配货分拣</ElButton
>
</span>
<span
v-if="
status === 'PENDING_PACKING' ||
(status === 'IN_PRODUCTION' && !isEnableSorting)
"
v-if="status === 'PENDING_PACKING' || !isEnableSorting"
class="item"
>
<ElButton type="success" @click="handleSeedingWall('print')"
......@@ -765,9 +765,7 @@
</span>
<!-- 待质检 -->
<span v-if="status === 'PENDING_QUALITY'" class="item">
<ElButton type="primary" @click="handleGetOrderInventoryDetail">
质检
</ElButton>
<ElButton type="primary" @click="() => {}"> 快捷质检 </ElButton>
</span>
<span v-if="status === 'PENDING_QUALITY'" class="item">
<ElButton type="success" @click="handleQuality(true)">
......@@ -789,6 +787,22 @@
打印操作单
</ElButton>
</span>
<span
v-if="status === 'PENDING_QUALITY' && qualitySubTab === 'NO_QUALITY'"
class="item"
>
<ElButton type="warning" @click="handleApplyReplenish">
申请补胚
</ElButton>
</span>
<span
v-if="status === 'PENDING_QUALITY' && qualitySubTab === 'NO_QUALITY'"
class="item"
>
<ElButton type="warning" @click="handleRemanufacture">
重新生产
</ElButton>
</span>
</div>
<div v-if="status === 'SUSPEND'" class="status-subtabs">
<div
......@@ -1370,6 +1384,7 @@ import {
interceptSuccessApi,
deliveryCompleteApi,
getStatusPushApi,
remanufactureApi,
} from '@/api/factoryOrderNew'
import { getConfigApi } from '@/api/order'
import { getLogisticsWayApi } from '@/api/podUsOrder'
......@@ -1581,9 +1596,9 @@ const getListQueryPayload = () => {
}
const getCraft = async () => {
const res = await getPodOrderCraftApi()
const res = await getPodOrderCraftApi()
const data: CraftListData[] = res.data
podCraftList.value = data.map((item:CraftListData) => ({
podCraftList.value = data.map((item: CraftListData) => ({
id: item.craftCode,
name: item.craftName,
warehouseName: processTypeMap[item.craftType] ?? '其他',
......@@ -2003,19 +2018,19 @@ const mainColumns = computed(() => [
},
{
prop: 'statusName',
label:'挂起前状态',
label: '挂起前状态',
minWidth: 120,
hidden:status.value !== 'SUSPEND',
align: 'center'
hidden: status.value !== 'SUSPEND',
align: 'center',
},
{
prop: 'statusName',
hidden:status.value === 'SUSPEND',
hidden: status.value === 'SUSPEND',
label: '订单状态',
minWidth: 120,
align: 'center',
render: (row: FactoryOrderNewListData) => {
return <span>{ row.pause ? '挂起' : row.statusName}</span>
return <span>{row.pause ? '挂起' : row.statusName}</span>
},
},
{
......@@ -2623,6 +2638,7 @@ const suspendDialogRef = ref<InstanceType<typeof SuspendDialog>>()
const pickCompleteDialogRef = ref<InstanceType<typeof PickCompleteDialog>>()
const pickFailDialogRef = ref<InstanceType<typeof PickFailDialog>>()
const qualityFailDialogRef = ref<InstanceType<typeof QualityFailDialog>>()
const fastQualifyRef = ref<InstanceType<typeof FastQualify>>()
const operateDetailsDialogRef = ref()
const arrangeDialogRef = ref<InstanceType<typeof ArrangeDialog>>()
const createLogisticDialogRef = ref()
......@@ -3001,10 +3017,7 @@ const handleSeedingWall = (type: 'print' | 'sort') => {
/** LODOP 单例不可并发,打印串行 */
let printOrderChain: Promise<void> = Promise.resolve()
const printOrder = (
data: OrderData,
callback: (status: boolean) => void,
) => {
const printOrder = (data: OrderData, callback: (status: boolean) => void) => {
const run = async () => {
const lodop = getCLodop(null, null)
if (!lodop) {
......@@ -3355,6 +3368,38 @@ const handleApplyReplenish = async () => {
refreshTree: true,
})
}
const handleRemanufacture = () => {
if (!ensureSelection()) return
const rows = isCardLayout.value ? cardSelectList.value : selectedRows.value
ElMessageBox.confirm('确定重新生产吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await remanufactureApi({
updateParams: rows.map((row) => ({
id: row.id,
version: row.version,
})),
})
if (res.code !== 200) return
ElMessage.success('重新生产成功')
refreshCurrentView({ isRefreshTree: true })
} catch (e) {
console.error(e)
} finally {
loading.close()
}
})
.catch(() => {})
}
const adjustPickOrderSuccess = async (
_: unknown,
selectionOperationIds: number[],
......@@ -3653,6 +3698,10 @@ const handleQuality = (qualityPassed: boolean) => {
const rows = isCardLayout.value ? cardSelectList.value : selectedRows.value
qualityFailDialogRef.value?.open(rows, qualityPassed)
}
const handleFastQualify = () => {
fastQualifyRef.value?.open()
}
const isEnableSorting = ref(false)
// 获取功能开关
const getFunctionSwitch = async () => {
......
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