Commit 7a8a27d5 authored by 王文琼's avatar 王文琼

修改密码,已完成等按钮,针车配套确认

parent 7b03ff0c
.mui-bar-nav {
background-color: #fff;
box-shadow: inherit;
}
.changeList{
margin-top: 15px;
}
.mui-input-group:before {
height: 0;
}
.mui-input-group:after{
height: 0;
}
.edit-padded{
padding: 70px 40px 38px;
height: 150px !important;
}
.edit-padded .mui-btn {
padding: 6px 12px;
background-color: #289be5;
border-color: #289be5;
}
mui.plusReady(function() {
initPage();
});
function initPage() {
// plus.screen.lockOrientation("landscape-secondary") //横屏
plus.screen.lockOrientation("landscape-primary") //横屏
app.init();
}
var app = new Vue({
el: '#app',
data: {
displayModel: 1,
IndexID: 0,
itemsLeft: [],
itemsLeft2: [], //已交接
itemsDetail: {},
submitModel: 0,
submitText: "确认接收",
nextDetail: {},
searchText: '', //搜索文本
completeState: true, ////切换已交接和未交接状态
paramUnDo: { //未交接
ReportType: 2, //成型
pageIndex: 2,
State: 0, //未交接
pageSize: 10
},
paramDone: { //已交接
ReportType: 2, //成型
pageIndex: 2,
State: 1, //已交接
pageSize: 10
},
paramUnDoSeach: { //未交接
ReportType: 2, //成型
pageIndex: 2,
State: 0, //未交接
pageSize: 10
},
paramDoneSeach: { //已交接
ReportType: 2, //成型
pageIndex: 2,
State: 1, //已交接
pageSize: 10
},
ReportType: 2,
cur: '0',
currentObj: -1,
listType: 0, // 0 未交接 1已交接
},
computed: {
display_: function() {
if (this.displayModel == 1) {
return "display: none "
}
},
btnMatch: function() {
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur]
.IsMatch : "disabled";
},
btnConfirm: function() {
return (this.listType && "disabled") || this.currentObj == -1 ? "disabled" : this.itemsLeft && this.itemsLeft.length >
0 ? this.itemsLeft[this.cur]
.IsConfirm : "disabled";
},
btnCheck: function() {
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";
}
},
},
methods: {
init: function() {
mui.init({
pullRefresh: {
container: '#pullrefresh',
up: {
height: 100,
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了',
callback: function() {
var reUnfinished = document.getElementById("item1").getAttribute("state");
var reFinished = document.getElementById("item2").getAttribute("state");
//console.log("未交接" + reUnfinished);
//console.log("已交接" + reFinished);
var needUrl = '/api/vMES/Handover/List';
var searchUrl = '/api/vMES/Handover/Search';
var searchUrlDone = '/api/vMES/Handover/SearchDone';
var UnneedData = app.itemsLeft;
var needData = app.itemsLeft2;
if (reUnfinished) {
if (app.searchText != "") {
searchPull(searchUrl, UnneedData, app.paramUnDoSeach);
console.log("未交接搜索:" + JSON.stringify(app.paramUnDoSeach));
} else {
console.log("未交接22:" + JSON.stringify(app.paramUnDo));
pullupRefresh(needUrl, UnneedData, app.paramUnDo);
}
} else if (reFinished) {
if (app.searchText != "") {
searchPull(searchUrlDone, needData, app.paramDoneSeach);
console.log("getData:已交接搜索:" + JSON.stringify(app.paramDoneSeach));
} else {
pullupRefresh(needUrl, needData, app.paramDone);
console.log("getData:已交接22:" + JSON.stringify(app.paramDone));
}
}
}
},
}
});
function pullupRefresh(url, arr, params) {
//console.log("加载前1" + arr);
setTimeout(function() {
var para = {
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
State: params.State
};
//console.log("canshu:" + JSON.stringify(para));
//console.log("之前的数据:" + arr);
Api.post(url, para, function(e) {
if (e.success) {
//console.log("111:" + JSON.stringify(e.items));
var data = e.items;
if (e.items.length > 0) {
params.pageIndex++;
}
for (var i = 0; i < data.length; i++) {
arr.push(data[i]);
}
//console.log("之后的arr" + arr);
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
mui('#pullrefresh').pullRefresh().endPullupToRefresh(); //参数为true代表没有更多数据了。
mui('#pullrefresh').pullRefresh().refresh(true);
//mui('#pullrefresh').pullRefresh().disablePullupToRefresh();
}, 1000);
}
function searchPull(url, arr, params) {
setTimeout(function() {
var para = {
SearchText: app.searchText,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType
};
Api.post(url, para, function(e) {
console.log("canshu:" + JSON.stringify(para));
if (e.success) {
//console.log("搜索到的111:" + JSON.stringify(e));
var data = e.items;
if (e.items.length > 0) {
params.pageIndex++;
}
for (var i = 0; i < data.length; i++) {
arr.push(data[i]);
}
//console.log("canshuqq:" + JSON.stringify(para));
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
mui('#pullrefresh').pullRefresh().endPullupToRefresh();
mui('#pullrefresh').pullRefresh().refresh(true);
}, 1000);
}
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.getData(0);
mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘
app.searchText = '';
app.getData(0);
});
},
getData: function(n) {
var that = this;
var para = {
ReportType: this.ReportType,
State: n,
PageSize: 20,
PageIndex: 1
}
// console.log(JSON.stringify(para));
that.searchText = '';
Api.post('/api/vMES/Handover/List', para, function(e) {
//console.log("TTTTTTTTTTTTTTTTTT List::" + JSON.stringify(para))
if (n == 0) {
if (e.items.length > 0) {
that.itemsLeft = e.items;
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
console.log("getData:未交接:" + JSON.stringify(that.itemsLeft));
} else {
that.itemsLeft = []
that.itemsDetail = [];
}
that.cur = 0;
} else {
that.cur = 0;
if (e.items.length > 0) {
that.itemsLeft2 = e.items;
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
console.log("getData:已交接:" + JSON.stringify(that.itemsLeft2));
} else {
that.itemsLeft2 = [];
that.itemsDetail = [];
}
}
if (para.PageIndex == 1) that.currentObj = e.items && e.items.length > 0 ? 0 : -1;
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
})
},
// selectPerson: function() {
// var that = this;
// mui.openWindow({
// url: 'NeedlecarPBB.html',
// id: 'NeedlecarPBB.html',
// extras: {
// nextDetail: that.nextDetail
// }
// });
// },
selectLeft: function(obj, n) {
this.IndexID = obj.IndexID;
//this.nextDetail = obj;
this.cur = n;
var that = this;
that.currentObj = n;
var para = {
ReportType: this.ReportType,
IndexID: this.IndexID,
}
Api.post('/api/vMES/Handover/Index', para, function(e) {
console.log("Indexddddd111::" + JSON.stringify(e.data) + "当前索引:" + that.cur + ":" + that.currentObj)
if (e.success) {
that.itemsDetail = e.data;
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
goSearch: function(event) {
var that = this;
var para = {
ReportType: this.ReportType,
SearchText: that.searchText,
PageSize: 10,
PageIndex: 1
};
//console.log("搜索文本:" + JSON.stringify(para));
if (event.keyCode == "13") {
document.activeElement.blur(); //收起虚拟键盘
if (that.searchText == '') return;
if (that.completeState) {
Api.post('/api/vMES/Handover/Search', para, function(e) {
//console.log("eee::" + JSON.stringify(e))
if (e.success) {
var data = e.items.length;
console.log("搜索未完成::" + e.items.length)
if (data > 0) {
that.itemsLeft = e.items;
that.itemsDetail = e.items[0];
that.cur = 0;
} else {
that.itemsLeft = [];
that.itemsDetail = [];
that.cur = 0;
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
} else {
Api.post('/api/vMES/Handover/SearchDone', para, function(e) {
//console.log("eee::" + JSON.stringify(e))
if (e.success) {
var data = e.items.length;
console.log("搜索已完成::" + e.items.length)
if (data > 0) {
that.itemsLeft2 = e.items;
that.itemsDetail = e.items[0];
that.cur = 0;
} else {
that.itemsLeft2 = [];
that.itemsDetail = [];
that.cur = 0;
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
}
event.preventDefault(); // 阻止默认事件---阻止页面刷新
//that.searchText = '';
}
},
selectDisplay: function(n) {
this.listType = n;
var opt = document.getElementById("item1");
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";
n2.style.background = n ? "royalblue" : "white";
n2.style.color = n ? "white" : "royalblue";
opt.style.display = n ? "none" : "block";
opt2.style.display = n ? "block" : "none";
this.submitModel = n ? 1 : 0;
this.submitText = n ? "撤回接收" : "确认接收";
this.getData(n);
},
matched: function() {
var that = this;
var para = {
IndexID: this.IndexID
}
console.log("111111111:" + this.IndexID);
Api.post('/api/vMES/Handover/Match', para, function(e) {
if (e.success) {
mui.toast("配套成功! ");
//that.getData(0);
console.log(JSON.stringify(e.data))
playVoice("cg.mp3");
console.log("配套suoyi:" + that.cur);
that.itemsDetail.MatchUserName = e.data.MatchUserName;
that.itemsDetail.MatchDate = e.data.MatchDate;
that.itemsLeft[that.cur].IsMatch = true;
console.log("suoyin22:" + that.btnMatch + " : " + that.cur);
} else {
mui.toast("配套失败: " + e.message);
playVoice("sb.mp3");
console.log(e.message);
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
})
},
cutConfirm: function() {
var that = this;
var para = {
IndexID: this.IndexID
}
console.log("2222:" + this.IndexID);
Api.post('/api/vMES/Handover/Confirm', para, function(e) {
if (e.success) {
mui.toast("确认成功! ");
//that.getData(0);
playVoice("cg.mp3");
console.log("裁断确认索引:" + that.cur);
console.log(JSON.stringify(e.data.ConfirmDate));
that.itemsDetail.ConfirmUserName = e.data.ConfirmUserName;
that.itemsDetail.ConfirmDate = e.data.ConfirmDate;
that.itemsLeft[that.cur].IsConfirm = true;
console.log("suoyin22:" + that.itemsLeft.length + "::" + that.itemsLeft[that.cur].IsConfirm + " : " + that.cur);
} else {
mui.toast("确认失败: " + e.message);
playVoice("sb.mp3");
console.log(e.message);
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
})
},
submit: function() {
var that = this;
var para = {
IndexID: this.IndexID,
}
console.log(JSON.stringify(para))
var html = '';
if (this.submitModel == 1) {
html = '/api/vMES/Handover/UnCheck';
} else {
html = '/api/vMES/Handover/Check'
}
Api.post(html, para, function(e) {
if (e.success) {
//that.selectLeftBack(0);
//that.IndexID = 0;
//that.nextDetail = {};
//that.itemsDetail = [];
if (html == '/api/vMES/Handover/Check') {
var ReceiveArr = that.itemsLeft;
console.log("长度111111111:" + JSON.stringify(ReceiveArr[ReceiveArr.length - 1]) + ":::" + ReceiveArr[
ReceiveArr.length - 1].IsConfirm + that.cur + ":::" + that.currentObj);
refresh(ReceiveArr);
} else {
var UnReceiveArr = that.itemsLeft2;
refresh(UnReceiveArr);
console.log("长度22222222:" + JSON.stringify(UnReceiveArr[UnReceiveArr.length - 1]));
}
function refresh(leftArr) {
var delIndexNoIndx = -1;
for (var i = 0; i < leftArr.length; i++) {
if (leftArr[i].IndexID == para.IndexID) {
delIndexNoIndx = i;
}
}
leftArr.splice(delIndexNoIndx, 1);
//console.log("删除后的数据:" + JSON.stringify(leftArr));
if (leftArr.length > 0) {
if (leftArr.length - 1 > delIndexNoIndx) {
that.cur = delIndexNoIndx;
that.itemsDetail = leftArr[delIndexNoIndx];
that.IndexID = leftArr[delIndexNoIndx].IndexID;
console.log("ssss之后:" + that.IndexID);
} else {
that.cur = leftArr.length - 1;
that.itemsDetail = leftArr[leftArr.length - 1];
that.IndexID = leftArr[leftArr.length - 1].IndexID;
}
that.selectLeft(that.itemsDetail,that.cur);
}
}
playVoice("cg.mp3");
mui.toast("操作成功");
} else {
playVoice("sb.mp3");
mui.toast("操作失败: " + e.message);
}
}, function(xhr, type, res) {
playVoice("sb.mp3");
mui.toast("操作失败" + JSON.stringify(res.message))
})
},
back: function() {
mui.back();
},
changePosition: function() {
var btn1 = document.getElementById("changePosition");
var btn2 = document.getElementById("right-2");
var Height = document.documentElement.clientHeight || document.body.clientHeight;
//console.log("得到焦点。。。。" + Height);
window.onresize = function() {
var Height1 = document.documentElement.clientHeight || document.body.clientHeight;
//console.log("得到焦点。。。。" + Height1);
if (Height > Height1) {
btn1.style.display = "none";
btn2.style.display = "none";
} else {
btn1.style.display = "block";
btn2.style.display = "block";
}
}
},
changePosition1: function() {
var btn1 = document.getElementById("changePosition");
var btn2 = document.getElementById("right-2");
var Height = document.documentElement.clientHeight || document.body.clientHeight;
window.onresize = function() {
var Height1 = document.documentElement.clientHeight || document.body.clientHeight;
if (Height < Height1) {
btn1.style.display = "block";
btn2.style.display = "block";
} else {
btn1.style.display = "none";
btn2.style.display = "none";
}
}
}
},
})
mui.plusReady(function() {
// plus.nativeUI.closeWaiting();
plus.nativeUI.showWaiting()
// mui.currentWebview.show();
initPage();
});
function initPage() {
plus.screen.lockOrientation("landscape-primary") //横屏
app.init();
}
var app = new Vue({
el: '#app',
data: {
number: 0,
qty: 0,
size: 0,
dateTime: "",
today: "",
link: "",
itemsDetail: [], //订单明细
itemsDetail1: [], //
itemsDetail2: [], //
paramUnDo: {
pageIndex: 2,
pageSize: 10
},
paramDone: {
pageIndex: 2,
pageSize: 10
},
paramUnDoSeach: {
pageIndex: 2,
pageSize: 10
},
paramDoneSeach: {
pageIndex: 2,
pageSize: 10
},
itemsHead: [], //未完成和搜索左侧数组
itemsLeft: [],
itemsLeft2: [], //已完成左侧数组
itemsSize: [],
SizeQty: [],
ReportType: 0,
IndexID: 0,
rightInfor: [], //右侧详情
cur: 0, //点击选中当前状态
completeState: true, //切换已完成和未完成状态
searchText: '', //搜索框输入的内容
datalen: 20, //默认取数据数量
reDatalen: 10, //每次加载的数据数量
isAlert: false,
disable_reportDelete: 'disabled',
disable_qq: 'disabled',
ReportID: 0,
// Report_IndexID: 0,
Model: 0,
CompleteRatio: 0, //完成进度
unPagenum: 1, //未完成页数
pagenum: 1, //已完成页数
displayModel: 1,
zhezhao: 1, //
mask_: mui.createMask(function(e) {
return false;
}),
appdis: 0,
},
computed: {
disable_save_button_C: function() {
if (this.size != 0 && this.qty != 0 && this.IndexID != 0 && this.Model == 0) {
return null;
} else {
return 'disabled';
}
},
display_: function() {
if (this.displayModel == 1) {
return "display: none "
}
},
SOP__: function() {
if (this.IndexID == 0) {
return "disabled"
} else {
return null
}
},
},
// mounted:function(){
// this.$nextTick(function(){
// mui('#progress .mui-text-center').each(function() {
// console.log(this.getAttribute("data-progress"));
// mui(this).progressbar({progress:this.getAttribute("data-progress")}).show()
// })
// })
// },
methods: {
init: function() { //初始化
mui.init({
pullRefresh: {
container: '#pullrefresh',
up: {
height: 100,
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了',
callback: function() {
var reUnfinished = document.getElementById("theOne").getAttribute("state");
var reFinished = document.getElementById("theTow").getAttribute("state");
var UnfinishedUrl = '/api/vMES/CutOffProductionReport/ToDo';
var FinishedUrl = '/api/vMES/CutOffProductionReport/Done';
var searchUrl = '/api/vMES/CutOffProductionReport/Search';
var searchDoneUrl = '/api/vMES/CutOffProductionReport/SearchDone';
//console.log("未完成" + reUnfinished)
//console.log("已完成" + reFinished)
var UnfinishedData = app.itemsHead;
var FinishedUrlData = app.itemsLeft2;
if (reUnfinished) {//未完成
if (app.searchText != "") {
searchPull(searchUrl, UnfinishedData, app.paramUnDoSeach);
}else{
pullupRefresh(UnfinishedUrl, UnfinishedData, app.paramUnDo);
}
} else if (reFinished) {//已完成
if (app.searchText != "") {
searchPull(searchDoneUrl, FinishedUrlData, app.paramDoneSeach);
}else{
pullupRefresh(FinishedUrl, FinishedUrlData, app.paramDone);
}
}
}
},
}
});
function pullupRefresh(url, arr, params) {
//console.log("加载前1" + arr);
setTimeout(function() {
var para = {
PageSize: params.pageSize,
PageIndex: params.pageIndex
};
//console.log("canshu:" + JSON.stringify(para));
//console.log("之前的数据:" + arr);
Api.post(url, para, function(e) { //2.没数据 提示 但是可以一直发请求只不过传回来是空
if (e.success) {
//console.log("111:" + JSON.stringify(e.items));
var data = e.items;
if (e.items.length > 0) {
params.pageIndex++;
}
for (var i = 0; i < data.length; i++) {
arr.push(data[i]);
console.log("changdu2222222:"+arr.length);
}
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
mui('#pullrefresh').pullRefresh().endPullupToRefresh(); //参数为true代表没有更多数据了。
mui('#pullrefresh').pullRefresh().refresh(true);
//mui('#pullrefresh').pullRefresh().disablePullupToRefresh();
}, 1000);
}
function searchPull(url, arr, params) {
setTimeout(function() {
var para = {
searchText: app.searchText,
PageSize: params.pageSize,
PageIndex: params.pageIndex
};
Api.post(url, para, function(e) {
if (e.success) {
//console.log("111:" + JSON.stringify(e.items));
var data = e.items;
if (e.items.length > 0) {
params.pageIndex++;
}
for (var i = 0; i < data.length; i++) {
arr.push(data[i]);
}
//console.log("canshuqq:" + JSON.stringify(para));
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
mui('#pullrefresh').pullRefresh().endPullupToRefresh();
mui('#pullrefresh').pullRefresh().refresh(true);
}, 1000);
}
window.addEventListener('back', function(e) {
var that = this;
app.getData();
app.ChangeState(1);
});
mui(".mui-icon-clear")[0].addEventListener('tap', function() {
document.activeElement.blur(); //收起虚拟键盘
app.searchText = '';
app.completeState ? app.ChangeState(1) :app.ChangeState(2);
//console.log('1111');
});
setTimeout(function() {
plus.nativeUI.closeWaiting();
var ap = document.getElementById("app");
ap.style = " display: inline-block";
}, 200)
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
});
this.dateTime = moment().format().substring(0, 10)
this.today = this.dateTime;
this.getData();
},
getData: function() {
var that = this;
this.createZhezhao(-1)
var para = {
PageSize: that.datalen,
PageIndex: that.unPagenum
};
//console.log("lalla" + JSON.stringify(para));
that.cur = 0;
Api.post('/api/vMES/CutOffProductionReport/ToDo', para, function(e) {
console.log("one :::;" +JSON.stringify(e.items.length))
console.log("getData:" + JSON.stringify(e.items[0]))
//console.log("点击之前"+JSON.stringify(that.rightInfor))
if (e.items.length > 0) {
that.itemsHead = e.items;
that.rightInfor = e.items[0];
that.itemsDetail = e.items[0];
that.IndexID = e.items[0].IndexID;
//that.ChangeState(1);
that.getTatolNum();
that.qty = 0;
that.disable_reportDelete = 'disabled';
} else {
that.itemsHead = [];
that.rightInfor = [];
that.itemsDetail = [];
that.IndexID = 0;
that.itemsDetail1 = [];
that.itemsSize = [];
that.size = 0;
that.itemsLeft = [];
that.number = 0;
that.qty = 0;
that.disable_reportDelete = 'disabled'
//that.ChangeState(1);
that.getTatolNum();
}
}, function(xhr, type, res) {
//console.log(bbb);
mui.toast(JSON.stringify(res.message))
});
},
getDetailInfor: function(idInfor, index) { //获取实报详细 未完成,已完成的的尺码明细信息
this.IndexID = idInfor;
var that = this;
that.cur = index;
//that.searchText = '';
var para = {
"IndexID": idInfor
};
that.ReportID = idInfor;
Api.post('/api/vMES/CutOffProductionReport/Detail', para, function(e) {
if (e.success) {
that.rightInfor = e.data;
console.log("点击之后" + JSON.stringify(that.rightInfor))
that.itemsDetail = e.data;
// that.itemsSize = e.data.SizeName;
// console.log(JSON.stringify(that.itemsSize))
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
selectDisplay: function(n) {
//console.log("selectDisplay:" + n)
this.ChangeState(n); //n=1 未完成 ,2已完成
n == 1 ? this.completeState = true : this.completeState = false;
},
ChangeState: function(n) { //改变状态,切换已完成和未完成
//n= 1 未完成 n=2 已完成
var that = this;
// console.log(JSON.stringify(para))
if (n == 1) {
var para = {
PageSize: that.datalen,
PageIndex: that.unPagenum
};
that.searchText = '';
that.disable_reportDelete = "disabled";
Api.post('/api/vMES/CutOffProductionReport/ToDo', para, function(e) {
that.cur = 0;
if (e.items.length > 0) {
that.itemsHead = e.items;
that.rightInfor = e.items[0];
that.itemsDetail = e.items[0];
console.log("weiwancheng111"+JSON.stringify(that.itemsHead));
that.IndexID = that.itemsHead[0].IndexID;
} else {
that.itemsHead = [];
that.rightInfor = [];
that.itemsDetail = [];
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
} else if (n == 2) {
var para = {
PageSize: that.datalen,
PageIndex: that.pagenum
};
//console.log("do para " + JSON.stringify(para))
that.disable_reportDelete = null;
that.searchText = '';
Api.post('/api/vMES/CutOffProductionReport/Done', para, function(e) {
console.log("已完成" + JSON.stringify(para))
var data = e.items.length;
if (data > 0) {
that.itemsLeft2 = e.items;
that.rightInfor = e.items[0];
that.cur = 0;
that.itemsDetail = e.items[0];
that.IndexID = that.itemsLeft2[0].IndexID;
} else {
that.rightInfor = [];
that.itemsLeft2 = [];
that.itemsDetail = [];
that.cur = 0;
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
}
},
goSearch: function(event) {
var that = this;
var para = {
SearchText: that.searchText,
PageSize: 20,
PageIndex: that.pagenum,
};
if (event.keyCode == "13") {
document.activeElement.blur(); //收起虚拟键盘
if (that.searchText == '') return;
if(this.completeState){//true 是未完成的搜索 false是已完成的搜索
Api.post('/api/vMES/CutOffProductionReport/Search', para, function(e) {
console.log("现在是未完成的搜索!");
var data = e.items.length;
if (data > 0) {
that.itemsHead = e.items;
console.log("未完成的搜索111"+JSON.stringify(that.itemsHead));
that.rightInfor = e.items[0];
that.itemsDetail = e.items[0];
that.cur = 0;
} else {
that.itemsHead = [];
that.rightInfor = [];
that.itemsDetail = [];
that.cur = 0;
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
}else{
Api.post('/api/vMES/CutOffProductionReport/SearchDone', para, function(e) {
console.log("现在是以111111完成的搜索!");
var data = e.items.length;
if (data > 0) {
that.itemsLeft2 = e.items;
that.rightInfor = e.items[0];
that.itemsDetail = e.items[0];
that.cur = 0;
} else {
that.itemsLeft2 = [];
that.rightInfor = [];
that.itemsDetail = [];
that.cur = 0;
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
}
event.preventDefault(); // 阻止默认事件---阻止页面刷新
//that.searchText = '';
}
},
getTatolNum: function() { //今日产量
var that = this;
var para = {
ReportType: this.ReportType,
Date: this.dateTime + " 00:00:00",
};
Api.post('/api/vMES/ProductionReport/TotalQty', para, function(e) {
if (e.success) {
that.number = e.data;
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
//完成进度
getCompleteRatio: function(n) {
var that = this;
var para = {
IndexID: n
};
if (n == 0) {
return;
}
// console.log(JSON.stringify(para))
Api.post('/api/vMES/ProductionReport/IndexNoCompleteRatio', para, function(e) {
that.CompleteRatio = e.data;
// console.log(JSON.stringify(e))
for (var i = 0; i < that.itemsHead.length; i++) {
if (that.itemsHead[i].IndexID == n) {
that.itemsHead[i].CompleteRatio = that.CompleteRatio;
// console.log(that.CompleteRatio);
}
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
reportDelete: function() { //
var that = this;
var para = {
ReportID: this.IndexID,
};
console.log(JSON.stringify(para)); //如果列表为空,弹出提示没有可以撤回的时报
Api.post('/api/vMES/ProductionReport/Delete', para, function(e) {
if (e.success) {
//console.log(JSON.stringify(e));
that.createZhezhao(-1)
that.size = 0;
that.qty = 0;
//that.getCompleteRatio(that.Report_IndexID); //订单进度
that.selectSize(0);
that.getTatolNum(); //获取今日完成数量
that.Model = 0;
mui.toast("撤回成功");
console.log("删除的id:" + JSON.stringify(para));
var doneIndexArr = that.itemsLeft2;
var delIndexNoIndx = -1;
for (var i = 0; i < doneIndexArr.length; i++) {
//console.log("比对的id:" + doneIndexArr[i].IndexID);
if (doneIndexArr[i].IndexID == para.ReportID) {
delIndexNoIndx = i;
break;
}
}
doneIndexArr.splice(delIndexNoIndx, 1);
if (doneIndexArr.length > 0) {
if (doneIndexArr.length - 1 >= delIndexNoIndx) {
that.cur = delIndexNoIndx;
that.rightInfor = doneIndexArr[delIndexNoIndx];
that.itemsDetail = doneIndexArr[delIndexNoIndx];
that.IndexID = doneIndexArr[delIndexNoIndx].IndexID;
} else {
that.cur = doneIndexArr.length;
that.rightInfor = doneIndexArr[delIndexNoIndx - 1];
that.itemsDetail = doneIndexArr[delIndexNoIndx - 1];
that.IndexID = doneIndexArr[doneIndexArr.length].IndexID;
}
}
} else {
mui.toast("撤回失败" + e.message)
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
getLink: function() {
var that = this;
var para = {
ReportType: this.ReportType,
StyleCode: this.itemsDetail.StyleCode
}
console.log(JSON.stringify(para))
Api.post('/api/vMES/Sop/StyleSop', para, function(e) {
if (e.success) {
// console.log( JSON.stringify(e))
that.link = e.data.Url;
var url_ = "sop.html";
var id_ = "sop.html";
mui.openWindow({
url: url_,
id: id_,
extras: {
style: that.itemsDetail.StyleCode,
ReportType: that.ReportType,
link: that.link,
parentPage: "Cutting.html"
},
});
} else {
mui.toast("获取sop地址失败: " + e.message)
}
}, function(xhr, type, res) {
mui.toast(JSON.stringify(res.message))
});
},
SizeQtyA: function() {
for (var i = 0; i < this.itemsSize.length; i++) {
var tempa = {
size: this.itemsSize[i],
qty: 0
}
this.SizeQty.push(tempa);
}
},
submit: function() {
if (!this.checkValue()) {
playVoice("sb.mp3");
return;
}
var para = {
IndexID: this.IndexID,
SizeName: this.size,
Qty: this.qty,
}
var that = this;
Api.post('/api/vMES/ProductionReport/Save', para, function(e) {
if (e.success) {
// that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
//that.getDataDetail1(); //获取列表尺码对应数量
that.getTatolNum(); //获取今日完成数量
that.getCompleteRatio(that.IndexID) //订单进度
playVoice("cg.mp3");
that.getDetailInfor(that.IndexID, that.cur)
mui.toast("提交成功");
} else {
mui.toast("提交失败: " + e.message);
}
}, function(xhr, type, res) {
playVoice("sb.mp3");
mui.toast(JSON.stringify(res.message))
});
},
sureSubmit: function(num) {
console.log("num:" + num);
if (num == "0") {
var that = this;
var para = {
ReportType: this.ReportType,
IndexID: that.IndexID,
}
console.log(JSON.stringify(that.rightInfor));
// console.log(JSON.stringify(para));
Api.post('/api/vMES/ProductionReport/SingleComplete', para, function(e) {
if (e.success) {
// that.disable_save_button = 'disabled'
that.size = 0;
that.qty = 0;
that.selectSize(0);
that.getTatolNum(); //获取今日完成数量
//that.ChangeState(1);
//that.getCompleteRatio(that.IndexID) //订单进度
playVoice("cg.mp3");
mui.toast("提交成功");
var todoIndexArr = that.itemsHead;
var delIndexNoIndx = -1;
for (var i = 0; i < todoIndexArr.length; i++) {
if (todoIndexArr[i].IndexID == para.IndexID)
delIndexNoIndx = i;
}
todoIndexArr.splice(delIndexNoIndx, 1);
if (todoIndexArr.length > 0) {
if (todoIndexArr.length - 1 >= delIndexNoIndx) {
that.cur = delIndexNoIndx;
that.rightInfor = todoIndexArr[delIndexNoIndx];
that.itemsDetail = todoIndexArr[delIndexNoIndx]
that.IndexID = todoIndexArr[delIndexNoIndx].IndexID;
} else {
that.cur = todoIndexArr.length;
that.rightInfor = todoIndexArr[delIndexNoIndx - 1];
that.itemsDetail = todoIndexArr[delIndexNoIndx - 1];
that.IndexID = todoIndexArr[todoIndexArr.length].IndexID;
}
}
} else {
mui.toast("提交失败: " + e.message);
}
}, function(xhr, type, res) {
playVoice("sb.mp3");
mui.toast(JSON.stringify(res.message))
});
that.isAlert = false;
} else {
this.isAlert = false;
return;
}
},
submitZD: function() {
this.isAlert = true;
},
selectIndex: function(idx) {
this.createZhezhao(-1) //关闭遮罩
var indxx = document.getElementsByClassName("Index");
var indx = document.getElementById("Index_" + idx)
for (var i = 0; i < indxx.length; i++) {
indxx[i].style.background = "";
}
indx.style.background = "#02C1ED";
this.IndexID = idx
this.Model = 0
if (this.IndexID != 0) {
that.ChangeState(1);
that.ChangeState(2);
this.getTatolNum();
this.selectSize(0);
//this.selectReport(0);
this.qty = 0;
this.size = 0;
//this.disable_reportDelete = 'disabled';
} else {
this.itemsDetail = [];
this.IndexID = 0;
this.itemsDetail1 = [];
this.itemsSize = [];
this.size = 0;
this.itemsLeft = [];
this.number = 0;
this.qty = 0;
//this.disable_reportDelete = 'disabled'
}
mui('.scroll1').scroll().scrollTo(0, 0, 100);
mui('.scroll2').scroll().scrollTo(0, 0, 100);
// mui('.scroll3').scroll().scrollTo(0,0,100);
mui('.scroll4').scroll().scrollTo(0, 0, 100);
},
createZhezhao: function(n) {
// console.log(n)
if (n == -1) {
// var mask = mui.createMask();//callback为用户点击蒙版时自动执行的回调;
// this.mask_.close();
this.mask_._remove()
this.zhezhao = 1;
} else {
if (this.zhezhao == 1) {
this.mask_.show(); //显示遮罩
this.zhezhao = 2
// mask.close();//关闭遮罩
}
}
},
changeValue: function() {
if (isNaN(parseInt(this.qty))) {
this.qty = 0;
// this.disable_save_button = 'disabled';
}
if (parseInt(this.qty) > 0) {
this.qty = parseInt(this.qty);
// this.disable_save_button = null;
}
},
checkValue: function() {
//数量不正确
if (isNaN(parseInt(this.qty)) || parseInt(this.qty) <= 0) {
mui.toast("数量不正确")
return false;
}
//尺码不正确
else if (this.size == 0) {
mui.toast("尺码不正确")
return false;
} else if (this.IndexID == 0) {
mui.toast("订单号不正确")
return false;
} else {
return true;
}
},
backNumber: function() {
if (this.Model == 1) {
return;
}
var str = this.qty.toString();
this.qty = str.substring(0, str.length - 1);
},
selectNumber: function(n) {
if (this.Model == 1) {
return;
}
this.qty = this.qty.toString() + n.toString();
// this.qty = isNaN(parseInt(this.qty)) ? 0 + parseInt(n) : parseInt(this.qty) + parseInt(n);
},
selectSize: function(n) {
var bg = document.getElementsByClassName("bg");
for (var i = 0; i < bg.length; i++) {
bg[i].style.background = ""
if (bg[i].innerHTML == n) {
bg[i].style.background = "#02C1ED"
}
}
if (n != 0) {
this.size = n;
// bg[0].style.background = "#02C1ED"
}
},
nextday: function(n) {
this.createZhezhao(-1)
var d = new Date(this.dateTime);
d.setTime(d.getTime() + 24 * 60 * 60 * 1000 * n);
if (d.getDate().toString().length == 1) {
this.dateTime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-0" + d.getDate();
} else {
this.dateTime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
}
this.getData();
mui('.scroll1').scroll().scrollTo(0, 0, 100);
mui('.scroll2').scroll().scrollTo(0, 0, 100);
mui('.scroll3').scroll().scrollTo(0, 0, 100);
mui('.scroll4').scroll().scrollTo(0, 0, 100);
},
stylebg: function(n) {
if (n == 0) {
return {
"background": "#02C1ED"
}
}
},
nextPage: function(n, k) {
var url_;
var id_;
url_ = "CuttingQuality.html";
id_ = "CuttingQuality.html";
var detail ={
IndexID: this.IndexID,
dateTime: this.dateTime,
itemsDetail: this.itemsDetail,
itemsSize: this.itemsSize,//
type: n, // n =2 点击不合格进去 ,
parentSize: k,
sizeNum: this.rightInfor.ReportDetail //尺码和数量
}
console.log("品质问题:"+ JSON.stringify(detail));
mui.openWindow({
url: url_,
id: id_,
extras: {
IndexID: this.IndexID,
dateTime: this.dateTime,
itemsDetail: this.itemsDetail,
itemsSize: this.itemsSize,
type: n, // n =2 点击不合格进去 ,
parentSize: k,
sizeNum: this.itemsDetail1 //尺码和数量
},
});
},
sop: function() {
this.getLink();
},
selecttime: function() {
var that = this;
var _self = document.getElementById("selectdate")
if (_self.picker) {
_self.picker.show(function(rs) {
_self.innerText = rs.text
_self.picker.dispose();
_self.picker = null;
});
} else {
var optionsJson = _self.getAttribute('data-options') || '{}';
var options = JSON.parse(optionsJson);
var id = _self.getAttribute('id');
/*
* 首次显示时实例化组件
* 示例为了简洁,将 options 放在了按钮的 dom 上
* 也可以直接通过代码声明 optinos 用于实例化 DtPicker
*/
_self.picker = new mui.DtPicker(options);
_self.picker.show(function(rs) {
/*
* rs.value 拼合后的 value
* rs.text 拼合后的 text
* rs.y 年,可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
* rs.m 月,用法同年
* rs.d 日,用法同年
* rs.h 时,用法同年
* rs.i 分(minutes 的第二个字母),用法同年
*/
_self.innerText = rs.text;
that.dateTime = rs.text;
that.getData();
/*
* 返回 false 可以阻止选择框的关闭
* return false;
*/
/*
* 释放组件资源,释放后将将不能再操作组件
* 通常情况下,不需要示放组件,new DtPicker(options) 后,可以一直使用。
* 当前示例,因为内容较多,如不进行资原释放,在某些设备上会较慢。
* 所以每次用完便立即调用 dispose 进行释放,下次用时再创建新实例。
*/
_self.picker.dispose();
_self.picker = null;
});
}
mui('.scroll1').scroll().scrollTo(0, 0, 100);
mui('.scroll2').scroll().scrollTo(0, 0, 100);
mui('.scroll3').scroll().scrollTo(0, 0, 100);
mui('.scroll4').scroll().scrollTo(0, 0, 100);
}, //selecttime
back: function() {
console.log("back")
mui.back()
// plus.screen.lockOrientation("portrait-primary") //横屏
},
changePosition: function() {
var btn1 = document.getElementById("changePosition");
var Height = document.documentElement.clientHeight || document.body.clientHeight;
//console.log("得到焦点。。。。" + Height);
window.onresize = function() {
var Height1 = document.documentElement.clientHeight || document.body.clientHeight;
//console.log("得到焦点。。。。" + Height1);
if (Height > Height1) {
btn1.style.display = "none";
} else {
btn1.style.display = "block";
}
}
},
changePosition1: function() {
var btn1 = document.getElementById("changePosition");
var Height = document.documentElement.clientHeight || document.body.clientHeight;
window.onresize = function() {
var Height1 = document.documentElement.clientHeight || document.body.clientHeight;
if (Height < Height1) {
btn1.style.display = "block";
} else {
btn1.style.display = "none";
}
}
}
}
})
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>针车配套确认</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="../dest/css/mui.min.css" rel="stylesheet" />
<link href="../dest/css/needlecarHand/needlecarHandover.css" rel="stylesheet" />
</head>
<body>
<div id="app" v-cloak>
<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>
</div>
<div class="mui-input-row mui-search">
<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 id="left-2">
<div id="pullrefresh">
<div class="mui-scroll">
<div id="item1" :state="completeState" class="scroll1 leftList maeginTop">
<div class="mui-table-view mui-table-view-chevron">
<ul :id="items.IndexID" :class="{active:cur==n}" class="mui-table-view bg needLeftList" v-for=" (items,n) in itemsLeft"
@click="selectLeft(items,n)">
<li>
<p><span>指令号:</span><span>{{items.IndexNo}}</span></p>
<p><span>订单号:</span><span>{{items.CustomPO}}</span></p>
</li>
<li>
<p><span>货号:</span><span class="blueColor">{{items.StyleCode}}</span></p>
<p><span>数量:</span><span class="redColor">{{items.Qty}}</span></p>
</li>
<li>
<p><span>计划时间:</span><span>{{items.PlanDate}}</span></p>
<p><span>班组:</span><span>{{items.ToWorkTeam}}</span></p>
</li>
<li>
<p><span>实报时间:</span><span>{{items.ReportDate}}</span></p>
<p><span>计划配送:</span><span>{{items.PlanDistribution}}</span></p>
</li>
<a class="meached" v-show = "items.IsMatch"> <img src="../dest/img/application/meached.png" /></a>
<a class="confirm" v-show = "items.IsConfirm"> <img src="../dest/img/application/haveSure.png" /></a>
</ul>
</div>
</div>
<div id="item2" :state="!completeState" class="scroll2 leftList " :style="display_">
<div class="mui-table-view mui-table-view-chevron">
<ul :id="items.IndexID" :class="{active:cur==n}" class="mui-table-view bg needLeftList" v-for=" items,n in itemsLeft2"
@click="selectLeft(items,n )">
<li>
<p><span>指令号:</span><span>{{items.IndexNo}}</span></p>
<p><span>订单号:</span><span>{{items.CustomPO}}</span></p>
</li>
<li>
<p><span>货号:</span><span class="blueColor">{{items.StyleCode}}</span></p>
<p><span>数量:</span><span class="redColor">{{items.Qty}}</span></p>
</li>
<li>
<p><span>计划时间:</span><span>{{items.PlanDate}}</span></p>
<p><span>班组:</span><span>{{items.ToWorkTeam}}</span></p>
</li>
<li>
<p><span>实报时间:</span><span>{{items.ReportDate}}</span></p>
<p><span>计划配送:</span><span>{{items.PlanDistribution}}</span></p>
</li>
<a class="meached" v-show = "items.IsMatch"> <img src="../dest/img/application/haveHandover.png" /></a>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="mui-segmented-control leftState" id="changePosition">
<a id="n1" class="mui-control-item mui-active" @click="selectDisplay(0)">未交接</a>
<a id="n2" class="mui-control-item " @click="selectDisplay(1)">已交接</a>
</div>
</div>
<div class="need-right">
<div id="right">
<div id="right-1">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<p > 指令号: </p>
<p style="float: left;width: 40%; color: #060606;white-space:nowrap;text-overflow: ellipsis;overflow: hidden;">&nbsp;{{itemsDetail.IndexNo}}
</p>
</li>
<li class="mui-table-view-cell">
<p> 货号: </p>
<p class="blueColor">&nbsp;{{itemsDetail.StyleCode}}</p>
<p>颜色: </p>
<p>{{itemsDetail.ColorName}} </p>
</li>
<li class="mui-table-view-cell">
<p> 数量: </p>
<p class="redColor">&nbsp;{{itemsDetail.FinishQty}} </p>
</li>
<li class="mui-table-view-cell">
<p> 不合格数: </p>
<p class="redColor">&nbsp;{{itemsDetail.UnQualifiedQty}} </p>
<p>报废数: </p>
<p class="redColor">{{itemsDetail.ScrapQty}} </p>
</li>
<li class="mui-table-view-cell">
<p> 发包: </p>
<p>&nbsp;{{itemsDetail.WorkTeam}} </p>
<p>收包: </p>
<p>{{itemsDetail.ToWorkTeam}} </p>
</li>
<li class="mui-table-view-cell">
<p> 计划时间: </p>
<p>&nbsp;{{itemsDetail.PlanDate}} </p>
<p>实报时间: </p>
<p>{{itemsDetail.ReportDate}} </p>
</li>
<li class="mui-table-view-cell">
<p> 实报人: </p>
<p>&nbsp;{{itemsDetail.ReportUser}} </p>
</li>
<li class="mui-table-view-cell">
<p> 确认人: </p>
<p>&nbsp;{{itemsDetail.ConfirmUserName}} </p>
<p>确认时间: </p>
<p>{{itemsDetail.ConfirmDate}} </p>
</li>
<li class="mui-table-view-cell">
<p> 配套人: </p>
<p>&nbsp;{{itemsDetail.MatchUserName}} </p>
<p>配套时间: </p>
<p>{{itemsDetail.MatchDate}} </p>
</li>
<li class="mui-table-view-cell">
<p> 交接人: </p>
<p>&nbsp;{{itemsDetail.CheckUserName}} </p>
<p>交接时间: </p>
<p>{{itemsDetail.CheckDate}} </p>
</li>
</ul>
</div>
</div>
<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>
</div>
</div>
</div>
<script src="../dest/js/mui.min.js"></script>
<script src="../dest/js/vue.min.js"></script>
<script src="../dest/js/public.min.js"></script>
<script src="../dest/js/mes/playVoice.js"></script>
<script src="../dest/js/mes/NeedleMatch.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改密码</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../dest/css/mui.min.css" />
<link rel="stylesheet" href="../dest/css/changePassWord.css" />
</head>
<body>
<div id="app">
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">修改密码</h1>
</header>
<div class="mui-content changeList" id="input_example">
<div class="mui-input-group">
<div class="mui-input-row">
<label>旧密码</label>
<input type="text" class="mui-input-clear" v-model="oldPsd" placeholder="请输入旧密码">
</div>
<div class="mui-input-row">
<label>新密码</label>
<input type="password" class="mui-input-password" v-model="newPsd" placeholder="请输入新密码">
</div>
<div class="mui-input-row">
<label>确认密码</label>
<input type="password" class="mui-input-password" v-model="surePsd" placeholder="请再次输入密码">
</div>
<div class="mui-button-row edit-padded">
<button class="mui-btn mui-btn-blue mui-btn-block" @click="checkPsd">确认</button>
</div>
</div>
</div>
</div>
<script src="../dest/js/mui.min.js"></script>
<script src="../dest/js/vue.min.js"></script>
<script src="../dest/js/public.min.js"></script>
<script type="text/javascript">
mui.plusReady(function() {
initPage();
});
function initPage() {
app.init();
}
var app = new Vue({
el: '#app',
data: {
newPsd: '',
surePsd: '',
oldPsd: '',
check: false,
},
methods: {
init: function() {
mui.init();
},
checkPsd: function() {
mui("#input_example input").each(function() {
//console.log(this.value)
//若当前input为空,则alert提醒
if (!this.value || this.value.trim() == "") {
var label = this.previousElementSibling;
mui.alert(label.innerText + "不允许为空");
this.check = false;
return false;
}
});
//console.log(this.newPsd+this.surePsd+this.oldPsd)
if (this.newPsd != '' && this.surePsd != '' && this.oldPsd != '') {
if (this.newPsd.length > 18 || this.surePsd.length > 18) {
this.check = false;
mui.alert("密码过长!");
} else if (this.newPsd === this.surePsd) {
this.check = true;
this.submit();
} else {
this.check = false;
mui.alert("两次密码不一样!");
console.log("两次密码不一样!");
}
}
},
submit: function() {
mui.toast('修改密码!');
var para = {
OldPWD: this.oldPsd,
PWD: this.newPsd
}
console.log(JSON.stringify(para));
Api.post('/api/User/PassWord', para, function(e) {
//console.log("调用了接口111111");
if (e.success) {
mui.toast('密码修改成功!');
mui.back();
console.log("chengggg");
} else {
mui.toast('密码修改失败!');
console.log("shibai ");
}
}, function(xhr, type, res) {
console.log("11111111111111111111出错啦!");
mui.toast(JSON.stringify(res.message))
});
},
}
});
</script>
</body>
</html>
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