Commit 262558ab by wusiyi

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

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