Commit 438a7e84 by wuqian

新JMPOD

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