|
|
@@ -3,43 +3,60 @@
|
|
|
<NavBar :go="{ type: 'push', path: '/resumptionEvaluate' }" />
|
|
|
<div class="evaluate">
|
|
|
<van-row class="cell_cls">
|
|
|
- <van-col span="24"> 三季度对押运公司的评价 </van-col>
|
|
|
+ <van-col span="24"> {{ formData.evaluateName }} </van-col>
|
|
|
</van-row>
|
|
|
<van-row class="cell_cls">
|
|
|
<van-col span="24">
|
|
|
<span class="evaluteTime">评价周期:</span>
|
|
|
- <span>{{ '2023-09-01-2023-10-01' }}</span>
|
|
|
+ <span>{{ formData.startTime }}-{{ formData.endTime }}</span>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
<van-row>
|
|
|
<van-col span="24" class="evaluteMain">
|
|
|
<span class="titleLeft"></span>
|
|
|
- <span class="text">评价内容</span>
|
|
|
+ <span class="text">{{ addOrInfo == 'add' ? '评价内容:' : '评价记录:' }}</span>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
- <van-cell title="1-被评价外包公司名称">
|
|
|
- <!-- 使用 title 插槽来自定义标题 -->
|
|
|
- <template #label>
|
|
|
- <van-field v-model="text" required placeholder="请输入" />
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
- <van-cell title="2-外包公司在提供服务过程中的质量">
|
|
|
- <!-- 使用 title 插槽来自定义标题 -->
|
|
|
- <template #label>
|
|
|
- <span style="font-size: 14px">评分:</span
|
|
|
- ><van-rate count="10" v-model="value" :size="20" color="#ffd21e" void-icon="star" void-color="#eee" />
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
+ <van-form @submit="onSubmit" ref="form">
|
|
|
+ <van-cell
|
|
|
+ :title="item.code + '.' + item.content"
|
|
|
+ v-for="item in formData.coreEvaluateContentList"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ <!-- 使用 title 插槽来自定义标题 -->
|
|
|
+ <template #label v-if="item.contentType == '1'">
|
|
|
+ <van-field
|
|
|
+ v-model="item.score"
|
|
|
+ required
|
|
|
+ :placeholder="'请输入' + item.content"
|
|
|
+ :rules="[{ required: true, message: item.content + '不能为空' }]"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #label v-else>
|
|
|
+ <span style="font-size: 14px">评分:</span
|
|
|
+ ><van-rate
|
|
|
+ count="10"
|
|
|
+ v-model="item.score"
|
|
|
+ :size="20"
|
|
|
+ color="#ffd21e"
|
|
|
+ void-icon="star"
|
|
|
+ void-color="#eee"
|
|
|
+ />{{ item.score }}分
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-form>
|
|
|
</div>
|
|
|
<van-row class="cell-btutton">
|
|
|
<van-col span="24">
|
|
|
- <van-button type="info" class="infoBtn">评价</van-button>
|
|
|
+ <van-button type="info" class="infoBtn" @click="onSubmit">评价</van-button>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import NavBar from '@/components/NavBar'
|
|
|
+import { getEvaluateByid, submitEvaluate } from '@/api/evaluateTask.js'
|
|
|
+import { Toast } from 'vant'
|
|
|
export default {
|
|
|
name: 'SocAppEvaluate',
|
|
|
components: {
|
|
|
@@ -48,13 +65,60 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
text: '',
|
|
|
+ id: '',
|
|
|
+ addOrInfo: '',
|
|
|
+ formData: {
|
|
|
+ coreEvaluateContentList: []
|
|
|
+ },
|
|
|
value: 0
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ created() {
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
mounted() {},
|
|
|
|
|
|
- methods: {}
|
|
|
+ methods: {
|
|
|
+ //获取详情数据
|
|
|
+ init() {
|
|
|
+ this.id = this.$route.params.id.split('_')[0] || ''
|
|
|
+ this.addOrInfo = this.$route.params.id.split('_')[1] || ''
|
|
|
+
|
|
|
+ if (this.$route.params.id.split('_')[1] === 'add') {
|
|
|
+ //评价
|
|
|
+
|
|
|
+ getEvaluateByid(this.id).then(res => {
|
|
|
+ let { code, data, msg } = res
|
|
|
+ if (code == 200) {
|
|
|
+ this.formData = data
|
|
|
+ console.log(this.formData)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //详情
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //评价提交
|
|
|
+ onSubmit() {
|
|
|
+ this.$refs.form.validate().then(() => {
|
|
|
+ let obj =JSON.parse(JSON.stringify(this.formData))
|
|
|
+ obj.coreEvaluateContentList.forEach(item=>{
|
|
|
+ if(item.contentType=='2'){
|
|
|
+ item.score=item.score+''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ submitEvaluate({ coreEvaluateTaskContentList:obj.coreEvaluateContentList , id: obj.id }).then(
|
|
|
+ res => {
|
|
|
+
|
|
|
+ let {code,msg}=res
|
|
|
+ Toast.success(msg)
|
|
|
+ this.$router.push('/resumptionEvaluate')
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ // this.formData.coreEvaluateContentList.forEach
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -89,12 +153,12 @@ export default {
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
}
|
|
|
-.infoBtn{
|
|
|
- width: 100%;
|
|
|
+.infoBtn {
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
-.cell-btutton{
|
|
|
- position: absolute;
|
|
|
- bottom: 0%;
|
|
|
- width: 100%;
|
|
|
+.cell-btutton {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0%;
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
</style>
|