提交 96c0fe48 authored 作者: 陆's avatar

交给德鹏做测试

上级 e9f3383b
...@@ -280,6 +280,7 @@ ...@@ -280,6 +280,7 @@
</div> </div>
<br/> <br/>
<i-button type="info" @click="addItems">添加商品</i-button> <i-button type="info" @click="addItems">添加商品</i-button>
<i-button type="info" @click="delAll">批量删除</i-button>
<br/> <br/>
<table id="adItemjqGrid"></table> <table id="adItemjqGrid"></table>
......
...@@ -177,7 +177,7 @@ let vm = new Vue({ ...@@ -177,7 +177,7 @@ let vm = new Vue({
}, },
sortItem(e) { sortItem(e) {
let id = $("#jqGrid").getGridParam("selrow"); let id = $("#jqGrid").getGridParam("selrow");
if (id == '' || id == null) { if (id == '' || id == null || vm.iscopy == 1) {
id = vm.tempId; id = vm.tempId;
} }
vm.modal1 = true; vm.modal1 = true;
...@@ -196,7 +196,7 @@ let vm = new Vue({ ...@@ -196,7 +196,7 @@ let vm = new Vue({
}, },
deal() { deal() {
let id = $("#jqGrid").getGridParam("selrow"); let id = $("#jqGrid").getGridParam("selrow");
if (id == '' || id == null) { if (id == '' || id == null || vm.iscopy == 1) {
id = vm.tempId; id = vm.tempId;
} }
console.log('deal-->adId', id) console.log('deal-->adId', id)
...@@ -223,13 +223,39 @@ let vm = new Vue({ ...@@ -223,13 +223,39 @@ let vm = new Vue({
delItem(itemId) { delItem(itemId) {
let id = $("#jqGrid").getGridParam("selrow"); let id = $("#jqGrid").getGridParam("selrow");
if (id == '' || id == null) { if (id == '' || id == null || vm.iscopy == 1) {
id = vm.tempId; id = vm.tempId;
} }
var data = []
data.push(itemId)
confirm('确定要删除选中的记录?', function () { confirm('确定要删除选中的记录?', function () {
Ajax.request({ Ajax.request({
url: "../advertisementitem/deleteByItem?itemId=" + itemId + '&adId=' + id, // url: "../advertisementitem/deleteByItem?itemId=" + itemId + '&adId=' + id,
url: "../advertisementitem/deleteByItem?adId=" + id ,
type: "POST", type: "POST",
data:data,
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.btn_Search(id);
});
}
});
});
},
// 批量删除
delAll() {
let id = $("#jqGrid").getGridParam("selrow");
if (id == '' || id == null || vm.iscopy == 1) {
id = vm.tempId;
}
let ids = getSelectedRows("#adItemjqGrid");
confirm('确定要删除选中的记录?', function () {
Ajax.request({
// url: "../advertisementitem/deleteByItem?itemId=" + itemId + '&adId=' + id,
url: "../advertisementitem/deleteByItem?adId=" + id ,
type: "POST",
params: JSON.stringify(ids),
contentType: "application/json", contentType: "application/json",
successCallback: function () { successCallback: function () {
alert('操作成功', function (index) { alert('操作成功', function (index) {
...@@ -246,7 +272,7 @@ let vm = new Vue({ ...@@ -246,7 +272,7 @@ let vm = new Vue({
return; return;
} }
let id = vm.advertisement.id; let id = vm.advertisement.id;
if (id == null || id == '' || id == 'undefined') { if (id == null || id == '' || id == 'undefined' || vm.iscopy == 1) {
id = vm.tempId; id = vm.tempId;
} }
Ajax.request({ Ajax.request({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论