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

优化。。。

parent b3b8e80d
......@@ -108,6 +108,22 @@ body {
margin: 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{
width: calc(100% - 80px);
float: right;
......
......@@ -136,7 +136,22 @@ body,
.mui-inner-wrap {
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 {
......@@ -274,6 +289,7 @@ body,
.right-main {
padding-top: 5px;
position: relative;
height: calc(100% - 80px);
}
.top1 {
......@@ -360,6 +376,7 @@ body,
position: absolute;
top: 0px;
background: white;
}
.rightDetail{
background:#fff;height: 100%;
......
......@@ -187,7 +187,23 @@ body,
text-overflow: ellipsis;
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 {
/* top: 32px; */
}
......
......@@ -52,9 +52,9 @@ var getSubInfoById = function(infoList, id) {
var wgtVer = null;
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文件
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);
function downWgtHot() {
......
......@@ -55,7 +55,7 @@ var app = new Vue({
datalen: 20, //默认取数据数量
reDatalen: 10, //每次加载的数据数量
isAlert: false,
disable_reportDelete: 'disabled',
//disable_reportDelete: 'disabled',
disable_qq: 'disabled',
ReportID: 0,
// Report_IndexID: 0,
......@@ -87,15 +87,54 @@ var app = new Vue({
}
],
current: '', //搜索选中
isWorkTeam:false,
workTimeData:[],
currentWorkTime:'',//班组
},
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() {
if(MenuAction.checkAction('90033','Update')){
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
}else{
return 'disabled';
}
},
display_: function() {
if (this.displayModel == 1) {
......@@ -111,8 +150,16 @@ var app = new Vue({
},
},
created() {
console.log(this.searchData[0].name);
//如果没有这句代码,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: {
init: function() { //初始化
......@@ -135,19 +182,28 @@ var app = new Vue({
var UnfinishedData = app.itemsHead;
var FinishedUrlData = app.itemsLeft2;
if (reUnfinished) { //未完成
if(app.current == '3'){
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") {
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
} else {
pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo);
}
}
} else if (reFinished) { //已完成
if(app.current == '3'){
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
}else{
if (app.searchText != "") {
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
} else {
pullupRefresh(searchDoneUrl, FinishedUrlData, app.paramDone);
}
}
}
......@@ -180,7 +236,18 @@ var app = new Vue({
});
this.dateTime = moment().format().substring(0, 10)
// 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();
}
},
getData: function() {
var that = this;
......@@ -206,7 +273,7 @@ var app = new Vue({
//that.ChangeState(1);
that.getTatolNum();
that.qty = 0;
that.disable_reportDelete = 'disabled';
//that.disable_reportDelete = 'disabled';
that.sizeArr();
} else {
that.itemsHead = [];
......@@ -219,7 +286,7 @@ var app = new Vue({
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
//that.disable_reportDelete = 'disabled'
//that.ChangeState(1);
that.getTatolNum();
}
......@@ -249,6 +316,27 @@ var app = new Vue({
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() {
var that = this;
that.itemsSize = [];
......@@ -277,7 +365,7 @@ var app = new Vue({
SearchText: '',
};
that.searchText = '';
that.disable_reportDelete = "disabled";
//that.disable_reportDelete = "disabled";
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
that.cur = 0;
if (e.items.length > 0) {
......@@ -305,7 +393,7 @@ var app = new Vue({
SearchText: '',
};
//console.log("do para " + JSON.stringify(para))
that.disable_reportDelete = null;
//that.disable_reportDelete = null;
that.searchText = '';
Api.post('/api/vMES/ProductionReportV2/SearchDone', para, function(e) {
console.log("已完成" + JSON.stringify(para))
......@@ -349,18 +437,52 @@ var app = new Vue({
}
},
changeSearchType: function() {
var that = this;
if(this.current == '3'){
this.isWorkTeam=true;
var para = {
SearchText: that.searchText,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: that.pagenum,
ReportType: that.ReportType,
SearchType: that.current,
PageIndex: this.pagenum,
ReportType: this.ReportType,
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);
},
searchDetail:function(para){
var that = this;
that.paramUnDoSeach={
pageIndex: 2,
pageSize: 10,
ReportType: 2
};
that.paramDoneSeach={
pageIndex: 2,
pageSize: 10,
ReportType: 2
};
if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
console.log("现在是未完成的搜索!");
......
......@@ -66,6 +66,10 @@ var app = new Vue({
{
id: '4',
name: '实际完成'
},
{
id: '5',
name: '班组'
}
],
current: '', //搜索选中
......@@ -82,32 +86,83 @@ var app = new Vue({
PersonList: [],
all: false, //全选
WorkTeamID: 0, //班组
isAward: 0, //是否发包
//isAward: 0, //是否发包
Workers: [],
ReportType:1,
isData: false, //是否显示搜索
dateTime2: 0,
workTimeData:[],
currentWorkTime:'',//班组
isWorkTeam:false,
},
computed: {
display_: function() {
if (this.displayModel == 1) {
return "display: none "
isAward: function() {
if(MenuAction.checkAction('90037','Update')){
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() {
if(MenuAction.checkAction('90037','Update')){
if (this.selectList.length > 1) {
return null
} else {
return "disabled"
}
}else{
return "disabled"
}
},
saveChange: function() {
if(MenuAction.checkAction('90037','Update')){
return null
}else{
return "disabled"
}
},
},
created: function() {
//如果没有这句代码,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.dateTime1 = 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() {
if (localStorage.getItem('data')) {
......@@ -141,12 +196,17 @@ var app = new Vue({
callback: function() {
var Url = '/api/vMES/ZCProductionPlan/List';
var dataList = app.itemsList;
if(app.current == '4'||app.current == '3'||app.current == '5'){
searchPull(Url, dataList, app.paramSearch);
}else{
if (app.searchText != "") {
searchPull(Url, dataList, app.paramSearch);
} else {
pullupRefresh(Url, dataList, app.paramList);
}
}
}
},
}
});
......@@ -199,6 +259,23 @@ var app = new Vue({
function searchPull(url, arr, params) {
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 = {
searchText: app.searchText,
PageSize: params.pageSize,
......@@ -206,6 +283,8 @@ var app = new Vue({
Date: app.dateTime,
SearchType: app.current,
};
}
Api.post(url, para, function(e) {
if (e.success) {
......@@ -252,7 +331,28 @@ var app = new Vue({
document.getElementsByClassName('mui-inner-wrap')[0].addEventListener('drag', function(event) {
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() {
var that = this;
......@@ -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) {
var that = this;
var para = {
Date: that.dateTime,
......@@ -409,17 +530,30 @@ var app = new Vue({
console.log("11111111111111111111:" + this.current);
if (this.current == '3' || this.current == '4') {
this.isData = true;
this.isWorkTeam = false;
var para = {
Date: this.dateTime,
PageSize: this.PageSize,
PageIndex: this.PageIndex,
SearchType: this.current,
SearchText: this.dateTime2,
};
} else {
} else if(this.current == '5'){
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 = {
Date: this.dateTime,
PageSize: this.PageSize,
......@@ -428,6 +562,19 @@ var app = new Vue({
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);
},
searchDetail: function(para) {
......@@ -452,7 +599,7 @@ var app = new Vue({
Api.post('/api/vMES/ZCProductionPlan/List', para, function(e) {
if (e.success) {
var data = e.data.items.length;
//console.log("搜索::" + JSON.stringify(e.data.items))
console.log("搜索::" + JSON.stringify(e.data.items))
if (data > 0) {
that.Summary = e.data.Summary;
that.itemsList = e.data.items;
......@@ -620,11 +767,22 @@ var app = new Vue({
console.log(JSON.stringify(para));
Api.post('/api/vMES/ZCProductionPlan/Save', para, function(e) {
if (e.success) {
that.isAward = false;
//that.isAward = false;
that.IndexID = e.data.IndexID;
console.log(JSON.stringify(that.IndexID));
that.getDetailList(that.IndexID);
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) {
mui.toast(JSON.stringify(res.message))
......@@ -647,9 +805,9 @@ var app = new Vue({
that.IndexID = item.IndexID;
console.log(item.IndexID)
that.getDetailList(that.IndexID);
that.isAward = false;
//that.isAward = false;
} else {
that.isAward = true;
//that.isAward = true;
mui.toast("该订单未发包!");
that.itemsData2 = [];
}
......@@ -665,7 +823,9 @@ var app = new Vue({
if (e.success) {
if (e.data.Main && e.data.Main != '') {
that.WorkTeamID = e.data.Main.WorkTeamID;
}
if (e.data.IETask.length > 0) {
that.itemsData2 = e.data.IETask;
console.log("详细信息::" + JSON.stringify(e.data))
......@@ -673,6 +833,7 @@ var app = new Vue({
that.$set(item, "status", false)
})
console.log(JSON.stringify(that.itemsData2));
}
}
}, function(xhr, type, res) {
......@@ -692,7 +853,7 @@ var app = new Vue({
Api.post('/api/vMES/ZCProductionPlan/Revoke', para, function(e) {
if (e.success) {
mui.toast("撤销成功!");
that.isAward = true;
//that.isAward = true;
that.itemsData2 = [];
that.playVoice("cg.mp3");
}
......
......@@ -76,6 +76,10 @@ var app = new Vue({
current: '', //搜索选中
dateTime: "", //日期
isData: false, //搜索的时候 是否选中了日期
getTitle:MenuAction.getTitle('90029'),
workTimeData:[],
currentWorkTime:'',//班组
isWorkTeam:false,
},
computed: {
display_: function() {
......@@ -85,30 +89,70 @@ var app = new Vue({
},
btnMatch: function() {
if(MenuAction.checkAction('90029','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur]
.IsMatch : "disabled";
}else{
return 'disabled';
}
},
btnConfirm: function() {
if(MenuAction.checkAction('90029','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur]
.IsConfirm : "disabled";
}else{
return 'disabled';
}
},
btnCheck: 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';
}
},
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() {
//如果没有这句代码,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: {
init: function() {
......@@ -131,6 +175,9 @@ var app = new Vue({
var needData = app.itemsLeft2;
if (reUnfinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") {
searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
console.log("未交接搜索:" + JSON.stringify(app.paramUnDoSeach));
......@@ -138,7 +185,12 @@ var app = new Vue({
console.log("未交接22:" + JSON.stringify(app.paramUnDo));
pullupRefresh(needUrl, UnneedData, app.paramUnDo);
}
}
} else if (reFinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrlDone, needData, app.paramDoneSeach);
}else{
if (app.searchText != "") {
searchPull(searchUrlDone, needData, app.paramDoneSeach);
console.log("getData:已交接搜索:" + JSON.stringify(app.paramDoneSeach));
......@@ -147,6 +199,8 @@ var app = new Vue({
console.log("getData:已交接22:" + JSON.stringify(app.paramDone));
}
}
}
}
},
}
......@@ -189,6 +243,23 @@ var app = new Vue({
function searchPull(url, arr, params) {
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 = {
SearchText: app.searchText,
PageSize: params.pageSize,
......@@ -196,6 +267,8 @@ var app = new Vue({
ReportType: params.ReportType,
SearchType: app.current
};
}
Api.post(url, para, function(e) {
console.log("canshu:" + JSON.stringify(para));
......@@ -222,14 +295,13 @@ var app = new Vue({
bounce: false,
indicators: true, //是否显示滚动条
});
this.getData(0);
mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘
app.searchText = '';
app.getData(0);
});
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 = {
ReportType: app.ReportType,
SearchText: app.dateTime,
......@@ -239,6 +311,27 @@ var app = new Vue({
};
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) {
var that = this;
......@@ -259,7 +352,7 @@ var app = new Vue({
that.itemsLeft = e.items;
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
console.log("getData:未交接:" + JSON.stringify(that.itemsLeft));
console.log("getData:未交接:" + that.itemsLeft);
} else {
that.itemsLeft = []
that.itemsDetail = [];
......@@ -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) {
this.IndexID = obj.IndexID;
//this.nextDetail = obj;
......@@ -336,30 +449,67 @@ var app = new Vue({
console.log("11111111111111111111:" + this.current);
if (this.current == '4') {
this.isData = true;
this.isWorkTeam = false;
var para = {
ReportType: this.ReportType,
SearchText: this.dateTime,
PageSize: 20,
PageIndex: 1,
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;
var para = {
ReportType: this.ReportType,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: 1,
SearchType: this.current
};
} else{
this.isData = false;
this.isWorkTeam = false;
var para = {
ReportType: this.ReportType,
SearchText: this.searchText,
PageSize: 20,
PageIndex: 1,
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);
},
searchDetail: function(para) {
console.log("搜索参数::" + JSON.stringify(para));
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) {
Api.post('/api/vMES/Handover/Search', para, function(e) {
//console.log("eee::" + JSON.stringify(e))
......
......@@ -77,6 +77,10 @@ var app = new Vue({
current: '', //搜索选中
dateTime: "", //日期
isData: false, //搜索的时候 是否选中了日期
isWorkTeam:false,//搜索的时候 是否选中了班组
getTitle:MenuAction.getTitle('90028'),
workTimeData:[],
currentWorkTime:'',//班组
},
computed: {
display_: function() {
......@@ -86,31 +90,73 @@ var app = new Vue({
},
btnMatch: function() {
if(MenuAction.checkAction('90028','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur]
.IsMatch : "disabled";
}else{
return 'disabled';
}
},
btnConfirm: function() {
if(MenuAction.checkAction('90028','Update')){
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur]
.IsConfirm : "disabled";
}else{
return 'disabled';
}
},
btnCheck: 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';
}
},
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() {
//如果没有这句代码,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: {
init: function() {
mui.init({
......@@ -130,8 +176,11 @@ var app = new Vue({
var searchUrlDone = '/api/vMES/Handover/SearchDone';
var UnneedData = app.itemsLeft;
var needData = app.itemsLeft2;
//this.dateTime
if (reUnfinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") {
searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
console.log("未交接搜索:" + JSON.stringify(app.paramUnDoSeach));
......@@ -139,7 +188,12 @@ var app = new Vue({
console.log("未交接22:" + JSON.stringify(app.paramUnDo));
pullupRefresh(needUrl, UnneedData, app.paramUnDo);
}
}
} else if (reFinished) {
if(app.current == '4' || app.current == '3'){
searchPull(searchUrlDone, needData, app.paramDoneSeach);
}else{
if (app.searchText != "") {
searchPull(searchUrlDone, needData, app.paramDoneSeach);
console.log("getData:已交接搜索:" + JSON.stringify(app.paramDoneSeach));
......@@ -148,6 +202,8 @@ var app = new Vue({
console.log("getData:已交接22:" + JSON.stringify(app.paramDone));
}
}
}
}
},
}
......@@ -190,6 +246,23 @@ var app = new Vue({
function searchPull(url, arr, params) {
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 = {
SearchText: app.searchText,
PageSize: params.pageSize,
......@@ -197,6 +270,8 @@ var app = new Vue({
ReportType: params.ReportType,
SearchType: app.current
};
}
Api.post(url, para, function(e) {
console.log("canshu:" + JSON.stringify(para));
......@@ -223,13 +298,14 @@ var app = new Vue({
bounce: false,
indicators: true, //是否显示滚动条
});
this.getData(0);
this.dateTime = moment().format().substring(0, 10);
mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘
app.searchText = '';
app.getData(0);
});
// mui(".mui-icon-clear")[0].addEventListener('tap', function() {
// document.activeElement.blur(); //收起虚拟键盘
// app.searchText = '';
// app.getData(0);
// });
mui('body').on('tap','.mui-dtpicker #queding' ,function(){
var para = {
ReportType: app.ReportType,
......@@ -240,6 +316,28 @@ var app = new Vue({
};
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) {
var that = this;
......@@ -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) {
this.IndexID = obj.IndexID;
//this.nextDetail = obj;
......@@ -336,6 +454,7 @@ var app = new Vue({
console.log("11111111111111111111:" + this.current);
if (this.current == '4') {
this.isData = true;
this.isWorkTeam = false;
var para = {
ReportType: this.ReportType,
SearchText: this.dateTime,
......@@ -344,8 +463,19 @@ var app = new Vue({
SearchType: this.current
};
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.isWorkTeam = false;
var para = {
ReportType: this.ReportType,
SearchText: this.searchText,
......@@ -353,15 +483,38 @@ var app = new Vue({
PageIndex: 1,
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);
},
searchDetail: function(para) {
console.log("搜索参数::" + JSON.stringify(para));
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) {
Api.post('/api/vMES/Handover/Search', para, function(e) {
//console.log("eee::" + JSON.stringify(e))
......@@ -411,7 +564,6 @@ var app = new Vue({
var opt2 = document.getElementById("item2");
var n1 = document.getElementById("n1");
var n2 = document.getElementById("n2");
this.completeState = n ? false : true;
n1.style.background = n ? "white" : "royalblue";
n1.style.color = n ? "royalblue" : "white";
......
......@@ -55,7 +55,7 @@ var app = new Vue({
datalen: 20, //默认取数据数量
reDatalen: 10, //每次加载的数据数量
isAlert: false,
disable_reportDelete: 'disabled',
//disable_reportDelete: 'disabled',
disable_qq: 'disabled',
ReportID: 0,
// Report_IndexID: 0,
......@@ -87,15 +87,54 @@ var app = new Vue({
}
],
current: '', //搜索选中
isWorkTeam:false,
workTimeData:[],
currentWorkTime:'',//班组
},
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() {
if(MenuAction.checkAction('90032','Update')){
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
}else{
return 'disabled';
}
},
display_: function() {
if (this.displayModel == 1) {
......@@ -112,7 +151,14 @@ var app = new Vue({
},
created() {
//如果没有这句代码,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: {
init: function() { //初始化
......@@ -135,12 +181,19 @@ var app = new Vue({
var UnfinishedData = app.itemsHead;
var FinishedUrlData = app.itemsLeft2;
if (reUnfinished) { //未完成
if(app.current == '3'){
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") {
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
} else {
pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo);
}
}
} else if (reFinished) { //已完成
if(app.current == '3'){
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
}else{
if (app.searchText != "") {
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
} else {
......@@ -148,6 +201,7 @@ var app = new Vue({
}
}
}
}
},
}
});
......@@ -177,7 +231,18 @@ var app = new Vue({
});
this.dateTime = moment().format().substring(0, 10)
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();
}
},
getData: function() {
var that = this;
......@@ -203,7 +268,7 @@ var app = new Vue({
//that.ChangeState(1);
that.getTatolNum();
that.qty = 0;
that.disable_reportDelete = 'disabled';
//that.disable_reportDelete = 'disabled';
that.sizeArr();
} else {
that.itemsHead = [];
......@@ -216,7 +281,7 @@ var app = new Vue({
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
//that.disable_reportDelete = 'disabled'
//that.ChangeState(1);
that.getTatolNum();
}
......@@ -246,6 +311,27 @@ var app = new Vue({
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(){
var that= this ;
that.itemsSize=[];
......@@ -274,7 +360,7 @@ var app = new Vue({
SearchText:'',
};
that.searchText = '';
that.disable_reportDelete = "disabled";
//that.disable_reportDelete = "disabled";
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
that.cur = 0;
if (e.items.length > 0) {
......@@ -302,7 +388,7 @@ var app = new Vue({
SearchText:'',
};
//console.log("do para " + JSON.stringify(para))
that.disable_reportDelete = null;
//that.disable_reportDelete = null;
that.searchText = '';
Api.post('/api/vMES/ProductionReportV2/SearchDone', para, function(e) {
console.log("已完成" + JSON.stringify(para))
......@@ -347,19 +433,51 @@ var app = new Vue({
}
},
changeSearchType:function(){
var that = this;
if(this.current == '3'){
this.isWorkTeam=true;
var para = {
SearchText: that.searchText,
SearchText: this.currentWorkTime,
PageSize: 20,
PageIndex: that.pagenum,
ReportType: that.ReportType,
SearchType:that.current,
PageIndex: this.pagenum,
ReportType: this.ReportType,
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);
},
searchDetail:function(para){
var that = this;
that.paramUnDoSeach={
pageIndex: 2,
pageSize: 10,
ReportType: 1
};
that.paramDoneSeach= {
pageIndex: 2,
pageSize: 10,
ReportType: 1
};
if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索
Api.post('/api/vMES/ProductionReportV2/Search', para, function(e) {
console.log("现在是未完成的搜索!");
......
......@@ -55,7 +55,7 @@ var app = new Vue({
datalen: 20, //默认取数据数量
reDatalen: 10, //每次加载的数据数量
isAlert: false,
disable_reportDelete: 'disabled',
//disable_reportDelete: 'disabled',
disable_qq: 'disabled',
ReportID: 0,
// Report_IndexID: 0,
......@@ -87,15 +87,55 @@ var app = new Vue({
name: '班组'
}
],
current: '', //搜索选中
current:'', //搜索选中
isWorkTeam:false,
workTimeData:[],
currentWorkTime:'',//班组
},
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() {
if(MenuAction.checkAction('90015','Update')){
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
}else{
return 'disabled';
}
},
display_: function() {
if (this.displayModel == 1) {
......@@ -112,7 +152,14 @@ var app = new Vue({
},
created() {
//如果没有这句代码,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: {
init: function() { //初始化
......@@ -135,19 +182,27 @@ var app = new Vue({
var UnfinishedData = app.itemsHead;
var FinishedUrlData = app.itemsLeft2;
if (reUnfinished) { //未完成
if(app.current == '3'){
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
}else{
if (app.searchText != "") {
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
} else {
pullupRefresh(searchUrl, UnfinishedData, app.paramUnDo);
}
}
} else if (reFinished) { //已完成
if(app.current == '3'){
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
}else{
if (app.searchText != "") {
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
} else {
pullupRefresh(searchDoneUrl, FinishedUrlData, app.paramDone);
}
}
}
}
......@@ -159,7 +214,6 @@ var app = new Vue({
app.getData();
app.ChangeState(1);
});
mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘
app.searchText = '';
......@@ -178,7 +232,18 @@ var app = new Vue({
});
this.dateTime = moment().format().substring(0, 10)
// 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();
}
},
getData: function() {
var that = this;
......@@ -192,6 +257,8 @@ var app = new Vue({
};
//console.log("lalla" + JSON.stringify(para));
that.cur = 0;
Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) {
console.log("one :::;" + JSON.stringify(para))
console.log("getData:" + JSON.stringify(e.items[0]))
......@@ -204,7 +271,8 @@ var app = new Vue({
//that.ChangeState(1);
that.getTatolNum();
that.qty = 0;
that.disable_reportDelete = 'disabled';
//that.disable_reportDelete =MenuAction.checkAction('90015','Update') ; // 'disabled';
that.sizeArr();
} else {
that.itemsHead = [];
......@@ -217,10 +285,11 @@ var app = new Vue({
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
//that.ChangeState(1);
that.getTatolNum();
}
//that.disable_reportDelete = 'disabled';
}, function(xhr, type, res) {
//console.log(bbb);
mui.toast(JSON.stringify(res.message))
......@@ -247,6 +316,27 @@ var app = new Vue({
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(){
var that= this ;
that.itemsSize=[];
......@@ -275,7 +365,7 @@ var app = new Vue({
SearchText:'',
};
that.searchText = '';
that.disable_reportDelete = "disabled";
//that.disable_reportDelete = "disabled";
Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) {
that.cur = 0;
if (e.items.length > 0) {
......@@ -303,7 +393,7 @@ var app = new Vue({
SearchText:'',
};
//console.log("do para " + JSON.stringify(para))
that.disable_reportDelete = null;
//that.disable_reportDelete = null;
that.searchText = '';
Api.post('/api/vMES/CutOffProductionReport/SearchDone', para, function(e) {
console.log("已完成" + JSON.stringify(para))
......@@ -348,6 +438,17 @@ var app = new Vue({
}
},
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 = {
SearchText: this.searchText,
PageSize: 20,
......@@ -355,10 +456,34 @@ var app = new Vue({
ReportType: this.ReportType,
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);
},
searchDetail: function(para) {
var that = this;
that.paramUnDoSeach={
pageIndex: 2,
pageSize: 10,
ReportType: ''
};
that.paramDoneSeach={
pageIndex: 2,
pageSize: 10,
ReportType: ''
};
if (this.completeState) { //true 是未完成的搜索 false是已完成的搜索
Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) {
console.log("现在是未完成的搜索!"+ JSON.stringify(para));
......
......@@ -36,6 +36,15 @@ function pullupRefresh(url, arr, params) {
function searchPull(url, arr, params) {
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 = {
searchText: app.searchText,
PageSize: params.pageSize,
......@@ -43,6 +52,8 @@ function pullupRefresh(url, arr, params) {
ReportType: params.ReportType,
SearchType:app.current,
};
}
Api.post(url, para, function(e) {
if (e.success) {
......
var Context = {
__context: null,
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'
}
};
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}};
\ No newline at end of file
......@@ -2,7 +2,7 @@
(function($){
var t = (new Date()).valueOf();
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",
update_json_android='android.json',
update_json_ios = 'ios.json',
......
......@@ -20,11 +20,16 @@
</div>
<div id="left-2" class="left-2">
<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"
pattern="\d*" @keyup.enter="goSearch($event)" @focus.prevent="changePosition()"
@blur.prevent="changePosition1()">
</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">
<select v-model="current" @change="changeSearchType" >
<option :value="item.id" v-for="item in searchData">{{item.name}}</option>
......@@ -146,7 +151,7 @@
</div>
<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="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 id="right-4">
......@@ -179,7 +184,7 @@
<div style=" display: inline-block; width: 38%;">
<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" :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 class="Rcomputed">
<input readonly="readonly" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
......
......@@ -195,9 +195,13 @@
</div>
<div id="right-5" style=" position: absolute; left:375px ; bottom: 5px;">
<!-- <label style="height:50px;width: 100px ; text-align: center; vertical-align:middle ; "> 处理类型:</label> -->
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px;background: #02C1ED ;font-size: 22px"
<button id="ProcessingType_1" type="button" class="mui-btn mui-btn-blue mui-btn-outlined"
style="height:50px;width: 100px;background: #02C1ED ;font-size: 22px"
:disabled="saveChange"
@click="selectProcessingType(1)">返修</button>
<button id="ProcessingType_2" type="button" class="mui-btn mui-btn-blue mui-btn-outlined" style="height:50px;width: 100px ;font-size: 22px"
<button id="ProcessingType_2" type="button" class="mui-btn mui-btn-blue mui-btn-outlined"
style="height:50px;width: 100px ;font-size: 22px"
:disabled="saveChange1"
@click="selectProcessingType(2)">报废</button>
</div>
......@@ -258,13 +262,31 @@
sizeNum:[],
},
computed: {
saveChange: function() {
if(MenuAction.checkAction('90015','Update')){
return null;
}else{
return 'disabled';
}
},
saveChange1: function() {
if(MenuAction.checkAction('90015','Update')){
return null;
}else{
return 'disabled';
}
},
disable_save_button2: function() {
if(MenuAction.checkAction('90015','Update')){
if (this.qty != 0 && this.size != 0 && this.qualityID != 0 && this.ProcessingType != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
}else{
return 'disabled';
}
},
display_: function() {
if (this.displayModel == 1) {
......@@ -329,7 +351,7 @@
that.getDataDetail2(1);
that.getTatolNum();
that.qty = 0;
that.disable_reportDelete = 'disabled';
} else {
that.itemsDetail = [];
that.IndexID = 0;
......@@ -339,10 +361,10 @@
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
}
}
that.disable_reportDelete = 'disabled';
});
},
//品检明细
......@@ -461,7 +483,7 @@
if (e.success) {
that.getsizeNum()
that.createZhezhao(-1)
that.disable_reportDelete = 'disabled'
that.disable_reportDelete = 'disabled';
that.size = 0;
that.qty = 0;
that.selectSize(0);
......@@ -618,7 +640,7 @@
this.getTatolNum();
this.qty = 0;
this.size = 0;
this.disable_reportDelete = 'disabled';
} else {
this.itemsDetail = [];
this.IndexID = 0;
......@@ -628,9 +650,9 @@
this.itemsLeft = [];
this.number = 0;
this.qty = 0;
this.disable_reportDelete = 'disabled'
}
}
this.disable_reportDelete = 'disabled';
},
selectReport: function(obj) {
......@@ -638,7 +660,7 @@
this.ReportID = obj;
if (this.ReportID != 0) {
this.disable_reportDelete = null;
this.disable_reportDelete = MenuAction.checkAction('90015','Delete') ? null: 'disabled';
}
var reportele = document.getElementsByClassName("Report");
......@@ -647,7 +669,6 @@
}
if (obj != 0) {
this.createZhezhao(1)
op.style.background = "#02C1ED";
this.displayReport();
}
......@@ -657,7 +678,7 @@
this.ReportID = obj;
if (this.ReportID != 0) {
this.disable_reportDelete = null;
this.disable_reportDelete = MenuAction.checkAction('90015','Delete') ? null: 'disabled';
}
var reportele = document.getElementsByClassName("Report");
......
......@@ -21,11 +21,16 @@
</div>
<div id="left-2" class="left-2">
<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"
pattern="\d*" @keyup.enter="goSearch($event)" @focus.prevent="changePosition()"
@blur.prevent="changePosition1()">
</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">
<select v-model="current" @change="changeSearchType">
<option :value="item.id" v-for="item in searchData">{{item.name}}</option>
......@@ -127,7 +132,7 @@
</div>
<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="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 id="right-4">
......@@ -160,7 +165,7 @@
<div style=" display: inline-block; width: 38%;">
<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" :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 class="Rcomputed">
<input readonly="readonly" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
......
......@@ -17,6 +17,11 @@
height: 200%;
/*background-color: #F6F6F6;*/
}
.bg li p{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
</head>
......@@ -50,30 +55,31 @@
<ul :id="itemsDetail.IndexID" class="mui-table-view bg" style="margin-top: 5px;" v-for=" itemsDetail ,n in itemsLeft" @click="nextPage(itemsDetail)">
<li style=" padding: 0px 15px;">
<p style="float: left;width: 16%; color: #060606; padding: 0; margin: 0;"> 指令号: </p>
<p style="float: left;width: 40%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.IndexNo}} </p>
<p style="float: left;width: 12%; color: #060606; padding: 0; margin: 0;">班组: </p>
<p style="float: left;width: 38%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.IndexNo}} </p>
<p style="float: left;width: 14%; color: #060606; padding: 0; margin: 0;">班组: </p>
<p style="float: left;width: 32%; color: #060606; padding: 0; margin: 0;">{{itemsDetail.WorkTeam}} </p>
</li>
<li style=" padding: 0px 15px;">
<p style="float: left;width: 16%; color: #060606; padding: 0; margin: 0;"> 货号: </p>
<p style="float: left;width: 40%; color: #007AFF; padding: 0; margin: 0;">&nbsp;{{itemsDetail.StyleCode}} </p>
<p style="float: left;width: 38%; color: #007AFF; padding: 0; margin: 0;">&nbsp;{{itemsDetail.StyleCode}} </p>
<p style="float: left;width: 14%; color: #060606; padding: 0; margin: 0;">数量: </p>
<p style="float: left;width: 28%; color: red; padding: 0; margin: 0;">{{itemsDetail.Qty}} </p>
<p style="float: left;width: 32%; color: red; padding: 0; margin: 0;">{{itemsDetail.Qty}} </p>
</li>
<li style=" padding: 0px 15px;">
<p style="float: left;width: 18%; color: #060606; padding: 0; margin: 0;"> 计划时间: </p>
<p style="float: left;width: 32%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.PlanDate}} </p>
<p style="float: left;width: 36%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.PlanDate}} </p>
<p style="float: left;width: 18%; color: #060606; padding: 0; margin: 0;"> 完成时间: </p>
<p style="float: left;width: 32%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.OrderDeliveryTime}} </p>
<p style="float: left;width: 28%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.OrderDeliveryTime}} </p>
</li>
<li style=" padding: 0px 11px 2px 11px;position: relative; overflow: hidden;">
<li style=" padding: 0px 11px 2px 15px;overflow: hidden;">
<p style="float: left;width: 18%; color: #060606; padding: 0; margin: 0;"> 发布时间: </p>
<p style="float: left;width: 40%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.CreateDate}} </p>
<p style="float: left;width: 14%; color: #060606; padding: 0; margin: 0;">发布人: </p>
<p style="float: left;width: 28%; color: #060606; padding: 0; margin: 0;">{{itemsDetail.PlanMan}} </p>
<p style="float: left;width: 36%; color: #060606; padding: 0; margin: 0;">&nbsp;{{itemsDetail.CreateDate}} </p>
<p style="float: left;width: 16%; color: #060606; padding: 0; margin: 0;">发布人: </p>
<p style="float: left;width: 30%; color: #060606; padding: 0; margin: 0;">{{itemsDetail.PlanMan}} </p>
</li>
</ul>
</div>
</div>
......
......@@ -29,7 +29,7 @@
<button class="mui-btn-outlined" id="selectdate" data-options='{"type":"month"}' name="shipdate" @click="selecttime()">{{dateTime}}</button>
<button class="mui-icon mui-icon-arrowright mui-btn-outlined " @click="nextMonth(1)"></button>
</div>
<div class="mui-input-row mui-search" v-show="!isData">
<div class="mui-input-row mui-search" v-show="!isData&&!isWorkTeam">
<input class="mui-input-clear search" placeholder="搜索" v-model="searchText" type="search" pattern="\d*"
@keyup.enter="goSearch($event)">
</div>
......@@ -38,6 +38,11 @@
<button class="mui-btn-outlined" id="selectdate2" data-options='{"type":"date"}' name="shipdate" @click="selecttime2()">{{dateTime2}}</button>
<button class="mui-icon mui-icon-arrowright mui-btn-outlined " @click="nextday2(1)"></button>
</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">
<select v-model="current" @change="changeSearchType">
<option :value="item.id" v-for="item in searchData">{{item.name}}</option>
......@@ -120,59 +125,59 @@
<form class="mui-input-group">
<div class="mui-input-row mui-checkbox mui-left">
<label>品名</label>
<input name="checkbox" type="checkbox" v-model="showStyleName" @click="change(0)">
<input name="checkbox" type="checkbox" v-model="showStyleName" @tap="change(0)">
</div>
<div class="mui-input-row mui-checkbox mui-left">
<label>指令号</label>
<input name="checkbox" type="checkbox" v-model="showIndexNo" @click="change(1)">
<input name="checkbox" type="checkbox" v-model="showIndexNo" @tap="change(1)">
</div>
<div class="mui-input-row mui-checkbox mui-left">
<label>订单号</label>
<input name="checkbox" type="checkbox" v-model="showCustomPO" @click="change(2)">
<input name="checkbox" type="checkbox" v-model="showCustomPO" @tap="change(2)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>货号</label>
<input name="checkbox" type="checkbox" v-model="showStyleCode" @click="change(3)">
<input name="checkbox" type="checkbox" v-model="showStyleCode" @tap="change(3)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>颜色</label>
<input name="checkbox" type="checkbox" v-model="showColor" @click="change(4)">
<input name="checkbox" type="checkbox" v-model="showColor" @tap="change(4)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>数量</label>
<input name="checkbox" type="checkbox" v-model="showTotalCount" @click="change(5)">
<input name="checkbox" type="checkbox" v-model="showTotalCount" @tap="change(5)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>单价</label>
<input name="checkbox" type="checkbox" v-model="showPrice" @click="change(6)">
<input name="checkbox" type="checkbox" v-model="showPrice" @tap="change(6)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>金额</label>
<input name="checkbox" type="checkbox" v-model="showTotalMoney" @click="change(7)">
<input name="checkbox" type="checkbox" v-model="showTotalMoney" @tap="change(7)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>裁断配套</label>
<input name="checkbox" type="checkbox" v-model="showMatchDate" @click="change(8)">
<input name="checkbox" type="checkbox" v-model="showMatchDate" @tap="change(8)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>扣件/鞋带</label>
<input name="checkbox" type="checkbox" v-model="showConfirmDate" @click="change(9)">
<input name="checkbox" type="checkbox" v-model="showConfirmDate" @tap="change(9)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>上线计划</label>
<input name="checkbox" type="checkbox" v-model="showZCPlanBeginDate" @click="change(10)">
<input name="checkbox" type="checkbox" v-model="showZCPlanBeginDate" @tap="change(10)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>计划交期</label>
<input name="checkbox" type="checkbox" v-model="showZCPlanDeliveryDate" @click="change(11)">
<input name="checkbox" type="checkbox" v-model="showZCPlanDeliveryDate" @tap="change(11)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>实际上线</label>
<input name="checkbox" type="checkbox" v-model="showPlanDate" @click="change(12)">
<input name="checkbox" type="checkbox" v-model="showPlanDate" @tap="change(12)">
</div>
<div class="mui-input-row mui-checkbox mui-left ">
<label>实际完成</label>
<input name="checkbox" type="checkbox" v-model="showFinishDate" @click="change(13)">
<input name="checkbox" type="checkbox" v-model="showFinishDate" @tap="change(13)">
</div>
</form>
......@@ -204,8 +209,8 @@
<div class="top-btn">
<!-- <span @tap="getDetailData" >发包</span>
<span @tap="revokeData" >撤销</span> -->
<button :disabled="!isAward" type="button" class="mui-btn mui-btn-blue " @tap="getDetailData">发包</button>
<button :disabled="isAward" type="button" class="mui-btn mui-btn-blue " @tap="revokeData">撤销</button>
<button :disabled="isAward" type="button" class="mui-btn mui-btn-blue " @tap="getDetailData">发包</button>
<button :disabled="isAward1" type="button" class="mui-btn mui-btn-blue " @tap="revokeData">撤销</button>
</div>
</div>
</div>
......@@ -268,7 +273,7 @@
</tr>
</tbody>
</table>
<div class="mui-scroll-wrapper " style="top: 36px; width: 100%; height: 460px; background: white;">
<div class="mui-scroll-wrapper " style="top: 36px; width: 100%; height: 370px; background: white;">
<div class="mui-scroll">
<!--这里放置真实显示的DOM内容-->
<div id='list'>
......@@ -293,7 +298,7 @@
<div style="position: absolute; bottom: 1px ; right: 1px; ">
<button type="button" class="mui-btn mui-btn-blue " style=" width: 150px; height: 70px;" @tap="sop">SOP</button>
<button type="button" class="mui-btn mui-btn-blue " style="width:150px;height: 70px; " :disabled="selectPL" @tap="selectPersonAll">批量选员</button>
<button id="submit" type="button" class="mui-btn mui-btn-blue " style=" width: 150px; height: 70px;" @tap="submit">提交</button>
<button id="submit" type="button" class="mui-btn mui-btn-blue " style=" width: 150px; height: 70px;" :disabled="saveChange" @tap="submit">提交</button>
</div>
</div>
</aside>
......@@ -306,7 +311,6 @@
<script src="../dest/js/moment.js"></script>
<script src="../js/mui.pullToRefresh.js"></script>
<script src="../dest/js/mui.picker.min.js"></script>
<script src="../dest/js/mes/NeedleDispatch.js"></script>
</body>
......
......@@ -15,11 +15,11 @@
<div class="need-left">
<div id="left-1">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: white; width: 60px;" @click="back"></a>
<label style=" text-align: center; margin-left: 70px; color: white;">针车配套确认</label>
<label style=" text-align: center; margin-left: 70px; color: white;">{{getTitle}}</label>
</div>
<div class="select">
<div class="mui-input-row mui-search" v-show="!isData">
<div class="mui-input-row mui-search" v-show="!isData&&!isWorkTeam">
<input id="search" class="mui-input-clear search" placeholder="搜索" v-model="searchText" type="search" pattern="\d*"
@keyup.enter="goSearch($event)" @focus.prevent="changePosition()" @blur.prevent="changePosition1()">
</div>
......@@ -28,6 +28,11 @@
<button class="mui-btn-outlined" id="selectdate" data-options='{"type":"date"}' name="shipdate" @click="selecttime()">{{dateTime}}</button>
<button class="mui-icon mui-icon-arrowright mui-btn-outlined " @click="nextday(1)"></button>
</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">
<select v-model="current" @change="changeSearchType">
<option :value="item.id" v-for="item in searchData">{{item.name}}</option>
......@@ -169,7 +174,8 @@
<div id="right-2">
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnConfirm" @click="cutConfirm">面部确认</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnMatch" @click="matched">成型配套确认</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnCheck" @click="submit">{{submitText}}</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnCheck" @click="submit" v-show="submitText == '确认接收'">{{submitText}}</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnCheck1" @click="submit" v-show="submitText == '撤回接收'">{{submitText}}</button>
</div>
</div>
</div>
......
......@@ -15,10 +15,10 @@
<div class="need-left">
<div id="left-1">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: white; width: 60px;" @click="back"></a>
<label style=" text-align: center; margin-left: 70px; color: white;">裁断配套确认</label>
<label style=" text-align: center; margin-left: 70px; color: white;">{{getTitle}}</label>
</div>
<div class="select">
<div class="mui-input-row mui-search" v-show="!isData">
<div class="mui-input-row mui-search" v-show="!isData&&!isWorkTeam">
<input id="search" class="mui-input-clear search" placeholder="搜索" v-model="searchText" type="search" pattern="\d*"
@keyup.enter="goSearch($event)" @focus.prevent="changePosition()" @blur.prevent="changePosition1()">
</div>
......@@ -27,6 +27,11 @@
<button class="mui-btn-outlined" id="selectdate" data-options='{"type":"date"}' name="shipdate" @click="selecttime()">{{dateTime}}</button>
<button class="mui-icon mui-icon-arrowright mui-btn-outlined " @click="nextday(1)"></button>
</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">
<select v-model="current" @change="changeSearchType">
<option :value="item.id" v-for="item in searchData">{{item.name}}</option>
......@@ -167,7 +172,8 @@
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnConfirm" @click="cutConfirm">裁断确认</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnMatch" @click="matched">针车配套</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnCheck" @click="submit">{{submitText}}</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnCheck" @click="submit" v-show="submitText == '确认接收'">{{submitText}}</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="btnCheck1" @click="submit" v-show="submitText == '撤回接收'">{{submitText}}</button>
</div>
</div>
......
......@@ -82,7 +82,7 @@
<div id="left-1" style="background-color: #007AFF; width: 40%; height: 34px; margin-bottom: 0px;">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: white; width: 60px; margin-top: 2px;"
@click="back"></a>
<label style=" text-align: center; margin-left: 70px; color: white; position: relative;top: 7px;">针车排班表 </label>
<label style=" text-align: center; margin-left: 70px; color: white; position: relative;top: 7px;">{{getTitle}} </label>
</div>
<div id="left-2" style="width: 40%">
<div id="left-date" style=" border: solid #B6B6B6 1px; background: #EDF5FA;">
......@@ -233,7 +233,7 @@
<div id="right-2" style="position: absolute; bottom: 1px ; right: 1px; ">
<button type="button" class="mui-btn mui-btn-blue " style=" width: 150px; height: 70px;" @click="sop">SOP</button>
<button type="button" class="mui-btn mui-btn-blue " :disabled="selectPL" style="width:150px;height: 70px; " @click="selectPersonAll">批量选员</button>
<button id="submit" type="button" class="mui-btn mui-btn-blue " style=" width: 150px; height: 70px;" @click="submit">提交</button>
<button id="submit" type="button" class="mui-btn mui-btn-blue " :disabled="selectPL1" style=" width: 150px; height: 70px;" @click="submit">提交</button>
</div>
</div>
</div>
......@@ -280,21 +280,28 @@
searchText: "",
searchPersonList: [],
searchPersonListAfter: [],
getTitle:MenuAction.getTitle('90031'),
},
computed: {
display_: function() {
if (this.displayModel == 1) {
return "display: none "
selectPL1: function() {
if(MenuAction.checkAction('90031','Update')){
return null
}else{
return "disabled"
}
},
selectPL: function() {
if(MenuAction.checkAction('90031','Update')){
if (this.selectif_PL == 0) {
return "disabled"
} else {
return null
}
}else{
return "disabled"
}
},
submit2_: function() {
if (this.searchPersonListAfter.length == 0) {
......
......@@ -26,11 +26,16 @@
pattern="\d*" @keyup.enter="goSearch($event)" @focus.prevent="changePosition()" @blur.prevent="changePosition1()">
</div> -->
<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"
pattern="\d*" @keyup.enter="goSearch($event)" @focus.prevent="changePosition()"
@blur.prevent="changePosition1()">
</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">
<select v-model="current" @change="changeSearchType">
<option :value="item.id" v-for="item in searchData">{{item.name}}</option>
......@@ -127,7 +132,7 @@
</div>
<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="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 id="right-4">
......@@ -160,7 +165,7 @@
<div style=" display: inline-block; width: 38%;">
<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" :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 class="Rcomputed">
<input readonly="readonly" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" v-model="qty" :value="qty"
......
......@@ -43,82 +43,29 @@
transition: background 0.4s ease;
border-radius: 8px;
}
.application-box {
display: none;
[v-cloak] {
display: none !important;
}
/* .application-box {
display: none;
} */
</style>
</head>
<body>
<div class="application" id="lialist">
<div class="application-box" types="90015">
<a ids="1" href="javascript:;">
<div class="application-img"><img src="../dest/img/application/zcsb.png" alt="裁断实报" /></div>
<h3 class="application-tit" title="裁断实报">裁断实报</h3>
<div class="application" id="lialist" v-cloak>
<div class="application-box"
v-for=" (list,index) in items"
:key="list.Code"
v-if="list.isShow"
@click="goNext(list.Code)"
>
<a href="javascript:;">
<div class="application-img"><img :src="'../dest/img/'+list.IcoCode+'.png'" /></div>
<h3 class="application-tit" :title="list.Name">{{list.Name}}</h3>
</a>
</div>
<div class="application-box" types="90016">
<a ids="0" href="javascript:;">
<div class="application-img"><img src="../dest/img/application/zcsb.png" alt="针车实报" /></div>
<h3 class="application-tit" title="针车实报">针车实报</h3>
</a>
</div>
<div class="application-box" types="90017">
<a ids="2" href="javascript:;">
<div class="application-img"><img src="../dest/img/application/zcsb.png" alt="成型实报" /></div>
<h3 class="application-tit" title="成型实报">成型实报</h3>
</a>
</div>
<div class="application-box" types="90032">
<a ids="7" href="javascript:;">
<div class="application-img"><img src="../dest/img/application/zcsb.png" alt="针车实报" /></div>
<h3 class="application-tit" title="针车实报V2">针车实报</h3>
</a>
</div>
<div class="application-box" types="90033">
<a ids="8" href="javascript:;">
<div class="application-img"><img src="../dest/img/application/zcsb.png" alt="成型实报" /></div>
<h3 class="application-tit" title="成型实报V2">成型实报</h3>
</a>
</div>
<div class="application-box" types="90028">
<a ids="4" href="javascript:;">
<div class="application-img"><img src="../dest/img/zc.png" alt="工序交接-针车" /></div>
<h3 class="application-tit" title="工序交接-针车">裁断配套确认</h3>
</a>
</div>
<div class="application-box" types="90029">
<a ids="3" href="javascript:;">
<div class="application-img"><img src="../dest/img/cx.png" alt="工序交接-成型" /></div>
<h3 class="application-tit" title="工序交接-成型">针车配套确认</h3>
</a>
</div>
<div class="application-box" types="90030">
<a ids="5" href="javascript:;">
<div class="application-img"><img src="../dest/img/mywork.png" alt="我的任务" /></div>
<h3 class="application-tit" title="我的任务">我的任务</h3>
</a>
</div>
<div class="application-box" types="90031">
<a ids="6" href="javascript:;">
<div class="application-img"><img src="../dest/img/bp.png" alt="针车排班表" /></div>
<h3 class="application-tit" title="针车排班表">针车排班表</h3>
</a>
</div>
<div class="application-box" types="90037">
<a ids="9" href="javascript:;">
<div class="application-img"><img src="../dest/img/bp.png" alt="针车派工单" /></div>
<h3 class="application-tit" title="针车派工单">针车派工单</h3>
</a>
</div>
<!-- <div class="application-box" types="设置">
<a ids="999" href="javascript:;">
<div class="application-img"><img src="../dest/img/sz.png" alt="设置" /></div>
......@@ -127,6 +74,7 @@
</div> -->
</div>
<script src="../dest/js/mui.min.js"></script>
<script src="../dest/js/vue.min.js"></script>
<script src="../dest/js/createView.min.js"></script>
<script src="../dest/js/underscore.min.js"></script>
<script src="../dest/js/public.min.js"></script>
......@@ -136,56 +84,82 @@
console.log("未登录,不再继续加载Application.html")
} else {
(function($, doc) {
$.plusReady(function() {
plus.navigator.closeSplashscreen()
// plus.screen.lockOrientation("portrait-primary")
plus.screen.lockOrientation("landscape-primary") //横屏
init();
mui.plusReady(function() {
initPage();
});
})(mui, document)
}
var back__first = null;
mui.back = function() {
if (!back__first) {
back__first = new Date().getTime();
mui.toast('再按一次退出应用');
setTimeout(function() {
back__first = null;
}, 2000);
} else {
if (new Date().getTime() - back__first < 2000) {
plus.runtime.quit();
}
}
};
function init() {
function initPage() {
// plus.screen.lockOrientation("landscape-secondary") //横屏
plus.screen.lockOrientation("landscape-primary") //横屏
app.init();
}
var app = new Vue({
el: '#lialist',
data: {
items:[],
extra:[],//下个页面的参数
page:[
{code:'90015',name:'Cutting'},
{code:'90016',name:'Needlecarreport_new'},
{code:'90017',name:'Forming'},
{code:'90032',name:'NeedlecarreportV2'},
{code:'90033',name:'FormingV2'},
{code:'90028',name:'NeedlecarHandover'},
{code:'90029',name:'NeedleMatch'},
{code:'90030',name:'MyWork'},
{code:'90031',name:'NeedlecarPBB'},
{code:'90037',name:'NeedleDispatch'},
],
},
computed: {
},
methods: {
init: function() {
mui.init();
this.getdata();
},
getdata: function() {
var that = this;
var lisy = Dom.getById('lialist');
var isds = lisy.getElementsByClassName('application-box');
var ucond = Dom.getById('centicon');
var pages = ['Needlecarreport_new', 'Cutting', "Forming", "NeedleMatch", "NeedlecarHandover",
"MyWork", "NeedlecarPBB", "NeedlecarreportV2", "FormingV2","NeedleDispatch"
];
//var tits = ['色卡档案', '样品企划', '样品客户意见', '款式图片档案', '下单管理', '生产进度表', '消息提醒', '业务审批', '订货主场','针车实报','设置'];
var lab1 = document.getElementsByTagName("a");
Api.post('/api/User/GetModuleListV2', {}, function(e) {
if (e.success) {
that.items = e.items;
MenuAction.setMenu(that.items);
function onGetDataSuccess(e) {
//console.log("GetModuleList::" + JSON.stringify(e))
var isSuccess = e.success;
if (isSuccess) {
var items = e.items;
//console.log(JSON.stringify(items))
//手动在结尾添加了一个设置项目
// items.push({
// Code: "设置"
// });
console.log(JSON.stringify(items));
for (var i = 0; i < items.length; i++) {
for (var j = 0; j < isds.length; j++) {
if (items[i].Code == isds[j].getAttribute('types')) {
isds[j].style.display = "block";
}
console.log(JSON.stringify(that.items));
for (var i = 0; i < that.items.length; i++) {
for (var j = 0; j < that.page.length; j++) {
if (that.items[i].Code == that.page[j].code) {
that.$set(that.items[i], "isShow", true);
}
}
}
}
function onGetDataFailure(xhr, type, eOrRes) {
}, function(xhr, type, eOrRes) {
console.log("获取登录信息" + eOrRes);
if (eOrRes && eOrRes.hasOwnProperty('code')) {
var code = eOrRes.code;
......@@ -196,83 +170,24 @@
return;
}
}
});
},
goNext:function(code){
var that =this;
for (var j = 0; j < that.page.length; j++) {
if (code == that.page[j].code) {
console.log(code);
Dom.open(that.page[j].name + '.html')
}
//console.log("GetModuleList::begin" )
Api.post('/api/User/GetModuleListV2', {}, onGetDataSuccess, onGetDataFailure);
mui(".application-box").on('tap', 'a', function() {
var index = this.getAttribute('ids');
if (index == 999) {
openSettingWindow()
} else {
Dom.open(pages[index] + '.html')
}
})
mui(".ululkisy").on('tap', 'span', function() {
openSettingWindow()
});
//选项卡点击事件
var subpages = ['message.html', 'application.html', 'ceo-report.html', 'mine.html'];
var activeTab = subpages[1];
mui('.mui-bar-tab').on('tap', 'a', function(e) {
var targetTab = this.getAttribute('href');
if (targetTab == activeTab) {
return;
}
//显示目标选项卡
//若为iOS平台或非首次显示,则直接显示
if (mui.os.ios || aniShow[targetTab]) {
plus.webview.show(targetTab);
} else {
//否则,使用fade-in动画,且保存变量
var temp = {};
temp[targetTab] = "true";
mui.extend(aniShow, temp);
plus.webview.show(targetTab, "fade-in", 300);
}
//隐藏当前;
plus.webview.hide(activeTab);
//更改当前活跃的选项卡
activeTab = targetTab;
});
}
var back__first = null;
mui.back = function() {
},
if (!back__first) {
back__first = new Date().getTime();
mui.toast('再按一次退出应用');
setTimeout(function() {
back__first = null;
}, 2000);
} else {
if (new Date().getTime() - back__first < 2000) {
plus.runtime.quit();
}
}
};
function openSettingWindow() {
var nview = mui.createHeadView({
viewId: 'mine',
backgroundColor: '#1b83fe',
borderColor: '#1b83fe',
titleColor: '#fff',
title: '我的',
fontSize: '18px',
rightIcon: false,
textAlign: 'left'
});
openView({
url: 'mine.html',
id: 'mine',
load: true
}, {}, null, nview);
}
},
})
</script>
</body>
......
var Context = {
__context: null,
/**
* 返回当前用户的TOKEN和配置信息等.
*/
getContext: function() {
if(this.__context != null)
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;
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;
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 (height && height > 0) {
url += '&height=' + height
}
if(rate && rate >0){
url += '&rate=' + rate;
if (rate && rate > 0) {
url += '&rate=' + rate
}
return url;
return url
},
isLogin:function(){
isLogin: function() {
var context = Context.getContext();
return context.token != '';
return context.token != ''
}
}
};
var Dom = {
getById: function(id) {
return document.getElementById(id)
},
clickAOpen:function(el,url,extras){
mui(el).on('tap', 'a', function () {
clickAOpen: function(el, url, extras) {
mui(el).on('tap', 'a', function() {
mui.openWindow({
url:url,
id:url,
extras:extras
});
});
url: url,
id: url,
extras: extras
})
})
},
open(url,extras){
open(url, extras) {
mui.openWindow({
url:url,
id:url,
extras:extras
});
url: url,
id: url,
extras: extras
})
}
}
};
var Api = {
/**
*
* @param {Object} url
* @param {Object} data
* @param {Object} success
* @param {Object} error ,错误处理函数,签名为 function(xhr,status,responseData|error)
*/
post: function(url, data, success, error) {
var context = Context.getContext();
var host = context.host;
var timestamp = (new Date()).valueOf();
data = data || {};
data.token = context.token;
data.timestamp = timestamp;
error = error || this.__defaultErrorHandlder;
Log.log("web request:" + host + url + ' data:' + JSON.stringify(data));
var ts = (new Date()).valueOf();
mui.ajax(host + url, {
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,
timeout: 5000,
headers: {
'Content-Type': 'application/json'
},
crossDomain:true,
crossDomain: true,
success: function(res, type, xhr) {
//console.log('ajax success:'+res);
if(res.success) {
if (res.success) {
success(res)
} else {
error(xhr, type, res)
}
},
error: error
});
})
},
//同POST,多了个显示加载中
postAndWaiting:function(url, data, success, error) {
postAndWaiting: function(url, data, success, error) {
var waitingObj = null;
function showWaiting(){
if(waitingObj){
function showWaiting() {
if (waitingObj) {
waitingObj.close();
waitingObj = null;
waitingObj = null
}
waitingObj = plus.nativeUI.showWaiting( "加载数据中..." );
waitingObj = plus.nativeUI.showWaiting("加载数据中...")
}
function closeWaiting(){
if(waitingObj){
function closeWaiting() {
if (waitingObj) {
waitingObj.close();
waitingObj = null;
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,
timeout: 10000,
headers: {
'Content-Type': 'application/json'
},
success: function(res, type, xhr) {
//console.log('ajax success:'+res);
closeWaiting()
if(res.success) {
closeWaiting();
if (res.success) {
success(res)
} else {
error(xhr, type, res)
}
},
error: function(xhr, type, e){
closeWaiting()
error(xhr,type,e);
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)
console.log(xhr.responseText);
console.log(xhr.responseXML);
console.log('status' + xhr.status);
console.log(xhr.statusText);
var msg = '';
if(e && e.hasOwnProperty('code')) {
if (e && e.hasOwnProperty('code')) {
var code = e.code;
switch(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;
break
}
mui.toast(msg)
mui.toast(msg);
console.log(msg)
} else {
var error_msg = '';
if(status == 'abort'){
error_msg = '网络错误,请检查设备的网络连接.';
}
else{
error_msg = '发生了一个错误';
if (status == 'abort') {
error_msg = '网络错误,请检查设备的网络连接.'
} else {
error_msg = '发生了一个错误'
}
mui.toast(error_msg)
console.log(error_msg)
mui.toast(error_msg);
console.log(error_msg);
console.log(e)
}
}
}//Api
var ArrayUtil ={
/**
* 给数组里的元素添加一个字段
* @param {Object} items 目标数组
* @param {Object} fieldName 要添加的字段名
* @param {Object} defaultValue 默认值
*
* @example ArrayUtil.addField(colors,'Selected',false)
*/
addField:function(items,fieldName,defaultValue){
for(var i=0;i<items.length;i++){
};
var ArrayUtil = {
addField: function(items, fieldName, defaultValue) {
for (var i = 0; i < items.length; i += 1) {
items[i][fieldName] = defaultValue
}
},
/**
* 设置数组里的每个元素的值为 value
* @param {Object} items
* @param {Object} fieldName
* @param {Object} value
*/
setField:function(items,fieldName,value){
for(var i=0;i<items.length;i++){
setField: function(items, fieldName, value) {
for (var i = 0; i < items.length; i += 1) {
items[i][fieldName] = value
}
}
}
var __PRINT_LOG = true
};
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 = {
//用来检查触发的此方法的地方的执行堆栈,主要用来调试.
printStack:function(){
isIos: function() {
var osname = plus.os.name.toLowerCase();
return osname == 'ios'
},
isAndroid: function() {
var osname = plus.os.name.toLowerCase();
return osname == 'android'
}
};
var MenuAction = { //这个哪里调
_menu: [],
setMenu: function(val) { //这个函数哪里调
MenuAction._menu = val;
//console.log("0000000000000000000000000000:" + MenuAction._menu.length); //37
window.localStorage.setItem("MenuList", JSON.stringify(MenuAction._menu));
if(__PRINT_LOG){
try{
throw new Error("print Statck");
}catch(ex){
},
checkAction: function(code, action) {
var res = false;
var _menu = JSON.parse(localStorage.getItem('MenuList'));
//console.log("222222222222:" + _menu.length);
if (!_menu || _menu.length == 0) {
return false;
} else {
for (var i = 0; i < _menu.length; i++) {
if (_menu[i].Code == code) {
if (_menu[i].Action.indexOf(action) > -1) {
res = true;
return res;
}
}
console.log(ex.stack);
}
}
return res;
},
log:function(val){
if(__PRINT_LOG){
console.log(val)
}
getTitle: function(code) {
var title = '';
var _menu = JSON.parse(localStorage.getItem('MenuList'));
console.log("222222222222:" + _menu.length);
for (var i = 0; i < _menu.length; i++) {
if (_menu[i].Code == code) {
title = _menu[i].Name;
console.log(title);
}
}
}
var Sys = {
isIos:function(){
var osname = plus.os.name.toLowerCase();
return osname == 'ios'
return title;
},
isAndroid:function(){
var osname = plus.os.name.toLowerCase();
return osname == 'android';
}
}
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;b=b||{},b.token=e.token,d=d||this.__defaultErrorHandlder,Log.log("web request:"+f+a+" data:"+JSON.stringify(b)),mui.ajax(f+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++)a[d][b]=c},setField:function(a,b,c){for(var d=0;d<a.length;d++)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}};
\ No newline at end of file
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}};
\ No newline at end of file
{
"@platforms" : [ "android", "iPhone", "iPad" ],
"id" : "H544710A8T", /*应用的标识,创建应用时自动生成,勿手动修改*/
"name" : "飞天兔MES_test", /*应用名称,程序桌面图标名称*/
"id" : "H544710A8", /*应用的标识,创建应用时自动生成,勿手动修改*/
"name" : "飞天兔MES", /*应用名称,程序桌面图标名称*/
"version" : {
"name" : "1.0.1.16", /*应用版本名称*/
"name" : "1.0.1.21", /*应用版本名称*/
"code" : 338
},
"description" : "飞天兔MES平板版", /*应用描述信息*/
......
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