Files
foton-laws-system-front/src/pages/processCenter/pages/creatProcess/bzjd/step4.vue
T
2021-12-17 17:31:05 +08:00

596 lines
24 KiB
Vue

<template>
<div class="bzjdStep4">
<!-- 标准调研流程-->
<ProcessHeader toggle>
<template slot="proName">标准解读流程</template>
<template slot="proNode">责任人审核</template>
</ProcessHeader>
<div class="headerTabs">
<div class="headerTabsItem" :class="active === '1' ? 'active' : ''" @click="handleTabs('1')">基础信息</div>
<div class="headerTabsItem" :class="active === '2' ? 'active' : ''" @click="handleTabs('2')">审批历史</div>
</div>
<div class="content" v-show="active === '1'">
<div style="overflow: auto;">
<el-form
ref="bzzqyjForm"
:model="form"
class="label-input-form"
label-width="210px"
>
<ProcessTitle>
<template slot="title">基础信息</template>
</ProcessTitle>
<el-collapse-transition>
<div class="prc-content-border" v-if="foldFormFlag === false">
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="标准编号" prop="cid" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.itemsNum"
placeholder="请输入标准编号"
clearable
></el-input>
</el-form-item>
<el-form-item label="标准名称" prop="cname" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.itemsName"
placeholder="请输入标准名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="上一版本标准号/政策号" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.itemsNum1"
clearable
></el-input>
</el-form-item>
<el-form-item label="上一版本标准名称/政策名称" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.itemsName1"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
</el-collapse-transition>
<el-button v-if="foldFormFlag === false" style="width: 100%" icon="el-icon-caret-top" @click="foldForm">隐藏基础信息</el-button>
<el-button v-if="foldFormFlag === true" style="width: 100%" icon="el-icon-caret-bottom" @click="foldForm">展开基础信息</el-button>
</el-form>
</div>
<ProcessTitle>
<template slot="title">拆分信息</template>
</ProcessTitle>
<el-table border
ref="selection"
:data="itemList"
tooltip-effect="dark"
style="width: 100%;"
height="100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
row-key="id"
>
<el-table-column
prop="itemsNum"
label="条款号"
width="70"
align="center">
</el-table-column>
<el-table-column
prop="itemsName"
label="条款名称"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
prop="itermsConditions"
label="条款内容"
width="200"
show-overflow-tooltip
align="center">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="itermsConditionsOpen(scope.row.itermsConditions)" class="common-button-primary">查看条款内容</el-button>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="technicalRequir"
width="200"
v-if="!form.itemsNum1"
label="核心技术要求"
align="center">
</el-table-column>
<el-table-column
show-overflow-tooltip
v-if="sarType === 'INLAND' && form.itemsNum1"
prop="changePoint"
width="150"
label="基于上一版本差异"
align="center">
</el-table-column>
<el-table-column
show-overflow-tooltip
v-if="sarType === 'FOREIGN'"
prop="changePoint"
width="150"
label="相对于国行标差异点"
align="center">
</el-table-column>
<el-table-column
prop="complianceRequir"
width="150"
label="符合项状态"
align="center">
<template slot-scope="scope">
<div v-if="scope.row.complianceRequir === '1'">符合</div>
<div v-else>不符合</div>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="complianceState"
width="200"
label="合规性分析"
align="center">
</el-table-column>
<el-table-column
prop="newData"
show-overflow-tooltip
width="150"
label="新车型实施日期"
align="center">
</el-table-column>
<el-table-column
prop="onlineData"
show-overflow-tooltip
width="150"
label="在产车型实施日期"
align="center">
</el-table-column>
<el-table-column
prop="applyArctic"
width="150"
label="适用车型"
show-overflow-tooltip
align="center">
<template slot-scope="scope">
{{ scope.row.applyArctic.toString() }}
</template>
</el-table-column>
<el-table-column
prop="unitDeptName"
label="责任部门"
width="170"
align="center">
</el-table-column>
<el-table-column
label="责任人"
width="170"
prop="zrUserIdName"
align="center">
</el-table-column>
<el-table-column
label="操作"
width="140"
align="center">
<template slot-scope="scope">
<el-button class="common-button-primary" size="mini" type="primary" @click="checkBD(scope.row.itemsId, scope.row.itemsId2)">查看比对</el-button>
</template>
</el-table-column>
</el-table>
<el-collapse accordion>
<el-collapse-item title="审批意见">
<div style="margin: 10px 0;">
<el-input
type="textarea"
:rows="3"
resize="none"
placeholder="请输入意见"
v-model="commentText">
</el-input>
</div>
</el-collapse-item>
</el-collapse>
</div>
<div class="content" v-show="active === '2'">
<el-table
height="100%"
ref="selection"
:data="histortData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
<el-table-column
prop="name"
label="任务步骤"
align="center"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="assignee"
label="任务受理人"
align="center"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
sortable="custom"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime ? $moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') : '' }}</span>
</template>
</el-table-column>
<el-table-column
prop="endTime"
label="完成时间"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.endTime ? $moment(scope.row.endTime).format('YYYY-MM-DD HH:mm:ss') : '' }}</span>
</template>
</el-table-column>
<el-table-column
prop="comment"
label="流程信息"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.commentText }}</span>
</template>
</el-table-column>
<el-table-column
prop="completeFlag"
label="状态"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.endTime ? '已完成' : '未完成'}}</span>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="loading">加载中...</loading>
<ProcessFooter
show-submit
:submitLoading="isSubmit"
:saveLoading="saveLoading"
@save="handleSave"
@submit="handleSubmit"
show-back
@back="handleSubmitNo"
show-transfer
@transfer="handleTransfer"
submitBTNText="同意"
>
</ProcessFooter>
<el-dialog
title="查看条款内容"
:visible.sync="itermsConditionsFlag"
size="800px">
<div style="height: 500px;overflow: auto;" v-html="itermsConditionsTitle"></div>
<div slot="footer">
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="itermsConditionsClose">关闭</el-button>
</div>
</el-dialog>
<el-dialog
title="查看比对内容"
:visible.sync="BDmodel"
size="1100px">
<div>相似度:{{ similarityDegree }}</div>
<div style="height: 600px;overflow: auto;display: flex;">
<div v-html="leftData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%;"></div>
<div v-html="rightData" style="margin: 5px; border: 1px solid #ccc; border-radius: 5px; padding: 5px; width: 50%;"></div>
</div>
</el-dialog>
</div>
</template>
<script>
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import {inboundLiaisonDetail,processCreateStand,changeAssigneeNew} from 'api/process'
import axios from "axios";
export default {
name: "bzjdStep4",
data() {
return {
similarityDegree: '',
BDmodel: false,
oldNumber: '',
leftData: '',
rightData: '',
drawerModal: false,
//折叠的标志,true为折叠,false为不折叠
foldFormFlag: false,
itermsConditionsFlag: false,
itermsConditionsTitle: '',
histortData: [],
sarType: '',
itemList: [],
loading: true,
commentText: '',
taskIds: this.$route.query.taskIds,
pId: this.$route.query.prcId,
textarea: '', // 意见
active: '1', // 默认显示
isSubmit: false,
saveLoading: false,
form: {
itemsNum: '',
itemsName: '',
itemsNum1: '',
itemsName1: '',
},
json: {},
}
},
components: {
ProcessHeader,
ProcessFooter,
ProcessTitle
},
methods: {
getBDList () {
this.$http.get('lawss/sarStandItemsCompareHis/getStandItemsCompareHisList', {
standHisId: this.oldNumber,
leftOrRight: 'LEFT'
}, {
_this: this
}, res => {
for (let a = 0; a < this.itemList.length; a++) {
for (let b = 0; b < res.data.length; b++) {
if (this.itemList[a].itemsNum === res.data[b].itemsNum) {
this.itemList[a].itemsId = res.data[b].itemsId
}
}
}
}, e => {
})
this.$http.get('lawss/sarStandItemsCompareHis/getStandItemsCompareHisList', {
standHisId: this.oldNumber,
leftOrRight: 'RIGHT'
}, {
_this: this
}, res => {
for (let a = 0; a < this.itemList.length; a++) {
for (let b = 0; b < res.data.length; b++) {
if (this.itemList[a].itemsNum === res.data[b].itemsNum) {
this.itemList[a].itemsId2 = res.data[b].itemsId
}
}
}
}, e => {
})
},
checkBD (id,id2) {
let itemsEoPage = {
oldItemId: id,
newItemId: id2,
flag: 1
}
this.$http.post('lawss/sarStandCompareHis/clauseComparison', itemsEoPage, {
_this: this
}, res => {
if (res.data.leftString === '' && res.data.rightString === '') {
this.$message.warning('暂无找到相似的文本')
} else {
this.leftData = res.data.leftString
this.rightData = res.data.rightString
this.BDmodel = true
this.similarityDegree = res.data.similarityDegree
}
})
},
itemEdit (row) {
this.itemId = row.id
this.modalshowflag2 = true
this.editForm = {
technicalRequir: row.technicalRequir, // 核心技术要求
changePoint: row.changePoint, // 国内标准的差异点
complianceRequir: row.complianceRequir || '1', // 符合性要求
complianceState: row.complianceState, // 合规性分析
newData: row.newData, // 新车型实施日期
onlineData: row.onlineData, // 在产车实施日期
applyArctic: row.applyArctic, // 适用车型
itemsId: row.itemsId,
itemsId2: row.itemsId2
}
},
phoneClick () {
this.$router.push('/phoneBzjdStep4')
},
handleTransfer() {
this.drawerModal = true
},
checkedRole (data) {
changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人
assignee: data[0].id, // 被委托人
pId: this.$route.query.prcId, // 流程实例
}).then(res => {
if (res.success) {
this.drawerModal = false
this.$message.success('调整成功')
this.processNum()
this.$router.push({path:'/processCenter?tabsName=ProcessCenter'})
} else {
this.$message.warning(res.message)
}
})
},
// 请求转换流程图
processNum (row) {
axios.request({
url: '/api/lawss/activiti/getImg?_t=' + new Date().getTime(),
responseType: 'blob',
method: 'get',
params: {
prcNum: this.$route.query.prcNum
}
}).then(res => {
this.processStep = window.URL.createObjectURL(res.data)
})
},
//折叠/展开基础信息方法
foldForm() {
this.foldFormFlag = !this.foldFormFlag
},
itermsConditionsClose () {
this.itermsConditionsFlag = false
},
itermsConditionsOpen (row) {
this.itermsConditionsFlag = true
this.itermsConditionsTitle = row
},
getHistoryData () {
this.$http.get('lawss/activiti/get_list_by_instance', {
prcNum: this.$route.query.prcNum,
}, {}, res => {
this.histortData = res
}, e => {})
},
handleTabs(name) {
this.active = name
},
handleSave() {},
handleSubmit() {
this.isSubmit = true
var json = this.json
json.resolveFlag = 1
json.commentText = this.commentText
this.$http.post('lawss/activiti/completeTask', {
json: JSON.stringify(json),
taskId: this.taskIds,
userId: this.$store.getters.userInfo.userId
}, {}, res => {
if (res.success) {
this.$message.success('提交成功')
this.$router.push('/processCenter')
}
this.isSubmit = false
})
},
handleSubmitNo () {
if (this.commentText) {
this.isSubmit = true
var json = this.json
json.resolveFlag = 2
json.commentText = this.commentText
this.$http.post('lawss/activiti/completeTask', {
json: JSON.stringify(json),
taskId: this.taskIds,
userId: this.$store.getters.userInfo.userId
}, {}, res => {
if (res.success) {
this.$message.success('驳回成功')
this.$router.push('/processCenter')
}
this.isSubmit = false
})
} else {
this.$message.warning('请输入反馈意见')
}
},
getData() {
return new Promise((resolve, reject) => {
inboundLiaisonDetail({
taskIds: this.taskIds,
pId: this.pId
}).then(res => {
let data = JSON.parse(res.mesg)
this.form.itemsNum = data.itemsNum || data.form.itemsNum
this.form.itemsName = data.itemsName || data.form.itemsName
if (data.form) {
this.form.itemsName1 = data.form.itemsName1 || ''
this.form.itemsNum1 = data.form.itemsNum1 || ''
} else {
this.form.itemsName1 = data.itemsName1 || ''
this.form.itemsNum1 = data.itemsNum1 || ''
}
this.sarType = data.standInData || data.sarType
this.json = data
this.itemList = data.itemList
this.loading = false
this.getBDList()
}).catch(e => {
})
})
},
},
mounted () {
this.getHistoryData()
this.getData()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.bzjdStep4 {
/deep/.el-drawer__container {
.prc-content-border {
border: none;
padding: 0 20px 0;
}
}
.fileClass {
cursor: pointer;
}
.fileClass:hover{
color: #0c91e5;
}
position: relative;
height: 100%;
.headerTabs {
height: 52px;
display: flex;
align-items: center;
position: absolute;
top: 0;
right: 10px;
.headerTabsItem {
border: 1px solid #c1c1c1;
padding: 0 5px;
height: 30px;
line-height: 30px;
cursor: pointer;
}
.active {
border: 1px solid #E6A23C;
color: #fff;
background: #E6A23C;
}
}
.content {
display: flex;
flex-direction: column;
justify-content: space-between;
height: calc(~'100% - 103px');
overflow: auto;
.tableTitle {
margin-bottom: 10px;
height: 30px;
line-height: 30px;
position: relative;
font-size: 13px;
font-weight: bold;
.tableButton {
position: absolute;
right: 0;
top: 0;
}
}
}
}
</style>