Commit 23c316c4 authored by 上官's avatar 上官

针车实报 针车品检

parent ecd9dc80
......@@ -53,7 +53,7 @@
</tr>
</thead>
<tbody class="mui-table-view-cell">
<tr :id="'ReportID_'+item.ReportID" class="Report" v-for=" item in itemsLeft" @tap="selectReport(item)">
<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>
......@@ -99,7 +99,7 @@
</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="back">返回时报</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" @tap="back">返回时报</button>
</div>
</div>
......@@ -153,9 +153,13 @@
</div>
<div style=" display: inline-block; position: absolute;bottom: 10px; width: 12%; right: 15px;">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_save_button" @tap="submit">提交</button>
</div>
<div id="right-5" style=" border: solid,red,3px; position: absolute; bottom: 0px;">
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;" @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>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" style="position: absolute; right: 0px; bottom: 0px;margin-bottom: 0px; width: 120px; " :disabled="disable_save_button2" @tap="submit">提交</button>
</div>
</div>
......@@ -200,10 +204,21 @@
IndexID: 0,
disable_save_button: 'disabled',
disable_reportDelete: 'disabled',
disable_qq:'disabled',
ReportID: 0
ProcessingType:0,
ReportID: 0,
Model:0, //0 可以提交 1 不可以提交
},
computed: {
disable_save_button2: function () {
if( this.qty !=0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0 && this.Model == 0 ){
return null;
}
else{
return 'disabled';
}
}
},
methods: {
init: function() {
mui.init();
......@@ -319,6 +334,36 @@
});
},
getReportDetail:function(){
var that = this;
var para = {
ReportID:this.ReportID
};
// console.log(JSON.stringify(para));
Api.post('/api/vMES/InspectionReport/ReportDetail', para, function(e) {
console.log("getReportDetail" + JSON.stringify(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;
......@@ -326,20 +371,25 @@
ReportID: this.ReportID,
};
// console.log(JSON.stringify(para));
Api.post('/api/vMES/ProductionReport/Delete', para, function(e) {
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.getDataDetail1(); //获取列表尺码对应数量
that.qualityID = 0;
that.selectQQ(0);
that.selectReport(0);
that.selectProcessingType(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
that.Model =0;
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + + e.success.message)
mui.toast("撤回失败" + e.success.message)
}
});
......@@ -366,19 +416,24 @@
IndexID: this.IndexID,
SizeName: this.size,
Qty: this.qty,
ProcessingType: this.ProcessingType,
QIDetailID: this.qualityID,
}
console.log(JSON.stringify(para))
var that = this;
Api.post('/api/vMES/ProductionReport/Save', para, function(e) {
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 = 0;
that.qualityID = 0;
that.selectQQ(0);
that.selectProcessingType(0);
that.selectSize(0);
that.getDataDetail1(); //获取列表尺码对应数量
that.selectReport(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getDataDetail2(); //获取左边列表明细
......@@ -388,11 +443,32 @@
}
});
},
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";
}
else if(n==0){
fx.style.background ="";
bf.style.background ="";
}
this.ProcessingType = n;
},
selectQQ:function(qq){
var op = document.getElementById("Quality_" + qq)
this.qualityID = qq;
if (this.qty != 0 && this.size != 0 && this.qualityID != 0) {
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType !=0) {
this.disable_save_button = null;
}
var reportele = document.getElementsByClassName("Quality");
......@@ -401,7 +477,8 @@
reportele[i].style.background = ""
}
op.style.background = "#02C1ED";
if(qq != 0){op.style.background = "#02C1ED";}
},
selectIndex:function(idx){
this.IndexID = idx
......@@ -430,9 +507,12 @@
},
selectReport: function(obj) {
var op = document.getElementById("ReportID_" + obj.ReportID)
var op = document.getElementById("ReportID_" + obj)
this.ReportID = obj.ReportID;
this.ReportID = obj;
if (this.ReportID != 0) {
this.disable_reportDelete = null;
}
......@@ -441,7 +521,11 @@
for (var i = 0; i < reportele.length; i++) {
reportele[i].style.background = ""
}
op.style.background = "#02C1ED";
if(obj != 0){
op.style.background = "#02C1ED";
}
this.displayReport();
},
changeValue: function() {
......@@ -470,8 +554,15 @@
} else if (this.IndexID == 0) {
mui.toast("订单号不正确")
return false;
} else {
console.log(this.size);
}else if (this.qualityID ==0){
mui.toast("请选择品检项目")
return false;
}
else if (this.ProcessingType ==0){
mui.toast("请选择处理类型")
return false;
}
else {
return true;
}
},
......@@ -490,78 +581,27 @@
}
}
if(n==0){
bg[0].style.background = "#02C1ED"
}
// if(n==0){
//
// bg[0].style.background = "#02C1ED"
// }
this.size = n;
},
stylebg: function(n) {
if (n == 0) {
return {
"background": "#02C1ED"
}
}
// if (n == 0) {
// return {
// "background": "#02C1ED"
//
// }
// }
},
SelectDate: function() {
console.log(this.dateTime)
},
selecttime: function() {
var that = this;
var _self = document.getElementById("selectdate")
if (_self.picker) {
_self.picker.show(function(rs) {
_self.innerText = rs.text
_self.picker.dispose();
_self.picker = null;
});
} else {
var optionsJson = _self.getAttribute('data-options') || '{}';
var options = JSON.parse(optionsJson);
var id = _self.getAttribute('id');
/*
* 首次显示时实例化组件
* 示例为了简洁,将 options 放在了按钮的 dom 上
* 也可以直接通过代码声明 optinos 用于实例化 DtPicker
*/
_self.picker = new mui.DtPicker(options);
_self.picker.show(function(rs) {
/*
* rs.value 拼合后的 value
* rs.text 拼合后的 text
* rs.y 年,可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
* rs.m 月,用法同年
* rs.d 日,用法同年
* rs.h 时,用法同年
* rs.i 分(minutes 的第二个字母),用法同年
*/
_self.innerText = rs.text
that.dateTime = rs.text;
that.getData();
/*
* 返回 false 可以阻止选择框的关闭
* return false;
*/
/*
* 释放组件资源,释放后将将不能再操作组件
* 通常情况下,不需要示放组件,new DtPicker(options) 后,可以一直使用。
* 当前示例,因为内容较多,如不进行资原释放,在某些设备上会较慢。
* 所以每次用完便立即调用 dispose 进行释放,下次用时再创建新实例。
*/
_self.picker.dispose();
_self.picker = null;
});
}
}, //selecttime
back: function() {
console.log("back");
mui.back();
// plus.screen.lockOrientation("portrait-primary") //横屏
}
}
......
......@@ -371,7 +371,7 @@
mui.toast("撤回成功")
}
else{
mui.toast("撤回失败" + + e.success.message)
mui.toast("撤回失败" + e.success.message)
}
});
......
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