对接条款比对

This commit is contained in:
范强强
2024-02-27 15:37:27 +08:00
parent 48d50501ce
commit bfc81e9a46
@@ -130,7 +130,9 @@ export default {
leftData: {}, leftData: {},
rightData: {}, rightData: {},
textRight: '', textRight: '',
textLeft: '' textLeft: '',
textLeftId: '',
textRightId: ''
} }
}, },
mounted () { mounted () {
@@ -144,7 +146,7 @@ export default {
// 左侧树选择 // 左侧树选择
onSelectLeft (selectedKeys, exports) { onSelectLeft (selectedKeys, exports) {
const node = exports.node.$vnode.data.props.dataRef const node = exports.node.$vnode.data.props.dataRef
if (!node.pid) { if (node.children && node.children.length > 0) {
return return
} }
this.leftData = node this.leftData = node
@@ -161,13 +163,16 @@ export default {
this.loading = true this.loading = true
documentSplitView(query).then((res) => { documentSplitView(query).then((res) => {
if (res.success) { if (res.success) {
if (res.result.records && res.result.records.length > 0){ if (res.result.records && res.result.records.length > 0) {
this.textLeft = res.result.records[0].item_content this.textLeft = res.result.records[0].item_content
this.textLeftId = res.result.records[0].id
} else { } else {
this.textLeft = '' this.textLeft = ''
this.textLeftId = ''
} }
} else { } else {
this.textLeft = '' this.textLeft = ''
this.textLeftId = ''
} }
this.loading = false this.loading = false
}) })
@@ -175,7 +180,7 @@ export default {
// 右侧树选择 // 右侧树选择
onSelectRight (selectedKeys, exports) { onSelectRight (selectedKeys, exports) {
const node = exports.node.$vnode.data.props.dataRef const node = exports.node.$vnode.data.props.dataRef
if (!node.pid) { if (node.children && node.children.length > 0) {
return return
} }
this.rightData = node this.rightData = node
@@ -193,13 +198,16 @@ export default {
this.loading = true this.loading = true
documentSplitView(query).then((res) => { documentSplitView(query).then((res) => {
if (res.success) { if (res.success) {
if (res.result.records && res.result.records.length > 0){ if (res.result.records && res.result.records.length > 0) {
this.textRight = res.result.records[0].item_content this.textRight = res.result.records[0].item_content
this.textRightId = res.result.records[0].id
} else { } else {
this.textRight = '' this.textRight = ''
this.textRightId = ''
} }
} else { } else {
this.textRight = '' this.textRight = ''
this.textRightId = ''
} }
this.loading = false this.loading = false
}) })
@@ -227,20 +235,22 @@ export default {
}) })
}, },
comparisonClick () { comparisonClick () {
if (!this.leftData.id) { if (!this.textLeftId) {
this.$message.warning('请选择左侧条款') this.$message.warning('请选择左侧条款')
} else if (!this.rightData.id) { } else if (!this.textRightId) {
this.$message.warning('请选择右侧条款') this.$message.warning('请选择右侧条款')
} else { } else {
const query = { const query = {
oldItemId: this.leftData.id, oldItemId: this.textLeftId,
newItemId: this.rightData.id, newItemId: this.textRightId,
standHisId: this.$route.query.id standHisId: this.$route.query.id
} }
this.loading = true
clauseComparisonEvent(query).then((res) => { clauseComparisonEvent(query).then((res) => {
if (res.success) { if (res.success) {
} }
this.loading = false
}) })
} }
} }