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

995 lines
30 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="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="gray-title-spare" @click="equipPartClick" v-show="isAddRepairRecode">
<view style="font-size: 26rpx;">
选择部件
</view>
<image src="../../../static/myinfo/right-arrow.png"
style="width: 30rpx;height: 30rpx;margin-right: 10%;"></image>
</view>
<view class="gray-title-spare" v-for="(item,index) in equipPartSelList" :key="index">
<view style="font-size: 22rpx;color: #6D6D72;">
{{item.FName}}
</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)"/>未执行
<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" v-show="isAddRepairRecode">维修部件</view>
<view class="card-list" style="flex-direction: column;" v-show="isAddRepairRecode">
<view class="card-list-report" v-for="(item,index) in equipPartSelList" :key="index" style="border-bottom: 1px solid #f5f5f5;">
<image class="img-left-small" src="../../../static/emapp/del_red.png" @click="equipPartDel(index)"></image>
<view class="card-info-title-text-detail-left">{{item.FName}}</view>
</view>
<view class="card-list-report" @click="equipPartClick">
<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 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 @click="save" class="fixed-bottom" v-show="submitShow">提交</view>
<view class="alter" v-if="otherShow" @click="hideAlter"></view>
<view class="worker-alter" v-if="equipPartShow">
<scroll-view scroll-y="true" :style="{'height':scrollHeight}">
<view class="card-list" v-for="(item,index) in equipPartList" style="margin: 24rpx 32rpx;">
<image class="img-left-middle" src="../../../static/emapp/part_blue.png" v-if="item.isChoose"></image>
<image class="img-left-middle" src="../../../static/emapp/part_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>
<checkbox :checked="item.isChoose" @click="chooseEquipPart(index)"
style="transform: scale(0.7);position: absolute;right: 0;"></checkbox>
</view>
</scroll-view>
<view class="worker-alter-confirm" @click="confirmEquipPart">确定</view>
</view>
<view class="worker-alter" v-if="workerShow" :style="{'height':scrollHeight}">
<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" type="number"
: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 style="height: 200rpx;width: 100%;"></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:'',
IsNew:1,
FMaintManID:[],
FMachinePartID:'',
selWorker:[],
empNO:'',
imgArray:new Array(),
imgBase64Url:new Array(),
equipPartList:[],
equipPartSelList:[],
equipPartShow:false,
sparePartShow:false,
dataList: [],
orgid:'',
commitList:[],
userID:'',
selCondition:['全部备件查询', '设备编号查询', '备件名称查询', '设备编号+备件名称查询'],
selConditionIndex:0,
basicType:0,
equipID:'',
sparePartName:'',
isAddRepairRecode:false,
curDate: '',
};
},
onLoad(options) {
//debugger
const res = uni.getSystemInfoSync();
this.windowHeight = res.windowHeight;
this.scrollHeight = (this.windowHeight-180)+'px';
this.scrollHeightPart = (this.windowHeight-220)+'px';
let sysParameterCameraType = uni.getStorageSync('getSysParameterCameraType');
this.cameraType = parseInt(sysParameterCameraType);
this.userID = this.userInfo.ID;
this.orgid = uni.getStorageSync('orgid');
let firstPageInfo = uni.getStorageSync('firstPageCurItemInfoRepair');
if(Object.keys(options).length==0){
this.isAddRepairRecode = false;
this.currRecordList = uni.getStorageSync('currRecordListRepair');
this.ticketDataInfo = uni.getStorageSync('ticketDataInfoRepair');
this.FInterID = this.ticketDataInfo[0].FINTERID;
this.equipID = this.ticketDataInfo[0].FITEMID;
this.getReportInfo();
this.getWorkerInfo();
this.getPartList();
}else{
this.isAddRepairRecode = true;
this.ticketDataInfo = uni.getStorageSync('ticketDataInfoRepair');
this.FInterID = this.ticketDataInfo[0].FINTERID;
this.equipID = this.ticketDataInfo[0].FITEMID;
this.getWorkerInfo();
this.getPartList();
this.getEquipPartList(this.equipID);
}
},
methods: {
getReportInfo(){
let _self = this;
let requestParams = {
"basicType":1,
"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.FOrderStatus = this.OrderEntryInfo.FOrderStatus;
if(this.FOrderStatus == 3){
this.submitShow = false;
}
this.FCondition = this.OrderEntryInfo.FCONDITION;
this.FScore = this.OrderEntryInfo.FSCORE;
this.FExplain = this.OrderEntryInfo.FEXPLAIN;
this.FMachinePartID = this.OrderEntryInfo.FMACHINEPARTID;
this.FInterID = this.OrderEntryInfo.FINTERID;
this.FContentAndRequir = this.OrderEntryInfo.FCONTENTSANDREQUIREMENTS;
this.FNote = this.OrderEntryInfo.FNOTE
}
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)
}
);
}
console.log(_self.selWorker)
}
});
},
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
}
}
)
}
});
},
equipPartClick(){
this.otherShow = true;
this.equipPartShow = true;
this.submitShow = false;
},
chooseEquipPart:function(index){
this.equipPartList[index].isChoose = !this.equipPartList[index].isChoose;
this.equipPartSelList = this.equipPartList.filter(
function(el){
return el.isChoose == true;
}
);
},
confirmEquipPart:function(){
if(this.equipPartSelList.length==1){
this.FMachinePartID = this.equipPartSelList[0].FID;
this.otherShow = false;
this.equipPartShow = false;
this.submitShow = true;
}
else if(this.equipPartSelList.length>1){
uni.showModal({
title:"温馨提示",
content:"只能选择一个部件",
showCancel:false
})
this.equipPartSelList = [];
return false;
}
else{
uni.showModal({
title:"温馨提示",
content:"请选择一个部件",
showCancel:false
})
return false;
}
},
equipPartDel(index){
this.equipPartSelList.splice(index,1);
this.FMachinePartID = ''
},
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.equipPartShow = 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;
}
);
},
workerDel(index) {
this.selWorker.splice(index, 1);
this.FMaintManID.splice(index, 1);
},
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;
},
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(_self.$refs.imgUpload.imgArray.length > 0 && _self.$refs.imgUpload.imgArray != ""){
_self.uploadImageCurrent()
}
else {
_self.handleSubmit("")
}
},
handleSubmit(imagurl){
let _self = this;
let FIsStopMachine = true;
if(this.isAddRepairRecode){
FIsStopMachine = true;
this.IsNew = 1;
if(this.FMachinePartID.length<=0){
uni.showModal({
title:"温馨提示",
content:"请选择一个部件",
showCancel:false
})
return false;
}
}else{
this.IsNew = 0;
FIsStopMachine = this.ticketDataInfo[0].FISSTOPMACHINE;
}
this.imgBase64Url = imagurl;
let repair = [{"IsNew":this.IsNew,"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":FIsStopMachine,"FNote":this.FNote,
"FOrderStatus":this.FOrderStatus,"FRequirements":this.FContentAndRequir,"FImage":this.imgBase64Url}]
let spareParts = this.partList;
let empData = this.FMaintManID;
let requestParams = {
"basicType":1,
"repair":repair,
"empData": empData,
"spareParts":spareParts,
};
this.$request.post('/RepairOreder/MaintenanceReport',requestParams).then(res => {
let data = res;
uni.redirectTo({
url:'EQUM03Item'
});
});
},
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(){
//debugger
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 <0) {
item.num = 0;
uni.showToast({
title:'数量不能小于0',
icon:'none'
})
return
}
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;
}
}
});
}
},
partDel(index) {
this.partList.splice(index, 1)
},
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;
}
this.otherShow = false;
this.sparePartShow = false;
this.submitShow = true;
}
}
};
</script>
<style lang="scss">
page {
background-color: #F7F7F7;
// overflow: hidden;
}
.report{overflow: 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;
align-items: center;
// justify-content: space-between;
// flex-direction: column;
}
.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>