wjt
2024-07-29 2ffea51205b7eb94cf3fb7221aede7ff66669fc1
qiye/record/details.vue
@@ -8,7 +8,10 @@
      <view class="donw-box"></view>
      <view class="page-main">
         <view class="title">
            已评价
            执法详情
         <!--    <template v-if="msg.isEva==0">未评价</template>
            <template v-if="msg.isEva==1">已评价</template>
            <template v-if="msg.orderStatus==2">待执法</template> -->
         </view>
         <view class="wbox">
            <view class="item">
@@ -16,7 +19,7 @@
                  执法类型
               </view>
               <view class="v">
                  司法检查
                  {{type}}
               </view>
            </view>
            <view class="item">
@@ -24,7 +27,7 @@
                  执法人
               </view>
               <view class="v">
                  刘欢欢
                  {{msg.executeUser || msg.applyUser}}
               </view>
            </view>
            <view class="item">
@@ -32,17 +35,17 @@
                  执法部门
               </view>
               <view class="v">
                  农业局
                  {{msg.executeDeptName || msg.applyDeptName}}
               </view>
            </view>
            <view class="item">
            <!-- <view class="item">
               <view class="k">
                  企业
               </view>
               <view class="v">
                  汉庭酒店
                  {{msg.companyName}}
               </view>
            </view>
            </view> -->
         </view>
         <view style="height: 20rpx;"></view>
         <view class="wbox">
@@ -51,26 +54,33 @@
                  执法主题
               </view>
               <view class="v">
                  汉庭酒店司法检查233号文件
                  {{msg.enforceReason}}
               </view>
            </view>
            <view class="item">
               <view class="k">
                  执法过程
                  执法内容
               </view>
               <view class="v" v-if="!img.length">
                  {{ msg.enforceContent}}
               </view>
            </view>
            <view class="imgbox">
               <img src="/static/i01.png" class="more" @click="imgclick('/static/i01.png')" alt="" />
            <view class="imgbox"  v-if="img.length">
               <template >
                  <img v-for="(item,index) in img" :key="index" :src="item" class="more" alt="" @click="imgclick(item)" />
               </template>
               <!-- <img src="/static/i01.png" class="more" @click="imgclick('/static/i01.png')" alt="" />
               <img src="/static/i02.png" class="more" alt="" />
               <img src="/static/i03.png" class="more" alt="" />
               <img src="/static/i04.png" class="more" alt="" />
               <img src="/static/i04.png" class="more" alt="" /> -->
            </view>
            <view class="item">
               <view class="k">
                  执法结果
               </view>
               <view class="v" style="color: #EB4746;">
                  停业整顿
                  {{msg.regionReason || '--'}}
               </view>
            </view>
            <view class="item">
