diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html index 19539ea9..1ddf2b6a 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html @@ -142,49 +142,63 @@ // $.table.bootstrapTable('resetView'); }, columns: [{ - checkbox: true + checkbox: true, + }, + { title: '主键ID',field: 'id',visible: false}, + { title: 'bom号',field: 'bomNo', sortable: true,}, + { title: '料号',field: 'materialNo', sortable: true,}, + { title: '物料名称',field: 'materialName', sortable: true,}, + {title: '描述',field: 'describe',}, + { title: '品牌',field: 'brand', sortable: true,}, + {title: '半成品类型',field: 'processMethod', + formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);; + } + }, + { title: '单位',field: 'unit',}, + { title: '图片',field: 'photoUrl', + formatter: function(value, row, index) {return $.table.imageView(value); + } + }, + { title: '申请人',field: 'applyUserName', + formatter: function(value, row, index) {return '' + (value ? value : "-") + '';} + }, + { title: '申请时间',field: 'applyTime',sortable: true,}, + {title: '上次更新时间',field: 'updateTime',}, + { title: '当前状态',field: 'taskName',align: 'center', + formatter: function(value, row, index) { + if(row.auditStatus!="1"&&value != "未启动"){ + return '' + value + ''; + } + if(value === "未启动"){ + return '' + value + ''; + } + return '' + value + ''; + } }, - { title: '主键ID',field: 'id'}, { title: '流程实例ID',field: 'instanceId',visible: false}, { title: '流程提交实例ID',field: 'submitInstanceId',visible: false}, { title: '流程作废实例ID', field: 'cancelInstanceId',visible: false}, { title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false}, { title: '流程实例类型',field: 'instanceTypeName', visible: false}, { title: '申请人ID',field: 'applyUser',visible: false}, - { title: '申请人',field: 'applyUserName', - formatter: function(value, row, index) {return '' + (value ? value : "-") + '';} - }, - { title: '申请时间',field: 'applyTime',sortable: true,}, { title: '当前任务ID',field: 'taskId',visible: false,}, { title: '待办用户ID',field: 'todoUserId',visible: false,}, - { title: '当前任务名称',field: 'taskName',align: 'center', - formatter: function(value, row, index) { - return '' + value + ''; - } - }, - { title: '审核状态',field: 'auditStatus',sortable: true, + { title: '审核状态',field: 'auditStatus',visible: false, formatter: function(value, row, index) { return $.table.selectDictLabel(auditStatusDatas, value); } }, - { title: '使用状态',field: 'useStatus',sortable: true, + { title: '使用状态',field: 'useStatus',visible: false, formatter: function(value, row, index) { return $.table.selectDictLabel(useStatusDatas, value); } }, - { title: '工程员',field: 'engineer', sortable: true,}, - { title: 'bom号',field: 'bomNo', sortable: true,}, - { title: '关联料号',field: 'materialNo', sortable: true,}, - { title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);}}, - { title: '物料名称',field: 'materialName', sortable: true,}, - { title: '物料类型',field: 'materialType',sortable: true, + { title: '工程员',field: 'engineer', visible: false}, + { title: '物料类型',field: 'materialType',visible: false, formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}}, - { title: '加工方式',field: 'processMethod',sortable: true, + { title: '加工方式',field: 'processMethod',visible: false, formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);} }, - { title: '单位',field: 'unit', sortable: true,}, - { title: '品牌',field: 'brand', sortable: true,}, - {title: '描述',field: 'describe', sortable: true,}, { title: '父级id',field: 'parentId',visible:false }, {title: '层级',field: 'level', visible:false, formatter: function(value, row, index) { @@ -234,7 +248,15 @@ actions.push(' 详情 '); return actions.join(''); } - }] + }], + rowStyle: function (row, index) { + if (row.auditStatus=="0") { + // 如果审核状态为待审核,则设置为红色 + return {css:{"color":"red"}}; + } + // 否则使用默认样式 + return {}; + } }; $.table.init(options); engineer(); @@ -740,6 +762,117 @@ } }); } + // 导出 + function exportExcel(formId) { + // $.table.set(); + var bomNoData = []; + var selections = $("#bootstrap-table").bootstrapTable("getSelections"); + if(selections.length === 0){ + // $.modal.alertWarning("请至少选择一条bom信息"); + // return; + $.modal.confirm("确定导出所有bom吗?", function() { + var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; + var params = $("#bootstrap-table").bootstrapTable('getOptions'); + var dataParam = $("#" + currentId).serializeArray(); + dataParam.push({ "name": "orderByColumn", "value": params.sortName }); + dataParam.push({ "name": "isAsc", "value": params.sortOrder }); + $.modal.loading("正在导出数据,请稍后..."); + $.post(prefix + '/exportAll', dataParam, function(result) { + if (result.code == web_status.SUCCESS) { + window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; + } else if (result.code == web_status.WARNING) { + $.modal.alertWarning(result.msg) + } else { + $.modal.alertError(result.msg); + } + $.modal.closeLoading(); + }); + }); + }else { + $.modal.confirm("确定导出选中的所有" + table.options.modalName + "吗?", function () { + //·拼接单号 + for(let i=0;i 导入', ' 取消'], + // 弹层外区域关闭 + shadeClose: true, + btn1: function(index, layero){ + var file = layero.find('#file').val(); + if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) { + $.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。"); + return false; + } + var index = layer.load(2, {shade: false}); + $.modal.disable(); + + // 获取CheckBox的状态 + var updateSupport = layero.find('#updateSupport').is(':checked'); + + var formData = new FormData(layero.find('form')[0]); + formData.append('updateSupport', updateSupport); // 添加CheckBox的状态到FormData + + $.ajax({ + url: table.options.importUrl, + data: formData, + cache: false, + contentType: false, + processData: false, + type: 'POST', + success: function (result) { + layer.close(index); + $.modal.enable(); + + $.modal.closeAll(); + $.modal.alertSuccess(result); + $.table.refresh(); + }, + error: function (result){ + layer.close(index); + $.modal.alertError(result); + } + }); + } + }); + } diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/material.html b/ruoyi-admin/src/main/resources/templates/erp/material/material.html index 4d90907c..09694178 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/material.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/material.html @@ -133,84 +133,26 @@ columns: [ {checkbox: true}, {title: '主键ID',field: 'id',visible: false}, - {title: '料号',field: 'materialNo', - formatter: function(value, row, index) { - if(row.auditStatus=="0"){ - return '' + (value ? value : "-") + ''; - } - return value; - } - }, - {title: '物料名称',field: 'materialName', - formatter: function(value, row, index) { - if(row.auditStatus=="0"){ - return '' + (value ? value : "-") + ''; - } - return value; - } - }, - {title: '描述',field: 'describe', - formatter: function(value, row, index) { - if(row.auditStatus=="0"){ - return '' + (value ? value : "-") + ''; - } - return value; - } - }, - {title: '品牌',field: 'brand', - formatter: function(value, row, index) { - if(row.auditStatus=="0"){ - return '' + (value ? value : "-") + ''; - } - return value; - } - }, + {title: '料号',field: 'materialNo',}, + {title: '物料名称',field: 'materialName',}, + {title: '描述',field: 'describe',}, + {title: '品牌',field: 'brand',}, {title: '半成品类型',field: 'processMethod', formatter: function(value, row, index) { - var showvalue = $.table.selectDictLabel(processMethodDatas, value); - if(row.auditStatus=="0"){ - return '' + (showvalue ? showvalue : "-") + ''; - } - return showvalue; + return $.table.selectDictLabel(processMethodDatas, value); } }, - {title: '单位',field: 'unit', - formatter: function(value, row, index) { - // var showvalue = $.table.selectDictLabel(sysUnitClassDatas, value); - if(row.auditStatus=="0"){ - return '' + (value ? value : "-") + ''; - } - return value; - } - }, + {title: '单位',field: 'unit',}, {title: '图片',field: 'photoUrl', formatter: function(value, row, index) { - var showvalue = $.table.imageView(value); - if(row.auditStatus=="0"){ - return '' + (showvalue ? showvalue : "-") + ''; - } - return showvalue; + return $.table.imageView(value); } }, {title: '申请人',field: 'applyUserName', formatter: function(value, row, index) {return '' + (value ? value : "-") + '';} }, - {title: '申请时间',field: 'applyTime', - formatter: function(value, row, index) { - if(row.auditStatus=="0"){ - return '' + (value ? value : "-") + ''; - } - return value; - } - }, - {title: '上次更新时间',field: 'updateTime', - formatter: function(value, row, index) { - if(row.auditStatus=="0"){ - return '' + (value ? value : "-") + ''; - } - return value; - } - }, + {title: '申请时间',field: 'applyTime',}, + {title: '上次更新时间',field: 'updateTime',}, {title: '当前状态',field: 'taskName',align: 'center', formatter: function(value, row, index) { if(row.auditStatus!="1"&&value != "未启动"){ @@ -287,7 +229,15 @@ return actions.join(''); } } - ] + ], + rowStyle: function (row, index) { + if (row.auditStatus=="0") { + // 如果审核状态为待审核,则设置为红色 + return {css:{"color":"red"}}; + } + // 否则使用默认样式 + return {}; + } }; $.table.init(options); });