Commit 8c8ac4f7 authored by p-wanping.song's avatar p-wanping.song
Browse files

123

parent 73570bae
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -9158,6 +9158,11 @@
        }
      }
    },
    "moment": {
      "version": "2.29.4",
      "resolved": "https://registry.npmmirror.com/moment/-/moment-2.29.4.tgz",
      "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
    },
    "move-concurrently": {
      "version": "1.0.1",
      "resolved": "http://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
    "lib-flexible": "^0.3.2",
    "lodash": "^4.17.21",
    "lodash.debounce": "^4.0.8",
    "moment": "^2.29.4",
    "postcss-px2rem": "^0.3.0",
    "pushstate-server": "^3.1.0",
    "s": "^1.0.0",
+34 −13
Original line number Diff line number Diff line
@@ -582,10 +582,21 @@ export default {
        });
    }),
    //保存房间名称
    saveRoomName() {
    async saveRoomName() {
      if (this.copyRoom.isCopy) {
        // return;
        this.saveCopy();
        if (
          !this.copyRoom.room.id ||
          !this.copyRoom.floor.id ||
          !this.copyRoom.type.dictCode
        ) {
          Toast.fail({
            title: "提示",
            forbidClick: true,
            message: "请填写完整!",
          });
          return false;
        }
        await this.saveCopy();
      }
      if (this.roomName == "") {
        Toast.fail({
@@ -626,7 +637,7 @@ export default {
        w: 2,
        h: 3,
        i: i,
        id: i,
        id: this.copyRoom.isCopy ? this.copyRoom.id : i,
        name: this.roomName,
        c: "#e6e5e5",
        type: this.isRoom
@@ -650,6 +661,7 @@ export default {
          : "9999",
      };
      this.layoutData.push(data);
      this.resetCopy();
      // postFun("/ledger/room/save", data)
      //   .then(res => {
      //     if (res.code == 200) {
@@ -662,23 +674,32 @@ export default {
      //   .catch(err => {
      //   });
    },
    resetCopy() {
      const copyRoom = {
        isCopy: false,
        floor: {},
        room: {},
        type: {},
        copyArr: [],
        id: "",
      };
      this.copyRoom = { ...this.copyRoom, ...copyRoom };
      // this.copyRoom.isCopy = false;
      // this.copyRoom.floor = {};
      // this.copyRoom.room = {};
      // this.copyRoom.type = {};
      // this.copyRoom.copyArr = [];
    },
    // saveCopy
    saveCopy() {
      const planId = sessionStorage.getItem("planId");
      postFun(`/risk/plan/copy/room/${planId}`, {
      return postFun(`/risk/plan/copy/room/${planId}`, {
        id: this.copyRoom.room.id,
        floorId: this.$route.params.floorId,
        name: this.roomName,
        roomType: this.copyRoom.type.dictType,
      }).then((res) => {
        // this.copyRoom.isCopy = false;
        this.copyRoom = {
          isCopy: false,
          floor: {},
          room: {},
          type: {},
          copyArr: [],
        };
        this.copyRoom.id = res.data;
      });
    },
    cancelDialog() {
+3 −4
Original line number Diff line number Diff line
@@ -145,10 +145,9 @@ export default {
        formData.append("remark", this.form.remark);
        postFun("/risk/plan/sign", formData).then((res) => {
          if (res.code == 200) {
            this.$message({
              message: "签到成功",
              type: "success",
            });
            this.$toast.success(type ? "签到成功" : "签退成功");
            this.form.file = [];
            this.form.remark = "";
          }
        });
      });
+52 −9
Original line number Diff line number Diff line
@@ -2,15 +2,32 @@
  <div>
    <LHeader text="签到记录"> </LHeader>
    <div>
      <van-cell
        v-for="item in list"
        :key="item.id"
        :title="item.type ? '签到' : '签退'"
        :value="item.createTime"
      >
      <van-cell v-for="item in list" :key="item.id">
        <template #label>
          <div class="tips">
            <div>用户:{{ item.userName }}</div>
            <div>备注:{{ item.remark }}</div>
          <div>照片:<img src="" alt="" /></div>
            <div>
              照片:
              <div class="imgs">
                <div
                  v-for="file in item.files"
                  :key="file.fileId"
                  class="img-item"
                >
                  <img :src="file.filePath" alt="" />
                </div>
              </div>
            </div>
          </div>
        </template>
        <template #title>
          <div class="title">
            <div>{{ item.type ? "签到" : "签退" }}</div>
            <div>
              {{ moment(item.createTime).format("YYYY-MM-DD HH:mm:ss") }}
            </div>
          </div>
        </template>
      </van-cell>
    </div>
@@ -20,11 +37,13 @@
<script>
import LHeader from "@/components/header.vue";
import { getFun } from "@/service/table.js";
import moment from "moment";
export default {
  components: { LHeader },
  data() {
    return {
      list: [],
      moment: moment,
    };
  },
  mounted() {
@@ -42,4 +61,28 @@ export default {
};
</script>

<style lang="scss" scoped></style>
<style lang="less" scoped>
.title {
  display: flex;
  justify-content: space-between;
}
.tips {
  line-height: 22px;

  .imgs {
    display: flex;
    flex-wrap: wrap;
    .img-item {
      width: 100px;
      height: 100px;
      margin-right: 10px;
      margin-top: 10px;
    }
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
</style>
Loading