MrShi
2025-08-19 f2ac76666299407545fb733f0d21f6e8cfe538a3
h5/pages/workOrder_she/workOrder_she.vue
@@ -3,6 +3,7 @@
      <view class="dca_head">
         <text>任务{{returnStatus(info.status)}}</text>
         <text>工单号:{{info.code}}</text>
         <view class="dca_head_chao" v-if="[...info.sheDealUserQwIds.split(',')].includes(userInfo.qwId) && [1, 2].includes(info.status)" @click="show3 = true">抄送</view>
      </view>
      <u-gap height="5" bgColor="#EFEFEF"></u-gap>
      <view class="dca_list">
@@ -37,7 +38,7 @@
         <view class="dca_list_item" style="flex-direction: column;">
            <view class="dca_list_item_label">图片</view>
            <view class="dca_list_item_tu" v-if="info.multifileList">
               <view class="dca_list_item_tu_item" v-for="(item, index) in info.multifileList" :key="index">
               <view class="dca_list_item_tu_item" v-for="(item, index) in info.multifileList" :key="index" @click="previewImage(item.fileurlFull, info.multifileList.map(item => item.fileurlFull))">
                  <image :src="item.fileurlFull" mode="widthFix"></image>
               </view>
               <view class="dca_list_item_tu_zw"></view>
@@ -53,7 +54,7 @@
            <view class="lc">
               <view class="lc_item" v-for="(item, index) in info.logList" :key="index">
                  <view class="lc_item_dian"></view>
                  <view class="lc_item_xian" v-if="info.logList.length === 1 ? false : index === 0"></view>
                  <view class="lc_item_xian" v-if="info.logList.length === 1 ? false : index !== info.logList.length - 1"></view>
                  <view class="lc_item_title">{{item.title}}</view>
                  <view class="lc_item_info">{{item.companyName}}/{{item.userName}} {{item.createDate}}</view>
                  <view class="lc_item_content" v-if="![0,4].includes(item.objType)">
@@ -73,8 +74,8 @@
                     <view class="lc_item_content_item">
                        <view class="lc_item_content_item_label">图片:</view>
                        <view class="lc_item_content_item_img" v-if="item.multifileList">
                           <view class="image" v-for="(item, index) in item.multifileList" :key="index">
                              <image :src="item.fileurlFull" mode="widthFix"></image>
                           <view class="image" v-for="(child, index) in item.multifileList" :key="index" @click="previewImage(child.fileurlFull, item.multifileList.map(item => item.fileurlFull))">
                              <image :src="child.fileurlFull" mode="widthFix"></image>
                           </view>
                           <view class="imagezw"></view>
                           <view class="imagezw"></view>
@@ -86,7 +87,7 @@
                  </view>
                  <view class="lc_item_content" v-else-if="item.objType === 4">
                     <view class="lc_item_content_item">
                        <view class="lc_item_content_item_label">已催促:</view>
                        <!-- <view class="lc_item_content_item_label">已催促:</view> -->
                        <view class="lc_item_content_item_val">
                           <text>{{item.content}}</text>
                        </view>
@@ -96,11 +97,13 @@
            </view>
         </view>
      </view>
      <view style="width: 100%; height: calc(84rpx + env(safe-area-inset-bottom));"></view>
      <view class="footer">
         <view class="footer_btn" :style="info.passOnButton === 0 ? 'background-color: #3875C5; color: #ffffff;' : ''" v-if="info.closeButton === 1" @click="openGB">问题关闭</view>
         <view class="footer_btn" v-if="info.passOnButton === 1" style="background-color: #3875C5; color: #ffffff;" @click="openFP">任务分配</view>
      </view>
      <template v-if="info.closeButton === 1 || info.passOnButton === 1">
         <view style="width: 100%; height: calc(84rpx + env(safe-area-inset-bottom));"></view>
         <view class="footer">
            <view class="footer_btn" :style="info.passOnButton === 0 ? 'background-color: #3875C5; color: #ffffff;' : ''" v-if="info.closeButton === 1" @click="openGB">问题关闭</view>
            <view class="footer_btn" v-if="info.passOnButton === 1" style="background-color: #3875C5; color: #ffffff;" @click="openFP">任务分配</view>
         </view>
      </template>
      <!-- 任务分配 -->
      <u-popup :show="show" :round="10" mode="bottom">
         <view class="fp">
@@ -120,12 +123,13 @@
                        maxlength="200" count></u--textarea>
                  </u-form-item>
                  <u-form-item label="上传图片" labelWidth="80" prop="multifileList" labelPosition="top">
                     <u-upload
                     <UploadImage
                        :fileList="model.multifileList"
                        @afterRead="afterRead"
                        @delete="deletePic"
                        name="2"
                        style="margin-top: 15rpx;" />
                        folder="WORKORDER_LOG_FILE_PATH"
                        @dele="deletePic"
                        @getFileList="afterRead"
                        style="margin-top: 15rpx;"
                     />
                  </u-form-item>
               </u--form>
            </view>
