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

1423 lines
38 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" 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.FStdValue}}</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 class="alter" v-if="otherShow" @click="hideAlter"></view>
<scroll-view class="sparePart" v-show="addShow" scroll-y="true" style="height: 80%;">
<view class="head" style="margin: 32rpx 32rpx;padding: 0 0;">
<view class="top-row-class">
<text class="top-row-title-class-add"><span style="color: red;">*</span>选择设备</text>
<view class="selCondition-alter" @click="equipClick">{{equipSelect}}</view>
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
<view class="top-row-class" @click="workerClick">
<text class="top-row-title-class-add"><span style="color: red;">*</span>维修负责人</text>
<view class="selCondition-alter">
<view>{{workerSelect}}</view>
</view>
<!-- <view class="selCondition-alter" @click="workerClick">{{workerSelect}}</view> -->
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
<view class="top-row-class">
<text class="top-row-title-class-add"><span style="color: red;">*</span>工单时间</text>
<view class="selCondition-date" @click="creatDatePicker()">{{creatlist[0].detail}}</view>
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
<view class="top-row-class">
<text class="top-row-title-class-add"><span style="color: red;">*</span>发生时间</text>
<view class="selCondition-date" @click="happenDatePicker()">{{happenlist[0].detail}}</view>
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
<view class="top-row-class">
<text class="top-row-title-class-add"><span style="color: red;">*</span>报修时间</text>
<view class="selCondition-date" @click="repairDatePicker()">{{repairlist[0].detail}}</view>
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
</view>
<date-time-picker ref='creatTime' :indicatorStyle='indicatorStyle' :type='type' :datestring='dateString'
@change='creatTimeChange'>
</date-time-picker>
<date-time-picker ref='happenTime' :indicatorStyle='indicatorStyle' :type='type' :datestring='dateString'
@change='happenTimeChange'>
</date-time-picker>
<date-time-picker ref='repairTime' :indicatorStyle='indicatorStyle' :type='type' :datestring='dateString'
@change='repairTimeChange'>
</date-time-picker>
<view class="head" style="margin: 32rpx 32rpx;padding: 0 0;">
<view class="top-row-class" style="padding: 0 0;">
<text class="top-row-title-class-add">优先级</text>
<view class="selCondition">
<picker @change="priorityChange" :value="priorityIndex" :range="priorityList">
<view class="uni-input">{{priorityList[priorityIndex]}}</view>
</picker>
</view>
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
<view class="top-row-class" style="padding: 0 0;height: 80rpx;">
<text class="top-row-title-class-add">是否自修</text>
<view class="selCondition">
<checkbox value="cb" @click="isRepair(1)" :checked="repairBySelfIndex==1"
style="transform:scale(0.7)" />是
<checkbox value="cb" @click="isRepair(0)" :checked="repairBySelfIndex==0"
style="margin-left: 100rpx;transform:scale(0.7)" />否
<!-- <picker @change="repairBySelfChange" :value="repairBySelfIndex" :range="repairBySelfList">
<view class="uni-input">{{repairBySelfList[repairBySelfIndex]}}</view>
</picker> -->
</view>
</view>
<view class="top-row-class" style="padding: 0 0;">
<text class="top-row-title-class-add">是否停机</text>
<view class="selCondition">
<checkbox value="cb" @click="isStopMach(1)" :checked="isStopMachineIndex==1"
style="transform:scale(0.7)" />是
<checkbox value="cb" @click="isStopMach(0)" :checked="isStopMachineIndex==0"
style="margin-left: 100rpx;transform:scale(0.7)" />否
<!-- <picker @change="isStopMachineChange" :value="isStopMachineIndex" :range="isStopMachineList">
<view class="uni-input">{{isStopMachineList[isStopMachineIndex]}}</view>
</picker> -->
</view>
</view>
<view class="top-row-class" style="padding: 0 0;">
<text class="top-row-title-class-add">故障类别</text>
<view class="selCondition">
<picker @change="accidentTypeChange" :value="accidentTypeIndex" :range="accidentTypeList">
<view class="uni-input" v-if="accidentTypeInfo.length>0">
{{accidentTypeInfo[accidentTypeIndex].FNAME}}
</view>
</picker>
</view>
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
<view class="top-row-class" style="padding: 0 0;">
<text class="top-row-title-class-add">故障程度</text>
<view class="selCondition">
<picker @change="faultDegreeChange" :value="faultDegreeIndex" :range="faultDegreeList">
<view class="uni-input" v-if="faultDegreeInfo.length>0">
{{faultDegreeInfo[faultDegreeIndex].FNAME}}
</view>
</picker>
</view>
<image class="search-img" src="../../../static/myinfo/right-arrow.png"></image>
</view>
</view>
<view class="alter-inner" v-if="innerShow" @click="hideInnerAlter"></view>
<view class="err" v-if="workerShow">
<view class="alter-head">
<view class="errTitle-cancel" @click="cancelWorker">取消</view>
<view class="errTitle-confirm" @click="confirmWorker">确定</view>
<!-- <view class="errTitle-search">
<input class="errTitle-search" v-model="workerSearch" @confirm="searchWorker(workerSearch)"
placeholder="输入员工编号搜索" placeholder-style="color:#333333"/>
</view> -->
</view>
<scroll-view scroll-y="true" :style="{'height':alterSelHeight}">
<view class="errList" v-for="(item,index) in workerList">
<checkbox :checked="item.isChoose" @click="chooseWorker(index)" style="transform: scale(0.7);">
</checkbox>
<view class="errDetails">{{item.FNAME}}({{item.FNO}})</view>
</view>
</scroll-view>
<!-- <view style="height: 20rpx;"></view>
<view class="errConfirm" @click="confirmWorker">确定</view> -->
</view>
<view class="err" v-if="equipShow">
<view class="alter-head">
<view class="errTitle-cancel" @click="cancelEquip">取消</view>
<view class="errTitle-confirm" @click="confirmEquip">确定</view>
<!-- <view class="errTitle-search">
<input class="errTitle-search" v-model="equipSearch" @confirm="searchEquip(equipSearch)"
placeholder="输入设备编号搜索" placeholder-style="color:#333333"/>
</view> -->
</view>
<scroll-view scroll-y="true" :style="{'height':alterSelHeight}">
<view class="errList" v-for="(item,index) in equipList">
<checkbox :checked="item.isChoose" @click="chooseEquip(index)" style="transform: scale(0.7);">
</checkbox>
<view class="errDetails">{{item.FNAME}}({{item.FNO}})</view>
</view>
</scroll-view>
<!-- <view style="height: 20rpx;"></view>
<view class="errConfirm" @click="confirmEquip">确定</view> -->
</view>
<view class="info-title">情况简述</view>
<view class="head" style="margin: 20rpx 32rpx;padding: 0 0;">
<view>
<textarea class="" placeholder="简述情况" v-model="FCondition" style="width: 100%;padding: 32rpx 24rpx;"
placeholder-style="color: #cacaca;font-size:26rpx;"></textarea>
</view>
</view>
<view class="info-title">原因简述</view>
<view class="head" style="margin: 20rpx 32rpx;padding: 0 0;">
<view>
<textarea class="" placeholder="简述原因" v-model="FReason" style="width: 100%;padding: 32rpx 24rpx;"
placeholder-style="color: #cacaca;font-size:26rpx;"></textarea>
</view>
</view>
<view style="height: 200rpx;width: 100%;"></view>
<view class="confirmBtn" @click="confirm">确定</view>
</scroll-view>
</view>
</template>
<script>
import DateTimePicker from '@/components/bory-dateTimePicker/bory-dateTimePicker.vue';
import imgUpload from '@/components/poiuy-uImgUpload/imgUpload.vue';
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
import errorStrUntil from '@/common/errorStrUntil.js';
import {
pathToBase64,
base64ToPath
} from '@/js_sdk/mmmm-image-tools/index.js';
import Vue from 'vue';
import {
mapState,
mapMutations
} from 'vuex';
var _self
export default {
data() {
return {
dialogNoticeContent:'',
dialogNoticeTitle:'',
dialogNoticeType:'',
showDialog:false,
alterSelHeight: '',
focus: true,
leftStyle: 0,
startX: 0,
hiddenFlag: true,
delBtnWidth: 220,
currIndex: '',
scrollTop: 0,
old: {
scrollTop: 0
},
taskList: [],
pageIndex: 1,
pageSize: 6,
showTips: false,
orgid: '',
searchEquipment: '',
otherShow: false,
addShow: false,
priorityIndex: 0,
priorityList: ['高', '中', '低'],
repairBySelfIndex: 0,
repairBySelfList: ['是', '否'],
isStopMachineIndex: 0,
isStopMachineList: ['是', '否'],
accidentTypeIndex: 0,
accidentTypeList: [],
accidentTypeInfo: [],
faultDegreeIndex: 0,
faultDegreeList: [],
faultDegreeInfo: [],
accidentID: '',
faultDegreeID: '',
FCondition: '',
FReason: '',
innerShow: false,
workerShow: false,
equipShow: false,
equipList: [],
equipNO: '',
workerList: [],
empNO: '',
workerSearch: '',
workerSelect: '选择人员',
workerID: '',
equipSearch: '',
equipSelect: '选择设备',
equipID: '',
equipPartList: [],
equipPartShow: false,
equipPartSearch: '',
equipPartSelect: '选择部件',
equipPartID: '',
isShowOrg:true,
dateString: '',
type: 'datetime-all',
creatlist: [{
type: 'datetime-all',
// title: '展示年月日时分秒',
detail: '选择开始时间'
}],
happenlist: [{
type: 'datetime-all',
// title: '展示年月日时分秒',
detail: '选择开始时间'
}],
repairlist: [{
type: 'datetime-all',
// title: '展示年月日时分秒',
detail: '选择开始时间'
}],
curDate: ''
}
},
onShow() {
let date = new Date();
this.curDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + " " + date
.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
this.creatlist[0].detail = this.curDate;
this.happenlist[0].detail = this.curDate;
this.repairlist[0].detail = this.curDate;
const res = uni.getSystemInfoSync();
this.alterSelHeight = (res.windowHeight * 0.5 - 40) + 'px';
let count = 0;
let searchEquipment = '';
this.getTaskList(1, this.pageSize, searchEquipment);
this.getDefultDegree();
this.getDefultType();
this.getEquipList(this.equipNO);
this.getEquipPartList(this.equipSearch);
this.pageIndex = 1;
_self = this;
this.getOrgList()
this.getWorkerList(this.empNO);
},
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: '已经到底了'
});
}
},
onNavigationBarButtonTap: function(e) {
this.addShow = true;
this.otherShow = true;
},
computed: {
indicatorStyle() {
return {
background: 'rgba(255,0,0,.2)',
height: '40px',
};
},
...mapState(['userInfo'])
},
components: {
DateTimePicker,
imgUpload,
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(){},
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();
}
}
},
isRepair(type) {
this.repairBySelfIndex = type;
},
isStopMach(type) {
this.isStopMachineIndex = type;
},
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);
},
back() {
uni.redirectTo({
url: '../../tabbar/apply/apply'
})
},
creatDatePicker() {
this.type = 'datetime-all';
this.$refs['creatTime'].show();
},
creatTimeChange(value) {
let item = this.creatlist[0];
item['detail'] = value;
},
happenDatePicker() {
this.type = 'datetime-all';
this.$refs['happenTime'].show();
},
happenTimeChange(value) {
let item = this.happenlist[0];
item['detail'] = value;
},
repairDatePicker() {
this.type = 'datetime-all';
this.$refs['repairTime'].show();
},
repairTimeChange(value) {
let item = this.repairlist[0];
item['detail'] = value;
},
hideInnerAlter() {
this.innerShow = false;
this.workerShow = false;
this.equipShow = false;
this.equipPartShow = false;
},
workerClick() {
this.innerShow = true;
this.workerShow = true;
this.equipShow = false;
},
searchWorker: function(workerNO) {
this.getWorkerList(workerNO);
},
chooseWorker: function(index) {
let selWorker = [];
this.workerList[index].isChoose = !this.workerList[index].isChoose;
selWorker = this.workerList.filter(
function(el) {
return el.isChoose == true;
}
);
if (selWorker.length > 1) {
uni.showToast({
icon: 'none',
title: '只能选择一个负责人'
})
return false;
}
this.workerSelect = selWorker[0].FNAME;
this.workerID = selWorker[0].FID;
},
confirmWorker() {
this.innerShow = false;
this.workerShow = false;
this.equipShow = false;
},
cancelWorker() {
this.innerShow = false;
this.workerShow = false;
this.equipShow = false;
},
equipClick() {
this.innerShow = true;
this.workerShow = false;
this.equipShow = true;
},
equipPartClick() {
this.innerShow = true;
this.equipPartShow = true;
},
searchEquip: function(equipNO) {
this.getEquipList(equipNO);
},
chooseEquip: function(index) {
this.equipList[index].isChoose = !this.equipList[index].isChoose;
let selEquip = this.equipList.filter(
function(el) {
return el.isChoose == true;
}
);
if (selEquip.length > 1) {
uni.showToast({
icon: 'none',
title: '只能选择一台设备'
})
return false;
}
this.equipSelect = selEquip[0].FNAME;
this.equipID = selEquip[0].FID;
},
confirmEquip() {
this.innerShow = false;
this.workerShow = false;
this.equipShow = false;
},
cancelEquip() {
this.innerShow = false;
this.workerShow = false;
this.equipShow = false;
},
chooseEquipPart: function(index) {
this.equipPartList[index].isChoose = !this.equipPartList[index].isChoose;
let selEquipPart = this.equipPartList.filter(
function(el) {
return el.isChoose == true;
}
);
this.equipPartSelect = selEquipPart[0].FNO;
this.equipPartID = selEquipPart[0].FID;
},
confirmEquipPart() {
this.innerShow = false;
this.equipPartShow = false;
},
hideAlter() {
this.addShow = false;
this.otherShow = false;
},
priorityChange(e) {
this.priorityIndex = e.target.value;
},
repairBySelfChange(e) {
this.repairBySelfIndex = e.target.value;
},
isStopMachineChange(e) {
this.isStopMachineIndex = e.target.value;
},
accidentTypeChange(e) {
this.accidentTypeIndex = e.target.value;
this.accidentID = this.accidentTypeInfo[this.accidentTypeIndex].FID;
},
faultDegreeChange(e) {
this.faultDegreeIndex = e.target.value;
this.faultDegreeID = this.faultDegreeInfo[this.faultDegreeIndex].FID;
},
equipChange(e) {
this.equipIndex = e.target.value;
},
workerChange(e) {
this.workerIndex = e.target.value;
},
timeCompare: function(sTime, eTime) {
let compareResult;
let beginTime = sTime;
let endTime = eTime;
let beginTimes = beginTime.substring(0, 10).split('-');
let endTimes = endTime.substring(0, 10).split('-');
beginTime = beginTimes[1] + '-' + beginTimes[2] + '-' + beginTimes[0] + ' ' + beginTime.substring(10,
19);
endTime = endTimes[1] + '-' + endTimes[2] + '-' + endTimes[0] + ' ' + endTime.substring(10, 19);
let minTime = (Date.parse(endTime) - Date.parse(beginTime)) / 3600 / 1000;
if (minTime > 0) {
compareResult = true;
} else {
compareResult = false;
}
return compareResult;
},
confirm() {
let _self = this;
let date = new Date();
if (this.equipID == "" || this.workerID == "" || this.creatlist[0].detail == "选择创建时间" ||
this.happenlist[0].detail == "选择发生时间" || this.repairlist[0].detail == "选择报修时间") {
uni.showToast({
icon: 'none',
title: '*为必录项'
})
return false;
}
let repairTime = new Date(this.repairlist[0].detail).getTime();
let happenTime = new Date(this.happenlist[0].detail).getTime();
if (repairTime < happenTime) {
uni.showToast({
icon: 'none',
title: "报修时间不能早于发生时间"
})
return repairTimeResult;
}
let repair = [{
"FName": this.equipSelect,
"FMaintDate": this.creatlist[0].detail,
"FMachineID": this.equipID,
"FPriority": this.priorityIndex,
"FRepairBySelf": this.repairBySelfIndex,
"FIsStopMachine": this.isStopMachineIndex,
"FConditionResume": this.FCondition,
"FReasonResume": this.FReason,
"FMaintManID": this.workerID,
"FAccidentDate": this.happenlist[0].detail,
"FApplyForDate": this.repairlist[0].detail,
"FAccidentType": this.accidentID,
"FFaultDegree": this.faultDegreeID
}]
let requestParams = {
"basicType": 1,
"repair": repair,
};
this.$request.post('/RepairOreder/CreateOrder',requestParams).then(res => {
this.getTaskList(1, 6);
this.addShow = false;
this.otherShow = false;
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getTaskList: function(index, size, searchEquipment) {
this.orgid = uni.getStorageSync('orgid')
this.pageIndex = index;
let requestParams = {
"fNO": searchEquipment ? searchEquipment : '',
"PageNumber": this.pageIndex,
"BarNumber": size,
"basicType": 1,
"statusType": 1
};
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('firstPageCurItemInfoRepair', item);
uni.navigateTo({
url: '../../views/EQUM03/EQUM03Item'
});
},
getWorkerList(empNO) {
let _self = this;
//+orgId
let requestParams = {
"basicType":10,
"basicNO": empNO,
"orgId":this.orgFItemID?this.orgFItemID:''
};
this.$request.get('/SysConfigData/QueryResource',{params:requestParams}).then(res => {
let data = res;
if (data && data.length > 0) {
let workerList = data;
workerList.forEach(
function(el) {
let arr = {
"FID": el.FID,
"FNO": el.FNO,
"FNAME": el.FNAME,
"FCOMPANYID": el.FCOMPANYID,
"isChoose": false
}
_self.workerList.push(arr)
}
);
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getEquipList(equipNO) {
let _self = this;
let requestParams = {
"basicType": 0,
"fNO": equipNO,
"FNAME": '',
"type": 0
};
this.$request.get('/RepairOreder/GetEquipmentBasicData', {
params: requestParams
}).then(res => {
let data = res
if (data && data.length > 0) {
let equipList = data;
_self.equipList = equipList.map(
function(el) {
return {
"FID": el.FID,
"FNO": el.FNO,
"FNAME": el.FNAME,
"FCOMPANYID": el.FCOMPANYID,
"isChoose": false
}
}
);
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getEquipPartList(equipPartNO) {
let _self = this;
let requestParams = {
"basicType": 3,
"fNO": equipPartNO,
"fName": '',
"type": 0
};
this.$request.get('/RepairOreder/GetEquipmentBasicData', {
params: requestParams
}).then(res => {
let data = res
if (data && data.length > 0) {
let equipPartList = data;
_self.equipPartList = equipPartList.map(
function(el) {
return {
"FID": el.FID,
"FNO": el.FNO,
"FNAME": el.FNAME,
"FCOMPANYID": el.FCOMPANYID,
"isChoose": false
}
}
)
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getDefultType() {
let _self = this;
let requestParams = {
"basicType": 1,
"fNO": '',
"fName": '',
"type": 0
};
this.$request.get('/RepairOreder/GetEquipmentBasicData', {
params: requestParams
}).then(res => {
let data = res
if (data && data.length > 0) {
let accidentTypeList = data;
accidentTypeList.forEach(
function(el) {
let arr = {
"FID": el.FID,
"FNO": el.FNO,
"FNAME": el.FNAME,
"FCOMPANYID": el.FCOMPANYID,
// "isChoose":false
};
_self.accidentTypeInfo.push(arr);
let arrList = el.FNAME;
_self.accidentTypeList.push(arrList);
}
)
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getDefultDegree() {
let _self = this;
let requestParams = {
"basicType": 2,
"fNO": '',
"fName": '',
"type":0
};
this.$request.get('/RepairOreder/GetEquipmentBasicData', {
params: requestParams
}).then(res => {
let data = res;
if (data && data.length > 0) {
let faultDegreeList = data;
faultDegreeList.forEach(
function(el) {
let arr = {
"FID": el.FID,
"FNO": el.FNO,
"FNAME": el.FNAME,
"FCOMPANYID": el.FCOMPANYID,
// "isChoose":false
};
_self.faultDegreeInfo.push(arr);
let arrList = el.FNAME;
_self.faultDegreeList.push(arrList);
}
);
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
delItem: function(index) {
this.taskList.splice(index,1);
this.leftStyle = 0;
uni.showToast({
title:"删除成功",
icon:'none'
})
},
// 开始移动时
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 {
background-color: #F5F5F5;
overflow: hidden;
}
.top-row-class {
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
margin: 0 32rpx;
padding: 16rpx 0;
border-bottom: 1px solid #f9f9f9;
position: relative;
}
.info-title {
padding: 0px 32rpx;
font-size: 14px;
font-family: PingFangSC, PingFangSC-Regular;
font-weight: 400;
color: #59595f;
}
.top-row-title-class {
text-align: end;
font-size: 28rpx;
font-style: auto;
color: #666666;
}
.top-row-title-class-add {
font-size: 28rpx;
color: #666666;
width: 230rpx;
text-align: end;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
.selCondition {
width: 100%;
margin-left: 32rpx;
}
.selCondition-date {
width: 100%;
color: #666666;
font-size: 28rpx;
// border: 1px solid #D8D8D8;
border-radius: 10rpx;
margin-left: 32rpx;
}
.uni-input {
color: #666666;
font-size: 28rpx;
}
.selCondition-alter {
display: flex;
flex-direction: row;
width: 100%;
color: #666666;
// border: 1px solid #D8D8D8;
border-radius: 10rpx;
white-space: pre-wrap;
word-wrap: break-word;
margin-left: 32rpx;
}
.top-row-input-class {
position: relative;
font-size: 28rpx;
color: #6B6B6B;
width: 100%;
border-radius: 10rpx;
// border: 1px solid #D8D8D8;
height: 60rpx;
line-height: 60rpx;
}
.search-img {
height: 40rpx;
width: 40rpx;
position: absolute;
top: 20rpx;
}
.scanImg {
height: 40rpx;
width: 40rpx;
position: absolute;
right: 80rpx;
}
.img-arrow {
height: 40rpx;
width: 40rpx;
}
.detail-table-class {
background-color: #FFFFFF;
border-radius: 10rpx;
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 {
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;
}
.alter {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: #333333;
opacity: 0.5;
}
.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: #F9F9F9;
}
.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: 0rpx;
right: 0rpx;
bottom: 0rpx;
background-color: #FFFFFF;
opacity: 1;
z-index: 5;
height: 50%;
}
.alter-head {
display: flex;
flex-wrap: nowrap;
border-bottom: 1px solid #f9f9f9;
}
.errTitle-cancel {
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: left;
margin-left: 32rpx;
color: #666666;
}
.errTitle-confirm {
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: end;
margin-right: 32rpx;
color: #0184ff;
}
.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>