add:数据解析结果显示
This commit is contained in:
@@ -38,7 +38,7 @@ public class PmFormDataController {
|
|||||||
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
public ResponseEntity<Object> queryAll(FormDataQuery query, PageQuery page) {
|
||||||
// Page<PmFormData> result = formDataService.page(page.build(), query.build());
|
// Page<PmFormData> result = formDataService.page(page.build(), query.build());
|
||||||
// Object o = formDataService.queryAll(query,page);
|
// Object o = formDataService.queryAll(query,page);
|
||||||
return new ResponseEntity<>(formDataService.queryAll(query, page), HttpStatus.CREATED);
|
return new ResponseEntity<>(TableDataInfo.build(formDataService.page(page.build(),query.build())), HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
|||||||
throw new BadRequestException("当前业务数据为空");
|
throw new BadRequestException("当前业务数据为空");
|
||||||
}
|
}
|
||||||
//暂时只有两层
|
//暂时只有两层
|
||||||
JSONArray mst_mapping_json = (JSONArray)mapping_json.remove(0);
|
JSONArray mst_mapping_json = mapping_json.size()>1?(JSONArray)mapping_json.remove(0):mapping_json.getJSONArray(0);
|
||||||
Map<String, JSONObject> fieldMapping = mst_mapping_json.stream().collect(HashMap::new, (formMap, o) -> {
|
Map<String, JSONObject> fieldMapping = mst_mapping_json.stream().collect(HashMap::new, (formMap, o) -> {
|
||||||
JSONObject item = (JSONObject) o;
|
JSONObject item = (JSONObject) o;
|
||||||
formMap.put(item.getString("value"), item);
|
formMap.put(item.getString("value"), item);
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
title="表单同步测试"
|
title="表单同步测试"
|
||||||
:visible.sync=syncShow
|
:visible.sync=syncShow
|
||||||
width="600px"
|
width="800px"
|
||||||
@close="syncAnalyseCannel"
|
@close="syncAnalyseCannel"
|
||||||
>
|
>
|
||||||
<el-form ref="form" :model="syncForm" :rules="rules" size="mini" label-width="50px">
|
<el-form ref="form" :model="syncForm" :rules="rules" size="mini" label-width="50px">
|
||||||
@@ -140,9 +140,69 @@
|
|||||||
<el-input disabled v-model="syncForm.form_name" :precision="0" style="width: 150px;" />
|
<el-input disabled v-model="syncForm.form_name" :precision="0" style="width: 150px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="测试数据" prop="analyseData">
|
<el-form-item label="测试数据" prop="analyseData">
|
||||||
<el-input type="textarea" v-model="syncForm.analyseData" :precision="0" style="width: 450px;" />
|
<el-input type="textarea" v-model="syncForm.analyseData" :precision="0" style="width: 650px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<div v-if="viewMst.length >0">
|
||||||
|
<div class="crud-opts2">
|
||||||
|
<span class="role-span2">解析数据</span>
|
||||||
|
</div>
|
||||||
|
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="viewMst"
|
||||||
|
style="width: 100%;"
|
||||||
|
max-height="300"
|
||||||
|
size="mini"
|
||||||
|
border
|
||||||
|
:highlight-current-row="true"
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
>
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="id" label="id" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="code" label="单据编码" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="biz_code" label="业务单" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_id" label="物料id" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="pcsn" label="批次" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="qty" label="数量" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="vehicle_code" label="载具" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="status" label="单据状态" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip v-for="(item, index) in viewMstCols" :key="item.value" :label="item.lable" >
|
||||||
|
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
<div v-if="hasDtl">
|
||||||
|
<div class="crud-opts2">
|
||||||
|
<span class="role-span2">明细数据</span>
|
||||||
|
</div>
|
||||||
|
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="viewDtl"
|
||||||
|
style="width: 100%;"
|
||||||
|
max-height="300"
|
||||||
|
size="mini"
|
||||||
|
border
|
||||||
|
:highlight-current-row="true"
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
>
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="id" label="id" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="code" label="单据编码" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="biz_code" label="业务单" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_id" label="物料id" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="pcsn" label="批次" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="qty" label="数量" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="vehicle_code" label="载具" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip prop="status" label="单据状态" align="center" />
|
||||||
|
<el-table-column min-width="120" show-overflow-tooltip v-for="(item, index) in viewDtlCols" :key="item.value" :label="item.lable" >
|
||||||
|
<template slot-scope="scope">{{scope.row.form_data[item.value]}}</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button :loading="crud.cu === 2" type="primary" @click="syncAnalyseSubmit">同步解析</el-button>
|
<el-button :loading="crud.cu === 2" type="primary" @click="syncAnalyseSubmit">同步解析</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -244,6 +304,11 @@ export default {
|
|||||||
syncShow: false,
|
syncShow: false,
|
||||||
syncForm: {},
|
syncForm: {},
|
||||||
permission: {},
|
permission: {},
|
||||||
|
viewMst: [],
|
||||||
|
viewDtl: [],
|
||||||
|
hasDtl: false,
|
||||||
|
viewMstCols: {},
|
||||||
|
viewDtlCols: {},
|
||||||
rules: {
|
rules: {
|
||||||
position_code: [
|
position_code: [
|
||||||
{ required: true, message: '缓存线位置编码不能为空', trigger: 'blur' }
|
{ required: true, message: '缓存线位置编码不能为空', trigger: 'blur' }
|
||||||
@@ -294,14 +359,32 @@ export default {
|
|||||||
syncTest(row){
|
syncTest(row){
|
||||||
this.syncShow = true
|
this.syncShow = true
|
||||||
this.syncForm = row
|
this.syncForm = row
|
||||||
|
crudFormMapping.tableColumns(row.form_type).then(res => {
|
||||||
|
this.viewMstCols = res.item
|
||||||
|
if (res.dtl_item != null){
|
||||||
|
this.hasDtl = true
|
||||||
|
this.viewDtlCols = res.dtl_item
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
syncAnalyseSubmit(){
|
syncAnalyseSubmit(){
|
||||||
|
this.viewMst=[]
|
||||||
|
this.viewDtl = []
|
||||||
crudFormMapping.syncAnalyse(this.syncForm).then(res => {
|
crudFormMapping.syncAnalyse(this.syncForm).then(res => {
|
||||||
this.crud.notify('解析成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('解析成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
for (let i = 0; i < res.content.length; i++) {
|
||||||
|
if (i==0){this.viewMst.push(res.content[i])}
|
||||||
|
else {this.viewDtl.push(res.content[i])}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
syncAnalyseCannel(){
|
syncAnalyseCannel(){
|
||||||
this.syncForm = {}
|
this.syncForm = {}
|
||||||
|
this.viewMst = [],
|
||||||
|
this.viewDtl = [],
|
||||||
|
this.hasDtl = false,
|
||||||
|
this.viewMstCols = {},
|
||||||
|
this.viewDtlCols = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user