636 lines
18 KiB
Vue
Executable File
636 lines
18 KiB
Vue
Executable File
<template>
|
||
<view class="content">
|
||
<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="detail-top-tab-class" @touchmove.stop.prevent="moveHandle">
|
||
<view class="detail-top-tab-col-class" @tap="pageFlagClick(1)">
|
||
<text :class="[pageFlag==1?'detail-top-tab-text-blue-class':'detail-top-tab-text-class']">待点检</text>
|
||
<view class="detail-top-tab-line-class" v-show="pageFlag == 1"></view>
|
||
</view>
|
||
<view class="detail-top-tab-col-line-class"></view>
|
||
<view class="detail-top-tab-col-class" @tap="pageFlagClick(2)">
|
||
<text :class="[pageFlag==2?'detail-top-tab-text-blue-class':'detail-top-tab-text-class']">完工</text>
|
||
<view class="detail-top-tab-line-class" v-show="pageFlag == 2"></view>
|
||
</view>
|
||
<view class="detail-top-tab-col-line-class"></view>
|
||
<view class="detail-top-tab-col-class" @tap="pageFlagClick(3)">
|
||
<text :class="[pageFlag==3?'detail-top-tab-text-blue-class':'detail-top-tab-text-class']">过期任务</text>
|
||
<view class="detail-top-tab-line-class" v-show="pageFlag == 3"></view>
|
||
</view>
|
||
</view>
|
||
|
||
<view style="height: 24rpx;" @touchmove.stop.prevent="moveHandle"></view>
|
||
|
||
<view class="search" v-show="searchShow">
|
||
<view class="search-title">
|
||
<picker @change="bindPickerChange" :value="selConditionIndex" :range="selCondition">
|
||
<view class="uni-input">
|
||
<view class="uni-input-text">{{selCondition[selConditionIndex]}}</view>
|
||
<image src="../../../static/login/icon-pull.png" style="height: 32rpx;width: 32rpx;"></image>
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
<input class="search-input" placeholder="搜索" v-model="searchData" focus="focus"
|
||
placeholder-style="font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: rgba(160,160,160,0.60);"
|
||
@confirm="searchTask(searchData)"></input>
|
||
<image class="search-img" src="../../../static/emapp/scan.png" @click="scanClick()"></image>
|
||
</view>
|
||
<view style="height: 32rpx;width: 100%;"></view>
|
||
<view v-if="taskList.length==0" >
|
||
<view v-if="pageFlag==1" style="color: red;margin-left: 56rpx;">待点检列表为空</view>
|
||
<view v-if="pageFlag==2" style="color: red;margin-left: 56rpx;">完工列表为空</view>
|
||
<view v-if="pageFlag==3" style="color: red;margin-left: 56rpx;">过期任务列表为空</view>
|
||
</view>
|
||
<view class="card-list" v-for="(item,index) in taskList" @tap="itemClick(item)" :key="index" v-else>
|
||
<view class="card-info">
|
||
<view class="card-info-title">
|
||
<view class="card-info-item" style="margin-top: 0;">
|
||
<text class="card-info-title-text-left">点检单号:</text>
|
||
<text class="card-info-title-text-detail-left">{{item.FBILLNO}}</text>
|
||
</view>
|
||
<view class="card-info-title-text-right">
|
||
<text class="status-red-text" v-show="item.FFType=='0'">待检</text>
|
||
<!-- <view class="status-red" v-show="item.FFType=='0'"></view> -->
|
||
<text class="status-yellow-text" v-show="item.FFType=='1'">进行中</text>
|
||
<!-- <view class="status-yellow" v-show="item.FFType=='1'"></view> -->
|
||
<text class="status-green-text" v-show="item.FFType=='2'">已完成</text>
|
||
<!-- <view class="status-green" v-show="item.FFType=='2'"></view> -->
|
||
</view>
|
||
</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.FEFFECTIVEDATE}}</text>
|
||
</view>
|
||
<view class="card-info-item">
|
||
<text class="card-info-item-text">异动时间:</text>
|
||
<text class="card-info-item-text-detail">{{item.M_YMD}}</text>
|
||
</view>
|
||
<view class="card-info-item">
|
||
<text class="card-info-item-text">执行人:</text>
|
||
<text class="card-info-item-text-detail">{{item.FEXECTOR}}</text>
|
||
</view>
|
||
<view class="card-info-item">
|
||
<text class="card-info-item-text">执行部门:</text>
|
||
<text class="card-info-item-text-detail">{{item.FDEPTNAME}}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view style="height: 10rpx;"></view>
|
||
<opsoft-dialog-notice
|
||
:dialogNoticeShow="showDialog"
|
||
:dialogNoticeType="dialogNoticeType"
|
||
:dialogNoticeTitle="dialogNoticeTitle"
|
||
:dialogNoticeContent="dialogNoticeContent"
|
||
@dialogNoticeConfirmClick="dialogNoticeConfirmClick"
|
||
>
|
||
</opsoft-dialog-notice>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import Vue from 'vue';
|
||
import navigationTitle from '@/components/navigation-title/navigation-title.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 {
|
||
components: {
|
||
navigationTitle,
|
||
opsoftDialogNotice
|
||
},
|
||
|
||
data() {
|
||
return {
|
||
dialogNoticeContent:'',
|
||
dialogNoticeTitle:'',
|
||
dialogNoticeType:'',
|
||
showDialog:false,
|
||
|
||
focus:true,
|
||
searchShow:true,
|
||
searchData:'',
|
||
selCondition:['全部','部门','单据名称','设备'],
|
||
selConditionIndex:0,
|
||
searchType:0,
|
||
scrollTop: 0,
|
||
isShowOrg:true,
|
||
old: {
|
||
scrollTop: 0
|
||
},
|
||
taskList:[],
|
||
pageIndex:1,
|
||
pageSize:6,
|
||
pageFlag:1,
|
||
showTips:false,
|
||
prgKey:"MESQS19",
|
||
nextPage:"EQUM01",
|
||
deptInfoArray:[],
|
||
deptID:"",
|
||
sourcesID:"",
|
||
status:0,
|
||
isHistory:0,
|
||
curDate:''
|
||
}
|
||
},
|
||
|
||
onShow() {
|
||
let date = new Date();
|
||
this.curDate = date.getFullYear()+'/'+(date.getMonth()+1)+'/'+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
|
||
this.pageIndex = 1;
|
||
this.pageFlagClick(1);
|
||
// this.getDeptInfoRequest(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(){},
|
||
|
||
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'
|
||
})
|
||
},
|
||
bindPickerChange:function(e){
|
||
this.selConditionIndex = e.target.value;
|
||
this.searchType = e.target.value;
|
||
this.getTaskList(1, this.pageSize,'');
|
||
},
|
||
scanClick:function(){
|
||
let _self = this;
|
||
let count = '';
|
||
uni.scanCode({
|
||
success:function(res){
|
||
_self.searchData = res.result;
|
||
_self.getTaskList(1, _self.pageSize,count);
|
||
}
|
||
})
|
||
},
|
||
searchTask:function(item){
|
||
this.searchData = item;
|
||
let count = '';
|
||
this.getTaskList(1, this.pageSize,count);
|
||
},
|
||
itemClick: function(item){
|
||
let sysParameter = uni.getStorageSync('getSysParameter');
|
||
let ExceedTimeCanEdit = sysParameter;
|
||
// let ExceedTimeCanEdit = 1;
|
||
if (ExceedTimeCanEdit == 1) {
|
||
let begTime = new Date(item.FBegTime).getTime();
|
||
let endTime = new Date(item.FEndTime).getTime();
|
||
let currentTime = new Date().getTime();
|
||
if (currentTime < begTime) {
|
||
uni.showModal({
|
||
title: '提示',
|
||
content: '当前点检单未到工单时间!',
|
||
showCancel:false,
|
||
success: function (res) {
|
||
|
||
}
|
||
});
|
||
return ;
|
||
}
|
||
|
||
// if (currentTime > endTime) {
|
||
// uni.showModal({
|
||
// title: '提示',
|
||
// content: '当前点检单超过异动时间!',
|
||
// showCancel:false,
|
||
// success: function (res) {
|
||
|
||
// }
|
||
// });
|
||
// return ;
|
||
// }
|
||
}
|
||
|
||
// if (ExceedTimeCanEdit == 2) {
|
||
// let begTime = new Date(item.FBegTime).getTime();
|
||
// let currentTime = new Date().getTime();
|
||
// if (currentTime < begTime) {
|
||
// uni.showModal({
|
||
// title: '提示',
|
||
// content: '当前点检单未到开始时间!',
|
||
// showCancel:false,
|
||
// success: function (res) {
|
||
|
||
// }
|
||
// });
|
||
// return ;
|
||
// }
|
||
// }
|
||
|
||
item.isHistory = this.isHistory;
|
||
item.isEditable = true;
|
||
if((item.isHistory == 1) || (item.FFType == 2)||(this.pageFlag==2)) {
|
||
item.isEditable = false;
|
||
}
|
||
|
||
let newItem;
|
||
if(item.FInterID) {
|
||
newItem = uni.getStorageSync(item.FInterID);
|
||
}
|
||
if(newItem && newItem.length>0) {
|
||
newItem.isHistory = item.isHistory;
|
||
newItem.isEditable = item.isEditable;
|
||
item = newItem;
|
||
}
|
||
|
||
let itemString = JSON.stringify(item);
|
||
|
||
let navigateUrl = '../../views/'+this.nextPage+'/'+'EQUM01Item?item='+itemString;
|
||
uni.navigateTo({
|
||
url: navigateUrl,
|
||
});
|
||
},
|
||
|
||
getDeptInfoRequest: function(count) {},
|
||
|
||
getTaskList: function(index,size,count) {
|
||
uni.showLoading({
|
||
title:"加载中",
|
||
mask:true
|
||
})
|
||
|
||
let userInfoLocal = uni.getStorageSync("userInfo");
|
||
let userID = this.userInfo.UserID;
|
||
this.orgid = uni.getStorageSync('orgid');
|
||
if (userInfoLocal && userInfoLocal.UserID) {
|
||
if(userInfoLocal.UserID.length > 0) {
|
||
if((!userID) || (userID.length <= 0)) {
|
||
userID = userInfoLocal.UserID;
|
||
}
|
||
}
|
||
}
|
||
|
||
this.pageIndex = index;
|
||
let requestParams = {
|
||
"type":this.pageFlag,
|
||
"pageIndex": this.pageIndex,
|
||
"pageSize": size,
|
||
"searchType":this.searchType,
|
||
"searchData":this.searchData
|
||
};
|
||
this.$request.get('/SpotCheck/SpotTaskSearch',{params:requestParams}).then(res => {
|
||
res.length ? res.forEach(
|
||
function(el){
|
||
if (el.FEFFECTIVEDATE) {
|
||
let FBegTime = commonUtil.removeLetter(el.FEFFECTIVEDATE);
|
||
el.FBegTime = FBegTime.substr(0,10) + " " + FBegTime.substr(10 ,8);
|
||
}
|
||
if (el.M_YMD) {
|
||
let FEndTime = commonUtil.removeLetter(el.M_YMD);
|
||
el.FEndTime = FEndTime.substr(0,10) + " " + FEndTime.substr(10 ,8);
|
||
}
|
||
}
|
||
) : ''
|
||
|
||
if (_self.pageIndex == 1) {
|
||
_self.taskList = res;
|
||
_self.pageIndex = _self.pageIndex+1;
|
||
}
|
||
else {
|
||
if(res.length != 0) {
|
||
let newArray = _self.taskList.concat(res);
|
||
_self.taskList = newArray;
|
||
_self.pageIndex = _self.pageIndex+1;
|
||
if(res.length < 6) {
|
||
_self.showTips = true;
|
||
}
|
||
} else {
|
||
_self.showTips = true;
|
||
}
|
||
}
|
||
|
||
uni.hideLoading();
|
||
}).catch(err => {
|
||
uni.hideLoading();
|
||
this.dialogNoticeProps(err,'error')
|
||
});
|
||
},
|
||
|
||
pageFlagClick: function(type){
|
||
this.pageFlag = type;
|
||
let count = 1;
|
||
if (type == 1){
|
||
this.status = 0;
|
||
this.isHistory = 0;
|
||
this.searchShow = true;
|
||
}
|
||
else if (type == 2){
|
||
this.status = 1;
|
||
this.isHistory = 0;
|
||
this.searchShow = false;
|
||
}
|
||
else if (type == 3){
|
||
this.status = 0;
|
||
this.isHistory = 1;
|
||
this.searchShow = false;
|
||
}
|
||
this.getTaskList(1, this.pageSize,count);
|
||
},
|
||
|
||
moveHandle: function(){
|
||
return false;
|
||
},
|
||
|
||
navigateBackClick: function(){
|
||
uni.redirectTo({
|
||
url:'../../tabbar/apply/apply'
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
page{background-color: #F0F0F0;}
|
||
.content {
|
||
display: flex;
|
||
flex-direction:column;
|
||
flex-wrap: nowrap;
|
||
justify-content: flex-start;
|
||
background-color: #F0F0F0;
|
||
}
|
||
|
||
.detail-top-tab-class{
|
||
background-color: #FFFFFF;
|
||
display: flex;
|
||
flex-direction:row;
|
||
flex-wrap: nowrap;
|
||
ustify-content: center;
|
||
align-items: center;
|
||
height: 84rpx;
|
||
margin: 0 0rpx;
|
||
}
|
||
|
||
.detail-top-tab-col-class{
|
||
width: 100rpx;
|
||
height: 84rpx;
|
||
line-height: 84rpx;
|
||
display: flex;
|
||
flex-direction:column;
|
||
flex-wrap: nowrap;
|
||
justify-content: center;
|
||
align-items: center;
|
||
flex-shrink: 1;
|
||
flex-grow: 1;
|
||
// padding-bottom: 10rpx;
|
||
}
|
||
|
||
.detail-top-tab-col-class image{
|
||
height: 45rpx;
|
||
width: 45rpx;
|
||
background:yell;
|
||
}
|
||
|
||
.detail-top-tab-col-line-class{
|
||
width: 1px;
|
||
height: 30rpx;
|
||
background-color: #D0D0D0;
|
||
justify-content: center;
|
||
align-items: center;
|
||
flex-shrink: 0;
|
||
flex-grow: 0;
|
||
}
|
||
|
||
.detail-top-tab-text-class{
|
||
flex-shrink: 1;
|
||
flex-grow: 1;
|
||
font-size: 28rpx;
|
||
font-family: PingFangSC, PingFangSC-Regular;
|
||
font-weight: 400;
|
||
color: #626262;
|
||
}
|
||
|
||
.detail-top-tab-text-blue-class{
|
||
flex-shrink: 1;
|
||
flex-grow: 1;
|
||
font-size: 32rpx;
|
||
font-family: PingFangSC, PingFangSC-Semibold;
|
||
font-weight: 600;
|
||
color: #262626;
|
||
}
|
||
|
||
.detail-top-tab-line-class{
|
||
width: 60rpx;
|
||
height:4rpx;
|
||
background-color:#3860F3;
|
||
flex-shrink: 0;
|
||
flex-grow: 0;
|
||
}
|
||
.search{padding: 0 0;background-color: #F0F0F0;margin: 0 32rpx;display: flex;flex-direction: row;}
|
||
.search-title{
|
||
width: 200rpx;
|
||
height: 60rpx;
|
||
line-height: 60rpx;
|
||
// border: 1px solid #D8D8D8;
|
||
border-radius: 10rpx;
|
||
font-size: 30rpx;
|
||
font-style: auto;
|
||
color: #666666;
|
||
margin-right: 20rpx;
|
||
}
|
||
.uni-input{
|
||
display: flex;
|
||
flex-direction: row;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
// border: 1px solid #D8D8D8;
|
||
color: #666666;
|
||
padding: 5rpx 24rpx;
|
||
border-radius: 10rpx;
|
||
flex-wrap: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
word-break: break-all;
|
||
}
|
||
.uni-input-text{text-align: left;width: 100%;font-size: 28rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: rgba(60,60,67,0.60);}
|
||
.search-input{
|
||
position: relative;
|
||
width: 100%;
|
||
height: 60rpx;
|
||
line-height: 60rpx;
|
||
font-size: 30rpx;
|
||
color: #6B6B6B;
|
||
padding-left: 15rpx;
|
||
padding-right: 15rpx;
|
||
border-radius: 10rpx;
|
||
// border: 1px solid #D8D8D8;
|
||
background-color: #FFFFFF;
|
||
}
|
||
.search-img{height: 32rpx;width: 32rpx;position: absolute;right: 15rpx;top: 14rpx;}
|
||
.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>
|