Commit 3ec97d5f authored by 13841799530's avatar 13841799530
Browse files

2222

parents de470e2e bde79239
Loading
Loading
Loading
Loading
Loading
+426 B
Loading image diff...
+443 B
Loading image diff...
+449 B
Loading image diff...
+84 −16
Original line number Diff line number Diff line
@@ -27,7 +27,11 @@
        @click="showProjectName = true"
        :rules="[{ required: true, message: '所属项目不能为空' }]"
      />
      <van-popup v-model="showProjectName" position="bottom">
      <van-popup
        v-model="showProjectName"
        position="bottom"
        v-if="!isShowreturnCause"
      >
        <van-picker
          show-toolbar
          value-key="projectName"
@@ -47,7 +51,11 @@
        @click="showRange = true"
        :rules="[{ required: true, message: '适用范围不能为空' }]"
      />
      <van-popup v-model="showRange" position="bottom">
      <van-popup
        v-model="showRange"
        position="bottom"
        v-if="!isShowreturnCause"
      >
        <van-picker
          show-toolbar
          value-key="hdRange"
@@ -66,8 +74,9 @@
        placeholder="请选择"
        @click="showType = true"
        :rules="[{ required: true, message: '隐患类型不能为空' }]"
        :class="{'gray':isShowreturnCause}"
      />
      <van-popup v-model="showType" position="bottom">
      <van-popup v-model="showType" position="bottom" v-if="!isShowreturnCause">
        <van-picker
          show-toolbar
          value-key="hdType"
@@ -87,7 +96,11 @@
        @click="showDangerName = true"
        :rules="[{ required: true, message: '隐患项目名称不能为空' }]"
      />
      <van-popup v-model="showDangerName" position="bottom">
      <van-popup
        v-model="showDangerName"
        position="bottom"
        v-if="!isShowreturnCause"
      >
        <van-picker
          show-toolbar
          value-key="hdName"
@@ -216,7 +229,29 @@
            :max-count="5"
            upload-text="最多上传五个"
            v-model="uploaderImg"
          >
            <template slot="default">
              <!-- 11111111111 -->
              <div
                style="
                  width: 2.13333rem;
                  height: 2.13333rem;
                  background: #f7f8fa;
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  flex-direction: column;
                "
              >
                <img
                  src="@/assets/upload/pic.png"
                  alt=""
                  style="width: 0.64rem; height: 0.64rem"
                />
                <span class="van-uploader__upload-text">最多上传五个</span>
              </div>
            </template>
          </van-uploader>
        </template>
      </van-field>

@@ -228,7 +263,29 @@
            upload-text="最多上传五个"
            v-model="uploaderVideo"
            accept="video/*"
          >
            <template slot="default">
              <!-- 11111111111 -->
              <div
                style="
                  width: 2.13333rem;
                  height: 2.13333rem;
                  background: #f7f8fa;
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  flex-direction: column;
                "
              >
                <img
                  src="@/assets/upload/video.png"
                  alt=""
                  style="width: 0.64rem; height: 0.64rem"
                />
                <span class="van-uploader__upload-text">最多上传五个</span>
              </div>
            </template>
          </van-uploader>
        </template>
      </van-field>
      <van-field
