提交 0f174da2 编写于 作者: W weizhiqiang

资产管理修改

上级 5098367f
......@@ -4,20 +4,19 @@ var taskType = "";//流程详情的主标题
var processInstanceId = "";//流程id
layui.config({
base: basePath,
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate'], function (exports) {
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
laydate = layui.laydate,
table = layui.table;
// 新增资产
authBtn('1566465526122');
showAssetList();
// 资产列表管理开始
function showAssetList(){
......@@ -32,7 +31,7 @@ layui.config({
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'companyName', title: '所属公司', align: 'center', width: 170 },
{ field: 'assetName', title: '名称', width: 120, templet: function (d) {
return '<a lay-event="assetlistdetails" class="notice-title-click">' + d.assetName + '</a>';
......@@ -41,93 +40,40 @@ layui.config({
{ field: 'assetNum', title: '资产编号', width: 100 },
{ field: 'unitPrice', title: '资产单价', align: 'center', width: 80 },
{ field: 'employeeId', title: '领用人', align: 'center', width: 80 },
{ field: 'state', title: '状态', width: 80, align: 'center', templet: function (d) {
if(d.state == '1'){
return "<span class='state-up'>正常</span>";
}else if(d.state == '2'){
return "<span class='state-down'>维修</span>";
}else if(d.state == '3'){
return "<span class='state-down'>报废</span>";
} else {
return "参数错误";
}
}},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 250, toolbar: '#assetlisttableBar'}
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 250, toolbar: '#assetlisttableBar' }
]],
done: function(){
matchingLanguage();
}
});
}
// 资产的操作事件
table.on('tool(assetlistTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'assetlistrepair') { //修复
assetlistrepair(data);
}else if (layEvent === 'assetlistdetails') { //详情
assetlistdetails(data);
}else if (layEvent === 'assetlistscrap'){ //报废
assetlistscrap(data);
}else if (layEvent === 'assetlistnormal'){ //恢复正常
assetlistnormal(data);
}else if (layEvent === 'assetlistdelet'){ //删除
assetlistdelet(data);
}else if (layEvent === 'assetlistedit'){ //编辑
assetlistedit(data);
}
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'assetlistdetails') { // 详情
assetlistdetails(data);
} else if (layEvent === 'assetlistdelet') { // 删除
assetlistdelet(data);
} else if (layEvent === 'assetlistedit') { // 编辑
assetlistedit(data);
}
});
form.render();
// 资产详情
function assetlistdetails(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/assetManage/assetManageDetails.html",
url: "../../tpl/assetManage/assetManageDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "assetManageDetails",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
}});
}
// 维修
function assetlistrepair(data){
var msg = '确认维修该资产吗?';
layer.confirm(msg, { icon: 3, title: '维修操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "asset008", params:{rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadassetTable();
}});
});
}
// 报废
function assetlistscrap(data){
var msg = '确认报废该资产吗?';
layer.confirm(msg, { icon: 3, title: '报废操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "asset009", params:{rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadassetTable();
}});
});
}
// 恢复正常
function assetlistnormal(data){
var msg = '确认对该资产恢复正常吗?';
layer.confirm(msg, { icon: 3, title: '恢复操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "asset007", params:{rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadassetTable();
}});
});
}
// 删除
function assetlistdelet(data){
......@@ -143,7 +89,7 @@ layui.config({
// 新增资产
$("body").on("click", "#assetlistaddBean", function() {
_openNewWindows({
url: "../../tpl/assetManage/assetManageAdd.html",
url: "../../tpl/assetManage/assetManageAdd.html",
title: "新增资产",
pageId: "assetManageAdd",
area: ['90vw', '90vh'],
......@@ -152,12 +98,12 @@ layui.config({
loadassetTable();
}});
});
// 编辑资产
function assetlistedit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/assetManage/assetManageEdit.html",
url: "../../tpl/assetManage/assetManageEdit.html",
title: "编辑资产",
pageId: "assetManageEdit",
area: ['90vw', '90vh'],
......@@ -166,26 +112,25 @@ layui.config({
loadassetTable();
}});
}
$("body").on("click", "#assetlistreloadTable", function() {
loadassetTable();
});
function loadassetTable(){
table.reload("assetlistTable", {where: getTableParams()});
}
// 搜索表单
$("body").on("click", "#assetlistSearch", function() {
table.reload("assetlistTable", {page: {curr: 1}, where: getTableParams()});
});
function getTableParams(){
return {
assetName:$("#assetName").val(),
state:$("#state").val()
assetName: $("#assetName").val()
};
}
exports('assetManageList', {});
});
......@@ -12,34 +12,30 @@ layui.config({
form = layui.form,
table = layui.table;
showList();
// 我名下的资产列表
function showList(){
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'myhasmation001',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
{ field: 'companyName', title: '所属公司', align: 'left', width: 170 },
{ field: 'assetName', title: '资产名称', align: 'left', width: 120 },
{ field: 'typeName', title: '资产类型', align: 'left', width: 100 },
{ field: 'assetNum', title: '资产编号', align: 'left', width: 100 },
{ field: 'specifications', title: '资产规格', align: 'left', width: 120 },
{ field: 'employeeName', title: '领用人', align: 'left', width: 80 },
{ field: 'assetAdmin', title: '管理员', align: 'left', width: 80 },
]],
done: function(){
matchingLanguage();
}
});
}
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'myhasmation001',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'assetName', title: '资产名称', align: 'left', width: 120 },
{ field: 'typeName', title: '资产类型', align: 'left', width: 100 },
{ field: 'assetNum', title: '资产编号', align: 'left', width: 100 },
{ field: 'specifications', title: '资产规格', align: 'left', width: 120 },
{ field: 'employeeName', title: '领用人', align: 'left', width: 120 },
{ field: 'assetAdmin', title: '管理员', align: 'left', width: 120 },
]],
done: function(){
matchingLanguage();
}
});
$("body").on("click", "#reloadmessageTable", function() {
loadTable();
......
......@@ -16,15 +16,6 @@
<div class="layui-input-inline">
<input type="text" id="assetName" name="assetName" placeholder="请输入资产名称" class="layui-input" />
</div>
<label class="layui-form-label">状态</label>
<div class="layui-input-inline">
<select id="state" name="state">
<option value="">全部</option>
<option value="1">正常</option>
<option value="2">维修</option>
<option value="3">报废</option>
</select>
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" type="button" id="assetlistSearch"><language showName="com.skyeye.search2"></language></button>
</div>
......@@ -40,30 +31,6 @@
<div style="margin:auto 10px;">
<table id="assetlistTable" lay-filter="assetlistTable"></table>
<script type="text/html" id="assetlisttableBar">
{{# if(d.state == 1){ }}
{{# if(auth('1566466025361')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="assetlistrepair">维修</a>
{{# } }}
{{# if(auth('1566466057757')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="assetlistscrap">报废</a>
{{# } }}
{{# } }}
{{# if(d.state == 2){ }}
{{# if(auth('1566466091879')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="assetlistnormal">恢复正常</a>
{{# } }}
{{# if(auth('1566466057757')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="assetlistscrap">报废</a>
{{# } }}
{{# } }}
{{# if(d.state == 3){ }}
{{# if(auth('1566466091879')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="assetlistnormal">恢复正常</a>
{{# } }}
{{# if(auth('1566466025361')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="assetlistrepair">维修</a>
{{# } }}
{{# } }}
{{# if(auth('1566465526122')){ }}
<a class="layui-btn layui-btn-xs" lay-event="assetlistedit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册