Browse Source

巡检待接单可以编辑

master
李俊城 2 months ago
parent
commit
870918d058
  1. 213
      src/App.vue
  2. 6
      src/api/spotCheckOrder.ts
  3. 8
      src/pages.json
  4. 779
      src/pages/spotCheckOrder/detailAndEdit.vue
  5. 456
      src/pages/spotCheckOrder/index.vue

213
src/App.vue

@ -1,116 +1,113 @@
<script setup lang="ts">
import {
onLaunch,
onShow,
onHide
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance
} from 'vue'
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { ref, getCurrentInstance } from 'vue'
import {
getAccessToken
} from '@/utils/auth';
import {
appUpdate
} from '@/utils/appUpdate.js';
const { proxy } = getCurrentInstance()
import { storeToRefs } from 'pinia'
import { getAccessToken } from '@/utils/auth'
import { appUpdate } from '@/utils/appUpdate.js'
import { storeToRefs } from 'pinia'
import { useCountStore } from '@/store'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
appUpdate(fasle);
onLaunch(async () => {
// #ifdef MP-WEIXIN
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
if (res.hasUpdate) {
updateManager.onUpdateReady(function () {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
uni.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
})
})
}
})
} else {
uni.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
// #endif
const { proxy } = getCurrentInstance()
// #ifdef APP-PLUS
const notificationAuthorized = uni.getAppAuthorizeSetting().notificationAuthorized
if (notificationAuthorized == 'denied') {
uni.showModal({
title: '提示',
content: '是否前往打开通知权限',
success: res => {
if (res.confirm) {
// this.openTongZhi()
} else if (res.cancel) {
}
}
})
}
plus.push.addEventListener("click", function (data) {
// 012
if(data.payload.status == 0 || data.payload.status == 1 || data.payload.status == 2){
uni.navigateTo({
url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`)
})
}
// // 1
// if(data.payload.status == 1){
// uni.navigateTo({
// url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`)
// })
// }
}, false);
uni.getPushClientId({
success: (res) => {
uni.setStorageSync('cid',res.cid)
},
fail(err) {
}
})
uni.onPushMessage((res) => {
})
// #endif
if (getAccessToken()) {
await store.GetPermissionInfo().then(res => {
uni.setStorageSync('permissionInfo',res.permissions)
uni.setStorageSync('roles',res.roles)
}).catch(() => {
})
await store.GetInfo().then(res => {
}).catch(() => { })
}
// onLaunchonLoad
proxy.$isResolve();
})
onShow(() => {
})
onHide(() => {
})
// store
const store = useCountStore()
// #ifdef APP
appUpdate(fasle)
// #endif
onLaunch(async () => {
// #ifdef MP-WEIXIN
if (uni.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
if (res.hasUpdate) {
updateManager.onUpdateReady(function () {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
uni.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
})
})
}
})
} else {
uni.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
// #endif
// #ifdef APP-PLUS
const { notificationAuthorized } = uni.getAppAuthorizeSetting()
if (notificationAuthorized == 'denied') {
uni.showModal({
title: '提示',
content: '是否前往打开通知权限',
success: (res) => {
if (res.confirm) {
// this.openTongZhi()
} else if (res.cancel) {
}
}
})
}
plus.push.addEventListener(
'click',
function (data) {
// 012
if (data.payload.status == 0 || data.payload.status == 1 || data.payload.status == 2) {
uni.navigateTo({
url: `/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`
})
}
// // 1
// if(data.payload.status == 1){
// uni.navigateTo({
// url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`)
// })
// }
},
false
)
uni.getPushClientId({
success: (res) => {
uni.setStorageSync('cid', res.cid)
},
fail(err) {}
})
uni.onPushMessage((res) => {})
// #endif
if (getAccessToken()) {
await store
.GetPermissionInfo()
.then((res) => {
uni.setStorageSync('permissionInfo', res.permissions)
uni.setStorageSync('roles', res.roles)
})
.catch(() => {})
await store
.GetInfo()
.then((res) => {})
.catch(() => {})
}
// onLaunchonLoad
proxy.$isResolve()
})
onShow(() => {})
onHide(() => {})
</script>
<style lang="scss">
@import 'vk-uview-ui/index.scss';
@import 'vk-uview-ui/index.scss';
</style>

