Commit dfb057bd authored by wanghang's avatar wanghang

工艺回显

parent e511281d
......@@ -8,8 +8,8 @@ $(document).ready(function () {
function initialize(){
//若是作为详情页,则初始化bom
if($("#productId").val()!=null&&$("#productId").val()!=""){
showTechnologyTable($("#productId").val());
ajaxRenderDataGoForm({proofingApplyNo:$("#proofingApplyNo").val()});
showTable($("#proofingApplyId").val());
}
}
......@@ -60,6 +60,10 @@ function getExtendedData(processAction) {
}
let technologyResult = DataUtil.getUpdateRow(technologyObj.gridManager); // 获取选中行
if(!technologyResult){
alert("请选择工艺!")
return false;
}
let processResult = DataUtil.getGridData({
gridManager: processObj.gridManager,
isAllData: true
......
......@@ -11,7 +11,8 @@
<x:billTitle title="打样申请单" needStatus="false" needPerson="true"/>
<div class="blank_div clearfix"></div>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id" id="proofingApplyId"/>
<%-- <x:hidden name="id" id="proofingApplyId"/>--%>
<x:hidden name="id"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fullId"/>
......@@ -26,7 +27,7 @@
<div><h3>基本信息</h3></div>
<div style="margin: 10px;">
<div class="hg-form-cols">
<x:hidden name="proofingApplyId"/>
<x:inputC name="proofingApplyNo" label="申请单号" maxLength="32" labelCol="1"
fieldCol="2"/>
<x:hidden name="productId"/>
......
......@@ -40,6 +40,10 @@ function bindQueryEvent() {
function saveForm(){
let technologyResult = DataUtil.getUpdateRow(technologyObj.gridManager); // 获取选中行
if(!technologyResult){
alert("请选择工艺!")
return false;
}
let processResult = DataUtil.getGridData({
gridManager: processObj.gridManager,
isAllData: true
......
//因为页面表格较多,每次操作一张表格时需要切换gridManager
// var gridManager = null;
var isDetail=false;
//定义生成表格的参数对象
var bomObj={
parms:{},
......@@ -154,31 +153,66 @@ function loadProofingApplyGrid(obj) {
// this.gridManager=processObj.gridManager;
// })
// }
function showTable(proofingApplyId){
debugger
function showTable(proofingApplyId) {
isDetail=true;
technologyObj.parms = {proofingApplyId: proofingApplyId}
if(technologyObj.gridManager!=null) {
reloadGrid(technologyObj);
}else{
technologyObj.url = "queryProofingApplyTechnology";
loadProofingApplyGrid(technologyObj);
}
let promise = new Promise(function(resolve, reject) {
if (technologyObj.gridManager != null) {
reloadGrid(technologyObj);
} else {
loadProofingApplyGrid(technologyObj);
}
setTimeout(function() {
resolve();
}, 1000);
});
let result = DataUtil.getUpdateRow(technologyObj.gridManager); // 获取选中行
processObj.parms = {technologyId: result.technologyId}
if(processObj.gridManager!=null) {
reloadGrid(processObj);
}else{
processObj.url = ""
loadProofingApplyGrid(processObj);
}
promise.then(function() {
let technologyResult = DataUtil.getGridData({
gridManager: technologyObj.gridManager,
isAllData: true
});
let proofingApplyTechnologyId = technologyResult.length > 0 ? technologyResult[0].proofingApplyTechnologyId : -1;
processObj.parms = {proofingApplyTechnologyId: proofingApplyTechnologyId}
if (processObj.gridManager != null) {
reloadGrid(processObj);
} else {
loadProofingApplyGrid(processObj);
}
});
}
// function showTable(proofingApplyId){
// // offEvent();
// debugger
// technologyObj.parms = {proofingApplyId: proofingApplyId}
// if(technologyObj.gridManager!=null) {
// reloadGrid(technologyObj);
// }else{
// loadProofingApplyGrid(technologyObj);
// }
// setTimeout(function() {
//
// let technologyResult = DataUtil.getGridData({
// gridManager: technologyObj.gridManager,
// isAllData: true
// });
// let proofingApplyTechnologyId = technologyResult.length > 0 ? technologyResult[0].proofingApplyTechnologyId : -1;
// processObj.parms = {proofingApplyTechnologyId: proofingApplyTechnologyId}
//
// if (processObj.gridManager != null) {
// reloadGrid(processObj);
// } else {
// loadProofingApplyGrid(processObj);
// }
// },1000)
// }
//展示工艺表格
function showTechnologyTable(productId){
isDetail=false;
if(technologyObj.gridManager!=null){
technologyObj.parms={productId:productId}
reloadGrid(technologyObj);
......@@ -225,7 +259,7 @@ function reloadGrid(obj) {
function technologyClickRequestProcess(){
$(document).on('click', '#technology .l-grid-row', function(event) {
setTimeout(function() {
if(isDetail)return;
let result = DataUtil.getUpdateRow(technologyObj.gridManager); // 获取选中行
processObj.parms = { technologyId: result.technologyId };
if (processObj.gridManager != null) {
......@@ -235,11 +269,6 @@ function technologyClickRequestProcess(){
}
}, 0);
// 延迟执行点击事件逻辑
// setTimeout(function() {
// let result = DataUtil.getUpdateRow(gridManager); // 获取选中行
......@@ -252,23 +281,18 @@ function technologyClickRequestProcess(){
// }
// }, 0);
});
$(document).on('click', '#process .l-grid-row', function(event) {
setTimeout(function() {
debugger
let result = DataUtil.getUpdateRow(processObj.gridManager); // 获取选中行
processBomObj.parms = { processId: result.processId };
if (processBomObj.gridManager != null) {
reloadGrid(processBomObj);
} else {
loadProofingApplyGrid(processBomObj);
}
}, 0);
});
// $(document).on('click', '#process .l-grid-row', function(event) {
// setTimeout(function() {
// debugger
// let result = DataUtil.getUpdateRow(processObj.gridManager); // 获取选中行
// processBomObj.parms = { processId: result.processId };
// if (processBomObj.gridManager != null) {
// reloadGrid(processBomObj);
// } else {
// loadProofingApplyGrid(processBomObj);
// }
// }, 0);
//
// });
}
// const saveTest=this.save;
// function save(){
// saveTest();
// }
\ No newline at end of file
......@@ -97,6 +97,8 @@ public class ProofingApplyApplicationImpl extends FlowBroker implements Proofing
proofingTechnology.setProofingApplyId(proofingApply.getProofingApplyId());
proofingTechnology = proofingTechnologyRepository.save(proofingTechnology);
List<ProofingApplyProcess> processesToDelete = proofingApplyProcessRepository.findByProofingApplyTechnologyId(proofingTechnology.getProofingApplyTechnologyId());
proofingApplyProcessRepository.deleteInBatch(processesToDelete);
for (ProofingApplyProcess proofingApplyProcess : ProcessList) {
proofingApplyProcess.setProofingApplyTechnologyId(proofingTechnology.getProofingApplyTechnologyId());
proofingApplyProcessRepository.save(proofingApplyProcess);
......
......@@ -14,7 +14,7 @@ public class ProofingApplyProcessApplicationImpl extends BaseApplication implem
@Override
public Map<String, Object> slicedProofingApplyProcess(ProofingApplyProcessQueryRequest query) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedProofingApplyTechnology");
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedProofingApplyProcess");
return this.sqlExecutorDao.executeSlicedQuery(queryDescriptor,query);
}
}
......@@ -122,7 +122,13 @@ public class ProofingApplyController extends CommonController {
public String slicedTechnologyList(){
SDO sdo = this.getSDO();
TechnologyQueryRequest queryRequest = sdo.toQueryRequest(TechnologyQueryRequest.class);
Map<String, Object> map = technologyApplication.slicedTechnologyList(queryRequest);
proofingApplyTechnologyQueryRequest proofingApplyTechnologyQueryRequest = sdo.toQueryRequest(proofingApplyTechnologyQueryRequest.class);
Map<String, Object> map = new HashMap<>();
if(proofingApplyTechnologyQueryRequest.getProofingApplyId()!=null&&!proofingApplyTechnologyQueryRequest.getProofingApplyId().equals("")){
map = proofingApplyTechnologyApplication.slicedProofingApplyTechnology(proofingApplyTechnologyQueryRequest);
}else if(queryRequest.getProductId()!=null&&!queryRequest.getProductId().equals("")){
map = technologyApplication.slicedTechnologyList(queryRequest);
}
return toResult(map);
}
......@@ -134,22 +140,13 @@ public class ProofingApplyController extends CommonController {
public String slicedTechnologyProcessList(){
SDO sdo = this.getSDO();
String technologyId = sdo.getString("technologyId");
return packGridDataAndResult(technologyProcessApplication.slicedTechnologyProcessList(technologyId));
}
public String queryProofingApplyTechnology(){
SDO sdo = this.getSDO();
proofingApplyTechnologyQueryRequest proofingApplyTechnologyQueryRequest = sdo.toQueryRequest(proofingApplyTechnologyQueryRequest.class);
Map<String, Object> map = proofingApplyTechnologyApplication.slicedProofingApplyTechnology(proofingApplyTechnologyQueryRequest);
return toResult(map);
}
public String slicedProofingApplyTechnologyProcess(){
SDO sdo = this.getSDO();
ProofingApplyProcessQueryRequest proofingApplyProcessQueryRequest = sdo.toQueryRequest(ProofingApplyProcessQueryRequest.class);
Map<String, Object> map = proofingApplyProcessApplication.slicedProofingApplyProcess(proofingApplyProcessQueryRequest);
return toResult(map);
if(proofingApplyProcessQueryRequest.getProofingApplyTechnologyId()!=null&&!proofingApplyProcessQueryRequest.getProofingApplyTechnologyId().equals("")){
return toResult(proofingApplyProcessApplication.slicedProofingApplyProcess(proofingApplyProcessQueryRequest));
}else if(technologyId!=null&&!technologyId.equals("")){
return packGridDataAndResult(technologyProcessApplication.slicedTechnologyProcessList(technologyId));
}
return toResult(null);
}
}
......@@ -31,6 +31,12 @@ public class ProofingApplyBaseInfo extends FlowBillAbstractEntity {
@Column(name = "proofing_apply_no")
private String proofingApplyNo;
/**
* 产品id
*/
@Column(name = "product_code")
private String productCode;
/**
* 产品id
*/
......
......@@ -54,4 +54,5 @@ public class ProofingApplyProcessQueryRequest extends QueryAbstractRequest {
private String processContent;
}
\ No newline at end of file
......@@ -3,5 +3,8 @@ package com.huigou.topsun.proofing.repository;
import com.huigou.topsun.proofing.domain.model.proofingApply.ProofingApplyProcess;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface ProofingApplyProcessRepository extends JpaRepository<ProofingApplyProcess, String> {
List<ProofingApplyProcess> findByProofingApplyTechnologyId(String proofingApplyTechnologyId);
}
......@@ -6,7 +6,7 @@
select pa.proofing_apply_no,pa.proofing_apply_id,pa.product_id,p.product_code
from proofing_apply_base_info pa
inner join product p on(pa.product_id=p.product_id)
where pa.proofing_apply_application_status ='normal'
<!-- where pa.proofing_apply_application_status ='normal'-->
</sql>
<field name="申请单号" title="申请单号" code="proofingApplyNo" width="200" />
<field name="申请Id" title="申请Id" code="proofingApplyId" width="200" />
......@@ -46,7 +46,7 @@
FROM
proofing_make_base_info pm
inner join product p on(pm.product_id=p.product_id)
where pm.proofing_make_application_status ="normal"
<!-- where pm.proofing_make_application_status ="normal"-->
</sql>
<field name="产品Id" title="产品Id" code="productId" width="200" />
<field name="产品编号" title="产品编号" code="productCode" width="200" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment