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

387 lines
11 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(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="card-list" v-for="(item,index) in taskList" @tap="itemClick(item)" :key="index">
<view class="card-info">
<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.FMACHINENAME}}</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 style="height: 10rpx;"></view>
</view>
</template>
<script>
import Vue from 'vue';
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
import errorStrUntil from '@/common/errorStrUntil.js';
import {
mapState,
mapMutations
} from 'vuex';
var commonUtil = require('../../../common/util.js');
var _self;
export default {
data() {
return {
dialogNoticeContent:'',
dialogNoticeTitle:'',
dialogNoticeType:'',
showDialog:false,
focus:true,
scrollTop: 0,
isShowOrg:true,
old: {
scrollTop: 0
},
taskList:[],
pageIndex:1,
pageSize:6,
showTips:false,
orgid:'',
searchEquipment:'',
curDate:''
}
},
components: {
opsoftDialogNotice
},
onShow(){
let date = new Date();
this.curDate = date.getFullYear()+'/'+(date.getMonth()+1)+'/'+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
this.getTaskList(1, this.pageSize);
this.pageIndex = 1;
console.log(commonUtil);
_self = this;
this.getOrgList()
},
onPullDownRefresh:function(){
_self.showTips = false;
this.getTaskList(1, this.pageSize);
setTimeout(()=>{
//停止下拉样式
uni.stopPullDownRefresh();
//隐藏标题读取
uni.hideNavigationBarLoading();
},
500);
},
onReachBottom:function(){
if(!_self.showTips) {
this.getTaskList(this.pageIndex, this.pageSize);
}
else {
uni.showToast({
icon: 'none',
title: '已经到底了'
});
}
},
computed: {
...mapState(['userInfo', 'sysParameters'])
},
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();
}
}
},
back(){
uni.redirectTo({
url:'../../tabbar/apply/apply'
});
},
itemClick: function(item){
let sysParameter = uni.getStorageSync('getSysParameter');
let ExceedTimeCanEdit = sysParameter;
// let ExceedTimeCanEdit = 1;
if (ExceedTimeCanEdit == 1) {
let fDate = new Date(item.FDate).getTime();
let currentTime = new Date().getTime();
if (currentTime < fDate) {
uni.showToast({
title: '当前保养单未到开始时间!',
icon:'none'
});
return ;
}
}
uni.setStorageSync('firstPageAcceptenceCurItemInfo',item);
uni.navigateTo({
url: '../../views/EQUM05/EQUM05Item?FIsFinished='+item.FIsFinished+"&FBillNO="+item.FBillNO
});
},
scanClick:function(){
let _self = this;
let count = '';
uni.scanCode({
success:function(res){
_self.searchEquipment = res.result;
_self.getTaskList(1, 6, _self.searchEquipment);
}
});
},
search:function(searchEquipment){
this.getTaskList(1, 6, searchEquipment);
},
getTaskList: function(index, size, searchEquipment) {
let userID = this.userInfo.UserID;
this.orgid = uni.getStorageSync('orgid');
let psw = uni.getStorageSync('psw')?uni.getStorageSync('psw'):'';
this.pageIndex = index;
let requestParams = {
"fNO":searchEquipment?searchEquipment:'',
"PageNumber": this.pageIndex,
"BarNumber": size,
"basicType":2,
"statusType":2
};
this.$request.get('/RepairOreder/RepairOrder',{params:requestParams}).then(res => {
let data = res;
if(this.pageIndex == 1) {
this.taskList = data;
this.pageIndex = this.pageIndex+1;
}
else {
if(data.length != 0) {
let newArray = this.taskList.concat(data);
this.taskList = newArray;
this.pageIndex = this.pageIndex+1;
if(data.length < 6) {
_self.showTips = true;
}
}
else {
_self.showTips = true;
}
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
}
}
}
</script>
<style lang="scss">
page{background-color: #EFEFF4;}
.content {
// height: 100%;
background-color: #F5F5F5;
// display: flex;
// flex-direction:column;
// flex-wrap: nowrap;
// justify-content: flex-start;
}
.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>