对接Pre-Homo流程
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
:loading-text="$t('loading')"
|
:loading-text="$t('loading')"
|
||||||
@load="onLoad"
|
@load="onLoad"
|
||||||
>
|
>
|
||||||
<div class="content-text" @click="handlingClick" v-for="(item,index) in list">
|
<div class="content-text" @click="handlingClick(item)" v-for="(item,index) in list">
|
||||||
<div class="content-text-left">
|
<div class="content-text-left">
|
||||||
<div class="content-text-top">
|
<div class="content-text-top">
|
||||||
<span class="content-text-top-left">
|
<span class="content-text-top-left">
|
||||||
@@ -62,7 +62,12 @@
|
|||||||
},
|
},
|
||||||
handlingClick(item) {
|
handlingClick(item) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/phonePreHomoMangement'
|
path: '/phonePreHomoMangement',
|
||||||
|
query: {
|
||||||
|
taskDefinitionKey: this.$route.query.taskDefinitionKey,
|
||||||
|
projectName:this.$route.query.projectName,
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div class="header-search">
|
<div class="header-search">
|
||||||
<van-icon @click="iconClick" class="icon" name="arrow-left"/>
|
<van-icon @click="iconClick" class="icon" name="arrow-left"/>
|
||||||
<span class="header-search-text">
|
<span class="header-search-text">
|
||||||
EDS1.2 EVO-G1.1-中国-03 Pre-Homo流程
|
{{$route.query.projectName + ' ' + $t('preHomoFlow')}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -87,22 +87,63 @@
|
|||||||
<van-form @submit="onSubmit" ref="form">
|
<van-form @submit="onSubmit" ref="form">
|
||||||
<van-field name="disposeResult"
|
<van-field name="disposeResult"
|
||||||
class="uploader"
|
class="uploader"
|
||||||
|
v-if="$route.query.taskDefinitionKey == 'Task Review' ||
|
||||||
|
$route.query.taskDefinitionKey == 'Task responsibility confirmation'"
|
||||||
:rules="[{ required: true, message: $t('resultofhandling') + $t('cannotEmpty') }]"
|
:rules="[{ required: true, message: $t('resultofhandling') + $t('cannotEmpty') }]"
|
||||||
:label="$t('resultofhandling')">
|
:label="$t('resultofhandling')">
|
||||||
<template #input>
|
<template #input>
|
||||||
<van-radio-group v-model="form.disposeResult" direction="horizontal">
|
<van-radio-group @change="disposeResultChange" v-model="form.disposeResult" direction="horizontal">
|
||||||
<van-radio name="Accepted">
|
<van-radio name="rzgcssc_tg" v-if="$route.query.taskDefinitionKey == 'Task Review'">
|
||||||
{{$t('reviewAndPass')}}
|
{{$t('reviewAndPass')}}
|
||||||
</van-radio>
|
</van-radio>
|
||||||
<van-radio name="Rejected">
|
<van-radio name="rzgcssc_th" v-if="$route.query.taskDefinitionKey == 'Task Review'">
|
||||||
{{$t('reviewAndReturn')}}
|
{{$t('reviewAndReturn')}}
|
||||||
</van-radio>
|
</van-radio>
|
||||||
|
<van-radio name="zrrjsrw" v-if="$route.query.taskDefinitionKey == 'Task responsibility confirmation'">
|
||||||
|
{{$t('missionAccepted')}}
|
||||||
|
</van-radio>
|
||||||
|
<van-radio name="zrrjjrw" v-if="$route.query.taskDefinitionKey == 'Task responsibility confirmation'">
|
||||||
|
{{$t('missionRejection')}}
|
||||||
|
</van-radio>
|
||||||
</van-radio-group>
|
</van-radio-group>
|
||||||
</template>
|
</template>
|
||||||
</van-field>
|
</van-field>
|
||||||
|
|
||||||
<van-field
|
<van-field
|
||||||
v-model.trim="form.approvalOpinion"
|
v-if="form.disposeResult == 'rzgcssc_tg'"
|
||||||
|
v-model.trim="form.reportNumber"
|
||||||
|
rows="4"
|
||||||
|
class="textarea"
|
||||||
|
autosize
|
||||||
|
:show-error="false"
|
||||||
|
:label="$t('reportNo')"
|
||||||
|
maxlength="200"
|
||||||
|
:placeholder="$t('pleaseEnter')+$t('reportNo')"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
v-if="form.disposeResult == 'rzgcssc_tg'"
|
||||||
|
v-model.trim="form.productModel"
|
||||||
|
rows="4"
|
||||||
|
class="textarea"
|
||||||
|
autosize
|
||||||
|
:show-error="false"
|
||||||
|
:label="$t('productModel')"
|
||||||
|
maxlength="200"
|
||||||
|
:placeholder="$t('pleaseEnter')+$t('productModel')"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
v-if="form.disposeResult == 'rzgcssc_tg'"
|
||||||
|
v-model.trim="form.productionEnterpriseName"
|
||||||
|
rows="4"
|
||||||
|
class="textarea"
|
||||||
|
autosize
|
||||||
|
:show-error="false"
|
||||||
|
:label="$t('nameOfManufacturer')"
|
||||||
|
maxlength="200"
|
||||||
|
:placeholder="$t('pleaseEnter')+$t('nameOfManufacturer')"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
v-if="form.disposeResult == 'rzgcssc_th' || form.disposeResult == 'zrrjjrw'"
|
||||||
|
v-model.trim="form.reasonForReturn"
|
||||||
rows="4"
|
rows="4"
|
||||||
class="textarea"
|
class="textarea"
|
||||||
autosize
|
autosize
|
||||||
@@ -113,6 +154,59 @@
|
|||||||
type="textarea"
|
type="textarea"
|
||||||
:placeholder="$t('pleaseEnter')+$t('feedbackMessage')"
|
:placeholder="$t('pleaseEnter')+$t('feedbackMessage')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div v-if="$route.query.taskDefinitionKey == 'Task handling'">
|
||||||
|
<van-field name="uploader" class="uploader"
|
||||||
|
:rules="[{ required: true, message: $t('DeliverablesResult') + $t('cannotEmpty') }]"
|
||||||
|
v-if="queryForm.valueType == 'file'"
|
||||||
|
:label="$t('DeliverablesResult')">
|
||||||
|
<template #input>
|
||||||
|
<van-uploader :preview-image="false"
|
||||||
|
accept="*"
|
||||||
|
v-model="form.disposeResult"
|
||||||
|
:after-read="upload"
|
||||||
|
class="uploader-button">
|
||||||
|
<van-button icon="back-top" type="primary">{{$t('upload1')}}</van-button>
|
||||||
|
</van-uploader>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
v-else-if="queryForm.valueType == 'text'"
|
||||||
|
:rules="[{ required: true, message: $t('DeliverablesResult') + $t('cannotEmpty') }]"
|
||||||
|
v-model.trim="form.deliveryResult"
|
||||||
|
rows="4"
|
||||||
|
class="textarea"
|
||||||
|
autosize
|
||||||
|
:show-error="false"
|
||||||
|
:label="$t('DeliverablesResult')"
|
||||||
|
maxlength="200"
|
||||||
|
:placeholder="$t('pleaseEnter')+$t('DeliverablesResult')"
|
||||||
|
/>
|
||||||
|
<van-field name="disposeResult"
|
||||||
|
class="uploader"
|
||||||
|
v-else-if="queryForm.valueType == 'select'"
|
||||||
|
:rules="[{ required: true, message: $t('DeliverablesResult') + $t('cannotEmpty') }]"
|
||||||
|
:label="$t('DeliverablesResult')">
|
||||||
|
<template #input>
|
||||||
|
<van-radio-group v-model="form.deliveryResult" direction="horizontal">
|
||||||
|
<van-radio name="1">
|
||||||
|
{{$t('yes')}}
|
||||||
|
</van-radio>
|
||||||
|
<van-radio name="2">
|
||||||
|
{{$t('not')}}
|
||||||
|
</van-radio>
|
||||||
|
</van-radio-group>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
<van-button class="submitButton"
|
<van-button class="submitButton"
|
||||||
round
|
round
|
||||||
block
|
block
|
||||||
@@ -129,30 +223,162 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||||
|
import { Dialog, Toast } from 'vant'
|
||||||
|
import Vue from 'vue'
|
||||||
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'phonePreHomoMangement',
|
name: 'phonePreHomoMangement',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeNames: ['1', '2', '3', '4'],
|
activeNames: ['1', '2', '3', '4'],
|
||||||
|
fileList: [],
|
||||||
show: false,
|
show: false,
|
||||||
textLoading: this.$t('loading'),
|
textLoading: this.$t('loading'),
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
queryData: {},
|
queryData: {},
|
||||||
form: {},
|
form: {},
|
||||||
|
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload',
|
||||||
queryProject: {},
|
queryProject: {},
|
||||||
dataSourceFile: [],
|
dataSourceFile: [],
|
||||||
deliverablesResultFile: []
|
deliverablesResultFile: [],
|
||||||
|
url: {
|
||||||
|
queryProjectCertificationInventoryById: '/phone/toDoCenter/queryProjectCertificationInventoryById',
|
||||||
|
saveBatch: '/project/projectCertificationInventoryEO/saveBatch'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
document.title = 'NIO GRP'
|
document.title = 'NIO GRP'
|
||||||
|
this.getData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
iconClick() {
|
iconClick() {
|
||||||
this.$router.go(-1)
|
this.$router.go(-1)
|
||||||
},
|
},
|
||||||
|
disposeResultChange(value) {
|
||||||
|
if (value == 'rzgcssc_tg') {
|
||||||
|
this.form.reasonForReturn = ''
|
||||||
|
} else if (value == 'rzgcssc_th') {
|
||||||
|
this.form.productionEnterpriseName = ''
|
||||||
|
this.form.productModel = ''
|
||||||
|
this.form.reportNumber = ''
|
||||||
|
} else if (value == 'zrrjsrw') {
|
||||||
|
this.form.reasonForReturn = ''
|
||||||
|
} else if (value == 'zrrjjrw') {
|
||||||
|
this.form.reasonForReturn = ''
|
||||||
|
}
|
||||||
|
this.form = { ...this.form }
|
||||||
|
},
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
if (this.$route.query.taskDefinitionKey == 'Task Review') {
|
||||||
|
this.ApprovedClick()
|
||||||
|
} else if (this.$route.query.taskDefinitionKey == 'Task handling') {
|
||||||
|
this.submitClick()
|
||||||
|
} else if (this.$route.query.taskDefinitionKey == 'Task responsibility confirmation') {
|
||||||
|
this.ApprovedClick()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitClick() {
|
||||||
|
let query = {
|
||||||
|
'nodeKey': 'zrrtjrw',
|
||||||
|
'projectLibraryId': this.queryForm.projectLibraryId,
|
||||||
|
'ids': this.queryForm.id
|
||||||
|
}
|
||||||
|
this.submitPreservation()
|
||||||
|
postAction('/project/projectCertificationInventoryEO/submitTask', query).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
Toast(this.$t('OperationSuccessful'))
|
||||||
|
this.$router.go(-1)
|
||||||
|
} else {
|
||||||
|
Toast(this.$t('operationFailed'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitPreservation() {
|
||||||
|
let content = []
|
||||||
|
let fileListId = []
|
||||||
|
if (this.queryForm.valueType == 'file') {
|
||||||
|
this.fileList.forEach(res => {
|
||||||
|
fileListId.push(res.id)
|
||||||
|
})
|
||||||
|
this.form.disposeResult = fileListId.join(',')
|
||||||
|
}
|
||||||
|
content[0] = Object.assign(this.queryForm, this.form)
|
||||||
|
postAction(this.url.saveBatch, { 'dataList': content }).then((res) => {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
ApprovedClick() {
|
||||||
|
let query = {
|
||||||
|
'nodeKey': this.form.disposeResult,
|
||||||
|
'projectLibraryId': this.queryForm.projectLibraryId,
|
||||||
|
'ids': this.queryForm.id,
|
||||||
|
reasonForReturn: this.form.reasonForReturn
|
||||||
|
}
|
||||||
|
if (this.form.disposeResult == 'rzgcssc_tg') {
|
||||||
|
this.preservationClick()
|
||||||
|
}
|
||||||
|
postAction('/project/projectCertificationInventoryEO/submitTask', query).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
Toast(this.$t('OperationSuccessful'))
|
||||||
|
this.$router.go(-1)
|
||||||
|
} else {
|
||||||
|
Toast(this.$t('operationFailed'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//保存
|
||||||
|
preservationClick() {
|
||||||
|
let content = []
|
||||||
|
content[0] = Object.assign(this.queryForm, this.form)
|
||||||
|
postAction(this.url.saveBatch, { 'dataList': content }).then((res) => {
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getData() {
|
||||||
|
getAction(this.url.queryProjectCertificationInventoryById, { id: this.$route.query.id }).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.queryForm = res.result || {}
|
||||||
|
} else {
|
||||||
|
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
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fileClick(index) {
|
||||||
|
this.fileList.splice(index, 1)
|
||||||
|
this.form.disposeResult.splice(index, 1)
|
||||||
|
this.form = { ...this.form }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -510,6 +736,8 @@
|
|||||||
margin-left: 0.2rem;
|
margin-left: 0.2rem;
|
||||||
color: #26BD4B;
|
color: #26BD4B;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
float: right;
|
||||||
|
margin-top: 0.11rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-text {
|
.icon-text {
|
||||||
|
|||||||
Reference in New Issue
Block a user