Commit 99837efc authored by 王文琼's avatar 王文琼
Browse files

优化。。。

parent b3b8e80d
...@@ -108,6 +108,22 @@ body { ...@@ -108,6 +108,22 @@ body {
margin: 0; margin: 0;
border-radius:0 ; border-radius:0 ;
} }
.workTime{
width: calc(100% - 80px);
float: right;
height: 33px;
border: 1px solid #c8c7cc;
}
.workTime select{
background-color: rgba(0,0,0,.1);
padding: 0;
padding-left:5px;
height: 33px;
margin: 0;
border-radius:0 ;
}
.mui-search{ .mui-search{
width: calc(100% - 80px); width: calc(100% - 80px);
float: right; float: right;
......
...@@ -136,7 +136,22 @@ body, ...@@ -136,7 +136,22 @@ body,
.mui-inner-wrap { .mui-inner-wrap {
height: 100%; height: 100%;
} }
.workTime{
width: calc(100% - 280px);
float: right;
height: 44px;
border: 1px solid #c8c7cc;
}
.workTime select{
background-color: rgba(0,0,0,.1);
padding: 0;
padding-left:5px;
height: 44px;
margin: 0;
border-radius:0 ;
}
/*****表格*****/ /*****表格*****/
.detail-list { .detail-list {
...@@ -274,6 +289,7 @@ body, ...@@ -274,6 +289,7 @@ body,
.right-main { .right-main {
padding-top: 5px; padding-top: 5px;
position: relative; position: relative;
height: calc(100% - 80px);
} }
.top1 { .top1 {
...@@ -360,6 +376,7 @@ body, ...@@ -360,6 +376,7 @@ body,
position: absolute; position: absolute;
top: 0px; top: 0px;
background: white; background: white;
} }
.rightDetail{ .rightDetail{
background:#fff;height: 100%; background:#fff;height: 100%;
......
...@@ -187,7 +187,23 @@ body, ...@@ -187,7 +187,23 @@ body,
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
.workTime{
width: calc(100% - 80px);
float: right;
height: 33px;
border: 1px solid #c8c7cc;
}
.workTime select{
background-color: rgba(0,0,0,.1);
padding: 0;
padding-left:5px;
height: 33px;
margin: 0;
border-radius:0 ;
}
#item2 { #item2 {
/* top: 32px; */ /* top: 32px; */
} }
......
...@@ -52,9 +52,9 @@ var getSubInfoById = function(infoList, id) { ...@@ -52,9 +52,9 @@ var getSubInfoById = function(infoList, id) {
var wgtVer = null; var wgtVer = null;
var t = (new Date()).valueOf(); var t = (new Date()).valueOf();
var checkUrl = "http://11wangjp.oss-cn-shanghai.aliyuncs.com/ftt_mes_test/version.txt?data=" + t; var checkUrl = "http://11wangjp.oss-cn-shanghai.aliyuncs.com/ftt_mes/version.txt?data=" + t;
// 下载wgt文件 // 下载wgt文件
var wgtUrl = "http://11wangjp.oss-cn-shanghai.aliyuncs.com/ftt_mes_test/ftt_mes_hot.wgt"; var wgtUrl = "http://11wangjp.oss-cn-shanghai.aliyuncs.com/ftt_mes/ftt_mes_hot.wgt";
console.log("检测更新地址:" + checkUrl); console.log("检测更新地址:" + checkUrl);
function downWgtHot() { function downWgtHot() {
......
...@@ -55,7 +55,7 @@ var app = new Vue({ ...@@ -55,7 +55,7 @@ var app = new Vue({
datalen: 20, //默认取数据数量 datalen: 20, //默认取数据数量
reDatalen: 10, //每次加载的数据数量 reDatalen: 10, //每次加载的数据数量
isAlert: false, isAlert: false,
disable_reportDelete: 'disabled', //disable_reportDelete: 'disabled',
disable_qq: 'disabled', disable_qq: 'disabled',
ReportID: 0, ReportID: 0,
// Report_IndexID: 0, // Report_IndexID: 0,
...@@ -87,15 +87,54 @@ var app = new Vue({ ...@@ -87,15 +87,54 @@ var app = new Vue({
} }
], ],
current: '', //搜索选中 current: '', //搜索选中
isWorkTeam:false,
workTimeData:[],
currentWorkTime:'',//班组
}, },
computed: { computed: {
complete_State:function(){
if(MenuAction.checkAction('90033','Update')){
if(this.completeState && this.itemsHead.length!=0){
return null;
}else{
return 'disabled';
}
}else{
return 'disabled';
}
},
disable_reportDelete:function(){
if(MenuAction.checkAction('90033','Delete')){
if(!this.completeState && this.itemsLeft2.length!=0){
return null;
}else{
return 'disabled';
}
}else{
return 'disabled';
}
},
disable_reportDelete1:function(){
if(!this.completeState && this.itemsLeft2.length!=0){
return null;
}else{
return 'disabled';
}
},
disable_save_button_C: function() { disable_save_button_C: function() {
if(MenuAction.checkAction('90033','Update')){
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) { if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null; return null;
} else { } else {
return 'disabled'; return 'disabled';
} }
}else{
return 'disabled';
}
}, },
display_: function() { display_: function() {
if (this.displayModel == 1) { if (this.displayModel == 1) {
...@@ -111,8 +150,16 @@ var app = new Vue({ ...@@ -111,8 +150,16 @@ var app = new Vue({
}, },
}, },
created() { created() {
console.log(this.searchData[0].name);
//如果没有这句代码,select中初始化会是空白的,默认选中就无法实现 //如果没有这句代码,select中初始化会是空白的,默认选中就无法实现
this.current = this.searchData[0].id; this.current =(JSON.parse(localStorage.getItem('FormSelect'))== null||'' ) ? this.searchData[0].id : JSON.parse(localStorage.getItem('FormSelect'));
if(this.current=='3'){
this.isWorkTeam = true;
}else{
this.isWorkTeam = false;
}
this.getWorkTime();
}, },
methods: { methods: {
init: function() { //初始化 init: function() { //初始化
...@@ -135,19 +182,28 @@ var app = new Vue({ ...@@ -135,19 +182,28 @@ var app = new Vue({
var UnfinishedData = app.itemsHead; var UnfinishedData = app.itemsHead;
var FinishedUrlData = app.itemsLeft2; var FinishedUrlData = app.itemsLeft2;
if (reUnfinished) { //未完成 if (reUnfinished) { //未完成
if(app.current == '3'){
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach); searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
} else { } else {
pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo); pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo);
} }
}
} else if (reFinished) { //已完成 } else if (reFinished) { //已完成
if(app.current == '3'){
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach); searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
} else { } else {
pullupRefresh(searchDoneUrl, FinishedUrlData, app.paramDone); pullupRefresh(searchDoneUrl, FinishedUrlData, app.paramDone);
} }
}
} }
...@@ -180,7 +236,18 @@ var app = new Vue({ ...@@ -180,7 +236,18 @@ var app = new Vue({
}); });
this.dateTime = moment().format().substring(0, 10) this.dateTime = moment().format().substring(0, 10)
// this.today = this.dateTime; // this.today = this.dateTime;
if(app.current == '3'){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para);
}else{
this.getData(); this.getData();
}
}, },
getData: function() { getData: function() {
var that = this; var that = this;
...@@ -206,7 +273,7 @@ var app = new Vue({ ...@@ -206,7 +273,7 @@ var app = new Vue({
//that.ChangeState(1); //that.ChangeState(1);
that.getTatolNum(); that.getTatolNum();
that.qty = 0; that.qty = 0;
that.disable_reportDelete = 'disabled'; //that.disable_reportDelete = 'disabled';
that.sizeArr(); that.sizeArr();
} else { } else {
that.itemsHead = []; that.itemsHead = [];
...@@ -219,7 +286,7 @@ var app = new Vue({ ...@@ -219,7 +286,7 @@ var app = new Vue({
that.itemsLeft = []; that.itemsLeft = [];
that.number = 0; that.number = 0;
that.qty = 0; that.qty = 0;
that.disable_reportDelete = 'disabled' //that.disable_reportDelete = 'disabled'
//that.ChangeState(1); //that.ChangeState(1);
that.getTatolNum(); that.getTatolNum();
} }
...@@ -249,6 +316,27 @@ var app = new Vue({ ...@@ -249,6 +316,27 @@ var app = new Vue({
mui.toast(JSON.stringify(res.message)) mui.toast(JSON.stringify(res.message))
}); });
}, },
getWorkTime:function(){
var that = this;
var para={
ReportType:that.ReportType,
}
Api.post('/api/vMES/ProductionReportV2/ListWorkTeam', para, function(e) {
//console.log("eee::" + JSON.stringify(e.items))
if (e.success) {
var data = e.items.length;
console.log("搜索::" + e.items.length)
if (data > 0) {
that.workTimeData = e.items;
that.currentWorkTime=that.workTimeData[0];
console.log("eee::" + JSON.stringify(that.workTimeData[0]))
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
sizeArr: function() { sizeArr: function() {
var that = this; var that = this;
that.itemsSize = []; that.itemsSize = [];
...@@ -277,7 +365,7 @@ var app = new Vue({ ...@@ -277,7 +365,7 @@ var app = new Vue({
SearchText: '', SearchText: '',
}; };
that.searchText = ''; that.searchText = '';
that.disable_reportDelete = "disabled"; //that.disable_reportDelete = "disabled";
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) { Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
that.cur = 0; that.cur = 0;
if (e.items.length > 0) { if (e.items.length > 0) {
...@@ -305,7 +393,7 @@ var app = new Vue({ ...@@ -305,7 +393,7 @@ var app = new Vue({
SearchText: '', SearchText: '',
}; };
//console.log("do para " + JSON.stringify(para)) //console.log("do para " + JSON.stringify(para))
that.disable_reportDelete = null; //that.disable_reportDelete = null;
that.searchText = ''; that.searchText = '';
Api.post('/api/vMES/ProductionReportV2/SearchDone', para, function(e) { Api.post('/api/vMES/ProductionReportV2/SearchDone', para, function(e) {
console.log("已完成" + JSON.stringify(para)) console.log("已完成" + JSON.stringify(para))
...@@ -349,18 +437,52 @@ var app = new Vue({ ...@@ -349,18 +437,52 @@ var app = new Vue({
} }
}, },
changeSearchType: function() { changeSearchType: function() {
var that = this; if(this.current == '3'){
this.isWorkTeam=true;
var para = { var para = {
SearchText: that.searchText, SearchText: this.currentWorkTime,
PageSize: 20, PageSize: 20,
PageIndex: that.pagenum, PageIndex: this.pagenum,
ReportType: that.ReportType, ReportType: this.ReportType,
SearchType: that.current, SearchType:this.current,
};
}else{
this.isWorkTeam=false;
var para = {
SearchText: this.searchText,
PageSize: 20,
PageIndex: this.pagenum,
ReportType: this.ReportType,
SearchType:this.current,
};
}
window.localStorage.setItem("FormSelect", JSON.stringify(this.current));
this.searchDetail(para);
},
changeWorkTime:function(){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
}; };
this.searchDetail(para); this.searchDetail(para);
}, },
searchDetail:function(para){ searchDetail:function(para){
var that = this; var that = this;
that.paramUnDoSeach={
pageIndex: 2,
pageSize: 10,
ReportType: 2
};
that.paramDoneSeach={
pageIndex: 2,
pageSize: 10,
ReportType: 2
};
if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索 if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) { Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
console.log("现在是未完成的搜索!"); console.log("现在是未完成的搜索!");
......
...@@ -66,6 +66,10 @@ var app = new Vue({ ...@@ -66,6 +66,10 @@ var app = new Vue({
{ {
id: '4', id: '4',
name: '实际完成' name: '实际完成'
},
{
id: '5',
name: '班组'
} }
], ],
current: '', //搜索选中 current: '', //搜索选中
...@@ -82,32 +86,83 @@ var app = new Vue({ ...@@ -82,32 +86,83 @@ var app = new Vue({
PersonList: [], PersonList: [],
all: false, //全选 all: false, //全选
WorkTeamID: 0, //班组 WorkTeamID: 0, //班组
isAward: 0, //是否发包 //isAward: 0, //是否发包
Workers: [], Workers: [],
ReportType:1,
isData: false, //是否显示搜索 isData: false, //是否显示搜索
dateTime2: 0, dateTime2: 0,
workTimeData:[],
currentWorkTime:'',//班组
isWorkTeam:false,
}, },
computed: { computed: {
display_: function() { isAward: function() {
if (this.displayModel == 1) { if(MenuAction.checkAction('90037','Update')){
return "display: none " if (this.itemsData2.length != 0) {
return "disabled"
}else{
return null
}
}else{
if (this.itemsData2.length != 0) {
return "disabled"
}
} }
},
isAward1: function() {
if(MenuAction.checkAction('90037','Delete')){
if (this.itemsData2.length == 0) {
return "disabled"
}else{
return null
}
}else{
if (this.itemsData2.length != 0) {
return "disabled"
}
}
}, },
selectPL: function() { selectPL: function() {
if(MenuAction.checkAction('90037','Update')){
if (this.selectList.length > 1) { if (this.selectList.length > 1) {
return null return null
} else { } else {
return "disabled" return "disabled"
} }
}else{
return "disabled"
}
},
saveChange: function() {
if(MenuAction.checkAction('90037','Update')){
return null
}else{
return "disabled"
}
}, },
}, },
created: function() { created: function() {
//如果没有这句代码,select中初始化会是空白的,默认选中就无法实现 //如果没有这句代码,select中初始化会是空白的,默认选中就无法实现
this.current = this.searchData[0].id; this.current =(JSON.parse(localStorage.getItem('NeedDispatchSelect'))== null||'' ) ? this.searchData[0].id : JSON.parse(localStorage.getItem('NeedDispatchSelect'));
this.dateTime = moment().format("YYYY-MM"); this.dateTime = moment().format("YYYY-MM");
this.dateTime1 = moment().format("YYYY-MM-DD"); this.dateTime1 = moment().format("YYYY-MM-DD");
this.dateTime2 = moment().format("YYYY-MM-DD"); this.dateTime2 = moment().format("YYYY-MM-DD");
if(this.current=='3'||this.current=='4'){
this.isData = true;
this.isWorkTeam = false;
}else if(this.current=='5'){
this.isWorkTeam = true;
this.isData = false;
}else{
this.isWorkTeam = false;
this.isData = false;
}
this.getWorkTime();
}, },
mounted: function() { mounted: function() {
if (localStorage.getItem('data')) { if (localStorage.getItem('data')) {
...@@ -141,12 +196,17 @@ var app = new Vue({ ...@@ -141,12 +196,17 @@ var app = new Vue({
callback: function() { callback: function() {
var Url = '/api/vMES/ZCProductionPlan/List'; var Url = '/api/vMES/ZCProductionPlan/List';
var dataList = app.itemsList; var dataList = app.itemsList;
if(app.current == '4'||app.current == '3'||app.current == '5'){
searchPull(Url, dataList, app.paramSearch);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(Url, dataList, app.paramSearch); searchPull(Url, dataList, app.paramSearch);
} else { } else {
pullupRefresh(Url, dataList, app.paramList); pullupRefresh(Url, dataList, app.paramList);
} }
} }
}
}, },
} }
}); });
...@@ -199,6 +259,23 @@ var app = new Vue({ ...@@ -199,6 +259,23 @@ var app = new Vue({
function searchPull(url, arr, params) { function searchPull(url, arr, params) {
setTimeout(function() { setTimeout(function() {
if(app.current == '4'||app.current == '3'){
var para = {
searchText: app.dateTime2,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
Date: app.dateTime,
SearchType: app.current,
};
}else if(app.current == '5'){
var para = {
searchText: app.currentWorkTime,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
Date: app.dateTime,
SearchType: app.current,
};
}else{
var para = { var para = {
searchText: app.searchText, searchText: app.searchText,
PageSize: params.pageSize, PageSize: params.pageSize,
...@@ -206,6 +283,8 @@ var app = new Vue({ ...@@ -206,6 +283,8 @@ var app = new Vue({
Date: app.dateTime, Date: app.dateTime,
SearchType: app.current, SearchType: app.current,
}; };
}
Api.post(url, para, function(e) { Api.post(url, para, function(e) {
if (e.success) { if (e.success) {
...@@ -252,7 +331,28 @@ var app = new Vue({ ...@@ -252,7 +331,28 @@ var app = new Vue({
document.getElementsByClassName('mui-inner-wrap')[0].addEventListener('drag', function(event) { document.getElementsByClassName('mui-inner-wrap')[0].addEventListener('drag', function(event) {
event.stopPropagation(); event.stopPropagation();
}); });
if(app.current == '4'||app.current == '3'){
var para = {
SearchText: this.dateTime2,
PageSize: 20,
PageIndex: 1,
SearchType: this.current,
Date: this.dateTime,
};
this.searchDetail(para);
}else if(app.current == '5'){
var para = {
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current,
Date: this.dateTime,
};
console.log("vvvvvvvvvvvvvvv:"+JSON.stringify(para))
this.searchDetail(para);
}else{
this.getData();
}
}, },
getData: function() { getData: function() {
var that = this; var that = this;
...@@ -386,7 +486,28 @@ var app = new Vue({ ...@@ -386,7 +486,28 @@ var app = new Vue({
} }
}, },
getWorkTime:function(){
var that = this;
var para={
ReportType:that.ReportType,
}
Api.post('/api/vMES/ProductionReportV2/ListWorkTeam', para, function(e) {
//console.log("eee::" + JSON.stringify(e.items))
if (e.success) {
var data = e.items.length;
console.log("搜索::" + e.items.length)
if (data > 0) {
that.workTimeData = e.items;
that.currentWorkTime=that.workTimeData[0];
console.log("eee::" + JSON.stringify(that.workTimeData[0]))
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
goSearch: function(event) { goSearch: function(event) {
var that = this; var that = this;
var para = { var para = {
Date: that.dateTime, Date: that.dateTime,
...@@ -409,17 +530,30 @@ var app = new Vue({ ...@@ -409,17 +530,30 @@ var app = new Vue({
console.log("11111111111111111111:" + this.current); console.log("11111111111111111111:" + this.current);
if (this.current == '3' || this.current == '4') { if (this.current == '3' || this.current == '4') {
this.isData = true; this.isData = true;
this.isWorkTeam = false;
var para = { var para = {
Date: this.dateTime, Date: this.dateTime,
PageSize: this.PageSize, PageSize: this.PageSize,
PageIndex: this.PageIndex, PageIndex: this.PageIndex,
SearchType: this.current, SearchType: this.current,
SearchText: this.dateTime2, SearchText: this.dateTime2,
}; };
} else { } else if(this.current == '5'){
this.isData = false; this.isData = false;
this.isWorkTeam = true;
var para = {
Date: this.dateTime,
PageSize: this.PageSize,
PageIndex: this.PageIndex,
SearchType: this.current,
SearchText: this.searchText,
};
}else {
this.isData = false;
this.isWorkTeam = false;
var para = { var para = {
Date: this.dateTime, Date: this.dateTime,
PageSize: this.PageSize, PageSize: this.PageSize,
...@@ -428,6 +562,19 @@ var app = new Vue({ ...@@ -428,6 +562,19 @@ var app = new Vue({
SearchText: this.searchText, SearchText: this.searchText,
}; };
} }
window.localStorage.setItem("NeedDispatchSelect", JSON.stringify(this.current));
this.searchDetail(para);
},
changeWorkTime:function(){
var para = {
Date: this.dateTime,
PageSize: this.PageSize,
PageIndex: this.PageIndex,
SearchType: this.current,
SearchText: this.currentWorkTime,
};
this.searchDetail(para); this.searchDetail(para);
}, },
searchDetail: function(para) { searchDetail: function(para) {
...@@ -452,7 +599,7 @@ var app = new Vue({ ...@@ -452,7 +599,7 @@ var app = new Vue({
Api.post('/api/vMES/ZCProductionPlan/List', para, function(e) { Api.post('/api/vMES/ZCProductionPlan/List', para, function(e) {
if (e.success) { if (e.success) {
var data = e.data.items.length; var data = e.data.items.length;
//console.log("搜索::" + JSON.stringify(e.data.items)) console.log("搜索::" + JSON.stringify(e.data.items))
if (data > 0) { if (data > 0) {
that.Summary = e.data.Summary; that.Summary = e.data.Summary;
that.itemsList = e.data.items; that.itemsList = e.data.items;
...@@ -620,11 +767,22 @@ var app = new Vue({ ...@@ -620,11 +767,22 @@ var app = new Vue({
console.log(JSON.stringify(para)); console.log(JSON.stringify(para));
Api.post('/api/vMES/ZCProductionPlan/Save', para, function(e) { Api.post('/api/vMES/ZCProductionPlan/Save', para, function(e) {
if (e.success) { if (e.success) {
that.isAward = false; //that.isAward = false;
that.IndexID = e.data.IndexID; that.IndexID = e.data.IndexID;
console.log(JSON.stringify(that.IndexID)); console.log(JSON.stringify(that.IndexID));
that.getDetailList(that.IndexID); that.getDetailList(that.IndexID);
that.playVoice("cg.mp3"); that.playVoice("cg.mp3");
var url_ = "blank.html";
var id_ = "blank.html";
mui.openWindow({
url: url_,
id: id_,
extras: {
parentPage: "NeedleDispatch.html"
},
});
window.location.reload();
} }
}, function(xhr, type, res) { }, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message)) mui.toast(JSON.stringify(res.message))
...@@ -647,9 +805,9 @@ var app = new Vue({ ...@@ -647,9 +805,9 @@ var app = new Vue({
that.IndexID = item.IndexID; that.IndexID = item.IndexID;
console.log(item.IndexID) console.log(item.IndexID)
that.getDetailList(that.IndexID); that.getDetailList(that.IndexID);
that.isAward = false; //that.isAward = false;
} else { } else {
that.isAward = true; //that.isAward = true;
mui.toast("该订单未发包!"); mui.toast("该订单未发包!");
that.itemsData2 = []; that.itemsData2 = [];
} }
...@@ -665,7 +823,9 @@ var app = new Vue({ ...@@ -665,7 +823,9 @@ var app = new Vue({
if (e.success) { if (e.success) {
if (e.data.Main && e.data.Main != '') { if (e.data.Main && e.data.Main != '') {
that.WorkTeamID = e.data.Main.WorkTeamID; that.WorkTeamID = e.data.Main.WorkTeamID;
} }
if (e.data.IETask.length > 0) { if (e.data.IETask.length > 0) {
that.itemsData2 = e.data.IETask; that.itemsData2 = e.data.IETask;
console.log("详细信息::" + JSON.stringify(e.data)) console.log("详细信息::" + JSON.stringify(e.data))
...@@ -673,6 +833,7 @@ var app = new Vue({ ...@@ -673,6 +833,7 @@ var app = new Vue({
that.$set(item, "status", false) that.$set(item, "status", false)
}) })
console.log(JSON.stringify(that.itemsData2)); console.log(JSON.stringify(that.itemsData2));
} }
} }
}, function(xhr, type, res) { }, function(xhr, type, res) {
...@@ -692,7 +853,7 @@ var app = new Vue({ ...@@ -692,7 +853,7 @@ var app = new Vue({
Api.post('/api/vMES/ZCProductionPlan/Revoke', para, function(e) { Api.post('/api/vMES/ZCProductionPlan/Revoke', para, function(e) {
if (e.success) { if (e.success) {
mui.toast("撤销成功!"); mui.toast("撤销成功!");
that.isAward = true; //that.isAward = true;
that.itemsData2 = []; that.itemsData2 = [];
that.playVoice("cg.mp3"); that.playVoice("cg.mp3");
} }
......
...@@ -76,6 +76,10 @@ var app = new Vue({ ...@@ -76,6 +76,10 @@ var app = new Vue({
current: '', //搜索选中 current: '', //搜索选中
dateTime: "", //日期 dateTime: "", //日期
isData: false, //搜索的时候 是否选中了日期 isData: false, //搜索的时候 是否选中了日期
getTitle:MenuAction.getTitle('90029'),
workTimeData:[],
currentWorkTime:'',//班组
isWorkTeam:false,
}, },
computed: { computed: {
display_: function() { display_: function() {
...@@ -85,30 +89,70 @@ var app = new Vue({ ...@@ -85,30 +89,70 @@ var app = new Vue({
}, },
btnMatch: function() { btnMatch: function() {
if(MenuAction.checkAction('90029','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur] 0 ? this.itemsLeft[this.cur]
.IsMatch : "disabled"; .IsMatch : "disabled";
}else{
return 'disabled';
}
}, },
btnConfirm: function() { btnConfirm: function() {
if(MenuAction.checkAction('90029','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur] 0 ? this.itemsLeft[this.cur]
.IsConfirm : "disabled"; .IsConfirm : "disabled";
}else{
return 'disabled';
}
}, },
btnCheck: function() { btnCheck: function() {
if(MenuAction.checkAction('90029','Update')){
if (this.listType == 1 && this.itemsLeft2.length > 0) { if (this.listType == 1 && this.itemsLeft2.length > 0) {
return null; return null;
} else { } else {
return this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > 0 && return this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > 0 &&
this.itemsLeft[this.cur].IsMatch && this.itemsLeft[this.cur].IsConfirm ? null : "disabled"; this.itemsLeft[this.cur].IsMatch && this.itemsLeft[this.cur].IsConfirm ? null : "disabled";
} }
}else{
return 'disabled';
}
},
btnCheck1: function() {
if(MenuAction.checkAction('90029','Update')){
if (this.listType == 1 && this.itemsLeft2.length > 0) {
return null;
} else {
return this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > 0 &&
this.itemsLeft[this.cur].IsMatch && this.itemsLeft[this.cur].IsConfirm ? null : "disabled";
}
}else{
return 'disabled';
}
}, },
}, },
created() { created() {
//如果没有这句代码,select中初始化会是空白的,默认选中就无法实现 //如果没有这句代码,select中初始化会是空白的,默认选中就无法实现
this.current = this.searchData[0].id; this.current =(JSON.parse(localStorage.getItem('NeedMatchSelect'))== null||'' ) ? this.searchData[0].id : JSON.parse(localStorage.getItem('NeedMatchSelect'));
if(this.current=='4'){
this.isData = true;
this.isWorkTeam = false;
}else if(this.current=='3'){
this.isWorkTeam = true;
this.isData = false;
}else{
this.isWorkTeam = false;
this.isData = false;
}
this.getWorkTime();
}, },
methods: { methods: {
init: function() { init: function() {
...@@ -131,6 +175,9 @@ var app = new Vue({ ...@@ -131,6 +175,9 @@ var app = new Vue({
var needData = app.itemsLeft2; var needData = app.itemsLeft2;
if (reUnfinished) { if (reUnfinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchUrl, UnneedData, app.paramUnDoSeach); searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
console.log("未交接搜索:" + JSON.stringify(app.paramUnDoSeach)); console.log("未交接搜索:" + JSON.stringify(app.paramUnDoSeach));
...@@ -138,7 +185,12 @@ var app = new Vue({ ...@@ -138,7 +185,12 @@ var app = new Vue({
console.log("未交接22:" + JSON.stringify(app.paramUnDo)); console.log("未交接22:" + JSON.stringify(app.paramUnDo));
pullupRefresh(needUrl, UnneedData, app.paramUnDo); pullupRefresh(needUrl, UnneedData, app.paramUnDo);
} }
}
} else if (reFinished) { } else if (reFinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrlDone, needData, app.paramDoneSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchUrlDone, needData, app.paramDoneSeach); searchPull(searchUrlDone, needData, app.paramDoneSeach);
console.log("getData:已交接搜索:" + JSON.stringify(app.paramDoneSeach)); console.log("getData:已交接搜索:" + JSON.stringify(app.paramDoneSeach));
...@@ -147,6 +199,8 @@ var app = new Vue({ ...@@ -147,6 +199,8 @@ var app = new Vue({
console.log("getData:已交接22:" + JSON.stringify(app.paramDone)); console.log("getData:已交接22:" + JSON.stringify(app.paramDone));
} }
} }
}
} }
}, },
} }
...@@ -189,6 +243,23 @@ var app = new Vue({ ...@@ -189,6 +243,23 @@ var app = new Vue({
function searchPull(url, arr, params) { function searchPull(url, arr, params) {
setTimeout(function() { setTimeout(function() {
if(app.current == '4'){
var para = {
SearchText: app.dateTime,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
SearchType: app.current
};
}else if(app.current == '3'){
var para = {
SearchText: app.currentWorkTime,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
SearchType: app.current
};
}else{
var para = { var para = {
SearchText: app.searchText, SearchText: app.searchText,
PageSize: params.pageSize, PageSize: params.pageSize,
...@@ -196,6 +267,8 @@ var app = new Vue({ ...@@ -196,6 +267,8 @@ var app = new Vue({
ReportType: params.ReportType, ReportType: params.ReportType,
SearchType: app.current SearchType: app.current
}; };
}
Api.post(url, para, function(e) { Api.post(url, para, function(e) {
console.log("canshu:" + JSON.stringify(para)); console.log("canshu:" + JSON.stringify(para));
...@@ -222,14 +295,13 @@ var app = new Vue({ ...@@ -222,14 +295,13 @@ var app = new Vue({
bounce: false, bounce: false,
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.getData(0);
mui(".mui-icon-clear")[0].addEventListener('tap', function() { mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘 document.activeElement.blur(); //收起虚拟键盘
app.searchText = ''; app.searchText = '';
app.getData(0); app.getData(0);
}); });
this.dateTime = moment().format().substring(0, 10); this.dateTime = moment().format().substring(0, 10);
mui('body').on('tap','.mui-dtpicker #queding' ,function(){ mui('body').on('tap', '.mui-dtpicker #queding', function() {
var para = { var para = {
ReportType: app.ReportType, ReportType: app.ReportType,
SearchText: app.dateTime, SearchText: app.dateTime,
...@@ -239,6 +311,27 @@ var app = new Vue({ ...@@ -239,6 +311,27 @@ var app = new Vue({
}; };
app.searchDetail(para); app.searchDetail(para);
}) })
if(app.current == '4'){
var para = {
ReportType: this.ReportType,
SearchText: this.dateTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para);
}else if(app.current == '3'){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para);
}else{
this.getData(0);
}
}, },
getData: function(n) { getData: function(n) {
var that = this; var that = this;
...@@ -259,7 +352,7 @@ var app = new Vue({ ...@@ -259,7 +352,7 @@ var app = new Vue({
that.itemsLeft = e.items; that.itemsLeft = e.items;
that.itemsDetail = e.items[0]; that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID; that.IndexID = e.items[0].IndexID;
console.log("getData:未交接:" + JSON.stringify(that.itemsLeft)); console.log("getData:未交接:" + that.itemsLeft);
} else { } else {
that.itemsLeft = [] that.itemsLeft = []
that.itemsDetail = []; that.itemsDetail = [];
...@@ -294,6 +387,26 @@ var app = new Vue({ ...@@ -294,6 +387,26 @@ var app = new Vue({
// } // }
// }); // });
// }, // },
getWorkTime:function(){
var that = this;
var para={
ReportType:that.ReportType,
}
Api.post('/api/vMES/Handover/ListWorkTeam', para, function(e) {
//console.log("eee::" + JSON.stringify(e.items))
if (e.success) {
var data = e.items.length;
console.log("搜索::" + e.items.length)
if (data > 0) {
that.workTimeData = e.items;
that.currentWorkTime=that.workTimeData[0];
console.log("eee::" + JSON.stringify(that.workTimeData[0]))
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
selectLeft: function(obj, n) { selectLeft: function(obj, n) {
this.IndexID = obj.IndexID; this.IndexID = obj.IndexID;
//this.nextDetail = obj; //this.nextDetail = obj;
...@@ -336,30 +449,67 @@ var app = new Vue({ ...@@ -336,30 +449,67 @@ var app = new Vue({
console.log("11111111111111111111:" + this.current); console.log("11111111111111111111:" + this.current);
if (this.current == '4') { if (this.current == '4') {
this.isData = true; this.isData = true;
this.isWorkTeam = false;
var para = { var para = {
ReportType: this.ReportType, ReportType: this.ReportType,
SearchText: this.dateTime, SearchText: this.dateTime,
PageSize: 20, PageSize: 20,
PageIndex: 1, PageIndex: 1,
SearchType: this.current SearchType: this.current
};console.log("eee::" + JSON.stringify(para)) };
} else { console.log("eee::" + JSON.stringify(para))
} else if(this.current == '3'){
this.isWorkTeam = true;
this.isData = false; this.isData = false;
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
} else{
this.isData = false;
this.isWorkTeam = false;
var para = { var para = {
ReportType: this.ReportType, ReportType: this.ReportType,
SearchText: this.searchText, SearchText: this.searchText,
PageSize: 20, PageSize: 20,
PageIndex: 1, PageIndex: 1,
SearchType: this.current SearchType: this.current
};console.log("vvvv::" + JSON.stringify(para)) };
} }
window.localStorage.setItem("NeedMatchSelect", JSON.stringify(this.current));
this.searchDetail(para);
},
changeWorkTime:function(){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para); this.searchDetail(para);
}, },
searchDetail: function(para) { searchDetail: function(para) {
console.log("搜索参数::" + JSON.stringify(para)); console.log("搜索参数::" + JSON.stringify(para));
var that = this; var that = this;
that.paramUnDoSeach= { //未交接
ReportType: 2, //成型
pageIndex: 2,
State: 0, //未交接
pageSize: 10
};
that.paramDoneSeach={ //已交接
ReportType: 2, //成型
pageIndex: 2,
State: 1, //已交接
pageSize: 10
};
if (that.completeState) { if (that.completeState) {
Api.post('/api/vMES/Handover/Search', para, function(e) { Api.post('/api/vMES/Handover/Search', para, function(e) {
//console.log("eee::" + JSON.stringify(e)) //console.log("eee::" + JSON.stringify(e))
......
...@@ -77,6 +77,10 @@ var app = new Vue({ ...@@ -77,6 +77,10 @@ var app = new Vue({
current: '', //搜索选中 current: '', //搜索选中
dateTime: "", //日期 dateTime: "", //日期
isData: false, //搜索的时候 是否选中了日期 isData: false, //搜索的时候 是否选中了日期
isWorkTeam:false,//搜索的时候 是否选中了班组
getTitle:MenuAction.getTitle('90028'),
workTimeData:[],
currentWorkTime:'',//班组
}, },
computed: { computed: {
display_: function() { display_: function() {
...@@ -86,31 +90,73 @@ var app = new Vue({ ...@@ -86,31 +90,73 @@ var app = new Vue({
}, },
btnMatch: function() { btnMatch: function() {
if(MenuAction.checkAction('90028','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur] 0 ? this.itemsLeft[this.cur]
.IsMatch : "disabled"; .IsMatch : "disabled";
}else{
return 'disabled';
}
}, },
btnConfirm: function() { btnConfirm: function() {
if(MenuAction.checkAction('90028','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur] 0 ? this.itemsLeft[this.cur]
.IsConfirm : "disabled"; .IsConfirm : "disabled";
}else{
return 'disabled';
}
}, },
btnCheck: function() { btnCheck: function() {
if(MenuAction.checkAction('90028','Update')){
if (this.listType == 1 && this.itemsLeft2.length > 0) { if (this.listType == 1 && this.itemsLeft2.length > 0) {
return null; return null;
} else { } else {
return this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > 0 && return this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > 0 &&
this.itemsLeft[this.cur].IsMatch && this.itemsLeft[this.cur].IsConfirm ? null : "disabled"; this.itemsLeft[this.cur].IsMatch && this.itemsLeft[this.cur].IsConfirm ? null : "disabled";
} }
}else{
return 'disabled';
}
},
btnCheck1: function() {
if(MenuAction.checkAction('90028','Update')){
if (this.listType == 1 && this.itemsLeft2.length > 0) {
return null;
} else {
return this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length > 0 &&
this.itemsLeft[this.cur].IsMatch && this.itemsLeft[this.cur].IsConfirm ? null : "disabled";
}
}else{
return 'disabled';
}
}, },
}, },
created() { created() {
//如果没有这句代码,select中初始化会是空白的,默认选中就无法实现 //如果没有这句代码,select中初始化会是空白的,默认选中就无法实现
this.current = this.searchData[0].id; this.current =(JSON.parse(localStorage.getItem('NeedHandSelect'))== null||'' ) ? this.searchData[0].id : JSON.parse(localStorage.getItem('NeedHandSelect'));
if(this.current=='4'){
this.isData = true;
this.isWorkTeam = false;
}else if(this.current=='3'){
this.isWorkTeam = true;
this.isData = false;
}else{
this.isWorkTeam = false;
this.isData = false;
}
this.getWorkTime();
}, },
methods: { methods: {
init: function() { init: function() {
mui.init({ mui.init({
...@@ -130,8 +176,11 @@ var app = new Vue({ ...@@ -130,8 +176,11 @@ var app = new Vue({
var searchUrlDone = '/api/vMES/Handover/SearchDone'; var searchUrlDone = '/api/vMES/Handover/SearchDone';
var UnneedData = app.itemsLeft; var UnneedData = app.itemsLeft;
var needData = app.itemsLeft2; var needData = app.itemsLeft2;
//this.dateTime
if (reUnfinished) { if (reUnfinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchUrl, UnneedData, app.paramUnDoSeach); searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
console.log("未交接搜索:" + JSON.stringify(app.paramUnDoSeach)); console.log("未交接搜索:" + JSON.stringify(app.paramUnDoSeach));
...@@ -139,7 +188,12 @@ var app = new Vue({ ...@@ -139,7 +188,12 @@ var app = new Vue({
console.log("未交接22:" + JSON.stringify(app.paramUnDo)); console.log("未交接22:" + JSON.stringify(app.paramUnDo));
pullupRefresh(needUrl, UnneedData, app.paramUnDo); pullupRefresh(needUrl, UnneedData, app.paramUnDo);
} }
}
} else if (reFinished) { } else if (reFinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrlDone, needData, app.paramDoneSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchUrlDone, needData, app.paramDoneSeach); searchPull(searchUrlDone, needData, app.paramDoneSeach);
console.log("getData:已交接搜索:" + JSON.stringify(app.paramDoneSeach)); console.log("getData:已交接搜索:" + JSON.stringify(app.paramDoneSeach));
...@@ -148,6 +202,8 @@ var app = new Vue({ ...@@ -148,6 +202,8 @@ var app = new Vue({
console.log("getData:已交接22:" + JSON.stringify(app.paramDone)); console.log("getData:已交接22:" + JSON.stringify(app.paramDone));
} }
} }
}
} }
}, },
} }
...@@ -190,6 +246,23 @@ var app = new Vue({ ...@@ -190,6 +246,23 @@ var app = new Vue({
function searchPull(url, arr, params) { function searchPull(url, arr, params) {
setTimeout(function() { setTimeout(function() {
if(app.current == '4'){
var para = {
SearchText: app.dateTime,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
SearchType: app.current
};
}else if(app.current == '3'){
var para = {
SearchText: app.currentWorkTime,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
SearchType: app.current
};
}else{
var para = { var para = {
SearchText: app.searchText, SearchText: app.searchText,
PageSize: params.pageSize, PageSize: params.pageSize,
...@@ -197,6 +270,8 @@ var app = new Vue({ ...@@ -197,6 +270,8 @@ var app = new Vue({
ReportType: params.ReportType, ReportType: params.ReportType,
SearchType: app.current SearchType: app.current
}; };
}
Api.post(url, para, function(e) { Api.post(url, para, function(e) {
console.log("canshu:" + JSON.stringify(para)); console.log("canshu:" + JSON.stringify(para));
...@@ -223,13 +298,14 @@ var app = new Vue({ ...@@ -223,13 +298,14 @@ var app = new Vue({
bounce: false, bounce: false,
indicators: true, //是否显示滚动条 indicators: true, //是否显示滚动条
}); });
this.getData(0);
this.dateTime = moment().format().substring(0, 10); this.dateTime = moment().format().substring(0, 10);
mui(".mui-icon-clear")[0].addEventListener('tap', function() { // mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘 // document.activeElement.blur(); //收起虚拟键盘
app.searchText = ''; // app.searchText = '';
app.getData(0); // app.getData(0);
}); // });
mui('body').on('tap','.mui-dtpicker #queding' ,function(){ mui('body').on('tap','.mui-dtpicker #queding' ,function(){
var para = { var para = {
ReportType: app.ReportType, ReportType: app.ReportType,
...@@ -240,6 +316,28 @@ var app = new Vue({ ...@@ -240,6 +316,28 @@ var app = new Vue({
}; };
app.searchDetail(para); app.searchDetail(para);
}) })
if(app.current == '4'){
var para = {
ReportType: this.ReportType,
SearchText: this.dateTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para);
}else if(app.current == '3'){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para);
}else{
this.getData(0);
}
}, },
getData: function(n) { getData: function(n) {
var that = this; var that = this;
...@@ -294,6 +392,26 @@ var app = new Vue({ ...@@ -294,6 +392,26 @@ var app = new Vue({
// } // }
// }); // });
// }, // },
getWorkTime:function(){
var that = this;
var para={
ReportType:that.ReportType,
}
Api.post('/api/vMES/Handover/ListWorkTeam', para, function(e) {
//console.log("eee::" + JSON.stringify(e.items))
if (e.success) {
var data = e.items.length;
console.log("搜索::" + e.items.length)
if (data > 0) {
that.workTimeData = e.items;
that.currentWorkTime=that.workTimeData[0];
console.log("eee::" + JSON.stringify(that.workTimeData[0]))
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
selectLeft: function(obj, n) { selectLeft: function(obj, n) {
this.IndexID = obj.IndexID; this.IndexID = obj.IndexID;
//this.nextDetail = obj; //this.nextDetail = obj;
...@@ -336,6 +454,7 @@ var app = new Vue({ ...@@ -336,6 +454,7 @@ var app = new Vue({
console.log("11111111111111111111:" + this.current); console.log("11111111111111111111:" + this.current);
if (this.current == '4') { if (this.current == '4') {
this.isData = true; this.isData = true;
this.isWorkTeam = false;
var para = { var para = {
ReportType: this.ReportType, ReportType: this.ReportType,
SearchText: this.dateTime, SearchText: this.dateTime,
...@@ -344,8 +463,19 @@ var app = new Vue({ ...@@ -344,8 +463,19 @@ var app = new Vue({
SearchType: this.current SearchType: this.current
}; };
console.log("eee::" + JSON.stringify(para)) console.log("eee::" + JSON.stringify(para))
} else { } else if(this.current == '3'){
this.isWorkTeam = true;
this.isData = false;
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
} else{
this.isData = false; this.isData = false;
this.isWorkTeam = false;
var para = { var para = {
ReportType: this.ReportType, ReportType: this.ReportType,
SearchText: this.searchText, SearchText: this.searchText,
...@@ -353,15 +483,38 @@ var app = new Vue({ ...@@ -353,15 +483,38 @@ var app = new Vue({
PageIndex: 1, PageIndex: 1,
SearchType: this.current SearchType: this.current
}; };
console.log("vvvv::" + JSON.stringify(para))
}
}
console.log("vvvv::" + JSON.stringify(para))
window.localStorage.setItem("NeedHandSelect", JSON.stringify(this.current));
this.searchDetail(para);
},
changeWorkTime:function(){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para); this.searchDetail(para);
}, },
searchDetail: function(para) { searchDetail: function(para) {
console.log("搜索参数::" + JSON.stringify(para)); console.log("搜索参数::" + JSON.stringify(para));
var that = this; var that = this;
that.paramUnDoSeach = { //未交接
ReportType: 1, //针车
pageIndex: 2,
State: 0, //未交接
pageSize: 10
};
that.paramDoneSeach = { //已交接
ReportType: 1, //针车
pageIndex: 2,
State: 1, //已交接
pageSize: 10
}
if (that.completeState) { if (that.completeState) {
Api.post('/api/vMES/Handover/Search', para, function(e) { Api.post('/api/vMES/Handover/Search', para, function(e) {
//console.log("eee::" + JSON.stringify(e)) //console.log("eee::" + JSON.stringify(e))
...@@ -411,7 +564,6 @@ var app = new Vue({ ...@@ -411,7 +564,6 @@ var app = new Vue({
var opt2 = document.getElementById("item2"); var opt2 = document.getElementById("item2");
var n1 = document.getElementById("n1"); var n1 = document.getElementById("n1");
var n2 = document.getElementById("n2"); var n2 = document.getElementById("n2");
this.completeState = n ? false : true; this.completeState = n ? false : true;
n1.style.background = n ? "white" : "royalblue"; n1.style.background = n ? "white" : "royalblue";
n1.style.color = n ? "royalblue" : "white"; n1.style.color = n ? "royalblue" : "white";
......
...@@ -55,7 +55,7 @@ var app = new Vue({ ...@@ -55,7 +55,7 @@ var app = new Vue({
datalen: 20, //默认取数据数量 datalen: 20, //默认取数据数量
reDatalen: 10, //每次加载的数据数量 reDatalen: 10, //每次加载的数据数量
isAlert: false, isAlert: false,
disable_reportDelete: 'disabled', //disable_reportDelete: 'disabled',
disable_qq: 'disabled', disable_qq: 'disabled',
ReportID: 0, ReportID: 0,
// Report_IndexID: 0, // Report_IndexID: 0,
...@@ -87,15 +87,54 @@ var app = new Vue({ ...@@ -87,15 +87,54 @@ var app = new Vue({
} }
], ],
current: '', //搜索选中 current: '', //搜索选中
isWorkTeam:false,
workTimeData:[],
currentWorkTime:'',//班组
}, },
computed: { computed: {
complete_State:function(){
if(MenuAction.checkAction('90032','Update')){
if(this.completeState && this.itemsHead.length!=0){
return null;
}else{
return 'disabled';
}
}else{
return 'disabled';
}
},
disable_reportDelete:function(){
if(MenuAction.checkAction('90032','Delete')){
if(!this.completeState && this.itemsLeft2.length!=0){
return null;
}else{
return 'disabled';
}
}else{
return 'disabled';
}
},
disable_reportDelete1:function(){
if(!this.completeState && this.itemsLeft2.length!=0){
return null;
}else{
return 'disabled';
}
},
disable_save_button_C: function() { disable_save_button_C: function() {
if(MenuAction.checkAction('90032','Update')){
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) { if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null; return null;
} else { } else {
return 'disabled'; return 'disabled';
} }
}else{
return 'disabled';
}
}, },
display_: function() { display_: function() {
if (this.displayModel == 1) { if (this.displayModel == 1) {
...@@ -112,7 +151,14 @@ var app = new Vue({ ...@@ -112,7 +151,14 @@ var app = new Vue({
}, },
created() { created() {
//如果没有这句代码,select中初始化会是空白的,默认选中就无法实现 //如果没有这句代码,select中初始化会是空白的,默认选中就无法实现
this.current = this.searchData[0].id; this.current = (JSON.parse(localStorage.getItem('NeedSelect')) == null ||'' )? this.searchData[0].id : JSON.parse(localStorage.getItem('NeedSelect'));
if(this.current=='3'){
this.isWorkTeam = true;
}else{
this.isWorkTeam = false;
}
this.getWorkTime();
}, },
methods: { methods: {
init: function() { //初始化 init: function() { //初始化
...@@ -135,12 +181,19 @@ var app = new Vue({ ...@@ -135,12 +181,19 @@ var app = new Vue({
var UnfinishedData = app.itemsHead; var UnfinishedData = app.itemsHead;
var FinishedUrlData = app.itemsLeft2; var FinishedUrlData = app.itemsLeft2;
if (reUnfinished) { //未完成 if (reUnfinished) { //未完成
if(app.current == '3'){
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach); searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
} else { } else {
pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo); pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo);
} }
}
} else if (reFinished) { //已完成 } else if (reFinished) { //已完成
if(app.current == '3'){
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach); searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
} else { } else {
...@@ -148,6 +201,7 @@ var app = new Vue({ ...@@ -148,6 +201,7 @@ var app = new Vue({
} }
} }
} }
}
}, },
} }
}); });
...@@ -177,7 +231,18 @@ var app = new Vue({ ...@@ -177,7 +231,18 @@ var app = new Vue({
}); });
this.dateTime = moment().format().substring(0, 10) this.dateTime = moment().format().substring(0, 10)
this.today = this.dateTime; this.today = this.dateTime;
if(app.current == '3'){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para);
}else{
this.getData(); this.getData();
}
}, },
getData: function() { getData: function() {
var that = this; var that = this;
...@@ -203,7 +268,7 @@ var app = new Vue({ ...@@ -203,7 +268,7 @@ var app = new Vue({
//that.ChangeState(1); //that.ChangeState(1);
that.getTatolNum(); that.getTatolNum();
that.qty = 0; that.qty = 0;
that.disable_reportDelete = 'disabled'; //that.disable_reportDelete = 'disabled';
that.sizeArr(); that.sizeArr();
} else { } else {
that.itemsHead = []; that.itemsHead = [];
...@@ -216,7 +281,7 @@ var app = new Vue({ ...@@ -216,7 +281,7 @@ var app = new Vue({
that.itemsLeft = []; that.itemsLeft = [];
that.number = 0; that.number = 0;
that.qty = 0; that.qty = 0;
that.disable_reportDelete = 'disabled' //that.disable_reportDelete = 'disabled'
//that.ChangeState(1); //that.ChangeState(1);
that.getTatolNum(); that.getTatolNum();
} }
...@@ -246,6 +311,27 @@ var app = new Vue({ ...@@ -246,6 +311,27 @@ var app = new Vue({
mui.toast(JSON.stringify(res.message)) mui.toast(JSON.stringify(res.message))
}); });
}, },
getWorkTime:function(){
var that = this;
var para={
ReportType:that.ReportType,
}
Api.post('/api/vMES/ProductionReportV2/ListWorkTeam', para, function(e) {
//console.log("eee::" + JSON.stringify(e.items))
if (e.success) {
var data = e.items.length;
console.log("搜索::" + e.items.length)
if (data > 0) {
that.workTimeData = e.items;
that.currentWorkTime=that.workTimeData[0];
console.log("eee::" + JSON.stringify(that.workTimeData[0]))
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
sizeArr:function(){ sizeArr:function(){
var that= this ; var that= this ;
that.itemsSize=[]; that.itemsSize=[];
...@@ -274,7 +360,7 @@ var app = new Vue({ ...@@ -274,7 +360,7 @@ var app = new Vue({
SearchText:'', SearchText:'',
}; };
that.searchText = ''; that.searchText = '';
that.disable_reportDelete = "disabled"; //that.disable_reportDelete = "disabled";
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) { Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
that.cur = 0; that.cur = 0;
if (e.items.length > 0) { if (e.items.length > 0) {
...@@ -302,7 +388,7 @@ var app = new Vue({ ...@@ -302,7 +388,7 @@ var app = new Vue({
SearchText:'', SearchText:'',
}; };
//console.log("do para " + JSON.stringify(para)) //console.log("do para " + JSON.stringify(para))
that.disable_reportDelete = null; //that.disable_reportDelete = null;
that.searchText = ''; that.searchText = '';
Api.post('/api/vMES/ProductionReportV2/SearchDone', para, function(e) { Api.post('/api/vMES/ProductionReportV2/SearchDone', para, function(e) {
console.log("已完成" + JSON.stringify(para)) console.log("已完成" + JSON.stringify(para))
...@@ -347,19 +433,51 @@ var app = new Vue({ ...@@ -347,19 +433,51 @@ var app = new Vue({
} }
}, },
changeSearchType:function(){ changeSearchType:function(){
var that = this; if(this.current == '3'){
this.isWorkTeam=true;
var para = { var para = {
SearchText: that.searchText, SearchText: this.currentWorkTime,
PageSize: 20, PageSize: 20,
PageIndex: that.pagenum, PageIndex: this.pagenum,
ReportType: that.ReportType, ReportType: this.ReportType,
SearchType:that.current, SearchType:this.current,
};
}else{
this.isWorkTeam=false;
var para = {
SearchText: this.searchText,
PageSize: 20,
PageIndex: this.pagenum,
ReportType: this.ReportType,
SearchType:this.current,
};
}
window.localStorage.setItem("NeedSelect", JSON.stringify(this.current));
this.searchDetail(para);
},
changeWorkTime:function(){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
}; };
this.searchDetail(para); this.searchDetail(para);
}, },
searchDetail:function(para){ searchDetail:function(para){
var that = this; var that = this;
that.paramUnDoSeach={
pageIndex: 2,
pageSize: 10,
ReportType: 1
};
that.paramDoneSeach= {
pageIndex: 2,
pageSize: 10,
ReportType: 1
};
if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索 if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) { Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
console.log("现在是未完成的搜索!"); console.log("现在是未完成的搜索!");
......
...@@ -55,7 +55,7 @@ var app = new Vue({ ...@@ -55,7 +55,7 @@ var app = new Vue({
datalen: 20, //默认取数据数量 datalen: 20, //默认取数据数量
reDatalen: 10, //每次加载的数据数量 reDatalen: 10, //每次加载的数据数量
isAlert: false, isAlert: false,
disable_reportDelete: 'disabled', //disable_reportDelete: 'disabled',
disable_qq: 'disabled', disable_qq: 'disabled',
ReportID: 0, ReportID: 0,
// Report_IndexID: 0, // Report_IndexID: 0,
...@@ -87,15 +87,55 @@ var app = new Vue({ ...@@ -87,15 +87,55 @@ var app = new Vue({
name: '班组' name: '班组'
} }
], ],
current: '', //搜索选中 current:'', //搜索选中
isWorkTeam:false,
workTimeData:[],
currentWorkTime:'',//班组
}, },
computed: { computed: {
complete_State:function(){
if(MenuAction.checkAction('90015','Update')){
if(this.completeState && this.itemsHead.length!=0){
return null;
}else{
return 'disabled';
}
}else{
return 'disabled';
}
},
disable_reportDelete:function(){
if(MenuAction.checkAction('90015','Delete')){
if(!this.completeState && this.itemsLeft2.length!=0){
return null;
}else{
return 'disabled';
}
}else{
return 'disabled';
}
},
disable_reportDelete1:function(){
if(!this.completeState && this.itemsLeft2.length!=0){
return null;
}else{
return 'disabled';
}
},
disable_save_button_C: function() { disable_save_button_C: function() {
if(MenuAction.checkAction('90015','Update')){
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) { if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null; return null;
} else { } else {
return 'disabled'; return 'disabled';
} }
}else{
return 'disabled';
}
}, },
display_: function() { display_: function() {
if (this.displayModel == 1) { if (this.displayModel == 1) {
...@@ -112,7 +152,14 @@ var app = new Vue({ ...@@ -112,7 +152,14 @@ var app = new Vue({
}, },
created() { created() {
//如果没有这句代码,select中初始化会是空白的,默认选中就无法实现 //如果没有这句代码,select中初始化会是空白的,默认选中就无法实现
this.current = this.searchData[0].id; this.current =(JSON.parse(localStorage.getItem('CutSelect'))==null||'')?this.searchData[0].id:JSON.parse(localStorage.getItem('CutSelect'));
if(this.current=='3'){
this.isWorkTeam = true;
}else{
this.isWorkTeam = false;
}
this.getWorkTime();
}, },
methods: { methods: {
init: function() { //初始化 init: function() { //初始化
...@@ -135,19 +182,27 @@ var app = new Vue({ ...@@ -135,19 +182,27 @@ var app = new Vue({
var UnfinishedData = app.itemsHead; var UnfinishedData = app.itemsHead;
var FinishedUrlData = app.itemsLeft2; var FinishedUrlData = app.itemsLeft2;
if (reUnfinished) { //未完成 if (reUnfinished) { //未完成
if(app.current == '3'){
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach); searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
} else { } else {
pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo); pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo);
} }
}
} else if (reFinished) { //已完成 } else if (reFinished) { //已完成
if(app.current == '3'){
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
}else{
if (app.searchText != "") { if (app.searchText != "") {
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach); searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
} else { } else {
pullupRefresh(searchDoneUrl, FinishedUrlData, app.paramDone); pullupRefresh(searchDoneUrl, FinishedUrlData, app.paramDone);
} }
}
} }
} }
...@@ -159,7 +214,6 @@ var app = new Vue({ ...@@ -159,7 +214,6 @@ var app = new Vue({
app.getData(); app.getData();
app.ChangeState(1); app.ChangeState(1);
}); });
mui(".mui-icon-clear")[0].addEventListener('tap', function() { mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘 document.activeElement.blur(); //收起虚拟键盘
app.searchText = ''; app.searchText = '';
...@@ -178,7 +232,18 @@ var app = new Vue({ ...@@ -178,7 +232,18 @@ var app = new Vue({
}); });
this.dateTime = moment().format().substring(0, 10) this.dateTime = moment().format().substring(0, 10)
// this.today = this.dateTime; // this.today = this.dateTime;
if(app.current == '3'){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para);
}else{
this.getData(); this.getData();
}
}, },
getData: function() { getData: function() {
var that = this; var that = this;
...@@ -192,6 +257,8 @@ var app = new Vue({ ...@@ -192,6 +257,8 @@ var app = new Vue({
}; };
//console.log("lalla" + JSON.stringify(para)); //console.log("lalla" + JSON.stringify(para));
that.cur = 0; that.cur = 0;
Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) { Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) {
console.log("one :::;" + JSON.stringify(para)) console.log("one :::;" + JSON.stringify(para))
console.log("getData:" + JSON.stringify(e.items[0])) console.log("getData:" + JSON.stringify(e.items[0]))
...@@ -204,7 +271,8 @@ var app = new Vue({ ...@@ -204,7 +271,8 @@ var app = new Vue({
//that.ChangeState(1); //that.ChangeState(1);
that.getTatolNum(); that.getTatolNum();
that.qty = 0; that.qty = 0;
that.disable_reportDelete = 'disabled'; //that.disable_reportDelete =MenuAction.checkAction('90015','Update') ; // 'disabled';
that.sizeArr(); that.sizeArr();
} else { } else {
that.itemsHead = []; that.itemsHead = [];
...@@ -217,10 +285,11 @@ var app = new Vue({ ...@@ -217,10 +285,11 @@ var app = new Vue({
that.itemsLeft = []; that.itemsLeft = [];
that.number = 0; that.number = 0;
that.qty = 0; that.qty = 0;
that.disable_reportDelete = 'disabled'
//that.ChangeState(1); //that.ChangeState(1);
that.getTatolNum(); that.getTatolNum();
} }
//that.disable_reportDelete = 'disabled';
}, function(xhr, type, res) { }, function(xhr, type, res) {
//console.log(bbb); //console.log(bbb);
mui.toast(JSON.stringify(res.message)) mui.toast(JSON.stringify(res.message))
...@@ -247,6 +316,27 @@ var app = new Vue({ ...@@ -247,6 +316,27 @@ var app = new Vue({
mui.toast(JSON.stringify(res.message)) mui.toast(JSON.stringify(res.message))
}); });
}, },
getWorkTime:function(){
var that = this;
var para={
//ReportType:that.ReportType,
ReportType:0,
}
Api.post('/api/vMES/ProductionReportV2/ListWorkTeam', para, function(e) {
//console.log("eee::" + JSON.stringify(e.items))
if (e.success) {
var data = e.items.length;
console.log("搜索::" + e.items.length)
if (data > 0) {
that.workTimeData = e.items;
that.currentWorkTime=that.workTimeData[0];
console.log("eee::" + JSON.stringify(that.workTimeData[0]))
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
sizeArr:function(){ sizeArr:function(){
var that= this ; var that= this ;
that.itemsSize=[]; that.itemsSize=[];
...@@ -275,7 +365,7 @@ var app = new Vue({ ...@@ -275,7 +365,7 @@ var app = new Vue({
SearchText:'', SearchText:'',
}; };
that.searchText = ''; that.searchText = '';
that.disable_reportDelete = "disabled"; //that.disable_reportDelete = "disabled";
Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) { Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) {
that.cur = 0; that.cur = 0;
if (e.items.length > 0) { if (e.items.length > 0) {
...@@ -303,7 +393,7 @@ var app = new Vue({ ...@@ -303,7 +393,7 @@ var app = new Vue({
SearchText:'', SearchText:'',
}; };
//console.log("do para " + JSON.stringify(para)) //console.log("do para " + JSON.stringify(para))
that.disable_reportDelete = null; //that.disable_reportDelete = null;
that.searchText = ''; that.searchText = '';
Api.post('/api/vMES/CutOffProductionReport/SearchDone', para, function(e) { Api.post('/api/vMES/CutOffProductionReport/SearchDone', para, function(e) {
console.log("已完成" + JSON.stringify(para)) console.log("已完成" + JSON.stringify(para))
...@@ -348,6 +438,17 @@ var app = new Vue({ ...@@ -348,6 +438,17 @@ var app = new Vue({
} }
}, },
changeSearchType: function() { changeSearchType: function() {
if(this.current == '3'){
this.isWorkTeam=true;
var para = {
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: this.pagenum,
ReportType: this.ReportType,
SearchType:this.current,
};
}else{
this.isWorkTeam=false;
var para = { var para = {
SearchText: this.searchText, SearchText: this.searchText,
PageSize: 20, PageSize: 20,
...@@ -355,10 +456,34 @@ var app = new Vue({ ...@@ -355,10 +456,34 @@ var app = new Vue({
ReportType: this.ReportType, ReportType: this.ReportType,
SearchType:this.current, SearchType:this.current,
}; };
}
window.localStorage.setItem("CutSelect", JSON.stringify(this.current));
this.searchDetail(para);
},
changeWorkTime:function(){
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
this.searchDetail(para); this.searchDetail(para);
}, },
searchDetail: function(para) { searchDetail: function(para) {
var that = this; var that = this;
that.paramUnDoSeach={
pageIndex: 2,
pageSize: 10,
ReportType: ''
};
that.paramDoneSeach={
pageIndex: 2,
pageSize: 10,
ReportType: ''
};
if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索 if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索
Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) { Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) {
console.log("现在是未完成的搜索!"+ JSON.stringify(para)); console.log("现在是未完成的搜索!"+ JSON.stringify(para));
......
...@@ -36,6 +36,15 @@ function pullupRefresh(url, arr, params) { ...@@ -36,6 +36,15 @@ function pullupRefresh(url, arr, params) {
function searchPull(url, arr, params) { function searchPull(url, arr, params) {
setTimeout(function() { setTimeout(function() {
if(app.current == '3'){
var para = {
searchText: app.currentWorkTime,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
SearchType:app.current,
};
}else{
var para = { var para = {
searchText: app.searchText, searchText: app.searchText,
PageSize: params.pageSize, PageSize: params.pageSize,
...@@ -43,6 +52,8 @@ function pullupRefresh(url, arr, params) { ...@@ -43,6 +52,8 @@ function pullupRefresh(url, arr, params) {
ReportType: params.ReportType, ReportType: params.ReportType,
SearchType:app.current, SearchType:app.current,
}; };
}
Api.post(url, para, function(e) { Api.post(url, para, function(e) {
if (e.success) { if (e.success) {
......
var Context = { var Context={__context:null,getContext:function(){if(null!=this.__context)return this.__context;var a=JSON.parse(localStorage.getItem("$state"))||{},b=a.token||"",c=a.host||"";return this.__context={token:b,host:c,image_url:a.image_url||""},this.__context},getImageUrl:function(a,b,c,d){var e=Context.getContext().image_url+"?md5="+a;return b&&0<b&&(e+="&width="+b),c&&0<c&&(e+="&height="+c),d&&0<d&&(e+="&rate="+d),e},isLogin:function(){var a=Context.getContext();return""!=a.token}},Dom={getById:function(a){return document.getElementById(a)},clickAOpen:function(a,b,c){mui(a).on("tap","a",function(){mui.openWindow({url:b,id:b,extras:c})})},open(a,b){mui.openWindow({url:a,id:a,extras:b})}},Api={post:function(a,b,c,d){var e=Context.getContext(),f=e.host,g=new Date().valueOf();b=b||{},b.token=e.token,b.timestamp=g,d=d||this.__defaultErrorHandlder;var h=new Date().valueOf();a=f+a,a+=0<a.indexOf("?")?"&ts="+h:"?ts="+h,Log.log("web request:"+a+JSON.stringify(b)),mui.ajax(a,{type:"POST",data:b,dataType:"json",timeout:5e3,headers:{"Content-Type":"application/json"},crossDomain:!0,success:function(a,b,e){a.success?c(a):d(e,b,a)},error:d})},postAndWaiting:function(a,b,c,d){function e(){g&&(g.close(),g=null),g=plus.nativeUI.showWaiting("\u52A0\u8F7D\u6570\u636E\u4E2D...")}function f(){g&&(g.close(),g=null)}var g=null;e();var h=Context.getContext(),i=h.host;b=b||{},b.token=h.token,d=d||this.__defaultErrorHandlder,Log.log("web request:"+i+a+" data:"+JSON.stringify(b)),mui.ajax(i+a,{type:"POST",data:b,dataType:"json",timeout:1e4,headers:{"Content-Type":"application/json"},success:function(a,b,e){f(),a.success?c(a):d(e,b,a)},error:function(a,b,c){f(),d(a,b,c)}})},__defaultErrorHandlder:function(a,b,c){console.log(a.responseText),console.log(a.responseXML),console.log("status"+a.status),console.log(a.statusText);var d="";if(c&&c.hasOwnProperty("code")){var e=c.code;switch(e){case 2:d="\u7528\u6237\u540D\u6216\u8005\u5BC6\u7801\u9519\u8BEF";break;case 3:d="\u767B\u5F55\u5DF2\u8FC7\u671F";break;case 4:d="\u672A\u77E5\u7684\u670D\u52A1\u5668\u9519\u8BEF";break;case 5:d="\u516C\u53F8\u4E0D\u53EF\u7528";break;case 6:d="\u672A\u77E5\u9519\u8BEF";break;case 7:d="\u516C\u53F8\u4E0D\u5B58\u5728";break;case 8:d="\u8BF7\u6C42\u53C2\u6570\u6709\u95EE\u9898";break;default:case 0:d="\u672A\u6307\u5B9A\u7684\u9519\u8BEF";}mui.toast(d),console.log(d)}else{var f="";f="abort"==b?"\u7F51\u7EDC\u9519\u8BEF,\u8BF7\u68C0\u67E5\u8BBE\u5907\u7684\u7F51\u7EDC\u8FDE\u63A5.":"\u53D1\u751F\u4E86\u4E00\u4E2A\u9519\u8BEF",mui.toast(f),console.log(f),console.log(c)}}},ArrayUtil={addField:function(a,b,c){for(var d=0;d<a.length;d+=1)a[d][b]=c},setField:function(a,b,c){for(var d=0;d<a.length;d+=1)a[d][b]=c}},__PRINT_LOG=!0,Log={printStack:function(){if(__PRINT_LOG)try{throw new Error("print Statck")}catch(a){console.log(a.stack)}},log:function(a){__PRINT_LOG&&console.log(a)}},Sys={isIos:function(){var a=plus.os.name.toLowerCase();return"ios"==a},isAndroid:function(){var a=plus.os.name.toLowerCase();return"android"==a}},MenuAction={_menu:[],setMenu:function(a){MenuAction._menu=a,window.localStorage.setItem("MenuList",JSON.stringify(MenuAction._menu))},checkAction:function(a,b){var c=!1,d=JSON.parse(localStorage.getItem("MenuList"));if(!d||0==d.length)return!1;for(var e=0;e<d.length;e++)if(d[e].Code==a&&-1<d[e].Action.indexOf(b))return c=!0,c;return c},getTitle:function(a){var b="",c=JSON.parse(localStorage.getItem("MenuList"));console.log("222222222222:"+c.length);for(var d=0;d<c.length;d++)c[d].Code==a&&(b=c[d].Name,console.log(b));return b}};
__context: null, \ No newline at end of file
getContext: function() {
if (this.__context != null) {
return this.__context
}
var state = JSON.parse(localStorage.getItem("$state")) || {};
var token = state.token || '';
var URL = state.host || '';
this.__context = {
token: token,
host: URL,
image_url: state.image_url || ''
};
return this.__context
},
getImageUrl: function(md5, width, height, rate) {
var url = Context.getContext().image_url + '?md5=' + md5;
if (width && width > 0) {
url += '&width=' + width
}
if (height && height > 0) {
url += '&height=' + height
}
if (rate && rate > 0) {
url += '&rate=' + rate
}
return url
},
isLogin: function() {
var context = Context.getContext();
return context.token != ''
}
};
var Dom = {
getById: function(id) {
return document.getElementById(id)
},
clickAOpen: function(el, url, extras) {
mui(el).on('tap', 'a', function() {
mui.openWindow({
url: url,
id: url,
extras: extras
})
})
},
open(url, extras) {
mui.openWindow({
url: url,
id: url,
extras: extras
})
}
};
var Api = {
post: function(url, data, success, error) {
var context = Context.getContext();
var host = context.host;
data = data || {};
data.token = context.token;
error = error || this.__defaultErrorHandlder;
var ts = (new Date()).valueOf();
url = host + url;
url += url.indexOf('?') > 0 ? ("&ts=" + ts) :("?ts=" + ts);
Log.log("web request:" + url+ JSON.stringify(data));
mui.ajax(url, {
type: 'POST',
data: data,
dataType: 'json',
timeout: 5000,
headers: {
'Content-Type': 'application/json'
},
crossDomain: true,
success: function(res, type, xhr) {
if (res.success) {
success(res)
} else {
error(xhr, type, res)
}
},
error: error
})
},
postAndWaiting: function(url, data, success, error) {
var waitingObj = null;
function showWaiting() {
if (waitingObj) {
waitingObj.close();
waitingObj = null
}
waitingObj = plus.nativeUI.showWaiting("加载数据中...")
}
function closeWaiting() {
if (waitingObj) {
waitingObj.close();
waitingObj = null
}
}
showWaiting();
var context = Context.getContext();
var host = context.host;
data = data || {};
data.token = context.token;
error = error || this.__defaultErrorHandlder;
Log.log("web request:" + host + url + ' data:' + JSON.stringify(data));
mui.ajax(host + url, {
type: 'POST',
data: data,
dataType: 'json',
timeout: 10000,
headers: {
'Content-Type': 'application/json'
},
success: function(res, type, xhr) {
closeWaiting();
if (res.success) {
success(res)
} else {
error(xhr, type, res)
}
},
error: function(xhr, type, e) {
closeWaiting();
error(xhr, type, e)
}
})
},
__defaultErrorHandlder: function(xhr, status, e) {
console.log(xhr.responseText);
console.log(xhr.responseXML);
console.log('status' + xhr.status);
console.log(xhr.statusText);
var msg = '';
if (e && e.hasOwnProperty('code')) {
var code = e.code;
switch (code) {
case 2:
msg = "用户名或者密码错误";
break;
case 3:
msg = "登录已过期";
break;
case 4:
msg = "未知的服务器错误";
break;
case 5:
msg = "公司不可用";
break;
case 6:
msg = "未知错误";
break;
case 7:
msg = "公司不存在";
break;
case 8:
msg = "请求参数有问题";
break;
default:
case 0:
msg = "未指定的错误";
break
}
mui.toast(msg);
console.log(msg)
} else {
var error_msg = '';
if (status == 'abort') {
error_msg = '网络错误,请检查设备的网络连接.'
} else {
error_msg = '发生了一个错误'
}
mui.toast(error_msg);
console.log(error_msg);
console.log(e)
}
}
};
var ArrayUtil = {
addField: function(items, fieldName, defaultValue) {
for (var i = 0; i < items.length; i += 1) {
items[i][fieldName] = defaultValue
}
},
setField: function(items, fieldName, value) {
for (var i = 0; i < items.length; i += 1) {
items[i][fieldName] = value
}
}
};
var __PRINT_LOG = true;
var Log = {
printStack: function() {
if (__PRINT_LOG) {
try {
throw new Error("print Statck")
} catch (ex) {
console.log(ex.stack)
}
}
},
log: function(val) {
if (__PRINT_LOG) {
console.log(val)
}
}
};
var Sys = {
isIos: function() {
var osname = plus.os.name.toLowerCase();
return osname == 'ios'
},
isAndroid: function() {
var osname = plus.os.name.toLowerCase();
return osname == 'android'
}
};
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
(function($){ (function($){
var t = (new Date()).valueOf(); var t = (new Date()).valueOf();
var wgtVer = null, var wgtVer = null,
checkUrl = "http://11wangjp.oss-cn-shanghai.aliyuncs.com/ftt_mes_test", checkUrl = "http://11wangjp.oss-cn-shanghai.aliyuncs.com/ftt_mes",
localDir="update", localDir="update",
update_json_android='android.json', update_json_android='android.json',
update_json_ios = 'ios.json', update_json_ios = 'ios.json',
......
...@@ -20,11 +20,16 @@ ...@@ -20,11 +20,16 @@
</div> </div>
<div id="left-2" class="left-2"> <div id="left-2" class="left-2">
<div class="select"> <div class="select">
<div class="mui-input-row mui-search"> <div class="mui-input-row mui-search" v-show="!isWorkTeam">
<input id="search" class="mui-input-clear search" placeholder="搜索"v-model="searchText" type="search" <input id="search" class="mui-input-clear search" placeholder="搜索"v-model="searchText" type="search"
pattern="\d*" @keyup.enter="goSearch($event)" @focus.prevent="changePosition()" pattern="\d*" @keyup.enter="goSearch($event)" @focus.prevent="changePosition()"
@blur.prevent="changePosition1()"> @blur.prevent="changePosition1()">
</div> </div>
<div class="workTime" v-show="isWorkTeam">
<select v-model="currentWorkTime" @change="changeWorkTime($event)">
<option :value="item" v-for="item in workTimeData">{{item}}</option>
</select>
</div>
<div class="select-left"> <div class="select-left">
<select v-model="current" @change="changeSearchType" > <select v-model="current" @change="changeSearchType" >
<option :value="item.id" v-for="item in searchData">{{item.name}}</option> <option :value="item.id" v-for="item in searchData">{{item.name}}</option>
...@@ -146,7 +151,7 @@ ...@@ -146,7 +151,7 @@
</div> </div>
<div class="left-submit"> <div class="left-submit">
<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_reportDelete" @click="reportDelete()">撤回实报</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete" @click="nextPage(1,0)">品质问题</button> <button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="disable_reportDelete1" @click="nextPage(1,0)">品质问题</button>
</div> </div>
</div> </div>
<div id="right-4"> <div id="right-4">
...@@ -179,7 +184,7 @@ ...@@ -179,7 +184,7 @@
<div style=" display: inline-block; width: 38%;"> <div style=" display: inline-block; width: 38%;">
<div class="Rbtn"> <div class="Rbtn">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" @click="sop" :disabled="SOP__">SOP</button> <button type="button" class="mui-btn mui-btn-blue mui-btn-block" @click="sop" :disabled="SOP__">SOP</button>
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="!disable_reportDelete" @click="submitZD">整单完工</button> <button type="button" class="mui-btn mui-btn-blue mui-btn-block" :disabled="complete_State" @click="submitZD">整单完工</button>
</div> </div>
<div class="Rcomputed"> <div class="Rcomputed">
<input readonly="readonly" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty" <input readonly="readonly" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
......
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