Commit dfb057bd authored by wanghang's avatar wanghang

工艺回显

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