Commit 37ca0095 authored by 王李辉's avatar 王李辉
Browse files

上传附件

parent 26cd1e8f
Loading
Loading
Loading
Loading
+47 −41
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@

      <van-field name="hdVideo1" label="隐患视频">
        <template #input>
          <van-uploader v-model="uploaderVideo" />
          <van-uploader v-model="uploaderVideo" accept="video/*" />
        </template>
      </van-field>
      <van-field
@@ -300,7 +300,7 @@ export default {
    });
  },
  beforeRouteLeave(to, from, next) {
     if ((to.name != "choose-people")) {
    if (to.name != "choose-people") {
      // 如果去的路由是
      this.projectId = ""; // 所属工程
      this.taskId = "";
@@ -386,6 +386,7 @@ export default {
    onSubmit(values) {
      console.log("submit", values);
      let formdata = new FormData();

      formdata.append("proId", this.projectId);
      formdata.append("hdRange", values.hdRange);
      formdata.append("hdType", values.hdType);
@@ -397,10 +398,15 @@ export default {
      formdata.append("dangerSource", values.dangerSource);
      formdata.append("hdPosition", values.hdPosition);
      formdata.append("hdDescribe", values.hdDescribe);
      formdata.append("hdPicture1[]", values.hdPicture1);
      formdata.append("hdVideo1[]", values.hdVideo1);
      formdata.append("hdExpirationTime", values.hdExpirationTime);
      formdata.append("rectificationUser", values.rectificationUser);
      // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
      values.hdPicture1.forEach(item => {
        formdata.append("hdPicture1[]", item.file);
      });
      values.hdVideo1.forEach(item => {
        formdata.append("hdVideo1[]", item.file);
      });
      this.$toast.loading({
        message: "提交中...",
        forbidClick: true,
+9 −4
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
        :rules="[{ required: true, message: '隐患整改详情描述不能为空' }]"
      />

      <van-field name="uploader" label="整改照片">
      <van-field name="uploader" label="整改照片" :rules="[{ required: true, message: '整改照片不能为空' }]">
        <template #input>
          <van-uploader v-model="uploaderImg" />
        </template>
@@ -73,7 +73,7 @@

      <van-field name="uploader2" label="整改视频">
        <template #input>
          <van-uploader v-model="uploaderVideo" />
          <van-uploader v-model="uploaderVideo" accept="video/*" />
        </template>
      </van-field>

@@ -145,8 +145,13 @@ export default {
      });
      let formdata = new FormData();
      formdata.append("details", this.value);
      // formdata.append("rePicture[]", values.uploader);
      // formdata.append("reVideo[]", values.uploader2);
      // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
      values.uploader.forEach(item => {
        formdata.append("rePicture1[]", item.file);
      });
      values.uploader2.forEach(item => {
        formdata.append("reVideo1[]", item.file);
      });
      // 判断保存的url
      let url = `/rectification/add1/${this.taskId}`;
      if (this.taskName == "隐患整改(已退回)") {
+6 −1
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@
        <van-field
          name="uploader"
          label="隐患复查照片"
          :rules="[{ required: true, message: '隐患复查照片不能为空' }]"
        >
          <template #input>
            <van-uploader v-model="uploaderImg" />
@@ -156,8 +157,12 @@ export default {
      });
      let formdata = new FormData()
      formdata.append('reviewResult', this.radio)
      // formdata.append('reviewPicture[]', values.uploader)
      formdata.append('reviewDetails', values.reviewDetails)
      // 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
      values.uploader.forEach(item => {
        formdata.append("reviewPicture1[]", item.file);
      });

      dangerReviewAdd(`/review/add1/${this.taskId}`,formdata)
        .then(res => {
          this.$toast.clear();
+134 −57
Original line number Diff line number Diff line
@@ -79,13 +79,29 @@
              <van-col span="7"
                ><span class="field-title">隐患照片:</span></van-col
              >
              <van-col span="17">{{ hdReport.hdPicture }}</van-col>
              <van-col span="17">
                <div
                  class="detail_pic"
                  v-for="(item, index) in hdReport.hdPictureList"
                  :key="index"
                >
                  <van-image width="100" height="100" :src="item.filePath" />
                </div>
              </van-col>
            </van-row>
            <van-row gutter="">
              <van-col span="7"
                ><span class="field-title">隐患视频:</span></van-col
              >
              <van-col span="17">{{ hdReport.hdVideo }}</van-col>
              <van-col span="17">
                <div
                  class="detail_video"
                  v-for="(item, index) in hdReport.hdVideoList"
                  :key="index"
                >
                  <video :src="item.filePath"></video>
                </div>
              </van-col>
            </van-row>
            <van-row gutter="">
              <van-col span="7"
@@ -129,9 +145,7 @@
            <van-col span="17">{{ hdConfirm.endTime }}</van-col>
          </van-row>
          <van-row gutter="">
            <van-col span="7"
              ><span class="field-title">意见:</span></van-col
            >
            <van-col span="7"><span class="field-title">意见:</span></van-col>
            <van-col span="17">{{ hdConfirm.confirmOpinion }}</van-col>
          </van-row>

@@ -151,7 +165,11 @@

      <div class="change-wrap" v-if="hdRectificationList.length > 0">
        <p>隐患整改</p>
        <van-cell-group inset v-for="(item, index) in hdRectificationList" :key="index">
        <van-cell-group
          inset
          v-for="(item, index) in hdRectificationList"
          :key="index"
        >
          <van-row gutter="">
            <van-col span="7"
              ><span class="field-title">整改详情描述:</span></van-col
@@ -162,13 +180,29 @@
            <van-col span="7"
              ><span class="field-title">隐患照片:</span></van-col
            >
            <van-col span="17">{{ item.rePicture }}</van-col>
            <van-col span="17">
              <div
                class="detail_pic"
                v-for="(itemTwo, index) in item.hdPictureList"
                :key="index"
              >
                <van-image width="100" height="100" :src="itemTwo.filePath" />
              </div>
            </van-col>
          </van-row>
          <van-row gutter="">
            <van-col span="7"
              ><span class="field-title">隐患视频:</span></van-col
            >
            <van-col span="17">{{ item.reVideo }}</van-col>
            <van-col span="17">
              <div
                class="detail_video"
                v-for="(itemTwo, index) in item.hdVideoList"
                :key="index"
              >
                <video :src="itemTwo.filePath"></video>
              </div>
            </van-col>
          </van-row>
          <van-row gutter="">
            <van-col span="7"
@@ -181,12 +215,24 @@

      <div class="review-wrap" v-if="hdReviewList.length > 0">
        <p>整改复查</p>
        <van-cell-group inset v-for="(item, index) in hdReviewList" :key="index">
        <van-cell-group
          inset
          v-for="(item, index) in hdReviewList"
          :key="index"
        >
          <van-row gutter="">
            <van-col span="7"
              ><span class="field-title">隐患照片:</span></van-col
            >
            <van-col span="17">{{ item.reviewPicture }}</van-col>
            <van-col span="17">
              <div
                class="detail_pic"
                v-for="(itemTwo, index) in item.hdPictureList"
                :key="index"
              >
                <van-image width="100" height="100" :src="itemTwo.filePath" />
              </div>
            </van-col>
          </van-row>

          <van-row gutter="">
@@ -200,7 +246,9 @@
            <van-col span="7"
              ><span class="field-title">复查结果:</span></van-col
            >
            <van-col span="17">{{ item.reviewResult == 1? "合格":"不合格"}}</van-col>
            <van-col span="17">{{
              item.reviewResult == 1 ? "合格" : "不合格"
            }}</van-col>
          </van-row>
        </van-cell-group>
      </div>
@@ -208,7 +256,11 @@
      <div class="journal-wrap">
        <p>日志信息</p>
        <van-cell-group inset>
          <van-steps direction="vertical" :active="99999" v-if="hdLogList.length>0">
          <van-steps
            direction="vertical"
            :active="99999"
            v-if="hdLogList.length > 0"
          >
            <van-step v-for="(item, index) in hdLogList" :key="index">
              <div class="step-wrap">
                <van-row>
@@ -249,7 +301,9 @@
              </div>
            </van-step>
          </van-steps>
          <div style="text-align: center;" v-if="hdLogList.length == 0">暂无数据</div>
          <div style="text-align: center;" v-if="hdLogList.length == 0">
            暂无数据
          </div>
        </van-cell-group>
        <!-- 展开 -->
        <div class="more" @click="journalReverse" v-show="hdLogList.length > 0">
@@ -260,7 +314,11 @@
      <div class="supervise-wrap">
        <p>督办信息</p>
        <van-cell-group inset>
           <van-steps direction="vertical" :active="99999" v-if="instructionsList.length>0">
          <van-steps
            direction="vertical"
            :active="99999"
            v-if="instructionsList.length > 0"
          >
            <van-step v-for="(item, index) in instructionsList" :key="index">
              <div class="step-wrap">
                <van-row>
@@ -296,10 +354,16 @@
            </van-step>
          </van-steps>

          <div style="text-align: center;" v-if="instructionsList.length == 0">暂无数据</div>
          <div style="text-align: center;" v-if="instructionsList.length == 0">
            暂无数据
          </div>
        </van-cell-group>
        <!-- 展开 -->
        <div class="more" @click="superviseReverse" v-show="instructionsList.length>0">
        <div
          class="more"
          @click="superviseReverse"
          v-show="instructionsList.length > 0"
        >
          {{ superviseOpenText }}
        </div>
      </div>
@@ -356,14 +420,14 @@ export default {
      standBookDetail(`/hdreport/hdDetailsApp/${this.id}`)
        .then(res => {
          this.$toast.clear();
          this.hdReport = res.data.hdReport
          this.hdConfirm = res.data.hdConfirm
          this.hdRectificationList = res.data.hdRectificationList
          this.hdReviewList = res.data.hdReviewList
          this.beifenhdLogList = res.data.hdLogList
          this.hdLogList = this.beifenhdLogList.slice(-1)
          this.beifeninstructionsList = res.data.instructionsList
          this.instructionsList = this.beifeninstructionsList.slice(-1)
          this.hdReport = res.data.hdReport;
          this.hdConfirm = res.data.hdConfirm;
          this.hdRectificationList = res.data.hdRectificationList;
          this.hdReviewList = res.data.hdReviewList;
          this.beifenhdLogList = res.data.hdLogList;
          this.hdLogList = this.beifenhdLogList.slice(-1);
          this.beifeninstructionsList = res.data.instructionsList;
          this.instructionsList = this.beifeninstructionsList.slice(-1);
        })
        .catch(() => {
          this.$toast.clear();
@@ -397,12 +461,11 @@ export default {
        //   显示所有数据
        this.journalOpenText = "收起 ▲";
        // 显示所有数据
        this.hdLogList = this.beifenhdLogList

        this.hdLogList = this.beifenhdLogList;
      } else {
        this.journalOpenText = "展开 ▼";
        // 只显示第一个数据
        this.hdLogList = this.beifenhdLogList.slice(-1)
        this.hdLogList = this.beifenhdLogList.slice(-1);
      }
    },
    // 督办信息显示或隐藏
@@ -411,11 +474,11 @@ export default {
      if (this.superviseOpen) {
        //   显示所有数据
        this.superviseOpenText = "收起 ▲";
        this.instructionsList = this.beifeninstructionsList
        this.instructionsList = this.beifeninstructionsList;
      } else {
        //   只渲染一条数据
        this.superviseOpenText = "展开 ▼";
        this.instructionsList = this.beifeninstructionsList.slice(-1)
        this.instructionsList = this.beifeninstructionsList.slice(-1);
      }
    }
  }
@@ -472,5 +535,19 @@ export default {
    font-weight: bolder;
    z-index: 99;
  }
  .detail_pic {
    margin-right: 0.266667rem;
    float: left;
  }
  .detail_video {
    width: 2.666667rem;
    height: 2.666667rem;
    margin-right: 0.266667rem;
    float: left;
    video {
      width: 2.666667rem;
      height: 2.666667rem;
    }
  }
}
</style>
+25 −3
Original line number Diff line number Diff line
@@ -67,6 +67,16 @@
              >
              <van-col span="17">{{ riskMain.gradingMethod }}</van-col>
            </van-row>
            <van-row gutter="">
              <van-col span="7"
                ><span class="field-title">定级方式(附件):</span></van-col
              >
              <van-col span="17">
                <div class="enclosure" v-for="(item, index) in riskMain.riskFileList1" :key="index">
                  <a :href="item.filePath" target="_blank">{{item.fileName}}</a>
                </div>
              </van-col>
            </van-row>
            <van-row gutter="">
              <van-col span="7"
                ><span class="field-title">技术措施:</span></van-col
@@ -77,7 +87,11 @@
              <van-col span="7"
                ><span class="field-title">技术措施(附件):</span></van-col
              >
              <van-col span="17">{{ riskMain.technicalMeasures }}</van-col>
              <van-col span="17">
                <div class="enclosure" v-for="(item, index) in riskMain.riskFileList2" :key="index">
                  <a :href="item.filePath" target="_blank">{{item.fileName}}</a>
                </div>
              </van-col>
            </van-row>
            <van-row gutter="">
              <van-col span="7"
@@ -89,7 +103,11 @@
              <van-col span="7"
                ><span class="field-title">管理措施(附件):</span></van-col
              >
              <van-col span="17">{{ riskMain.managementMeasures }}</van-col>
              <van-col span="17">
                   <div class="enclosure" v-for="(item, index) in riskMain.riskFileList3" :key="index">
                  <a :href="item.filePath" target="_blank">{{item.fileName}}</a>
                </div>
              </van-col>
            </van-row>
            <van-row gutter="">
              <van-col span="7"
@@ -101,7 +119,11 @@
              <van-col span="7"
                ><span class="field-title">应急措施(附件):</span></van-col
              >
              <van-col span="17">{{ riskMain.emergencyMeasure }}</van-col>
              <van-col span="17">
                  <div class="enclosure" v-for="(item, index) in riskMain.riskFileList4" :key="index">
                  <a :href="item.filePath"  target="_blank">{{item.fileName}}</a>
                </div>
              </van-col>
            </van-row>
          </div>
        </van-cell-group>
Loading