Commit 75a40f4a by sunyang

打印普货生产单

parent 7823de14
......@@ -188,6 +188,12 @@ export function printProductionOrderApi(orderIds: number[]) {
orderIds,
)
}
export function printNormalProductionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductUs/printNormalProducePdf',
orderIds,
)
}
export function printPrintOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderProductUs/printPickPdf',
......
......@@ -901,6 +901,16 @@
</ElFormItem>
<ElFormItem
v-if="
status === 'WAIT_SHIPMENT'"
>
<span class="item">
<ElButton type="success" @click="printNormalProductionOrder(2, null)">
打印普胚生产单
</ElButton>
</span>
</ElFormItem>
<ElFormItem
v-if="
[
'STOCK_OUT',
'CREATE_LOGISTICS',
......@@ -1583,7 +1593,7 @@
<div
v-if="
status === 'WAIT_SHIPMENT' &&
item.productMark !== 'custom_normal'
item.productMark === 'custom_part'
"
style="
display: flex;
......@@ -1600,6 +1610,26 @@
>打印生产单
</el-button>
</div>
<div
v-if="
status === 'WAIT_SHIPMENT' &&
item.productMark === 'custom_normal' || item.productMark === 'normal'
"
style="
display: flex;
flex-direction: column;
align-items: start;
"
>
<el-button
link
size="small"
type="success"
style="height: 23px"
@click="printNormalProductionOrder(1, item)"
>打印普胚生产单
</el-button>
</div>
</div>
</div>
</div>
......@@ -3091,6 +3121,7 @@ import {
downloadMaterialApi,
updateExceptionOrderApi,
printProductionOrderApi,
printNormalProductionOrderApi,
getOrderDetailById,
updateRemarkApi,
getProductionClientApi,
......@@ -4871,6 +4902,51 @@ const printProductionOrder = async (
loading.close()
}
}
const printNormalProductionOrder = async (
type: 1 | 2,
item: PodUsOrderListData | null,
) => {
if (type === 2 && selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
const orderIds: number[] = []
if(type === 1){
orderIds.push(item!.id)
}else{
if (!selection.value.length) {
return ElMessage.warning('请选择订单')
}
selection.value.forEach((s) => {
s.productList &&
s.productList.forEach((p) => {
if (p.productMark === 'normal' || p.productMark === 'custom_normal') {
orderIds.push(p.id)
}
})
})
}
if (!orderIds.length) {
ElMessage.warning('暂无可打印的普货生产单')
return
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await printNormalProductionOrderApi(orderIds)
if (res.code !== 200) return
ElMessage.success('操作成功')
window.open(filePath + res.message)
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const printPickingOrder = async () => {
if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据')
......
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