@@ -78,91 +88,115 @@
                  执法时间
               </view>
               <view class="v">
                  2024-10-10 16:24
                  {{msg.inTime || msg.planTime}}
               </view>
            </view>
         </view>
         <view style="height: 20rpx;"></view>
         <view class="wbox2">
         <view class="wbox2" v-if="msg.isEva==1">
            <view class="t">
               执法评价
            </view>
            <view class="sbox">
               <view class="t2">
                  本次执法还满意程度
               </view>
               <view class="xbox">
                  <view @click="daxing(1)">
                     <img src="/static/qiye/xing1.png" alt="" />
            <template v-for="(item,index) in qlist">
               <view class="sbox" v-if="item.questionType==2">
                  <view class="t2">
                     {{item.questionName}}
                  </view>
                  <view class="xbox">
                     <view>
                        很糟糕
                        <img src="/static/qiye/xing1.png" alt="" />
                        <view>
                           很糟糕
                        </view>
                     </view>
                     <view>
                        <img v-if="item.getScore>=2" src="/static/qiye/xing1.png" alt="" />
                        <img v-else src="/static/qiye/xing2.png" alt="" />
                        <view :class="item.getScore==2?'hei':''">
                           不满意
                        </view>
                     </view>
                     <view>
                        <img v-if="item.getScore>=3" src="/static/qiye/xing1.png" alt="" />
                        <img v-else src="/static/qiye/xing2.png" alt="" />
                        <view :class="item.getScore==3?'hei':''">
                           一般般
                        </view>
                     </view>
                     <view>
                        <img v-if="item.getScore>=4" src="/static/qiye/xing1.png" alt="" />
                        <img v-else src="/static/qiye/xing2.png" alt="" />
                        <view :class="item.getScore==4?'hei':''">
                           满意
                        </view>
                     </view>
                     <view>
                        <img v-if="item.getScore>=5" src="/static/qiye/xing1.png" alt="" />
                        <img v-else src="/static/qiye/xing2.png" alt="" />
                        <view :class="item.getScore==5?'hei':''">
                           非常满意
                        </view>
                     </view>
                  </view>
                  <view @click="daxing(2)">
                     <img v-if="xing>=2" src="/static/qiye/xing1.png" alt="" />
                     <img v-else src="/static/qiye/xing2.png" alt="" />
                     <view :class="xing==2?'hei':''">
                        不满意
                     </view>
                  </view>
                  <view @click="daxing(3)">
                     <img v-if="xing>=3" src="/static/qiye/xing1.png" alt="" />
                     <img v-else src="/static/qiye/xing2.png" alt="" />
                     <view :class="xing==3?'hei':''">
                        一般般
                     </view>
                  </view>
                  <view @click="daxing(4)">
                     <img v-if="xing>=4" src="/static/qiye/xing1.png" alt="" />
                     <img v-else src="/static/qiye/xing2.png" alt="" />
                     <view :class="xing==4?'hei':''">
                        满意
                     </view>
                  </view>
                  <view @click="daxing(5)">
                     <img v-if="xing>=5" src="/static/qiye/xing1.png" alt="" />
                     <img v-else src="/static/qiye/xing2.png" alt="" />
                     <view :class="xing==5?'hei':''">
                        非常满意
                     </view>
                  </view>
                  <view class="line"></view>
               </view>
               <view class="line"></view>
            </view>
            <view class="sbox">
               <view class="t2">
                  这是一个单选题的题干?
               <view class="sbox" v-if="item.questionType==1">
                  <view class="t2">
                     {{item.questionName}}
                  </view>
                  <u-radio-group v-model="item.remark">
                     <u-radio v-for="(aa, ii) in item.answerList" :key="ii" :name="aa.answerId"
                     :disabled="item.remark!=aa.answerId">
                        {{aa.answerName}}
                     </u-radio>
                  </u-radio-group>
                  <!-- <u-radio-group v-model="value">
                     <u-radio name="orange">选中</u-radio>
                     <u-radio name="1" :disabled="true">未选中</u-radio>
                  </u-radio-group> -->
                  <view class="line"></view>
               </view>
               <u-radio-group v-model="value">
                  <u-radio name="orange">选中</u-radio>
                  <u-radio name="1" :disabled="true">未选中</u-radio>
               </u-radio-group>
               <view class="line"></view>
            </view>
            <view class="sbox">
            </template>
            <view class="sbox" v-if="msg.evaluateVo.questionRemark">
               <view class="t2">
                  对我们的评价
               </view>
               <view class="pjbox">
                  这次执法非常好,非常好,这次执法非常好,非常好这次执法非常好,非常好
                  {{msg.evaluateVo.questionRemark}}
               </view>
            </view>
         </view>
      </view>
      <view class="bottom">
         <view class="one" v-if="type==1">
      <view class="bottom" v-if=" msg.orderStatus== 5">
         <view class="one" v-if="msg.isComplaint != 1 && msg.isEva == 1">
            <view class="b1" @click="open()">
               投诉
            </view>
         </view>
         <view class="two" v-if="type==2">
            <view class="b2" @click="open()">
         <view class="two" v-if="msg.isComplaint != 1 && msg.isEva != 1">
            <view class="b2" @click="open()" >
               投诉
            </view>
            <view class="b3">
            <view class="b3" @click="pingjia()">
               我要评价
            </view>
         </view>
         <view class="one" v-if="msg.isComplaint == 1 && msg.isEva != 1">
            <view class="b1" @click="pingjia()">
               我要评价
            </view>
         </view>
      </view>
      <view class="bottom" v-if=" msg.orderStatus == 4">
         <view class="one" >
            <view class="b1" style="background-color: #1171E0;color: white;" @click="enterOrder()">
               确认
            </view>
         </view>
      </view>
      <u-popup :show="show" @close="close" mode="bottom" round="10" closeable>
         <view class="page-box">
@@ -175,20 +209,21 @@
                  投诉主题
               </view>
               <view>
                  <u-radio-group  placement="row">
                     <u-radio active-color="#3EB47A" label="aaa" name="3"></u-radio>
                     <u-radio active-color="#3EB47A" label="bbb" name="3"></u-radio>
                  </u-radio-group>
                  <u-radio-group v-model="complaintType">
                                       <u-radio v-for="(aa, ii) in list" :key="ii" :name="aa.dictCode">
                                          {{aa.dictLabel}}
                                       </u-radio>
                                    </u-radio-group>
               </view>
               <view class="font">
                  投诉内容
               </view>
               <view class="margin-top">
                  <u-textarea placeholder="请输入..."></u-textarea>
                  <u-textarea :cursorSpacing="70" v-model="complaintReason" placeholder="请输入..."></u-textarea>
               </view>
            </view>
            <view class="down">
               <view class="enter" @entery="entery">提交</view>
               <view class="enter" @click="entery()">提交</view>
            </view>
         </view>
      </u-popup>
