|
|
@@ -12,39 +12,28 @@
|
|
|
</div>
|
|
|
<div class="mainItem">
|
|
|
<div class="label">演练时间</div>
|
|
|
- <div>{{ trainingData?.typeText }}</div>
|
|
|
+ <div>{{ trainingData?.startDate }}</div>
|
|
|
</div>
|
|
|
<div class="mainItem">
|
|
|
<div class="label">演练地点</div>
|
|
|
- <div>{{ trainingData?.trainingStartDateTime }}</div>
|
|
|
+ <div>{{ trainingData?.drillSite }}</div>
|
|
|
</div>
|
|
|
<div class="mainItem">
|
|
|
<div class="label">指挥人</div>
|
|
|
- <div>{{ trainingData?.trainingEndDateTime }}</div>
|
|
|
+ <div>{{ trainingData?.hostName }}</div>
|
|
|
</div>
|
|
|
<div class="mainItem">
|
|
|
<div class="label">演练项目</div>
|
|
|
- <div>{{ trainingData?.hostName }}</div>
|
|
|
+ <div>{{ trainingData?.typeText }}</div>
|
|
|
</div>
|
|
|
<div class="mainItem">
|
|
|
<div class="label">预设案由</div>
|
|
|
- <div>{{ trainingData?.recorderName }}</div>
|
|
|
+ <div>{{ trainingData?.presetCase }}</div>
|
|
|
</div>
|
|
|
- <!-- <div class="mainItem">
|
|
|
-
|
|
|
- <div class="label labelPeople">培训资料</div>
|
|
|
- <template v-for="item in studyList">
|
|
|
- <div :key="item.url" class="imglIST" style="{width:'100px',height: '100px';}">
|
|
|
|
|
|
- <imgCom :width="'100'" v-if="this_window.origin+item.url&&item.type==0" :height="'100'" :src="this_window.origin+item.url"></imgCom>
|
|
|
-
|
|
|
- <VuePdf v-else :src="this_window.origin+item.url"></VuePdf>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div> -->
|
|
|
<div class="mainItem">
|
|
|
<div class="label">演练情况</div>
|
|
|
- <div>{{ trainingData?.content }}</div>
|
|
|
+ <div>{{ trainingData?.drillSituation }}</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="mainItem">
|
|
|
@@ -62,26 +51,26 @@
|
|
|
</div>
|
|
|
<div
|
|
|
class="mainItem"
|
|
|
- v-if="this.$route.params.id.split('_')[1] === 'info' || this.$route.params.id.split('_')[1] === 'comment'"
|
|
|
+ v-if="peopleShow"
|
|
|
>
|
|
|
<div class="label labelPeople">参与人员签名图片</div>
|
|
|
<template v-for="item in signUserList">
|
|
|
<imgCom :width="'100'" v-if="item.signImage" :key="item.userId" :height="'100'" :src="item.signImage"></imgCom>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <!-- <van-rate value="{{ value }}" count="{{ 6 }}" bind:change="onChange" /> -->
|
|
|
<div
|
|
|
class="mainItem"
|
|
|
- v-if="this.$route.params.id.split('_')[1] === 'evaluate' || this.$route.params.id.split('_')[1] === 'comment'"
|
|
|
+ v-if="evaluateShow"
|
|
|
>
|
|
|
<div class="label">评分</div>
|
|
|
- <div><van-rate v-model="value" :count="10" /></div>
|
|
|
+ <div><van-rate :disabled="disabledShow" v-model="value" :count="10" /></div>
|
|
|
</div>
|
|
|
<van-field
|
|
|
- v-if="this.$route.params.id.split('_')[1] === 'evaluate' || this.$route.params.id.split('_')[1] === 'comment'"
|
|
|
+ v-if="evaluate"
|
|
|
required
|
|
|
:rules="[{ required: true, message: '评语不能为空' }]"
|
|
|
v-model="content"
|
|
|
+
|
|
|
name="content"
|
|
|
label="评语"
|
|
|
type="textarea"
|
|
|
@@ -100,18 +89,20 @@
|
|
|
@click="signatureHandler"
|
|
|
>签名</van-button
|
|
|
>
|
|
|
- <!-- 评价 || 评优推优选 -->
|
|
|
+ <!-- 评价 || 评优推优选 -->
|
|
|
<van-button
|
|
|
type="info"
|
|
|
class="btn"
|
|
|
v-if="this.$route.params.id.split('_')[1] === 'evaluate' || this.$route.params.id.split('_')[1] === 'comment'"
|
|
|
- @click="signatureHandler"
|
|
|
+ @click="submitHandler"
|
|
|
>提交</van-button
|
|
|
>
|
|
|
-
|
|
|
-
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
+ <div class="mainItem" v-if="disabledShow">
|
|
|
+ <div class="label">评语</div>
|
|
|
+ <div>{{ content }}</div>
|
|
|
+ </div>
|
|
|
<van-action-sheet v-model="show" title="签署名字" class="sheet">
|
|
|
<writingPad ref="esign" @resultImg="resultImg"></writingPad>
|
|
|
</van-action-sheet>
|
|
|
@@ -120,16 +111,19 @@
|
|
|
<script>
|
|
|
import NavBar from '@/components/NavBar'
|
|
|
import writingPad from '@/components/writingPad/index.vue'
|
|
|
-import { gettrainingInfo, signtrainingInfo } from '@/api/training.js'
|
|
|
+import { getrehearsalInfo, singrehearsalTask, drillInfo } from '@/api/drillTask.js'
|
|
|
import { upload } from '@/api/public'
|
|
|
import imgCom from '@/components/imgCom/index.vue'
|
|
|
import { base64ToBlob } from '@/utils/base64TurnImg.js'
|
|
|
import config from '@/config/index'
|
|
|
+import { Toast, Dialog } from 'vant'
|
|
|
import VuePdf from '@/components/pdfCom/index.vue'
|
|
|
export default {
|
|
|
name: 'SocAppAddTraining',
|
|
|
components: {
|
|
|
NavBar,
|
|
|
+ Dialog,
|
|
|
+ Toast,
|
|
|
VuePdf,
|
|
|
imgCom,
|
|
|
writingPad
|
|
|
@@ -148,21 +142,47 @@ export default {
|
|
|
trainingData: {} //详情数据
|
|
|
}
|
|
|
},
|
|
|
- computed:{
|
|
|
- goBack(){
|
|
|
- if(this.$route.params.id.split('_')[1] === 'evaluate'){
|
|
|
+ computed: {
|
|
|
+ goBack() {
|
|
|
+ if (this.$route.params.id.split('_')[1] === 'evaluate' || this.$route.params.id.split('_')[1] === 'edit'||this.$route.params.id.split('_')[1] === 'info') {
|
|
|
return '/rehearsalTask'
|
|
|
- }else if(this.$route.params.id.split('_')[1] === 'comment'){
|
|
|
+ } else if (this.$route.params.id.split('_')[1] === 'comment') {
|
|
|
return '/rehearsaloptimal'
|
|
|
}
|
|
|
-
|
|
|
+ },
|
|
|
+ evaluate(){
|
|
|
+ if(this.$route.params.id.split('_')[1] === 'evaluate' || this.$route.params.id.split('_')[1] === 'comment'){
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ evaluateShow(){
|
|
|
+ if(this.$route.params.id.split('_')[1] === 'info'||this.$route.params.id.split('_')[1] === 'evaluate' || this.$route.params.id.split('_')[1] === 'comment'){
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ disabledShow(){
|
|
|
+ if(this.$route.params.id.split('_')[1] === 'info'){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ peopleShow(){
|
|
|
+ if(this.$route.params.id.split('_')[1] === 'info' || this.$route.params.id.split('_')[1] === 'comment'){
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
created() {
|
|
|
//获取详情信息
|
|
|
- gettrainingInfo(this.$route.params.id.split('_')[0]).then(res => {
|
|
|
+ getrehearsalInfo(this.$route.params.id.split('_')[0]).then(res => {
|
|
|
let { code, data, msg } = res
|
|
|
if (code == 200) {
|
|
|
+ this.content=data.comment
|
|
|
+ this.value=data.commentScore
|
|
|
this.trainingData = data
|
|
|
this.trainingData?.taskUserList?.map(item => {
|
|
|
if (item.type == 1) {
|
|
|
@@ -181,7 +201,7 @@ export default {
|
|
|
if (list.length > 0) {
|
|
|
list.forEach(item => {
|
|
|
let i = JSON.parse(item)
|
|
|
- console.log(i)
|
|
|
+
|
|
|
if (i.url.split('.')[1] == 'pdf') {
|
|
|
i.type = 1
|
|
|
} else {
|
|
|
@@ -201,12 +221,56 @@ export default {
|
|
|
signatureHandler() {
|
|
|
this.show = true
|
|
|
},
|
|
|
+ //评价提交
|
|
|
+ submitHandler() {
|
|
|
+ //判断当前是评价 还是评价推优
|
|
|
+ if (this.$route.params.id.split('_')[1] === 'evaluate') {
|
|
|
+ //评价
|
|
|
+ if (!this.content) {
|
|
|
+ //评语不能为空
|
|
|
+ Toast('评语不能为空')
|
|
|
+ return
|
|
|
+ } else if (this.value == 0) {
|
|
|
+ //评分不能为0分
|
|
|
+ Toast('评分不能为0分')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ Dialog.confirm({
|
|
|
+ title: '',
|
|
|
+ message: `是否提交评价?`
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let obj = this.trainingData
|
|
|
+ obj.commentScore = this.value
|
|
|
+ obj.comment = this.content
|
|
|
+ drillInfo({
|
|
|
+ id: this.trainingData.id,
|
|
|
+ // type: this.trainingData.type,
|
|
|
+ submitType: 2,
|
|
|
+
|
|
|
+ ...obj
|
|
|
+ }).then(res => {
|
|
|
+ let { code, msg } = res
|
|
|
+ if (code == 200) {
|
|
|
+ Toast('登记成功')
|
|
|
+ this.$router.push('/rehearsalTask')
|
|
|
+ } else {
|
|
|
+ Toast(msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // on cancel
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //评价推优
|
|
|
+ }
|
|
|
+ },
|
|
|
clearHandler() {
|
|
|
this.$refs.esign.handleReset()
|
|
|
},
|
|
|
- submitHandler() {
|
|
|
- console.log(this.file)
|
|
|
- },
|
|
|
+
|
|
|
//上传签名图到服务器
|
|
|
resultImg(img) {
|
|
|
let obj = base64ToBlob(img)
|
|
|
@@ -231,11 +295,11 @@ export default {
|
|
|
|
|
|
//提交到后端数据
|
|
|
submitSign(url) {
|
|
|
- signtrainingInfo({
|
|
|
+ singrehearsalTask({
|
|
|
id: this.trainingData.id,
|
|
|
signImage: url
|
|
|
}).then(res => {
|
|
|
- this.$router.push('/training')
|
|
|
+ this.$router.push('/rehearsalTask')
|
|
|
})
|
|
|
}
|
|
|
}
|