出库修改

This commit is contained in:
hongchao 2025-02-27 17:52:29 +08:00
parent ceda98aa00
commit 40c26f83e4
2 changed files with 75 additions and 18 deletions

View File

@ -888,20 +888,20 @@ const pickUpCodeForm = reactive<any>({
</el-button> --> </el-button> -->
<el-button <el-button
v-if="item.orderStatus == '3'" v-if="item.orderStatus == '2'"
type="primary" type="primary"
size="small" size="small"
@click="pickUpView(item)" @click="pickUpView(item)"
>查看取件码</el-button >查看取件码</el-button
> >
<el-button <!-- <el-button
v-if="item.orderStatus == '3'" v-if="item.orderStatus == '3'"
type="primary" type="primary"
size="small" size="small"
@click="pickUpViewOut(index)" @click="pickUpViewOut(index)"
>确认收货</el-button >确认收货</el-button
> > -->
<el-button <el-button
@click="handleViewOrder(j, item)" @click="handleViewOrder(j, item)"

View File

@ -160,42 +160,53 @@ const onAcceptOrders = (item: any) => {
}) })
.then(async() => { .then(async() => {
const passApiRes = await passApi({ orderId: item.orderId, orderStatus: 2 }); const passApiRes = await passApi({ orderId: item.orderId, orderStatus: 2 });
// passApi if (passApiRes && passApiRes.code === 200) {
if (passApiRes && passApiRes.code === 200) { ElMessage({
// passApi passApi passApiTwo
const passApiTwoRes = await passApi({ orderId: item.orderId, orderStatus: 3 });
if (passApiTwoRes && passApiTwoRes.code === 200) {
ElMessage({
type: 'success', type: 'success',
message: '接单成功', message: '接单成功',
duration: 1000, duration: 1000,
}); });
numberTemp.value = numberTemp.value + 1; numberTemp.value = numberTemp.value + 1;
getList(); getList();
} }
} // passApi
// if (passApiRes && passApiRes.code === 200) {
// // passApi passApi passApiTwo
// const passApiTwoRes = await passApi({ orderId: item.orderId, orderStatus: 3 });
// if (passApiTwoRes && passApiTwoRes.code === 200) {
// ElMessage({
// type: 'success',
// message: '',
// duration: 1000,
// });
// numberTemp.value = numberTemp.value + 1;
// getList();
// }
// }
}) })
.catch(() => {}) .catch(() => {})
} }
const indexPickUpCode = ref(0);
// //
const dialogVisiblePickUpCodeOut = ref(false); const dialogVisiblePickUpCodeOut = ref(false);
// //
const pickUpCodeOut = ref(''); const pickUpCodeOut = ref('');
const pickUpViewOut = (index: Number) => { const pickUpViewOut = (index: number) => {
indexPickUpCode.value = index;
pickUpCodeForm.pickUpCode = ''; pickUpCodeForm.pickUpCode = '';
dialogVisiblePickUpCodeOut.value = true; dialogVisiblePickUpCodeOut.value = true;
}; };
const pickUpCodeFormRef = ref() const pickUpCodeFormRef = ref()
// //
const pickUpCodeRules = ref({ const pickUpCodeRules = ref({
pickUpCode: [ pickUpCode:[
{ {
required: true, required: true,
message: '请输入取件码', message: '请输入取件码',
trigger: 'blur', trigger: 'blur',
}, }
], ],
}) })
const pickUpCodeForm = reactive<any>({ const pickUpCodeForm = reactive<any>({
@ -767,6 +778,35 @@ const pickUpView = async(item: any) => {
dialogVisiblePickUpCode.value = true; dialogVisiblePickUpCode.value = true;
}; };
//
const confirmReceipt = () => {
pickUpCodeFormRef.value.validate((valid:any) => {
if (valid) {
ElMessageBox.confirm('是否确定收货?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
console.log('xxxxxxxxxxxxxxxx',indexPickUpCode.value,pickUpCodeForm.pickUpCode)
return passApi({ orderId: cardList.value[indexPickUpCode.value].orderId, orderStatus: 4,pickupCode:pickUpCodeForm.pickUpCode })
})
.then((res) => {
if (res.code === 200) {
ElMessage({
type: 'success',
message: '确定出库成功',
})
numberTemp.value = numberTemp.value + 1
dialogVisiblePickUpCodeOut.value = false
getList()
}
})
.catch(() => {})
}
})
}
</script> </script>
<template> <template>
@ -1154,13 +1194,19 @@ const pickUpView = async(item: any) => {
>接单</el-button >接单</el-button
> >
<el-button <el-button
v-if="item.orderStatus == '3'" v-if="item.orderStatus == '2'"
type="primary" type="primary"
size="small" size="small"
@click="pickUpView(item)" @click="pickUpView(item)"
>查看取件码</el-button >查看取件码</el-button
> >
<el-button
v-if="item.orderStatus == '2'"
type="primary"
size="small"
@click="pickUpViewOut(index)"
>出库</el-button
>
<el-button @click="handleViewOrder(item)" type="primary" size="small"> <el-button @click="handleViewOrder(item)" type="primary" size="small">
订单详情 订单详情
@ -2113,7 +2159,10 @@ const pickUpView = async(item: any) => {
title="收货" title="收货"
width="30%" width="30%"
align-center align-center
>
<el-form
ref="pickUpCodeFormRef" ref="pickUpCodeFormRef"
label-position="right"
:model="pickUpCodeForm" :model="pickUpCodeForm"
:rules="pickUpCodeRules" :rules="pickUpCodeRules"
> >
@ -2129,16 +2178,19 @@ const pickUpView = async(item: any) => {
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
<div class="button-container">
<el-button type="primary" class="primary-lease" @click="dialogVisiblePickUpCodeOut=false"> <el-button type="primary" class="primary-lease" @click="dialogVisiblePickUpCodeOut=false">
关闭 关闭
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
class="primary-lease" class="primary-lease"
@click="confirmPass" @click="confirmReceipt"
> >
收货 出库
</el-button> </el-button>
</div>
</el-dialog> </el-dialog>
</template> </template>
@ -2525,4 +2577,9 @@ const pickUpView = async(item: any) => {
width: 100%; width: 100%;
height: 500px; height: 500px;
} }
.button-container {
display: flex;
justify-content: flex-end;
margin-top: 20px; //
}
</style> </style>