董国庆
2025-06-06 d0f4c2d4bb7a72b32fb9945de8908e1d4ab6509c
H5/pages/dispatchWorkOrder/dispatchWorkOrder.vue
@@ -2,18 +2,18 @@
   <view class="problem-report-page">
      <view class="info-cards">
         <view class="info-top">
            <view class="num">诉求号:7843523454</view>
            <view class="status">正在办理</view>
            <view class="num">诉求号:{{detail.serialNumber}}</view>
            <view class="status">{{['正在办理','延期办理','超时办理','已办结','群众撤销','上报待审核','上级驳回'][detail.status]}}</view>
         </view>
         <view class="address">
            <view class="adr">江苏省常州市溧阳市牛顿大道172号</view>
            <view class="adr">{{detail.location || ''}}</view>
            <image src="/static/position@2x.png" class="w-31 h-31" mode="aspectFill"></image>
         </view>
         <view class="table-head">
            <view class="type flex1">问题类型</view>
            <view class="person flex1">群众</view>
            <view class="person flex1">群众姓名</view>
            <view class="phone flex1">联系电话</view>
         </view>
@@ -21,19 +21,23 @@
            <view class="table-item">
               <view class="type-tip flex1">
                  <view class="tip">
                     教育
                     {{detail.problemType}}
                  </view>
               </view>
               <view class="person-item flex1">沙振</view>
               <view class="phone-item flex1">14225874426</view>
               <view class="person-item flex1">{{detail.name}}</view>
               <view class="flex a-center">
                  <view class="phone-item flex1">{{detail.contactNumber}}</view>
                  <image @click.stop="callPhone(detail.contactNumber)" src="../../static/tell.png"
                     class="w-58 h-58 shrink0 " />
               </view>
            </view>
         </view>
      </view>
      <view class="input-card">
         <view class="title mb-27">
            上报说明
            下派说明
         </view>
         <u--textarea style="background-color:rgba(248, 248, 248, 1);border: unset;padding:25rpx 30.77rpx;"
            height="365.38rpx" v-model="content" placeholder="请输入内容"></u--textarea>
@@ -41,21 +45,19 @@
      <view class="notice-tip flex a-center ">
         <image src="/static/warnng@2x.png" class="w-31 h-31 mr-15" mode="aspectFill"></image>
         提交后会由上级部门进行审核,请留意审核结果
         提交后会由下级部门处理当前诉求
      </view>
      <view class="btn">下派至下级部门</view>
      <view class="btn" @click="dispatch">下派至下级部门</view>
      <u-popup round="19rpx" :show="showPop" mode="center" @close="close" @open="open">
         <view class="popup-content">
            <view class="title-pop">请选择下派单位</view>
            <view class="pop-label">社区:</view>
            <view class="pop-select">
               请选择
            </view>
            <view class="pop-label">{{['','区县','街道','社区'][accountLevel]}}:</view>
            <uni-data-select :disabled="false" v-model="value" :localdata="range"></uni-data-select>
            <view class="botton-btn">
               <view class="cancle">取消</view>
               <view class="sure">确定</view>
               <view class="cancle" @tap="close">取消</view>
               <view class="sure" @tap="toDispatch">确定</view>
            </view>
         </view>
      </u-popup>
@@ -63,19 +65,124 @@
</template>
<script>
   import {
      saveDispatch,
      getDetail,
      getDispatchList
   } from './service'
   export default {
      data() {
         return {
            content: '',
            detail: {},
            showPop: false,
            value: '',
            range: [],
            accountLevel: 1, //1、市级 2、区县 3、街道 4、社区
         };
      }
      },
      onShow() {
         this.accountLevel = uni.getStorageSync('userInfo').levelId || 1
      },
      onLoad(option) {
         // option.id = 1
         if (option.id) {
            this.id = option.id
            getDetail({
               id: option.id
            }).then(res => {
               if (res.code == 200) {
                  this.detail = res.data
               }
            })
         }
      },
      methods: {
         callPhone(phoneNumber) {
            uni.makePhoneCall({
               phoneNumber
            });
         },
         close() {
            this.showPop = false
         },
         dispatch() {
            this.showPop = true
         },
         open() {
            getDispatchList().then(res => {
               if (res.code == 200) {
                  this.range = res.data.map(item => {
                     item.text = item.name
                     item.value = item.id
                     item.disable = false
                     return item
                  })
               }
            })
         },
         toDispatch() {
            if (!this.value) {
               uni.showToast({
                  icon: 'none',
                  title: '请选择下派单位'
               })
               return
            }
            uni.showLoading({
               mask: true
            })
            saveDispatch({
               complaintId: this.id,
               comment: this.content,
               dispatchId: this.value
            }).then(res => {
               this.showPop = false
               uni.hideLoading()
               if (res.code == 200) {
                  uni.showToast({
                     icon: 'none',
                     title: '下派成功'
                  })
                  setTimeout(() => {
                     uni.navigateBack({
                        delta: 2
                     })
                  }, 1500)
               }
            })
         }
      },
   }
</script>
<style lang="scss" scoped>
   /deep/.uni-select {
      width: calc(484rpx) !important;
      border: unset;
      margin-top: 25rpx;
      margin-left: 45.15rpx;
   }
   /deep/.uni-select__input-box {
      width: calc(454rpx - 30.77rpx) !important;
      height: 77rpx;
      background: #FFFFFF;
      border-radius: 15rpx;
      border: 2rpx solid rgba(0, 0, 0, 0.15);
      padding-left: 30.77rpx;
      padding-right: 30.77rpx;
   }
   /deep/.uni-select__selector {
      width: calc(461rpx) !important;
      left: 15rpx;
   }
   .problem-report-page {
      padding-top: 38.46rpx;
      margin: 0 30.77rpx;
@@ -338,5 +445,7 @@
         color: #FFFFFF;
         cursor: pointer;
      }
   }
</style>