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">
@@ -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,13 +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"
                        multiple
                        style="margin-top: 15rpx;" />
                        folder="WORKORDER_LOG_FILE_PATH"
                        @dele="deletePic"
                        @getFileList="afterRead"
                        style="margin-top: 15rpx;"
                     />
                  </u-form-item>
               </u--form>
            </view>
@@ -146,13 +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"
                        multiple
                        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>
@@ -164,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,
@@ -172,6 +203,7 @@
            show: false,
            show1: false,
            show2: false,
            show3: false,
            model: {
               name: '',
               info: '',
@@ -209,6 +241,37 @@
         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,
@@ -313,56 +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) {
            var that = this
            uni.showLoading({ title: '上传中...', mask: true })
            uni.uploadFile({
               url: this.$baseUrl + '/web/public/uploadBatch',
               files: event.file.map(e => {
                  return { name: 'files', uri: e.url }
               }),
               formData: {
                  folder: "WORKORDER_LOG_FILE_PATH",
               },
               success(res) {
                  uni.hideLoading();
                  let obj = JSON.parse(res.data)
                  if (obj.code === 200) {
                     console.log(obj.data)
                     obj.data.forEach(item => {
                        item.fileurl = item.imgaddr
                     })
                     that.model.multifileList = [...that.model.multifileList, ...obj.data]
                  }
               }
            })
            // 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]
         }
      }
   }
@@ -371,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%;
@@ -576,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) {