6
src/api/spotCheckOrder.ts

@ -31,6 +31,12 @@ export function spotCheckOrderPage(params,type) {
}
}
// 待接单编辑
export function orderEditClick(params) {
return http.post('/eam/device-spot-inspection-record-main/complete',params)
}
// 操作工单
export function orderClick(params,type) {
if (type == 'DEVICE') {

8
src/pages.json

@ -149,6 +149,14 @@
"navigationBarTextStyle": "white"
}
}
,{
"path": "pages/spotCheckOrder/detailAndEdit",
"style": {
"navigationBarTitleText": "点检工单详情",
"navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white"
}
}
,{
"path": "pages/spotCheckOrder/addForm",
"style": {

779
src/pages/spotCheckOrder/detailAndEdit.vue

@ -0,0 +1,779 @@
<template>
<!-- 详情 -->
<view class="detail-container">
<view class="info">
<view class="title">
<view>点检工单</view>
</view>
<view class="dec">
<view class="dec-item">
<view>工单单号</view>
<view>{{ data.number }}</view>
</view>
<view class="" style="display: flex; flex-direction: row; align-items: center; padding-bottom: 30rpx">
<view style="color: red">*</view>
<view>点检描述</view>
<view class="">
<u-input v-model="data.describes" placeholder="请输入点检描述" />
</view>
</view>
<view class="" style="display: flex; flex-direction: row; align-items: center; padding-bottom: 30rpx" v-if="data.status != 'PECEIVED'">
<view style="color: red">*</view>
<view>班次</view>
<!-- <view>{{ data.classesName }}</view>sssssss -->
<view class="select" style="margin-left: 50rpx; width: 70%" @click="openSingleColumn('classes', '', maintenanceShift)">
<view class="input" v-if="data.classesName">
{{ data.classesName }}
</view>
<view class="placeholder" v-else>
{{ `请选择班次` }}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</view>
<view class="dec-item">
<view>点检人</view>
<view>{{ store.name }}</view>
</view>
<view class="dec-item">
<view>点检时间</view>
<view>{{ $time.formatDate(data.createTime) }}</view>
</view>
</view>
</view>
<div class="line"></div>
<view class="info" style="padding-bottom: 130rpx">
<view class="tab">
<u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current" @change="change"></u-tabs>
</view>
<view>
<view class="title">
<view>{{ changeItem.name }}</view>
</view>
<view class="dec" v-if="changeItem.value == 1">
<view class="dec-item">
<view>编号</view>
<view>{{ data.deviceNumber }}</view>
</view>
<view class="dec-item">
<view>名称</view>
<view>{{ data.name }}</view>
</view>
<view class="dec-item">
<view>所属厂区</view>
<view>{{ data.factoryAreaName }}</view>
</view>
<view class="dec-item">
<view>类型</view>
<view>{{ data.type == 'DEVICE' ? '设备' : data.type == 'TECH' ? '工艺' : '模具' }}</view>
</view>
</view>
<view class="list" v-if="changeItem.value == 2">
<view class="item" v-for="(item, index) in subList" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
{{ item.name }}
</view>
</view>
<u-row gutter="16">
<u-col :span="12">
<view class="dec" style="margin-top: 10rpx">
<view class=""> 设备部位名称: {{ item.equipmentPosition }} </view>
</view>
<view class="" style="margin-left: 30rpx; display: flex; flex-direction: row; color: #9c9c9c; align-items: center">
<view class=""> 是否符合: </view>
<view class="" style="display: flex; margin-left: 20rpx; margin-top: 20rpx">
<u-radio-group v-model="item.isConform">
<view class="" style="display: flex; flex-direction: row">
<view class="">
<u-radio name="TRUE">符合</u-radio>
</view>
<view class="">
<u-radio name="FALSE">不符合</u-radio>
</view>
</view>
</u-radio-group>
</view>
</view>
<view class="" style="display: flex; flex-direction: row; align-items: center">
<view class="">
<view class="" style="margin-left: 30rpx; color: #9c9c9c"> 巡检点检记录:</view>
</view>
<view class="" style="width: 60%; margin-left: 10rpx">
<u-input v-model="item.records" :placeholder="'请输入巡检点检记录'" :class="{ error: item.numberNeedSwitch && !item.records }" />
</view>
</view>
<view class="image" style="margin-top: 20rpx">
<view class="image-list" :key="refreshKey">
<view class="image-item" v-for="(element, index) in item.imgList" :key="index">
<image :src="element" mode=""></image>
<u-icon name="close-circle-fill" color="red" class="close" size="36" @click="delImage(index)"> </u-icon>
</view>
</view>
<view class="image-item image-item1" @click="chooseImage(item)">
<image src="../../static/images/photo.png" mode=""></image>
</view>
</view>
</u-col>
</u-row>
</view>
</view>
</view>
</view>
</view>
<view class="footer">
<view class="btns">
<u-button type="primary" @click="submit()" :loading="loading" :disabled="loading">验证</u-button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom)"></view>
</view>
<!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">意见</view>
<view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view>
<view class="popup-footer">
<view class="sure" @click="apply('APPROVEPASS')">通过</view>
<view class="reject" @click="apply('APPROVEREJECTED')" style="color: red">驳回</view>
</view>
</u-popup>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom)"></view>
<u-select v-model="singleColumnShow" mode="single-column" :default-value="singleColumnDefaultValue" :list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
</view>
</template>
<script setup lang="ts">
import { onLoad, onShow } from '@dcloudio/uni-app'
import { ref, getCurrentInstance } from 'vue'
import * as dictApi from '@/api/dict'
import * as repairOrderApi from '@/api/repairOrder'
import { useCountStore } from '@/store'
import * as spotCheckOrderApi from '@/api/spotCheckOrder'
import * as uploadApi from '@/api/upload'
const { proxy } = getCurrentInstance()
// store
const store = useCountStore()
const list = ref([
{
name: '设备信息',
value: 1
},
{
name: '维修内容',
value: 2
}
])
const current = ref(0)
const changeItem = ref({
name: '设备信息',
value: 1
})
const subList = ref([])
const data = ref({})
const loading = ref(false)
const loading1 = ref(false)
const type = ref('')
const serviceList = ref([])
const isShowSuccess = ref(false)
const isVerifyShowSuccess = ref(false) //
const isApplyShowSuccess = ref(false) //
const orderCompleteResult = ref([]) //
const result = ref('TEMPORARILY')
const data1 = ref('')
const number = ref('')
const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([])
const singleColumnList = ref([])
const field = ref('')
const maintenanceShift = ref([]) //
const faultType = ref([]) //
const imgList = ref([])
const refreshKey = ref(0)
function change(index) {
current.value = index
changeItem.value = list.value[current.value]
}
//
function addSubForm(clickType, item) {
if (data.value.status == 'APPLYPASS' || data.value.status == 'COMPLETED') {
return
}
if (data.value.status == 'PENDING') {
proxy.$modal.showToast('请先接单')
return
}
if (clickType == 'updata') {
proxy.$tab.navigateTo(`/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}&deviceNumber=${data.value.deviceNumber}`)
} else {
proxy.$tab.navigateTo(`/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&deviceNumber=${data.value.deviceNumber}`)
}
}
function submit() {
if (!data.value.describes) {
proxy.$modal.showToast('请输入点检描述')
return
}
if (!data.value.classesName) {
proxy.$modal.showToast('请选择班次')
return
}
const submitData = {
id: data.value.id,
describes: data.value.describes,
deviceNumber: data.value.deviceNumber,
maintenances: data.value.maintenances,
classes: data.value.classes,
subList: subList.value,
type: type.value
}
proxy.$modal.confirm('是否提交?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
spotCheckOrderApi
.orderEditClick(submitData)
.then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('提交成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
if (res.msg) {
proxy.$modal.showToast(res.msg)
} else {
proxy.$modal.showToast('提交失败')
}
loading.value = false
}
})
.catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}
//
function chooseSingleColumn(e) {
data.value[field.value] = e[0].value
if (field.value == 'classes') {
data.value.classesName = e[0].label
}
singleColumnShow.value = false
}
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
data.value.applyContent = null
isVerifyShowSuccess.value = true
spotCheckOrderApi.orderEditClick
}
function cancel() {
data.value.applyContent = null
isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false
}
function radioGroupChange(e) {
result.value = e
}
function sure() {
isShowSuccess.value = false
orderClick(2)
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick()
}
/**
* 审核确认
*/
function apply(status) {
isVerifyShowSuccess.value = false
data.value.status = status
orderClick()
}
//
async function orderClick() {
const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
approveOpinion: data.value.applyContent
}
const tips = '是否确认提交'
proxy.$modal.loading('加载中')
loading.value = true
await spotCheckOrderApi
.orderClickVerify(dataOne, type.value)
.then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
}
})
.catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
function previewImage(index, filePathList) {
uni.previewImage({
current: index, //
urls: filePathList, //
longPressActions: {
itemList: ['保存图片'],
success(data) {
console.log(`选中了第${data.tapIndex}个按钮`)
console.log(`选中了第${data.index}张图片`)
},
fail(err) {
console.log(err.errMsg)
}
}
})
}
//
function delImage(index) {
imgList.value.splice(index, 1)
}
function chooseImage(dataItem) {
uni.chooseImage({
count: 1, // 9
sizeType: ['compressed'], //
sourceType: ['album', 'camera'], //
success: (res) => {
const filePath = res.tempFilePaths[0]
proxy.$modal.loading()
const fileInfo = ref({
name: '',
url: ''
})
uploadApi
.uploadFile({
filePath,
name: 'file',
formData: {
user: 'test'
}
})
.then((ret) => {
if (dataItem.imgList) {
dataItem.imgList.push(ret.data)
fileInfo.value.url = ret.data
dataItem.fileInfoList.push(fileInfo.value)
} else {
dataItem.imgList = [ret.data]
fileInfo.value.url = ret.data
dataItem.fileInfoList = [fileInfo.value]
}
proxy.$modal.closeLoading()
})
.catch((err) => {
proxy.$modal.closeLoading()
})
}
})
}
//
function openSingleColumn(fieldName, val, list) {
singleColumnList.value = list
field.value = fieldName
if (val) {
singleColumnDefaultValue.value = [list.findIndex((item) => item.value == val)]
} else {
singleColumnDefaultValue.value = []
}
singleColumnShow.value = true
}
async function getDeviceRepairDetail(number) {
await repairOrderApi
.getDeviceRepairDetail(number, type.value)
.then((res) => {
proxy.$modal.closeLoading()
data.value = res.data
if (res.data) {
}
loading.value = false
})
.catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
onLoad(async (option) => {
if (option.data) {
data.value = JSON.parse(decodeURIComponent(option.data))
}
if (option.type) type.value = option.type
if (option.number) {
number.value = option.number
selectListByNumber()
}
maintenanceShift.value = await dictApi.getDict('maintenance_shift')
changeItem.value = list.value[current.value]
orderCompleteResult.value = await dictApi.getDict('order_complete_result')
})
onShow(async () => {
if (number.value) {
list.value = [
{
name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1
},
{
name: '点检项内容',
value: 2
}
]
} else {
list.value = [
{
name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1
},
{
name: '点检项内容',
value: 2
}
]
}
maintenanceShift.value = await dictApi.getDict('maintenance_shift')
faultType.value = await dictApi.getDict('fault_type')
})
function selectListByNumber() {
const data = {
number: number.value
}
spotCheckOrderApi
.selectListByNumber(data, type.value)
.then((res) => {
if (res.data) {
subList.value = res.data
}
})
.catch(() => {})
}
</script>
<style lang="scss" scoped>
.detail-container {
min-height: 100vh;
background: white;
}
.line {
background: #f5f5f5;
height: 20rpx;
}
.info {
background: white;
}
.tab {
border-bottom: 1px solid #e4e4e4;
}
.title {
display: flex;
align-items: center;
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
view {
&:nth-child(1) {
flex: 1;
border-left: 10rpx solid #409eff;
padding-left: 20rpx;
font-weight: bold;
}
}
}
.dec {
padding: 30rpx;
.dec-item {
padding-bottom: 30rpx;
display: flex;
view {
&:nth-child(1) {
width: 160rpx;
}
&:nth-child(2) {
color: #888888;
flex: 1;
width: 0px;
word-wrap: break-word;
}
}
}
}
.dec2 {
padding: 10rpx 30rpx;
display: flex;
view {
&:nth-child(1) {
width: 160rpx;
}
&:nth-child(2) {
color: #888888;
flex: 1;
width: 0px;
word-wrap: break-word;
}
}
}
.items {
margin: 20rpx 30rpx;
border-radius: 12rpx;
background: #f5f5f5;
padding-bottom: 20rpx;
.items-name {
padding: 20rpx;
border-bottom: 1px solid #dedede;
}
.items-dec {
padding: 0px 20rpx;
margin-top: 20rpx;
}
}
.popup-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx;
}
.popup {
width: 600rpx;
padding: 0rpx 60rpx 0rpx;
}
.popup-footer {
display: flex;
border-top: 1px solid #e4e4e4;
view {
line-height: 100rpx;
flex: 1;
text-align: center;
&.sure {
color: #409eff;
}
}
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
background: white;
z-index: 22;
}
.btns {
display: flex;
padding: 20rpx;
box-shadow: 0px -2rpx 20rpx rgba(0, 0, 0, 0.1);
button {
flex: 1;
margin: 0px 10rpx;
}
.sure {
background: #409eff;
color: white;
border-radius: 8rpx;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
}
.list {
padding: 20rpx;
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
border-radius: 12rpx;
border: 1px solid #dedede;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
display: flex;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
flex: 1;
}
}
.dec {
color: #9c9c9c;
padding: 0rpx 30rpx 20rpx;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
::v-deep .u-radio-group {
display: grid !important;
padding-bottom: 20rpx;
}
.images {
display: flex;
width: 100%;
image {
width: 30%;
margin-right: 20rpx;
height: 200rpx;
border-radius: 10rpx;
}
}
.select {
display: flex;
align-items: center;
height: 72rpx;
width: 100%;
.input {
flex: 1;
font-size: 28rpx;
color: #000000;
}
.placeholder {
flex: 1;
font-size: 28rpx;
color: rgb(192, 196, 204);
}
}
.images {
.preview-image {
width: 30%;
margin-right: 20rpx;
height: 200rpx;
border-radius: 10rpx;
cursor: pointer; //
}
}
.image {
padding: 0px 30rpx;
padding-bottom: 30rpx;
display: flex;
align-items: center;
flex-wrap: wrap;
.image-list {
display: flex;
align-items: center;
flex-wrap: wrap;
}
}
.image-item {
width: 210rpx;
height: 210rpx;
margin-right: 20rpx;
position: relative;
border: 1px solid rgba(230, 230, 230, 0.5);
margin-bottom: 20rpx;
border-radius: 20rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
.close {
position: absolute;
right: 0px;
top: 0px;
}
}
.image-item1 {
border: none;
margin-right: 0px;
image {
width: 100%;
height: 100%;
}
}
</style>

456
src/pages/spotCheckOrder/index.vue

@ -1,240 +1,232 @@
<template>
<!-- 点检工单 -->
<view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="点检工单">
<template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-spot-inspection-record-main:createAPP'))||(params.type=='MOLD'&&$auth.hasPermi('eam:mold-spot-inspection-record-main:createAPP'))||(params.type=='TECH'&&$auth.hasPermi('eam:tech-spot-inspection-record-main:createAPP'))"></u-icon>
</template>
</u-navbar>
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" >
<view class="" @click="itemClick(item,index)">
<view class="title">
<view class="title-txt">
{{item.describes}}
</view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/>
<u-tag text="已转办" v-else-if="item.status=='TRANSFERRED'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/>
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/>
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/>
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
<u-tag text="审核通过" v-else-if="item.status=='APPROVEPASS'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
<u-tag text="审核不通过" v-else-if="item.status=='APPROVEREJECTED'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/>
</view>
<view class="dec">
工单单号:<span>{{item.number}}</span>
</view>
<view class="dec">
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="dec">
班次:<span>{{item.classesName}}</span>
</view>
<view class="dec">
点检人:<span>{{item.maintenanceName}}</span>
</view>
</view>
<view class="bottom">
<view class="time" style="flex: 1;">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<!-- 点检工单 -->
<view class="container">
<u-navbar back-icon-color="#fff" :background="{ background: '#409eff' }" back-text="" title-color="#fff" title="点检工单">
<template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx" @click="addForm" v-if="(params.type == 'DEVICE' && $auth.hasPermi('eam:device-spot-inspection-record-main:createAPP')) || (params.type == 'MOLD' && $auth.hasPermi('eam:mold-spot-inspection-record-main:createAPP')) || (params.type == 'TECH' && $auth.hasPermi('eam:tech-spot-inspection-record-main:createAPP'))"></u-icon>
</template>
</u-navbar>
<view class="list">
<view class="item" v-for="(item, index) in list" :key="index">
<view class="" @click="itemClick(item, index)">
<view class="title">
<view class="title-txt">
{{ item.describes }}
</view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color="rgba(255,255,255,0)" color="#fe8463" border-color="#fe8463" type="primary" shape="circle" />
<u-tag text="已撤回" v-else-if="item.status == 'REJECTED'" bg-color="rgba(255,255,255,0)" color="#d7d7d7" border-color="#d7d7d7 " type="warning" shape="circle" />
<u-tag text="已转办" v-else-if="item.status == 'TRANSFERRED'" bg-color="rgba(255,255,255,0)" color="#e01f54" border-color="#e01f54" type="success" shape="circle" />
<u-tag text="已接单" v-else-if="item.status == 'PECEIVED'" bg-color="rgba(255,255,255,0)" color="#005eaa" border-color="#005eaa " type="error" shape="circle" />
<u-tag text="已验证" v-else-if="item.status == 'VERIFIED'" bg-color="rgba(255,255,255,0)" color="#2EC7C9" border-color="#2EC7C9" type="info" shape="circle" />
<u-tag text="已完成" v-else-if="item.status == 'COMPLETED'" bg-color="rgba(255,255,255,0)" color="#2ba471" border-color="#2ba471" type="info" shape="circle" />
<u-tag text="审核通过" v-else-if="item.status == 'APPROVEPASS'" bg-color="rgba(255,255,255,0)" color="#2ba471" border-color="#2ba471" type="info" shape="circle" />
<u-tag text="审核不通过" v-else-if="item.status == 'APPROVEREJECTED'" bg-color="rgba(255,255,255,0)" color="#e01f54" border-color="#e01f54" type="success" shape="circle" />
</view>
<view class="dec">
工单单号:<span>{{ item.number }}</span>
</view>
<view class="dec">
类型:<span>{{ item.type == 'DEVICE' ? '设备' : item.type == 'TECH' ? '工艺' : '模具' }}</span>
</view>
<view class="dec">
{{ `${params.type == 'DEVICE' ? '设备' : '模具'}` }}编号:<span>{{ item.deviceNumber }}</span>
</view>
<view class="dec">
{{ `${params.type == 'DEVICE' ? '设备' : '模具'}` }}名称:<span>{{ item.name }}</span>
</view>
<view class="dec">
所属厂区:<span>{{ item.factoryAreaName }}</span>
</view>
<view class="dec">
班次:<span>{{ item.classesName }}</span>
</view>
<view class="dec">
点检人:<span>{{ item.maintenanceName }}</span>
</view>
</view>
<view class="bottom">
<view class="time" style="flex: 1">
{{ `${$time.formatDate(item.createTime)}` }}
</view>
</view>
</view>
</view>
<view style="height: 94rpx; padding-top: 30rpx">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom)"></view>
</view>
</template>
<script setup lang="ts">
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance,
nextTick
} from 'vue'
import * as spotCheckOrderApi from "@/api/spotCheckOrder"
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
// store
const store = useCountStore()
const params = ref({
pageNo: 1,
pageSize: 10,
type: '',
})
const status = ref('loadmore') //
const list = ref([])
function itemClick(item, index) {
proxy.$tab.navigateTo(`/pages/spotCheckOrder/detail?type=${params.value.type}&number=${item.number}&data=${encodeURIComponent(JSON.stringify(item))}`)
}
function addForm(item) {
proxy.$tab.navigateTo(`/pages/spotCheckOrder/addForm?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
}
async function getList() {
if (status.value == 'nomore') return;
status.value = 'loading';
proxy.$modal.loading('加载中')
await spotCheckOrderApi.spotCheckOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list);
params.value.pageNo++;
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
onLoad((option) => {
if (option.type) params.value.type = option.type;
if (option.flag) params.value.flag = option.flag;
})
onShow(() => {
params.value.pageNo = 1
list.value = []
status.value = 'loadmore'
getList()
})
onReachBottom(() => {
getList()
})
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'
import { ref, getCurrentInstance, nextTick } from 'vue'
import * as spotCheckOrderApi from '@/api/spotCheckOrder'
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
// store
const store = useCountStore()
const params = ref({
pageNo: 1,
pageSize: 10,
type: ''
})
const status = ref('loadmore') //
const list = ref([])
function itemClick(item, index) {
if (item.status == 'PENDING') {
proxy.$tab.navigateTo(`/pages/spotCheckOrder/detailAndEdit?type=${params.value.type}&number=${item.number}&data=${encodeURIComponent(JSON.stringify(item))}`)
} else {
proxy.$tab.navigateTo(`/pages/spotCheckOrder/detail?type=${params.value.type}&number=${item.number}&data=${encodeURIComponent(JSON.stringify(item))}`)
}
}
function addForm(item) {
proxy.$tab.navigateTo(`/pages/spotCheckOrder/addForm?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
}
async function getList() {
if (status.value == 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
await spotCheckOrderApi
.spotCheckOrderPage(params.value, params.value.type)
.then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list)
params.value.pageNo++
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
})
.catch(() => {
proxy.$modal.closeLoading()
})
}
onLoad((option) => {
if (option.type) params.value.type = option.type
if (option.flag) params.value.flag = option.flag
})
onShow(() => {
params.value.pageNo = 1
list.value = []
status.value = 'loadmore'
getList()
})
onReachBottom(() => {
getList()
})
</script>
<style lang="scss" scoped>
.container{
background: #f5f5f5;
min-height: 100vh;
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
word-wrap: break-word;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
}
}
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
position: relative;
.button {
position: absolute;
right: 0rpx;
}
}
}
}
.container {
background: #f5f5f5;
min-height: 100vh;
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
word-wrap: break-word;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #e4e4e4;
padding: 20rpx 0px;
}
}
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #e4e4e4;
padding: 20rpx 0px;
position: relative;
.button {
position: absolute;
right: 0rpx;
}
}
}
}
</style>
Loading…
Cancel
Save