出库修改
This commit is contained in:
parent
ceda98aa00
commit
40c26f83e4
|
|
@ -888,20 +888,20 @@ const pickUpCodeForm = reactive<any>({
|
|||
</el-button> -->
|
||||
|
||||
<el-button
|
||||
v-if="item.orderStatus == '3'"
|
||||
v-if="item.orderStatus == '2'"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="pickUpView(item)"
|
||||
>查看取件码</el-button
|
||||
>
|
||||
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
v-if="item.orderStatus == '3'"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="pickUpViewOut(index)"
|
||||
>确认收货</el-button
|
||||
>
|
||||
> -->
|
||||
|
||||
<el-button
|
||||
@click="handleViewOrder(j, item)"
|
||||
|
|
|
|||
|
|
@ -160,42 +160,53 @@ const onAcceptOrders = (item: any) => {
|
|||
})
|
||||
.then(async() => {
|
||||
const passApiRes = await passApi({ orderId: item.orderId, orderStatus: 2 });
|
||||
// 检查 passApi 是否成功
|
||||
if (passApiRes && passApiRes.code === 200) {
|
||||
// 如果 passApi 成功,调用 passApi(原代码中的 passApiTwo 可能是拼写错误)
|
||||
const passApiTwoRes = await passApi({ orderId: item.orderId, orderStatus: 3 });
|
||||
if (passApiTwoRes && passApiTwoRes.code === 200) {
|
||||
ElMessage({
|
||||
if (passApiRes && passApiRes.code === 200) {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '接单成功',
|
||||
duration: 1000,
|
||||
});
|
||||
numberTemp.value = numberTemp.value + 1;
|
||||
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(() => {})
|
||||
}
|
||||
|
||||
|
||||
const indexPickUpCode = ref(0);
|
||||
//出库弹窗参数
|
||||
const dialogVisiblePickUpCodeOut = ref(false);
|
||||
// 新增变量来存储取件码
|
||||
const pickUpCodeOut = ref('');
|
||||
const pickUpViewOut = (index: Number) => {
|
||||
const pickUpViewOut = (index: number) => {
|
||||
indexPickUpCode.value = index;
|
||||
pickUpCodeForm.pickUpCode = '';
|
||||
dialogVisiblePickUpCodeOut.value = true;
|
||||
};
|
||||
const pickUpCodeFormRef = ref()
|
||||
//取件码表单校验规则
|
||||
const pickUpCodeRules = ref({
|
||||
pickUpCode: [
|
||||
pickUpCode:[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入取件码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
}
|
||||
],
|
||||
})
|
||||
const pickUpCodeForm = reactive<any>({
|
||||
|
|
@ -767,6 +778,35 @@ const pickUpView = async(item: any) => {
|
|||
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>
|
||||
|
||||
<template>
|
||||
|
|
@ -1154,13 +1194,19 @@ const pickUpView = async(item: any) => {
|
|||
>接单</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="item.orderStatus == '3'"
|
||||
v-if="item.orderStatus == '2'"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="pickUpView(item)"
|
||||
>查看取件码</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">
|
||||
订单详情
|
||||
|
|
@ -2113,7 +2159,10 @@ const pickUpView = async(item: any) => {
|
|||
title="收货"
|
||||
width="30%"
|
||||
align-center
|
||||
>
|
||||
<el-form
|
||||
ref="pickUpCodeFormRef"
|
||||
label-position="right"
|
||||
:model="pickUpCodeForm"
|
||||
:rules="pickUpCodeRules"
|
||||
>
|
||||
|
|
@ -2129,16 +2178,19 @@ const pickUpView = async(item: any) => {
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="button-container">
|
||||
<el-button type="primary" class="primary-lease" @click="dialogVisiblePickUpCodeOut=false">
|
||||
关闭
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="primary-lease"
|
||||
@click="confirmPass"
|
||||
@click="confirmReceipt"
|
||||
>
|
||||
收货
|
||||
出库
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
|
@ -2525,4 +2577,9 @@ const pickUpView = async(item: any) => {
|
|||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
.button-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 20px; // 根据实际情况调整顶部间距
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue