routine update

This commit is contained in:
yubao
2018-03-19 22:24:20 +08:00
parent 25387d12f1
commit 37789838fa
8 changed files with 293 additions and 176 deletions

View File

@@ -61,47 +61,37 @@
}();
//添加(编辑)对话框
var editDlg = function() {
var vm = new Vue({
el: "#formEdit"
});
var editDlg = function () {
var update = false; //是否为更新
var show = function (data) {
var title = update ? "编辑信息" : "添加";
layer.open({
type: 2,
area: ['600px', '500px'], //宽高
maxmin: true, //开启最大化最小化按钮
title: title,
area: ["500px", "400px"],
type: 1,
content: $('#divEdit'),
success: function() {
vm.$set('$data', data);
content: '/flowInstances/edit?id=' + data.Id,
btn: ['保存', '关闭'],
yes: function (index, layero) {
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象执行iframe页的方法iframeWin.method();
iframeWin.submit();
},
end: mainList
cancel: function (index) {
layer.close(index);
mainList();
}
});
var url = "/FlowInstances/Add";
if (update) {
url = "/FlowInstances/Update";
}
//提交数据
form.on('submit(formSubmit)',
function(data) {
$.post(url,
data.field,
function(data) {
layer.msg(data.Message);
},
"json");
return false;
});
}
return {
add: function() { //弹出添加
add: function () { //弹出添加
update = false;
show({
Id: ''
});
},
update: function(data) { //弹出编辑框
update: function (data) { //弹出编辑框
update = true;
show(data);
}
@@ -116,7 +106,6 @@
}
});
//监听页面主按钮操作
var active = {
btnDel: function () { //批量删除