Commit 438a7e84 by wuqian

新JMPOD

parent 8e1db597
......@@ -73,7 +73,8 @@ export function getCardOrderList(
}
export function getOrderBySubOrderNumber(orderNumber: string) {
return axios.get<never, BaseRespData<OrderData>>(
'factory/podJomallOrder/getOrderBySubOrderNumber',
// 'factory/podJomallOrder/getOrderBySubOrderNumber',
'factory/podJomallOrder/getOrderProductBySubOrderNumber',
{
params: {
factorySubOrderNumber: orderNumber,
......@@ -81,7 +82,16 @@ export function getOrderBySubOrderNumber(orderNumber: string) {
},
)
}
export function applyForReplenishmentApi(productIds: string) {
return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderProduct/applyForReplenishment',
{
params: {
productIds,
},
},
)
}
// 发货保存
export function saveOrder(
sumbitSendOutList: ShipmentOrderRes[],
......
......@@ -170,13 +170,13 @@
(item.num || 0) - (item.shipmentNum || 0)
}}</span>
</div>
<div class="order-list-expand_item_info_title">
<div v-if="isPod" class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">工艺:</span>
<span class="order-list-expand_item_value">{{
!isPod ? item?.processName || '--' : item?.process || '--'
item?.processName || '--'
}}</span>
</div>
<div v-if="!isPod" class="order-list-expand_item_info_title">
<div v-if="isPod" class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">工艺简称:</span>
<span class="order-list-expand_item_value">{{
item?.process || '--'
......
......@@ -324,7 +324,7 @@ const props = defineProps({
type: String,
},
})
const emit = defineEmits(['update:detailVisible', 'close'])
const emit = defineEmits(['update:detailVisible', 'close','onSuccess'])
watch(
() => props.detailVisible,
......@@ -461,9 +461,8 @@ const changeStatus = async () => {
setData(TrackingNumber.value)
})
}
const setData = async (orderNumber: string) => {
if (detail.value && detail.value?.id) {
if (detail.value && detail.value?.id!=-1) {
try {
const id = detail.value?.id
await productionQueryApi(id)
......@@ -481,7 +480,7 @@ const setData = async (orderNumber: string) => {
localStorage.setItem('historyData', JSON.stringify(historyData.value))
}
}
emit('onSuccess')
playAudio('weight_success')
detail.value = { id: -1, podOrderId: -1, imgList: [] }
} catch (e) {
......
......@@ -73,6 +73,8 @@ export default function useShipment(callback?: () => void) {
isLock.value = false
await nextTick()
if (shipmentOrderRef.value) {
console.log("shipmentOrderRef.value",shipmentOrderRef.value);
const rowEl = shipmentOrderRef.value.listRef?.querySelector(
`div[data-id="${rowData.id}"]`,
)
......
......@@ -153,33 +153,52 @@
下载素材</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>
<div
v-if="['IN_PRODUCTION', 'WAIT_SHIPMENT'].includes(status)"
v-if="
[
'IN_PRODUCTION',
'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT',
'INVALID',
].includes(status)
"
class="card-mode"
>
<div v-loading="loading" class="card-list">
<div
v-if="CardOrderList.length > 0"
v-loading="loading"
class="card-list"
>
<div
v-for="cardItem in CardOrderList"
:key="cardItem.id"
......@@ -292,11 +311,17 @@
</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="
status === 'IN_PRODUCTION'
['TO_BE_REPLENISHMENT', 'IN_PRODUCTION'].includes(
status,
)
? '未生产数量'
: '已生产数量'
"
......@@ -304,7 +329,9 @@
>
<span
>数量:{{
status === 'IN_PRODUCTION'
['TO_BE_REPLENISHMENT', 'IN_PRODUCTION'].includes(
status,
)
? cardItem?.notPassNum
: cardItem?.passNum
}}</span
......@@ -394,6 +421,7 @@
</CardWrapper>
</div>
</div>
<div v-else class="no-data">暂无数据</div>
</div>
<div
v-else
......@@ -730,11 +758,11 @@
:type="fastType"
:detail-data="detailData"
:current-status="status"
@onSuccess="handleSuccess"
@close="fastClose"
></fastProduction>
</template>
<script setup lang="tsx">
// refreshJMProductInfo,reasonInvalidationApi,
import {
getOrderTabData,
getOrderList,
......@@ -748,6 +776,9 @@ import {
updateRemarkApi,
getCardOrderList,
getOrderDetail,
refreshJMProductInfo,
reasonInvalidationApi,
applyForReplenishmentApi,
} from '@/api/podOrder'
import TableView from '@/components/TableView.vue'
import {
......@@ -864,6 +895,10 @@ const loadTabData = async () => {
// showError(error)
}
}
const handleSuccess = () => {
loadTabData()
loadDiffList()
}
// 查看详情
const openDetail = async (id: number) => {
try {
......@@ -1003,7 +1038,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()
......@@ -1147,36 +1189,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
}
......@@ -1215,6 +1271,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) {
......@@ -1225,7 +1310,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),
)
......@@ -1327,34 +1412,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 }) => {
// try {
// const res = await reasonInvalidationApi(
// selection.value.map((item) => item.id),
// value,
// )
// ElMessage.success(res.message)
// loadTabData()
// loadDiffList()
// } catch (e) {
// // showError(e)
// }
// })
// }
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({
......@@ -1364,7 +1450,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),
)
......@@ -1488,6 +1574,7 @@ onMounted(() => {
}
}
.card-mode {
height: 629px;
padding-top: 10px;
overflow: auto;
.card-list {
......@@ -1542,6 +1629,13 @@ onMounted(() => {
}
}
}
.no-data {
margin-top: 300px;
display: flex;
align-items: center;
justify-content: center;
color: #777;
}
}
.tabs {
......
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