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

View File

@ -30,3 +30,9 @@ export const confirmPriceApi = (data: any) => {
export const getContractDetailApi = (data: any) => { export const getContractDetailApi = (data: any) => {
return get('/material-mall/order/leaseAgreement', data) 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 <a
v-for="(item, index) in currentIndex == 1 ? levelList : levelList_2" v-for="(item, index) in currentIndex == 1 ? levelList : levelList_2"
:key="index" :key="index"
:style="index + 1 == currentIndex ? 'color:#000' : ''" :style="index + 1 == currentIndex ? 'color:#000' : 'color: #333'"
>{{ item.title >{{ item.title
}}{{ }}{{
currentIndex == 1 currentIndex == 1
@ -35,7 +35,7 @@
active: val.isChecked, active: val.isChecked,
}" }"
> >
<span>{{ val.name }}</span> <span style="color: #333">{{ val.name }}</span>
<!-- <span v-else> <!-- <span v-else>
{{ val.name }} {{ 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[index].nextCheckDate = dayjs(currentDate).format('YYYY-MM-DD')
// equipTableList.value = [...equipTableList.value]; // 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> </script>
<template> <template>
@ -1438,7 +1456,11 @@ const changeDate = (row: any, index: number) => {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="typeName" label="装备型号" /> <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="装备状态"> <el-table-column align="center" label="装备状态">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag> <el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag>

View File

@ -9,6 +9,7 @@ import {
failApi, failApi,
confirmPriceApi, confirmPriceApi,
getContractDetailApi, getContractDetailApi,
getOrderCodeApi,
} from 'http/api/usercenter/seekorder' } from 'http/api/usercenter/seekorder'
import TitleTip from 'components/TitleTip/index.vue' import TitleTip from 'components/TitleTip/index.vue'
import { getOverhaulApi } from 'http/api/rent-termination/index' import { getOverhaulApi } from 'http/api/rent-termination/index'
@ -107,8 +108,8 @@ const getList = async () => {
queryParams.value.endTime = undefined queryParams.value.endTime = undefined
} }
const res: any = await getOrderListApi(queryParams.value) const res: any = await getOrderListApi(queryParams.value)
cardList.value = res.rows cardList.value = res.data.rows
total.value = res.total total.value = res.data.total
} }
const emit = defineEmits(['onOpenOrderDetails']) const emit = defineEmits(['onOpenOrderDetails'])
@ -165,26 +166,32 @@ const onChangeGoods = (index: number) => {
} }
// //
const confirmReceipt = async (index: number) => { const confirmReceipt = () => {
ElMessageBox.confirm('是否确定收货?', { pickUpCodeFormRef.value.validate((valid:any) => {
confirmButtonText: '确定', if (valid) {
cancelButtonText: '取消', ElMessageBox.confirm('是否确定收货?', {
type: 'warning', confirmButtonText: '确定',
}) cancelButtonText: '取消',
type: 'warning',
})
.then(() => { .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) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '确定收成功', message: '确定收成功',
}) })
numberTemp.value = numberTemp.value + 1 numberTemp.value = numberTemp.value + 1
dialogVisiblePickUpCodeOut.value = false
getList() getList()
} }
}) })
.catch(() => {}) .catch(() => {})
}
})
} }
// //
@ -383,17 +390,17 @@ const downloadContract = () => {
// } // }
} }
const confirmFail = async (index: number) => { const confirmFail = async (item: any) => {
ElMessageBox.confirm('是否确定取消订单?', { ElMessageBox.confirm('是否确定取消订单?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
return failApi({ orderId: cardList.value[index].orderId, orderStatus: 99 }) return failApi({ orderId: item.orderId, orderStatus: 99 })
// return removeDeviceApi([row.maId]) // return removeDeviceApi([row.maId])
}) })
.then((res) => { .then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage({ ElMessage({
type: 'success', type: 'success',
@ -464,6 +471,44 @@ const costSubmit = () => {
}) })
.catch(async () => {}) .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> </script>
<template> <template>
@ -810,14 +855,30 @@ const costSubmit = () => {
style="display: flex; align-items: center" style="display: flex; align-items: center"
> >
<div :class="item.orderStatus == 4 ? 'handle-btn-4' : 'handle-btn'"> <div :class="item.orderStatus == 4 ? 'handle-btn-4' : 'handle-btn'">
<el-button <!-- <el-button
v-if="item.orderStatus == '3'" v-if="item.orderStatus == '3'"
type="primary" type="primary"
size="small" size="small"
@click="confirmReceipt(index)" @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 <el-button
@click="handleViewOrder(j, item)" @click="handleViewOrder(j, item)"
@ -865,10 +926,10 @@ const costSubmit = () => {
</el-button> </el-button>
<!-- <el-button type="primary" size="small"> 发起减免 </el-button> --> <!-- <el-button type="primary" size="small"> 发起减免 </el-button> -->
<el-button <el-button
v-if="item.orderStatus == '2'" v-if="item.orderStatus == '1' || item.orderStatus == '2'"
type="primary" type="primary"
size="small" size="small"
@click="confirmFail(index)" @click="confirmFail(item)"
> >
取消订单 取消订单
</el-button> </el-button>
@ -1194,9 +1255,9 @@ const costSubmit = () => {
<PagingComponent <PagingComponent
v-if="total > 0" v-if="total > 0"
@getList="getList" @getListChange="getList"
:pageSize="pageSize" v-model:pageSize="queryParams.pageSize"
:pageNumber="pageNumber" v-model:currentPage="queryParams.pageNum"
:total="total" :total="total"
/> />
</div> </div>
@ -1400,6 +1461,74 @@ const costSubmit = () => {
</div> </div>
<div id="mmm" style="height: 600px"></div> <div id="mmm" style="height: 600px"></div>
</el-dialog> </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> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -1687,4 +1816,9 @@ const costSubmit = () => {
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.button-container {
display: flex;
justify-content: flex-end;
margin-top: 20px; //
}
</style> </style>

View File

@ -10,6 +10,7 @@ import {
passApi, passApi,
failApi, failApi,
getContractDetailApi, getContractDetailApi,
getOrderCodeApi,
} from 'http/api/usercenter/seekorder' } from 'http/api/usercenter/seekorder'
import uploadComponent from 'components/uploadComponent/index.vue' import uploadComponent from 'components/uploadComponent/index.vue'
import previewImg from './previewImg/index.vue' import previewImg from './previewImg/index.vue'
@ -94,8 +95,8 @@ const getList = async () => {
queryParams.value.endTime = undefined queryParams.value.endTime = undefined
} }
const res: any = await getOrderListApi(queryParams.value) const res: any = await getOrderListApi(queryParams.value)
cardList.value = res.rows cardList.value = res.data.rows
total.value = res.total total.value = res.data.total
} }
const emit = defineEmits(['onOpenOrderDetails']) const emit = defineEmits(['onOpenOrderDetails'])
@ -157,25 +158,52 @@ const onAcceptOrders = (item: any) => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(async() => {
return passApi({ orderId: item.orderId, orderStatus: 2 }) const passApiRes = await passApi({ orderId: item.orderId, orderStatus: 2 });
// return removeDeviceApi([row.maId]) // passApi
}) if (passApiRes && passApiRes.code === 200) {
.then((res) => { // passApi passApi passApiTwo
if (res.code === 200) { const passApiTwoRes = await passApi({ orderId: item.orderId, orderStatus: 3 });
ElMessage({ if (passApiTwoRes && passApiTwoRes.code === 200) {
type: 'success', ElMessage({
message: '接单成功', type: 'success',
duration: 1000, message: '接单成功',
}) duration: 1000,
numberTemp.value = numberTemp.value + 1 });
getList() numberTemp.value = numberTemp.value + 1;
getList();
}
} }
}) })
.catch(() => {}) .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) => { const confirmPass = async (index: number) => {
ElMessageBox.confirm('是否确定出库?', { ElMessageBox.confirm('是否确定出库?', {
confirmButtonText: '确定', 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('是否确定取消?', { ElMessageBox.confirm('是否确定取消?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
return failApi({ orderId: cardList.value[index].orderId, orderStatus: 99 }) return failApi({ orderId: item.orderId, orderStatus: 99 })
// return removeDeviceApi([row.maId]) // return removeDeviceApi([row.maId])
}) })
.then((res) => { .then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage({ ElMessage({
type: 'success', type: 'success',
@ -703,6 +732,19 @@ const downloadContract = () => {
} }
const wordUrl = ref('') 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> </script>
<template> <template>
@ -1090,13 +1132,14 @@ const wordUrl = ref('')
>接单</el-button >接单</el-button
> >
<el-button <el-button
v-if="item.orderStatus == '2'" v-if="item.orderStatus == '3'"
type="primary" type="primary"
size="small" size="small"
@click="confirmPass(index)" @click="pickUpView(item)"
>出库</el-button >查看取件码</el-button
> >
<el-button @click="handleViewOrder(item)" type="primary" size="small"> <el-button @click="handleViewOrder(item)" type="primary" size="small">
订单详情 订单详情
</el-button> </el-button>
@ -1130,8 +1173,8 @@ const wordUrl = ref('')
<el-button <el-button
size="small" size="small"
type="primary" type="primary"
v-if="item.orderStatus == '2'" v-if="item.orderStatus == '1'"
@click="confirmFail(index)" @click="confirmFail(item)"
> >
取消订单 取消订单
</el-button> </el-button>
@ -1144,9 +1187,9 @@ const wordUrl = ref('')
<Empty v-else /> <Empty v-else />
<PagingComponent <PagingComponent
v-if="total > 0" v-if="total > 0"
@getList="getList" @getListChange="getList"
v-model:pageSize="queryParams.pageSize" v-model:pageSize="queryParams.pageSize"
v-model:currentPage="queryParams.pageNumber" v-model:currentPage="queryParams.pageNum"
:total="total" :total="total"
/> />
@ -2012,6 +2055,68 @@ const wordUrl = ref('')
</div> </div>
<div id="mmm" style="height: 600px"></div> <div id="mmm" style="height: 600px"></div>
</el-dialog> </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> </template>
<style lang="scss" scoped> <style lang="scss" scoped>