Commit f0efef33 authored by 上官's avatar 上官

调整同步

parent 49c805ce
......@@ -8,95 +8,152 @@
<link href="../dest/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../dest/css/mui.picker.min.css" />
<style type="text/css">
th{
th {
border-width: 1px;
border-style: solid;
border-color: #a9c6c9;
}
.altrowstable {
border-width: 1px;
/*padding: 2px;*/
border-style: solid;
border-color: #a9c6c9;
background: white;
height:200%;
height: 200%;
/*background-color: #F6F6F6;*/
}
.mui-backdrop {position: fixed;top:251px;right: 10px;bottom: 5px;left: 698px;z-index: 998;background-color: rgba(0,0,0,.3);}
</style>
</head>
<body>
<div id="app">
<div class="mui-content" >
<div class="mui-content">
<div id="left" style=" display: inline-block; width: 30%; ">
<div id="left-1" style="position: absolute; top: 1px;">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @tap="back"></a>
<label style=" text-align: center; position: relative; left: 50px;">今日完成数量:{{number}} </label>
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @click="back"></a>
<label style=" text-align: center; position: relative; left: 50px;">今日完成数量:{{number}} </label>
</div>
<div id="left-2" >
<table class="mui-table" style=" position: relative;top: -440px;">
<thead class="mui-table-view">
<div id="left-2">
<table class="mui-table" style=" position: relative;top: -432px; ">
<tbody class="mui-table-view-cell" >
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">指令号</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">数量</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;width: 30%;">时间</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;width: 50% ">指令号</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;width: 19%; ">数量</th>
</tr>
</thead>
</table>
<div class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block; width: 30%; top: 45px;">
</tbody>
</table>
<div id="item1" class="mui-scroll-wrapper scroll1" style=" border: solid #DAE6EF 1px ;height: 480px; background: white; display: inline-block; width: 30%; top: 49px;">
<div class="mui-scroll">
<table class="mui-table">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @tap="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @click="selectReport(item.ReportID)">
<td style="width: 30%;" align="center">{{item.Date}}</td>
<td style="width: 50% " align="center">{{item.IndexNo}}</td>
<td style="width: 19%;" align="center">{{item.Qty}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div id="item2" class="mui-scroll-wrapper scroll2" :style="display_" style=" border: solid #DAE6EF 1px ;height: 480px; background: white; display: inline-block; width: 30%; top: 49px;">
<div class="mui-scroll">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID2_'+item.ReportID" class="Report" v-for=" item in itemsLeft2" @click="selectReport2(item.ReportID)">
<td style="width: 30%;" align="center">{{item.Date}}</td>
<td style="width: 50%;" align="center">{{item.IndexNo}}</td>
<td style="width: 19%;" align="center">{{item.Qty}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div class="mui-segmented-control" style="position: relative;top: 50px;">
<a id="n1" class="mui-control-item mui-active" @click="selectDisplay(1)" >今日实报</a>
<a id="n2" class="mui-control-item " @click="selectDisplay(2)" >单款实报</a>
</div>
</div>
</div>
<div id="right" style=" display: inline-block; width: 69%; ">
<div id="right-1" style=" ">
<div id="right" style=" display: inline-block; width: 69.5%; ">
<div id="right-1" style="">
<div style="border: solid #DCDCE1 1px ; display: inline-block; width: 10%; position: relative;top: -20px; height: 38px;">
<button style="text-align: center;border-style:none; width: 100%;height: 100%; background: white;">指令号:</button>
<button style="text-align: center;border-style:none; width: 100%;height: 100%; background: white;">指令号:</button>
</div>
<div class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" style=" display: inline-block; width: 66%; position: relative;top: 1px;">
<div class="mui-scroll-wrapper scroll3 mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" style=" display: inline-block; width: 64.5%; position: relative;top: 1px;">
<div class="mui-scroll">
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index mui-active" style="background:#02C1ED ;" v-for="itemh,i in itemsHead" v-if= "i == 0" @tap="selectIndex(itemh.IndexID)">
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index mui-active" style="background:#02C1ED ;" v-for="itemh,i in itemsHead"
v-if="i == 0" @tap="selectIndex(itemh.IndexID)">
<img src="../dest/img/00.png" v-if="itemh.CompleteRatio ==0 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/12.5.png" v-if=" itemh.CompleteRatio>0 && itemh.CompleteRatio<= 12.5 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/25.png" v-if=" itemh.CompleteRatio>12.5 && itemh.CompleteRatio<= 25 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/37.5.png" v-if=" itemh.CompleteRatio>25 && itemh.CompleteRatio<= 37.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/50.png" v-if=" itemh.CompleteRatio>37.5 && itemh.CompleteRatio<= 50" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/62.5.png" v-if=" itemh.CompleteRatio>50 && itemh.CompleteRatio<= 62.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/75.png" v-if=" itemh.CompleteRatio>62.5 && itemh.CompleteRatio<= 75" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/87.5.png" v-if=" itemh.CompleteRatio>75 && itemh.CompleteRatio<100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/100.png" v-if=" itemh.CompleteRatio== 100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
{{itemh.IndexNo}}
</a>
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index" style="" v-for="itemh,i in itemsHead" v-if= "i != 0" @tap="selectIndex(itemh.IndexID)">
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index" style="" v-for="itemh,i in itemsHead" v-if="i != 0"
@tap="selectIndex(itemh.IndexID)">
<img src="../dest/img/00.png" v-if="itemh.CompleteRatio ==0 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/12.5.png" v-if=" itemh.CompleteRatio>0 && itemh.CompleteRatio<= 12.5 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/25.png" v-if=" itemh.CompleteRatio>12.5 && itemh.CompleteRatio<= 25 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/37.5.png" v-if=" itemh.CompleteRatio>25 && itemh.CompleteRatio<= 37.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/50.png" v-if=" itemh.CompleteRatio>37.5 && itemh.CompleteRatio<= 50" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/62.5.png" v-if=" itemh.CompleteRatio>50 && itemh.CompleteRatio<= 62.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/75.png" v-if=" itemh.CompleteRatio>62.5 && itemh.CompleteRatio<= 75" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/87.5.png" v-if=" itemh.CompleteRatio>75 && itemh.CompleteRatio< 100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/100.png" v-if=" itemh.CompleteRatio== 100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
{{itemh.IndexNo}}
</a>
</div>
</div>
<div style=" ; display: inline-block; width: 22% ;position: relative;top: -20px; height: 38px; ">
<a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="margin-top: 5px" @tap="nextday(-1)"></a>
<a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="margin-left: -15px;margin-top: 5px" @tap="nextday(-1)"></a>
<button style=" width: 60%;height: 100%; margin-left: -5px" id="selectdate" data-options='{"type":"date"}' name="shipdate" @tap="selecttime()">{{dateTime}}</button>
<a class=" mui-icon mui-icon-arrowright mui-pull-right" style="margin-left: -15px;margin-top: 5px" @tap="nextday(1)"></a>
<a class=" mui-icon mui-icon-arrowright mui-pull-right" style="margin-left: -15px;margin-top: 5px" @tap="nextday(1)"></a>
<div style=" ; display: inline-block; width: 24% ;position: relative;top: -20px; height: 38px; ">
<button class="mui-icon mui-icon-arrowleft mui-btn-outlined ;" style="border: 0px ; color:royalblue; width: 23%;height: 100%; text-align: left; padding-left:0px ;"
@click="nextday(-1)">
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-top: 5px" @click="nextday(-1)"></a> -->
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-left: -15px;margin-top: 5px" @click="nextday(-1)"></a> -->
</button>
<button class="mui-btn-outlined" style="padding-left: 6px; width: 54%;height: 100%; margin-left: -4px" id="selectdate"
data-options='{"type":"date"}' name="shipdate" @click="selecttime()">{{dateTime}}</button>
<button class="mui-icon mui-icon-arrowright mui-btn-outlined" style=" border: 0px;color:royalblue;margin-left: -4px; width: 20%;height: 100%; padding:0px ;"
@click="nextday(1)">
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-top: 5px" @click="nextday(-1)"></a> -->
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-left: -15px;margin-top: 5px" @click="nextday(-1)"></a> -->
</button>
</div>
</div>
<div id="right-2" style="">
<div id="right-2" style="margin-top: -20px;">
<div style="border: solid #DAE6EF 1px ; display: inline-block; width: 80%;">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
......@@ -123,16 +180,16 @@
</div>
<div style=" display: inline-block; width: 17%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @tap="reportDelete()" >撤回实报</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_qq" @tap ="nextPage()">品质问题</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @click="reportDelete()">撤回实报</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_qq_" @click="nextPage(1,0)">品质问题</button>
</div>
</div>
<div id="right-4" style=" margin-top: 10px ;">
<div style=" display: inline-block; width: 60%; position: relative;top: -230px;">
<table class="mui-table ">
<div id="right-4" style=" margin-top: -20px ;">
<div style=" display: inline-block; width: 60%; position: relative;top: -315px;">
<table class="mui-table ">
<thead class="mui-table-view">
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">尺码</th>
......@@ -141,52 +198,69 @@
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">不合格数</th>
</tr>
</thead>
</table>
<div class="mui-scroll-wrapper " style=" border: #DAE6EF solid 1px; display: inline-block; height: 270px;background: white; top:22px;">
<div class="mui-scroll">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr v-for="itemdetail,isize in itemsDetail1" @tap="selectSize(itemdetail.SizeName)">
<td class="altrowstable bg " style="height: 50px" :style="stylebg(isize)" align="center" >{{itemdetail.SizeName}}</td>
<td class="altrowstable" align="center">{{itemdetail.Qty}}</td>
<td class="altrowstable" align="center">{{itemdetail.QualifiedQty}}</td>
<td class="altrowstable" align="center">{{itemdetail.UnQualifiedQty}}</td>
</tr>
</tbody>
</table>
<div class="mui-scroll-wrapper scroll4 " style=" border: #DAE6EF solid 1px; display: inline-block; height: 365px;background: white; top:22px;">
<div class="mui-scroll">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr v-for="itemdetail,isize in itemsDetail1" @click="selectSize(itemdetail.SizeName)">
<td class="altrowstable bg " style="height: 50px" align="center">{{itemdetail.SizeName}}</td>
<td class="altrowstable" align="center">{{itemdetail.Qty}}</td>
<td class="altrowstable" align="center">{{itemdetail.QualifiedQty}}</td>
<td class="altrowstable" @click ="nextPage(2,itemdetail.SizeName)" align="center">{{itemdetail.UnQualifiedQty}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style=" display: inline-block; width: 38%;">
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 160px ;height: 60px;margin-right: -4px; text-align: center;color: red;background: #C8C7CC; "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
:onchange="changeValue()"/>
<button style=" width: 80px;height: 60px;" @tap="backNumber(1)"> ←</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(1)" > 1</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(2)"> 2</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(3)"> 3</button>
<button style=" width: 80px; height: 60px;margin-right: -4px " @tap="selectNumber(4)"> 4</button>
<button style=" width: 80px; height: 60px;margin-right: -4px" @tap="selectNumber(5)"> 5</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(6)"> 6</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(7)"> 7</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(8)"> 8</button>
<button style=" width: 80px;height: 60px;"> 9</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 160px;height: 60px; " @tap="submit" :disabled="disable_save_button_C"> 提交</button>
<div>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;"
@click="sop">SOP</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;"
:disabled="disable_qq_" @click="submitZD">整单完工</button>
</div>
<div>
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 170px ;height: 65px;margin-right: -6px;margin-bottom: -1px; text-align: center;color: red;background: #C8C7CC;font-size: 25px "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty" :onchange="changeValue()" />
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="backNumber(1)"> ←</button>
<button style=" width: 85px;height: 65px; margin-right: -6px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(1)">
1</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(2)">
2</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(3)">
3</button>
<button style=" width: 85px; height: 65px;margin-right: -6px ;margin-bottom: -1px;font-size: 25px" @click="selectNumber(4)">
4</button>
<button style=" width: 85px; height: 65px;margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(5)">
5</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(6)"> 6</button>
<button style=" width: 85px;height: 65px ;margin-bottom: -1px;; margin-right: -6px;font-size: 25px" @click="selectNumber(7)">
7</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;; margin-right: -5px;font-size: 25px" @click="selectNumber(8)">
8</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(9)"> 9</button>
<button style=" width: 85px;height: 65px; margin-right: -6px;font-size: 25px" @click="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 170px;height: 65px; " @click="submit" :disabled="disable_save_button_C">
提交</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../dest/js/mui.min.js"></script>
<script src="../dest/js/mui.picker.min.js"></script>
<script src="../dest/js/createView.min.js"></script>
......@@ -199,7 +273,7 @@
});
function initPage() {
plus.screen.lockOrientation("landscape-secondary") //横屏
plus.screen.lockOrientation("landscape-primary") //横屏
app.init();
}
......@@ -211,84 +285,117 @@
qty: 0,
size: 0,
dateTime: "",
dateTimeFull :new Date(),
today: "",
link:"",
itemsDetail: [], //订单明细
itemsDetail1: [],
itemsDetail2: [],
itemsHead: [],
itemsLeft: [],
itemsLeft2:[],
itemsSize: [],
SizeQty: [],
itemsSizeDef:[40,41,42,43,44,45,46],
ReportType :0 ,
IndexID: 0,
// disable_save_button: 'disabled',
disable_reportDelete: 'disabled',
disable_qq:null,
disable_qq: 'disabled',
ReportID: 0,
Model:0,
Report_IndexID: 0,
Model: 0,
CompleteRatio: 0, //完成进度
displayModel:1,
zhezhao :1, //
mask_: mui.createMask(function(e){return false;}),
},
computed:{
disable_save_button_C :function(){
if(this.size !=0 && this.qty !=0 && this.IndexID !=0 && this.Model == 0 ){
computed: {
disable_save_button_C: function() {
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
else {
return 'disabled' ;
},
disable_qq_: function() {
if (this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
},
display_:function(){
if(this.displayModel ==1 ){
return "display: none "
}
}
},
methods: {
init: function() {
mui.init();
window.addEventListener('back', function(e) {
var that = this;
app.getDataDetail1();
});
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.dateTime = new Date().toLocaleDateString();
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.today = this.dateTime;
this.getData();
},
getData: function() {
var that = this;
var tempdate = this.dateTime + " 00:00:00";
this.createZhezhao(-1)
var para = {
ReportType: 0,
ReportType: this.ReportType,
Date: tempdate
};
Api.post('/api/vMES/ProductionReport/ProductIndexNo', para, function(e) {
that.itemsHead = e.items;
if (e.items.length > 0) {
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
that.getDataDetail1();
that.getDataDetail2();
that.getDataDetail2(1);
that.getTatolNum();
that.qty = 0;
that.disable_reportDelete = 'disabled';
} else {
that.itemsDetail = [];
that.IndexID = 0;
that.itemsDetail1 = [];
that.itemsSize = [];
that.size = 0;
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
that.getDataDetail2(1);
that.getTatolNum();
that.qty=0;
that.disable_reportDelete='disabled';
}
else{
that.itemsDetail=[];
that.IndexID =0;
that.itemsDetail1 =[];
that.itemsSize=[];
that.size=0;
that.itemsLeft=[];
that.number=0;
that.qty=0;
that.disable_reportDelete='disabled'
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getDataDetail1: function() {
......@@ -296,91 +403,209 @@
var para = {
IndexID: this.IndexID,
};
if(this.IndexID == 0){
return;
}
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
console.log("eeee:::" +JSON.stringify(e))
that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName;
// that.size = e.data.SizeName[0];
if(e.success){
that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getDataDetail2: function() {
getDataDetail2: function(n) {
//n= 1 今日时报 n=2 单款时报
var that = this;
var para = {
ReportType: 0,
Date: this.dateTime + " 00:00:00",
IndexID: this.IndexID,
ReportType: this.ReportType,
IndexID: n==1 ? 0 : this.IndexID ,
PageSize: 200,
PageIndex: 1,
};
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
that.itemsLeft = e.items;
// console.log(JSON.stringify(para))
if( n ==1 ){
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
that.itemsLeft = e.items;
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
}
else if( n ==2){
if( this.IndexID == 0)
{
that.itemsLeft2 =[];
}
else{
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
that.itemsLeft2 = e.items;
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
}
}
},
getTatolNum: function() {
var that = this;
var para = {
ReportType: 0,
ReportType: this.ReportType,
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/ProductionReport/TotalQty', para, function(e) {
that.number = e.data;
if(e.success){
that.number = e.data;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
//完成进度
getCompleteRatio: function(n) {
var that = this;
var para = {
IndexID: n
};
if(n == 0){
return;
}
// console.log(JSON.stringify(para))
Api.post('/api/vMES/ProductionReport/IndexNoCompleteRatio', para, function(e) {
that.CompleteRatio = e.data;
// console.log(JSON.stringify(e))
for (var i = 0; i < that.itemsHead.length; i++) {
if (that.itemsHead[i].IndexID == n) {
that.itemsHead[i].CompleteRatio = that.CompleteRatio;
// console.log(that.CompleteRatio);
}
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
reportDelete: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/ProductionReport/Delete', para, function(e) {
if(e.success){
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.selectReport(0)
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.Model =0 ;
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + e.success.message)
if (e.success) {
that.createZhezhao(-1)
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.getCompleteRatio(that.Report_IndexID); //订单进度
that.selectSize(0);
that.selectReport(0);
that.selectReport2(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2);
that.Model = 0;
if(that.IndexID != 0){
var Index = document.getElementById("Index_" + that.IndexID)
Index.style.background = "#02C1ED" ;
}
mui.toast("撤回成功")
} else {
mui.toast("撤回失败" + e.message)
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getDataByReportID:function(){
getDataByReportID: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/ProductionReport/ReportIndexNoDetail', para, function(e) {
if(e.success){
if (e.success) {
that.itemsDetail = e.data;
that.itemsSize =e.data.SizeName;
that.itemsDetail1 = e.data.ReportDetail ;
that.itemsSize = e.data.SizeName;
that.itemsDetail1 = e.data.ReportDetail;
that.size = e.data.ReportSizeName;
that.qty = e.data.ReportQty;
that.selectSize(e.data.ReportSizeName);
} else {
mui.toast("获取明细失败:" + e.message)
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getLink:function(){
var that = this;
var para ={
ReportType: this.ReportType,
StyleCode: this.itemsDetail.StyleCode
}
// console.log( JSON.stringify(para))
Api.post('/api/vMES/Sop/StyleSop', para, function(e) {
if(e.success){
// console.log( JSON.stringify(e))
that.link = e.data.Url ;
var url_ = "sop.html";
var id_ = "sop.html";
mui.openWindow({
url: url_,
id: id_,
extras: {
style:that.itemsDetail.StyleCode,
ReportType:that.ReportType,
link :that.link,
parentPage: "Cutting.html"
},
});
}
else{
mui.toast("获取明细失败:" + e.message)
mui.toast("获取sop地址失败: " + e.message)
}
},function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
SizeQtyA: function() {
for (var i = 0; i < this.itemsSize.length; i++) {
......@@ -388,7 +613,7 @@
size: this.itemsSize[i],
qty: 0
}
this.SizeQty.push(tempa);
}
},
......@@ -403,79 +628,160 @@
}
var that = this;
Api.post('/api/vMES/ProductionReport/Save', para, function(e) {
if (e.success) {
// that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 今日实报
that.getDataDetail2(2); //获取左边列表明细 单款实报
that.getCompleteRatio(that.IndexID) //订单进度
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.message);
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
mui.toast(JSON.stringify(bbb.message))
});
},
selectIndex:function(idx){
submitZD: function() {
var btnArray = ['否', '是'];
var that = this;
mui.confirm('请确认是否整单完工?', '提示', btnArray, function(e) {
if (e.index == 1) {
var para = {
ReportType: this.ReportType,
IndexID: that.IndexID,
}
// console.log(JSON.stringify(para));
// console.log(JSON.stringify(para));
Api.post('/api/vMES/ProductionReport/SingleComplete', para, function(e) {
if (e.success) {
// that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getCompleteRatio(that.IndexID) //订单进度
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.message);
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
} else {
return;
}
})
},
selectIndex: function(idx) {
this.createZhezhao(-1)//关闭遮罩
var indxx = document.getElementsByClassName("Index");
// if (this.Model == 1) {
// setTimeout(function() {
//
// for (var i = 0; i < indxx.length; i++) {
//
// indxx[i].className ="mui-control-item Index"
// }
//
// }, 50);
//
// return;
// }
var indx = document.getElementById("Index_" + idx)
var indx = document.getElementById("Index_" + idx)
for (var i = 0; i < indxx.length; i++) {
indxx[i].style.background ="";
indxx[i].style.background = "";
}
indx.style.background = "#02C1ED";
this.IndexID = idx
this.Model =0
if(this.IndexID != 0){
this.Model = 0
if (this.IndexID != 0) {
this.getDataDetail1();
this.getDataDetail2();
this.getDataDetail2(1);
this.getDataDetail2(2);
this.getTatolNum();
this.selectSize(0);
this.selectReport(0);
this.qty=0;
this.size=0;
this.disable_reportDelete='disabled';
this.qty = 0;
this.size = 0;
this.disable_reportDelete = 'disabled';
} else {
this.itemsDetail = [];
this.IndexID = 0;
this.itemsDetail1 = [];
this.itemsSize = [];
this.size = 0;
this.itemsLeft = [];
this.number = 0;
this.qty = 0;
this.disable_reportDelete = 'disabled'
}
else{
this.itemsDetail=[];
this.IndexID =0;
this.itemsDetail1 =[];
this.itemsSize=[];
this.size=0;
this.itemsLeft=[];
this.number=0;
this.qty=0;
this.disable_reportDelete='disabled'
mui('.scroll1').scroll().scrollTo(0,0,100);
mui('.scroll2').scroll().scrollTo(0,0,100);
// mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100);
},
createZhezhao:function(n){
// console.log(n)
if(n== -1){
// var mask = mui.createMask();//callback为用户点击蒙版时自动执行的回调;
// this.mask_.close();
this.mask_._remove()
this.zhezhao = 1;
}
else{
if (this.zhezhao == 1 ){
// var mask = mui.createMask(function(e){
// return false;
//
// });//callback为用户点击蒙版时自动执行的回调;
this.mask_.show();//显示遮罩
this.zhezhao = 2
// mask.close();//关闭遮罩
}
}
},
selectReport: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
if (obj == 0) {
this.Report_IndexID = 0
} else {
this.createZhezhao(1)
for (var i = 0; i < this.itemsLeft.length; i++) {
if (this.itemsLeft[i].ReportID == obj) {
this.Report_IndexID = this.itemsLeft[i].IndexID
}
}
}
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
......@@ -484,24 +790,95 @@
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(obj != 0){
if (obj != 0) {
if(this.IndexID != 0){
var Index = document.getElementById("Index_" + this.IndexID)
Index.style.background = "";
}
op.style.background = "#02C1ED";
this.Model =1 ;
this.Model = 1;
this.getDataByReportID();
}
},
selectReport2: function(obj) {
var op = document.getElementById("ReportID2_" + obj)
this.ReportID = obj;
if (obj == 0) {
this.Report_IndexID = 0
} else {
this.createZhezhao(1)
for (var i = 0; i < this.itemsLeft2.length; i++) {
if (this.itemsLeft2[i].ReportID == obj) {
this.Report_IndexID = this.itemsLeft2[i].IndexID
}
}
}
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
var reportele = document.getElementsByClassName("Report");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if (obj != 0) {
if(this.IndexID != 0){
var Index = document.getElementById("Index_" + this.IndexID)
Index.style.background = "";
}
op.style.background = "#02C1ED";
this.Model = 1;
this.getDataByReportID();
}
},
selectDisplay:function(n){
var opt = document.getElementById("item1" )
var opt2 = document.getElementById("item2" )
var n1 = document.getElementById("n1" )
var n2 = document.getElementById("n2" )
if( n== 1){
n1.style.background ="royalblue"
n1.style.color = "white"
n2.style.background ="white"
n2.style.color = "royalblue"
opt.style.display ="inline-block";
opt2.style.display = "none"
}
if(n== 2){
this.getDataDetail2(2)
n1.style.background ="white"
n1.style.color = "royalblue"
n2.style.background ="royalblue"
n2.style.color = "white"
opt.style.display ="none";
opt2.style.display = "inline-block"
}
},
changeValue: function() {
if (isNaN(parseInt(this.qty))) {
this.qty = 0;
// this.disable_save_button = 'disabled';
}
if (parseInt(this.qty) > 0) {
this.qty = parseInt(this.qty);
// this.disable_save_button = null;
}
},
checkValue: function() {
......@@ -521,61 +898,71 @@
return true;
}
},
backNumber:function(){
if (this.Model == 1) {
return;
}
var str =this.qty.toString();
this.qty = str.substring(0, str.length - 1);
backNumber: function() {
if (this.Model == 1) {
return;
}
var str = this.qty.toString();
this.qty = str.substring(0, str.length - 1);
},
selectNumber: function(n) {
if (this.Model == 1) {
return;
}
this.qty = this.qty.toString()+ n.toString();
this.qty = this.qty.toString() + n.toString();
// this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
},
selectSize: function(n) {
var bg = document.getElementsByClassName("bg");
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
if (bg[i].innerHTML == n) {
bg[i].style.background = "#02C1ED"
}
}
if(n!=0 ){
if (n != 0) {
this.size = n;
// bg[0].style.background = "#02C1ED"
}
console.log(this.size);
},
nextday:function(n){
nextday: function(n) {
this.createZhezhao(-1)
var d = new Date(this.dateTime);
d.setTime(d.getTime()+24*60*60*1000*n);
var s = d.getFullYear()+"-" + (d.getMonth()+1) + "-" + d.getDate();
this.dateTime = s;
var d = new Date(this.dateTime);
d.setTime(d.getTime() + 24 * 60 * 60 * 1000 * n);
if (d.getDate().toString().length == 1) {
this.dateTime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-0" + d.getDate();
} else {
this.dateTime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
}
this.getData();
mui('.scroll1').scroll().scrollTo(0,0,100);
mui('.scroll2').scroll().scrollTo(0,0,100);
mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100);
},
stylebg: function(n) {
if (n == 0) {
return {
"background": "#02C1ED"
}
}
},
nextPage: function() {
nextPage: function(n,k) {
var url_;
var id_;
url_ = "CuttingQuality.html";
......@@ -584,13 +971,26 @@
url: url_,
id: id_,
extras: {
IndexID:this.IndexID,
dateTime:this.dateTime,
itemsDetail:this.itemsDetail,
itemsSize:this.itemsSize
IndexID: this.IndexID,
dateTime: this.dateTime,
itemsDetail: this.itemsDetail,
itemsSize: this.itemsSize,
type: n , // n =2 点击不合格进去 ,
parentSize:k,
},
});
},
sop: function() {
this.getLink();
},
selecttime: function() {
var that = this;
......@@ -623,8 +1023,8 @@
* rs.h 时,用法同年
* rs.i 分(minutes 的第二个字母),用法同年
*/
console.log(rs.value)
_self.innerText = rs.text;
_self.innerText = rs.text;
that.dateTime = rs.text;
that.getData();
......@@ -642,9 +1042,13 @@
_self.picker = null;
});
}
mui('.scroll1').scroll().scrollTo(0,0,100);
mui('.scroll2').scroll().scrollTo(0,0,100);
mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100);
}, //selecttime
back: function() {
plus.screen.lockOrientation("portrait-primary") //横屏
// plus.screen.lockOrientation("portrait-primary") //横屏
}
}
......
......@@ -8,37 +8,47 @@
<link href="../dest/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../dest/css/mui.picker.min.css" />
<style type="text/css">
th{
th {
border-width: 1px;
border-style: solid;
border-color: #a9c6c9;
}
.altrowstable {
border-width: 1px;
/*padding: 2px;*/
border-style: solid;
border-color: #a9c6c9;
background: white;
height:200%;
height: 200%;
/*background-color: #F6F6F6;*/
}
.mui-backdrop {
position: fixed;
top: 209px;
right: 13px;
bottom: 46px;
left: 695px;
z-index: 998;
background-color: rgba(0, 0, 0, .3);
}
</style>
</head>
<body>
<div id="app">
<div class="mui-content" >
<div class="mui-content">
<div id="left" style=" display: inline-block; width: 30%; ">
<div id="left-1" style="position: absolute; top: 1px;">
<label style=" text-align: center; position: relative; left: 50px;">今日次品数量:{{number}} </label>
<label style=" text-align: center; position: relative; left: 50px;">今日次品数量:{{number}} </label>
</div>
<div id="left-2" >
<table class="mui-table" style="position: relative;top: -440px;">
<div id="left-2">
<table class="mui-table" style="position: relative;top: -455px;">
<thead class="mui-table-view">
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th>
......@@ -47,32 +57,45 @@
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">类型</th>
</tr>
</thead>
</table>
<div class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block; width: 30%; top: 45px;">
</table>
<div id="item1" class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block;height: 480px; width: 30%; top: 45px;">
<div class="mui-scroll">
<table class="mui-table">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @tap="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td>
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @click="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div id="item2" class="mui-scroll-wrapper " :style="display_" style="border: solid #DAE6EF 1px ;background: white; display: inline-block;height: 480px; width: 30%; top: 45px;">
<div class="mui-scroll">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft2" @click="selectReport2(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div class="mui-segmented-control" style="position: relative;top: 30px;">
<a id="n1" class="mui-control-item mui-active" @click="selectDisplay(1)">今日实报</a>
<a id="n2" class="mui-control-item " @click="selectDisplay(2)">单款实报</a>
</div>
</div>
</div>
<div id="right" style=" display: inline-block; width: 69%; ">
<div id="right-2" style=" position: relative;top:2px">
<div style="border: solid #DAE6EF 1px ; display: inline-block; width: 80%;">
<ul class="mui-table-view">
......@@ -95,87 +118,90 @@
<p style="float: left;width: 12%; color: #060606;">班组: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.WorkTeam}} </p>
</li>
</ul>
</div>
<div style=" display: inline-block; width: 17%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @tap="reportDelete()" >撤回品检</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" @tap="back">返回时报</button>
<div style=" display: inline-block; width: 19%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @click="reportDelete()">撤回品检</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" @click="back">返回时报</button>
</div>
</div>
<div id="right-3" style="border: solid #DAE6EF 1px ;position: relative;top : -10px">
<table class="mui-table " >
<div id="right-3" style="border: solid #DAE6EF 1px ;position: relative;top : -18px">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr style=" height: 50px">
<td class="altrowstable" style="background: white;height: 50px" >尺码:</td>
<td class="altrowstable" style=" height: 50px" v-for="itemdef in itemsSizeDef" v-if="itemsSize.length ==0">
<button class="bg" type="button" style="width: 100%;height: 50px" class="mui-btn mui-btn-blue mui-btn-outlined" >{{itemdef}}</button>
<td class="altrowstable" style="background: white;height: 50px; text-align: center;">尺码:</td>
<td class="altrowstable" style=" height: 50px" v-for="itemdef in itemsSizeDef" v-if="itemsSize.length ==0">
<button class="bg" type="button" style="width: 100%;height: 50px" class="mui-btn mui-btn-blue mui-btn-outlined">{{itemdef}}</button>
</td>
<td class="altrowstable" style=" height: 50px" v-for="itemd,isize in itemsSize" >
<button class="bg" :style="stylebg(isize)" style="width: 100%;height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectSize(itemd)">{{itemd}}</button>
<td class="altrowstable" style=" height: 50px" v-for="itemd,isize in itemsSize">
<button class="bg" :style="stylebg(itemd)" style="width: 100%;height: 50px; border:0px ;" type="button" class="mui-btn mui-btn-blue mui-btn-outlined"
@click="selectSize(itemd)">{{itemd}}</button>
</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</div>
<div id="right-4" style=" margin-top: 10px ;height: 300px ;">
<div style=" display: inline-block; width: 60%;height: 260px; position: relative;top:-10px;">
<div id="right-4" style=" margin-top: 8px ;height: 300px ;">
<div style=" display: inline-block; width: 60%;height: 305px; position: relative;top:-15px;">
<div class="mui-scroll-wrapper">
<div class="mui-scroll">
<table class="mui-table">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr style="height:60px ;" v-for="itemq , n in itemsDetail1_ar" >
<td :id="'Quality_'+ itemqq.ID" class="altrowstable Quality" style="height: 60px;" v-for ="itemqq , n in itemq" @tap ="selectQQ(itemqq.ID)">{{itemqq.Name}} </td>
<tr style="height:60px ;" v-for="itemq , n in itemsDetail1_ar">
<td :id="'Quality_'+ itemqq.ID" class="altrowstable Quality" style="height: 60px;text-align: center; "
v-for="itemqq , n in itemq" @click="selectQQ(itemqq.ID)">
<p style="font-size: 27px; text-align: center;">{{itemqq.Code}}</p>
<label class="mui-pull-caption " style=" font-size: 12px; padding: 0px; margin: 5px 0px 0px 0px; line-height: 12px !important;text-align: center!important">{{itemqq.Name}}</label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style=" display: inline-block; width: 38%; position: relative;top: -15px;">
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 160px ;height: 60px;margin-right: -4px; text-align: center;color: red; "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
:onchange="changeValue()"/>
<button style=" width: 80px;height: 60px;" @tap="backNumber(1)"> ←</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(1)" > 1</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(2)"> 2</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(3)"> 3</button>
<button style=" width: 80px; height: 60px;margin-right: -4px " @tap="selectNumber(4)"> 4</button>
<button style=" width: 80px; height: 60px;margin-right: -4px" @tap="selectNumber(5)"> 5</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(6)"> 6</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(7)"> 7</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(8)"> 8</button>
<button style=" width: 80px;height: 60px;"> 9</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 160px;height: 60px; " @tap="submit" :disabled="disable_save_button2"> 提交</button>
</div>
<div style=" display: inline-block; width: 39%; position: relative;top: -50px;">
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 170px ;height: 65px;margin-right: -6px;margin-bottom: -1px; text-align: center;color: red;background: #C8C7CC;font-size: 25px "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty" :onchange="changeValue()" />
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="backNumber()"> ←</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px ; font-size: 25px;" @click="selectNumber(1)">
1</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(2)">
2</button>
<button style=" width: 85px;height: 65px; margin-right: -4px ;margin-bottom: -1px;font-size: 25px" @click="selectNumber(3)">
3</button>
<button style=" width: 85px; height: 65px;margin-right: -5px ;margin-bottom: -1px;font-size: 25px" @click="selectNumber(4)">
4</button>
<button style=" width: 85px; height: 65px;margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(5)">
5</button>
<button style=" width: 85px;height: 65px;margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(6)">
6</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(7)">
7</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @clicl="selectNumber(8)">
8</button>
<button style=" width: 85px;height: 65px; margin-bottom: -1px;font-size: 25px" @click="selectNumber(9)"> 9</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;font-size: 25px" @click="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 170px;height: 65px; " @click="submit" :disabled="disable_save_button2">
提交</button>
</div>
</div>
<div id="right-5" style=" border: solid,red,3px; position: absolute; bottom: 0px;">
<label style="height:50px;width: 100px ; position: relative; top :15px"> 处理类型:</label>
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px;background: #02C1ED ;" @tap ="selectProcessingType(1)">返修</button>
<button id="ProcessingType_2" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;" @tap ="selectProcessingType(2)">报废</button>
<div id="right-5" style=" ">
<label style="height:50px;width: 100px ; text-align: center; vertical-align:middle ; position: relative;top: 14px; ">
处理类型:</label>
</div>
<div id="right-5" style=" position: absolute; left:375px ; bottom: 5px;">
<!-- <label style="height:50px;width: 100px ; text-align: center; vertical-align:middle ; "> 处理类型:</label> -->
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px;background: #02C1ED ;font-size: 22px"
@click="selectProcessingType(1)">返修</button>
<button id="ProcessingType_2" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;font-size: 22px"
@click="selectProcessingType(2)">报废</button>
</div>
</div>
</div>
</div>
......@@ -191,7 +217,8 @@
});
function initPage() {
plus.screen.lockOrientation("landscape-secondary") //横屏
// plus.screen.lockOrientation("landscape-secondary") //横屏
plus.screen.lockOrientation("landscape-primary") //横屏
app.init();
}
......@@ -203,97 +230,112 @@
qty: 0,
size: 0,
dateTime: "",
qualityID : 0,
itemsDetail: [], //订单明细
itemsDetail1: [], //品检项目
itemsDetail1_ar:[],
qualityID: 0,
itemsDetail: [], //订单明细
itemsDetail1: [], //品检项目
itemsDetail1_ar: [],
itemsDetail2: [],
itemsHead: [],
itemsLeft: [],
itemsLeft: [], //今日实报
itemsLeft2: [], //单款实报
itemsSize: [],
SizeQty: [],
itemsSizeDef:[40,41,42,43,44,45,46],
itemsSizetest: [11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14,
15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15,
],
itemsSizeDef: [40, 41, 42, 43, 44, 45, 46],
type: 1,
parentSize: 0,
IndexID: 0,
disable_save_button: 'disabled',
disable_reportDelete: 'disabled',
ProcessingType:1,
ProcessingType: 1,
ReportID: 0,
Model:0, //0 可以提交 1 不可以提交
Model: 0, //0 可以提交 1 不可以提交
zhezhao: 1, //
displayModel: 1,
mask_: mui.createMask(function(e) {
return false;
}),
ReportType:0,
},
computed: {
disable_save_button2: function () {
if( this.qty !=0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0 && this.Model == 0 ){
disable_save_button2: function() {
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0 && this.Model == 0) {
return null;
}
else{
} else {
return 'disabled';
}
}
},
display_: function() {
if (this.displayModel == 1) {
return "display: none "
}
}
},
methods: {
init: function() {
mui.init();
mui.init({
beforeback: function() {
var temp = 'Needlecarreport_new.html';
var list = plus.webview.getWebviewById(temp);
mui.fire(list, 'back');
return true;
}
});
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.dateTime = new Date().toLocaleDateString();
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.IndexID = mui.currentWebview.IndexID;
this.itemsDetail= mui.currentWebview.itemsDetail;
this.itemsSize= mui.currentWebview.itemsSize;
this.itemsDetail = mui.currentWebview.itemsDetail;
this.itemsSize = mui.currentWebview.itemsSize;
this.type = mui.currentWebview.type;
this.parentSize = mui.currentWebview.parentSize;
this.getDataInit();
},
getDataInit:function(){
this.getDataDetail1();
this.getDataDetail2();
getDataInit: function() {
this.getDataDetail1();
this.getDataDetail2(1);
this.getTatolNum();
},
getData: function() {
var that = this;
var para = {
ReportType: 0,
ReportType: this.ReportType,
IndexID: this.IndexID
};
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
that.itemsHead = e.items;
if (e.items.length > 0) {
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
that.getDataDetail1();
that.getDataDetail2();
that.getDataDetail2(1);
that.getTatolNum();
that.qty=0;
that.disable_reportDelete='disabled';
}
else{
that.itemsDetail=[];
that.IndexID =0;
that.itemsDetail1 =[];
that.itemsSize=[];
that.size=0;
that.itemsLeft=[];
that.number=0;
that.qty=0;
that.disable_reportDelete='disabled'
that.qty = 0;
that.disable_reportDelete = 'disabled';
} else {
that.itemsDetail = [];
that.IndexID = 0;
that.itemsDetail1 = [];
that.itemsSize = [];
that.size = 0;
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
}
......@@ -303,108 +345,110 @@
getDataDetail1: function() {
var that = this;
var para = {
ReportType: 0,
ReportType: this.ReportType,
IndexID: this.IndexID
};
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
that.itemsDetail1 = e.items;
that.itemsDetail1_ar=[];
for(var i=0,len=e.items.length;i<len;i+=5){
that.itemsDetail1_ar.push(e.items.slice(i,i+5));
}
that.itemsDetail1_ar = [];
for (var i = 0, len = e.items.length; i < len; i += 5) {
that.itemsDetail1_ar.push(e.items.slice(i, i + 5));
}
});
},
//完成信息明细
getDataDetail2: function() {
getDataDetail2: function(n) {
var that = this;
var para = {
ReportType: 0,
Date: this.dateTime + " 00:00:00",
IndexID: this.IndexID,
ReportType: this.ReportType,
// Date: this.dateTime + " 00:00:00",
IndexID: n == 1 ? 0 : this.IndexID,
PageSize: 200,
PageIndex: 1,
};
Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
console.log(JSON.stringify(e));
that.itemsLeft = e.items;
});
if (n == 1) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
that.itemsLeft = e.items;
console.log(JSON.stringify(that.itemsLeft));
});
} else if (n == 2) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
that.itemsLeft2 = e.items;
});
}
},
getTatolNum: function() {
var that = this;
var para = {
ReportType:0,
ReportType: this.ReportType,
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/InspectionReport/TotalQty', para, function(e) {
that.number = e.data;
that.number = e.data;
});
},
getReportDetail:function(){
getReportDetail: function() {
var that = this;
var para = {
ReportID:this.ReportID
};
Api.post('/api/vMES/InspectionReport/ReportDetail', para, function(e) {
if(e.success){
that.ReportID = e.data.ReportID;
that.itemsDetail = e.data;
that.itemsSize = e.data.SizeName;
that.qualityID = e.data.QIDetailID;
that.ProcessingType = e.data.ProcessingType;
that.size = e.data.UnQualifiedSizeName;
that.qty =e.data.UnQualifiedQty;
that.Model = 1;
that.selectQQ(that.qualityID);
that.selectSize(that.size);
that.selectProcessingType(that.ProcessingType);
}
});
var para = {
ReportID: this.ReportID
};
Api.post('/api/vMES/InspectionReport/ReportDetail', para, function(e) {
if (e.success) {
that.ReportID = e.data.ReportID;
that.itemsDetail = e.data;
that.itemsSize = e.data.SizeName;
that.qualityID = e.data.QIDetailID;
that.ProcessingType = e.data.ProcessingType;
that.size = e.data.UnQualifiedSizeName;
that.qty = e.data.UnQualifiedQty;
that.Model = 1;
that.selectQQ(that.qualityID);
that.selectSize(that.size);
that.selectProcessingType(that.ProcessingType);
}
});
},
reportDelete: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/InspectionReport/Delete', para, function(e) {
if(e.success){
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.qualityID = 0;
that.selectQQ(0);
that.selectReport(0);
that.selectProcessingType(1);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.Model =0;
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + e.success.message)
if (e.success) {
that.createZhezhao(-1)
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.qualityID = 0;
that.selectQQ(0);
that.selectReport(0);
that.selectProcessingType(1);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
that.Model = 0;
mui.toast("撤回成功")
} else {
mui.toast("撤回失败" + e.message)
}
});
......@@ -416,12 +460,9 @@
size: this.itemsSize[i],
qty: 0
}
this.SizeQty.push(tempa);
}
},
submit: function() {
if (!this.checkValue()) {
......@@ -434,7 +475,7 @@
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID,
}
var that = this;
Api.post('/api/vMES/InspectionReport/Save', para, function(e) {
......@@ -449,82 +490,79 @@
that.selectSize(0);
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.success.message);
}
});
},
displayReport:function(){
displayReport: function() {
this.getReportDetail();
},
selectProcessingType:function(n){
var fx = document.getElementById("ProcessingType_1" );
var bf = document.getElementById("ProcessingType_2" );
if(n==1){
fx.style.background ="#02C1ED";
bf.style.background =""
}
if(n==2){
fx.style.background ="";
bf.style.background ="#02C1ED";
selectProcessingType: function(n) {
var fx = document.getElementById("ProcessingType_1");
var bf = document.getElementById("ProcessingType_2");
if (n == 1) {
fx.style.background = "#02C1ED";
bf.style.background = ""
}
else if(n==0){
fx.style.background ="";
bf.style.background ="";
if (n == 2) {
fx.style.background = "";
bf.style.background = "#02C1ED";
} else if (n == 0) {
fx.style.background = "";
bf.style.background = "";
}
this.ProcessingType = n;
},
selectQQ:function(qq){
selectQQ: function(qq) {
var op = document.getElementById("Quality_" + qq)
this.qualityID = qq;
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType !=0) {
this.disable_save_button = null;
}
var reportele = document.getElementsByClassName("Quality");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(qq != 0){op.style.background = "#02C1ED";}
this.qualityID = qq;
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0) {
this.disable_save_button = null;
}
var reportele = document.getElementsByClassName("Quality");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if (qq != 0) {
op.style.background = "#02C1ED";
}
},
selectIndex:function(idx){
selectIndex: function(idx) {
this.IndexID = idx
if(this.IndexID != 0){
if (this.IndexID != 0) {
this.getDataDetail1();
this.getDataDetail2();
this.getDataDetail2(1);
this.getTatolNum();
this.qty=0;
this.size=0;
this.disable_reportDelete='disabled';
}
else{
this.itemsDetail=[];
this.IndexID =0;
this.itemsDetail1 =[];
this.itemsSize=[];
this.size=0;
this.itemsLeft=[];
this.number=0;
this.qty=0;
this.disable_reportDelete='disabled'
this.qty = 0;
this.size = 0;
this.disable_reportDelete = 'disabled';
} else {
this.itemsDetail = [];
this.IndexID = 0;
this.itemsDetail1 = [];
this.itemsSize = [];
this.size = 0;
this.itemsLeft = [];
this.number = 0;
this.qty = 0;
this.disable_reportDelete = 'disabled'
}
},
selectReport: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
......@@ -536,25 +574,85 @@
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(obj != 0){
if (obj != 0) {
this.createZhezhao(1)
op.style.background = "#02C1ED";
this.displayReport();
}
},
selectReport2: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
var reportele = document.getElementsByClassName("Report");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if (obj != 0) {
this.createZhezhao(1)
op.style.background = "#02C1ED";
this.displayReport();
}
},
selectDisplay: function(n) {
var opt = document.getElementById("item1")
var opt2 = document.getElementById("item2")
var n1 = document.getElementById("n1")
var n2 = document.getElementById("n2")
if (n == 1) {
n1.style.background = "royalblue"
n1.style.color = "white"
n2.style.background = "white"
n2.style.color = "royalblue"
opt.style.display = "inline-block";
opt2.style.display = "none"
}
if (n == 2) {
this.getDataDetail2(2)
n1.style.background = "white"
n1.style.color = "royalblue"
n2.style.background = "royalblue"
n2.style.color = "white"
opt.style.display = "none";
opt2.style.display = "inline-block"
}
},
createZhezhao: function(n) {
if (n == -1) {
this.mask_._remove()
this.zhezhao = 1;
} else {
if (this.zhezhao == 1) {
this.mask_.show(); //显示遮罩
this.zhezhao = 2
// mask.close();//关闭遮罩
}
}
},
changeValue: function() {
if (isNaN(parseInt(this.qty))) {
this.qty = 0;
this.disable_save_button = 'disabled';
}
if (parseInt(this.qty) > 0) {
this.qty = parseInt(this.qty);
this.disable_save_button = null;
}
},
checkValue: function() {
......@@ -570,52 +668,64 @@
} else if (this.IndexID == 0) {
mui.toast("订单号不正确")
return false;
}else if (this.qualityID ==0){
} else if (this.qualityID == 0) {
mui.toast("请选择品检项目")
return false;
}
else if (this.ProcessingType ==0){
} else if (this.ProcessingType == 0) {
mui.toast("请选择处理类型")
return false;
}
else {
} else {
return true;
}
},
backNumber: function() {
if (this.Model == 1) {
return;
}
var str = this.qty.toString();
this.qty = str.substring(0, str.length - 1);
},
selectNumber: function(n) {
if (this.Model == 1) {
return;
}
this.qty = this.qty.toString() + n.toString();
// this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
},
selectSize: function(n) {
var bg = document.getElementsByClassName("bg");
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
if (bg[i].innerHTML == n) {
bg[i].style.background = "#02C1ED"
}
}
// if(n==0){
//
// bg[0].style.background = "#02C1ED"
// }
this.size = n;
},
stylebg: function(n) {
stylebg: function(k) {
if (this.type == 1) {
return
} else if (this.type == 2) {
if (k == this.parentSize) {
this.size = this.parentSize
return {
"background": "#02C1ED"
}
}
}
// if (n == 0) {
// return {
// "background": "#02C1ED"
//
// }
// }
},
back: function() {
mui.back();
// plus.screen.lockOrientation("portrait-primary") //横屏
......
......@@ -8,95 +8,152 @@
<link href="../dest/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../dest/css/mui.picker.min.css" />
<style type="text/css">
th{
th {
border-width: 1px;
border-style: solid;
border-color: #a9c6c9;
}
.altrowstable {
border-width: 1px;
/*padding: 2px;*/
border-style: solid;
border-color: #a9c6c9;
background: white;
height:200%;
height: 200%;
/*background-color: #F6F6F6;*/
}
.mui-backdrop {position: fixed;top:251px;right: 10px;bottom: 5px;left: 698px;z-index: 998;background-color: rgba(0,0,0,.3);}
</style>
</head>
<body>
<div id="app">
<div class="mui-content" >
<div class="mui-content">
<div id="left" style=" display: inline-block; width: 30%; ">
<div id="left-1" style="position: absolute; top: 1px;">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @tap="back"></a>
<label style=" text-align: center; position: relative; left: 50px;">今日完成数量:{{number}} </label>
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @click="back"></a>
<label style=" text-align: center; position: relative; left: 50px;">今日完成数量:{{number}} </label>
</div>
<div id="left-2" >
<table class="mui-table" style=" position: relative;top: -440px;">
<thead class="mui-table-view">
<div id="left-2">
<table class="mui-table" style=" position: relative;top: -432px; ">
<tbody class="mui-table-view-cell" >
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">指令号</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">数量</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;width: 30%;">时间</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;width: 50% ">指令号</th>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;width: 19%; ">数量</th>
</tr>
</thead>
</table>
<div class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block; width: 30%; top: 45px;">
</tbody>
</table>
<div id="item1" class="mui-scroll-wrapper scroll1" style=" border: solid #DAE6EF 1px ;height: 480px; background: white; display: inline-block; width: 30%; top: 49px;">
<div class="mui-scroll">
<table class="mui-table">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @tap="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @click="selectReport(item.ReportID)">
<td style="width: 30%;" align="center">{{item.Date}}</td>
<td style="width: 50% " align="center">{{item.IndexNo}}</td>
<td style="width: 19%;" align="center">{{item.Qty}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div id="item2" class="mui-scroll-wrapper scroll2" :style="display_" style=" border: solid #DAE6EF 1px ;height: 480px; background: white; display: inline-block; width: 30%; top: 49px;">
<div class="mui-scroll">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID2_'+item.ReportID" class="Report" v-for=" item in itemsLeft2" @click="selectReport2(item.ReportID)">
<td style="width: 30%;" align="center">{{item.Date}}</td>
<td style="width: 50%;" align="center">{{item.IndexNo}}</td>
<td style="width: 19%;" align="center">{{item.Qty}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div class="mui-segmented-control" style="position: relative;top: 50px;">
<a id="n1" class="mui-control-item mui-active" @click="selectDisplay(1)" >今日实报</a>
<a id="n2" class="mui-control-item " @click="selectDisplay(2)" >单款实报</a>
</div>
</div>
</div>
<div id="right" style=" display: inline-block; width: 69%; ">
<div id="right-1" style=" ">
<div id="right" style=" display: inline-block; width: 69.5%; ">
<div id="right-1" style="">
<div style="border: solid #DCDCE1 1px ; display: inline-block; width: 10%; position: relative;top: -20px; height: 38px;">
<button style="text-align: center;border-style:none; width: 100%;height: 100%; background: white;">指令号:</button>
<button style="text-align: center;border-style:none; width: 100%;height: 100%; background: white;">指令号:</button>
</div>
<div class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" style=" display: inline-block; width: 66%; position: relative;top: 1px;">
<div class="mui-scroll-wrapper scroll3 mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" style=" display: inline-block; width: 64.5%; position: relative;top: 1px;">
<div class="mui-scroll">
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index mui-active" style="background:#02C1ED ;" v-for="itemh,i in itemsHead" v-if= "i == 0" @tap="selectIndex(itemh.IndexID)">
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index mui-active" style="background:#02C1ED ;" v-for="itemh,i in itemsHead"
v-if="i == 0" @tap="selectIndex(itemh.IndexID)">
<img src="../dest/img/00.png" v-if="itemh.CompleteRatio ==0 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/12.5.png" v-if=" itemh.CompleteRatio>0 && itemh.CompleteRatio<= 12.5 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/25.png" v-if=" itemh.CompleteRatio>12.5 && itemh.CompleteRatio<= 25 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/37.5.png" v-if=" itemh.CompleteRatio>25 && itemh.CompleteRatio<= 37.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/50.png" v-if=" itemh.CompleteRatio>37.5 && itemh.CompleteRatio<= 50" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/62.5.png" v-if=" itemh.CompleteRatio>50 && itemh.CompleteRatio<= 62.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/75.png" v-if=" itemh.CompleteRatio>62.5 && itemh.CompleteRatio<= 75" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/87.5.png" v-if=" itemh.CompleteRatio>75 && itemh.CompleteRatio<100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/100.png" v-if=" itemh.CompleteRatio== 100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
{{itemh.IndexNo}}
</a>
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index" style="" v-for="itemh,i in itemsHead" v-if= "i != 0" @tap="selectIndex(itemh.IndexID)">
<a :id="'Index_' + itemh.IndexID" class="mui-control-item Index" style="" v-for="itemh,i in itemsHead" v-if="i != 0"
@tap="selectIndex(itemh.IndexID)">
<img src="../dest/img/00.png" v-if="itemh.CompleteRatio ==0 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/12.5.png" v-if=" itemh.CompleteRatio>0 && itemh.CompleteRatio<= 12.5 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/25.png" v-if=" itemh.CompleteRatio>12.5 && itemh.CompleteRatio<= 25 " style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/37.5.png" v-if=" itemh.CompleteRatio>25 && itemh.CompleteRatio<= 37.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/50.png" v-if=" itemh.CompleteRatio>37.5 && itemh.CompleteRatio<= 50" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/62.5.png" v-if=" itemh.CompleteRatio>50 && itemh.CompleteRatio<= 62.5" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/75.png" v-if=" itemh.CompleteRatio>62.5 && itemh.CompleteRatio<= 75" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/87.5.png" v-if=" itemh.CompleteRatio>75 && itemh.CompleteRatio< 100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
<img src="../dest/img/100.png" v-if=" itemh.CompleteRatio== 100" style="width: 20px; height: 20px; position: relative; top: 5px;" />
{{itemh.IndexNo}}
</a>
</div>
</div>
<div style=" ; display: inline-block; width: 22% ;position: relative;top: -20px; height: 38px; ">
<a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="margin-top: 5px" @tap="nextday(-1)"></a>
<a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="margin-left: -15px;margin-top: 5px" @tap="nextday(-1)"></a>
<button style=" width: 60%;height: 100%; margin-left: -5px" id="selectdate" data-options='{"type":"date"}' name="shipdate" @tap="selecttime()">{{dateTime}}</button>
<a class=" mui-icon mui-icon-arrowright mui-pull-right" style="margin-left: -15px;margin-top: 5px" @tap="nextday(1)"></a>
<a class=" mui-icon mui-icon-arrowright mui-pull-right" style="margin-left: -15px;margin-top: 5px" @tap="nextday(1)"></a>
<div style=" ; display: inline-block; width: 24% ;position: relative;top: -20px; height: 38px; ">
<button class="mui-icon mui-icon-arrowleft mui-btn-outlined ;" style="border: 0px ; color:royalblue; width: 23%;height: 100%; text-align: left; padding-left:0px ;"
@click="nextday(-1)">
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-top: 5px" @click="nextday(-1)"></a> -->
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-left: -15px;margin-top: 5px" @click="nextday(-1)"></a> -->
</button>
<button class="mui-btn-outlined" style="padding-left: 6px; width: 54%;height: 100%; margin-left: -4px" id="selectdate"
data-options='{"type":"date"}' name="shipdate" @click="selecttime()">{{dateTime}}</button>
<button class="mui-icon mui-icon-arrowright mui-btn-outlined" style=" border: 0px;color:royalblue;margin-left: -4px; width: 20%;height: 100%; padding:0px ;"
@click="nextday(1)">
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-top: 5px" @click="nextday(-1)"></a> -->
<!-- <a class=" mui-icon mui-icon-arrowleft mui-pull-left" style="border: blue solid 1px; margin-left: -15px;margin-top: 5px" @click="nextday(-1)"></a> -->
</button>
</div>
</div>
<div id="right-2" style="">
<div id="right-2" style="margin-top: -20px;">
<div style="border: solid #DAE6EF 1px ; display: inline-block; width: 80%;">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
......@@ -123,16 +180,16 @@
</div>
<div style=" display: inline-block; width: 17%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @tap="reportDelete()" >撤回实报</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_qq" @tap ="nextPage()">品质问题</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @click="reportDelete()">撤回实报</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_qq_" @click="nextPage(1,0)">品质问题</button>
</div>
</div>
<div id="right-4" style=" margin-top: 10px ;">
<div style=" display: inline-block; width: 60%; position: relative;top: -230px;">
<table class="mui-table ">
<div id="right-4" style=" margin-top: -20px ;">
<div style=" display: inline-block; width: 60%; position: relative;top: -315px;">
<table class="mui-table ">
<thead class="mui-table-view">
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">尺码</th>
......@@ -141,52 +198,69 @@
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">不合格数</th>
</tr>
</thead>
</table>
<div class="mui-scroll-wrapper " style=" border: #DAE6EF solid 1px; display: inline-block; height: 270px;background: white; top:22px;">
<div class="mui-scroll">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr v-for="itemdetail,isize in itemsDetail1" @tap="selectSize(itemdetail.SizeName)">
<td class="altrowstable bg " style="height: 50px" :style="stylebg(isize)" align="center" >{{itemdetail.SizeName}}</td>
<td class="altrowstable" align="center">{{itemdetail.Qty}}</td>
<td class="altrowstable" align="center">{{itemdetail.QualifiedQty}}</td>
<td class="altrowstable" align="center">{{itemdetail.UnQualifiedQty}}</td>
</tr>
</tbody>
</table>
<div class="mui-scroll-wrapper scroll4 " style=" border: #DAE6EF solid 1px; display: inline-block; height: 365px;background: white; top:22px;">
<div class="mui-scroll">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr v-for="itemdetail,isize in itemsDetail1" @click="selectSize(itemdetail.SizeName)">
<td class="altrowstable bg " style="height: 50px" align="center">{{itemdetail.SizeName}}</td>
<td class="altrowstable" align="center">{{itemdetail.Qty}}</td>
<td class="altrowstable" align="center">{{itemdetail.QualifiedQty}}</td>
<td class="altrowstable" @click ="nextPage(2,itemdetail.SizeName)" align="center">{{itemdetail.UnQualifiedQty}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style=" display: inline-block; width: 38%;">
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 160px ;height: 60px;margin-right: -4px; text-align: center;color: red;background: #C8C7CC; "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
:onchange="changeValue()"/>
<button style=" width: 80px;height: 60px;" @tap="backNumber(1)"> ←</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(1)" > 1</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(2)"> 2</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(3)"> 3</button>
<button style=" width: 80px; height: 60px;margin-right: -4px " @tap="selectNumber(4)"> 4</button>
<button style=" width: 80px; height: 60px;margin-right: -4px" @tap="selectNumber(5)"> 5</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(6)"> 6</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(7)"> 7</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(8)"> 8</button>
<button style=" width: 80px;height: 60px;"> 9</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 160px;height: 60px; " @tap="submit" :disabled="disable_save_button_C"> 提交</button>
<div>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;"
@click="sop">SOP</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;"
:disabled="disable_qq_" @click="submitZD">整单完工</button>
</div>
<div>
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 170px ;height: 65px;margin-right: -6px;margin-bottom: -1px; text-align: center;color: red;background: #C8C7CC;font-size: 25px "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty" :onchange="changeValue()" />
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="backNumber(1)"> ←</button>
<button style=" width: 85px;height: 65px; margin-right: -6px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(1)">
1</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(2)">
2</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(3)">
3</button>
<button style=" width: 85px; height: 65px;margin-right: -6px ;margin-bottom: -1px;font-size: 25px" @click="selectNumber(4)">
4</button>
<button style=" width: 85px; height: 65px;margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(5)">
5</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(6)"> 6</button>
<button style=" width: 85px;height: 65px ;margin-bottom: -1px;; margin-right: -6px;font-size: 25px" @click="selectNumber(7)">
7</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;; margin-right: -5px;font-size: 25px" @click="selectNumber(8)">
8</button>
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(9)"> 9</button>
<button style=" width: 85px;height: 65px; margin-right: -6px;font-size: 25px" @click="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 170px;height: 65px; " @click="submit" :disabled="disable_save_button_C">
提交</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../dest/js/mui.min.js"></script>
<script src="../dest/js/mui.picker.min.js"></script>
<script src="../dest/js/createView.min.js"></script>
......@@ -199,7 +273,7 @@
});
function initPage() {
plus.screen.lockOrientation("landscape-secondary") //横屏
plus.screen.lockOrientation("landscape-primary") //横屏
app.init();
}
......@@ -211,84 +285,117 @@
qty: 0,
size: 0,
dateTime: "",
dateTimeFull :new Date(),
today: "",
link:"",
itemsDetail: [], //订单明细
itemsDetail1: [],
itemsDetail2: [],
itemsHead: [],
itemsLeft: [],
itemsLeft2:[],
itemsSize: [],
SizeQty: [],
itemsSizeDef:[40,41,42,43,44,45,46],
ReportType :2 ,
IndexID: 0,
// disable_save_button: 'disabled',
disable_reportDelete: 'disabled',
disable_qq:null,
disable_qq: 'disabled',
ReportID: 0,
Model:0,
Report_IndexID: 0,
Model: 0,
CompleteRatio: 0, //完成进度
displayModel:1,
zhezhao :1, //
mask_: mui.createMask(function(e){return false;}),
},
computed:{
disable_save_button_C :function(){
if(this.size !=0 && this.qty !=0 && this.IndexID !=0 && this.Model == 0 ){
computed: {
disable_save_button_C: function() {
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
else {
return 'disabled' ;
},
disable_qq_: function() {
if (this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
},
display_:function(){
if(this.displayModel ==1 ){
return "display: none "
}
}
},
methods: {
init: function() {
mui.init();
window.addEventListener('back', function(e) {
var that = this;
app.getDataDetail1();
});
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.dateTime = new Date().toLocaleDateString();
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.today = this.dateTime;
this.getData();
},
getData: function() {
var that = this;
var tempdate = this.dateTime + " 00:00:00";
this.createZhezhao(-1)
var para = {
ReportType: 2,
ReportType: this.ReportType,
Date: tempdate
};
Api.post('/api/vMES/ProductionReport/ProductIndexNo', para, function(e) {
that.itemsHead = e.items;
if (e.items.length > 0) {
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
that.getDataDetail1();
that.getDataDetail2();
that.getDataDetail2(1);
that.getTatolNum();
that.qty = 0;
that.disable_reportDelete = 'disabled';
} else {
that.itemsDetail = [];
that.IndexID = 0;
that.itemsDetail1 = [];
that.itemsSize = [];
that.size = 0;
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
that.getDataDetail2(1);
that.getTatolNum();
that.qty=0;
that.disable_reportDelete='disabled';
}
else{
that.itemsDetail=[];
that.IndexID =0;
that.itemsDetail1 =[];
that.itemsSize=[];
that.size=0;
that.itemsLeft=[];
that.number=0;
that.qty=0;
that.disable_reportDelete='disabled'
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getDataDetail1: function() {
......@@ -296,91 +403,215 @@
var para = {
IndexID: this.IndexID,
};
if(this.IndexID == 0){
return;
}
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
console.log("eeee:::" +JSON.stringify(e))
that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName;
// that.size = e.data.SizeName[0];
if(e.success){
that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getDataDetail2: function() {
getDataDetail2: function(n) {
//n= 1 今日时报 n=2 单款时报
var that = this;
var para = {
ReportType: 2,
Date: this.dateTime + " 00:00:00",
IndexID: this.IndexID,
ReportType: this.ReportType,
IndexID: n==1 ? 0 : this.IndexID ,
PageSize: 200,
PageIndex: 1,
};
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
that.itemsLeft = e.items;
// console.log(JSON.stringify(para))
if( n ==1 ){
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
if(e.success){
that.itemsLeft = e.items;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
}
else if( n ==2){
if( this.IndexID == 0)
{
that.itemsLeft2 =[];
}
else{
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
if(e.success){
that.itemsLeft2 = e.items;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
}
}
},
getTatolNum: function() {
var that = this;
var para = {
ReportType: 2,
ReportType: this.ReportType,
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/ProductionReport/TotalQty', para, function(e) {
that.number = e.data;
if(e.success){
that.number = e.data;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
//完成进度
getCompleteRatio: function(n) {
var that = this;
var para = {
IndexID: n
};
if(n == 0){
return;
}
Api.post('/api/vMES/ProductionReport/IndexNoCompleteRatio', para, function(e) {
if(e.success){
that.CompleteRatio = e.data;
// console.log(JSON.stringify(e))
for (var i = 0; i < that.itemsHead.length; i++) {
if (that.itemsHead[i].IndexID == n) {
that.itemsHead[i].CompleteRatio = that.CompleteRatio;
// console.log(that.CompleteRatio);
}
}
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
reportDelete: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/ProductionReport/Delete', para, function(e) {
if(e.success){
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.selectReport(0)
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.Model =0 ;
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + e.success.message)
if (e.success) {
that.createZhezhao(-1)
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.getCompleteRatio(that.Report_IndexID); //订单进度
that.selectSize(0);
that.selectReport(0);
that.selectReport2(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2);
that.Model = 0;
if(that.IndexID != 0){
var Index = document.getElementById("Index_" + that.IndexID)
Index.style.background = "#02C1ED" ;
}
mui.toast("撤回成功")
} else {
mui.toast("撤回失败" + e.message)
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getDataByReportID:function(){
getDataByReportID: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/ProductionReport/ReportIndexNoDetail', para, function(e) {
if(e.success){
if (e.success) {
that.itemsDetail = e.data;
that.itemsSize =e.data.SizeName;
that.itemsDetail1 = e.data.ReportDetail ;
that.itemsSize = e.data.SizeName;
that.itemsDetail1 = e.data.ReportDetail;
that.size = e.data.ReportSizeName;
that.qty = e.data.ReportQty;
that.selectSize(e.data.ReportSizeName);
} else {
mui.toast("获取明细失败:" + e.message)
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getLink:function(){
var that = this;
var para ={
ReportType: this.ReportType,
StyleCode: this.itemsDetail.StyleCode
}
// console.log( JSON.stringify(para))
Api.post('/api/vMES/Sop/StyleSop', para, function(e) {
if(e.success){
// console.log( JSON.stringify(e))
that.link = e.data.Url ;
var url_ = "sop.html";
var id_ = "sop.html";
mui.openWindow({
url: url_,
id: id_,
extras: {
style:that.itemsDetail.StyleCode,
ReportType:that.ReportType,
link :that.link,
parentPage: "Forming.html"
},
});
}
else{
mui.toast("获取明细失败:" + e.message)
mui.toast("获取sop地址失败: " + e.message)
}
},function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
SizeQtyA: function() {
for (var i = 0; i < this.itemsSize.length; i++) {
......@@ -388,7 +619,7 @@
size: this.itemsSize[i],
qty: 0
}
this.SizeQty.push(tempa);
}
},
......@@ -403,79 +634,162 @@
}
var that = this;
Api.post('/api/vMES/ProductionReport/Save', para, function(e) {
if (e.success) {
// that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细 今日实报
that.getDataDetail2(2); //获取左边列表明细 单款实报
that.getCompleteRatio(that.IndexID) //订单进度
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.message);
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
mui.toast(JSON.stringify(bbb.message))
});
},
selectIndex:function(idx){
var indxx = document.getElementsByClassName("Index");
// if (this.Model == 1) {
// setTimeout(function() {
//
// for (var i = 0; i < indxx.length; i++) {
//
// indxx[i].className ="mui-control-item Index"
// }
//
// }, 50);
//
// return;
// }
submitZD: function() {
var btnArray = ['否', '是'];
var that = this;
mui.confirm('请确认是否整单完工?', '提示', btnArray, function(e) {
if (e.index == 1) {
var para = {
ReportType: this.ReportType,
IndexID: that.IndexID,
}
// console.log(JSON.stringify(para));
// console.log(JSON.stringify(para));
Api.post('/api/vMES/ProductionReport/SingleComplete', para, function(e) {
if (e.success) {
// that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getCompleteRatio(that.IndexID) //订单进度
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.message);
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
} else {
return;
}
})
},
selectIndex: function(idx) {
var indx = document.getElementById("Index_" + idx)
this.createZhezhao(-1)//关闭遮罩
var indxx = document.getElementsByClassName("Index");
var indx = document.getElementById("Index_" + idx)
for (var i = 0; i < indxx.length; i++) {
indxx[i].style.background ="";
indxx[i].style.background = "";
}
indx.style.background = "#02C1ED";
indx.style.background = "#02C1ED";
this.IndexID = idx
this.Model =0
if(this.IndexID != 0){
this.Model = 0
if (this.IndexID != 0) {
this.getDataDetail1();
this.getDataDetail2();
this.getDataDetail2(1);
this.getDataDetail2(2);
this.getTatolNum();
this.selectSize(0);
this.selectReport(0);
this.qty=0;
this.size=0;
this.disable_reportDelete='disabled';
this.qty = 0;
this.size = 0;
this.disable_reportDelete = 'disabled';
} else {
this.itemsDetail = [];
this.IndexID = 0;
this.itemsDetail1 = [];
this.itemsSize = [];
this.size = 0;
this.itemsLeft = [];
this.number = 0;
this.qty = 0;
this.disable_reportDelete = 'disabled'
}
else{
this.itemsDetail=[];
this.IndexID =0;
this.itemsDetail1 =[];
this.itemsSize=[];
this.size=0;
this.itemsLeft=[];
this.number=0;
this.qty=0;
this.disable_reportDelete='disabled'
mui('.scroll1').scroll().scrollTo(0,0,100);
mui('.scroll2').scroll().scrollTo(0,0,100);
// mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100);
},
createZhezhao:function(n){
// console.log(n)
if(n== -1){
// var mask = mui.createMask();//callback为用户点击蒙版时自动执行的回调;
// this.mask_.close();
this.mask_._remove()
this.zhezhao = 1;
}
else{
if (this.zhezhao == 1 ){
// var mask = mui.createMask(function(e){
// return false;
//
// });//callback为用户点击蒙版时自动执行的回调;
this.mask_.show();//显示遮罩
this.zhezhao = 2
// mask.close();//关闭遮罩
}
}
},
selectReport: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
if (obj == 0) {
this.Report_IndexID = 0
} else {
this.createZhezhao(1)
for (var i = 0; i < this.itemsLeft.length; i++) {
if (this.itemsLeft[i].ReportID == obj) {
this.Report_IndexID = this.itemsLeft[i].IndexID
}
}
}
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
......@@ -484,24 +798,95 @@
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(obj != 0){
if (obj != 0) {
if(this.IndexID != 0){
var Index = document.getElementById("Index_" + this.IndexID)
Index.style.background = "";
}
op.style.background = "#02C1ED";
this.Model =1 ;
this.Model = 1;
this.getDataByReportID();
}
},
selectReport2: function(obj) {
var op = document.getElementById("ReportID2_" + obj)
this.ReportID = obj;
if (obj == 0) {
this.Report_IndexID = 0
} else {
this.createZhezhao(1)
for (var i = 0; i < this.itemsLeft2.length; i++) {
if (this.itemsLeft2[i].ReportID == obj) {
this.Report_IndexID = this.itemsLeft2[i].IndexID
}
}
}
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
var reportele = document.getElementsByClassName("Report");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if (obj != 0) {
if(this.IndexID != 0){
var Index = document.getElementById("Index_" + this.IndexID)
Index.style.background = "";
}
op.style.background = "#02C1ED";
this.Model = 1;
this.getDataByReportID();
}
},
selectDisplay:function(n){
var opt = document.getElementById("item1" )
var opt2 = document.getElementById("item2" )
var n1 = document.getElementById("n1" )
var n2 = document.getElementById("n2" )
if( n== 1){
n1.style.background ="royalblue"
n1.style.color = "white"
n2.style.background ="white"
n2.style.color = "royalblue"
opt.style.display ="inline-block";
opt2.style.display = "none"
}
if(n== 2){
this.getDataDetail2(2)
n1.style.background ="white"
n1.style.color = "royalblue"
n2.style.background ="royalblue"
n2.style.color = "white"
opt.style.display ="none";
opt2.style.display = "inline-block"
}
},
changeValue: function() {
if (isNaN(parseInt(this.qty))) {
this.qty = 0;
// this.disable_save_button = 'disabled';
}
if (parseInt(this.qty) > 0) {
this.qty = parseInt(this.qty);
// this.disable_save_button = null;
}
},
checkValue: function() {
......@@ -521,61 +906,71 @@
return true;
}
},
backNumber:function(){
if (this.Model == 1) {
return;
}
var str =this.qty.toString();
this.qty = str.substring(0, str.length - 1);
backNumber: function() {
if (this.Model == 1) {
return;
}
var str = this.qty.toString();
this.qty = str.substring(0, str.length - 1);
},
selectNumber: function(n) {
if (this.Model == 1) {
return;
}
this.qty = this.qty.toString()+ n.toString();
this.qty = this.qty.toString() + n.toString();
// this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
},
selectSize: function(n) {
var bg = document.getElementsByClassName("bg");
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
if (bg[i].innerHTML == n) {
bg[i].style.background = "#02C1ED"
}
}
if(n!=0 ){
if (n != 0) {
this.size = n;
// bg[0].style.background = "#02C1ED"
}
console.log(this.size);
},
nextday:function(n){
nextday: function(n) {
this.createZhezhao(-1)
var d = new Date(this.dateTime);
d.setTime(d.getTime()+24*60*60*1000*n);
var s = d.getFullYear()+"-" + (d.getMonth()+1) + "-" + d.getDate();
this.dateTime = s;
var d = new Date(this.dateTime);
d.setTime(d.getTime() + 24 * 60 * 60 * 1000 * n);
if (d.getDate().toString().length == 1) {
this.dateTime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-0" + d.getDate();
} else {
this.dateTime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
}
this.getData();
mui('.scroll1').scroll().scrollTo(0,0,100);
mui('.scroll2').scroll().scrollTo(0,0,100);
mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100);
},
stylebg: function(n) {
if (n == 0) {
return {
"background": "#02C1ED"
}
}
},
nextPage: function() {
nextPage: function(n,k) {
var url_;
var id_;
url_ = "FormingQuality.html";
......@@ -584,13 +979,26 @@
url: url_,
id: id_,
extras: {
IndexID:this.IndexID,
dateTime:this.dateTime,
itemsDetail:this.itemsDetail,
itemsSize:this.itemsSize
IndexID: this.IndexID,
dateTime: this.dateTime,
itemsDetail: this.itemsDetail,
itemsSize: this.itemsSize,
type: n , // n =2 点击不合格进去 ,
parentSize:k,
},
});
},
sop: function() {
this.getLink();
},
selecttime: function() {
var that = this;
......@@ -623,8 +1031,8 @@
* rs.h 时,用法同年
* rs.i 分(minutes 的第二个字母),用法同年
*/
console.log(rs.value)
_self.innerText = rs.text;
_self.innerText = rs.text;
that.dateTime = rs.text;
that.getData();
......@@ -642,9 +1050,13 @@
_self.picker = null;
});
}
mui('.scroll1').scroll().scrollTo(0,0,100);
mui('.scroll2').scroll().scrollTo(0,0,100);
mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0,0,100);
}, //selecttime
back: function() {
plus.screen.lockOrientation("portrait-primary") //横屏
// plus.screen.lockOrientation("portrait-primary") //横屏
}
}
......
......@@ -8,37 +8,47 @@
<link href="../dest/css/mui.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../dest/css/mui.picker.min.css" />
<style type="text/css">
th{
th {
border-width: 1px;
border-style: solid;
border-color: #a9c6c9;
}
.altrowstable {
border-width: 1px;
/*padding: 2px;*/
border-style: solid;
border-color: #a9c6c9;
background: white;
height:200%;
height: 200%;
/*background-color: #F6F6F6;*/
}
.mui-backdrop {
position: fixed;
top: 209px;
right: 13px;
bottom: 46px;
left: 695px;
z-index: 998;
background-color: rgba(0, 0, 0, .3);
}
</style>
</head>
<body>
<div id="app">
<div class="mui-content" >
<div class="mui-content">
<div id="left" style=" display: inline-block; width: 30%; ">
<div id="left-1" style="position: absolute; top: 1px;">
<label style=" text-align: center; position: relative; left: 50px;">今日次品数量:{{number}} </label>
<label style=" text-align: center; position: relative; left: 50px;">今日次品数量:{{number}} </label>
</div>
<div id="left-2" >
<table class="mui-table" style="position: relative;top: -440px;">
<div id="left-2">
<table class="mui-table" style="position: relative;top: -455px;">
<thead class="mui-table-view">
<tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th>
......@@ -47,32 +57,45 @@
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">类型</th>
</tr>
</thead>
</table>
<div class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block; width: 30%; top: 45px;">
</table>
<div id="item1" class="mui-scroll-wrapper " style="border: solid #DAE6EF 1px ;background: white; display: inline-block;height: 480px; width: 30%; top: 45px;">
<div class="mui-scroll">
<table class="mui-table">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @tap="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td>
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @click="selectReport(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div id="item2" class="mui-scroll-wrapper " :style="display_" style="border: solid #DAE6EF 1px ;background: white; display: inline-block;height: 480px; width: 30%; top: 45px;">
<div class="mui-scroll">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft2" @click="selectReport2(item.ReportID)">
<td align="center">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody>
</tr>
</table>
</div>
</div>
<div class="mui-segmented-control" style="position: relative;top: 30px;">
<a id="n1" class="mui-control-item mui-active" @click="selectDisplay(1)">今日实报</a>
<a id="n2" class="mui-control-item " @click="selectDisplay(2)">单款实报</a>
</div>
</div>
</div>
<div id="right" style=" display: inline-block; width: 69%; ">
<div id="right-2" style=" position: relative;top:2px">
<div style="border: solid #DAE6EF 1px ; display: inline-block; width: 80%;">
<ul class="mui-table-view">
......@@ -95,87 +118,90 @@
<p style="float: left;width: 12%; color: #060606;">班组: </p>
<p style="float: left;width: 32%; color: #060606;">{{itemsDetail.WorkTeam}} </p>
</li>
</ul>
</div>
<div style=" display: inline-block; width: 17%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @tap="reportDelete()" >撤回品检</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" @tap="back">返回时报</button>
<div style=" display: inline-block; width: 19%; position: relative;top: -25px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @click="reportDelete()">撤回品检</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" @click="back">返回时报</button>
</div>
</div>
<div id="right-3" style="border: solid #DAE6EF 1px ;position: relative;top : -10px">
<table class="mui-table " >
<div id="right-3" style="border: solid #DAE6EF 1px ;position: relative;top : -18px">
<table class="mui-table ">
<tbody class="mui-table-view-cell">
<tr style=" height: 50px">
<td class="altrowstable" style="background: white;height: 50px" >尺码:</td>
<td class="altrowstable" style=" height: 50px" v-for="itemdef in itemsSizeDef" v-if="itemsSize.length ==0">
<button class="bg" type="button" style="width: 100%;height: 50px" class="mui-btn mui-btn-blue mui-btn-outlined" >{{itemdef}}</button>
<td class="altrowstable" style="background: white;height: 50px; text-align: center;">尺码:</td>
<td class="altrowstable" style=" height: 50px" v-for="itemdef in itemsSizeDef" v-if="itemsSize.length ==0">
<button class="bg" type="button" style="width: 100%;height: 50px" class="mui-btn mui-btn-blue mui-btn-outlined">{{itemdef}}</button>
</td>
<td class="altrowstable" style=" height: 50px" v-for="itemd,isize in itemsSize" >
<button class="bg" :style="stylebg(isize)" style="width: 100%;height: 50px" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" @tap="selectSize(itemd)">{{itemd}}</button>
<td class="altrowstable" style=" height: 50px" v-for="itemd,isize in itemsSize">
<button class="bg" :style="stylebg(itemd)" style="width: 100%;height: 50px; border:0px ;" type="button" class="mui-btn mui-btn-blue mui-btn-outlined"
@click="selectSize(itemd)">{{itemd}}</button>
</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</div>
<div id="right-4" style=" margin-top: 10px ;height: 300px ;">
<div style=" display: inline-block; width: 60%;height: 260px; position: relative;top:-10px;">
<div id="right-4" style=" margin-top: 8px ;height: 300px ;">
<div style=" display: inline-block; width: 60%;height: 305px; position: relative;top:-15px;">
<div class="mui-scroll-wrapper">
<div class="mui-scroll">
<table class="mui-table">
<table class="mui-table">
<tbody class="mui-table-view-cell">
<tr style="height:60px ;" v-for="itemq , n in itemsDetail1_ar" >
<td :id="'Quality_'+ itemqq.ID" class="altrowstable Quality" style="height: 60px;" v-for ="itemqq , n in itemq" @tap ="selectQQ(itemqq.ID)">{{itemqq.Name}} </td>
<tr style="height:60px ;" v-for="itemq , n in itemsDetail1_ar">
<td :id="'Quality_'+ itemqq.ID" class="altrowstable Quality" style="height: 60px;text-align: center; "
v-for="itemqq , n in itemq" @click="selectQQ(itemqq.ID)">
<p style="font-size: 27px; text-align: center;">{{itemqq.Code}}</p>
<label class="mui-pull-caption " style=" font-size: 12px; padding: 0px; margin: 5px 0px 0px 0px; line-height: 12px !important;text-align: center!important">{{itemqq.Name}}</label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style=" display: inline-block; width: 38%; position: relative;top: -15px;">
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 160px ;height: 60px;margin-right: -4px; text-align: center;color: red; "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
:onchange="changeValue()"/>
<button style=" width: 80px;height: 60px;" @tap="backNumber(1)"> ←</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(1)" > 1</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(2)"> 2</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(3)"> 3</button>
<button style=" width: 80px; height: 60px;margin-right: -4px " @tap="selectNumber(4)"> 4</button>
<button style=" width: 80px; height: 60px;margin-right: -4px" @tap="selectNumber(5)"> 5</button>
<button style=" width: 80px;height: 60px;" @tap="selectNumber(6)"> 6</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(7)"> 7</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(8)"> 8</button>
<button style=" width: 80px;height: 60px;"> 9</button>
<button style=" width: 80px;height: 60px; margin-right: -4px" @tap="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 160px;height: 60px; " @tap="submit" :disabled="disable_save_button2"> 提交</button>
</div>
<div style=" display: inline-block; width: 39%; position: relative;top: -50px;">
<input readonly="readonly" style="border: 1px solid #DDDDDD; width: 170px ;height: 65px;margin-right: -6px;margin-bottom: -1px; text-align: center;color: red;background: #C8C7CC;font-size: 25px "
onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty" :onchange="changeValue()" />
<button style=" width: 85px;height: 65px;margin-bottom: -1px;font-size: 25px" @click="backNumber()"> ←</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px ; font-size: 25px;" @click="selectNumber(1)">
1</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(2)">
2</button>
<button style=" width: 85px;height: 65px; margin-right: -4px ;margin-bottom: -1px;font-size: 25px" @click="selectNumber(3)">
3</button>
<button style=" width: 85px; height: 65px;margin-right: -5px ;margin-bottom: -1px;font-size: 25px" @click="selectNumber(4)">
4</button>
<button style=" width: 85px; height: 65px;margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(5)">
5</button>
<button style=" width: 85px;height: 65px;margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(6)">
6</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @click="selectNumber(7)">
7</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;margin-bottom: -1px;font-size: 25px" @clicl="selectNumber(8)">
8</button>
<button style=" width: 85px;height: 65px; margin-bottom: -1px;font-size: 25px" @click="selectNumber(9)"> 9</button>
<button style=" width: 85px;height: 65px; margin-right: -5px;font-size: 25px" @click="selectNumber(0)"> 0</button>
<button class="mui-btn-blue" style=" width: 170px;height: 65px; " @click="submit" :disabled="disable_save_button2">
提交</button>
</div>
</div>
<div id="right-5" style=" border: solid,red,3px; position: absolute; bottom: 0px;">
<label style="height:50px;width: 100px ; position: relative; top :15px"> 处理类型:</label>
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px;background: #02C1ED ;" @tap ="selectProcessingType(1)">返修</button>
<button id="ProcessingType_2" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;" @tap ="selectProcessingType(2)">报废</button>
<div id="right-5" style=" ">
<label style="height:50px;width: 100px ; text-align: center; vertical-align:middle ; position: relative;top: 14px; ">
处理类型:</label>
</div>
<div id="right-5" style=" position: absolute; left:375px ; bottom: 5px;">
<!-- <label style="height:50px;width: 100px ; text-align: center; vertical-align:middle ; "> 处理类型:</label> -->
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px;background: #02C1ED ;font-size: 22px"
@click="selectProcessingType(1)">返修</button>
<button id="ProcessingType_2" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;font-size: 22px"
@click="selectProcessingType(2)">报废</button>
</div>
</div>
</div>
</div>
......@@ -191,7 +217,8 @@
});
function initPage() {
plus.screen.lockOrientation("landscape-secondary") //横屏
// plus.screen.lockOrientation("landscape-secondary") //横屏
plus.screen.lockOrientation("landscape-primary") //横屏
app.init();
}
......@@ -203,97 +230,112 @@
qty: 0,
size: 0,
dateTime: "",
qualityID : 0,
itemsDetail: [], //订单明细
itemsDetail1: [], //品检项目
itemsDetail1_ar:[],
qualityID: 0,
itemsDetail: [], //订单明细
itemsDetail1: [], //品检项目
itemsDetail1_ar: [],
itemsDetail2: [],
itemsHead: [],
itemsLeft: [],
itemsLeft: [], //今日实报
itemsLeft2: [], //单款实报
itemsSize: [],
SizeQty: [],
itemsSizeDef:[40,41,42,43,44,45,46],
itemsSizetest: [11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14,
15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15, 11, 21, 31, 14, 15,
],
itemsSizeDef: [40, 41, 42, 43, 44, 45, 46],
type: 1,
parentSize: 0,
IndexID: 0,
disable_save_button: 'disabled',
disable_reportDelete: 'disabled',
ProcessingType:1,
ProcessingType: 1,
ReportID: 0,
Model:0, //0 可以提交 1 不可以提交
Model: 0, //0 可以提交 1 不可以提交
zhezhao: 1, //
displayModel: 1,
mask_: mui.createMask(function(e) {
return false;
}),
ReportType:2,
},
computed: {
disable_save_button2: function () {
if( this.qty !=0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0 && this.Model == 0 ){
disable_save_button2: function() {
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0 && this.Model == 0) {
return null;
}
else{
} else {
return 'disabled';
}
}
},
display_: function() {
if (this.displayModel == 1) {
return "display: none "
}
}
},
methods: {
init: function() {
mui.init();
mui.init({
beforeback: function() {
var temp = 'Needlecarreport_new.html';
var list = plus.webview.getWebviewById(temp);
mui.fire(list, 'back');
return true;
}
});
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.dateTime = new Date().toLocaleDateString();
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.IndexID = mui.currentWebview.IndexID;
this.itemsDetail= mui.currentWebview.itemsDetail;
this.itemsSize= mui.currentWebview.itemsSize;
this.itemsDetail = mui.currentWebview.itemsDetail;
this.itemsSize = mui.currentWebview.itemsSize;
this.type = mui.currentWebview.type;
this.parentSize = mui.currentWebview.parentSize;
this.getDataInit();
},
getDataInit:function(){
this.getDataDetail1();
this.getDataDetail2();
getDataInit: function() {
this.getDataDetail1();
this.getDataDetail2(1);
this.getTatolNum();
},
getData: function() {
var that = this;
var para = {
ReportType: 2,
ReportType: this.ReportType,
IndexID: this.IndexID
};
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
that.itemsHead = e.items;
if (e.items.length > 0) {
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
that.getDataDetail1();
that.getDataDetail2();
that.getDataDetail2(1);
that.getTatolNum();
that.qty=0;
that.disable_reportDelete='disabled';
}
else{
that.itemsDetail=[];
that.IndexID =0;
that.itemsDetail1 =[];
that.itemsSize=[];
that.size=0;
that.itemsLeft=[];
that.number=0;
that.qty=0;
that.disable_reportDelete='disabled'
that.qty = 0;
that.disable_reportDelete = 'disabled';
} else {
that.itemsDetail = [];
that.IndexID = 0;
that.itemsDetail1 = [];
that.itemsSize = [];
that.size = 0;
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
}
......@@ -303,108 +345,111 @@
getDataDetail1: function() {
var that = this;
var para = {
ReportType: 2,
ReportType: this.ReportType,
IndexID: this.IndexID
};
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
Api.post('/api/vMES/InspectionReport/GetQIItem', para, function(e) {
that.itemsDetail1 = e.items;
that.itemsDetail1_ar=[];
for(var i=0,len=e.items.length;i<len;i+=5){
that.itemsDetail1_ar.push(e.items.slice(i,i+5));
}
that.itemsDetail1_ar = [];
for (var i = 0, len = e.items.length; i < len; i += 5) {
that.itemsDetail1_ar.push(e.items.slice(i, i + 5));
}
});
},
//完成信息明细
getDataDetail2: function() {
getDataDetail2: function(n) {
var that = this;
var para = {
ReportType: 2,
Date: this.dateTime + " 00:00:00",
IndexID: this.IndexID,
ReportType: this.ReportType,
// Date: this.dateTime + " 00:00:00",
IndexID: n == 1 ? 0 : this.IndexID,
PageSize: 200,
PageIndex: 1,
};
console.log(JSON.stringify(para))
Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
console.log(JSON.stringify(e));
that.itemsLeft = e.items;
});
if (n == 1) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
that.itemsLeft = e.items;
console.log(JSON.stringify(that.itemsLeft));
});
} else if (n == 2) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
that.itemsLeft2 = e.items;
});
}
},
getTatolNum: function() {
var that = this;
var para = {
ReportType:2,
ReportType: this.ReportType,
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/InspectionReport/TotalQty', para, function(e) {
that.number = e.data;
that.number = e.data;
});
},
getReportDetail:function(){
getReportDetail: function() {
var that = this;
var para = {
ReportID:this.ReportID
};
Api.post('/api/vMES/InspectionReport/ReportDetail', para, function(e) {
if(e.success){
that.ReportID = e.data.ReportID;
that.itemsDetail = e.data;
that.itemsSize = e.data.SizeName;
that.qualityID = e.data.QIDetailID;
that.ProcessingType = e.data.ProcessingType;
that.size = e.data.UnQualifiedSizeName;
that.qty =e.data.UnQualifiedQty;
that.Model = 1;
that.selectQQ(that.qualityID);
that.selectSize(that.size);
that.selectProcessingType(that.ProcessingType);
}
});
var para = {
ReportID: this.ReportID
};
Api.post('/api/vMES/InspectionReport/ReportDetail', para, function(e) {
if (e.success) {
that.ReportID = e.data.ReportID;
that.itemsDetail = e.data;
that.itemsSize = e.data.SizeName;
that.qualityID = e.data.QIDetailID;
that.ProcessingType = e.data.ProcessingType;
that.size = e.data.UnQualifiedSizeName;
that.qty = e.data.UnQualifiedQty;
that.Model = 1;
that.selectQQ(that.qualityID);
that.selectSize(that.size);
that.selectProcessingType(that.ProcessingType);
}
});
},
reportDelete: function() {
var that = this;
var para = {
ReportID: this.ReportID,
};
Api.post('/api/vMES/InspectionReport/Delete', para, function(e) {
if(e.success){
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.qualityID = 0;
that.selectQQ(0);
that.selectReport(0);
that.selectProcessingType(1);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.Model =0;
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + e.success.message)
if (e.success) {
that.createZhezhao(-1)
that.disable_reportDelete = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.qualityID = 0;
that.selectQQ(0);
that.selectReport(0);
that.selectProcessingType(1);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
that.Model = 0;
mui.toast("撤回成功")
} else {
mui.toast("撤回失败" + e.message)
}
});
......@@ -416,12 +461,9 @@
size: this.itemsSize[i],
qty: 0
}
this.SizeQty.push(tempa);
}
},
submit: function() {
if (!this.checkValue()) {
......@@ -434,7 +476,7 @@
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID,
}
var that = this;
Api.post('/api/vMES/InspectionReport/Save', para, function(e) {
......@@ -449,82 +491,79 @@
that.selectSize(0);
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.success.message);
}
});
},
displayReport:function(){
displayReport: function() {
this.getReportDetail();
},
selectProcessingType:function(n){
var fx = document.getElementById("ProcessingType_1" );
var bf = document.getElementById("ProcessingType_2" );
if(n==1){
fx.style.background ="#02C1ED";
bf.style.background =""
}
if(n==2){
fx.style.background ="";
bf.style.background ="#02C1ED";
selectProcessingType: function(n) {
var fx = document.getElementById("ProcessingType_1");
var bf = document.getElementById("ProcessingType_2");
if (n == 1) {
fx.style.background = "#02C1ED";
bf.style.background = ""
}
else if(n==0){
fx.style.background ="";
bf.style.background ="";
if (n == 2) {
fx.style.background = "";
bf.style.background = "#02C1ED";
} else if (n == 0) {
fx.style.background = "";
bf.style.background = "";
}
this.ProcessingType = n;
},
selectQQ:function(qq){
selectQQ: function(qq) {
var op = document.getElementById("Quality_" + qq)
this.qualityID = qq;
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType !=0) {
this.disable_save_button = null;
}
var reportele = document.getElementsByClassName("Quality");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(qq != 0){op.style.background = "#02C1ED";}
this.qualityID = qq;
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0) {
this.disable_save_button = null;
}
var reportele = document.getElementsByClassName("Quality");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if (qq != 0) {
op.style.background = "#02C1ED";
}
},
selectIndex:function(idx){
selectIndex: function(idx) {
this.IndexID = idx
if(this.IndexID != 0){
if (this.IndexID != 0) {
this.getDataDetail1();
this.getDataDetail2();
this.getDataDetail2(1);
this.getTatolNum();
this.qty=0;
this.size=0;
this.disable_reportDelete='disabled';
}
else{
this.itemsDetail=[];
this.IndexID =0;
this.itemsDetail1 =[];
this.itemsSize=[];
this.size=0;
this.itemsLeft=[];
this.number=0;
this.qty=0;
this.disable_reportDelete='disabled'
this.qty = 0;
this.size = 0;
this.disable_reportDelete = 'disabled';
} else {
this.itemsDetail = [];
this.IndexID = 0;
this.itemsDetail1 = [];
this.itemsSize = [];
this.size = 0;
this.itemsLeft = [];
this.number = 0;
this.qty = 0;
this.disable_reportDelete = 'disabled'
}
},
selectReport: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
......@@ -536,25 +575,85 @@
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if(obj != 0){
if (obj != 0) {
this.createZhezhao(1)
op.style.background = "#02C1ED";
this.displayReport();
}
},
selectReport2: function(obj) {
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj;
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
var reportele = document.getElementsByClassName("Report");
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
if (obj != 0) {
this.createZhezhao(1)
op.style.background = "#02C1ED";
this.displayReport();
}
},
selectDisplay: function(n) {
var opt = document.getElementById("item1")
var opt2 = document.getElementById("item2")
var n1 = document.getElementById("n1")
var n2 = document.getElementById("n2")
if (n == 1) {
n1.style.background = "royalblue"
n1.style.color = "white"
n2.style.background = "white"
n2.style.color = "royalblue"
opt.style.display = "inline-block";
opt2.style.display = "none"
}
if (n == 2) {
this.getDataDetail2(2)
n1.style.background = "white"
n1.style.color = "royalblue"
n2.style.background = "royalblue"
n2.style.color = "white"
opt.style.display = "none";
opt2.style.display = "inline-block"
}
},
createZhezhao: function(n) {
if (n == -1) {
this.mask_._remove()
this.zhezhao = 1;
} else {
if (this.zhezhao == 1) {
this.mask_.show(); //显示遮罩
this.zhezhao = 2
// mask.close();//关闭遮罩
}
}
},
changeValue: function() {
if (isNaN(parseInt(this.qty))) {
this.qty = 0;
this.disable_save_button = 'disabled';
}
if (parseInt(this.qty) > 0) {
this.qty = parseInt(this.qty);
this.disable_save_button = null;
}
},
checkValue: function() {
......@@ -570,52 +669,64 @@
} else if (this.IndexID == 0) {
mui.toast("订单号不正确")
return false;
}else if (this.qualityID ==0){
} else if (this.qualityID == 0) {
mui.toast("请选择品检项目")
return false;
}
else if (this.ProcessingType ==0){
} else if (this.ProcessingType == 0) {
mui.toast("请选择处理类型")
return false;
}
else {
} else {
return true;
}
},
backNumber: function() {
if (this.Model == 1) {
return;
}
var str = this.qty.toString();
this.qty = str.substring(0, str.length - 1);
},
selectNumber: function(n) {
if (this.Model == 1) {
return;
}
this.qty = this.qty.toString() + n.toString();
// this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
},
selectSize: function(n) {
var bg = document.getElementsByClassName("bg");
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
if (bg[i].innerHTML == n) {
bg[i].style.background = "#02C1ED"
}
}
// if(n==0){
//
// bg[0].style.background = "#02C1ED"
// }
this.size = n;
},
stylebg: function(n) {
stylebg: function(k) {
if (this.type == 1) {
return
} else if (this.type == 2) {
if (k == this.parentSize) {
this.size = this.parentSize
return {
"background": "#02C1ED"
}
}
}
// if (n == 0) {
// return {
// "background": "#02C1ED"
//
// }
// }
},
back: function() {
mui.back();
// plus.screen.lockOrientation("portrait-primary") //横屏
......
......@@ -323,6 +323,7 @@
return 'disabled';
}
},
display_:function(){
if(this.displayModel ==1 ){
return "display: none "
......@@ -393,6 +394,9 @@
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getDataDetail1: function() {
......@@ -400,13 +404,20 @@
var para = {
IndexID: this.IndexID,
};
if(this.IndexID == 0){
return;
}
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
if(e.success){
that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName;
// that.size = e.data.SizeName[0];
});
},
getDataDetail2: function(n) {
......@@ -423,9 +434,15 @@
// console.log(JSON.stringify(para))
if( n ==1 ){
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
that.itemsLeft = e.items;
});
if(e.success){
that.itemsLeft = e.items;
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
}
else if( n ==2){
if( this.IndexID == 0)
......@@ -434,9 +451,14 @@
}
else{
Api.post('/api/vMES/ProductionReport/Report', para, function(e) {
if(e.success){
that.itemsLeft2 = e.items;
}
that.itemsLeft2 = e.items;
});
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
}
}
......@@ -451,7 +473,10 @@
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/ProductionReport/TotalQty', para, function(e) {
that.number = e.data;
if(e.success){
that.number = e.data;
}
});
},
//完成进度
......@@ -462,7 +487,9 @@
};
// console.log(JSON.stringify(para))
if(n == 0){
return;
}
Api.post('/api/vMES/ProductionReport/IndexNoCompleteRatio', para, function(e) {
that.CompleteRatio = e.data;
// console.log(JSON.stringify(e))
......@@ -472,6 +499,9 @@
// console.log(that.CompleteRatio);
}
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
......@@ -496,13 +526,18 @@
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2);
that.Model = 0;
var Index = document.getElementById("Index_" + that.IndexID)
Index.style.background = "#02C1ED" ;
if(that.IndexID != 0){
var Index = document.getElementById("Index_" + that.IndexID)
Index.style.background = "#02C1ED" ;
}
mui.toast("撤回成功")
} else {
mui.toast("撤回失败" + e.message)
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
......@@ -529,6 +564,9 @@
} else {
mui.toast("获取明细失败:" + e.message)
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getLink:function(){
......@@ -541,7 +579,7 @@
// console.log( JSON.stringify(para))
Api.post('/api/vMES/Sop/StyleSop', para, function(e) {
if(e.success){
// console.log( JSON.stringify(e))
// console.log( JSON.stringify(e))
that.link = e.data.Url ;
var url_ = "sop.html";
......@@ -552,7 +590,8 @@
extras: {
style:that.itemsDetail.StyleCode,
ReportType:that.ReportType,
link :that.link
link :that.link,
parentPage: "Needlecarreport_new.html"
},
});
......
......@@ -46,7 +46,8 @@
item:1,
style:"",
ReportType:0,
link:""
link:"",
parentPage:"",
},
computed:{
// link:function(){
......@@ -59,17 +60,17 @@
this.style = mui.currentWebview.style
this.ReportType = mui.currentWebview.ReportType
this.link = mui.currentWebview.link
console.log("this.style::" + this.style)
console.log("this.link::" + this.link)
this.parentPage = mui.currentWebview.parentPage
console.log("this.parent::" + this.parentPage)
},
backaction:function(){
console.log('ddddd');
mui.openWindow({
url: 'Needlecarreport_new.html',
id: 'Needlecarreport_new.html',
url: this.parentPage,
id: this.parentPage,
});
},
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment