|
@@ -0,0 +1,430 @@
|
|
|
+var refreshGirdData;
|
|
|
+var bootstrap = function ($, learun) {
|
|
|
+ "use strict";
|
|
|
+ var selectRowsData;
|
|
|
+ var psuid = "";
|
|
|
+ var urls = [{ "url": "/FJManager/BillBomSet/DFM1509", "name": "DFM1509", "width": 744, "height": 690 },
|
|
|
+ { "url": "/FJManager/BillBomSet/DOF2", "name": "DOF2", "width": 920, "height": 676 },
|
|
|
+ { "url": "/FJManager/BillBomSet/DOF4", "name": "DOF4", "width": 920, "height": 676 },
|
|
|
+ { "url": "/FJManager/BillBomSet/DFM6", "name": "DFM6", "width": 920, "height": 676 },
|
|
|
+ { "url": "/FJManager/BillBomSet/DFM09", "name": "DFM9", "width": 940, "height": 676 },
|
|
|
+ { "url": "/FJManager/BillBomSet/Exception", "name": "Exception", "width": 920, "height": 676 },
|
|
|
+ { "url": "/FJManager/BillBomSet/DFMAll", "name": "DFMAll", "width": 920, "height": 676 },];
|
|
|
+ var page = {
|
|
|
+ init: function () {
|
|
|
+ page.bind();
|
|
|
+ page.initGird();
|
|
|
+ },
|
|
|
+ bind: function () {
|
|
|
+ $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
|
|
|
+ // 调用后台查询
|
|
|
+ // queryJson 查询条件
|
|
|
+ console.log(queryJson);
|
|
|
+
|
|
|
+ queryJson["Code"] = $("#Code").val();
|
|
|
+ queryJson["Name"] = $("#Name").val();
|
|
|
+ queryJson["ShortCode"] = $("#ShortCode").val();
|
|
|
+ queryJson["ProMaterCode"] = $("#ProMaterCode").val();
|
|
|
+ queryJson["BomCode"] = $("#BomCode").val();
|
|
|
+
|
|
|
+ if ($("#IsStop").is(":checked")) {
|
|
|
+ queryJson["IsStop"] = '1';
|
|
|
+ } else {
|
|
|
+ queryJson["IsStop"] = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ queryJson["StampType"] = stampType;
|
|
|
+ page.search({ queryJson: JSON.stringify(queryJson) });
|
|
|
+ }, 250);
|
|
|
+ // 查询
|
|
|
+ $('#btn_Search').on('click', function () {
|
|
|
+ var keyword = $('#txt_Keyword').val();
|
|
|
+ page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), StampType: stampType }) });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 刷新
|
|
|
+ $('#lr_refresh').on('click', function () {
|
|
|
+ location.reload();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 新增
|
|
|
+ $('#lr_add').on('click', function () {
|
|
|
+ learun.layerForm({
|
|
|
+ id: 'form',
|
|
|
+ title: '新增' + urls[parseInt(stampType) - 1].name,
|
|
|
+ url: top.$.rootUrl + urls[parseInt(stampType) - 1].url,
|
|
|
+ width: urls[parseInt(stampType) - 1].width,
|
|
|
+ height: urls[parseInt(stampType) - 1].height,
|
|
|
+ callBack: function (id) {
|
|
|
+ return top[id].acceptClick(refreshGirdData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // 编辑
|
|
|
+ $('#lr_edit').on('click', function () {
|
|
|
+ let editSelRows = $('#gridtable').jfGridGet("rowdata");
|
|
|
+ if (editSelRows.length == 0) {
|
|
|
+ learun.alert.error('未选择行!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (editSelRows.length > 1) {
|
|
|
+ learun.alert.error('选择了多行!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var keyValue = $('#gridtable').jfGridValue('Id');
|
|
|
+ if (learun.checkrow(keyValue)) {
|
|
|
+ learun.layerForm({
|
|
|
+ id: 'form',
|
|
|
+ title: '编辑' + urls[parseInt(stampType) - 1].name,
|
|
|
+ url: top.$.rootUrl + urls[parseInt(stampType) - 1].url + '?keyValue=' + keyValue,
|
|
|
+ width: urls[parseInt(stampType) - 1].width,
|
|
|
+ height: urls[parseInt(stampType) - 1].height,
|
|
|
+ callBack: function (id) {
|
|
|
+ return top[id].acceptClick(refreshGirdData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#lr_search").on('click', function () {
|
|
|
+ let editSelRows = $('#gridtable').jfGridGet("rowdata");
|
|
|
+ if (editSelRows.length == 0) {
|
|
|
+ learun.alert.error('未选择行!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (editSelRows.length > 1) {
|
|
|
+ learun.alert.error('选择了多行!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var keyValue = $('#gridtable').jfGridValue('Id');
|
|
|
+ if (learun.checkrow(keyValue)) {
|
|
|
+ learun.layerForm({
|
|
|
+ id: 'form',
|
|
|
+ title: '查看' + urls[parseInt(stampType) - 1].name,
|
|
|
+ btn: ['关闭'],
|
|
|
+ url: top.$.rootUrl + urls[parseInt(stampType) - 1].url + '?keyValue=' + keyValue,
|
|
|
+ width: urls[parseInt(stampType) - 1].width,
|
|
|
+ height: urls[parseInt(stampType) - 1].height,
|
|
|
+ callBack: function (id) {
|
|
|
+ return true;
|
|
|
+ //return top[id].acceptClick(refreshGirdData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 删除
|
|
|
+ $('#lr_delete').on('click', function () {
|
|
|
+ selectRowsData = $('#gridtable').jfGridGet("rowdata");
|
|
|
+
|
|
|
+ if (selectRowsData.length == 0) {
|
|
|
+ learun.alert.error('未选择行!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var keyValue = selectRowsData.map((item) => item.Id);
|
|
|
+
|
|
|
+ //var keyValue = $('#gridtable').jfGridValue('Id');
|
|
|
+ if (learun.checkrow(keyValue)) {
|
|
|
+ learun.layerConfirm('是否确认删除该项!', function (res) {
|
|
|
+ if (res) {
|
|
|
+ learun.deleteForm(top.$.rootUrl + '/FJManager/BillBomSet/Deletes', { keyValue: keyValue }, function () {
|
|
|
+ refreshGirdData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 启用
|
|
|
+ $('#lr_enable').on('click', function () {
|
|
|
+ var postData = $('#gridtable').jfGridGet("rowdata");
|
|
|
+
|
|
|
+ if (postData.length == 0) {
|
|
|
+ learun.alert.error('未选择行!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (postData.length > 1) {
|
|
|
+ learun.alert.error('启用只能选择一条数据!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ learun.layerConfirm('是否确认启用该跺型!', function (res) {
|
|
|
+ if (res) {
|
|
|
+ learun.postForm(top.$.rootUrl + '/FJManager/BillBomSet/Enables', { ids: JSON.stringify(postData.map((item) => item.Id)) }, function () {
|
|
|
+ refreshGirdData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // 禁用
|
|
|
+ $('#lr_disable').on('click', function () {
|
|
|
+ var postData = $('#gridtable').jfGridGet("rowdata");
|
|
|
+
|
|
|
+ if (postData.length == 0) {
|
|
|
+ learun.alert.error('未选择行!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ learun.layerConfirm('是否确认禁用该跺型!', function (res) {
|
|
|
+ if (res) {
|
|
|
+ learun.postForm(top.$.rootUrl + '/FJManager/BillBomSet/Disables', { ids: JSON.stringify(postData.map((item) => item.Id)) }, function () {
|
|
|
+ refreshGirdData();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // 打印
|
|
|
+ $('#lr_print').on('click', function () {
|
|
|
+ $('#gridtable').jqprintTable();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 初始化列表
|
|
|
+ initGird: function () {
|
|
|
+ $('#gridtable').jfGrid({
|
|
|
+ url: top.$.rootUrl + '/FJManager/BillBomSet/GetPaiKuList',
|
|
|
+ headData: [
|
|
|
+ { label: '垛型编码', name: 'Code', width: 160, align: 'left' },
|
|
|
+ { label: '垛型名称', name: 'Name', width: 160, align: 'left' },
|
|
|
+ { label: '短编号', name: 'ShortCode', width: 50, align: 'left' },
|
|
|
+ { label: '帘线物料编码', name: 'ProMaterCode', width: 100, align: 'left' },
|
|
|
+ { label: '投料物料编码', name: 'ProCode', width: 180, align: 'left' },
|
|
|
+ { label: '实际物料编码', name: 'BomCode', width: 180, align: 'left' },
|
|
|
+ //{
|
|
|
+ // label: '投料物料名称', name: 'BomCode', width: 180, align: 'left', formatterAsync: function (callback, value, row) {
|
|
|
+ // learun.httpAsync('GET', top.$.rootUrl + '/FJManager/BillBomInfo/GetList', { queryJson: JSON.stringify({ Code: value }) }, function (res) {
|
|
|
+ // if (res.code > 0 && res.data.length > 0) {
|
|
|
+ // callback(res.data[0].Name);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ //},
|
|
|
+ { label: '工字轮个数', name: 'HWCountQty', width: 70, align: 'left' },
|
|
|
+ {
|
|
|
+ label: '托盘类型', name: 'TpTypeCode', width: 60, align: 'left', formatter: function (cellvalue) {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-success\" >09</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >非09</span>';
|
|
|
+ } else {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { label: '层数', name: 'LayerCountQty', width: 40, align: 'left' },
|
|
|
+ learun.jfFormatter.col_ISSTOP(),
|
|
|
+ //{
|
|
|
+ // label: '是否删除', name: 'IsDelete', width: 60, align: "center"
|
|
|
+ // , formatter: function (cellvalue) {
|
|
|
+ // if (cellvalue == 0) {
|
|
|
+ // return '<span class=\"label label-success\" >正常</span>';
|
|
|
+ // } else if (cellvalue == 1) {
|
|
|
+ // return '<span class=\"label label-default\" >删除</span>';
|
|
|
+ // } else {
|
|
|
+ // return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //},
|
|
|
+ {
|
|
|
+ label: '子类型', name: 'StampChildType', width: 120, align: 'left', formatter: function (cellvalue, item) {
|
|
|
+ if (item.StampType == '2') {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-default\" >DOF2-01</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >DOF2-02</span>';
|
|
|
+ } else if (cellvalue == '3') {
|
|
|
+ return '<span class=\"label label-default\" >DOF2-03</span>';
|
|
|
+ } else if (cellvalue == '4') {
|
|
|
+ return '<span class=\"label label-default\" >DOF2-04</span>';
|
|
|
+ } else if (cellvalue == '5') {
|
|
|
+ return '<span class=\"label label-default\" >DOF2-05</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.StampType == '3') {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-default\" >DOF4-01</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >DOF4-02</span>';
|
|
|
+ } else if (cellvalue == '3') {
|
|
|
+ return '<span class=\"label label-default\" >DOF4-03</span>';
|
|
|
+ } else if (cellvalue == '4') {
|
|
|
+ return '<span class=\"label label-default\" >DOF4-04</span>';
|
|
|
+ } else if (cellvalue == '5') {
|
|
|
+ return '<span class=\"label label-default\" >DOF4-05</span>';
|
|
|
+ } else if (cellvalue == '6') {
|
|
|
+ return '<span class=\"label label-default\" >DOF4-06</span>';
|
|
|
+ } else if (cellvalue == '7') {
|
|
|
+ return '<span class=\"label label-default\" >DOF4-07</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (item.StampType == '4') {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-01</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-02</span>';
|
|
|
+ } else if (cellvalue == '3') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-03</span>';
|
|
|
+ } else if (cellvalue == '4') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-04</span>';
|
|
|
+ } else if (cellvalue == '5') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-05</span>';
|
|
|
+ } else if (cellvalue == '6') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-06</span>';
|
|
|
+ } else if (cellvalue == '7') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-07</span>';
|
|
|
+ } else if (cellvalue == '8') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-08</span>';
|
|
|
+ } else if (cellvalue == '9') {
|
|
|
+ return '<span class=\"label label-default\" >DFM6-09</span>';
|
|
|
+ }
|
|
|
+ } else if (item.StampType == '5') {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-01</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-02</span>';
|
|
|
+ } else if (cellvalue == '3') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-03</span>';
|
|
|
+ } else if (cellvalue == '4') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-04</span>';
|
|
|
+ } else if (cellvalue == '5') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-05</span>';
|
|
|
+ } else if (cellvalue == '6') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-06</span>';
|
|
|
+ } else if (cellvalue == '7') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-07</span>';
|
|
|
+ } else if (cellvalue == '8') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-08</span>';
|
|
|
+ } else if (cellvalue == '9') {
|
|
|
+ return '<span class=\"label label-default\" >DFM9-09</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (item.StampType == '6') {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-default\" >WS34芯股--异常</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >WS18--异常</span>';
|
|
|
+ } else if (cellvalue == '3') {
|
|
|
+ return '<span class=\"label label-default\" >WS50--异常</span>';
|
|
|
+ } else if (cellvalue == '4') {
|
|
|
+ return '<span class=\"label label-default\" >WS09--异常</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return '<span class=\"label label-default\" >无</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是否桁架码垛', name: 'IsTruss', width: 80, align: 'left', formatter: function (cellvalue) {
|
|
|
+ if (cellvalue == 1) {
|
|
|
+ return '<span class=\"label label-success\" >是</span>';
|
|
|
+ } else if (cellvalue === '') {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ } else if (cellvalue === 0) {
|
|
|
+ return '<span class=\"label label-info\" >否</span>';
|
|
|
+ } else {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ learun.jfFormatter.col_AddWho(),
|
|
|
+ learun.jfFormatter.col_AddTime(),
|
|
|
+ learun.jfFormatter.col_EditWho(),
|
|
|
+ learun.jfFormatter.col_EditTime(),
|
|
|
+ learun.jfFormatter.col_MEMO()
|
|
|
+ ],
|
|
|
+ mainId: 'Code',
|
|
|
+ isPage: true,
|
|
|
+ isMultiselect: true,
|
|
|
+ reloadSelected: true,
|
|
|
+ sidx: 'Code',
|
|
|
+ isSubGrid: true, // 是否有子表
|
|
|
+ subGridExpanded: function (subid, rowdata) {
|
|
|
+ psuid = subid;
|
|
|
+ $('#' + subid).jfGrid({
|
|
|
+ url: top.$.rootUrl + '/FJManager/BillBomSet/GetPaiKuList',
|
|
|
+ headData: [
|
|
|
+ { label: '编号', name: 'XYNo', width: 40, align: 'left' },
|
|
|
+ { label: '行', name: 'Row', width: 40, align: 'left' },
|
|
|
+ { label: '物料编码', name: 'MatCode', width: 200, align: 'left' },
|
|
|
+ { label: '物料Id', name: 'MatId', width: 150, align: 'left' },
|
|
|
+ {
|
|
|
+ label: '有/无', name: 'IsEmpty', width: 60, align: 'left', formatter: function (cellvalue) {
|
|
|
+ if (cellvalue == '0') {
|
|
|
+ return '<span class=\"label label-success\" >有</span>';
|
|
|
+ } else if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-default\" >无</span>';
|
|
|
+ } else {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '正/反面', name: 'SideNum', width: 70, align: 'left', formatter: function (cellvalue) {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-success\" >正面朝上</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >反面朝上</span>';
|
|
|
+ } else {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { label: '工字轮型号', name: 'SpoolType', width: 80, align: 'left' },
|
|
|
+ {
|
|
|
+ label: '单/双丝', name: 'SilkType', width: 80, align: 'left', formatter: function (cellvalue) {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-success\" >单丝</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >双丝</span>';
|
|
|
+ } else if (cellvalue == '3') {
|
|
|
+ return '<span class=\"label label-default\" >三丝</span>';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { label: '钢丝直径上限', name: 'SilkDiam', width: 100, align: 'left' },
|
|
|
+ /* { label: '钢丝直径上限', name: 'SilkDiamMaxCount', width: 100, align: 'left' },*/
|
|
|
+ { label: '数量上限', name: 'QtyMaxCount', width: 100, align: 'left' },
|
|
|
+ {
|
|
|
+ label: '是否芯股', name: 'IsCore', width: 100, align: 'left', formatter: function (cellvalue) {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-success\" >是</span>';
|
|
|
+ } else if (cellvalue == '2') {
|
|
|
+ return '<span class=\"label label-default\" >否</span>';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '是混合行', name: 'IsMixRow', width: 100, align: 'left', formatter: function (cellvalue) {
|
|
|
+ if (cellvalue == '1') {
|
|
|
+ return '<span class=\"label label-success\" >是</span>';
|
|
|
+ } else if (cellvalue == '0') {
|
|
|
+ return '<span class=\"label label-default\" >否</span>';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return '<span class=\"label label-default\" >未知</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { label: '混合料行编码', name: 'MixRowCode', width: 100, align: 'left' },
|
|
|
+ learun.jfFormatter.col_ISSTOP(),
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ $('#' + subid).jfGridSet('reloadSon', { bomSetHdrId: rowdata.Id });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), StampType: stampType }) });
|
|
|
+ },
|
|
|
+ search: function (param) {
|
|
|
+ $('#gridtable').jfGridSet('reload', param);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ refreshGirdData = function () {
|
|
|
+ $('#gridtable').jfGridSet('reload');
|
|
|
+ };
|
|
|
+ page.init();
|
|
|
+}
|