问题修改

This commit is contained in:
hayu 2025-07-29 17:45:39 +08:00
parent 92a3e3b04c
commit 5b58d3b1ad
1 changed files with 169 additions and 33 deletions

View File

@ -45,6 +45,7 @@
<span class="sub-code">{{ `${item.backCode}-${item.level}` }}</span>
</div>
<div class="title-right">
<uni-tag v-if="item.dataStatus == 3" text="修饰后入库驳回" type="error" style="margin-right: 5px" custom-style="errorStyle"/>
<uni-tag v-if="item.status == 0" text="未完成" type="warning" custom-style="warningStyle"/>
<uni-tag v-if="item.status == 1" text="已完成" type="success" custom-style="successStyle"/>
<uni-tag v-if="item.status == 2" text="已驳回" type="warning" custom-style="warningStyle"/>
@ -95,6 +96,23 @@
</view>
</scroll-view>
</view>
<!-- 自定义弹窗 -->
<view v-if="showCustomModal" class="custom-modal-mask" @tap="handleCloseModal">
<view class="custom-modal-container" @tap.stop>
<view class="custom-modal-header">
<text class="custom-modal-title">{{ modalTitle }}</text>
<text class="custom-modal-close" @tap="handleCloseModal">×</text>
</view>
<view class="custom-modal-content">
{{ modalContent }}
</view>
<view class="custom-modal-footer">
<button class="custom-modal-btn cancel" @tap="handleCancel">转至维修</button>
<button class="custom-modal-btn confirm" @tap="handleConfirm">进入定损</button>
</view>
</view>
</view>
</template>
<script setup>
@ -111,6 +129,10 @@ const dateArray = ref([
new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
new Date().toISOString().split('T')[0]
]) //
const showCustomModal = ref(false)
const currentItem = ref(null)
const modalTitle = ref('提示')
const modalContent = ref('是否确认进行定损?')
//
const queryParams = ref({
startTime: dateArray.value[0] || '',
@ -254,42 +276,80 @@ const changeTab = (index) => {
//
const handleItem = (item) => {
console.log(item)
if(item.repairStatusCode=="0"){
//
uni.showModal({
title: '提示',
content: '是否确认进行定损?',
confirmText: '进入定损',
cancelText: '转至维修',
success: async (res) => {
if (res.confirm) {
//
uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
} else if (res.cancel) {
//
const res = await updateRepairStatusAPI({taskId: item.taskId})
if(res.code==200){
uni.showToast({
title: '成功转至维修',
icon: 'none',
})
setTimeout(() => {
queryParams.value.pageNum = 1
tableList.value = []
getTableList(true)
}, 1000)
}
}
}
})
// uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
}else{
uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
}
currentItem.value = item
if(item.repairStatusCode == "0") {
// 使
showCustomModal.value = true
} else {
uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
}
// if(item.repairStatusCode=="0"){
// //
// uni.showModal({
// title: '',
// content: '',
// confirmText: '',
// cancelText: '',
// success: async (res) => {
// if (res.confirm) {
// //
// uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
// } else if (res.cancel) {
// //
// const res = await updateRepairStatusAPI({taskId: item.taskId})
// if(res.code==200){
// uni.showToast({
// title: '',
// icon: 'none',
// })
// setTimeout(() => {
// queryParams.value.pageNum = 1
// tableList.value = []
// getTableList(true)
// }, 1000)
//
// }
// }
// }
// })
// // uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
// }else{
// uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
// }
}
//
const handleConfirm = () => {
showCustomModal.value = false
uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${currentItem.value.taskId}` })
}
//
const handleCancel = async () => {
showCustomModal.value = false
const res = await updateRepairStatusAPI({taskId: currentItem.value.taskId})
if(res.code == 200) {
uni.showToast({
title: '成功转至维修',
icon: 'none',
})
setTimeout(() => {
queryParams.value.pageNum = 1
tableList.value = []
getTableList(true)
}, 1000)
}
}
//
const handleCloseModal = () => {
showCustomModal.value = false
}
//
const finish = computed(() => {
if (total.value === tableList.value.length) return true
@ -314,6 +374,82 @@ const maskClick = () => {}
</script>
<style lang="scss" scoped>
/* 在style部分添加以下样式 */
.custom-modal-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
}
.custom-modal-container {
width: 600rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
}
.custom-modal-header {
margin-left: 10px;
margin-right: 10px;
padding: 10rpx;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1rpx solid #eee;
}
.custom-modal-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.custom-modal-close {
font-size: 40rpx;
color: #999;
padding: 10rpx;
}
.custom-modal-content {
padding: 40rpx 30rpx;
font-size: 28rpx;
color: #666;
text-align: center;
}
.custom-modal-footer {
display: flex;
border-top: 1rpx solid #eee;
}
.custom-modal-btn {
flex: 1;
margin: 0;
border-radius: 0;
border: none;
background: none;
line-height: 90rpx;
font-size: 28rpx;
}
.custom-modal-btn.cancel {
color: #666;
border-right: 1rpx solid #eee;
}
.custom-modal-btn.confirm {
color: #3784fb;
font-weight: bold;
}
.title-left {
display: flex;
flex-direction: column;