From a2266408211b9e6ffcedc3bc95d35ffd1c4da294 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Mon, 24 Jul 2023 16:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E5=BA=93=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/pages/depository/table-in.html | 2 + .../templates/pages/depository/table-out.html | 63 +++++++------------ 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/src/main/resources/templates/pages/depository/table-in.html b/src/main/resources/templates/pages/depository/table-in.html index 0686dc7e..c9d63f58 100644 --- a/src/main/resources/templates/pages/depository/table-in.html +++ b/src/main/resources/templates/pages/depository/table-in.html @@ -111,6 +111,8 @@ th:style="'display:'+${display}">删除 + + diff --git a/src/main/resources/templates/pages/depository/table-out.html b/src/main/resources/templates/pages/depository/table-out.html index 2ae3ebd3..553833fe 100644 --- a/src/main/resources/templates/pages/depository/table-out.html +++ b/src/main/resources/templates/pages/depository/table-out.html @@ -112,6 +112,27 @@ th:style="'display:'+${display}">删除 + + @@ -127,7 +148,7 @@ function selectMaterialByName(obj) { } - layui.use(['form', 'table', 'laydate','dropdown'], function () { + layui.use(['form', 'table', 'laydate', 'dropdown'], function () { var $ = layui.jquery, form = layui.form, table = layui.table, @@ -190,7 +211,7 @@ {field: 'mcode', width: 150, title: '存货编码'}, {field: 'quantity', width: 100, title: '数量', sort: true}, {field: 'depositoryName', width: 150, title: '仓库名称'}, - {field: 'state', width: 150, title: '流程状态'}, + {field: 'state', width: 150, title: '流程状态',templet:'#approvalState',align:"center"}, {field: 'applicantName', width: 150, title: '申请人'}, {field: 'adminorgName', width: 150, title: '申请人部门'}, {field: 'useAdminorgName', width: 150, title: '使用部门'}, @@ -258,7 +279,7 @@ {field: 'mcode', width: 150, title: '存货编码'}, {field: 'quantity', width: 100, title: '数量', sort: true}, {field: 'depositoryName', width: 150, title: '仓库名称'}, - {field: 'state', width: 150, title: '流程状态'}, + {field: 'state', width: 150, title: '流程状态',templet:'#approvalState',align:"center"}, {field: 'applicantName', width: 150, title: '申请人'}, {field: 'applicantTime', width: 200, title: '申请时间', sort: true}, { @@ -289,48 +310,12 @@ } } - $.each(res['data'], function (i, j) { - let allApproval = j["allApproval"]; - let pass = j["pass"]; - if (pass === 3) { - if (allApproval) { - Layui_SetDataTableRowColor('table', i + 1, '#31bdec'); - } else { - Layui_SetDataTableRowColor('table', i + 1, '#ffb800'); - } - } else if (pass === 1) { - Layui_SetDataTableRowColor('table', i + 1, '#16b777'); - } else { - Layui_SetDataTableRowColor('table', i + 1, '#ff211e'); - } - - - - }); } }); - // 用于给table行上色的方法 - function Layui_SetDataTableRowColor(TabDivId, RowIndex, ColorString) { - try { - let rowItem = $("[lay-id='currentTableId'] tr:eq(" + RowIndex + ")"); - let column = $(rowItem[0].childNodes[7]); - if (column != null) //找到对象了 - { - // console.log(div); - column.css("background-color", ColorString); - - } else { - console.log('没有找到对象'); - } - } catch (e) { - // console.log(e.message); - } - } - // 监听搜索操作 form.on('submit(data-search-btn)', function (data) { var req = {};