拖拽的几个事件。
dragShopStart: function (item) {
console.log(item)
this.dropData = item //获取拖传过来的对象
},
// 拖动结束
dragShopOver: function (event) {
event.preventDefault()
},
//获取传过来的URLcode
getQueryString: function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
},
//放
dropShop: function (event) {
this.addBindModalInit()
const dropData = this.dropData //拖过来的数据
console.log(dropData)
if (!dropData.itemId) {
$("#bindNewItemModal").modal("show")
this.wayIndex = event.currentTarget.getAttribute('wayNumberAttribute') //获取货道号
this.costPrice = dropData.costPrice
this.price = dropData.price
this.shopDropName = dropData.name
this.basicItemId = dropData.basicItemId
this.endDate = dropData.endTime
// this.dropData=
} else {
$("#modalEditShop").modal("show")
this.modalEditInit()
this.editShopDropName = dropData.name,
this.editCostPrice = dropData.costPrice,
this.editPrice = dropData.price,
this.editFullNum = dropData.fullNum,
this.editNum = dropData.num,
this.editItemId = dropData.itemId,
this.editWayIndex = event.currentTarget.getAttribute('wayNumberAttribute')
}
},