Files
GX.O3.WMS/APK/APP_O3/pages/views/EQUM06/EQUM06.vue
T

810 lines
20 KiB
Vue
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="content">
<opsoft-dialog-notice
:dialogNoticeShow="showDialog"
:dialogNoticeType="dialogNoticeType"
:dialogNoticeTitle="dialogNoticeTitle"
:dialogNoticeContent="dialogNoticeContent"
@dialogNoticeConfirmClick="dialogNoticeConfirmClick"
>
</opsoft-dialog-notice>
<view class="header-row-class-organzie" v-if="isShowOrg">
<view class="header-row-title-class-organzie">当前组织:</view>
<picker @change="orgChange" :value="index" :range="orgArry" range-key="FNAME">
<view class="head-row-content-class-organzie">{{orgArry[index].FNAME}}</view>
</picker>
<image class="img-organzie" src="../../../static/img/changearrow.svg"></image>
</view>
<view class="search">
<!-- <text class="search-title">设备搜索:</text> -->
<input class="search-input" placeholder="输入设备代码" v-model="searchEquipment" focus="focus"
@confirm="search(pageSize, searchEquipment)"></input>
<image class="search-img" style="height: 40rpx;width: 40rpx;position: absolute;top: 20rpx;"
src="../../../static/emapp/scan.png" @click="scanClick()"></image>
</view>
<view style="height: 10rpx;"></view>
<text class="detail-row-content-class" v-if="taskList.length==0">您当前没有任务</text>
<view class="work-center-item" v-for="(item,index) in taskList" :key="index">
<view class="container" @touchstart="touchS($event,index)"
@touchmove="touchM($event,index)" @touchend="touchE($event,index)"
:style="{'left': (currIndex==index?leftStyle + 'rpx':'')}">
<view class="card-list">
<view class="card-info" @tap="itemClick(item)">
<view class="card-info-title">
<view class="card-info-item">
<text class="card-info-title-text-left">设备名称:</text>
<text class="card-info-title-text-detail-left" style="font-size: 24rpx;">{{item.FMACHINENAME}}</text>
</view>
<view class="card-info-title-text-right">
<text class="status-red-text" v-show="item.FISFINISHED==false">未验收</text>
<!-- <view class="status-red" v-show="item.FIsFinished==false"></view> -->
<text class="status-green-text" v-show="item.FISFINISHED==true">已验收</text>
<!-- <view class="status-green" v-show="item.FIsFinished==true"></view> -->
</view>
</view>
<view class="card-info-item">
<text class="card-info-item-text">设备代码:</text>
<text class="card-info-item-text-detail">{{item.FMACHINENUMBER}}</text>
</view>
<view class="card-info-item">
<text class="card-info-item-text">工单编号:</text>
<text class="card-info-item-text-detail">{{item.FBILLNO}}</text>
</view>
<view class="card-info-item">
<text class="card-info-item-text">项目名称:</text>
<text class="card-info-item-text-detail">{{item.FNAME}}</text>
</view>
<view class="card-info-item">
<text class="card-info-item-text">工单日期:</text>
<text class="card-info-item-text-detail">{{item.FDATE}}</text>
</view>
</view>
</view>
<view class="delete-icon" @click="delItem(index)">
删除
</view>
</view>
</view>
<view style="height: 10rpx;"></view>
</view>
</template>
<script>
import DateTimePicker from '@/components/bory-dateTimePicker/bory-dateTimePicker.vue';
import imgUpload from '@/components/poiuy-uImgUpload/imgUpload.vue';
import { pathToBase64, base64ToPath } from '@/js_sdk/mmmm-image-tools/index.js';
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
import errorStrUntil from '@/common/errorStrUntil.js';
import Vue from 'vue';
import {
mapState,
mapMutations
} from 'vuex';
export default {
data() {
return {
dialogNoticeContent:'',
dialogNoticeTitle:'',
dialogNoticeType:'',
showDialog:false,
focus:true,
leftStyle: 0,
startX: 0,
hiddenFlag: true,
delBtnWidth: 220,
currIndex:'',
scrollTop: 0,
isShowOrg:true,
old: {
scrollTop: 0
},
taskList:[],
pageIndex:1,
pageSize:6,
showTips:false,
searchEquipment:'',
}
},
onShow(){
let count = 0;
let searchEquipment = '';
this.pageIndex = 1;
this.getTaskList(1, this.pageSize, searchEquipment);
this.getOrgList()
},
onPullDownRefresh:function(){
let _self = this;
_self.showTips = false;
this.getTaskList(1, this.pageSize, this.searchEquipment);
setTimeout(()=>{
//停止下拉样式
uni.stopPullDownRefresh();
//隐藏标题读取
uni.hideNavigationBarLoading();
},
500);
},
onReachBottom:function(){
let _self = this;
if(!_self.showTips) {
this.getTaskList(this.pageIndex, this.pageSize, this.searchEquipment);
}
else {
uni.showToast({
icon: 'none',
title: '已经到底了'
});
}
},
onNavigationBarButtonTap:function(e){
this.addShow = true;
this.otherShow = true;
},
computed: {
indicatorStyle() {
return {
background: 'rgba(255,0,0,.2)',
height: '40px',
};
},
...mapState(['userInfo'])
},
components: {
opsoftDialogNotice
},
onBackPress(options) {
if(options.from === 'navigateBack'){
return false;
}
this.back();
return true;
},
methods: {
dialogNoticeConfirmClick(){
this.showDialog = false;
},
dialogNoticeProps(err,type){
err = errorStrUntil.handle(err);
this.showDialog = true;
this.dialogNoticeType = 'error';
this.dialogNoticeTitle = '异常提示';
if(type=='success'){
this.dialogNoticeType = 'success';
this.dialogNoticeTitle = '执行成功';
}
this.dialogNoticeContent = err;
},
getOrgList:function(){
let _self = this;
let orgInfo = uni.getStorageSync('orgInfo');
if(orgInfo && orgInfo.length > 0) {
let defaultOrgInfo = uni.getStorageSync('defaultOrgInfo');
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
if(!isOpenDefaultOrg){
this.orgFItemID = orgInfo[0].FINTERID;
}else{
if(defaultOrgInfo){
this.orgFItemID = defaultOrgInfo.FINTERID;
}else{
this.orgFItemID = orgInfo[0].FINTERID;
}
}
this.orgArry = orgInfo;
this.orgArry.forEach(
function(el,index){
let currentOrgid = el.FINTERID;
let result = (currentOrgid == _self.orgFItemID);
if(result){
_self.index = index;
}
}
);
}else{
this.orgArry = [{name:"请选择组织", key:"", FNAME:"当前无组织"}];
this.index = 0;
}
},
orgChange:function(e){
console.log(this.orgArry)
this.index = e.target.value;
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
if(!this.orgArry[this.index].FItemID){
this.orgFItemID = "";
}else{
this.orgFItemID = this.orgArry[this.index].FItemID;
if(isOpenDefaultOrg){
uni.setStorageSync('defaultOrgInfo',this.orgArry[this.index]);
}
}
console.log(this.orgFItemID);
this.orgChangedClear();
},
showOrg:function(){
let userID = this.userInfo.token;
let currentPage = "MESMT05";
let requestParams = {
"id": userID,
"prgkey": currentPage
};
this.$request.post(
{
data: {
action: 'QueryIsEnableOr',
params: requestParams
}
}
).then(res => {
uni.hideLoading();
this.isShowOrg = JSON.parse(res);
if(!this.isShowOrg){
this.orgFItemID = "";
}
});
},
orgChangedClear:function(){
this.currentBarCodeInfo = new Object();
this.FInvenPlanNO = "";
this.FInvenPlanName = "";
this.currentBarCodeInfo.FBarcodeNumber = "";
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FLocation = "";
this.currentBarCodeInfo.FSCStockNumber = "";
this.currentBarCodeInfo.FSCSPNumber = "";
this.fQtyDisabled = true;
this.showResult = true;
this.fSCSPNumberDisabled = true;
this.scannedDataList = [];
this.totalData = [];
this.barcodeList = [];
this.commitList = [];
this.judgeCash();
this.$forceUpdate();
},
judgeCash:function(){
const cashValue = uni.getStorageSync('pageCash'+this.currentTranType+this.orgFItemID);
if(cashValue) {
if(cashValue.otherInfo.dbAlise == this.userInfo.dbAlise &&
cashValue.otherInfo.UserID == this.userInfo.UserID){
// this.showCashTips = true;
this.loadByCash();
}
}
},
scanClick:function(){
let _self = this;
let count = '';
uni.scanCode({
success:function(res){
_self.searchEquipment = res.result;
_self.getTaskList(1, _self.pageSize, _self.searchEquipment);
}
})
},
search:function(pageSize, searchEquipment){
this.getTaskList(1, pageSize, searchEquipment);
},
back() {
uni.redirectTo({
url:'../../tabbar/apply/apply'
})
},
getTaskList: function(index, size, searchEquipment) {
let _self = this;
let userID = this.userInfo.UserID;
this.orgid = uni.getStorageSync('orgid')
this.pageIndex = index;
let requestParams = {
"fNO":searchEquipment?searchEquipment:'',
"PageNumber": this.pageIndex,
"BarNumber": size,
"basicType":1,
"statusType":2
};
this.$request.get('/RepairOreder/RepairOrder',{
params:requestParams
}).then(res => {
let data = res;
if(_self.pageIndex == 1) {
_self.taskList = data;
_self.pageIndex = _self.pageIndex+1;
}
else {
if(data.length != 0) {
let newArray = _self.taskList.concat(data);
_self.taskList = newArray;
_self.pageIndex = _self.pageIndex+1;
if(data.length < 6) {
_self.showTips = true;
}
} else {
_self.showTips = true;
}
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
itemClick: function(item){
uni.setStorageSync('firstPageAcceptenceCurItemInfoRepair',item);
uni.navigateTo({
url: '../../views/EQUM06/EQUM06Item?FIsFinished='+item.FISFINISHED+"&FBillNO="+item.FBILLNO
});
},
delItem:function(index){
let userID = this.userInfo.UserID;
let requestParams = {
"id": userID,
"basicType":1,
"repair":1,
"fID":this.taskList[index].FInterID,
};
this.$request.post({
data: {
action: 'DelOrder',
params: requestParams
}
}).then(res => {
// let data = JSON.parse(res);
this.taskList.splice(index,1);
this.leftStyle = 0;
uni.showToast({
title:"删除成功",
icon:'none'
})
this.$forceUpdate();
});
},
// 开始移动时
touchS($event,index) {
// startX记录开始移动的位置
console.log($event);
console.log(index);
this.currIndex = index;
if($event.touches.length === 1) {
this.startX = $event.touches[0].clientX;
}
// hiddenFlag为true则是从右向左,为false则是从左向右
if(this.leftStyle === 0) {
this.hiddenFlag = true;
} else {
this.hiddenFlag = false;
}
},
touchM($event,index) {
if($event.touches.length === 1) {
//手指移动时水平方向位置
const moveX = $event.touches[0].clientX;
this.moveFunc(moveX);
}
},
touchE($event,index) {
const { leftStyle } = this;
const { delBtnWidth } = this;
// 如果停止滑动的距离大于二分之一则直接弹出删除按钮,不然则left为0
if(-leftStyle > delBtnWidth/2) {
this.leftStyle = -delBtnWidth;
} else {
this.leftStyle = 0;
}
},
moveFunc(moveX) {
// 原始位置向左,leftStyle为小于0;原始位置向右,leftStyle为大于0
// disX为相对最初位置的左右距离
// 大于0为向右,小于0为向左
const disX = moveX - this.startX;
const delBtnWidth = this.delBtnWidth;
let offsetNum = 0;
if(-disX >= delBtnWidth && this.leftStyle === -delBtnWidth) {
return;
}
console.log(disX, this.hiddenFlag);
// this.hiddenFlag为true则是从左到右,则应该将container向左移动
// this.hiddenFlag为false则是从右向左,则应该将container向右移动
if(this.hiddenFlag) {
// 此时container为最右边,则应该将container向左移动
// disX大于0为相对原始位置的向右移动,则直接将offsetNum置为0
// 否则为向左移动,offsetNum为disX相反的值,判断是否超过设置的最大位置
if(disX == 0 || disX > 0) {
offsetNum = 0;
} else {
offsetNum = disX;
if (disX <= -delBtnWidth) {
//控制手指移动距离最大值为删除按钮的宽度
offsetNum = -delBtnWidth;
}
}
} else {
// 此时container为最左边,应该向右移动
// disX小于0为相对原始位置的向左移动,则直接将offsetNum置为-this.delBtnWidth
// 否则为相对原始位置的向右移动,此时应该将最大位置与向右位置的差值为此刻位置,判断是否为大于0
if(disX < 0) {
offsetNum = -this.delBtnWidth;
} else {
offsetNum = -this.delBtnWidth + disX;
if(offsetNum > 0) {
offsetNum = 0;
}
}
}
this.leftStyle = offsetNum;
},
}
}
</script>
<style lang="scss">
.content {
// height: 100%;
background-color: #F5F5F5;
// display: flex;
// flex-direction:column;
// flex-wrap: nowrap;
// justify-content: flex-start;
overflow-x: hidden;
}
.top-row-title-class{
text-align: end;
font-size: 30rpx;
font-style: auto;
color: #666666;
flex-shrink: 0;
flex-grow: 0;
line-height: 50rpx;
height: 50rpx;
width: 150rpx;
}
.top-row-title-class-add{
font-size: 30rpx;
font-style: auto;
color: #666666;
flex-shrink: 0;
flex-grow: 0;
line-height: 50rpx;
height: 50rpx;
}
.selCondition{
width: 100%;
}
.selCondition-date{
width: 100%;
color: #666666;
padding: 5rpx 10rpx;
font-size:28rpx;
border: 1px solid #D8D8D8;
border-radius: 10rpx;
}
.selCondition-alter{
width: 100%;
color: #666666;
border: 1px solid #D8D8D8;
height: 60rpx; line-height: 60rpx;
border-radius: 10rpx;
padding: 5rpx 10rpx;
white-space:pre-wrap;
word-wrap:break-word;
}
.top-row-input-class{
position: relative;
font-size: 30rpx;
color: #6B6B6B;
width: 100%;
padding-left: 15rpx;
padding-right: 15rpx;
border-radius: 10rpx;
border: 1px solid #D8D8D8;
height: 60rpx; line-height: 60rpx;
}
.scanImg{
height: 40rpx;
width: 40rpx;
position: absolute;
right: 80rpx;
}
.img-arrow{
height: 40rpx;
width: 40rpx;
// position: fixed;
// right: 56rpx;
}
.detail-table-class{
margin-top: 10rpx;
margin-left: 32rpx;
margin-right: 32rpx;
margin-bottom: 34rpx;
background-color: #FFFFFF;
border-radius:10rpx;
padding-left: 24rpx;
// padding-right: 24rpx;
padding-bottom: 16rpx;
display: flex;
flex-direction:row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
flex-shrink: 0;
flex-grow: 0;
position: relative;
}
.detail-row0-class{
height: 64rpx;
line-height: 64rpx;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
}
.detail-row-title0-class{
// width: auto;
flex-shrink: 1;
flex-grow: 1;
height: 34rpx;
font-size: 26rpx;
font-family: MicrosoftYaHei;
color: #3D3D3D;
line-height: 34rpx;
}
.detail-line-class{
background-color: #F8F8F8;
height: 1px;
}
.detail-row-class{
display: flex;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
font-size: 24rpx;
font-family: MicrosoftYaHei;
color: #505050;
height: 48rpx;
}
.detail-row-title-class{
color: #8F8F8F;
width: 120rpx;
text-align: end;
flex-shrink: 0;
flex-grow: 0;
}
.detail-row-content-class{
color: #505050;
flex-shrink: 1;
flex-grow: 1;
}
.detail-row-content-green-class{
flex-shrink: 0;
flex-grow: 0;
font-size: 28rpx;
font-style: auto;
color: #5EC02D;
font-weight: 1000;
width: 90rpx;
margin-left: 5rpx;
}
.detail-row-content-yellow-class{
flex-shrink: 0;
flex-grow: 0;
font-size: 28rpx;
font-style: auto;
color: #FAAE12;
font-weight: 1000;
width: 90rpx;
margin-left: 5rpx;
}
.detail-row-content-red-class{
flex-shrink: 0;
flex-grow: 0;
font-size: 28rpx;
font-style: auto;
color: #FF2E2E;
font-weight: 1000;
width: 90rpx;
}
.detail-row-status-green-class{
width: 2px;
height: 15px;
background: #5EC02D;
border-radius: 2px;
margin-left: 10rpx;
}
.detail-row-status-red-class{
width: 2px;
height: 15px;
background: #FF2E2E;
border-radius: 2px;
margin-left: 10rpx;
}
.detail-row-status-yellow-class{
width: 2px;
height: 15px;
background: #FAAE12;
border-radius: 2px;
margin-left: 10rpx;
}
.alter{
position: fixed;
left: 0;
right: 0;
top:0;
bottom: 0;
background-color: #333333;
opacity: 0.5;
}
.uni-input{
display: flex;
border: 1px solid #D8D8D8;
color: #666666;
padding: 5rpx 10rpx;
border-radius: 10rpx;
flex-wrap: nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.confirmBtn{
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
background-color: #2560C9;
position: fixed;
bottom: 0;
}
.sparePart{
// height: 80%;
position: fixed;
left: 0;
right: 0;
bottom: 0;
background-color: #FFFFFF;
}
.container {
position: relative;
/* margin-top: 26rpx; */
}
.delete-icon {
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
right: -175rpx;
width: 130rpx;
height: 62rpx;
line-height: 62rpx;
border-radius: 31rpx;
font-weight: 500;
font-size: 32rpx;
text-align: center;
color: #FFFFFF;
background: #FF1C1C;
}
.alter-inner{
position: fixed;
left: 0;
right: 0;
top:0;
bottom: 0;
background-color: #333333;
opacity: 0.5;
}
.err{
position: fixed;
left: 100rpx;
right: 100rpx;
top: 400rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
opacity: 1;
z-index: 5;
}
.alter-head{
display: flex;
flex-wrap: nowrap;
}
.errTitle{
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: center;
border-bottom: 2rpx solid #3D3D3D;
}
.errTitle-search{
height: 80rpx;
line-height: 80rpx;
width: 100%;
color: #C0C0C0;
font-size: 28rpx;
text-align: center;
border-bottom: 2rpx solid #3D3D3D;
}
.errList{
width: 100%;
margin-left: 30%;
display: flex;
}
.errDetails{
/* width: 90%; */
font-size: 26rpx;
color: #3D3D3D;
}
.errConfirm{
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: center;
color: #007AFF;
border-top: 2rpx solid #3D3D3D;
}
.header-row-class-organzie{
display: flex;
justify-content: flex-end;
align-items: center;
// padding-right: 50rpx;
}
.header-row-title-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.head-row-content-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.img-organzie{
height: 32rpx;
width: 32rpx;
margin-left: 24rpx;
}
</style>