830 lines
26 KiB
Vue
Executable File
830 lines
26 KiB
Vue
Executable File
<template>
|
||
<view class="report">
|
||
<!-- <date-time-picker ref='actualStarTime' :indicatorStyle='indicatorStyle'
|
||
:type='type' :datestring='dateString' @change='actualStarTimeChange'>
|
||
</date-time-picker>
|
||
<date-time-picker ref='actualEndTime' :indicatorStyle='indicatorStyle'
|
||
:type='type' :datestring='dateString' @change='actualEndTimeChange'>
|
||
</date-time-picker>
|
||
<date-time-picker ref='stopStarTime' :indicatorStyle='indicatorStyle'
|
||
:type='type' :datestring='dateString' @change='stopStarTimeChange'>
|
||
</date-time-picker>
|
||
<date-time-picker ref='stopEndTime' :indicatorStyle='indicatorStyle'
|
||
:type='type' :datestring='dateString' @change='stopEndTimeChange'>
|
||
</date-time-picker>
|
||
<view class="gray-title">
|
||
实际执行时间<text>*</text>
|
||
</view>
|
||
<view class="line-wrapper">
|
||
<view class="line-title">
|
||
实际开始时间
|
||
</view>
|
||
|
||
<view class="line-child" @click="actualStarDatePicker()">
|
||
{{actualStarlist[0].detail}}
|
||
</view>
|
||
</view>
|
||
<view class="line-wrapper">
|
||
<view class="line-title">
|
||
实际结束时间
|
||
</view>
|
||
<view class="line-child" @click="actualEndDatePicker()">
|
||
{{actualEndlist[0].detail}}
|
||
</view>
|
||
</view>
|
||
<view class="gray-title">
|
||
停机时间<text>*</text>
|
||
</view>
|
||
<view class="line-wrapper">
|
||
<view class="line-title">
|
||
停机开始时间
|
||
</view>
|
||
<view class="line-child" @click="stopStarDatePicker()">
|
||
{{stopStarlist[0].detail}}
|
||
</view>
|
||
</view>
|
||
<view class="line-wrapper">
|
||
<view class="line-title">
|
||
停机结束时间
|
||
</view>
|
||
<view class="line-child" @click="stopEndDatePicker()">
|
||
{{stopEndlist[0].detail}}
|
||
</view>
|
||
</view> -->
|
||
<view class="order-title">工单执行结果</view>
|
||
<view class="card-list">
|
||
<view class="card-info-item-text">执行结果</view>
|
||
<view class="card-info-item-text-detail">
|
||
<checkbox value="cb" :checked="FOrderStatus==0" @click="beforeStarChanged" style="transform:scale(0.7);border-radius: 50%;"/>未执行
|
||
<checkbox value="cb" :checked="FOrderStatus==1" @click="onGoingChanged" style="margin-left: 24rpx;transform:scale(0.7)"/>执行中
|
||
<checkbox value="cb" :checked="FOrderStatus==2" @click="finishedChanged" style="margin-left: 24rpx;transform:scale(0.7)"/>完成
|
||
</view>
|
||
</view>
|
||
<view class="info-title">备件领用</view>
|
||
<view class="card-list" style="flex-direction: column;">
|
||
<view class="card-list-report" v-for="(item,index) in partList" :key="index" style="border-bottom: 1px solid #f5f5f5;">
|
||
<image class="img-left-small" src="../../../static/emapp/del_red.png" @click="partDel(index)"></image>
|
||
<view class="card-info-title-text-detail-left">{{item.FName}}</view>
|
||
<view class="card-info-title-text-detail-left-report">数量:{{item.FQty}}</view>
|
||
</view>
|
||
<view class="card-list-report" @click="spareListClick">
|
||
<image class="img-left-small" src="../../../static/emapp/add.png"></image>
|
||
<view class="card-info-item-text">添加备件</view>
|
||
<image class="img-report" src="../../../static/myinfo/right-arrow.png" ></image>
|
||
</view>
|
||
</view>
|
||
<view class="info-title">保养人</view>
|
||
<view class="card-list" style="flex-direction: column;">
|
||
<view class="card-list-report" v-for="(item,index) in selWorker" style="border-bottom: 1px solid #f5f5f5;">
|
||
<image class="img-left-small" src="../../../static/emapp/del_red.png" @click="workerDel(index)"></image>
|
||
<view class="card-info-title-text-detail-left">{{item.FName}}</view>
|
||
<view class="card-info-title-text-detail-left-report">保养工时:{{item.FACraftTime?item.FACraftTime:0}}H</view>
|
||
</view>
|
||
<view class="card-list-report" @click="workerListClick">
|
||
<image class="img-left-small" src="../../../static/emapp/add.png"></image>
|
||
<view class="card-info-item-text">添加保养人</view>
|
||
<image class="img-report" src="../../../static/myinfo/right-arrow.png" ></image>
|
||
</view>
|
||
</view>
|
||
<view class="info-title">内容及要求</view>
|
||
<view class="info-body">
|
||
<textarea placeholder="输入内容及要求" v-model="FContentAndRequir" placeholder-class="text-area-holder" class="text-area"></textarea>
|
||
</view>
|
||
<view class="info-title">备注</view>
|
||
<view class="info-body">
|
||
<textarea placeholder="输入备注信息" v-model="FNote" placeholder-class="text-area-holder" class="text-area"></textarea>
|
||
</view>
|
||
<view class="info-title">图片上传<span>仅限jpg、png格式</span></view>
|
||
<view class="info-body" style="padding: 20rpx 32rpx;">
|
||
<imgUpload :imgArr="imgArray" imgCount="1" ref="imgUpload" :controlCarmalFlag="cameraType"></imgUpload>
|
||
</view>
|
||
<view style="height: 200rpx;width: 100%;"></view>
|
||
<view @click="save" class="fixed-bottom" v-show="submitShow">提交</view>
|
||
<view class="alter" v-if="otherShow" @click="hideAlter"></view>
|
||
<view class="worker-alter" v-if="workerShow">
|
||
<!-- <view class="worker-alter-head">
|
||
<view class="worker-alter-title">选择员工</view>
|
||
</view> -->
|
||
<scroll-view scroll-y="true" :style="{'height':scrollHeight}">
|
||
<view class="card-list" v-for="(item,index) in workerList" style="margin: 24rpx 32rpx;">
|
||
<image class="img-left-middle" src="../../../static/emapp/human.png" v-if="item.isChoose"></image>
|
||
<image class="img-left-middle" src="../../../static/emapp/human_gray.png" v-if="!item.isChoose"></image>
|
||
<view style="display: flex;flex-direction: column;padding-left: 20rpx;">
|
||
<view class="worker-alter-details">{{item.FName}}({{item.FNO}})</view>
|
||
<view class="worker-alter-time">
|
||
保养工时:
|
||
<input v-model="item.FACraftTime" :class="[item.isChoose?'worker-alter-time-input-select':'worker-alter-time-input']"/>H
|
||
</view>
|
||
</view>
|
||
<checkbox :checked="item.isChoose" @click="chooseWorker(index)" style="transform: scale(0.7);position: absolute;right: 0;"></checkbox>
|
||
</view>
|
||
</scroll-view>
|
||
<view class="worker-alter-confirm" @click="confirmWorker">确定</view>
|
||
</view>
|
||
|
||
<view class="sparePart" v-show="sparePartShow">
|
||
<scroll-view scroll-y="true" :style="{'height':scrollHeightPart}">
|
||
<view class="card-list" v-for="(i, k) in dataList" :key="k" style="margin: 32rpx 32rpx 0 32rpx;padding: 0 0;">
|
||
<view class="card-info" style="background-color: #FFFFFF;margin-left: 0;border-radius: 10rpx;padding-bottom: 20rpx;">
|
||
<view class="card-info-item" style="margin: 0 32rpx;position: relative;padding: 20rpx 0 8rpx 0;">
|
||
<view class="sparePart-title">{{i.FName}}</view>
|
||
<view class="sparePart-count">
|
||
<view class="min" @click="minClick(k)">
|
||
<image class="sparePart-count-img" src="../../../static/emapp/min_blue.png" v-if="!i.minForbidden"></image>
|
||
<image class="sparePart-count-img" src="../../../static/emapp/min_gray.png" v-if="i.minForbidden"></image>
|
||
</view>
|
||
<input type="number" class="sparePart-count-input" v-model="i.num" @input="partCountInput(i)"></input>
|
||
<view class="pluse" @click="pluseClick(k)">
|
||
<image class="sparePart-count-img" src="../../../static/emapp/add.png"></image>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="card-info-item-text" style="width: 100%;color: #8a8a8e;font-size: 28rpx;padding-left: 32rpx;">备件代码: {{i.FBillNO}}</view>
|
||
<view class="card-info-item-text" style="width: 100%;color: #8a8a8e;font-size: 28rpx;padding-left: 32rpx;">规格型号:{{i.FEqModel || '-'}}</view>
|
||
<view class="card-info-item-text"
|
||
style="width: 100%;color: #8a8a8e;font-size: 28rpx;padding-left: 32rpx;">
|
||
备件库存:{{i.FQty ? i.FQty : '-'}}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
<view class="confirmBtn" @click="confirm">确定</view>
|
||
</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 Vue from 'vue';
|
||
import {
|
||
mapState,
|
||
mapMutations
|
||
} from 'vuex';
|
||
var commonUtil = require('../../../common/util.js');
|
||
export default {
|
||
computed: {
|
||
indicatorStyle() {
|
||
return {
|
||
background: 'rgba(255,0,0,.2)',
|
||
height: '40px',
|
||
};
|
||
},
|
||
...mapState(['userInfo'])
|
||
},
|
||
|
||
components: {
|
||
DateTimePicker,
|
||
imgUpload
|
||
},
|
||
|
||
data() {
|
||
return {
|
||
cameraType:0,
|
||
windowHeight:'',
|
||
scrollHeight:'',
|
||
scrollHeightPart:'',
|
||
currRecordList:[],
|
||
ticketDataInfo:[],
|
||
FOrderStatus:0,
|
||
dateString: '',
|
||
type: 'datetime-all',
|
||
FContentAndRequir:'',
|
||
FNote:'',
|
||
actualStarlist: [{
|
||
type: 'datetime-all',
|
||
// title: '展示年月日时分秒',
|
||
detail: '选择开始时间'
|
||
}],
|
||
actualEndlist: [{
|
||
type: 'datetime-all',
|
||
// title: '展示年月日时分秒',
|
||
detail: '选择结束时间'
|
||
}],
|
||
stopStarlist: [{
|
||
type: 'datetime-all',
|
||
// title: '展示年月日时分秒',
|
||
detail: '选择停机开始时间'
|
||
}],
|
||
stopEndlist: [{
|
||
type: 'datetime-all',
|
||
// title: '展示年月日时分秒',
|
||
detail: '选择停机结束时间'
|
||
}],
|
||
partList:[],
|
||
workerList:[],
|
||
otherShow:false,
|
||
workerShow:false,
|
||
submitShow:true,
|
||
OrderEntryInfo:[],
|
||
FInterID:'',
|
||
|
||
FMaintManID:[],
|
||
FMachinePartID:'',
|
||
selWorker:[],
|
||
empNO:'',
|
||
imgArray:new Array(),
|
||
clickEnable:true,
|
||
imgBase64Url:new Array(),
|
||
|
||
|
||
sparePartShow:false,
|
||
dataList: [],
|
||
orgid:'',
|
||
commitList:[],
|
||
userID:'',
|
||
selCondition:['全部备件查询', '设备编号查询', '备件名称查询', '设备编号+备件名称查询'],
|
||
selConditionIndex:0,
|
||
basicType:0,
|
||
equipID:'',
|
||
sparePartName:'',
|
||
curDate:'',
|
||
|
||
};
|
||
},
|
||
onLoad(options) {
|
||
const res = uni.getSystemInfoSync();
|
||
this.windowHeight = res.windowHeight;
|
||
this.scrollHeight = (this.windowHeight-190)+'px';
|
||
this.scrollHeightPart = (this.windowHeight-220)+'px';
|
||
let sysParameterCameraType = uni.getStorageSync('getSysParameterCameraType');
|
||
this.cameraType = parseInt(sysParameterCameraType);
|
||
this.userID = this.userInfo.ID;
|
||
let equipInfo = uni.getStorageSync('firstPageCurItemInfo');
|
||
this.equipID = equipInfo.FItemID;
|
||
this.currRecordList = uni.getStorageSync('currRecordList');
|
||
this.ticketDataInfo = uni.getStorageSync('ticketDataInfo');
|
||
this.orgid = uni.getStorageSync('orgid');
|
||
this.getReportInfo();
|
||
this.getWorkerInfo();
|
||
this.getPartList();
|
||
},
|
||
|
||
methods: {
|
||
getReportInfo(){
|
||
let _self = this;
|
||
let requestParams = {
|
||
"basicType":2,
|
||
"detailID":this.currRecordList.FDETAILID,
|
||
};
|
||
|
||
this.$request.get('/RepairOreder/MaintenanceOrderEntry',{params:requestParams}).then(res => {
|
||
let data = res;
|
||
this.FMaintManID = [];
|
||
if(data){
|
||
if(data.Body1.length>0){
|
||
this.OrderEntryInfo = data.Body1[0];
|
||
this.actualStarlist[0].detail = (this.OrderEntryInfo.FASTARTTIME?this.OrderEntryInfo.FASTARTTIME:"选择开始时间")
|
||
this.actualEndlist[0].detail = (this.OrderEntryInfo.FAENDTIME?this.OrderEntryInfo.FAENDTIME:"选择结束时间")
|
||
this.stopStarlist[0].detail = (this.OrderEntryInfo.FMACHINESTOPSTART?this.OrderEntryInfo.FMACHINESTOPSTART:"选择停机开始时间")
|
||
this.stopEndlist[0].detail = (this.OrderEntryInfo.FMACHINESTOPEND?this.OrderEntryInfo.FMACHINESTOPEND:"选择停机结束时间")
|
||
this.FOrderStatus = this.OrderEntryInfo.FORDERSTATUS;
|
||
this.FMachinePartID = this.OrderEntryInfo.FMACHINEPARTID;
|
||
this.FInterID = this.OrderEntryInfo.FINTERID;
|
||
this.FContentAndRequir = this.OrderEntryInfo.FCONTENTSANDREQUIREMENTS;
|
||
this.FNote = this.OrderEntryInfo.FNOTE;
|
||
if(this.OrderEntryInfo.FIMAGE){
|
||
this.imgArray.push(this.OrderEntryInfo.FIMAGE);
|
||
}
|
||
}
|
||
|
||
if(data.Body2.length>0){
|
||
data.Body2.forEach(
|
||
function(el){
|
||
let arr = {
|
||
FInterID:el.FSPAREPARTID,
|
||
FBillNO:_self.OrderEntryInfo.FBILLNO,
|
||
FName:el.FSPAREPARTNAME,
|
||
FEqModel:el.FEqModel,
|
||
FQty:el.FQTY
|
||
}
|
||
_self.partList.push(arr)
|
||
}
|
||
);
|
||
}
|
||
|
||
if(data.Body3.length>0){
|
||
data.Body3.forEach(
|
||
function(el){
|
||
let arr = {"FName":el.FEMPNAME,"FID":el.FMAINTMANID,"FACraftTime":el.FACRAFTTIME?el.FACRAFTTIME:0};
|
||
let arrID = {"FMaintID":el.FMAINTMANID,"FACraftTime":el.FACRAFTTIME?el.FACRAFTTIME:0};
|
||
_self.selWorker.push(arr);
|
||
_self.FMaintManID.push(arrID)
|
||
}
|
||
);
|
||
}
|
||
}
|
||
});
|
||
},
|
||
|
||
getWorkerInfo(){
|
||
let _self = this;
|
||
let orgID = uni.getStorageSync('orgID');
|
||
//+orgId
|
||
let requestParams = {
|
||
"basicType": 10,
|
||
"basicNO":this.empNO,
|
||
"orgId":orgID
|
||
};
|
||
|
||
this.$request.get('/SysConfigData/QueryResource',{params:requestParams}).then(res => {
|
||
let data = res;
|
||
if(data && data.length>0){
|
||
let workerList = data;
|
||
_self.workerList = workerList.map(
|
||
function(el){
|
||
return {
|
||
"FID":el.FID,
|
||
"FNO":el.FNO,
|
||
"FName":el.FNAME,
|
||
"FCOMPANYID":el.FCOMPANYID,
|
||
"isChoose":false,
|
||
"FACraftTime":''
|
||
}
|
||
}
|
||
);
|
||
}
|
||
});
|
||
},
|
||
spareListClick(){
|
||
this.submitShow = false;
|
||
this.otherShow = true;
|
||
this.sparePartShow = true;
|
||
},
|
||
workerListClick(){
|
||
this.otherShow = true;
|
||
this.workerShow = true;
|
||
this.submitShow = false;
|
||
},
|
||
hideAlter(){
|
||
this.otherShow = false;
|
||
this.workerShow = false;
|
||
this.sparePartShow = false;
|
||
this.submitShow = true;
|
||
},
|
||
chooseWorker:function(index){
|
||
this.workerList[index].isChoose = !this.workerList[index].isChoose;
|
||
this.selWorker = this.workerList.filter(
|
||
function(el){
|
||
return el.isChoose == true;
|
||
}
|
||
);
|
||
},
|
||
confirmWorker:function(){
|
||
if(this.selWorker.length>=1){
|
||
// this.FMaintManID = this.selWorker[0].FID;
|
||
let FMaintManIDList = [];
|
||
this.selWorker.forEach(
|
||
function(el){
|
||
let arr = {"FMaintID":el.FID,"FACraftTime":el.FACraftTime?el.FACraftTime:0};
|
||
FMaintManIDList.push(arr)
|
||
}
|
||
)
|
||
this.FMaintManID = FMaintManIDList;
|
||
this.otherShow = false;
|
||
this.workerShow = false;
|
||
this.submitShow = true;
|
||
}
|
||
// else if(this.selWorker.length>1){
|
||
// uni.showModal({
|
||
// title:"温馨提示",
|
||
// content:"只能选择一位保养人",
|
||
// showCancel:false
|
||
// })
|
||
// this.selWorker = [];
|
||
// return false;
|
||
// }
|
||
else{
|
||
uni.showModal({
|
||
title:"温馨提示",
|
||
content:"请至少选择一位保养人",
|
||
showCancel:false
|
||
})
|
||
return false;
|
||
}
|
||
},
|
||
workerDel(index){
|
||
this.selWorker.splice(index,1);
|
||
this.FMaintManID.splice(index,1);
|
||
},
|
||
beforeStarChanged(){
|
||
this.FOrderStatus = 0;
|
||
},
|
||
onGoingChanged(){
|
||
this.FOrderStatus = 1;
|
||
let date = new Date();
|
||
this.curDate = date.getFullYear()+'/'+(date.getMonth()+1)+'/'+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
|
||
console.log(this.curDate)
|
||
},
|
||
finishedChanged(){
|
||
this.FOrderStatus = 2;
|
||
let date = new Date();
|
||
this.curDate = date.getFullYear()+'/'+(date.getMonth()+1)+'/'+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
|
||
console.log(this.curDate)
|
||
},
|
||
actualStarDatePicker() {
|
||
this.type = 'datetime-all';
|
||
this.$refs['actualStarTime'].show();
|
||
},
|
||
actualStarTimeChange(value) {
|
||
let item = this.actualStarlist[0];
|
||
item['detail'] = value;
|
||
},
|
||
actualEndDatePicker() {
|
||
this.type = 'datetime-all';
|
||
this.$refs['actualEndTime'].show();
|
||
},
|
||
actualEndTimeChange(value) {
|
||
let item = this.actualEndlist[0];
|
||
item['detail'] = value;
|
||
},
|
||
stopStarDatePicker() {
|
||
this.type = 'datetime-all';
|
||
this.$refs['stopStarTime'].show();
|
||
},
|
||
stopStarTimeChange(value) {
|
||
let item = this.stopStarlist[0];
|
||
item['detail'] = value;
|
||
},
|
||
stopEndDatePicker() {
|
||
this.type = 'datetime-all';
|
||
this.$refs['stopEndTime'].show();
|
||
},
|
||
stopEndTimeChange(value) {
|
||
let item = this.stopEndlist[0];
|
||
item['detail'] = 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;
|
||
},
|
||
|
||
save(){
|
||
let _self = this;
|
||
// if(this.actualStarlist[0].detail =="选择开始时间 "||this.actualEndlist[0].detail =="选择结束时间 "||
|
||
// this.stopStarlist[0].detail =="选择停机开始时间 "||this.stopEndlist[0].detail =="选择停机结束时间 "){
|
||
// uni.showToast({
|
||
// icon:'none',
|
||
// title:"请选择时间"
|
||
// })
|
||
// return false;
|
||
// }
|
||
// let actualTimeResult = this.timeCompare(this.actualStarlist[0].detail,this.actualEndlist[0].detail);
|
||
// if(!actualTimeResult){
|
||
// uni.showToast({
|
||
// icon:'none',
|
||
// title:"实际结束时间需大于开始时间"
|
||
// })
|
||
// return actualTimeResult
|
||
// }
|
||
// let stopTimeResult = this.timeCompare(this.stopStarlist[0].detail,this.stopEndlist[0].detail);
|
||
// if(!stopTimeResult){
|
||
// uni.showToast({
|
||
// icon:'none',
|
||
// title:"停机结束时间需大于开始时间"
|
||
// })
|
||
// return stopTimeResult
|
||
// }
|
||
if(_self.$refs.imgUpload.imgArray.length > 0 && _self.$refs.imgUpload.imgArray != ""){
|
||
_self.uploadImageCurrent()
|
||
}
|
||
else {
|
||
_self.handleSubmit("");
|
||
}
|
||
},
|
||
|
||
handleSubmit(imagurl){
|
||
let _self = this;
|
||
this.imgBase64Url = imagurl;
|
||
let repair = [{"IsNew":1,"FInterID":this.FInterID,"FDetailID":this.currRecordList.FDETAILID,
|
||
"FMachinePartID":this.FMachinePartID,
|
||
// "FAStartTime":this.actualStarlist[0].detail,"FAEndTime":this.actualEndlist[0].detail,"FMachineStopStart":this.stopStarlist[0].detail,"FMachineStopEnd":this.stopEndlist[0].detail,
|
||
"FIsStopMachine":this.ticketDataInfo[0].FISSTOPMACHINE,"FNote":this.FNote,
|
||
"FOrderStatus":this.FOrderStatus,"FRequirements":this.FContentAndRequir,"FImage":this.imgBase64Url}]
|
||
let spareParts = this.partList;
|
||
let empData = this.FMaintManID;
|
||
let requestParams = {
|
||
"basicType":2,
|
||
"repair":repair,
|
||
"spareParts":spareParts,
|
||
"empData":empData
|
||
};
|
||
this.$request.post('/RepairOreder/MaintenanceReport',requestParams).then(res => {
|
||
let data = res;
|
||
if(data == "提交成功"){
|
||
uni.redirectTo({
|
||
url:'EQUM02Item'
|
||
})
|
||
}
|
||
});
|
||
},
|
||
|
||
uploadImageCurrent(){
|
||
let _self = this;
|
||
let imgCheck = false;
|
||
if(_self.$refs.imgUpload.imgArray.length > 0) {
|
||
let imgIndex = _self.$refs.imgUpload.imgArray[0].indexOf("http");
|
||
if(imgIndex != 0) {
|
||
imgCheck = true;
|
||
}
|
||
}
|
||
|
||
if(imgCheck) {
|
||
let url = _self.$global.globalData.requestUrl;
|
||
let fileName = _self.currRecordList.FDetailID +"-"+ Date.parse(new Date());
|
||
// _self.taskItem.SubItem[_self.currentIndex].imgArray = _self.$refs.imgUpload.imgArray;
|
||
|
||
_self.$refs.imgUpload.upload(
|
||
res=>{
|
||
let data = res[0];
|
||
if(data.StatusCode == "200") {
|
||
let imageUrl = data.Data;
|
||
// imageUrl = imageUrl + data.data;
|
||
// imageUrl = imageUrl.replace('"', '');
|
||
// imageUrl = imageUrl.replace('"', '');
|
||
// imageUrl = imageUrl.replace('\\', '');
|
||
// imageUrl = imageUrl.replace('\\', '/');
|
||
this.handleSubmit(imageUrl);
|
||
|
||
uni.showToast({
|
||
icon: 'success',
|
||
title: "图片上传成功"
|
||
});
|
||
}
|
||
else {
|
||
//用户没有上传图片的返回 code码为400
|
||
uni.showToast({
|
||
icon: 'none',
|
||
title: "图片上传失败"
|
||
});
|
||
}
|
||
},
|
||
_self.userInfo, fileName, url);
|
||
}
|
||
else{
|
||
let imageUrl = _self.$refs.imgUpload.imgArray[0];
|
||
this.handleSubmit(imageUrl);
|
||
}
|
||
|
||
return imgCheck;
|
||
},
|
||
|
||
bindPickerChange: function(e) {
|
||
this.selConditionIndex = e.target.value;
|
||
this.basicType = e.target.value;
|
||
},
|
||
|
||
getPartList(){
|
||
let requestParams = {
|
||
"basicType":this.basicType,
|
||
"equipID":this.equipID,
|
||
"sparePartName":this.sparePartName
|
||
};
|
||
|
||
this.$request.get('/SparePart/GetSparePart',{params:requestParams}).then(res => {
|
||
let _self = this;
|
||
let data = res
|
||
_self.dataList = [];
|
||
if(data && data.length>0){
|
||
data.forEach(
|
||
function(el){
|
||
let arr = {
|
||
FBillNO:el.FBILLNO,
|
||
FName:el.FNAME,
|
||
FEqModel:el.FEQMODEL,
|
||
FQty:el.FQTY,
|
||
FInterID:el.FINTERID,
|
||
num:0,
|
||
minForbidden:true
|
||
};
|
||
_self.dataList.push(arr);
|
||
}
|
||
);
|
||
}
|
||
});
|
||
},
|
||
|
||
partCountInput:function(item){
|
||
let _self = this;
|
||
item.num = parseInt(item.num);
|
||
let storageQty = parseInt(item.FQty);
|
||
if(item.num > storageQty){
|
||
uni.showModal({
|
||
title: '提示',
|
||
content:'领用数量不能大于库存数量',
|
||
showCancel:false,
|
||
success: function (res) {
|
||
if (res.confirm) {
|
||
item.num = 0;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
},
|
||
|
||
minClick:function(k){
|
||
let _self = this;
|
||
let index = k;
|
||
if(this.dataList[index].num<=0){
|
||
this.dataList[index].minForbidden = true
|
||
uni.showToast({
|
||
title:'数量不可小于0',
|
||
icon:'none'
|
||
})
|
||
return false
|
||
}else{
|
||
this.dataList[index].num = this.dataList[index].num - 1;
|
||
let storageQty = parseInt(this.dataList[index].FQty);
|
||
if(this.dataList[index].num > storageQty){
|
||
uni.showModal({
|
||
title: '提示',
|
||
content:'领用数量不能大于库存数量',
|
||
showCancel:false,
|
||
success: function (res) {
|
||
if (res.confirm) {
|
||
_self.dataList[index].num = 0;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
}
|
||
},
|
||
|
||
pluseClick:function(k){
|
||
let _self = this;
|
||
let index = k;
|
||
this.dataList[index].minForbidden = false;
|
||
this.dataList[index].num = Number(this.dataList[index].num)+ 1;
|
||
let storageQty = parseInt(this.dataList[index].FQty);
|
||
if(this.dataList[index].num > storageQty){
|
||
uni.showModal({
|
||
title: '提示',
|
||
content:'领用数量不能大于库存数量',
|
||
showCancel:false,
|
||
success: function (res) {
|
||
if (res.confirm) {
|
||
_self.dataList[index].num = 0;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
},
|
||
|
||
confirm(){
|
||
let _self = this;
|
||
_self.commitList = [];
|
||
if(this.dataList && this.dataList.length>0){
|
||
this.dataList.forEach(
|
||
function(el){
|
||
if(el.num != 0){
|
||
let arr = {
|
||
FBillNO:el.FBillNO,
|
||
FEqModel:el.FEqModel,
|
||
FInterID:el.FInterID,
|
||
FName:el.FName,
|
||
FQty:el.num
|
||
};
|
||
_self.commitList.push(arr)
|
||
}
|
||
}
|
||
);
|
||
this.partList = this.commitList;
|
||
}else{
|
||
uni.showToast({
|
||
title:'当前未领用备件',
|
||
icon:'none'
|
||
})
|
||
this.partList = this.commitList;
|
||
}
|
||
this.otherShow = false;
|
||
this.sparePartShow = false;
|
||
this.submitShow = true;
|
||
},
|
||
partDel(index){
|
||
this.partList.splice(index,1)
|
||
}
|
||
|
||
}
|
||
};
|
||
</script>
|
||
<style lang="scss">
|
||
page {
|
||
background-color: #F7F7F7;
|
||
overflow-x: hidden;
|
||
}
|
||
.report{
|
||
overflow-x: hidden;
|
||
}
|
||
.card-list-report{
|
||
position: relative;
|
||
width: 100%;
|
||
display: flex;
|
||
flex-direction:row;
|
||
flex-wrap: nowrap;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
padding: 20rpx 0;
|
||
}
|
||
.card-info-title-text-detail-left-report{position: absolute;right: 0;}
|
||
.img-report{position: absolute;right: 0;height: 20rpx;width: 20rpx;}
|
||
.card-info-item-text{text-align: left;}
|
||
span{font-size: 24rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: #cacaca;margin-left: 16rpx;}
|
||
.alter{
|
||
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;
|
||
}
|
||
|
||
.confirmBtn{
|
||
height: 80rpx;
|
||
line-height: 80rpx;
|
||
width: 100%;
|
||
font-size: 32rpx;
|
||
color: #FFFFFF;
|
||
text-align: center;
|
||
background-color: #2560C9;
|
||
position: fixed;
|
||
bottom: 0;
|
||
}
|
||
.fixed-bottom {
|
||
height: 80rpx;
|
||
background-color: #2f7fe3;
|
||
font-size: 16px;
|
||
text-align: center;
|
||
line-height: 80rpx;
|
||
color: #fff;
|
||
position: fixed;
|
||
bottom: 0;
|
||
z-index: 20;
|
||
width: 100%;
|
||
}
|
||
</style>
|
||
|