已废弃
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

323 lines
14 KiB

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>任务审批</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all">
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="layui-fluid">
<div class="layui-card">
<div class="layui-card-body" style="padding-top: 40px;">
<div id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
<div style="margin-top: 30px">
<table id="demo" class="layui-table"
style="margin: 0 auto;max-width: 800px;padding-top: 40px;">
<colgroup>
<col width="150">
<col width="200">
<col>
</colgroup>
<tbody>
<tr>
<td>申请编号</td>
<td id="id" style="display: none" th:text="${record.getId()}">123456</td>
<td id="code" th:text="${record.getCode()}">123456</td>
</tr>
<tr>
<td>物料名称</td>
<td>
<button th:each="recordMin,iterStar: ${recordMinList}" th:text="${recordMin.getMname()}" th:value="${recordMin.getId()}"
style="margin: 1px;" onclick="selectThisMinRecord(this)"></button>
</td>
</tr>
<tr>
<td>仓库名称</td>
<td id="depositoryName" th:text="${record.getDepositoryName()}">外芯仓库</td>
</tr>
<tr>
<td>所处库位</td>
<td id="placeId" th:text="${record.getPCode()}"></td>
</tr>
<tr>
<td>数量</td>
<td id="quantity" th:text="${record.getQuantity()}">数量</td>
</tr>
<tr>
<td>计量单位</td>
<td id="unit" th:text="${record.getUnit()}">单位</td>
</tr>
<tr>
<td>金额</td>
<td id="price" th:text="${record.getPrice()}">金额</td>
</tr>
<tr>
<td>状态</td>
<td id="state" th:text="${record.getState()}">状态</td>
<td id="pass" th:text="${record.getPass()}" style="display:none;"></td>
</tr>
<tr>
<td>申请人</td>
<td id="applicantName" th:text="${record.getApplicantName()}">申请人</td>
</tr>
<tr>
<td>请求提交时间</td>
<td id="applicantTime" th:text="${record.getApplicantTime() }">1970-01-01 08:00:00
</td>
</tr>
<tr>
<tr>
<td>申请备注</td>
<td id="applyRemarks" th:text="${record.getApplyRemark()}">申请备注</td>
</tr>
<tr>
<td>部门负责人</td>
<td id="departmentheadName" th:text="${record.getDepartmentheadName()}">部门负责人</td>
</tr>
<tr id="departmentheadMessageT" style="display: none">
<td>审核意见</td>
<td id="departmentheadMessage" th:text="${record.getDepartmentheadMessage()}">审核意见
</td>
</tr>
<tr id="departmentheadTimeT" style="display: none">
<td>审核时间</td>
<td id="departmentheadTime"
th:text="${record.getDepartmentheadTime().equals('1970-01-01 08:00:00')?'':record.getDepartmentheadTime()}">
1970-01-01 08:00:00
</td>
</tr>
<tr id="depositoryManagerNameT" style="display: none">
<td>仓储负责人</td>
<td id="depositoryManagerName" th:text="${record.getDepositoryManagerName()}">
仓储负责人
</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr>
<div id="review">
<div class="layui-form" style="margin: 0 auto;max-width: 900px;padding-top: 40px;">
<div class="layui-form-item">
<label class="layui-form-label">审核备注:</label>
<div class="layui-input-block">
<input id="departmentheadMessageF" name="departmentheadMessage"
placeholder="请填写相关原因及申请原因" value="" class="layui-input"/>
</div>
</div>
<div class="layui-row layui-col-space15">
<div class="layui-input-block">
<div class="layui-col-xs12 layui-col-md3" style="padding: 7.5px">
<button type="button" class="layui-btn" onclick="review(1)">
&emsp;同意&emsp;
</button>
</div>
<div class="layui-col-xs12 layui-col-md3" style="padding: 7.5px">
<button type="button" class="layui-btn layui-btn-danger"
onclick="review(2)">
&emsp;驳回&emsp;
</button>
</div>
</div>
</div>
</div>
</div>
<div id="check" style="display: none">
<div class="layui-form" style="margin: 0 auto;max-width: 900px;padding-top: 40px;">
<div class="layui-form-item">
<label class="layui-form-label">审核备注:</label>
<div class="layui-input-block">
<input id="depositoryManagerMessageF" name="depositoryManagerMessage"
placeholder="请填写相关原因及申请原因" value="" class="layui-input"/>
</div>
</div>
<div class="layui-row layui-col-space15">
<div class="layui-input-block">
<div class="layui-col-xs12 layui-col-md3" style="padding: 7.5px">
<button type="button" class="layui-btn" onclick="check(1)">
&emsp;同意&emsp;
</button>
</div>
<div class="layui-col-xs12 layui-col-md3" style="padding: 7.5px">
<button type="button" class="layui-btn layui-btn-danger"
onclick="check(2)">
&emsp;驳回&emsp;
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
function check() {
}
function review() {
}
function selectThisMinRecord(obj){
}
// 用于标志是否为第一次提交
let flagForForm = false;
layui.use(['form', 'step'], function () {
var $ = layui.$,
form = layui.form,
step = layui.step;
/* var state=$("#state").text();
var pass = $("#pass").text();
//当前处于的状态
var position=0,states={},number = 1;
if (state === "待部门负责人审核" || state === "部门负责人审核未通过") {
// , {title: "未入库"}
states = [ {title: state}];
number = 2;
} else {
if(state === "待仓储中心负责人审核"|| state === "仓储中心负责人审核未通过"){
states = [ {title: state}];
number = 3;
}else{
if(pass === 1 || pass === "1"){
number = 4;
states = [{title:"已出库"}]
}else if(pass === 3 || pass === "3"){
number = 4;
states = [{title:"出库中"}]
}else if(pass === 2 || pass === "2"){
number = 4;
states = [{title:"未出库"}]
}
}
}*/
step.render({
elem: '#stepForm',
filter: 'stepForm',
width: '100%', //设置容器宽度
stepWidth: '750px',
height: '100%',
// position: position,
// number:number,
stepItems: []
});
let departmentheadTime = $("#departmentheadTime").text();
if (departmentheadTime != null && departmentheadTime !== "") {
$("#departmentheadTimeT").show();
$("#departmentheadMessageT").show();
$("#depositoryManagerNameT").show();
$("#review").hide();
$("#check").show();
}
review = function (pass) {
if(!flagForForm){
flagForForm = true;
let data = {};
data.id = $("#id").text();
if (pass == 1) {
data.departmentheadPass = 1;
} else {
data.departmentheadPass = 2;
}
data.departmentheadMessage = $("#departmentheadMessageF").val();
send(data);
}
};
check = function (pass) {
if(!flagForForm) {
flagForForm = true;
let data = {};
data.id = $("#id").text();
if (pass == 1) {
data.depositoryManagerPass = 1;
} else {
data.depositoryManagerPass = 2;
}
data.depositoryManagerMessage = $("#depositoryManagerMessageF").val();
send(data);
}
};
function send(req) {
$.ajax({
url: "/depositoryRecord/review",
type: 'put',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(req),
beforeSend: function () {
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']});
},
success: function (data) {
layer.close(this.layerIndex);
if (data.status >= 300) {
layer.msg(data.statusInfo.detail,
{
icon: 2,
time: 300
},
function () {
window.location = '/ApplicationOutView?id=' + req.id;
});//失败的表情
return;
} else {
layer.msg("提交成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function () {
window.location = '/ApplicationOutView?id=' + req.id;
});
}
},
})
}
selectThisMinRecord = function (obj) {
// console.log(obj)
var minId = obj.value;
layer.open({
type: 2,
title: '详情',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['100%', '100%'],
move : '.layui-layer-title',
fixed:false,
content: '/form_step_lookByminRecordOut?id='+minId,
});
}
})
</script>
</body>
</html>