@@ -196,33 +231,97 @@
</template>
<script>
   import { order } from '@/api/index.js'
   import { getDicts } from '@/api/data.js'
   import { config } from '@/common/config'
   import { orderComplaint, confirmOrderId } from '@/api/qiye.js'
   export default {
      data() {
         return {
            complaintType:'',
            complaintReason:'',
            id:'',
            msg:{},
            type:'',
            img:[],
            baseUrl: config.baseUrl,
            xing: 5,
            value: 'orange',
            type: 2,
            //type: 2,
            show: false,
            show2: false,
            list: [{
               //todo 请求接口
                  value: '1',
                  label: '江'
               },
               {
                  value: '2',
                  label: '湖'
               }
            list: [
            ],
            qlist:[]
         }
      },
      onLoad(options) {
         this.id = options.id
         //this.getdata(options.id)
         getDicts('complaint_type').then(val => {
            this.list = val.data.data
            console.log(this.list)
             // const value = val.data.data.find(item => item.dictCode == this.msg.enforceType)
             // this.type = value.dictLabel
         })
         // this.getdata()
      },
      onShow(options) {
         this.getdata()
      },
      methods: {
         enterOrder() {
            uni.showModal({
               title: '提示',
               content: '确认该订单?',
               success: val => {
                  if(val.confirm) {
                     confirmOrderId({orderId: this.msg.orderId}).then(val => {
                        if(val.data.code == 200) {
                           uni.showToast({
                              title: '确认成功',
                              icon: 'none'
                           })
                           this.getdata()
                        }
                     })
                  }
               }
            })
         },
         getdata(){
            order(this.id).then(val => {
               this.msg = val.data.data
               getDicts('enforce_type').then(val => {
                   const value = val.data.data.find(item => item.dictCode == this.msg.enforceType)
                   this.type = value.dictLabel
               })
               let arr = this.msg.regionImgs.split(",");
               for(let i = 0;i<arr.length;i++){
                  this.img.push(this.baseUrl+arr[i])
               }
               this.qlist = this.msg.evaluateVo.questionList
               for(let i = 0;i<this.qlist.length;i++){
                  if(this.qlist[i].questionType==1&&this.qlist[i].remark){
                     this.qlist[i].remark = Number(this.qlist[i].remark)
                  }
               }
            })
         },
         daxing(a) {
            this.xing = a
         },
         imgclick(url) {
            uni.previewImage({
               urls: [url]
            })
         },
         pingjia(){
            uni.navigateTo({
               url: `/qiye/record/evaluate?id=${this.msg.orderId}`
            })
         },
         open() {
@@ -234,6 +333,34 @@
         },
         entery() {
            this.$emit('entery')
            if(this.complaintType==''){
               uni.showToast({
                  title: '请选择投诉主题',
                  icon: 'none'
               })
               return
            }
            if(this.complaintReason==''){
               uni.showToast({
                  title: '请输入投诉内容',
                  icon: 'none'
               })
               return
            }
            let data = {
               orderId:Number(this.id),
               complaintType:this.complaintType,
               complaintReason:this.complaintReason
            }
            console.log(data)
            //return;
            orderComplaint(data).then(val => {
               uni.showToast({
                  title: '提交成功',
                  icon: 'none'
               })
               this.show = false
            })
         },
      }
@@ -288,16 +415,19 @@
      }
      .imgbox {
         display: flex;
         flex-wrap: wrap;
         justify-content: space-between;
         display: grid;
         grid-template-columns: 1fr 1fr 1fr;
         grid-gap: 10rpx;
         // display: flex;
         // flex-wrap: wrap;
         // justify-content: space-between;
         border-radius: 10rpx;
         img {
            width: 198rpx;
            height: 198rpx;
            margin-bottom: 20rpx;
            border-radius: 10rpx;
         }
      }
   }
@@ -365,9 +495,10 @@
   /deep/ .u-radio-group {
      margin-top: 20rpx;
      flex-wrap: wrap;
      .u-radio {
         margin-right: 20rpx;
         margin-bottom: 20rpx;
      }
   }
@@ -429,10 +560,10 @@
   .page-box {
      padding: 24rpx 0;
      .font{
         color: #4a4e60;
         font-size: 32rpx;
         margin-top: 20rpx;
      .font{
         color: #4a4e60;
         font-size: 32rpx;
         margin-top: 20rpx;
      }
      .title1 {
         font-size: 36rpx;