对接手机端

This commit is contained in:
范强强
2023-06-07 15:09:52 +08:00
parent 8f8569ed13
commit 7ce6402428
2 changed files with 373 additions and 127 deletions
+348 -113
View File
@@ -3,12 +3,12 @@
<div class="header-search">
<van-icon @click="iconClick" class="icon" name="arrow-left"/>
<span class="header-search-text">
ISO 16750-4-2023 设计符合性流程
{{queryForm.serialNumber}} {{title}}
</span>
</div>
<van-collapse class="collapse" v-model="activeNames">
<van-collapse-item title="基本信息" name="1">
<van-collapse-item :title="$t('essentialInformation')" name="1">
<div class="content-box-type">
<span class="content-box-left">{{$t('entryName')}}</span>
<span class="content-box-text">{{queryForm.projectName+'-'+queryForm.projectVersion}}</span>
@@ -31,7 +31,7 @@
</div>
</van-collapse-item>
<van-collapse-item title="任务要求" name="2">
<van-collapse-item :title="$t('TaskRequirements')" name="2">
<div class="content-box-type">
<span class="content-box-left">{{$t('Sponsor')}}</span>
<span class="content-box-text">{{queryProject[queryData.Sponsor] || '--'}}</span>
@@ -51,8 +51,13 @@
<div class="content-box-type-text">
{{$t('deliverableTemplate')}}
</div>
<div class="content-box-type-text-one">
线控底盘技术发展与标准化需求研究报告.pdf
<div class="content-box-type-text-one" v-if="dataSourceFile && dataSourceFile.length == 0">
--
</div>
<div class="content-box-type-text-one"
v-else
v-for="item in dataSourceFile">
{{item.fileName}}
</div>
<div class="content-box-type-text">
{{$t('descriptionDeliverables')}}
@@ -61,138 +66,136 @@
{{queryProject[queryData.remarks] || '--'}}
</div>
</van-collapse-item>
<van-collapse-item title="流程历史" name="3">
<van-collapse-item :title="$t('Processhistory')" name="3">
<van-steps inactive-icon="passed"
active-icon="passed"
active-color="#00BEBE"
direction="vertical" :active="1">
<van-step>
direction="vertical" :active="dataSource.length">
<van-step v-for="(item,index) in dataSource" :key="index">
<div class="vanStepBox">
<div class="van-text">
发起流程
<span class="van-text-color">
接受
{{item.name}}
<span class="van-text-color" :class="statusClass[item.operatorResult]" v-if="item.operatorResultName">
{{item.operatorResultName}}
</span>
</div>
<div class="van-time">
<span class="van-name">
Yingxi.Sun
{{item.assignee}}
</span>
|
<span class="van-name-time">
2016-07-12 12:40
{{item.createTime}}
</span>
</div>
<div class="van-desgin">
这里是反馈意见这里是反馈意见这里是反馈意见这里是反馈意见
{{item.approvalOpinion}}
</div>
<div class="van-file">
线控底盘技术发展与标准化需求研究报告.pdf
</div>
<div class="van-file">
线控底盘技术发展与标准化需求研究报告.pdf
</div>
</div>
</van-step>
<van-step>
<div class="vanStepBox">
<div class="van-text">
发起流程
<span class="van-text-color">
接受
</span>
</div>
<div class="van-time">
<span class="van-name">
Yingxi.Sun
</span>
|
<span class="van-name-time">
2016-07-12 12:40
</span>
</div>
<div class="van-desgin">
这里是反馈意见这里是反馈意见这里是反馈意见这里是反馈意见
</div>
<div class="van-file">
线控底盘技术发展与标准化需求研究报告.pdf
</div>
<div class="van-file">
线控底盘技术发展与标准化需求研究报告.pdf
</div>
</div>
</van-step>
<van-step>
<div class="vanStepBox">
<div class="van-text">
发起流程
<span class="van-text-color">
接受
</span>
</div>
<div class="van-time">
<span class="van-name">
Yingxi.Sun
</span>
|
<span class="van-name-time">
2016-07-12 12:40
</span>
</div>
<div class="van-desgin">
这里是反馈意见这里是反馈意见这里是反馈意见这里是反馈意见
</div>
<div class="van-file">
线控底盘技术发展与标准化需求研究报告.pdf
</div>
<div class="van-file">
线控底盘技术发展与标准化需求研究报告.pdf
<div class="van-file" v-if="item.approvalFileName && item.approvalFileName.length > 0"
v-for="(val,index1) in item.approvalFileName" :key="index1">
{{val}}
</div>
</div>
</van-step>
</van-steps>
</van-collapse-item>
<van-collapse-item title="发起人审查" name="4">
<van-form @submit="onSubmit">
<van-field name="radio" label="处理结果">
<van-collapse-item :title="examineTitle" name="4" v-if="!queryData.isDisplay">
<van-form @submit="onSubmit" ref="form">
<van-field name="disposeResult"
:rules="[{ required: true, message: $t('resultofhandling') + $t('cannotEmpty') }]"
:label="$t('resultofhandling')">
<template #input>
<van-radio-group v-model="form.radio" direction="horizontal">
<van-radio name="1">通过</van-radio>
<van-radio name="2">退回</van-radio>
<van-radio-group v-model="form.disposeResult" direction="horizontal">
<van-radio name="Accepted" v-if="queryData.TaskKey == 'zrrqr' || queryData.TaskKey == 'dezrrqr'">
{{$t('accept')}}
</van-radio>
<van-radio name="Rejected" v-if="queryData.TaskKey == 'zrrqr'">
{{$t('refuse')}}
</van-radio>
<van-radio name="Adopt" :disabled="isAdopt" v-if="queryData.TaskKey == 'fggcssh' || queryData.TaskKey == 'fggcsbcsh'">
{{$t('adopt')}}
</van-radio>
<van-radio name="Compliance"
v-if="queryData.TaskKey == 'dezrrtjjfw' || queryData.TaskKey == 'zrrtjjfw' || queryData.TaskKey == 'zrrbctjxg'">
{{$t('accord')}}
</van-radio>
<van-radio name="Non-Compliance"
v-if="queryData.TaskKey == 'dezrrtjjfw' || queryData.TaskKey == 'zrrtjjfw' || queryData.TaskKey == 'zrrbctjxg'">
{{$t('nonConformity')}}
</van-radio>
<van-radio name="To be tracked"
v-if="queryData.TaskKey == 'zrrtjjfw' || queryData.TaskKey == 'dezrrtjjfw' || queryData.TaskKey == 'zrrbctjxg'">
{{$t('Tracked')}}
</van-radio>
<van-radio name="NA"
v-if="queryData.TaskKey == 'zrrtjjfw' || queryData.TaskKey == 'dezrrtjjfw' || queryData.TaskKey == 'zrrbctjxg'">
{{$t('notInvolved')}}
</van-radio>
<van-radio name="Returned"
v-if="queryData.TaskKey == 'dezrrqr' || queryData.TaskKey == 'dezrrtjjfw' ||
queryData.TaskKey == 'zrrtjjfw' || queryData.TaskKey == 'fggcssh' || queryData.TaskKey == 'fggcsbcsh'">
{{$t('sendBack')}}
</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-model="form.message"
v-model.trim="form.approvalOpinion"
rows="4"
class="textarea"
autosize
label="反馈意见"
:show-error="false"
:rules="[{ required: true, message: $t('feedbackMessage') + $t('cannotEmpty') }]"
:label="$t('feedback')"
maxlength="200"
type="textarea"
placeholder="请输入反馈意见"
:placeholder="$t('pleaseEnter')+$t('feedbackMessage')"
/>
<van-field name="uploader" class="uploader" label="附件上传">
<van-field name="uploader" class="uploader"
v-if="queryData.TaskKey == 'dezrrtjjfw' || queryData.TaskKey == 'zrrtjjfw' || queryData.TaskKey == 'fggcssh'
|| queryData.TaskKey == 'zrrbctjxg' || queryData.TaskKey == 'fggcsbcsh'"
:label="$t('attachmentUpload')">
<template #input>
<van-uploader class="uploader-button">
<van-uploader :preview-image="false"
accept="*"
:after-read="upload"
class="uploader-button">
<van-button icon="back-top" type="primary">上传</van-button>
</van-uploader>
</template>
</van-field>
<div class="file-list"
v-for="(item,index) in fileList"
:key="index">
<span class="file-text">{{item.fileName}}
<van-icon class="file-text-icon" name="passed"/>
</span>
<a-icon @click="fileClick(index)" class="icon-text" type="delete"/>
</div>
<van-button class="submitButton"
round
block
type="info"
native-type="submit">提交
</van-button>
</van-form>
</van-collapse-item>
</van-collapse>
<van-overlay :show="show">
<van-loading type="spinner">{{$t('loading')}}</van-loading>
<van-loading type="spinner">{{textLoading}}</van-loading>
</van-overlay>
</div>
</template>
<script>
import { getAction, postAction, deleteAction, downloadFile, putAction } from '@/api/manage'
import { getAction, postAction, deleteAction, downloadFile, uploadAction } from '@/api/manage'
import { mapGetters } from 'vuex'
import moment from 'moment'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default {
name: 'phoneProcessManagement',
@@ -201,21 +204,43 @@
activeNames: ['1', '2', '3', '4'],
show: false,
form: {},
statusClass: {
'Accepted': 'AcceptedClass',
'Rejected': 'RejectedClass',
'Transfer': 'TransferClass',
'Returned': 'ReturnedClass',
'Adopt': 'AdoptClass',
'Compliance': 'ComplianceClass',
'Non-Compliance': 'NonComplianceClass',
'To be tracked': 'trackedClass',
'NA': 'NAClass'
},
dataSource: [],
url: {
urlFrom: 'project/projectLibraryBase/queryById',
queryProjectLawsInventoryInfoById: 'project/projectLawsInventoryEO/queryProjectLawsInventoryInfoById',
queryTaskDetailByTaskIds: '/task/queryTaskDetailByTaskIds',
edit: '/project/projectTaskInventoryDetailEO/edit',
dreSubmit: '/project/projectTaskInventoryFeedbackEO/dreSubmit',
list: '/project/projectTaskInventoryFeedbackEO/list'
list: '/project/projectTaskInventoryFeedbackEO/list',
historyList: '/wkflow/processHistoryEO/queryComplianceProcessHistoryList'
},
queryForm: {},
queryProject: {},
queryBy: {}
queryBy: {},
queryData: {},
title: '',
dataSourceFile: [],
textLoading: '',
fileList: [],
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload',
examineTitle: '',
isAdopt:false,
}
},
mounted() {
document.title = 'NIO GRP'
this.textLoading = this.$t('loading')
this.getData(this.$route.query)
},
methods: {
@@ -224,34 +249,34 @@
this.$router.go(-1)
},
onSubmit() {
this.$refs.form.validate().then(() => {
let handlingTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
let content = []
if (this.fileList && this.fileList.length > 0) {
this.fileList.forEach(res => {
content.push(res.id)
})
}
this.form.approvalFile = content.join(',')
this.completeTask({ operatorTime: handlingTime, ...this.form })
})
},
getData(row) {
this.show = true
this.queryData = row
this.queryData.isDisplay = JSON.parse(this.queryData.isDisplay)
let _this = this
this.standardContentList = [
{
title: this.$t('deliveryDate'),
value: this.queryData.DueDate
},
{
title: this.$t('typeOfDeliverables'),
value: this.queryData.typeOfDeliverables
},
{
title: this.$t('deliverableTemplate'),
value: this.queryData.deliverableTemplate,
type: 2
},
{},
{
title: this.$t('descriptionDeliverables'),
value: this.queryData.remarks
}
]
if (row.flowType == '2') {
this.title = this.$t('designTheComplianceProcess')
} else if (row.flowType == '4') {
this.title = this.$t('verifyComplianceProcess')
}
if (row.TaskKey == 'zrrqr' || row.TaskKey == 'dezrrqr' || row.TaskKey == 'zrrtjjfw' || row.TaskKey == 'dezrrtjjfw') {
this.examineTitle = this.$t('personLiableConfirm')
} else {
this.examineTitle = this.$t('sponsorReview')
}
this.getHistoryList()
if (row.taskIds) {
this.queryTaskDetailByTask(function() {
_this.queryProjectLawsInventoryInfo()
@@ -262,6 +287,7 @@
this.queryProjectLawsInventoryInfo()
}
},
queryTaskDetailByTask(callback) {
this.loading = true
getAction(this.url.queryTaskDetailByTaskIds, { taskIds: this.queryData.taskIds }).then((res) => {
@@ -274,6 +300,7 @@
}
})
},
queryProjectLawsInventoryInfo() {
let query = {
id: this.queryBy.id,
@@ -284,12 +311,58 @@
getAction(this.url.queryProjectLawsInventoryInfoById, query).then((res) => {
if (res.success) {
this.queryProject = res.result[0] || {}
if (this.queryBy.disposeResult == 'To be tracked' || this.queryBy.disposeResult == 'Non-Compliance') {
this.isAdopt = true
}
if (this.queryProject[this.queryData.deliverableTemplate]) {
this.getFileInfos(this.queryProject[this.queryData.deliverableTemplate])
}
this.getQueryForm()
} else {
this.queryProject = {}
}
})
},
getHistoryList() {
let query = {
actiProcInstId: this.queryData.actiProcInstId || this.queryData.prcId,
flowType: this.queryData.flowType,
projectLawsInventoryId: this.queryData.projectTaskInventoryId
}
getAction('/wkflow/processHistoryEO/queryComplianceProcessHistoryList', query).then((res) => {
if (res.success) {
this.dataSource = res.result || []
this.dataSource.forEach(val => {
if (val.approvalFileName) {
val.approvalFileName = val.approvalFileName.split(',')
val.approvalFile = val.approvalFile.split(',')
}
})
} else {
this.dataSource = []
}
})
},
getFileInfos(item) {
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
console.log(this.dataSourceFile)
} else {
this.dataSourceFile = []
}
})
},
getQueryForm() {
getAction(this.url.urlFrom, { id: this.queryBy.projectLibraryId }).then((res) => {
if (res.success) {
@@ -302,6 +375,67 @@
this.queryForm = {}
}
})
},
async upload(file) {
// 这时候我们创建一个formData对象实例
const formData = new FormData()
// 通过append方法添加需要的file
// 这里需要注意 append(key, value)来添加数据,如果指定的key不存在则会新增一条数据,如果key存在,则添加到数据的末尾
formData.append('file', file.file)
// 调用uploadFile上传的接口
const res = await this.uploadFile(formData)
this.fileList.push(res)
// 上传文件的guid和后台返回的guid一样,通过push方法把上传的文件存放到上传成功才能提交的数组里面
},
uploadFile(formData) {
this.textLoading = this.$t('loading')
this.show = true
return new Promise(resolve => {
const token = Vue.ls.get(ACCESS_TOKEN)
axios({
url: this.uploadAction,
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data', // 文件上传
'X-Access-Token': token
}
}).then((res) => {
resolve(res.data.result)
this.show = false
})
})
},
completeTask(value) {
this.textLoading = this.$t('Submitting')
this.show = true
let json = Object.assign(this.queryBy, value)
let data = JSON.stringify(json).replace(/\"/g, '\'')
Object.keys(value).forEach(res => {
if (value[res] && typeof value[res] == 'string') {
value[res] = value[res].replace(/\"/g, '“')
value[res] = value[res].replace(/\'/g, '')
}
})
let query = {
userid: this.userInfo().id,
taskId: this.queryData.taskId || this.queryData.taskIds,
json: data
}
postAction('/workFlow/completeTask', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.show = false
this.$router.go(-1)
} else {
this.show = false
this.$message.warning(res.message)
}
})
},
fileClick(index) {
this.fileList.splice(index, 1)
}
}
}
@@ -508,6 +642,7 @@
font-weight: 400;
color: #01A0AC;
margin-top: 0.3rem;
word-break: break-all;
}
::v-deep .van-form .van-cell__title {
@@ -521,7 +656,7 @@
::v-deep .van-form .van-radio__icon .van-icon {
width: 0.45rem;
height: 0.45rem;
line-height: 0.45rem;
line-height: 0.38rem;
}
::v-deep .van-form .van-radio__icon--checked .van-icon {
@@ -600,4 +735,104 @@
align-items: center;
justify-content: center;
}
.submitButton {
border-radius: 0.2rem;
background: #00B3BE;
border: none;
margin-top: 1.2rem;
}
::v-deep .van-icon-success:before {
font-size: 0.34rem;
text-align: center;
}
::v-deep .van-radio {
margin-bottom: 0.1rem;
}
.file-list {
width: 100%;
background: #FFFFFF;
border-radius: 0.2rem;
border: 0.02rem solid #E6E7EC;
padding: 0.26rem 0.4rem;
font-size: 0.38rem;
font-weight: 400;
color: #040B29;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.2rem;
}
.file-text {
display: inline-block;
margin-right: 0.3rem;
word-break: break-all;
}
.file-text-icon {
font-size: 0.41rem;
margin-left: 0.2rem;
color: #26BD4B;
font-weight: 600;
}
.icon-text {
font-size: 0.4rem;
color: #040B29;
}
::v-deep .van-field--error .van-field__control::placeholder {
color: #BBBDC7;
}
.van-collapse-item:last-child {
margin-bottom: 0;
}
.AcceptedClass {
background: #e9f8ed;
color: #26BD4B;
}
.RejectedClass {
background: #fdeaea;
color: #E83030;
}
.TransferClass {
background: #fff6e8;
color: #FDA71C;
}
.ReturnedClass {
background: #fff6e8;
color: #FDA71C;
}
.AdoptClass {
background: #e9f8ed;
color: #26BD4B;
}
.ComplianceClass {
background: #e9f8ed;
color: #26BD4B;
}
.NonComplianceClass {
background: #fdeaea;
color: #E83030;
}
.trackedClass {
background: #fff6e8;
color: #FDA71C;
}
.NAClass {
background: #f1f1f3;
color: #707486;
}
</style>
+25 -14
View File
@@ -29,7 +29,7 @@
@load="toDoProcessOnLoad"
>
<div class="content-box-content"
@click="toDoCenterClick(item)"
@click="toDoCenterClick(item,false)"
v-for="(item,index) in toDoProcessList"
:key="index">
<div class="content-box-title-to">
@@ -50,9 +50,11 @@
:class="{'content-box-left-one':language == 'en-us' ? true : false}">{{$t('node')}}</span>
<span class="content-box-text">{{item.taskDefinitionKeyName || '--'}}</span>
</div>
<div class="content-box-right">
<div v-if="item.flowType == '2' || item.flowType == '4' || item.flowType == '21'"></div>
<div class="content-box-right" v-else>
<img src="~@/assets/icon_single_screen.svg" alt="">
</div>
</div>
</van-list>
</div>
@@ -65,7 +67,7 @@
:loading-text="$t('loading')"
@load="processDoneOnLoad"
>
<div class="content-box-content" @click="toDoCenterClick(item)"
<div class="content-box-content" @click="toDoCenterClick(item,true)"
v-for="(item,index) in processDoneList"
:key="index">
<div class="content-box-title">
@@ -101,7 +103,7 @@
:loading-text="$t('loading')"
@load="sentProcessOnLoad"
>
<div class="content-box-content" @click="toDoCenterClick(item)"
<div class="content-box-content" @click="toDoCenterClick(item,true)"
v-for="(item,index) in sentProcessList"
:key="index">
<div class="content-box-title">
@@ -189,6 +191,7 @@
<script>
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import { Toast } from 'vant'
export default {
name: 'phoneToDoCenter',
@@ -317,20 +320,23 @@
this.getSentProcess()
}
},
toDoCenterClick(row) {
toDoCenterClick(row, isTrue) {
let query = {}
row.taskId = row.taskId + ''
if (row.taskId.length > 30) {
row.taskId = ''
}
if (row.taskDefinitionKey == 'fqlc' && isTrue) {
row.taskId = ''
}
if (row.flowType == '2') {
query = {
// taskIds: row.taskId,
taskIds: row.taskId,
actiProcInstId: row.actiProcInstId,
projectTaskInventoryId: row.projectLawsInventoryId,
projectLibraryId: row.projectLibraryId,
TaskKey: row.taskDefinitionKey,
isDisplay: true,
isDisplay: isTrue,
flowType: 2,
Sponsor: 'regulationOwnerName',
personLiable: 'designDutyIdName',
@@ -339,14 +345,18 @@
DueDate: 'designDueDate',
remarks: 'designRemark'
}
this.$router.push({
path: '/phoneProcessManagement',
query: query
})
} else if (row.flowType == '4') {
query = {
// taskIds: row.taskId,
taskIds: row.taskId,
actiProcInstId: row.actiProcInstId,
projectTaskInventoryId: row.projectLawsInventoryId,
projectLibraryId: row.projectLibraryId,
TaskKey: row.taskDefinitionKey,
isDisplay: true,
isDisplay: isTrue,
flowType: 4,
Sponsor: 'regulationOwnerName',
personLiable: 'verifyDutyIdName',
@@ -355,14 +365,15 @@
DueDate: 'verifyDueDate',
remarks: 'verifyRemark'
}
this.$router.push({
path: '/phoneProcessManagement',
query: query
})
} else if (row.flowType == '21') {
} else {
Toast(this.$t('pleaseProcessThePC'))
}
this.$router.push({
path: '/phoneProcessManagement',
query: query
})
},
searchIconClick() {
this.show = true