@@ -145,12 +149,35 @@
                        maxlength="200" count></u--textarea>
                  </u-form-item>
                  <u-form-item label="上传图片" labelWidth="120" prop="multifileList" labelPosition="top" required>
                     <u-upload
                     <UploadImage
                        :fileList="model.multifileList"
                        @afterRead="afterRead"
                        @delete="deletePic"
                        name="1"
                        style="margin-top: 15rpx;" />
                        folder="WORKORDER_LOG_FILE_PATH"
                        @dele="deletePic"
                        @getFileList="afterRead"
                        style="margin-top: 15rpx;"
                     />
                  </u-form-item>
               </u--form>
            </view>
         </view>
      </u-popup>
      <!-- 抄送 -->
      <u-popup :show="show3" :round="10" mode="bottom">
         <view class="fp">
            <view class="fp_head">
               <text @click="show3 = false">取消</text>
               <text @click="send">确认抄送</text>
            </view>
            <view class="fp_box">
               <u--form labelPosition="left" :model="model" :rules="rules1" ref="uForm2">
                  <u-form-item label="选择抄送人" labelWidth="80" prop="passOnUserName" @click="seleUser1" required>
                     <u--input v-model="model.passOnUserName" border="none" placeholder="请选择抄送人" disabledColor="#ffffff"
                        disabled></u--input>
                     <u-icon slot="right" name="arrow-right"></u-icon>
                  </u-form-item>
                  <u-form-item label="说明" labelWidth="80" labelPosition="top" prop="info">
                     <u--textarea v-model="model.info" placeholder="请输入说明" style="margin-top: 15rpx;"
                        maxlength="200" count></u--textarea>
                  </u-form-item>
               </u--form>
            </view>
@@ -162,7 +189,13 @@
</template>
<script>
   import { mapState } from 'vuex'
   import UploadImage from '@/components/uploadImage/uploadImage.vue'
   export default {
      components: { UploadImage },
      computed: {
         ...mapState(['userInfo'])
      },
      data() {
         return {
            id: null,
@@ -170,6 +203,7 @@
            show: false,
            show1: false,
            show2: false,
            show3: false,
            model: {
               name: '',
               info: '',
@@ -207,6 +241,43 @@
         this.getDetails()
      },
      methods: {
         seleUser1() {
            var that = this
            that.$ww.selectEnterpriseContact({
               fromDepartmentId: -1,
               mode: 'multi',
               type: ['user'],
            }).then(res =>{
               console.log(res)
               if (res.errCode === 0) {
                  that.model.passOnUserName = res.result.userList.map(item => item.name).join(',')
                  that.model.passOnUserId = res.result.userList.map(item => item.id).join(',')
               }
            })
         },
         send() {
            var that = this
            that.$refs.uForm2.validate().then(async () => {
               let res = await that.$u.api.sendCopy({
                  info: that.model.info,
                  userIds: that.model.passOnUserId,
                  workorderId: that.info.id
               })
               if (res.code === 200) {
                  that.show3 = false
                  that.getDetails()
                  uni.showToast({ title: '操作成功', icon: 'none' })
               }
            }).catch(errors => {
            })
         },
         previewImage(current, urls) {
            uni.previewImage({
               current,
               urls
            });
         },
         openGB() {
            this.stopScroll()
            this.show1 = true
@@ -257,7 +328,8 @@
                  info: that.model.info,
                  passOnUserId: that.model.passOnUserId,
                  multifileList: that.model.multifileList,
                  workorderId: that.info.id
                  workorderId: that.info.id,
                  passOnType: this.info.status
               })
               if (res.code === 200) {
                  uni.showToast({ title: '操作成功', icon: 'none' })
@@ -273,10 +345,7 @@
         async urge() {
            let res = await this.$u.api.urge({ workorderId: this.info.id })
            if (res.code === 200) {
               uni.showToast({
                  title: '操作成功',
                  icon: 'none'
               })
               uni.showToast({ title: '催促成功', icon: 'none' })
               this.getDetails()
               this.show2 = false
            }
@@ -307,34 +376,17 @@
         async getDetails() {
            let res = await this.$u.api.detail({ id: this.id })
            if (res.code === 200) {
               res.data.managerId = res.data.managerId ? res.data.managerId : ''
               this.info = res.data
            }
         },
         // 删除图片
         deletePic(event) {
            this.model.multifileList.forEach((item, index) => {
               if (item.imgaddr === event.file.imgaddr) {
                  this.model.multifileList.splice(index, 1)
               }
            })
         deletePic(index) {
            this.model.multifileList.splice(index, 1)
         },
         // 新增图片
         afterRead(event) {
            uni.uploadFile({
               url: this.$baseUrl + '/web/public/upload',
               filePath: event.file.url,
               name: "file",
               formData: {
                  folder: "WORKORDER_LOG_FILE_PATH"
               },
               success: (res) => {
                  let obj = JSON.parse(res.data)
                  if (obj.code === 200) {
                     obj.data.fileurl = obj.data.imgaddr
                     this.model.multifileList.push(obj.data)
                  }
               }
            });
         afterRead(arr) {
            this.model.multifileList = [...this.model.multifileList, ...arr]
         }
      }
   }
@@ -343,6 +395,40 @@
<style lang="scss" scoped>
   .dca {
      width: 100%;
      .fp {
         width: 100%;
         .fp_head {
            width: 100%;
            height: 74rpx;
            padding: 0 42rpx;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1rpx solid #EFEFEF;
            text {
               &:nth-child(1) {
                  color: rgba(16, 16, 16, 1);
                  font-size: 28rpx;
               }
               &:nth-child(2) {
                  color: rgba(56, 117, 197, 1);
                  font-size: 28rpx;
               }
            }
         }
         .fp_box {
            width: 100%;
            padding: 30rpx;
            box-sizing: border-box;
         }
      }
      .dca_process {
         width: 100%;
@@ -548,6 +634,16 @@
         background-color: #ffffff;
         display: flex;
         flex-direction: column;
         position: relative;
         .dca_head_chao {
            position: absolute;
            top: 32rpx;
            right: 32rpx;
            color: rgba(32,110,238,1);
            font-size: 28rpx;
            text-decoration: underline;
         }
         text {
            &:nth-child(1) {