Commit 9bb68c5a authored by 上官's avatar 上官

调整 同步

parent f0efef33
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
<div style=" display: inline-block; width: 38%;"> <div style=" display: inline-block; width: 38%;">
<div> <div>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;" <button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;"
@click="sop">SOP</button> @click="sop" :disabled="SOP__">SOP</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;" <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> :disabled="disable_qq_" @click="submitZD">整单完工</button>
</div> </div>
...@@ -266,6 +266,7 @@ ...@@ -266,6 +266,7 @@
<script src="../dest/js/createView.min.js"></script> <script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script> <script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script> <script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript"> <script type="text/javascript">
mui.plusReady(function() { mui.plusReady(function() {
...@@ -328,6 +329,15 @@ ...@@ -328,6 +329,15 @@
return "display: none " return "display: none "
} }
},
SOP__:function(){
if(this.IndexID == 0){
return "disabled"
}
else{
return null
}
} }
}, },
...@@ -347,10 +357,7 @@ ...@@ -347,10 +357,7 @@
bounce: false, bounce: false,
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.dateTime = new Date().toLocaleDateString(); this.dateTime = moment().format().substring(0,10)
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.today = this.dateTime; this.today = this.dateTime;
this.getData(); this.getData();
}, },
...@@ -977,6 +984,7 @@ ...@@ -977,6 +984,7 @@
itemsSize: this.itemsSize, itemsSize: this.itemsSize,
type: n , // n =2 点击不合格进去 , type: n , // n =2 点击不合格进去 ,
parentSize:k, parentSize:k,
sizeNum:this.itemsDetail1 //尺码和数量
}, },
}); });
......
...@@ -49,12 +49,12 @@ ...@@ -49,12 +49,12 @@
</div> </div>
<div id="left-2"> <div id="left-2">
<table class="mui-table" style="position: relative;top: -455px;"> <table class="mui-table" style="position: relative;top: -455px;">
<thead class="mui-table-view"> <tbody class="mui-table-view-cell" >
<tr> <tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th> <th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9; width: 20%">时间</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: 50%">指令号</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: 15%">数量</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: 15%">类型</th>
</tr> </tr>
</thead> </thead>
</table> </table>
...@@ -63,10 +63,10 @@ ...@@ -63,10 +63,10 @@
<table class="mui-table"> <table class="mui-table">
<tbody class="mui-table-view-cell"> <tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @click="selectReport(item.ReportID)"> <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" style="width: 20% ">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td> <td align="center" style="width: 50% ">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td> <td align="center" style="width: 15% ">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td> <td align="center" style="width: 15% ">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody> </tbody>
</tr> </tr>
</table> </table>
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
<script src="../dest/js/createView.min.js"></script> <script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script> <script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script> <script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript"> <script type="text/javascript">
mui.plusReady(function() { mui.plusReady(function() {
...@@ -255,6 +256,7 @@ ...@@ -255,6 +256,7 @@
return false; return false;
}), }),
ReportType:0, ReportType:0,
sizeNum:[],
}, },
computed: { computed: {
...@@ -276,7 +278,7 @@ ...@@ -276,7 +278,7 @@
init: function() { init: function() {
mui.init({ mui.init({
beforeback: function() { beforeback: function() {
var temp = 'Needlecarreport_new.html'; var temp = 'Cutting.html';
var list = plus.webview.getWebviewById(temp); var list = plus.webview.getWebviewById(temp);
mui.fire(list, 'back'); mui.fire(list, 'back');
return true; return true;
...@@ -288,19 +290,18 @@ ...@@ -288,19 +290,18 @@
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.dateTime = new Date().toLocaleDateString(); this.dateTime = moment().format().substring(0,10)
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.IndexID = mui.currentWebview.IndexID; this.IndexID = mui.currentWebview.IndexID;
this.itemsDetail = mui.currentWebview.itemsDetail; this.itemsDetail = mui.currentWebview.itemsDetail;
this.itemsSize = mui.currentWebview.itemsSize; this.itemsSize = mui.currentWebview.itemsSize;
this.type = mui.currentWebview.type; this.type = mui.currentWebview.type;
this.parentSize = mui.currentWebview.parentSize; this.parentSize = mui.currentWebview.parentSize;
// this.sizeNum = mui.currentWebview.sizeNum;
this.getDataInit(); this.getDataInit();
}, },
getDataInit: function() { getDataInit: function() {
this.getsizeNum()
this.getDataDetail1(); this.getDataDetail1();
this.getDataDetail2(1); this.getDataDetail2(1);
this.getTatolNum(); this.getTatolNum();
...@@ -317,7 +318,7 @@ ...@@ -317,7 +318,7 @@
that.itemsHead = e.items; that.itemsHead = e.items;
if (e.items.length > 0) { if (e.items.length > 0) {
that.getsizeNum()
that.itemsDetail = e.items[0]; that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID; that.IndexID = e.items[0].IndexID;
...@@ -382,11 +383,35 @@ ...@@ -382,11 +383,35 @@
}); });
} }
}, },
getsizeNum: function() {
var that = this;
var para = {
IndexID: this.IndexID,
};
console.log("bbb:::" + JSON.stringify(para))
if(this.IndexID == 0){
return;
}
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
if(e.success){
that.sizeNum = e.data.ReportDetail;
console.log("aaa:::" + JSON.stringify(that.sizeNum))
}
else{
that.sizeNum=[]
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getTatolNum: function() { getTatolNum: function() {
var that = this; var that = this;
var para = { var para = {
ReportType: this.ReportType, ReportType: this.ReportType,
Date: this.dateTime + " 00:00:00", Date: this.dateTime + " 00:00:00",
}; };
Api.post('/api/vMES/InspectionReport/TotalQty', para, function(e) { Api.post('/api/vMES/InspectionReport/TotalQty', para, function(e) {
...@@ -431,6 +456,7 @@ ...@@ -431,6 +456,7 @@
Api.post('/api/vMES/InspectionReport/Delete', para, function(e) { Api.post('/api/vMES/InspectionReport/Delete', para, function(e) {
if (e.success) { if (e.success) {
that.getsizeNum()
that.createZhezhao(-1) that.createZhezhao(-1)
that.disable_reportDelete = 'disabled' that.disable_reportDelete = 'disabled'
that.size = 0; that.size = 0;
...@@ -464,40 +490,75 @@ ...@@ -464,40 +490,75 @@
this.SizeQty.push(tempa); this.SizeQty.push(tempa);
} }
}, },
sumUnQualifiedQty:function(){
for (var i = 0; i < this.sizeNum.length; i++) {
if(this.sizeNum[i].SizeName == this.size){
this.sizeNum[i].UnQualifiedQty = this.sizeNum[i].UnQualifiedQty + this.qty;
}
}
},
submit_: function() {
var that = this;
var para = {
IndexID: this.IndexID,
SizeName: this.size,
Qty: this.qty,
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID,
}
Api.post('/api/vMES/InspectionReport/Save', para, function(e) {
if (e.success) {
that.sumUnQualifiedQty()
that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.ProcessingType = 1;
that.qualityID = 0;
that.selectQQ(0);
that.selectProcessingType(1);
that.selectSize(0);
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.success.message);
}
});
},
submit: function() { submit: function() {
var that =this;
if (!this.checkValue()) { if (!this.checkValue()) {
return; return;
} }
var para = { for (var i = 0; i < this.sizeNum.length; i++) {
IndexID: this.IndexID, if (this.sizeNum[i].SizeName == this.size) {
SizeName: this.size, if (parseInt(this.qty) > 10 && parseInt(this.qty) / this.sizeNum[i].Qty > 0.1) {
Qty: this.qty, var btnArray = ['否', '是'];
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID, mui.confirm('次品提交数量占总数量的10%以上,是否继续保存?', '提示', btnArray, function(e) {
} if (e.index == 1) {
that.submit_();
var that = this; } else {
Api.post('/api/vMES/InspectionReport/Save', para, function(e) { return
}
if (e.success) { })
that.disable_save_button = 'disabled' } else {
that.size = 0; this.submit_();
that.qty = 0; }
that.ProcessingType = 1;
that.qualityID = 0; }
that.selectQQ(0);
that.selectProcessingType(1);
that.selectSize(0); }
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.success.message);
}
});
}, },
displayReport: function() { displayReport: function() {
this.getReportDetail(); this.getReportDetail();
...@@ -675,6 +736,20 @@ ...@@ -675,6 +736,20 @@
mui.toast("请选择处理类型") mui.toast("请选择处理类型")
return false; return false;
} else { } else {
for (var i = 0; i < this.sizeNum.length; i++) {
if(this.sizeNum[i].SizeName == this.size){
if(this.qty>this.sizeNum[i].Qty ){
this.qty = 0;
mui.toast("不合格数量不能大于总数,请重新输入")
return false;
}
else if (this.qty > this.sizeNum[i].Qty - this.sizeNum[i].UnQualifiedQty){
this.qty = 0;
mui.toast("不合格数量不能大于总数,请重新输入")
return false;
}
}
}
return true; return true;
} }
}, },
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
<div style=" display: inline-block; width: 38%;"> <div style=" display: inline-block; width: 38%;">
<div> <div>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;" <button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;"
@click="sop">SOP</button> @click="sop" :disabled="SOP__">SOP</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;" <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> :disabled="disable_qq_" @click="submitZD">整单完工</button>
</div> </div>
...@@ -266,6 +266,7 @@ ...@@ -266,6 +266,7 @@
<script src="../dest/js/createView.min.js"></script> <script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script> <script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script> <script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript"> <script type="text/javascript">
mui.plusReady(function() { mui.plusReady(function() {
...@@ -328,6 +329,15 @@ ...@@ -328,6 +329,15 @@
return "display: none " return "display: none "
} }
},
SOP__:function(){
if(this.IndexID == 0){
return "disabled"
}
else{
return null
}
} }
}, },
...@@ -347,10 +357,7 @@ ...@@ -347,10 +357,7 @@
bounce: false, bounce: false,
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.dateTime = new Date().toLocaleDateString(); this.dateTime = moment().format().substring(0,10)
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.today = this.dateTime; this.today = this.dateTime;
this.getData(); this.getData();
}, },
...@@ -985,6 +992,7 @@ ...@@ -985,6 +992,7 @@
itemsSize: this.itemsSize, itemsSize: this.itemsSize,
type: n , // n =2 点击不合格进去 , type: n , // n =2 点击不合格进去 ,
parentSize:k, parentSize:k,
sizeNum:this.itemsDetail1 //尺码和数量
}, },
}); });
......
...@@ -49,12 +49,12 @@ ...@@ -49,12 +49,12 @@
</div> </div>
<div id="left-2"> <div id="left-2">
<table class="mui-table" style="position: relative;top: -455px;"> <table class="mui-table" style="position: relative;top: -455px;">
<thead class="mui-table-view"> <tbody class="mui-table-view-cell" >
<tr> <tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th> <th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9; width: 20%">时间</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: 50%">指令号</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: 15%">数量</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: 15%">类型</th>
</tr> </tr>
</thead> </thead>
</table> </table>
...@@ -63,10 +63,10 @@ ...@@ -63,10 +63,10 @@
<table class="mui-table"> <table class="mui-table">
<tbody class="mui-table-view-cell"> <tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @click="selectReport(item.ReportID)"> <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" style="width: 20% ">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td> <td align="center" style="width: 50% ">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td> <td align="center" style="width: 15% ">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td> <td align="center" style="width: 15% ">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody> </tbody>
</tr> </tr>
</table> </table>
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
<script src="../dest/js/createView.min.js"></script> <script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script> <script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script> <script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript"> <script type="text/javascript">
mui.plusReady(function() { mui.plusReady(function() {
...@@ -254,7 +255,8 @@ ...@@ -254,7 +255,8 @@
mask_: mui.createMask(function(e) { mask_: mui.createMask(function(e) {
return false; return false;
}), }),
ReportType:2, ReportType: 2,
sizeNum: [], //尺码与数量
}, },
computed: { computed: {
...@@ -276,7 +278,7 @@ ...@@ -276,7 +278,7 @@
init: function() { init: function() {
mui.init({ mui.init({
beforeback: function() { beforeback: function() {
var temp = 'Needlecarreport_new.html'; var temp = 'Forming.html';
var list = plus.webview.getWebviewById(temp); var list = plus.webview.getWebviewById(temp);
mui.fire(list, 'back'); mui.fire(list, 'back');
return true; return true;
...@@ -288,19 +290,19 @@ ...@@ -288,19 +290,19 @@
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.dateTime = new Date().toLocaleDateString(); this.dateTime = moment().format().substring(0,10)
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.IndexID = mui.currentWebview.IndexID; this.IndexID = mui.currentWebview.IndexID;
this.itemsDetail = mui.currentWebview.itemsDetail; this.itemsDetail = mui.currentWebview.itemsDetail;
this.itemsSize = mui.currentWebview.itemsSize; this.itemsSize = mui.currentWebview.itemsSize;
this.type = mui.currentWebview.type; this.type = mui.currentWebview.type;
this.parentSize = mui.currentWebview.parentSize; this.parentSize = mui.currentWebview.parentSize;
// this.sizeNum = mui.currentWebview.sizeNum;
this.getDataInit(); this.getDataInit();
}, },
getDataInit: function() { getDataInit: function() {
this.getsizeNum()
this.getDataDetail1(); this.getDataDetail1();
this.getDataDetail2(1); this.getDataDetail2(1);
this.getTatolNum(); this.getTatolNum();
...@@ -317,7 +319,7 @@ ...@@ -317,7 +319,7 @@
that.itemsHead = e.items; that.itemsHead = e.items;
if (e.items.length > 0) { if (e.items.length > 0) {
that.getsizeNum()
that.itemsDetail = e.items[0]; that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID; that.IndexID = e.items[0].IndexID;
...@@ -370,11 +372,12 @@ ...@@ -370,11 +372,12 @@
PageSize: 200, PageSize: 200,
PageIndex: 1, PageIndex: 1,
}; };
console.log(JSON.stringify(para))
if (n == 1) { if (n == 1) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) { Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
console.log("itemsLeft::" + JSON.stringify(e))
that.itemsLeft = e.items; that.itemsLeft = e.items;
console.log(JSON.stringify(that.itemsLeft));
}); });
} else if (n == 2) { } else if (n == 2) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) { Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
...@@ -383,6 +386,30 @@ ...@@ -383,6 +386,30 @@
}); });
} }
}, },
getsizeNum: function() {
var that = this;
var para = {
IndexID: this.IndexID,
};
console.log("bbb:::" + JSON.stringify(para))
if(this.IndexID == 0){
return;
}
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
if(e.success){
that.sizeNum = e.data.ReportDetail;
console.log("aaa:::" + JSON.stringify(that.sizeNum))
}
else{
that.sizeNum=[]
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getTatolNum: function() { getTatolNum: function() {
var that = this; var that = this;
var para = { var para = {
...@@ -432,6 +459,7 @@ ...@@ -432,6 +459,7 @@
Api.post('/api/vMES/InspectionReport/Delete', para, function(e) { Api.post('/api/vMES/InspectionReport/Delete', para, function(e) {
if (e.success) { if (e.success) {
that.getsizeNum()
that.createZhezhao(-1) that.createZhezhao(-1)
that.disable_reportDelete = 'disabled' that.disable_reportDelete = 'disabled'
that.size = 0; that.size = 0;
...@@ -465,10 +493,15 @@ ...@@ -465,10 +493,15 @@
this.SizeQty.push(tempa); this.SizeQty.push(tempa);
} }
}, },
submit: function() { sumUnQualifiedQty:function(){
if (!this.checkValue()) { for (var i = 0; i < this.sizeNum.length; i++) {
return; if(this.sizeNum[i].SizeName == this.size){
this.sizeNum[i].UnQualifiedQty = this.sizeNum[i].UnQualifiedQty + this.qty;
}
} }
},
submit_: function() {
var that = this;
var para = { var para = {
IndexID: this.IndexID, IndexID: this.IndexID,
SizeName: this.size, SizeName: this.size,
...@@ -477,10 +510,11 @@ ...@@ -477,10 +510,11 @@
QIDetailID: this.qualityID, QIDetailID: this.qualityID,
} }
var that = this;
Api.post('/api/vMES/InspectionReport/Save', para, function(e) { Api.post('/api/vMES/InspectionReport/Save', para, function(e) {
if (e.success) { if (e.success) {
that.sumUnQualifiedQty()
that.disable_save_button = 'disabled' that.disable_save_button = 'disabled'
that.size = 0; that.size = 0;
that.qty = 0; that.qty = 0;
...@@ -499,6 +533,34 @@ ...@@ -499,6 +533,34 @@
mui.toast("提交失败: " + e.success.message); mui.toast("提交失败: " + e.success.message);
} }
}); });
},
submit: function() {
var that = this;
if (!this.checkValue()) {
return;
}
for (var i = 0; i < this.sizeNum.length; i++) {
if (this.sizeNum[i].SizeName == this.size) {
if (parseInt(this.qty) > 10 && parseInt(this.qty) / this.sizeNum[i].Qty > 0.1) {
var btnArray = ['否', '是'];
mui.confirm('次品提交数量占总数量的10%以上,是否继续保存?', '提示', btnArray, function(e) {
if (e.index == 1) {
that.submit_();
} else {
return
}
})
} else {
this.submit_();
}
}
}
}, },
displayReport: function() { displayReport: function() {
this.getReportDetail(); this.getReportDetail();
...@@ -577,7 +639,7 @@ ...@@ -577,7 +639,7 @@
} }
if (obj != 0) { if (obj != 0) {
this.createZhezhao(1) this.createZhezhao(1)
op.style.background = "#02C1ED"; op.style.background = "#02C1ED";
this.displayReport(); this.displayReport();
} }
...@@ -662,6 +724,7 @@ ...@@ -662,6 +724,7 @@
mui.toast("数量不正确") mui.toast("数量不正确")
return false; return false;
} }
//尺码不正确 //尺码不正确
else if (this.size == 0) { else if (this.size == 0) {
mui.toast("尺码不正确") mui.toast("尺码不正确")
...@@ -676,6 +739,20 @@ ...@@ -676,6 +739,20 @@
mui.toast("请选择处理类型") mui.toast("请选择处理类型")
return false; return false;
} else { } else {
for (var i = 0; i < this.sizeNum.length; i++) {
if(this.sizeNum[i].SizeName == this.size){
if(this.qty>this.sizeNum[i].Qty ){
this.qty = 0;
mui.toast("不合格数量不能大于总数,请重新输入")
return false;
}
else if (this.qty > this.sizeNum[i].Qty - this.sizeNum[i].UnQualifiedQty){
this.qty = 0;
mui.toast("不合格数量不能大于总数,请重新输入")
return false;
}
}
}
return true; return true;
} }
}, },
......
...@@ -171,6 +171,7 @@ ...@@ -171,6 +171,7 @@
<script src="../dest/js/createView.min.js"></script> <script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script> <script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script> <script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript"> <script type="text/javascript">
mui.plusReady(function() { mui.plusReady(function() {
...@@ -229,10 +230,7 @@ ...@@ -229,10 +230,7 @@
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.dateTime = new Date().toLocaleDateString(); this.dateTime = moment().format().substring(0,10)
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.IndexID = mui.currentWebview.IndexID; this.IndexID = mui.currentWebview.IndexID;
......
...@@ -48,25 +48,25 @@ ...@@ -48,25 +48,25 @@
<label style=" text-align: center; position: relative; left: 50px;">今日次品数量:{{number}} </label> <label style=" text-align: center; position: relative; left: 50px;">今日次品数量:{{number}} </label>
</div> </div>
<div id="left-2"> <div id="left-2">
<table class="mui-table" style="position: relative;top: -455px;"> <table class="mui-table" style="position: relative;top: -455px;" >
<thead class="mui-table-view"> <tbody class="mui-table-view-cell" >
<tr> <tr>
<th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;">时间</th> <th style="font-size: 16px;font-weight: normal;background-color: #E2E2E9;width: 20%">时间</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: 50% ">指令号</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: 15%">数量</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: 15%">类型</th>
</tr> </tr>
</thead> </tbody>
</table> </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 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"> <div class="mui-scroll">
<table class="mui-table"> <table class="mui-table">
<tbody class="mui-table-view-cell"> <tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @click="selectReport(item.ReportID)"> <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" style="width: 20% ">{{item.Date}}</td>
<td align="center">{{item.IndexNo}}</td> <td align="center" style="width: 50% ">{{item.IndexNo}}</td>
<td align="center">{{item.Qty}}</td> <td align="center" style="width: 15% ">{{item.Qty}}</td>
<td align="center">{{item.ProcessingType==1?"返修" :"报废"}}</td> <td align="center" style="width: 15% ">{{item.ProcessingType==1?"返修" :"报废"}}</td>
</tbody> </tbody>
</tr> </tr>
</table> </table>
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
<script src="../dest/js/createView.min.js"></script> <script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script> <script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script> <script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript"> <script type="text/javascript">
mui.plusReady(function() { mui.plusReady(function() {
...@@ -255,6 +256,7 @@ ...@@ -255,6 +256,7 @@
return false; return false;
}), }),
ReportType:1, ReportType:1,
sizeNum:[]
}, },
computed: { computed: {
...@@ -288,19 +290,18 @@ ...@@ -288,19 +290,18 @@
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.dateTime = new Date().toLocaleDateString(); this.dateTime = moment().format().substring(0,10)
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.IndexID = mui.currentWebview.IndexID; this.IndexID = mui.currentWebview.IndexID;
this.itemsDetail = mui.currentWebview.itemsDetail; this.itemsDetail = mui.currentWebview.itemsDetail;
this.itemsSize = mui.currentWebview.itemsSize; this.itemsSize = mui.currentWebview.itemsSize;
this.type = mui.currentWebview.type; this.type = mui.currentWebview.type;
this.parentSize = mui.currentWebview.parentSize; this.parentSize = mui.currentWebview.parentSize;
// this.sizeNum = mui.currentWebview.sizeNum;
this.getDataInit(); this.getDataInit();
}, },
getDataInit: function() { getDataInit: function() {
this.getsizeNum()
this.getDataDetail1(); this.getDataDetail1();
this.getDataDetail2(1); this.getDataDetail2(1);
this.getTatolNum(); this.getTatolNum();
...@@ -317,7 +318,7 @@ ...@@ -317,7 +318,7 @@
that.itemsHead = e.items; that.itemsHead = e.items;
if (e.items.length > 0) { if (e.items.length > 0) {
that.getsizeNum()
that.itemsDetail = e.items[0]; that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID; that.IndexID = e.items[0].IndexID;
...@@ -373,7 +374,7 @@ ...@@ -373,7 +374,7 @@
if (n == 1) { if (n == 1) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) { Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
that.itemsLeft = e.items; that.itemsLeft = e.items;
console.log(JSON.stringify(that.itemsLeft));
}); });
} else if (n == 2) { } else if (n == 2) {
Api.post('/api/vMES/InspectionReport/Report', para, function(e) { Api.post('/api/vMES/InspectionReport/Report', para, function(e) {
...@@ -382,6 +383,30 @@ ...@@ -382,6 +383,30 @@
}); });
} }
}, },
getsizeNum: function() {
var that = this;
var para = {
IndexID: this.IndexID,
};
console.log("bbb:::" + JSON.stringify(para))
if(this.IndexID == 0){
return;
}
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
if(e.success){
that.sizeNum = e.data.ReportDetail;
console.log("aaa:::" + JSON.stringify(that.sizeNum))
}
else{
that.sizeNum=[]
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
},
getTatolNum: function() { getTatolNum: function() {
var that = this; var that = this;
var para = { var para = {
...@@ -431,6 +456,7 @@ ...@@ -431,6 +456,7 @@
Api.post('/api/vMES/InspectionReport/Delete', para, function(e) { Api.post('/api/vMES/InspectionReport/Delete', para, function(e) {
if (e.success) { if (e.success) {
that.getsizeNum()
that.createZhezhao(-1) that.createZhezhao(-1)
that.disable_reportDelete = 'disabled' that.disable_reportDelete = 'disabled'
that.size = 0; that.size = 0;
...@@ -464,41 +490,75 @@ ...@@ -464,41 +490,75 @@
this.SizeQty.push(tempa); this.SizeQty.push(tempa);
} }
}, },
submit: function() { sumUnQualifiedQty:function(){
if (!this.checkValue()) { for (var i = 0; i < this.sizeNum.length; i++) {
return; if(this.sizeNum[i].SizeName == this.size){
} this.sizeNum[i].UnQualifiedQty = this.sizeNum[i].UnQualifiedQty + this.qty;
var para = {
IndexID: this.IndexID,
SizeName: this.size,
Qty: this.qty,
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID,
}
var that = this;
Api.post('/api/vMES/InspectionReport/Save', para, function(e) {
if (e.success) {
that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.ProcessingType = 1;
that.qualityID = 0;
that.selectQQ(0);
that.selectProcessingType(1);
that.selectSize(0);
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.success.message);
} }
}); }
}, },
submit_: function() {
var that = this;
var para = {
IndexID: this.IndexID,
SizeName: this.size,
Qty: this.qty,
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID,
}
Api.post('/api/vMES/InspectionReport/Save', para, function(e) {
if (e.success) {
that.sumUnQualifiedQty()
that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.ProcessingType = 1;
that.qualityID = 0;
that.selectQQ(0);
that.selectProcessingType(1);
that.selectSize(0);
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(1); //获取左边列表明细
that.getDataDetail2(2); //获取左边列表明细
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.success.message);
}
});
},
submit: function() {
var that = this;
if (!this.checkValue()) {
return;
}
for (var i = 0; i < this.sizeNum.length; i++) {
if (this.sizeNum[i].SizeName == this.size) {
if (parseInt(this.qty) > 10 && parseInt(this.qty) / this.sizeNum[i].Qty > 0.1) {
var btnArray = ['否', '是'];
mui.confirm('次品提交数量占总数量的10%以上,是否继续保存?', '提示', btnArray, function(e) {
if (e.index == 1) {
that.submit_();
} else {
return
}
})
} else {
this.submit_();
}
}
}
},
displayReport: function() { displayReport: function() {
this.getReportDetail(); this.getReportDetail();
}, },
...@@ -675,6 +735,21 @@ ...@@ -675,6 +735,21 @@
mui.toast("请选择处理类型") mui.toast("请选择处理类型")
return false; return false;
} else { } else {
for (var i = 0; i < this.sizeNum.length; i++) {
if(this.sizeNum[i].SizeName == this.size){
if(this.qty>this.sizeNum[i].Qty ){
this.qty = 0;
mui.toast("不合格数量不能大于总数,请重新输入")
return false;
}
else if (this.qty > this.sizeNum[i].Qty - this.sizeNum[i].UnQualifiedQty){
this.qty = 0;
mui.toast("不合格数量不能大于总数,请重新输入")
return false;
}
}
}
return true; return true;
} }
}, },
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
<div style=" display: inline-block; width: 38%;"> <div style=" display: inline-block; width: 38%;">
<div> <div>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;" <button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;"
@click="sop">SOP</button> @click="sop" :disabled="SOP__">SOP</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="width: 120px; height: 60; display: inline-block;" <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> :disabled="disable_qq_" @click="submitZD">整单完工</button>
</div> </div>
...@@ -266,6 +266,7 @@ ...@@ -266,6 +266,7 @@
<script src="../dest/js/createView.min.js"></script> <script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/public.min.js"></script> <script src="../dest/js/public.min.js"></script>
<script src="../dest/js/vue.min.js"> </script> <script src="../dest/js/vue.min.js"> </script>
<script src="../dest/js/moment.js"></script>
<script type="text/javascript"> <script type="text/javascript">
mui.plusReady(function() { mui.plusReady(function() {
...@@ -329,6 +330,15 @@ ...@@ -329,6 +330,15 @@
return "display: none " return "display: none "
} }
},
SOP__:function(){
if(this.IndexID == 0){
return "disabled"
}
else{
return null
}
} }
}, },
...@@ -348,10 +358,8 @@ ...@@ -348,10 +358,8 @@
bounce: false, bounce: false,
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.dateTime = new Date().toLocaleDateString(); this.dateTime = moment().format().substring(0,10)
this.dateTime = this.dateTime.replace("/", "-")
this.dateTime = this.dateTime.replace("/", "-")
this.today = this.dateTime; this.today = this.dateTime;
this.getData(); this.getData();
}, },
...@@ -409,6 +417,7 @@ ...@@ -409,6 +417,7 @@
} }
Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) { Api.post('/api/vMES/ProductionReport/ProductIndexNoDetail', para, function(e) {
if(e.success){ if(e.success){
that.itemsDetail = e.data; that.itemsDetail = e.data;
that.itemsDetail1 = e.data.ReportDetail; that.itemsDetail1 = e.data.ReportDetail;
that.itemsSize = e.data.SizeName; that.itemsSize = e.data.SizeName;
...@@ -576,7 +585,7 @@ ...@@ -576,7 +585,7 @@
StyleCode: this.itemsDetail.StyleCode StyleCode: this.itemsDetail.StyleCode
} }
// console.log( JSON.stringify(para)) console.log( JSON.stringify(para))
Api.post('/api/vMES/Sop/StyleSop', para, function(e) { Api.post('/api/vMES/Sop/StyleSop', para, function(e) {
if(e.success){ if(e.success){
// console.log( JSON.stringify(e)) // console.log( JSON.stringify(e))
...@@ -976,6 +985,7 @@ ...@@ -976,6 +985,7 @@
itemsSize: this.itemsSize, itemsSize: this.itemsSize,
type: n , // n =2 点击不合格进去 , type: n , // n =2 点击不合格进去 ,
parentSize:k, parentSize:k,
sizeNum:this.itemsDetail1 //尺码和数量
}, },
}); });
......
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