Commit d4c308fc by wuqian

新JMPOD

parent c9d64291
......@@ -153,29 +153,43 @@
下载素材</ElButton
>
</span>
<!-- <span
<span
v-if="
['TO_BE_CONFIRMED', 'IN_PRODUCTION', 'PART_SHIPPING'].includes(
status,
)
[
'TO_BE_CONFIRMED',
'IN_PRODUCTION',
'PART_SHIPPING',
'WAIT_SHIPMENT',
].includes(status)
"
class="item"
>
<ElButton type="primary" @click="refreshProduct"
>刷新商品信息</ElButton
>
</span> -->
</span>
<span
v-if="status === 'WAIT_SHIPMENT' || status === 'PART_SHIPPING'"
class="item"
>
<ElButton type="success" @click="confirmDelivery">发货</ElButton>
</span>
<!-- <span v-if="status === 'IN_PRODUCTION'" class="item">
<span v-if="status === 'IN_PRODUCTION'" class="item">
<ElButton type="danger" @click="voidedBtn">作废</ElButton>
</span> -->
</span>
<span v-if="status === 'IN_PRODUCTION'" class="item">
<ElButton type="warning" is-dark @click="applyForReplacement">
申请补胚</ElButton
>
</span>
</div>
<template v-if="['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status)">
<template v-if="[
'IN_PRODUCTION',
'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT',
'INVALID',
].includes(status)
">
<div
v-if="CardOrderList.length"
v-loading="loading"
......@@ -337,26 +351,22 @@
>
{{ cardItem?.variantSku }}
</span>
</el-tooltip>
</el-col>
<el-col :span="10" :offset="0" style="text-align: right">
<span v-if="status === 'INVALID'">
数量:{{ cardItem?.num }}
</span>
<el-tooltip
v-else
class="item"
effect="dark"
:content="'货号'"
placement="bottom"
>
<span>货号:{{ cardItem?.supplierItemNo }}</span>
</el-tooltip>
</el-col>
</el-row>
<el-row style="margin-top: 5px">
<el-col
:span="12"
:offset="0"
style="
white-space: nowrap;
display: flex;
align-items: center;
:content="
['TO_BE_REPLENISHMENT', 'IN_PRODUCTION'].includes(
status,
)
? '未生产数量'
: '已生产数量'
"
>
<span>工艺:</span>
......@@ -766,6 +776,7 @@
:type="fastType"
:detail-data="detailData"
:current-status="status"
@onSuccess="handleSuccess"
@close="fastClose"
></fastProduction>
</template>
......@@ -787,6 +798,9 @@ import {
getOrderDetail,
getInProductionCount,
getWaitShipmentCount,
refreshJMProductInfo,
reasonInvalidationApi,
applyForReplenishmentApi,
} from '@/api/podOrder'
import TableView from '@/components/TableView.vue'
import {
......@@ -960,6 +974,10 @@ const loadTabData = async () => {
// showError(error)
}
}
const handleSuccess = () => {
loadTabData()
loadDiffList()
}
// 查看详情
const openDetail = async (id: number) => {
try {
......@@ -1111,7 +1129,14 @@ const fastClose = () => {
}
// 根据不同状态调用不同接口
const loadDiffList = () => {
if (['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status.value)) {
if (
[
'IN_PRODUCTION',
'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT',
'INVALID',
].includes(status.value)
) {
loadCardList()
} else {
search()
......@@ -1256,36 +1281,50 @@ const getLogisticsList = async () => {
//showError(error)
}
}
// const refreshProduct = async () => {
// if (selection.value.length === 0) {
// return ElMessage({
// message: '请选择订单',
// type: 'warning',
// offset: window.innerHeight / 2,
// })
// }
// try {
// await showConfirm('是否刷新商品信息', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// type: 'warning',
// })
// } catch {
// return
// }
// try {
// const res = await refreshJMProductInfo(selection.value.map((el) => el.id))
// ElMessage({
// message: res.message,
// type: 'success',
// offset: window.innerHeight / 2,
// })
// loadTabData()
// loadDiffList()
// } catch (e) {
// // showError(e)
// }
// }
const refreshProduct = async () => {
if (selection.value.length === 0) {
return ElMessage({
message: '请选择订单',
type: 'warning',
offset: window.innerHeight / 2,
})
}
try {
await showConfirm('是否刷新商品信息', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = []
if (['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status.value)) {
ids.push(
...selection.value.map(
(item: CardOrderData | PodProductList) => item.podOrderId as number,
),
)
} else {
ids.push(
...selection.value.map(
(item: CardOrderData | PodProductList) => item.id as number,
),
)
}
try {
const res = await refreshJMProductInfo(ids)
ElMessage({
message: res.message,
type: 'success',
offset: window.innerHeight / 2,
})
loadTabData()
loadDiffList()
} catch (e) {
// showError(e)
}
}
const openAll = (row: CardOrderData) => {
row.moreable = !row.moreable
}
......@@ -1324,6 +1363,35 @@ const confirmProduce = async () => {
// showError(e)
}
}
const applyForReplacement = async () => {
if (selection.value.length === 0) {
return ElMessage({
message: '请选择订单',
type: 'warning',
offset: window.innerHeight / 2,
})
}
try {
await showConfirm('是否申请补胚', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selection.value
.map((item: CardOrderData | PodProductList) => item.id)
.join(',')
try {
const res = await applyForReplenishmentApi(ids)
loadDiffList()
await loadTabData()
ElMessage.success(res.message)
} catch (e) {
// showError(e)
}
}
// 下载稿件
const downloadMaterial = async () => {
if (selection.value.length === 0) {
......@@ -1334,7 +1402,7 @@ const downloadMaterial = async () => {
})
}
const ids = []
if (status.value === 'IN_PRODUCTION' || status.value === 'WAIT_SHIPMENT') {
if (['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status.value)) {
ids.push(
...selection.value.map((item: CardOrderData | PodProductList) => item.id),
)
......@@ -1440,6 +1508,35 @@ const addInternalTag = async () => {
}
})
}
const voidedBtn = async () => {
if (selection.value.length === 0) {
return ElMessage({
message: '请选择订单',
type: 'warning',
offset: window.innerHeight / 2,
})
}
ElMessageBox.prompt('', '作废', {
confirmButtonText: '确认',
cancelButtonText: '取消',
inputPlaceholder: '请输入作废原因',
inputPattern: /.+/,
inputErrorMessage: '作废原因不能为空',
}).then(async ({ value }: { value: string }) => {
try {
const res = await reasonInvalidationApi(
selection.value.map((item: CardOrderData | PodProductList) => item.id),
value,
)
ElMessage.success(res.message)
loadTabData()
loadDiffList()
} catch (e) {
// showError(e)
}
})
}
const printManuscript = async () => {
if (selection.value.length === 0) {
return ElMessage({
......@@ -1449,7 +1546,7 @@ const printManuscript = async () => {
})
}
const ids = []
if (status.value === 'IN_PRODUCTION' || status.value === 'WAIT_SHIPMENT') {
if (['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status.value)) {
ids.push(
...selection.value.map((item: CardOrderData | PodProductList) => item.id),
)
......@@ -1581,6 +1678,7 @@ onBeforeUnmount(() => {
}
}
.card-mode {
height: 629px;
padding-top: 10px;
overflow: auto;
flex: 1;
......@@ -1636,6 +1734,13 @@ onBeforeUnmount(() => {
}
}
}
.no-data {
margin-top: 300px;
display: flex;
align-items: center;
justify-content: center;
color: #777;
}
}
.empty {
flex: 1;
......
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