1411 lines
71 KiB
Plaintext
1411 lines
71 KiB
Plaintext
<%@page import="com.sipai.entity.sparepart.SparePartCommString"%>
|
||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||
<%request.setAttribute("STATUS_CONTRACT_START", SparePartCommString.STATUS_CONTRACT_START); %>
|
||
<%request.setAttribute("STATUS_CONTRACT_DEPT_AUDIT", SparePartCommString.STATUS_CONTRACT_DEPT_AUDIT); %>
|
||
<%request.setAttribute("STATUS_CONTRACT_DEPT_REJECT", SparePartCommString.STATUS_CONTRACT_DEPT_REJECT); %>
|
||
<%request.setAttribute("STATUS_CONTRACT_AUDIT", SparePartCommString.STATUS_CONTRACT_AUDIT); %>
|
||
<%request.setAttribute("STATUS_CONTRACT_REJECT", SparePartCommString.STATUS_CONTRACT_REJECT); %>
|
||
<%request.setAttribute("STATUS_CONTRACT_EXECUTE", SparePartCommString.STATUS_CONTRACT_EXECUTE); %>
|
||
<%request.setAttribute("STATUS_CONTRACT_FINISH", SparePartCommString.STATUS_CONTRACT_FINISH); %>
|
||
<%request.setAttribute("FINISH", SparePartCommString.STATUS_FINISH); %>
|
||
<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 = '${contract.id}';//业务Id
|
||
var tbName_process = 'TB_Process_UploadFile'; //数据表
|
||
var nameSpace_process ='ProcessUploadFile';//保存文件夹
|
||
var status = 'delete';//有删除权限
|
||
function doend() {
|
||
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) {
|
||
$("#status").val('${STATUS_CONTRACT_FINISH}');
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$.post(ext.contextPath + "/sparepart/contract/update.do", $("#subForm").serialize(), function(data) {
|
||
if (data.res == 1){
|
||
closeModal('subModal');
|
||
$("#table").bootstrapTable('refresh');
|
||
}else if(data.res == 0){
|
||
showAlert('d','保存失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
function doupdate() {
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$("#contractnumber").val($("#contractnumber_left").val()+$("#contractnumber_right").val());
|
||
$.post(ext.contextPath + "/sparepart/contract/update.do", $("#subForm").serialize(), function(data) {
|
||
if (data.res == 1){
|
||
closeModal('subModal');
|
||
$("#table").bootstrapTable('refresh');
|
||
}else if(data.res == 0){
|
||
showAlert('d','保存失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
}
|
||
}
|
||
function dosubmit(){
|
||
$("#status").val('${STATUS_CONTRACT_DEPT_AUDIT}');
|
||
$("#subForm").bootstrapValidator('validate');//提交验证
|
||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||
$("#contractnumber").val($("#contractnumber_left").val()+$("#contractnumber_right").val());
|
||
$.post(ext.contextPath + "/sparepart/contract/startContractProcess.do", $("#subForm").serialize(), function(data) {
|
||
if (data.res == 1){
|
||
closeModal('subModal');
|
||
$("#table").bootstrapTable('refresh');
|
||
}else if(data.res == 2){
|
||
showAlert('d','未检测到合同审核流程,请先部署流程!');
|
||
}else if(data.res == 0){
|
||
showAlert('d','保存失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
}
|
||
}
|
||
//提交时先验证审核人不能为空,保存时审核人可以为空
|
||
function submitFun(){
|
||
//新增的输入框添加验证
|
||
$("#subForm").data('bootstrapValidator').addField('auditMan',{
|
||
validators: {
|
||
notEmpty: {
|
||
message: '审核人不能为空'
|
||
},
|
||
}
|
||
});
|
||
dosubmit();
|
||
}
|
||
|
||
var addNumber = function() {
|
||
var companyId = $("#bizId").val();;
|
||
var deptId = $("#deptId").val();
|
||
var contractclassid = $("#contractclassid").val();
|
||
var channelsid = $("#channelsid").val();//列资渠道
|
||
if(deptId==null){
|
||
showAlert('d','请选择部门');
|
||
return false;
|
||
}
|
||
if(contractclassid==null){
|
||
showAlert('d','请选择类型');
|
||
return false;
|
||
}
|
||
var firstparty = $("#firstparty").val();
|
||
var companyNum = "G";
|
||
if(firstparty=='常州市排水管理处'){
|
||
companyNum = "C";
|
||
}else{
|
||
if(firstparty=='常州市排水管理处和常州市城市排水有限公司'){
|
||
companyNum = "CG";
|
||
}
|
||
}
|
||
$.post(ext.contextPath + '/sparepart/contract/doaddNumber.do', {contractClassId:contractclassid,companyNum:companyNum,deptId:deptId,channelsid:channelsid} , function(data) {
|
||
if(data.res=='true'){
|
||
$("#contractnumber_left").val(data.number.substring(0,15));
|
||
if(data.number.length>15){
|
||
$("#contractnumber_right").val(data.number.substring(16,data.number.length-1));
|
||
}
|
||
}else{
|
||
showAlert('d',data.msg);
|
||
}
|
||
},'json');
|
||
};
|
||
//关闭模态框时刷新表格数据
|
||
function closeModel(){
|
||
closeModal('subModal');
|
||
$("#table").bootstrapTable('refresh');
|
||
}
|
||
//新增付款
|
||
var paymentAddFun= function() {
|
||
var contractId = $("#id").val();
|
||
$.post(ext.contextPath + '/sparepart/contractDetailPayment/add.do', {contractId:contractId},
|
||
function(data) {
|
||
$("#Goods4SelectsDiv").html(data);
|
||
openModal('subDetailModal');
|
||
});
|
||
}
|
||
//编辑付款
|
||
var editFunPayment= function(id) {
|
||
$.post(ext.contextPath + '/sparepart/contractDetailPayment/edit.do', {id:id},
|
||
function(data) {
|
||
$("#Goods4SelectsDiv").html(data);
|
||
openModal('subDetailModal');
|
||
});
|
||
}
|
||
//删除付款
|
||
var deleteFunPayment= function(id) {
|
||
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 + '/sparepart/contractDetailPayment/delete.do', {id : id}, function(data) {
|
||
if(data==1){
|
||
$("#table_Payment").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
|
||
//新增开票
|
||
var invoiceAddFun = function() {
|
||
var contractId = $("#id").val();
|
||
$.post(ext.contextPath + '/sparepart/contractDetailInvoice/add.do', {contractId:contractId},
|
||
function(data) {
|
||
$("#Goods4SelectsDiv").html(data);
|
||
openModal('subDetailModal');
|
||
});
|
||
}
|
||
//编辑开票
|
||
var editFunInvoice = function(id) {
|
||
$.post(ext.contextPath + '/sparepart/contractDetailInvoice/edit.do', {id:id},
|
||
function(data) {
|
||
$("#Goods4SelectsDiv").html(data);
|
||
openModal('subDetailModal');
|
||
});
|
||
}
|
||
//删除开票
|
||
var deleteFunInvoice= function(id) { 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 + '/sparepart/contractDetailInvoice/delete.do', {id : id}, function(data) {
|
||
if(data==1){
|
||
$("#table_Invoice").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','删除失败','mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
var doRefreshContractDetail = function() {
|
||
$("#table_ContractDetail").bootstrapTable('refresh');
|
||
};
|
||
var doFinishSelectContractDetail = function(data) {
|
||
$.post(ext.contextPath + '/sparepart/contract/updateContractDetails.do', {contractId:'${contract.id}',deptId : $("#deptId").val(),
|
||
goodsIds:data} , function(data) {
|
||
if(data.res){
|
||
doRefreshContractDetail();
|
||
}
|
||
},'json');
|
||
};
|
||
//删除多条申购明细数据
|
||
var deletesContractDetailFun = function() {
|
||
var checkedItems = $("#table_ContractDetail").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 + '/sparepart/contract/deletesContractDetail.do', {ids:datas} , function(data) {
|
||
if(data>0){
|
||
$("#table_ContractDetail").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','删除失败','alertDiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
};
|
||
var showUser4SelectsFun = function(hiddenId,textId) {
|
||
var userIds= $("#"+hiddenId).val();
|
||
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {formId:"subForm",hiddenId:hiddenId,textId:textId,userIds:userIds} , function(data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal("user4SelectModal");
|
||
});
|
||
};
|
||
|
||
var showSubscribe4SelectsFun = function() {
|
||
var purchaseId= $("#purchaseId").val();
|
||
var status='${FINISH}';
|
||
$.post(ext.contextPath + '/sparepart/subscribe/subscribeList4select.do', {formId:"subForm",hiddenId:"purchaseId",textId:"purchaseId",purchaseId:purchaseId,status:status} , function(data) {
|
||
$("#fault4SelectDiv").html(data);
|
||
openModal("subDetailModal");
|
||
});
|
||
};
|
||
var doFinishSelects = function(datas) {
|
||
$("#purchaseId").val(datas);
|
||
}
|
||
|
||
|
||
//新增申购明细-历史订单
|
||
var addSubscribeHistoryFun = function() {
|
||
//新增申购明细时,验证部门不能为空
|
||
$("#subForm").data('bootstrapValidator').validateField('deptId');
|
||
if($("#subForm").data('bootstrapValidator').isValidField('deptId')){
|
||
var allTableData = $("#table_SubscribeDetail").bootstrapTable('getData');
|
||
var goodsIds="";
|
||
$.each(allTableData,function(index,item){
|
||
if(goodsIds!=""){
|
||
goodsIds+=",";
|
||
}
|
||
goodsIds+=item.goods.id;
|
||
})
|
||
var goodsIds="";
|
||
var subscribeId = $("#purchaseId").val();
|
||
if(subscribeId=='' || subscribeId==null){
|
||
showAlert('d','请先选择采购申请单!','alertDiv');
|
||
return false;
|
||
}
|
||
var contractId = $("#id").val();
|
||
$.post(ext.contextPath + '/sparepart/subscribe/selectGoodsForSubscribeHistory.do', {goodsIds:goodsIds,contractId:contractId,subscribeId:subscribeId},
|
||
function(data) {
|
||
$("#fault4SelectDiv").html(data);
|
||
openModal('subDetailModal');
|
||
});
|
||
}
|
||
};
|
||
|
||
var doFinishSelectSubscribeDetail = function(data) {
|
||
var contractId = $("#id").val();
|
||
var subscribeId = $("#purchaseId").val();
|
||
$.post(ext.contextPath + '/sparepart/subscribe/updateSubscribeDetails4contract.do', {subscribeId:subscribeId,contractId : contractId, goodsIds:data} , function(data) {
|
||
if(data.res){
|
||
$("#table_SubscribeDetail").bootstrapTable('refresh');
|
||
}
|
||
},'json');
|
||
};
|
||
|
||
//删除多条申购明细数据
|
||
var deletesSubscribeHistoryFun = function() {
|
||
var checkedItems = $("#table_SubscribeDetail").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) {
|
||
var contractId = $("#id").val();
|
||
$.post(ext.contextPath + '/sparepart/subscribe/deletesSubscribeDetail4contract.do', {ids:datas} , function(data) {
|
||
if(data>0){
|
||
$("#table_SubscribeDetail").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','删除失败','alertDiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
};
|
||
var companyId = "${contract.bizId}";
|
||
|
||
//初始化部门
|
||
var refreshSelect = function(companyId) {
|
||
$.post(ext.contextPath + "/user/getUnitsByUnitId4Select.do", {id:companyId}, function(data) {
|
||
//$("#deptId").empty();
|
||
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('${contract.deptId}').trigger("change");
|
||
},'json');
|
||
};
|
||
|
||
$(function(){
|
||
//初始化文件显示
|
||
getFileList_process();
|
||
|
||
//选择厂区
|
||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
||
refreshSelect(companyId);
|
||
//选择厂区为一个厂时隐藏选择框
|
||
if(data.length == 1){
|
||
console.log(data+"data");
|
||
$("#bizId").css("display", "none");
|
||
$("#input_bizId").val(data[0].text);
|
||
$("#hidden_bizId").val(data[0].id);
|
||
companyId = data[0].id;
|
||
}else{
|
||
$("#hidden_bizId").attr("disabled","disabled");
|
||
$("#input_bizId").css("display", "none");
|
||
var selelct =$("#bizId").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('${contract.bizId}').trigger("change");
|
||
refreshSelect(companyId);
|
||
selelct.on("change",function(e){
|
||
console.log(companyId+"companyId");
|
||
companyId = $(this).val();
|
||
refreshSelect(companyId);
|
||
$("#deptId").empty();
|
||
});
|
||
}
|
||
},'json');
|
||
|
||
//输入框验证
|
||
$("#subForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
firstparty: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '甲方不能为空'
|
||
}
|
||
}
|
||
},
|
||
contractname: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '名称不能为空'
|
||
}
|
||
}
|
||
},
|
||
deptId: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '部门不能为空'
|
||
}
|
||
}
|
||
},
|
||
contractclassid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '类型不能为空'
|
||
}
|
||
}
|
||
},
|
||
contractnumber: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '编号不能为空'
|
||
}
|
||
}
|
||
},
|
||
/* contracttaxrateid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '税率不能为空'
|
||
}
|
||
}
|
||
},
|
||
purchaseid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '申购单不能为空'
|
||
}
|
||
}
|
||
},
|
||
purchasemethodsid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '采购形式不能为空'
|
||
}
|
||
}
|
||
},
|
||
channelsid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '列资渠道不能为空'
|
||
}
|
||
}
|
||
},*/
|
||
supplierid: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '供应商不能为空'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
//选择公司
|
||
$.post(ext.contextPath + "/user/getCompany4Select.do", function(data) {
|
||
var selelct = $("#bizId").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('${contract.bizId}').trigger("change");
|
||
},'json');
|
||
//选择合同类型
|
||
$.post(ext.contextPath + "/sparepart/contractClass/getContractClass4Select.do", function(data) {
|
||
var selelct = $("#contractclassid").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('${contract.contractclassid}').trigger("change");
|
||
},'json');
|
||
//选择合同税率
|
||
$.post(ext.contextPath + "/sparepart/contractTaxRate/getContractTaxRate4Select.do", function(data) {
|
||
var selelct = $("#contractTaxRateId").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('${contract.contracttaxrateid}').trigger("change");
|
||
},'json');
|
||
//选择申购单
|
||
/* $.post(ext.contextPath + "/sparepart/subscribe/getSubscribe4Select.do", function(data) {
|
||
var selelct = $("#purchaseId").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('${contract.purchaseid}').trigger("change");
|
||
},'json'); */
|
||
//选择采购形式
|
||
$.post(ext.contextPath + "/sparepart/purchaseMethods/getPurchaseMethods4Select.do", function(data) {
|
||
var selelct = $("#purchaseMethodsId").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('${contract.purchasemethodsid}').trigger("change");
|
||
},'json');
|
||
//选择列资渠道
|
||
$.post(ext.contextPath + "/sparepart/channels/getChannels4Select.do",{pid:'-1'}, function(data) {
|
||
var selelct = $("#channelsId").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;} // 函数用于呈现当前的选择
|
||
});
|
||
var select_id = '${contract.channelsid}';
|
||
var arr = select_id.split(",");
|
||
selelct.val(arr).trigger("change");
|
||
$('#channelsId').change(function(){
|
||
var o=document.getElementById('channelsId').getElementsByTagName('option');
|
||
var all="";
|
||
for(var i=0;i<o.length;i++){
|
||
if(o[i].selected){
|
||
all+=o[i].value+",";
|
||
}
|
||
}
|
||
all = all.substr(0, all.length - 1);//去掉末尾的逗号
|
||
$("#channelsid").val(all);//赋值给隐藏的文本框
|
||
})
|
||
},'json');
|
||
//选择供应商
|
||
$.post(ext.contextPath + "/sparepart/supplier/getSupplier4Select.do", function(data) {
|
||
var selelct = $("#supplierId").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('${contract.supplierid}').trigger("change");
|
||
},'json');
|
||
//选择质保期
|
||
$.post(ext.contextPath + "/sparepart/warrantyPeriod/getWarrantyPeriod4Select.do", function(data) {
|
||
var selelct = $("#warrantyPeriodId").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('${contract.warrantyperiodid}').trigger("change");
|
||
},'json');
|
||
$('#table_SubscribeDetail').bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/sparepart/subscribe/getSubscribeDetailList.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,
|
||
pids:'${contract.purchaseid}',
|
||
contractid:'${contract.id}',
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
},{
|
||
field: 'goods.name', // 返回json数据中的name
|
||
title: '物品名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'goods.model', // 返回json数据中的name
|
||
title: '规格型号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'goods.unit', // 返回json数据中的name
|
||
title: '单位', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'brand', // 返回json数据中的name
|
||
title: '品牌', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
editable: { //编辑列元素
|
||
type: 'text',
|
||
title: '品牌',
|
||
}
|
||
},{
|
||
field: 'design', // 返回json数据中的name
|
||
title: '设计规格', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
editable: { //编辑列元素
|
||
type: 'text',
|
||
title: '设计规格',
|
||
}
|
||
},{
|
||
field: 'manufacturer', // 返回json数据中的name
|
||
title: '生产厂家', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
editable: { //编辑列元素
|
||
type: 'text',
|
||
title: '生产厂家',
|
||
}
|
||
},{
|
||
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', // 上下居中
|
||
editable: { //编辑列元素
|
||
type: 'text',
|
||
title: '单价',
|
||
validate: function (v) {
|
||
if (!v) return '单价不能为空';
|
||
|
||
}
|
||
}
|
||
},{
|
||
field: 'totalMoney', // 返回json数据中的name
|
||
title: '合计/元', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'install', // 返回json数据中的name
|
||
title: '是否安装', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'channelsName', // 返回json数据中的name
|
||
title: '子项工程', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'purpose', // 返回json数据中的name
|
||
title: '用途', // 表格表头显示文字
|
||
width: '20%',
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
}
|
||
],
|
||
//保存列修改后的数据
|
||
onEditableSave: function (field, row, oldValue, $el) {
|
||
$.post(ext.contextPath + "/sparepart/subscribe/updateSubscribeDetail.do", {id:row.id,price:row.price,number:row.number,purpose:row.purpose,
|
||
brand:row.brand,design:row.design,manufacturer:row.manufacturer}, function(data) {
|
||
if (data.res == 1){
|
||
$("#table_SubscribeDetail").bootstrapTable('refresh');
|
||
}else if(data.res == 0){
|
||
showAlert('d','编辑失败');
|
||
}else{
|
||
showAlert('d',data.res);
|
||
}
|
||
},'json');
|
||
},
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_SubscribeDetail");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
})
|
||
//付款记录
|
||
$("#table_Payment").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/sparepart/contractDetailPayment/getList.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,
|
||
contractId:'${contract.id}',
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'paymentdate', // 返回json数据中的name
|
||
title: '付款时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function(value,row,index){
|
||
return value.substring(0,10);
|
||
}
|
||
},{
|
||
field: 'amountpaid', // 返回json数据中的name
|
||
title: '已付金额', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
},{
|
||
field: 'amountoutstanding', // 返回json数据中的name
|
||
title: '未付金额', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'applicationTime', // 返回json数据中的name
|
||
title: '申请时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'applicationAmount', // 返回json数据中的name
|
||
title: '申请金额', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'paymentStatus', // 返回json数据中的name
|
||
title: '状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 120, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var buts= '';
|
||
if('${contract.status}' != '${STATUS_CONTRACT_FINISH}'){
|
||
buts+= '<security:authorize buttonUrl="sparepart/contract/edit.do">';
|
||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFunPayment(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||
buts+= '</security:authorize>';
|
||
buts+= '<security:authorize buttonUrl="sparepart/contract/delete.do">';
|
||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFunPayment(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||
buts+= '</security:authorize>';
|
||
buts='<div class="btn-group" >'+buts+'</div>';
|
||
}
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_Payment");
|
||
console.info("加载数据成功");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
//开票记录
|
||
$("#table_Invoice").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/sparepart/contractDetailInvoice/getList.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,
|
||
contractId:'${contract.id}',
|
||
}
|
||
},
|
||
sortName: 'id', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
field: 'number', // 返回json数据中的name
|
||
title: '发票号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
|
||
},
|
||
{
|
||
field: 'invoicedate', // 返回json数据中的name
|
||
title: '开票时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function(value,row,index){
|
||
return value.substring(0,10);
|
||
}
|
||
},{
|
||
field: 'amountinvoice', // 返回json数据中的name
|
||
title: '开票金额', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
},{
|
||
field: 'invoiceStatus', // 返回json数据中的name
|
||
title: '状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 120, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var buts= '';
|
||
if('${contract.status}' != '${STATUS_CONTRACT_FINISH}'){
|
||
buts+= '<security:authorize buttonUrl="sparepart/contract/edit.do">';
|
||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFunInvoice(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||
buts+= '</security:authorize>';
|
||
buts+= '<security:authorize buttonUrl="sparepart/contract/delete.do">';
|
||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFunInvoice(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||
buts+= '</security:authorize>';
|
||
buts='<div class="btn-group" >'+buts+'</div>';
|
||
}
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_Payment");
|
||
console.info("加载数据成功");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
|
||
})
|
||
|
||
$("#contractenddate").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
})
|
||
$("#contractstartdate").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
})
|
||
$("#supplyplanenddate").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
})
|
||
$("#supplyplanstartdate").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
})
|
||
$("#supplyactualstartdate").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
})
|
||
$("#supplyactualenddate").datepicker({
|
||
language: 'zh-CN',
|
||
autoclose: true,
|
||
todayHighlight: true,
|
||
format:'yyyy-mm-dd',
|
||
})
|
||
})
|
||
|
||
//导出设备表,要用get请求的方式
|
||
function downloadFun() {
|
||
var contractId = '${contract.id}';
|
||
window.open(ext.contextPath + "/sparepart/subscribe/downloadSubscribeDetailExcel.do?contractId="+contractId);
|
||
}
|
||
//导出设备表,要用get请求的方式
|
||
function downloadFun4equ() {
|
||
var contractId = '${contract.id}';
|
||
window.open(ext.contextPath + "/sparepart/subscribe/downloadEquipmentExcel.do?contractId="+contractId);
|
||
}
|
||
|
||
//导入明细
|
||
function importFun(){
|
||
var contractId = '${contract.id}';
|
||
var channelsid = $("#channelsid").val();//列资渠道
|
||
$.post(ext.contextPath + '/sparepart/subscribe/importSubscribeDetail.do', {contractId:contractId,channelsid:channelsid} , function(data) {
|
||
$("#importDiv").html(data);
|
||
openModal('importModal');
|
||
});
|
||
}
|
||
|
||
var addchannelsId = function() {
|
||
var checkedItems = $("#table_SubscribeDetail").bootstrapTable('getSelections');
|
||
var datas="";
|
||
$.each(checkedItems, function(index, item){
|
||
datas+=item.id+",";
|
||
});
|
||
if(datas==""){
|
||
showAlert('d','请先选择记录','alertDiv');
|
||
}else{
|
||
var channelsid= $("#channelsid").val();
|
||
$.post(ext.contextPath + '/sparepart/channels/selectChannelsForSubscribeDetail.do', {channelsid:channelsid},
|
||
function(data) {
|
||
$("#fault4SelectDiv").html(data);
|
||
openModal('fault4SelectModal');
|
||
});
|
||
}
|
||
}
|
||
|
||
var addchannelsIdSave = function() {
|
||
var checkedItems = $("#table_SubscribeDetail").bootstrapTable('getSelections');
|
||
var datas="";
|
||
$.each(checkedItems, function(index, item){
|
||
datas+=item.id+",";
|
||
});
|
||
var channelsId= $("#subscribeDetail_channelsId").val();
|
||
$.post(ext.contextPath + '/sparepart/subscribe/addSubscribeDetailchannelsId.do', {ids:datas,channelsId:channelsId} , function(data) {
|
||
if(data>0){
|
||
$("#table_SubscribeDetail").bootstrapTable('refresh');
|
||
}else{
|
||
showAlert('d','设置失败','alertDiv');
|
||
}
|
||
});
|
||
}
|
||
</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 id="status" name="status" type="hidden" value="${contract.status}"/>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">所属厂区</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<select class="form-control" id="bizId" name ="bizId" style="width: 100%;" >
|
||
</select>
|
||
<%-- <input id="bizId" name="bizId" type="hidden" value="${contract.company.id}"/>
|
||
<p class="form-control-static" >${contract.company.name}</p> --%>
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label hidden">*合同甲方</label>
|
||
<div class="col-md-4 col-sm-10 hidden">
|
||
<select class="form-control select2" id="firstparty" name ="firstparty" style="width: 100%;">
|
||
<option <c:if test="${contract.firstparty=='常州市城市排水有限公司'}">selected</c:if>>常州市城市排水有限公司</option>
|
||
<option <c:if test="${contract.firstparty=='常州市排水管理处'}">selected</c:if>>常州市排水管理处</option>
|
||
<option <c:if test="${contract.firstparty=='常州市排水管理处和常州市城市排水有限公司'}">selected</c:if>>常州市排水管理处和常州市城市排水有限公司</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">*合同名称</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="contractname" name ="contractname" placeholder="名称" value="${contract.contractname}" >
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">*合同类型</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<select class="form-control select2" id="contractclassid" name ="contractclassid" style="width: 100%;"></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">*经办部门</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<select class="form-control" id="deptId" name ="deptId" style="width: 100%;" >
|
||
</select>
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">*经办人</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="agentName" name ="agentName" placeholder="点击选择"
|
||
onclick="showUser4SelectsFun('agentId','agentName');" value="${contract.agentName}">
|
||
<input type="hidden" class="form-control" id="agentId" name ="agentid" value="${contract.agentid}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">*合同编号</label>
|
||
<div class="col-md-5 col-sm-10">
|
||
<input type="hidden" class="form-control" id="id" name ="id" value="${contract.id}" readonly>
|
||
<input type="text" class="form-control" id="contractnumber_left" placeholder="编号" value="${fn:substring(contract.contractnumber, 0, 15)}" readonly>
|
||
</div>
|
||
<div class="col-md-5 col-sm-10">
|
||
<div class="input-group">
|
||
<input type="text" class="form-control" id="contractnumber_right" placeholder="编号自定义部分" value="${fn:substring(contract.contractnumber, 16, fn:length(contract.contractnumber)-1)}">
|
||
|
||
<input type="hidden" class="form-control" id="contractnumber" name="contractnumber" value="${contract.contractnumber}">
|
||
<span class="input-group-btn">
|
||
<a rol="button" class="btn btn-default" onclick="addNumber();"><i class="fa fa-plus"></i> 生成编号</a>
|
||
</span>
|
||
</div><!-- /input-group -->
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">*供应商</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<select class="form-control select2" id="supplierId" name ="supplierid" style="width: 100%;"></select>
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">采购形式</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<select class="form-control select2" id="purchaseMethodsId" name ="purchasemethodsid" style="width: 100%;"></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">结算金额</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="settlementAmount" name ="settlementAmount" value="${contract.settlementAmount}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">采购申请单</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control" id="purchaseId" name ="purchaseid" placeholder="点击选择" onclick="showSubscribe4SelectsFun();" value="${contract.purchaseid}">
|
||
<!-- <select class="form-control select2" id="purchaseId" name ="purchaseid" style="width: 100%;"></select> -->
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">列资渠道</label>
|
||
<div class="col-sm-10">
|
||
<select class="form-control select2" multiple="multiple" id="channelsId" style="width: 100%;"></select>
|
||
<input id="channelsid" name ="channelsid" type="hidden" value="${contract.channelsid}" />
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">开始日期</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="contractstartdate" name ="contractstartdate" value="${contract.contractstartdate.substring(0,10)}" >
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">结束日期</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="contractenddate" name ="contractenddate" value="${contract.contractenddate.substring(0,10)}" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">合同金额(元)</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="contractAmount" name ="contractamount" value="${contract.contractamount}" >
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">合同税率(%)</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<select class="form-control select2" id="contractTaxRateId" name ="contracttaxrateid" style="width: 100%;"></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">履约保证金</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="performancebond" name ="performancebond" value="${contract.performancebond}">
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">质保金(%)</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="warrantydeposit" name ="warrantydeposit" value="${contract.warrantydeposit}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">质保金(元)</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="qualityDeposit" name ="qualitydeposit" value="${contract.qualitydeposit}">
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">质保期(年)</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<select class="form-control select2" id="warrantyPeriodId" name ="warrantyperiodid" style="width: 100%;"></select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">供货计划开始日期</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="supplyplanstartdate" name ="supplyplanstartdate" value="${contract.supplyplanstartdate.substring(0,10)}">
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">供货计划结束日期</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="supplyplanenddate" name ="supplyplanenddate" value="${contract.supplyplanenddate.substring(0,10)}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">供货实际开始日期</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="supplyactualstartdate" name ="supplyactualstartdate" value="${contract.supplyactualstartdate.substring(0,10)}" >
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">供货实际结束日期</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="supplyactualenddate" name ="supplyactualenddate" value="${contract.supplyactualenddate.substring(0,10)}" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-md-2 col-sm-2 control-label">*审核人</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="auditMan" name ="auditMan" placeholder="请选择本部门领导" onclick="showUser4SelectsFun('contractAuditId','auditMan');" value="${contract.contractAuditName}">
|
||
<input id="contractAuditId" name="contractAuditId" type="hidden" value="${contract.contractAuditId}" />
|
||
</div>
|
||
<label class="col-md-2 col-sm-2 control-label">协办人</label>
|
||
<div class="col-md-4 col-sm-10">
|
||
<input type="text" class="form-control" id="helpersMan" name ="helpersMan" placeholder="请选择协办部门经办人(可多选)" onclick="showUser4SelectsFun('helpers','helpersMan');" value="${contract.helpersMan}">
|
||
<input id="helpers" name="helpers" type="hidden" value="${contract.helpers}" />
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">备注</label>
|
||
<div class="col-sm-10">
|
||
<textarea class="form-control" rows="2" id ="remark" name ="remark" placeholder="备注...">${contract.remark}</textarea>
|
||
</div>
|
||
</div>
|
||
<!-- 文件上传,显示 -->
|
||
<div class="form-group" style="margin:8px">
|
||
<label class="col-sm-2 control-label"></label>
|
||
|
||
<c:if test="${contract.status==STATUS_CONTRACT_START}">
|
||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_processMore('Biddingfile')" id="btn_save"><i class="fa fa-paperclip"></i>上传招标文件</button>
|
||
</c:if>
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<a ><i class="fa fa-paperclip"></i>招标文件</a>
|
||
</c:if>
|
||
</div>
|
||
<div id="Biddingfile">
|
||
</div>
|
||
<!-- 文件上传,显示 -->
|
||
<div class="form-group" style="margin:8px">
|
||
<label class="col-sm-2 control-label"></label>
|
||
|
||
<c:if test="${contract.status==STATUS_CONTRACT_START}">
|
||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_processMore('Initialfile')" id="btn_save"><i class="fa fa-paperclip"></i>上传初始合同</button>
|
||
</c:if>
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<a ><i class="fa fa-paperclip"></i>初始合同</a>
|
||
</c:if>
|
||
</div>
|
||
<div id="Initialfile">
|
||
</div>
|
||
<!-- 文件上传,显示 -->
|
||
<div class="form-group" style="margin:8px">
|
||
<label class="col-sm-2 control-label"></label>
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<button type="button" class="btn btn-default btn-file" onclick="fileinput_processMore1('lastfile')" id="btn_save"><i class="fa fa-paperclip"></i>上传最终合同</button>
|
||
</c:if>
|
||
</div>
|
||
<div id="lastfile">
|
||
</div>
|
||
</form>
|
||
<div class="nav-tabs-custom">
|
||
<ul class="nav nav-tabs" id="">
|
||
<li class="active"><a href="#tab1" data-toggle="tab" index="0" aria-expanded="true">合同明细</a></li>
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<li class=""><a href="#tab2" data-toggle="tab" index="0" aria-expanded="true">付款记录</a></li>
|
||
<li class=""><a href="#tab3" data-toggle="tab" index="1" aria-expanded="false">开票记录</a></li>
|
||
</c:if>
|
||
<!-- <li class=""><a href="#tab3" data-toggle="tab" index="4" aria-expanded="false">验收记录</a></li>
|
||
<li class=""><a href="#tab4" data-toggle="tab" index="3" aria-expanded="false">入库记录</a></li>
|
||
<li class=""><a href="#tab5" data-toggle="tab" index="4" aria-expanded="false">出库记录</a></li>
|
||
<li class=""><a href="#tab6" data-toggle="tab" index="5" aria-expanded="false">合同变更历史</a></li> -->
|
||
</ul>
|
||
</div>
|
||
<div class="tab-content" >
|
||
<div class=" tab-pane active" id="tab1">
|
||
<div class="box box-primary" >
|
||
<div class="box-header with-border">
|
||
<h3 class="box-title"></h3>
|
||
<div class="box-tools pull-right">
|
||
<a class="btn btn-default btn-sm" onclick="importFun();"><i class="fa fa-cloud-upload"></i> 导入合同明细表</a>
|
||
<a onclick="downloadFun();" class="btn btn-default btn-sm"><i class="fa fa-cloud-download"></i> 导出合同明细表</a>
|
||
<a onclick="downloadFun4equ();" class="btn btn-default btn-sm"><i class="fa fa-cloud-download"></i> 导出为设备台账</a>
|
||
<a onclick="addchannelsId()" class="btn btn-default" data-toggle="tooltip" title="设置">设置子项工程</a>
|
||
<a onclick="addSubscribeHistoryFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||
<a onclick="deletesSubscribeHistoryFun()" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i class="glyphicon glyphicon-minus"></i></a>
|
||
</div>
|
||
</div>
|
||
<!-- /.box-header -->
|
||
<div class="box-body ">
|
||
<input id="subscribeDetail_channelsId" type="hidden" value="" />
|
||
<table id="table_SubscribeDetail"></table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<div class=" tab-pane " id="tab2">
|
||
|
||
<div class="box box-primary" >
|
||
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<div class="box-header with-border">
|
||
<div class="box-tools pull-right">
|
||
<a onclick="paymentAddFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||
</div>
|
||
</div>
|
||
</c:if>
|
||
<div class="box-body ">
|
||
<table id="table_Payment"></table>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</c:if>
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<div class=" tab-pane " id="tab3">
|
||
<div class="box box-primary" >
|
||
<c:if test="${contract.status==STATUS_CONTRACT_EXECUTE}">
|
||
<div class="box-header with-border">
|
||
<div class="box-tools pull-right">
|
||
<a onclick="invoiceAddFun()" class="btn btn-box-tool" data-toggle="tooltip" title="新增"><i class="glyphicon glyphicon-plus"></i></a>
|
||
</div>
|
||
<!-- 文件上传,显示 -->
|
||
</div>
|
||
</c:if>
|
||
<div class="box-body ">
|
||
<table id="table_Invoice"></table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</c:if>
|
||
<%-- <div class="tab-content" >
|
||
<div class=" tab-pane active" id="tab1">
|
||
|
||
</div>
|
||
<div class=" tab-pane " id="tab2">
|
||
|
||
</div>
|
||
<div class=" tab-pane " id="tab3">
|
||
<div class="box box-primary" >
|
||
<div class="box-body ">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class=" tab-pane " id="tab4">
|
||
<div class="box box-primary" >
|
||
<div class="box-body ">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class=" tab-pane " id="tab5">
|
||
<div class="box box-primary" >
|
||
<div class="box-body ">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class=" tab-pane " id="tab6">
|
||
<div class="box box-primary" >
|
||
<div class="box-body ">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div> --%>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" onclick="closeModel()">关闭</button>
|
||
<c:choose>
|
||
<c:when test="${contract.status== STATUS_CONTRACT_EXECUTE}">
|
||
<button type="button" class="btn btn-primary" onclick="doend()" id="btn_update">完成</button>
|
||
</c:when>
|
||
<c:otherwise>
|
||
<button type="button" class="btn btn-primary" onclick="doupdate()" id="btn_update">保存</button>
|
||
<button type="button" class="btn btn-primary" onclick="submitFun()" id="btn_submit">提交</button>
|
||
</c:otherwise>
|
||
</c:choose>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div> |