@@ -370,6 +427,7 @@ export default {

  data() {
    return {
      id: 0,
      text: "新增隐患",
      taskId: "",
      projectId: "", // 所属工程
@@ -443,6 +501,7 @@ export default {

    onSubmit(values) {
      let formdata = new FormData();
      formdata.append("id", this.id);
      formdata.append("proId", this.projectId);
      // formdata.append("projectName", this.projectName);
      formdata.append("hdRange", values.hdRange);
@@ -526,8 +585,9 @@ export default {
          // 对数据进行赋值
          this.returnCause = res.data.reason;
          let msg = res.data.hdReport;
          msg.hdPictureList=msg.hdPictureList||[];
          msg.hdVideoList=msg.hdVideoList||[];
          // msg.hdPictureList=msg.hdPictureList||[];
          // msg.hdVideoList=msg.hdVideoList||[];
          this.id = msg.id;
          this.projectId = msg.proId;
          this.projectName = res.data.projectInformations.filter(
            (item) => item.id == msg.proId
@@ -544,20 +604,28 @@ export default {
          this.describe = msg.hdDescribe;
          this.expireTime = msg.hdExpirationTime;
          this.recPeople = msg.rectificationUser;
          this.uploaderImg = msg.hdPictureList.map(item=>{
          this.uploaderImg = (res.data.imgsysFiles || []).map((item) => {
            return {
              ...item,
              url:item.filePath
            }
          })
          this.uploaderVideo =  msg.hdVideoList.map(item=>{
              url: item.filePath,
            };
          });
          console.log(this.uploaderImg);
          this.uploaderVideo = (res.data.videosysFiles || []).map((item) => {
            return {
              ...item,
              url:item.filePath
              url: item.filePath,
            };
          });

          postHdShowPeople(`/hdreport/showPeople/${msg.proId}`).then(
            (res) => {
              this.columnsRecPeople = res.data;
            }
          );
        })
        })
        .catch(() => {
        .catch((err) => {
          console.log(err);
          this.$toast.clear();
          this.$toast.fail("加载失败,请稍后再试");
        });
+42 −27
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@
        <van-col span="6">隐患类型:</van-col>
        <van-col span="18">{{ item.hdType }}</van-col>
      </van-row>
      <van-row gutter="">
        <van-col span="6">工单状态:</van-col>
        <van-col span="18">{{ item.taskName }}</van-col>
      </van-row>
      <!-- <van-row gutter="">
        <van-col span="6">发现时间:</van-col>
        <van-col span="18">{{ item.hdDiscoveryTime }}</van-col>
@@ -59,7 +63,10 @@
          :value="value"
          label="整改截止时间"
          placeholder="点击选择日期"
          @click="showCalendar = true;currentDate = new Date()"
          @click="
            showCalendar = true;
            currentDate = new Date();
          "
          :rules="[{ required: true, message: '请选择日期' }]"
        />
        <van-popup v-model="showCalendar" position="bottom">
@@ -135,7 +142,7 @@
        />
      </div>

      <div style="margin: 16px;">
      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit"
          >保存</van-button
        >
@@ -157,7 +164,7 @@ import { getConfirmFormList, dangerConSub } from "@/service/danger";
export default {
  name: "affirm-danger",
  components: {
    LHeader
    LHeader,
  },
  data() {
    return {
@@ -177,19 +184,18 @@ export default {
      showPickerReview: false,
      valueIdea: "",
      returnReason: "",
      currentDate: new Date()
      currentDate: new Date(),
    };
  },

  beforeRouteEnter(to, from, next) {
    next(vm => {
    next((vm) => {
      if (from.name === "confirme-danger") {
        vm.messageList = [];
        let paramsData = to.params.data;
        vm.taskId = paramsData.taskId;
        vm.messageList.push(paramsData);
        vm.radio= "1",
        vm.value = "";
        (vm.radio = "1"), (vm.value = "");
        vm.rectId = ""; // 隐患整改人
        vm.valueRect = "";
        vm.reviewId = ""; // 隐患复查人
@@ -198,7 +204,7 @@ export default {
        vm.returnReason = "";
        vm.getFormList();
        // 清空数据
        vm.currentDate = new Date()
        vm.currentDate = new Date();
      }
    });
  },
@@ -213,10 +219,10 @@ export default {
        message: "加载中...",
        forbidClick: true,
        loadingType: "spinner",
        duration: 0
        duration: 0,
      });
      getConfirmFormList(`confirm/add/${this.taskId}`)
        .then(res => {
        .then((res) => {
          this.$toast.clear();
          this.columnsRect = res.data.rectificationUser;
          this.columnsReview = res.data.rectificationReview;
@@ -234,22 +240,31 @@ export default {
      }
      let formdata = new FormData();
      formdata.append("confirmResult", this.radio);
      formdata.append("endTime", values.endTime?values.endTime:'');
      formdata.append("rectificationUser", values.rectificationUser?values.rectificationUser:'');
      formdata.append("rectificationReview", values.rectificationReview?values.rectificationReview:'');
      formdata.append("confirmOpinion", values.confirmOpinion?values.confirmOpinion:'');
      formdata.append("endTime", values.endTime ? values.endTime : "");
      formdata.append(
        "rectificationUser",
        values.rectificationUser ? values.rectificationUser : ""
      );
      formdata.append(
        "rectificationReview",
        values.rectificationReview ? values.rectificationReview : ""
      );
      formdata.append(
        "confirmOpinion",
        values.confirmOpinion ? values.confirmOpinion : ""
      );
      this.$toast.loading({
        message: "提交中...",
        forbidClick: true,
        loadingType: "spinner",
        duration: 0
        duration: 0,
      });
      dangerConSub(`/confirm/add1/${this.taskId}`, formdata)
        .then(res => {
        .then((res) => {
          this.$toast.clear();
          this.$toast.success({
            message: "提交成功",
            duration: 2000
            duration: 2000,
          });
          history.go(-1);
        })
@@ -272,7 +287,7 @@ export default {
    onConRect(value) {
      if (!value) {
        this.showPickerRect = false;
        return
        return;
      }
      this.valueRect = value.userName;
      this.rectId = value.userId;
@@ -281,7 +296,7 @@ export default {
    onConReview(value) {
      if (!value) {
        this.showPickerReview = false;
        return
        return;
      }
      this.valueReview = value.userName;
      this.reviewId = value.userId;
@@ -292,15 +307,15 @@ export default {
      this.$router.push({
        name: "normal-detail",
        params: {
          id: taskId
        }
          id: taskId,
        },
      });
    },

    cancel() {
      this.$router.go(-1);
    }
  }
    },
  },
};
</script>
<style lang="less" scoped>
Loading