var acceptClick;
var account = request('lraccount');
var bootstrap = function ($, learun) {
"use strict";
var selectRowsDatas = learun.frameTab.currentIframe().selectRowsData;
var BusType = learun.frameTab.currentIframe().BusType;
const devices = [{ id: "1N", text: "2532" }, { id: "1S", text: "2732" }, { id: "2N", text: "2932" }, { id: "2S", text: "3132" }, { id: "3N", text: "3332" }, { id: "3S", text: "3532" } ] ;
var url = weburl + "api/Fj/ManualTask";
var page = {
init: function () {
page.bind();
page.initData();
},
bind: function () {
//$("#addTo").append($(""));
$.each(devices, function (n, item) {
if (item.id == selectRowsDatas[0].WarehouseCode) {
$("#addTo").append($(""));
}
});
//$("#addTo").prepend("请选择");
$('#Warehouse').val(selectRowsDatas[0].WarehouseName);
$('#User').val(top.$.lcoreUser.account);
},
initData: function () {
if (selectRowsDatas.length <= 0) {
}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('#form').lrValidform()) {
return false;
}
var handledata = JSON.stringify({
"location": selectRowsDatas.map((item) => item.Code),
//"busType": BusType,
"warehouseCode": selectRowsDatas[0].WarehouseCode,
"addTo": $("#addTo").val()
});
learun.layerConfirm('是否确认手动出库!', function (res, index) {
if (res) {
$.ajax({
type: 'post',
data: handledata,
dataType: 'json',
contentType: "application/json;charset=utf-8",
url: url,
success: function (response) {
//resCode 200 resMsg "成功"
if (!!callBack) {
callBack();
}
top.layer.close(index);
top.learun.layerClose(window.name);
learun.alert.info(response.resMsg);
}
});
}
});
};
page.init();
}