Merge branch 'master' of http://192.168.30.2:3000/bonus/bonus-material-app
This commit is contained in:
commit
f5f772cba2
|
|
@ -45,6 +45,7 @@
|
||||||
<span class="sub-code">{{ `${item.backCode}-${item.level}` }}</span>
|
<span class="sub-code">{{ `${item.backCode}-${item.level}` }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="title-right">
|
<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 == 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 == 1" text="已完成" type="success" custom-style="successStyle"/>
|
||||||
<uni-tag v-if="item.status == 2" text="已驳回" type="warning" custom-style="warningStyle"/>
|
<uni-tag v-if="item.status == 2" text="已驳回" type="warning" custom-style="warningStyle"/>
|
||||||
|
|
@ -95,6 +96,23 @@
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</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>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<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(new Date().getTime() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
|
||||||
new Date().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({
|
const queryParams = ref({
|
||||||
startTime: dateArray.value[0] || '',
|
startTime: dateArray.value[0] || '',
|
||||||
|
|
@ -254,42 +276,80 @@ const changeTab = (index) => {
|
||||||
// 点击跳转详情
|
// 点击跳转详情
|
||||||
const handleItem = (item) => {
|
const handleItem = (item) => {
|
||||||
console.log(item)
|
console.log(item)
|
||||||
if(item.repairStatusCode=="0"){
|
currentItem.value = item
|
||||||
// 弹出确认弹窗
|
if(item.repairStatusCode == "0") {
|
||||||
uni.showModal({
|
// 使用自定义弹窗
|
||||||
title: '提示',
|
showCustomModal.value = true
|
||||||
content: '是否确认进行定损?',
|
} else {
|
||||||
confirmText: '进入定损',
|
uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
|
||||||
cancelText: '转至维修',
|
}
|
||||||
success: async (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
// 用户点击确认,进行页面跳转
|
|
||||||
uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
|
// if(item.repairStatusCode=="0"){
|
||||||
} else if (res.cancel) {
|
// // 弹出确认弹窗
|
||||||
//直接进行维修
|
// uni.showModal({
|
||||||
const res = await updateRepairStatusAPI({taskId: item.taskId})
|
// title: '提示',
|
||||||
if(res.code==200){
|
// content: '是否确认进行定损?',
|
||||||
uni.showToast({
|
// confirmText: '进入定损',
|
||||||
title: '成功转至维修',
|
// cancelText: '转至维修',
|
||||||
icon: 'none',
|
// success: async (res) => {
|
||||||
})
|
// if (res.confirm) {
|
||||||
setTimeout(() => {
|
// // 用户点击确认,进行页面跳转
|
||||||
queryParams.value.pageNum = 1
|
// uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
|
||||||
tableList.value = []
|
// } else if (res.cancel) {
|
||||||
getTableList(true)
|
// //直接进行维修
|
||||||
}, 1000)
|
// const res = await updateRepairStatusAPI({taskId: item.taskId})
|
||||||
|
// if(res.code==200){
|
||||||
}
|
// uni.showToast({
|
||||||
}
|
// title: '成功转至维修',
|
||||||
}
|
// icon: 'none',
|
||||||
})
|
// })
|
||||||
// uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
|
// setTimeout(() => {
|
||||||
}else{
|
// queryParams.value.pageNum = 1
|
||||||
uni.navigateTo({ url: `/pages/repair/equipAssessment/view?taskId=${item.taskId}` })
|
// 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(() => {
|
const finish = computed(() => {
|
||||||
if (total.value === tableList.value.length) return true
|
if (total.value === tableList.value.length) return true
|
||||||
|
|
@ -314,6 +374,82 @@ const maskClick = () => {}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<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 {
|
.title-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="accept page-common">
|
<view class="accept page-common">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<uni-forms :modelValue="formData" label-width="170rpx" :border="true">
|
<uni-row :gutter="24">
|
||||||
<uni-forms-item label="单位名称:" name="unitId" required>
|
<uni-col :span="6">
|
||||||
|
<view class="coding-btn" @tap="codeScan">二维码识别</view>
|
||||||
|
</uni-col>
|
||||||
|
</uni-row>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<uni-forms :modelValue="formData" label-width="170rpx" :border="true">
|
||||||
|
<uni-forms-item label="单位名称:" name="unitId" required>
|
||||||
<eselect
|
<eselect
|
||||||
style="width: 100%; height: 90rpx"
|
style="width: 100%; height: 90rpx"
|
||||||
ref="treeSelect"
|
ref="treeSelect"
|
||||||
|
|
@ -33,6 +40,11 @@
|
||||||
<button class="btn-cont" @click="clearForm">清空</button>
|
<button class="btn-cont" @click="clearForm">清空</button>
|
||||||
<button class="btn-cont" @click="confirmAdd">确认</button>
|
<button class="btn-cont" @click="confirmAdd">确认</button>
|
||||||
</div>
|
</div>
|
||||||
|
<ScanQrCode
|
||||||
|
ref="scanQrCodeRef"
|
||||||
|
@scanSuccess="handleScanSuccess"
|
||||||
|
@scanError="handleScanError"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -45,7 +57,11 @@ import {
|
||||||
insert,
|
insert,
|
||||||
getAgreementInfoById,
|
getAgreementInfoById,
|
||||||
} from '@/services/fieldMaintenance/fieldMaintenance.js'
|
} from '@/services/fieldMaintenance/fieldMaintenance.js'
|
||||||
|
import { getMachineByQrCodeApi } from '../../../services/back.js'
|
||||||
import eselect from '@/components/tree-select/eselect.vue'
|
import eselect from '@/components/tree-select/eselect.vue'
|
||||||
|
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
|
||||||
|
|
||||||
|
const scanQrCodeRef = ref(null)
|
||||||
const treeSelect = ref(null)
|
const treeSelect = ref(null)
|
||||||
const treeSelect2 = ref(null)
|
const treeSelect2 = ref(null)
|
||||||
const unitId = ref('')
|
const unitId = ref('')
|
||||||
|
|
@ -55,7 +71,49 @@ const unitList = ref([])
|
||||||
const proList = ref([])
|
const proList = ref([])
|
||||||
const fieldPerson = ref('')
|
const fieldPerson = ref('')
|
||||||
const phone = ref('')
|
const phone = ref('')
|
||||||
|
const qrCode = ref('')
|
||||||
|
const maInfo = ref({}) //二维码
|
||||||
|
// 处理扫描成功事件
|
||||||
|
const handleScanSuccess = (result) => {
|
||||||
|
qrCode.value = result?.data?.split('?qrcode=')[1] || result?.data
|
||||||
|
if (qrCode.value === '') {
|
||||||
|
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||||
|
} else {
|
||||||
|
getMaInfoScan()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 处理扫描失败事件
|
||||||
|
const handleScanError = (error) => {
|
||||||
|
console.error('扫描出错:', error.message)
|
||||||
|
uni.showToast({ title: error.message, icon: 'none' })
|
||||||
|
}
|
||||||
|
|
||||||
|
//查看是否是该规格型号
|
||||||
|
const getMaInfoScan = async () => {
|
||||||
|
let param = {
|
||||||
|
qrCode: qrCode.value,
|
||||||
|
}
|
||||||
|
//通过二维码获取相绑定的设备编码
|
||||||
|
const res = await getMachineByQrCodeApi(param)
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 200) {
|
||||||
|
if (res.data.length > 0) {
|
||||||
|
unitId.value = res.data[0].unitId
|
||||||
|
proId.value = res.data[0].proId
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: '扫码二维码未绑定设备编码!', icon: 'none' })
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.data.msg, icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const codeScan = async () => {
|
||||||
|
qrCode.value = ''
|
||||||
|
|
||||||
|
if (scanQrCodeRef.value) {
|
||||||
|
scanQrCodeRef.value.scanQrCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
//单位
|
//单位
|
||||||
const getUnit = () => {
|
const getUnit = () => {
|
||||||
// proId.value=e.id;
|
// proId.value=e.id;
|
||||||
|
|
@ -158,9 +216,9 @@ const confirmAdd = () => {
|
||||||
uni.showToast({ title: '请确认联系电话!', icon: 'none' })
|
uni.showToast({ title: '请确认联系电话!', icon: 'none' })
|
||||||
} else {
|
} else {
|
||||||
let obj = {
|
let obj = {
|
||||||
agreementId: agreementId.value,
|
agreementId: agreementId.value,
|
||||||
fieldPerson: fieldPerson.value,
|
fieldPerson: fieldPerson.value,
|
||||||
phone: phone.value,
|
phone: phone.value,
|
||||||
}
|
}
|
||||||
insert(obj)
|
insert(obj)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
@ -213,6 +271,25 @@ onLoad((options) => {
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
|
.coding-btn {
|
||||||
|
height: 70rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
background: linear-gradient(135deg, #4b8eff 0%, #3784fb 100%);
|
||||||
|
border-radius: 12rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
box-shadow: 0 6rpx 20rpx rgba(55, 132, 251, 0.2);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: scale(0.98);
|
||||||
|
opacity: 0.9;
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(55, 132, 251, 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 表单样式
|
// 表单样式
|
||||||
:deep(.uni-forms) {
|
:deep(.uni-forms) {
|
||||||
.uni-forms-item {
|
.uni-forms-item {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ export const repairRejectAPI = (id) => {
|
||||||
export const partTypeTreeList = (data) => {
|
export const partTypeTreeList = (data) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '/material/ma_part_type/list',
|
url: '/material/ma_part_type/partList',
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue