Commit cd220b1a by qinjianhui

feat: 打印生产单

parent ed638dda
......@@ -103,3 +103,9 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) {
},
)
}
export function printProductionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printProducePdf',
orderIds,
)
}
......@@ -94,12 +94,15 @@
<span v-if="status === 'EXCEPTION'" class="item">
<ElButton type="success" @click="updateOrder"> 更新 </ElButton>
</span>
<span v-if="status === 'IN_PRODUCTION'" class="item">
<ElButton type="primary" @click="printProductionOrder"> 打印生产单 </ElButton>
</span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="warning" @click="changeExceptionOrder">
转为异常单
</ElButton>
</span>
<span v-if="status !== 'IN_PRODUCTION'" class="item">
<span v-if="status === 'TO_BE_CONFIRMED' || status === 'EXCEPTION'" class="item">
<ElButton type="danger" @click="cancelOrder">取消</ElButton>
</span>
<span v-if="status !== 'IN_PRODUCTION'" class="item">
......@@ -512,6 +515,7 @@ import {
getOperationLogApi,
downloadMaterialApi,
updateExceptionOrderApi,
printProductionOrderApi,
} from '@/api/podUsOrder'
import TableView from '@/components/TableView.vue'
import {
......@@ -723,7 +727,22 @@ const updateOrder = async () => {
console.error(e)
}
}
const printProductionOrder = async () => {
if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
const orderIds = cardSelection.value.map((item) => item.id)
try {
const res = await printProductionOrderApi(orderIds)
if (res.code !== 200) return
ElMessage.success('操作成功')
window.open(filePath + res.message)
search()
loadTabData()
} catch (e) {
console.error(e)
}
}
const changeExceptionOrder = async () => {
if (selection.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