Commit d4c308fc by wuqian

新JMPOD

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