You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

409 lines
13 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!-- 扫描rfid,选择缓存区根据选择的缓存区查询库位勾选是否取走托盘提交托盘变更信息 -->
<template>
<view class="page-product-receipt">
<view class="header" :style="{ backgroundColor: `rgba(250, 53, 52, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="goback()" />
</view>
<view class="title">巡检</view>
<view class="right">
<!-- <u-icon name="setting-fill"> </u-icon> -->
</view>
</view>
<u-tabs name="cate_name" count="cate_count" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
<div class="singlebox">
<view class="single-left" style="background-color: #ffffff">
<!-- <view>扫描设备码:</view> -->
<u-search style="" placeholder="请扫描" @search="search(orderNo)" :focus="shouciFocus" v-model="orderNo" :show-action="false"> </u-search>
<uni-icons class="Scan" type="scan" size="22" @click="scanCodeOne" style="color: black; background-color: #0b9eff; margin: auto; padding: 22rpx"></uni-icons>
</view>
<view class="single-left" style="background-color: #ffffff; margin-top: 10px; display: flex; align-items: center">
<view style="margin-right: 10px">日期:</view>
<u-input @click="onfocus" placeholder="请选择日期" v-model="createTime" />
<u-icon name="close-circle-fill" @click="clear" color="rgb(96, 98, 102)" size="28"></u-icon>
</view>
</div>
<view class="list" v-show="current == 0" v-for="(item, index) in listdata" :key="index + 'a'" @click="linkdetails(item, isorderNo)">
<div class="list-top">
<div class="name">工单号: {{ item.orderCode }}</div>
<div class="tag">{{ item.orderStatus == 0 ? '进行中' : item.orderStatus == 1 ? '已完成' : '已逾期' }}</div>
<u-icon @click="linkdetails(item, isorderNo)" name="arrow-right" color="#2979ff" size="28"></u-icon>
</div>
<div class="item1" style="color: red">设备编码:{{ item.equipmentCode }}</div>
<div class="item1" style="color: red">设备名称:{{ item.equipmentName }}</div>
<div class="item1">车间编码: {{ item.planWorkshop }}</div>
<div class="item1" style="color: red">周期: {{ item.planLoop }}{{ item.planLoopType == 'month' ? '月' : item.planLoopType == 'day' ? '日' : item.planLoopType == 'year' ? '年' : '周' }}</div>
<div class="item1">循环执行时间开始: {{ item.planLoopStart }}</div>
<div class="item1">循环执行时间结束: {{ item.planLoopEnd }}</div>
</view>
<view class="list" v-show="current != 0" v-for="(item, index) in detailsdata" :key="index + 'b'" @click="linkdetailscheck(item, isorderNo)">
<div class="list-top">
<div class="name">工单号: {{ item.orderCode }}</div>
<div class="tag">{{ item.orderStatus == 0 ? '进行中' : item.orderStatus == 1 ? '已完成' : '已逾期' }}</div>
<u-icon @click="linkdetailscheck(item, isorderNo)" name="arrow-right" color="#2979ff" size="28"></u-icon>
</div>
<div class="item1" style="color: red">设备编码:{{ item.equipmentCode }}</div>
<div class="item1" style="color: red">设备名称:{{ item.equipmentName }}</div>
<div class="item1">车间编码: {{ item.planWorkshop }}</div>
<div class="item1" style="color: red">周期: {{ item.planLoop }}{{ item.planLoopType == 'month' ? '月' : item.planLoopType == 'day' ? '日' : item.planLoopType == 'year' ? '年' : '周' }}</div>
<div class="item1">循环执行时间开始: {{ item.planLoopStart }}</div>
<div class="item1">循环执行时间结束: {{ item.planLoopEnd }}</div>
</view>
<u-toast ref="uToast" />
<Attrssetup sureColor="#ff0000" ref="attrssetup1" showKey="label" valKey="value" />
<u-calendar v-model="iscalendar" :mode="mode" @change="changetime"></u-calendar>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import chooseOne from '@/components/choose-one/choose-one.vue';
import jPicker from '@/components/J-Picker/jPicker.vue';
import model1 from '../../equipment/Repairbx/model';
const mpaasScanModule: any = uni.requireNativePlugin('Mpaas-Scan-Module');
import Attrssetup from '@/components/attrs-setup/attrs-setup.vue';
import moment from 'moment';
// import { session } from '@/store/modules/session';
//import store from '@/store';
@Component({
components: {
chooseOne,
jPicker,
Attrssetup,
},
})
export default class ChangePalletNew extends BasePage {
model = model;
model1 = model1;
list: any = [
{
cate_name: '',
},
{
cate_name: '',
},
];
current: any = 0;
moren = '选择缓存区';
shouciFocus = true;
zaiciFocus = false;
ischecked = false;
isattrssetup = false;
iscalendar = false;
mode = 'date';
createTime: any = null;
switchListText = [
{
title: '',
value: 0,
},
{
title: '',
value: 1,
},
];
listdata: any = [];
detailsdata: any = [];
orderNoItemList: any = {};
productCodeList: any = {};
productCodelocList: any = {};
detailsdataceshi: any = [
{
itemq: '1',
item2: '',
item3: '2023-08-01 - 2023-08-31',
item4: '',
item5: 'XXXXX',
item6: '',
},
{
itemq: '1',
item2: '',
item3: '2023-08-01 - 2023-08-31',
item4: '',
item5: 'XXXXX',
item6: '',
},
];
userinfo: any = null;
isorderNo: any = null;
// remove: any = {};
async onShow() {
this.createTime = moment().format('YYYY-MM-DD');
console.log(uni.getStorageSync('userinfo'));
this.userinfo = uni.getStorageSync('userinfo');
if (this.userinfo) {
let query = {
userId: this.userinfo.userName,
createTime: this.createTime,
//createTime: '',
};
await this.model.getTodayTask(query);
this.listdata = model.orderNoItemList;
}
}
async onReady() {
this.createTime = moment().format('YYYY-MM-DD');
//await this.model.getpalletLocation();
//this.remove = this.model.WlList[0];
}
//
scanCodeOne() {
// http://lj08.cn/21201501124240221021300171390045
mpaasScanModule.mpaasScan(
{
// qrCodebarCode
//
scanType: ['qrCode', 'barCode'],
// false
hideAlbum: false,
},
(ret) => {
// uni.showModal({
// title: '扫码结果',
// // 返回值中,有三个参数 resp_code、resp_message、resp_result
// // resp_code 表示返回结果值10用户取消11其他错误1000成功
// // resp_message 表示返回结果信息
// // resp_result 表示扫码结果,只有成功才会有返回
// content: JSON.stringify(ret),
// showCancel: false,
// confirmText: '确定',
// });
if (ret.resp_message == 'success') {
this.orderNo = ret.resp_result;
this.search(this.orderNo);
} else {
this.customToast(ret.resp_result);
}
},
);
}
clear() {
this.createTime = null;
}
async onLoad() {
// console.log(uni.getStorageSync('userinfo'));
}
search(value) {
let data = [];
if (this.current == 0) {
data = this.listdata.filter((v) => v.equipmentCode == value);
} else {
data = this.detailsdata.filter((v) => v.equipmentCode == value);
}
if (data.length == 0) {
(this.$refs.uToast as any).show({
title: '当前设备无点检任务',
type: 'default',
});
return;
} else {
data[0].orderNoinput = value;
if (this.current == 0) {
this.linkdetails(data[0], value);
} else {
this.linkdetailscheck(data[0], value);
}
}
}
onfocus() {
this.iscalendar = true;
}
async changetime(e) {
console.log(e);
this.createTime = e.result;
if (this.current == 0) {
if (this.userinfo) {
let query = {
userId: this.userinfo.userName,
createTime: this.createTime,
//createTime: '',
};
await this.model.getTodayTask(query);
this.listdata = model.orderNoItemList;
}
} else {
if (this.userinfo) {
let query = {
userId: this.userinfo.userName,
createTime: this.createTime,
//createTime: '',
};
await this.model.getTaskRecord(query);
this.detailsdata = model.getTaskRecordList;
}
}
// this.tagslist = JSON.parse(JSON.stringify(item.babtype));
// this.tagslistcopy = JSON.parse(JSON.stringify(item.babtype));
}
// selectItem(e: any) {
// this.remove = e.pickerName;
// }
orderNo: any = '';
location: any = '';
locationStatus: any = 1;
//
async change(index) {
this.current = index;
if (index == 0) {
if (this.userinfo) {
let query = {
userId: this.userinfo.userName,
createTime: this.createTime,
//createTime: '',
};
await this.model.getTodayTask(query);
this.listdata = model.orderNoItemList;
}
} else {
if (this.userinfo) {
let query = {
userId: this.userinfo.userName,
createTime: this.createTime,
//createTime: '',
};
await this.model.getTaskRecord(query);
this.detailsdata = model.getTaskRecordList;
}
}
}
goback() {
uni.navigateTo({
url: `/pages/equipment/index`,
});
}
linkdetails(item, value) {
if (this.model1.rowdata) {
this.model1.rowdatanull();
}
uni.navigateTo({
url: `/pages/equipment/Inspection/details?listitem=` + encodeURIComponent(JSON.stringify(item)) + '&equipmentCode=' + value,
});
}
linkdetailscheck(item, value) {
if (this.model1.rowdata) {
this.model1.rowdatanull();
}
this.ischecked = true;
item.ischecked = true;
uni.navigateTo({
url: `/pages/equipment/Inspection/detailsview?listitem=` + encodeURIComponent(JSON.stringify(item)) + '&equipmentCode=' + value,
});
}
}
</script>
<style lang="scss" scoped>
.page-product-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #f8262c 51%, #d9001b 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.singlebox {
margin-top: 10px;
background-color: #fff;
padding: 10px;
border-radius: 5px;
box-shadow: 0 0 10px 0 rgba(128, 128, 128, 0.2);
}
.single-left {
display: flex;
.Scan {
border-radius: 6px;
}
}
.header {
position: fixed;
top: 0rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 120rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
padding: 45rpx 0rpx 0rpx;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.quest {
width: 367px;
border-radius: 5px;
border: rgba(121, 121, 121, 1) solid 1px;
background-color: #ffffff;
padding: 7px 8px 7px 12px;
box-sizing: border-box;
text-align: center;
font-size: 18px;
font-weight: 600;
color: black;
}
.list {
margin-top: 15px;
width: 367px;
border-radius: 5px;
border: rgba(121, 121, 121, 1) solid 1px;
background-color: #ffffff;
padding: 7px 8px 7px 8px;
box-sizing: border-box;
.list-top {
display: flex;
justify-content: space-between;
position: relative;
height: 24px;
align-items: center;
margin-bottom: 10px;
.name {
font-weight: 600;
font-size: 15px;
}
.tag {
width: 71px;
height: 24px;
border-radius: 5px;
text-align: center;
line-height: 24px;
// box-shadow: 0 1rpx 20rpx 0 #54B0D7;
border: 2px solid #54b0d7;
position: absolute;
right: 18px;
color: #54b0d7;
}
.tag1 {
border: 2px solid #83c874;
color: #83c874;
}
}
.item1 {
margin-bottom: 10px;
white-space: 1px;
}
}
::v-deep .yjy-switch-container .yjy-switch-item {
width: 100%;
}
::v-deep .yjy-switch-container {
width: 50%;
}
}
</style>