Merge branch 'ah-simple' of http://192.168.0.75:3000/bonus/Zlpt_Portal into ah-simple

This commit is contained in:
syruan 2025-02-25 15:02:36 +08:00
commit 0af7c3672a
6 changed files with 320 additions and 50 deletions

3
components.d.ts vendored
View File

@ -14,6 +14,7 @@ declare module 'vue' {
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
@ -28,6 +29,7 @@ declare module 'vue' {
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
@ -35,6 +37,7 @@ declare module 'vue' {
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElProgress: typeof import('element-plus/es')['ElProgress']

View File

@ -29,4 +29,10 @@ export const confirmPriceApi = (data: any) => {
//获取租赁协议详情
export const getContractDetailApi = (data: any) => {
return get('/material-mall/order/leaseAgreement', data)
}
}
//获取取件码
export const getOrderCodeApi = (data: any) => {
return get('/material-mall/order/getOrderCode',data)
}

View File

@ -6,7 +6,7 @@
<a
v-for="(item, index) in currentIndex == 1 ? levelList : levelList_2"
:key="index"
:style="index + 1 == currentIndex ? 'color:#000' : ''"
:style="index + 1 == currentIndex ? 'color:#000' : 'color: #333'"
>{{ item.title
}}{{
currentIndex == 1
@ -35,7 +35,7 @@
active: val.isChecked,
}"
>
<span>{{ val.name }}</span>
<span style="color: #333">{{ val.name }}</span>
<!-- <span v-else>
{{ val.name }}
{{

View File

@ -1283,6 +1283,24 @@ const changeDate = (row: any, index: number) => {
equipTableList.value[index].nextCheckDate = dayjs(currentDate).format('YYYY-MM-DD')
// equipTableList.value = [...equipTableList.value];
}
const getUpdateTimeBgColor = (row: any) => {
// Date
const checkDate = new Date();
const nextCheckDate = new Date(row.nextCheckDate);
//
const diffTime = Math.abs(nextCheckDate - checkDate);
//
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
if (checkDate < nextCheckDate && diffDays <= 30) {
return '#FFFFCC'; //
} else if (checkDate > nextCheckDate) {
return '#FFCCCC'; //
}
return ''; //
};
</script>
<template>
@ -1438,7 +1456,11 @@ const changeDate = (row: any, index: number) => {
</template>
</el-table-column>
<el-table-column align="center" prop="typeName" label="装备型号" />
<el-table-column align="center" prop="updateTime" label="更新时间" />
<el-table-column align="center" prop="nextCheckDate" label="下次检验日期" >
<template #default="{ row }">
<span :style="{ backgroundColor: getUpdateTimeBgColor(row) }">{{ row.nextCheckDate }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="装备状态">
<template #default="{ row }">
<el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag>

View File

@ -9,6 +9,7 @@ import {
failApi,
confirmPriceApi,
getContractDetailApi,
getOrderCodeApi,
} from 'http/api/usercenter/seekorder'
import TitleTip from 'components/TitleTip/index.vue'
import { getOverhaulApi } from 'http/api/rent-termination/index'
@ -107,8 +108,8 @@ const getList = async () => {
queryParams.value.endTime = undefined
}
const res: any = await getOrderListApi(queryParams.value)
cardList.value = res.rows
total.value = res.total
cardList.value = res.data.rows
total.value = res.data.total
}
const emit = defineEmits(['onOpenOrderDetails'])
@ -165,26 +166,32 @@ const onChangeGoods = (index: number) => {
}
//
const confirmReceipt = async (index: number) => {
ElMessageBox.confirm('是否确定收货?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
const confirmReceipt = () => {
pickUpCodeFormRef.value.validate((valid:any) => {
if (valid) {
ElMessageBox.confirm('是否确定收货?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return passApi({ orderId: cardList.value[index].orderId, orderStatus: 4 })
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: '确定收成功',
message: '确定收成功',
})
numberTemp.value = numberTemp.value + 1
dialogVisiblePickUpCodeOut.value = false
getList()
}
})
.catch(() => {})
}
})
}
//
@ -383,17 +390,17 @@ const downloadContract = () => {
// }
}
const confirmFail = async (index: number) => {
const confirmFail = async (item: any) => {
ElMessageBox.confirm('是否确定取消订单?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return failApi({ orderId: cardList.value[index].orderId, orderStatus: 99 })
return failApi({ orderId: item.orderId, orderStatus: 99 })
// return removeDeviceApi([row.maId])
})
.then((res) => {
.then((res: any) => {
if (res.code === 200) {
ElMessage({
type: 'success',
@ -464,6 +471,44 @@ const costSubmit = () => {
})
.catch(async () => {})
}
//
const dialogVisiblePickUpCode = ref(false);
//
const pickUpCode = ref('');
const pickUpView = async(item: any) => {
console.log('item',item)
const res: any = await getOrderCodeApi({orderId:item.orderId})
console.log('res',res)
pickUpCode.value = res.data
dialogVisiblePickUpCode.value = true;
};
const indexPickUpCode = ref(0);
//
const dialogVisiblePickUpCodeOut = ref(false);
//
const pickUpCodeOut = ref('');
const pickUpViewOut = (index: number) => {
indexPickUpCode.value = index;
pickUpCodeForm.pickUpCode = '';
dialogVisiblePickUpCodeOut.value = true;
};
const pickUpCodeFormRef = ref()
//
const pickUpCodeRules = ref([
{
required: true,
message: '请输入取件码',
trigger: 'blur',
},
],
)
const pickUpCodeForm = reactive<any>({
pickUpCode: '',
})
</script>
<template>
@ -810,14 +855,30 @@ const costSubmit = () => {
style="display: flex; align-items: center"
>
<div :class="item.orderStatus == 4 ? 'handle-btn-4' : 'handle-btn'">
<el-button
<!-- <el-button
v-if="item.orderStatus == '3'"
type="primary"
size="small"
@click="confirmReceipt(index)"
>
确认收货
</el-button>
</el-button> -->
<el-button
v-if="item.orderStatus == '3'"
type="primary"
size="small"
@click="pickUpView(item)"
>查看取件码</el-button
>
<el-button
v-if="item.orderStatus == '3'"
type="primary"
size="small"
@click="pickUpViewOut(index)"
>确认收货</el-button
>
<el-button
@click="handleViewOrder(j, item)"
@ -865,10 +926,10 @@ const costSubmit = () => {
</el-button>
<!-- <el-button type="primary" size="small"> 发起减免 </el-button> -->
<el-button
v-if="item.orderStatus == '2'"
v-if="item.orderStatus == '1' || item.orderStatus == '2'"
type="primary"
size="small"
@click="confirmFail(index)"
@click="confirmFail(item)"
>
取消订单
</el-button>
@ -1194,9 +1255,9 @@ const costSubmit = () => {
<PagingComponent
v-if="total > 0"
@getList="getList"
:pageSize="pageSize"
:pageNumber="pageNumber"
@getListChange="getList"
v-model:pageSize="queryParams.pageSize"
v-model:currentPage="queryParams.pageNum"
:total="total"
/>
</div>
@ -1400,6 +1461,74 @@ const costSubmit = () => {
</div>
<div id="mmm" style="height: 600px"></div>
</el-dialog>
<!-- 取件码弹窗 -->
<el-dialog
v-model="dialogVisiblePickUpCode"
title="查看"
width="30%"
align-center
:close-on-click-modal="false"
>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" style="font-size: 18px; font-weight:">
<el-input
autocomplete="off"
maxlength="20"
v-model="pickUpCode"
clearable
style="font-size: 18px; font-weight: bold;"
/>
</el-form-item>
</el-col>
</el-row>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisiblePickUpCode = false">关闭</el-button>
</span>
</template>
</el-dialog>
<!-- 收货取件码弹窗 -->
<el-dialog
v-model="dialogVisiblePickUpCodeOut"
title="收货"
width="30%"
align-center
>
<el-form
ref="pickUpCodeFormRef"
label-position="right"
:model="pickUpCodeForm"
:rules="pickUpCodeRules"
>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" >
<el-input
autocomplete="off"
maxlength="20"
v-model="pickUpCodeForm.pickUpCode"
clearable
/>
</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="confirmReceipt"
>
收货
</el-button>
</div>
</el-dialog>
</template>
<style lang="scss" scoped>
@ -1687,4 +1816,9 @@ const costSubmit = () => {
margin-bottom: 10px;
}
}
.button-container {
display: flex;
justify-content: flex-end;
margin-top: 20px; //
}
</style>

View File

@ -10,6 +10,7 @@ import {
passApi,
failApi,
getContractDetailApi,
getOrderCodeApi,
} from 'http/api/usercenter/seekorder'
import uploadComponent from 'components/uploadComponent/index.vue'
import previewImg from './previewImg/index.vue'
@ -94,8 +95,8 @@ const getList = async () => {
queryParams.value.endTime = undefined
}
const res: any = await getOrderListApi(queryParams.value)
cardList.value = res.rows
total.value = res.total
cardList.value = res.data.rows
total.value = res.data.total
}
const emit = defineEmits(['onOpenOrderDetails'])
@ -157,25 +158,52 @@ const onAcceptOrders = (item: any) => {
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return passApi({ orderId: item.orderId, orderStatus: 2 })
// return removeDeviceApi([row.maId])
})
.then((res) => {
if (res.code === 200) {
ElMessage({
type: 'success',
message: '接单成功',
duration: 1000,
})
numberTemp.value = numberTemp.value + 1
getList()
.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({
type: 'success',
message: '接单成功',
duration: 1000,
});
numberTemp.value = numberTemp.value + 1;
getList();
}
}
})
.catch(() => {})
}
//
//
const dialogVisiblePickUpCodeOut = ref(false);
//
const pickUpCodeOut = ref('');
const pickUpViewOut = (index: Number) => {
pickUpCodeForm.pickUpCode = '';
dialogVisiblePickUpCodeOut.value = true;
};
const pickUpCodeFormRef = ref()
//
const pickUpCodeRules = ref({
pickUpCode: [
{
required: true,
message: '请输入取件码',
trigger: 'blur',
},
],
})
const pickUpCodeForm = reactive<any>({
pickUpCode: '',
})
//
const confirmPass = async (index: number) => {
ElMessageBox.confirm('是否确定出库?', {
confirmButtonText: '确定',
@ -200,17 +228,18 @@ const confirmPass = async (index: number) => {
}
//
const confirmFail = async (index: number) => {
const confirmFail = async (item: any) => {
// console.log(item.orderId, '-->>>')
ElMessageBox.confirm('是否确定取消?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return failApi({ orderId: cardList.value[index].orderId, orderStatus: 99 })
return failApi({ orderId: item.orderId, orderStatus: 99 })
// return removeDeviceApi([row.maId])
})
.then((res) => {
.then((res: any) => {
if (res.code === 200) {
ElMessage({
type: 'success',
@ -703,6 +732,19 @@ const downloadContract = () => {
}
const wordUrl = ref('')
//
const dialogVisiblePickUpCode = ref(false);
//
const pickUpCode = ref('');
const pickUpView = async(item: any) => {
console.log('item',item)
const res: any = await getOrderCodeApi({orderId:item.orderId})
console.log('res',res)
pickUpCode.value = res.data
dialogVisiblePickUpCode.value = true;
};
</script>
<template>
@ -1090,13 +1132,14 @@ const wordUrl = ref('')
>接单</el-button
>
<el-button
v-if="item.orderStatus == '2'"
v-if="item.orderStatus == '3'"
type="primary"
size="small"
@click="confirmPass(index)"
>出库</el-button
@click="pickUpView(item)"
>查看取件码</el-button
>
<el-button @click="handleViewOrder(item)" type="primary" size="small">
订单详情
</el-button>
@ -1130,8 +1173,8 @@ const wordUrl = ref('')
<el-button
size="small"
type="primary"
v-if="item.orderStatus == '2'"
@click="confirmFail(index)"
v-if="item.orderStatus == '1'"
@click="confirmFail(item)"
>
取消订单
</el-button>
@ -1144,9 +1187,9 @@ const wordUrl = ref('')
<Empty v-else />
<PagingComponent
v-if="total > 0"
@getList="getList"
@getListChange="getList"
v-model:pageSize="queryParams.pageSize"
v-model:currentPage="queryParams.pageNumber"
v-model:currentPage="queryParams.pageNum"
:total="total"
/>
@ -2012,6 +2055,68 @@ const wordUrl = ref('')
</div>
<div id="mmm" style="height: 600px"></div>
</el-dialog>
<!-- 取件码弹窗 -->
<el-dialog
v-model="dialogVisiblePickUpCode"
title="查看"
width="30%"
align-center
:close-on-click-modal="false"
>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" style="font-size: 18px; font-weight:">
<el-input
autocomplete="off"
maxlength="20"
v-model="pickUpCode"
clearable
style="font-size: 18px; font-weight: bold;"
/>
</el-form-item>
</el-col>
</el-row>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisiblePickUpCode = false">关闭</el-button>
</span>
</template>
</el-dialog>
<!-- 收货取件码弹窗 -->
<el-dialog
v-model="dialogVisiblePickUpCodeOut"
title="收货"
width="30%"
align-center
ref="pickUpCodeFormRef"
:model="pickUpCodeForm"
:rules="pickUpCodeRules"
>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="取件码:" prop="pickUpCode" label-width="100px" >
<el-input
autocomplete="off"
maxlength="20"
v-model="pickUpCodeForm.pickUpCode"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-button type="primary" class="primary-lease" @click="dialogVisiblePickUpCodeOut=false">
关闭
</el-button>
<el-button
type="primary"
class="primary-lease"
@click="confirmPass"
>
收货
</el-button>
</el-dialog>
</template>
<style lang="scss" scoped>