12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- /*
- * 描 述:功能模块
- */
- var acceptClick;
- var keyValue = '';
- var bootstrap = function ($, learun) {
- "use strict";
- var selectedRow = learun.frameTab.currentIframe().selectedRow || {};
- const setgrps = [{ id: "18异常工字轮码垛", text: "18异常工字轮码垛" }, { id: "09", text: "09" }];
- const newsetgrps = [{ id: "3x0.28四爪吊具专用垛型", text: "3x0.28四爪吊具专用垛型" }, { id: "0240225", text: "0240225" }];
- const relations = [{ id: "18异常工字轮码垛", value: "3x0.28四爪吊具专用垛型" }, { id: "09", value: "0240225" }];
- var page = {
- init: function () {
- page.bind();
- page.initData();
- },
- /*绑定事件和初始化控件*/
- bind: function () {
- // 上级
- for (let j = 0; j < setgrps.length; j++) {
- $("#SetGrp").append($("<option value='" + setgrps[j].id + "'>" + setgrps[j].text + "</option>"));
- }
- //for (let j = 0; j < newsetgrps.length; j++) {
- // $("#NewSetGrp").append($("<option value='" + newsetgrps[j].id + "'>" + newsetgrps[j].text + "</option>"));
- //}
- $('#WarehouseId').lrselect({
- url: top.$.rootUrl + '/FJManager/BaseWarehouse/GetSelectWarehouseNameList',
- maxHeight: 180,
- allowSearch: false
- });
- $('#User').val(top.$.lcoreUser.account);
- $("#SetGrp").change(function () {
- var value = this.value;
- var typenum = value == "09" ? "1" : "0";
- var url = top.$.rootUrl + '/FJManager/BillBomSet/GetSelectCodeListByType?typenum=' + typenum;
- learun.httpAsyncGet(url, function (data) {
- if (data.IsSucc) {
- $("#NewSetGrp").empty();
- for (let j = 0; j < data.data.length; j++) {
- $("#NewSetGrp").append($("<option value='" + data.data[j].id + "'>" + data.data[j].text + "</option>"));
- }
- }
- });
- })
- $("#SetGrp option:eq(0)").prop("selected", true);
- $("#SetGrp").trigger('change');
- },
- /*初始化数据*/
- initData: function () {
- if (!!selectedRow) {
- keyValue = selectedRow.Id;
- $('#form').lrSetFormData(selectedRow);
-
- }
- }
- };
- acceptClick = function (callBack) {
- if (!$('#form').lrValidform()) {
- return false;
- }
- var postData = $('#form').lrGetFormData(keyValue);
-
- $.lrSaveForm(top.$.rootUrl + '/FJManager/Inventorys/ChangeSetGrp', postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
- }
|