@ -15,26 +15,28 @@
< input type = "text" name = "equipCode" / >
< / li >
< li >
< label > 设备名称 :< / label >
< input type = "text" name = "equipNam e" / >
< label > 料号 :< / label >
< input type = "text" name = "materialCod e" / >
< / li >
< li >
< label > 出厂编号 :< / label >
< input type = "text" name = "factoryCod e" / >
< label > 物料名称 :< / label >
< input type = "text" name = "materialNam e" / >
< / li >
< li >
< label > 厂家代码 :< / label >
< input type = "text" name = "manufacturerCode " / >
< label > 型号 :< / label >
< input type = "text" name = "equipModel " / >
< / li >
< li >
< label > 设备厂家名称:< / label >
< input type = "text" name = "equipManufacturerName" / >
< label > 设备状态:< / label >
< select name = "equipStatus" th:attr = "dict=${@dict.getType('equipStatus')}" >
< option value = "" > 所有< / option >
< option th:each = "dict : ${@dict.getType('equipStatus')}" th:text = "${dict.dictLabel}" th:value = "${dict.dictValue}" > < / option >
< / select >
< / li >
< li >
< label > 设备状态:< / label >
< select name = "equipStatus" th:attr = "dict=${@dict.getType('equipment_state')} ">
< label > 所在部门 :< / label >
< select type = "text" id = "department" name = "department ">
< option value = "" > 所有< / option >
< option th:each = "dict : ${@dict.getType('sys_equip_status')}" th:text = "${dict.dictLabel}" th:value = "${dict.dictValue}" > < / option >
< / select >
< / li >
< li >
@ -50,11 +52,8 @@
< a class = "btn btn-success" onclick = "$.operate.add()" shiro:hasPermission = "financial:CompantFixedAssets:add" >
< i class = "fa fa-plus" > < / i > 添加
< / a >
< a class = "btn btn-primary single disabled" onclick = "$.operate.edit()" shiro:hasPermission = "financial:CompantFixedAssets:edit" >
< i class = "fa fa-edit" > < / i > 修改
< / a >
< a class = "btn btn-danger multiple disabled" onclick = "$.operate.removeAll()" shiro:hasPermission = "financial:CompantFixedAssets:remove" >
< i class = "fa fa-remove" > < / i > 删除
< a class = "btn btn-success" onclick = "exportExcel()" shiro:hasPermission = "quality:qualityReport:export" >
< i class = "fa fa-download" > < / i > 导出
< / a >
< / div >
< div class = "col-sm-12 select-table table-striped" >
@ -68,56 +67,64 @@
var removeFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:remove')}]];
var cancelFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('financial:CompantFixedAssets:restore')}]];
var equipUnitDatas = [[${@dict.getType('ck_liangci')}]];
var equipUnitDatas = [[${@dict.getType('sys_unit_class')}]];
var equipStatusDatas = [[${@dict.getType('equipStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var prefix = ctx + "financial/compantFixedAssets";
$(function() {
getSelections();
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cance l/{id}",
detailUrl: prefix + "/detai l/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "公司固定资产",
columns: [
{checkbox: true},
{title: '设备档案id',field: 'compantFixedAssetsId',visible: false},
{title: '料号',field: 'materialCode',sort: true},
{title: '物料名称',field: 'materialName',sort: true},
{title: '设备编号',field: 'equipCode',sort: true},
{title: '设备名称',field: 'equipName',sort: true},
{title: '设备型号',field: 'equipModel',sort: true},
{title: '设备重量',field: 'equipWeight',sort: true},
{title: '设备状态',field: 'equipStatus',sort: true},
{title: '计量单位',field: 'equipUnit',
{title: '料号',field: 'materialCode',sort: true,align: 'center'},
{title: '物料名称',field: 'materialName',sort: true,align: 'center'},
{title: '设备编号',field: 'equipCode',sort: true,align: 'center'},
{title: '设备名称',field: 'equipName',sort: true,align: 'center'},
{title: '型号',field: 'equipModel',sort: true,align: 'center'},
{title: '描述',field: 'description',sort: true,align: 'center'},
{title: '单位',field: 'equipUnit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(equipUnitDatas, value);
}
},
{title: '设备类别',field: 'equipCategory',sort: true},
{title: '出厂编号',field: 'factoryCode',sort: true},
{title: '设备价格',field: 'equipPrice',sort: true},
{title: '厂家代码',field: 'manufacturerCode',sort: true},
{title: '设备生产日期',field: 'equipProductionDate',sort: true},
{title: '所在部门',field: 'department',sort: true},
{title: '设备厂家名称',field: 'equipManufacturerName',sort: true},
{title: '设备使用日期',field: 'equipUsageDate',sort: true},
{title: '折旧年数',field: 'depreciationYears',sort: true},
{title: '年折旧率',field: 'annualDepreciationRate',sort: true},
{title: '设备存放位置',field: 'equipStorageLocation',sort: true},
{title: '完成工序',field: 'completeTheProcess',sort: true},
{title: '负责人',field: 'esponsiblePerson',sort: true},
{title: '备注',field: 'remark',sort: true},
{title: '使用状态',field: 'useStatus',
{title: '所在部门',field: 'department',sort: true,align: 'center'},
{title: '设备状态',field: 'equipStatus',sort: true,align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(equipStatusDatas, value);
}
},
{title: '供应商/品牌',field: 'equipManufacturerName',sort: true,align: 'center'},
{title: '金额',field: 'equipPrice',sort: true,align: 'center'},
{title: '领用日期',field: 'equipUsageDate',sort: true,align: 'center'},
{title: '折旧月数',field: 'depreciationYears',sort: true,align: 'center'},
{title: '设备重量',field: 'equipWeight',sort: true,visible: false,},
{title: '设备类别',field: 'equipCategory',sort: true,visible: false,},
{title: '出厂编号',field: 'factoryCode',sort: true,visible: false,},
{title: '厂家代码',field: 'manufacturerCode',sort: true,visible: false,},
{title: '设备生产日期',field: 'equipProductionDate',sort: true,visible: false,},
{title: '年折旧率',field: 'annualDepreciationRate',sort: true,visible: false,},
{title: '设备存放位置',field: 'equipStorageLocation',sort: true,visible: false,},
{title: '完成工序',field: 'completeTheProcess',sort: true,visible: false,},
{title: '负责人',field: 'esponsiblePerson',sort: true,visible: false,},
{title: '备注',field: 'remark',sort: true,visible: false,},
{title: '使用状态',field: 'useStatus',visible: false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{title: '审核状态',field: 'auditStatus',
{title: '审核状态',field: 'auditStatus',visible: false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
@ -126,12 +133,8 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('< a class = "btn btn-success btn-xs ' + editFlag + '" href = "javascript:void(0)" onclick = "$.operate.edit(\'' + row.compantFixedAssetsId + '\')" > < i class = "fa fa-edit" > < / i > 编辑< / a > ');
actions.push('< a class = "btn btn-danger btn-xs ' + removeFlag + '" href = "javascript:void(0)" onclick = "$.operate.remove(\'' + row.compantFixedAssetsId + '\')" > < i class = "fa fa-remove" > < / i > 删除< / a > ');
if(row.delFlag == '0'){
actions.push('< a class = "btn btn-danger btn-xs ' + cancelFlag + '" href = "javascript:void(0)" onclick = "$.operate.cancel(\'' + row.id + '\')" > < i class = "fa fa-remove" > < / i > 作废< / a > ');
}else{
actions.push('< a class = "btn btn-success btn-xs ' + restoreFlag + '" href = "javascript:void(0)" onclick = "$.operate.restore(\'' + row.id + '\')" > < i class = "fa fa-window-restore" > < / i > 恢复< / a > ');
}
actions.push('< a class = "btn btn-success btn-xs " href = "javascript:void(0)" onclick = "$.operate.detail(\'' + row.compantFixedAssetsId + '\')" > < i class = "fa fa-eye" > < / i > 详情< / a > ');
return actions.join('');
}
}
@ -139,6 +142,47 @@
};
$.table.init(options);
});
function getSelections(){
$.ajax({
url: ctx + "system/dept/selectDeptList",
type: "get",
dataType: "json",
success: function (result) {
var deptDatas = result.data;
console.log(deptDatas);
deptDatas.forEach(function (dept){
$('#department').append($('< option > ', {
value: dept.deptName,
text: dept.deptName
}));
})
}
});
}
// 导出
function exportExcel() {
var ids = $.table.selectColumns("compantFixedAssetsId");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出选中数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "& delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
< / script >
< / body >
< / html >