744 lines
33 KiB
Plaintext
744 lines
33 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|||
|
|
<%@page import="com.sipai.tools.CommString"%>
|
|||
|
|
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
|||
|
|
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
|||
|
|
<%request.setAttribute("AUDIT", SparePartCommString.STATUS_STOCK_AUDIT); %>
|
|||
|
|
<%request.setAttribute("START", SparePartCommString.STATUS_STOCK_START); %>
|
|||
|
|
<%request.setAttribute("FINSH", SparePartCommString.STATUS_STOCK_FINISH); %>
|
|||
|
|
<%request.setAttribute("Status_OFF", EquipmentCard.Status_OFF); %>
|
|||
|
|
<%request.setAttribute("Status_ON", EquipmentCard.Status_ON); %>
|
|||
|
|
<%request.setAttribute("Status_Fault", EquipmentCard.Status_Fault); %>
|
|||
|
|
<%request.setAttribute("Status_Transfer", EquipmentCard.Status_Transfer); %>
|
|||
|
|
<%request.setAttribute("Status_Scrap", EquipmentCard.Status_Scrap); %>
|
|||
|
|
<%request.setAttribute("Status_STOP", EquipmentCard.Status_STOP); %>
|
|||
|
|
<%request.setAttribute("Status_IN", EquipmentCard.Status_IN); %>
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
.select2-container .select2-selection--single{
|
|||
|
|
height:34px;
|
|||
|
|
line-height: 34px;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
.select2-selection__arrow{
|
|||
|
|
margin-top:3px;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
//流程审核文件上传所需参数
|
|||
|
|
var masterId_process = '${id}';//业务Id
|
|||
|
|
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
|||
|
|
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
|||
|
|
var status = 'delete';//有删除权限
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
setTimeout(function(){
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/equipment/EquipmentTransfersApply/dosave.do", $("#subForm").serialize(), function(data) {
|
|||
|
|
if (data.res == 1){
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
}else if(data.res == 0){
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d',data.res);
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}, 100);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
|
|||
|
|
deptId: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '部门不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
applyTime: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '申请时间不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
transfersInstr: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '设备调拨原因及要求不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
//提交审核
|
|||
|
|
function dosubmit(){
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('auditMan', 'NOT_VALIDATED',null)
|
|||
|
|
.validateField('auditMan');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/equipment/EquipmentTransfersApply/startProcess.do", $("#subForm").serialize(), function(data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal('subModal');
|
|||
|
|
}else if(data.res == 0){
|
|||
|
|
showAlert('d','保存失败');
|
|||
|
|
}else if(data.res == 2){
|
|||
|
|
showAlert('d','未检测到审核流程,请先部署流程!');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d',data.res);
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//提交时先验证审核人不能为空,保存时审核人可以为空
|
|||
|
|
function submitFun(){
|
|||
|
|
//新增的输入框添加验证
|
|||
|
|
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '接收人员不能为空'
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
dosubmit();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//厂区ID
|
|||
|
|
var companyId = "${company.id}";
|
|||
|
|
//console.log("companyId="+companyId);
|
|||
|
|
$(function() {
|
|||
|
|
//初始化文件显示
|
|||
|
|
getFileList_process();
|
|||
|
|
$('#table_equipmentTransfersApplyDetail').bootstrapTable({ // 对应table标签的id
|
|||
|
|
//url: ext.contextPath + '/sparepart/outStockRecord/getOutStockDetailList.do', // 获取表格数据的url
|
|||
|
|
url: ext.contextPath + '/equipment/EquipmentTransfersApply/getEquipmentTransfersApplyDetailList.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 10, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
transfersApplyNumber:'${transfersApplyNumber}'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
checkbox: true, // 显示一个勾选框
|
|||
|
|
},{
|
|||
|
|
field: 'equipmentCard.equipmentcardid', // 返回json数据中的name
|
|||
|
|
title: '设备厂内编码', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'equipmentCard.equipmentstatus', // 返回json数据中的name
|
|||
|
|
title: '状态', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
switch (value){
|
|||
|
|
case '${Status_OFF}' :
|
|||
|
|
return "封存";
|
|||
|
|
case '${Status_ON}' :
|
|||
|
|
return "在用";
|
|||
|
|
case '${Status_Fault}' :
|
|||
|
|
return "故障";
|
|||
|
|
case '${Status_Transfer}' :
|
|||
|
|
return "拨出";
|
|||
|
|
case '${Status_Scrap}' :
|
|||
|
|
return "报废";
|
|||
|
|
case '${Status_STOP}' :
|
|||
|
|
return "停用";
|
|||
|
|
case '${Status_IN}' :
|
|||
|
|
return "拨入";
|
|||
|
|
default :
|
|||
|
|
return "";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},{
|
|||
|
|
field: 'equipmentCard.equipmentname', // 返回json数据中的name
|
|||
|
|
title: '设备名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
},{
|
|||
|
|
field: 'equipmentCard.areaid', // 返回json数据中的name
|
|||
|
|
title: '安装地点', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},{
|
|||
|
|
field: 'equipmentCard.assetnumber', // 返回json数据中的name
|
|||
|
|
title: '资产编码', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentCard.equipmentmanufacturer', // 返回json数据中的name
|
|||
|
|
title: '生产商', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'equipmentCard.equipmentvalue', // 返回json数据中的name
|
|||
|
|
title: '资产原值(元)', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
|
|||
|
|
},{
|
|||
|
|
field: 'equipmentCard.residualvalue', // 返回json数据中的name
|
|||
|
|
title: '剩余价值(元)', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
|
|||
|
|
|
|||
|
|
onLoadSuccess: function(){ //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_equipmentTransfersApplyDetail");
|
|||
|
|
},
|
|||
|
|
onLoadError: function(){ //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#table_stockTransfersApplyDetail').bootstrapTable({ // 对应table标签的id
|
|||
|
|
//url: ext.contextPath + '/sparepart/outStockRecord/getOutStockDetailList.do', // 获取表格数据的url
|
|||
|
|
url: ext.contextPath + '/equipment/EquipmentTransfersApply/getStockApplyDetailList.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 10, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'server', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
|||
|
|
sort: params.sort, // 要排序的字段
|
|||
|
|
order: params.order,
|
|||
|
|
transfersApplyNumber:'${transfersApplyNumber}'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
sortName: 'id', // 要排序的字段
|
|||
|
|
sortOrder: 'desc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
checkbox: true, // 显示一个勾选框
|
|||
|
|
},{
|
|||
|
|
field: 'stock.goods.name', // 返回json数据中的name
|
|||
|
|
title: '设备名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
},{
|
|||
|
|
field: 'stock.goods.model', // 返回json数据中的name
|
|||
|
|
title: '设备规格', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
},{
|
|||
|
|
field: 'stock.goods.brand', // 返回json数据中的name
|
|||
|
|
title: '品牌', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
},{
|
|||
|
|
field: 'number', // 返回json数据中的name
|
|||
|
|
title: '数量', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
editable: { //编辑列元素
|
|||
|
|
type: 'text',
|
|||
|
|
title: '数量',
|
|||
|
|
validate: function (v) {
|
|||
|
|
if (!v) return '数量不能为空';
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}, {
|
|||
|
|
field: 'price', // 返回json数据中的name
|
|||
|
|
title: '单价/元', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle' // 上下居中
|
|||
|
|
}, {
|
|||
|
|
field: 'totalMoney', // 返回json数据中的name
|
|||
|
|
title: '合计(元)', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle', // 上下居中
|
|||
|
|
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
|
|||
|
|
//保存列修改后的数据
|
|||
|
|
onEditableSave: function (field, row, oldValue, $el) {
|
|||
|
|
//$.post(ext.contextPath + "/sparepart/outStockRecord/updateOutStockDetail.do", {id:row.id,price:row.price,number:row.outNumber}, function(data) {
|
|||
|
|
$.post(ext.contextPath + "/equipment/EquipmentTransfersApply/updateStockTransfersApplyDetail.do", {id:row.id,price:row.price,number:row.number,transfersApplyNumber:'${transfersApplyNumber}'}, function(data) {
|
|||
|
|
if (data.res >= 1){
|
|||
|
|
$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
|||
|
|
$("#table_stockTransfersApplyDetail").bootstrapTable('refresh');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d',data.message);
|
|||
|
|
$("#table_stockTransfersApplyDetail").bootstrapTable('refresh');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
},
|
|||
|
|
onLoadSuccess: function(){ //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_stockTransfersApplyDetail");
|
|||
|
|
},
|
|||
|
|
onLoadError: function(){ //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//申请时间
|
|||
|
|
$("#applyTime").datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
todayHighlight: true,
|
|||
|
|
format:'yyyy-mm-dd',
|
|||
|
|
}).on('hide',function(e) {
|
|||
|
|
//当日期选择框关闭时,执行刷新校验
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('applyTime', 'NOT_VALIDATED',null)
|
|||
|
|
.validateField('applyTime');
|
|||
|
|
});
|
|||
|
|
$("#applyTime").datepicker('setDate',new Date());
|
|||
|
|
//选择部门
|
|||
|
|
/*
|
|||
|
|
$.post(ext.contextPath + "/user/getDeptByBizId4Select.do", {companyId:companyId}, function(data) {
|
|||
|
|
var selelct =$("#deptId").select2({
|
|||
|
|
data: data,
|
|||
|
|
placeholder:'请选择',//默认文字提示
|
|||
|
|
allowClear: false,//允许清空
|
|||
|
|
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
selelct.val('').trigger("change");
|
|||
|
|
selelct.on("change",function(e){
|
|||
|
|
$('#deptName').val($("#deptId option:checked").text());
|
|||
|
|
//$('#deptName').val($(this).text());
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
},'json');
|
|||
|
|
*/
|
|||
|
|
});
|
|||
|
|
//选择审核人
|
|||
|
|
var showUser4AuditSelectsFun = function() {
|
|||
|
|
var userIds= $("#auditId").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelect.do', {formId:"subForm",hiddenId:"auditId",textId:"auditMan",userIds:userIds} , function(data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
//新增设备调拨明细
|
|||
|
|
var addDetailFun = function() {
|
|||
|
|
stopBubbleDefaultEvent();
|
|||
|
|
var allTableData = $("#table_equipmentTransfersApplyDetail").bootstrapTable('getData');
|
|||
|
|
var equipmentCardIds="";
|
|||
|
|
$.each(allTableData,function(index,item){
|
|||
|
|
if(equipmentCardIds!=""){
|
|||
|
|
equipmentCardIds+=",";
|
|||
|
|
}
|
|||
|
|
equipmentCardIds+=item.equipmentCardId;
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/selectEquipmentCardDetails.do', {equipmentCardIds:equipmentCardIds,companyId:unitId},
|
|||
|
|
function(data) {
|
|||
|
|
$("#equipmentCard4SelectsDiv").html(data);
|
|||
|
|
openModal('subDetailModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var doFinishSelects = function(data) {
|
|||
|
|
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/saveEquipmentTransfersApplyDetails.do', {transfersApplyNumber:'${transfersApplyNumber}',
|
|||
|
|
equipmentCardIds:data} , function(data) {
|
|||
|
|
if(data.res){
|
|||
|
|
$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
|||
|
|
$("#table_equipmentTransfersApplyDetail").bootstrapTable('refresh');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
};
|
|||
|
|
//删除多条明细数据
|
|||
|
|
var deletesDetailFun = function() {
|
|||
|
|
var checkedItems = $("#table_equipmentTransfersApplyDetail").bootstrapTable('getSelections');
|
|||
|
|
var datas="";
|
|||
|
|
$.each(checkedItems, function(index, item){
|
|||
|
|
datas+=item.id+",";
|
|||
|
|
});
|
|||
|
|
if(datas==""){
|
|||
|
|
showAlert('d','请先选择记录','alertDiv');
|
|||
|
|
}else{
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function(willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/deletesEquipmentTransfersApplyDetail.do', {ids:datas,money:$('#totalMoney').val(),transfersApplyNumber:'${transfersApplyNumber}'} , function(data) {
|
|||
|
|
|
|||
|
|
if(data.res){
|
|||
|
|
$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
|||
|
|
$("#table_equipmentTransfersApplyDetail").bootstrapTable('refresh');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','删除失败','alertDiv');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var addStockDetailFun = function() {
|
|||
|
|
//stopBubbleDefaultEvent();
|
|||
|
|
var allTableData = $("#table_stockTransfersApplyDetail").bootstrapTable('getData');
|
|||
|
|
var stockIds="";
|
|||
|
|
$.each(allTableData,function(index,item){
|
|||
|
|
if(stockIds!=""){
|
|||
|
|
stockIds+=",";
|
|||
|
|
}
|
|||
|
|
stockIds+=item.stockId;
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/selectStockDetails.do', {stockIds:stockIds,companyId:'${company.id}'},
|
|||
|
|
function(data) {
|
|||
|
|
$("#stock4SelectsDiv").html(data);
|
|||
|
|
openModal('subStockDetailModal');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var doStockFinishSelects = function(data) {
|
|||
|
|
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/saveStockTransfersApplyDetails.do', {transfersApplyNumber:'${transfersApplyNumber}',
|
|||
|
|
stockIds:data} , function(data) {
|
|||
|
|
if(data.res){
|
|||
|
|
$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
|||
|
|
$("#table_stockTransfersApplyDetail").bootstrapTable('refresh');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
};
|
|||
|
|
//删除多条明细数据
|
|||
|
|
var deletesStockDetailFun = function() {
|
|||
|
|
var checkedItems = $("#table_stockTransfersApplyDetail").bootstrapTable('getSelections');
|
|||
|
|
var datas="";
|
|||
|
|
$.each(checkedItems, function(index, item){
|
|||
|
|
datas+=item.id+",";
|
|||
|
|
});
|
|||
|
|
if(datas==""){
|
|||
|
|
showAlert('d','请先选择记录','alertDiv');
|
|||
|
|
}else{
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function(willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/equipment/EquipmentTransfersApply/deletesStockTransfersApplyDetail.do', {ids:datas,money:$('#totalMoney').val(),transfersApplyNumber:'${transfersApplyNumber}'} , function(data) {
|
|||
|
|
|
|||
|
|
if(data.res){
|
|||
|
|
$('#totalMoney').val(parseFloat(data.totalMoney).toFixed(2));
|
|||
|
|
$("#table_stockTransfersApplyDetail").bootstrapTable('refresh');
|
|||
|
|
}else{
|
|||
|
|
showAlert('d','删除失败','alertDiv');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
var showCompany4SelectFun = function () {
|
|||
|
|
/*
|
|||
|
|
$.post(ext.contextPath + '/user/showCompany4Select.do', {formId: "subForm", hiddenId: "sendToBizId", textId: "sendToBizName"}, function (data) {
|
|||
|
|
$("#selectCompanyDiv").html(data);
|
|||
|
|
openModal("company4SelectModal");
|
|||
|
|
});
|
|||
|
|
*/
|
|||
|
|
//简易部门combotree
|
|||
|
|
$.post(ext.contextPath + '/user/getAllCompanyForTree.do', { ng: '' }, function (data) {
|
|||
|
|
if ((data.length == 1 && data.nodes != "") || data.length > 1) {
|
|||
|
|
$('#companiestree').treeview({
|
|||
|
|
data: data,
|
|||
|
|
showBorder: false,
|
|||
|
|
levels: 3,
|
|||
|
|
});
|
|||
|
|
$('#companiestree').on('nodeSelected', function (event, data) {
|
|||
|
|
$("#search_userPid").val(data.id);
|
|||
|
|
$("#coname_input").val(data.text);
|
|||
|
|
document.getElementById('user_tree').style.display = "none";
|
|||
|
|
bizId= data.id;
|
|||
|
|
$("#sendToBizId").val(bizId);
|
|||
|
|
$("#sendToBizName").val($("#coname_input").val());
|
|||
|
|
//doSearchUser();
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
//防止点击树的+号收起下拉框
|
|||
|
|
$("#user_tree").on("click", function (e) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
});
|
|||
|
|
//点击空白隐藏树
|
|||
|
|
$(document).click(function (e) {
|
|||
|
|
var divTree = $('#user_tree'); // 设置目标区域
|
|||
|
|
if (!divTree.is(e.target) && divTree.has(e.target).length === 0) {
|
|||
|
|
divTree.hide()
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModal">
|
|||
|
|
<div class="modal-dialog modal-xlg">
|
|||
|
|
<div class="modal-content">
|
|||
|
|
<div class="modal-header">
|
|||
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|||
|
|
<span aria-hidden="true">×</span></button>
|
|||
|
|
<h4 class="modal-title">新增设备调拨申请单</h4>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-body">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input name="id" id="id" type="hidden" value="${id}"/>
|
|||
|
|
<input name="bizId" id="bizId" type="hidden" value="${company.id}"/>
|
|||
|
|
<input name="companyName" id="companyName" type="hidden" value="${company.name}"/>
|
|||
|
|
<input name="deptName" id="deptName" type="hidden" value=""/>
|
|||
|
|
<input name="applyPeopleId" id="applyPeopleId" type="hidden" value="${cu.id}"/>
|
|||
|
|
<input name="applyPeopleName" id="applyPeopleName" type="hidden" value="${cu.caption}"/>
|
|||
|
|
<input name="status" type="hidden" value="${START}"/>
|
|||
|
|
<input id="sendToBizId" name="sendToBizId" type="hidden" value="" />
|
|||
|
|
<input id="sendToBizName" name="sendToBizName" type="hidden" value="" />
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*调入部门</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<p class="form-control-static" >${company.name}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<!--
|
|||
|
|
<label class="col-sm-2 control-label">*调入部门</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="text" class="form-control" id="sendToBizName" name="sendToBizName" placeholder="点击选择" readonly
|
|||
|
|
onclick="showCompany4SelectFun();" value=""
|
|||
|
|
style="border-radius:4px;background-color: white">
|
|||
|
|
<input id="sendToBizId" name="sendToBizId" type="hidden" value="" />
|
|||
|
|
</div>
|
|||
|
|
-->
|
|||
|
|
<label class="col-sm-2 control-label" style="display:inline-block;">*调出部门</label>
|
|||
|
|
<div style="display:inline-block;margin-left:15px;">
|
|||
|
|
<ul id="companyForUserSelect" style="list-style-type:none;padding-left:0px;width:260px;">
|
|||
|
|
<li class="dropdown" style="width:270px;">
|
|||
|
|
<!-- Menu toggle button -->
|
|||
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
|||
|
|
style="width:260px;" onclick="document.getElementById('user_tree').style.display = 'block';">
|
|||
|
|
<div class="input-group">
|
|||
|
|
<!-- -->
|
|||
|
|
|
|||
|
|
<!--
|
|||
|
|
<span class="input-group-addon"
|
|||
|
|
style="height:34px;color:#000000;border-top-left-radius: 4px;border-bottom-left-radius: 4px;font-weight:bold">部门:
|
|||
|
|
</span>
|
|||
|
|
-->
|
|||
|
|
|
|||
|
|
<input class="form-control " id="coname_input" name="coname_input" placeholder="请选择" onclick="showCompany4SelectFun()"
|
|||
|
|
style="height:34px;width: 270px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;"
|
|||
|
|
readonly />
|
|||
|
|
|
|||
|
|
</div><!-- /input-group -->
|
|||
|
|
</a>
|
|||
|
|
<ul id="user_tree" class="dropdown-menu" data-stopPropagation="true">
|
|||
|
|
<li class="header">
|
|||
|
|
<div id="companiestree" style="width: 270px;height:300px; overflow:auto;"></div>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<!--
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*部门</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<select class="form-control select2" id="deptId" name ="deptId" style="width: 270px;"></select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
-->
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*设备调拨申请单编号</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="text" class="form-control" id="transfersApplyNumber" name ="transfersApplyNumber" value="${transfersApplyNumber}" readonly>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="control-label col-sm-2">*申请日期</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<div class="input-group date">
|
|||
|
|
<div class="input-group-addon">
|
|||
|
|
<i class="fa fa-calendar"></i>
|
|||
|
|
</div>
|
|||
|
|
<input type="text" class="form-control" id="applyTime" name="applyTime" style="width: 230px;" placeholder="请选择"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">价值(元)</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="text" class="form-control" id="totalMoney" name ="totalMoney" >
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*申请人</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="text" class="form-control" id="applyPeopleName" name ="applyPeopleName" disabled value="${cu.caption}" >
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*接收人员</label>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="text" class="form-control" id="auditMan" name="auditMan" placeholder="点击选择" onclick="showUser4AuditSelectsFun();" value="">
|
|||
|
|
<input id="auditId" name="auditId" type="hidden" value="" />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">调出部门意见</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control " id="deptOpinion" name="deptOpinion" rows="2" placeholder="调出部门意见"></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*设备调拨原因和要求</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control " id="transfersInstr" name="transfersInstr" rows="2" placeholder="调拨原因和要求"></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">备注</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control " id="remark" name="remark" rows="2" placeholder="调拨的设备名称(选填)"></textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- 文件上传,显示 -->
|
|||
|
|
<div class="form-group" style="margin:8px">
|
|||
|
|
<label class="col-sm-2 control-label"></label>
|
|||
|
|
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i class="fa fa-paperclip"></i>上传文件</button>
|
|||
|
|
</div>
|
|||
|
|
<div id="fileArea">
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
|
|||
|
|
<div class="box box-primary" id='equipmentCardOnclickDiv'>
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">调拨设备台账明细</h3>
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="addDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
|||
|
|
<a onclick="deletesDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
|
|||
|
|
<table id="table_equipmentTransfersApplyDetail"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- 2019-08-09新增 -->
|
|||
|
|
<div class="box box-primary" id="stockOnclickDiv">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">调拨设备库存明细</h3>
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="addStockDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
|||
|
|
<a onclick="deletesStockDetailFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
|
|||
|
|
<table id="table_stockTransfersApplyDetail"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="dosave()" id="btn_save">保存</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交审核</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|