对接文档对比

This commit is contained in:
qq787203167
2022-08-02 18:08:20 +08:00
parent 5d9d66da3b
commit 38dcac59c0
4 changed files with 169 additions and 53 deletions
+1
View File
@@ -1220,4 +1220,5 @@ module.exports = {
sdt:'sdt', sdt:'sdt',
dre:'dre', dre:'dre',
applicableInstructionsMarketList:'Applicable instructions of market list', applicableInstructionsMarketList:'Applicable instructions of market list',
pleaseSelectTheDataCompared:'Please select the data to be compared',
} }
+1
View File
@@ -1323,4 +1323,5 @@ module.exports = {
sdt:'工程接口人', sdt:'工程接口人',
dre:'填写人', dre:'填写人',
applicableInstructionsMarketList:'市场清单适用说明', applicableInstructionsMarketList:'市场清单适用说明',
pleaseSelectTheDataCompared:'请选择需要对比的数据',
} }
@@ -50,7 +50,7 @@
:scroll="{x: '100%',y:400}" :scroll="{x: '100%',y:400}"
rowKey="id" rowKey="id"
:data-source="dataSourceLeft" :data-source="dataSourceLeft"
:row-selection="{ selectedRowKeys: selectedRowKeysLeft, onChange: onSelectChangeLeft }" :row-selection="{ selectedRowKeys: selectedRowKeysLeft, onChange: onSelectChangeLeft,columnTitle:' ' }"
:columns="columns" :columns="columns"
> >
</a-table> </a-table>
@@ -70,9 +70,10 @@
<span class="box-button-standard-left"> <span class="box-button-standard-left">
{{$t('selectedStandard')}} {{$t('selectedStandard')}}
</span> </span>
<span class="box-button-standard-right"> <span class="box-button-standard-right"
{{$t('noComparisonDocumentSelected')}} :class="{'box-button-standard-right-color':selectedRowKeysLeftRecord[0]}">
</span> {{selectedRowKeysLeftRecord[0]?selectedRowKeysLeftRecord[0].serialNumber+' '+selectedRowKeysLeftRecord[0].fileName:$t('noComparisonDocumentSelected')}}
</span>
</div> </div>
</div> </div>
<div class="detail-content-right"> <div class="detail-content-right">
@@ -113,7 +114,7 @@
:scroll="{x: '100%',y:400}" :scroll="{x: '100%',y:400}"
rowKey="id" rowKey="id"
:data-source="dataSourceRight" :data-source="dataSourceRight"
:row-selection="{ selectedRowKeys: selectedRowKeysRight, onChange: onSelectChangeRight }" :row-selection="{ selectedRowKeys: selectedRowKeysRight, onChange: onSelectChangeRight,columnTitle:' ' }"
:columns="columns" :columns="columns"
> >
</a-table> </a-table>
@@ -133,8 +134,9 @@
<span class="box-button-standard-left"> <span class="box-button-standard-left">
{{$t('selectedStandard')}} {{$t('selectedStandard')}}
</span> </span>
<span class="box-button-standard-right"> <span class="box-button-standard-right"
{{$t('noComparisonDocumentSelected')}} :class="{'box-button-standard-right-color':selectedRowKeysRightRecord[0]}">
{{selectedRowKeysRightRecord[0]?selectedRowKeysRightRecord[0].serialNumber+' '+selectedRowKeysRightRecord[0].fileName:$t('noComparisonDocumentSelected')}}
</span> </span>
</div> </div>
</div> </div>
@@ -142,12 +144,12 @@
<div class="Remarks"> <div class="Remarks">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm"> <a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<div class="box-title-text-Remarks"> <div class="box-title-text-Remarks">
<div class="title-text-Remarks" :title="$t('standard')"> <div class="title-text-Remarks" :title="$t('RemarkInfo')">
<span>{{$t('RemarkInfo')}}</span> <span>{{$t('RemarkInfo')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="dreUserIdName"> <a-form-model-item class="itemModel" prop="remark">
<a-textarea :placeholder="$t('pleaseEnter')+$t('RemarkInfo')" <a-textarea :placeholder="$t('pleaseEnter')+$t('RemarkInfo')"
v-model="formInline.RemarkInfo" v-model="formInline.remark"
:rows="4"/> :rows="4"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -159,11 +161,13 @@
</div> </div>
</div> </div>
</div> </div>
<JLoading :loading="loading">{{$t('dataLoading')}}</JLoading> <JLoading :loading="loading">{{$t('pleaseWaitWhileRunning')}}</JLoading>
</div> </div>
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction } from '@/api/manage'
export default { export default {
name: 'initiateDocumentComparison', name: 'initiateDocumentComparison',
data() { data() {
@@ -179,10 +183,20 @@
pageSizeRight: 10, pageSizeRight: 10,
selectedRowKeysRight: [], selectedRowKeysRight: [],
dataSourceRight: [], dataSourceRight: [],
selectedRowKeysLeftRecord: [],
selectedRowKeysRightRecord: [],
totalRight: 0, totalRight: 0,
pageNoRight: 1, pageNoRight: 1,
formInline: {}, formInline: {},
rules: {}, rules: {
remark: [
{
max: 300,
message: this.$t('RemarkInfo') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
},
columns: [ columns: [
{ {
title: this.$t('number'), title: this.$t('number'),
@@ -196,7 +210,7 @@
title: this.$t('standard'), title: this.$t('standard'),
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
dataIndex: 'standard' dataIndex: 'serialNumber'
}, },
{ {
title: this.$t('title'), title: this.$t('title'),
@@ -208,26 +222,26 @@
title: this.$t('TextStatus'), title: this.$t('TextStatus'),
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
dataIndex: 'TextStatus' dataIndex: 'fileType'
}, },
{ {
title: this.$t('fileName'), title: this.$t('fileName'),
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
dataIndex: 'fileName' dataIndex: 'fileName'
},
{
title: this.$t('textInformation'),
align: 'center',
ellipsis: true,
dataIndex: 'textInformation'
} }
], ],
dataSourceLeft: [], dataSourceLeft: [],
selectedRowKeysLeft: [] selectedRowKeysLeft: [],
url: {
list: '/split/sarFileSplitInfo/page',
add: '/compare/sarFileCompareInfo/fullTextComparison'
}
} }
}, },
mounted() { mounted() {
this.getListLeft()
this.getListRight()
}, },
methods: { methods: {
Fallback() { Fallback() {
@@ -236,43 +250,133 @@
}) })
}, },
searchQueryLeft() { searchQueryLeft() {
this.pageNoLeft = 1
this.getListLeft()
}, },
searchResetLeft() { searchResetLeft() {
this.queryParamLeft = {}
this.pageNoLeft = 1
this.getListLeft()
}, },
onSelectChangeLeft(value) { onSelectChangeLeft(value, record) {
this.selectedRowKeysLeft = value this.selectedRowKeysLeft = value
this.selectedRowKeysLeftRecord = []
if (this.selectedRowKeysLeft.length > 1) {
this.selectedRowKeysLeft.shift()
}
let content = record.filter(res => {
return res.id == this.selectedRowKeysLeft[0]
})
this.selectedRowKeysLeftRecord = content
}, },
pageOnChangeLeft(page) { pageOnChangeLeft(page) {
this.pageNoLeft = page this.pageNoLeft = page
this.getList() this.getListLeft()
}, },
SizeChangeLeft(pageSize) { SizeChangeLeft(page, pageSize) {
this.pageNoLeft = 1 this.pageNoLeft = 1
this.pageSizeLeft = pageSize this.pageSizeLeft = pageSize
this.getList() this.getListLeft()
}, },
searchQueryRight() { searchQueryRight() {
this.pageNoRight = 1
this.getListRight()
}, },
searchResetRight() { searchResetRight() {
this.queryParamRight = {}
this.pageNoRight = 1
this.getListRight()
}, },
onSelectChangeRight(value) { onSelectChangeRight(value, record) {
this.selectedRowKeysRight = value this.selectedRowKeysRight = value
this.selectedRowKeysRightRecord = []
if (this.selectedRowKeysRight.length > 1) {
this.selectedRowKeysRight.shift()
}
let content = record.filter(res => {
return res.id == this.selectedRowKeysRight[0]
})
this.selectedRowKeysRightRecord = content
}, },
pageOnChangeRight(page) { pageOnChangeRight(page) {
this.pageNoRight = page this.pageNoRight = page
this.getList() this.getListRight()
}, },
SizeChangeRight(pageSize) { SizeChangeRight(page, pageSize) {
this.pageNoRight = 1 this.pageNoRight = 1
this.pageSizeRight = pageSize this.pageSizeRight = pageSize
this.getList() this.getListRight()
}, },
submit() { submit() {
if (!this.selectedRowKeysRightRecord[0] || !this.selectedRowKeysLeftRecord[0]) {
this.$message.warning(this.$t('pleaseSelectTheDataCompared'))
return
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.loading = true
let query = {
leftStandard: this.selectedRowKeysLeftRecord[0].id,
rightStandard: this.selectedRowKeysRightRecord[0].id,
remark: this.formInline.remark
}
postAction(this.url.add, query).then((res) => {
if (res.success) {
this.loading = false
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
},
getListLeft() {
let queryParam = JSON.parse(JSON.stringify(this.queryParamLeft))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
let query = {
pageNo: this.pageNoLeft,
pageSize: this.pageSizeLeft,
...queryParam
}
this.loadingLeft = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataSourceLeft = res.result.records || []
this.totalLeft = res.result.total
this.loadingLeft = false
} else {
this.loadingLeft = false
}
})
},
getListRight() {
let queryParam = JSON.parse(JSON.stringify(this.queryParamRight))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
let query = {
pageNo: this.pageNoRight,
pageSize: this.pageSizeRight,
...queryParam
}
this.loadingRight = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataSourceRight = res.result.records || []
this.totalRight = res.result.total
this.loadingRight = false
} else {
this.loadingRight = false
}
})
} }
} }
} }
@@ -286,6 +390,8 @@
height: 100%; height: 100%;
.doc-detail-wrap { .doc-detail-wrap {
padding-bottom: 20px;
.doc-detail-header { .doc-detail-header {
width: 100%; width: 100%;
z-index: 1000; z-index: 1000;
@@ -319,6 +425,8 @@
padding: 24px 32px; padding: 24px 32px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 2px #EFF1F3 solid; border-bottom: 2px #EFF1F3 solid;
min-height: 400px;
max-height: 672px;
} }
.detail-content-right { .detail-content-right {
@@ -327,6 +435,8 @@
padding: 24px 32px; padding: 24px 32px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 2px #EFF1F3 solid; border-bottom: 2px #EFF1F3 solid;
min-height: 400px;
max-height: 672px;
} }
.page { .page {
@@ -442,4 +552,8 @@
padding: 0 32px; padding: 0 32px;
box-sizing: border-box; box-sizing: border-box;
} }
.box-button-standard-right-color {
color: #040B29;
}
</style> </style>
@@ -96,7 +96,7 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage' import { getAction, postAction, deleteAction } from '@/api/manage'
export default { export default {
name: 'index', name: 'index',
@@ -105,8 +105,8 @@
return { return {
//url传参严格按照当前命名 //url传参严格按照当前命名
url: { url: {
list: '', list: '/compare/sarFileCompareInfo/page',
deleteBatch: '' deleteBatch: '/compare/sarFileCompareInfo/deleteBatch'
}, },
loading: false, loading: false,
dataSource: [{}], dataSource: [{}],
@@ -129,67 +129,67 @@
{ {
title: this.$t('standard') + 1, title: this.$t('standard') + 1,
align: 'center', align: 'center',
dataIndex: 'serialNumber', dataIndex: 'serialNumberLeft',
width: 170 width: 170
}, },
{ {
title: this.$t('title') + 1, title: this.$t('title') + 1,
align: 'center', align: 'center',
dataIndex: 'title', dataIndex: 'titleLeft',
width: 170 width: 170
}, },
{ {
title: this.$t('TextStatus'), title: this.$t('TextStatus'),
align: 'center', align: 'center',
width: 170, width: 200,
ellipsis: true, ellipsis: true,
dataIndex: 'TextStatus' dataIndex: 'fileTypeLeft'
}, },
{ {
title: this.$t('fileName'), title: this.$t('fileName'),
align: 'center', align: 'center',
width: 170, width: 270,
ellipsis: true, ellipsis: true,
dataIndex: 'fileName' dataIndex: 'fileNameLeft'
}, },
{ {
title: this.$t('standard') + 2, title: this.$t('standard') + 2,
align: 'center', align: 'center',
dataIndex: 'serialNumberTwo', dataIndex: 'serialNumberRight',
width: 170 width: 170
}, },
{ {
title: this.$t('title') + 2, title: this.$t('title') + 2,
align: 'center', align: 'center',
dataIndex: 'titleTwo', dataIndex: 'titleRight',
width: 170 width: 170
}, },
{ {
title: this.$t('TextStatus'), title: this.$t('TextStatus'),
align: 'center', align: 'center',
width: 170, width: 200,
ellipsis: true, ellipsis: true,
dataIndex: 'TextStatusTwo' dataIndex: 'fileTypeRight'
}, },
{ {
title: this.$t('fileName'), title: this.$t('fileName'),
align: 'center', align: 'center',
width: 170, width: 270,
ellipsis: true, ellipsis: true,
dataIndex: 'fileNameTwo' dataIndex: 'fileNameRight'
}, },
{ {
title: this.$t('releaseSituation'), title: this.$t('releaseSituation'),
align: 'center', align: 'center',
width: 170, width: 170,
ellipsis: true, ellipsis: true,
dataIndex: 'releaseSituation' dataIndex: 'releaseState'
}, },
{ {
title: this.$t('remarks'), title: this.$t('remarks'),
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
width: 170, width: 270,
dataIndex: 'remark' dataIndex: 'remark'
}, },
{ {
@@ -203,7 +203,7 @@
} }
}, },
mounted() { mounted() {
// this.getList() this.getList()
}, },
methods: { methods: {
searchQuery() { searchQuery() {
@@ -276,7 +276,7 @@
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmDelete'), content: _this.$t('ConfirmDelete'),
onOk() { onOk() {
getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => { deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
_this.getList() _this.getList()