Commit 80137880 authored by yf's avatar yf
Browse files

修改执行情况查看

parent ad372ed3
Loading
Loading
Loading
Loading
+336 −305
Original line number Diff line number Diff line
@@ -20,23 +20,37 @@
        </van-grid-item>
        <van-grid-item>
          <div>开始时间:</div>
            <div>{{timestampToTimes(messageList.startTime)||messageList.startTime}}</div>
          <div>
            {{
              timestampToTimes(messageList.startTime) || messageList.startTime
            }}
          </div>
        </van-grid-item>
        <van-grid-item>
          <div>结束时间:</div>
            <div>{{timestampToTimes(messageList.endTime)||messageList.endTime}}</div>
          <div>
            {{ timestampToTimes(messageList.endTime) || messageList.endTime }}
          </div>
        </van-grid-item>
      </van-grid>
      <van-steps :active="active" active-icon="success" active-color="#38f" style="margin: 0.26rem 0;">
      <van-steps
        :active="active"
        active-icon="success"
        active-color="#38f"
        style="margin: 0.26rem 0;"
      >
        <van-step>任务发起</van-step>
        <van-step>风险评估</van-step>
        <van-step>评估审核</van-step>
        <van-step>项目完成</van-step>
      </van-steps>
      <van-tabs v-model="active" color="#2980f7"
      <van-tabs
        v-model="active"
        color="#2980f7"
        animated
        :sticky="true"
        offset-top="2.93rem">
        offset-top="2.93rem"
      >
        <van-tab title="任务详情">
          <van-form
            :scroll-to-error="true"
@@ -95,16 +109,17 @@
              :rules="[{ required: true, message: '事故类型不能为空' }]"
            />

        
            <van-field
              v-model="form.startTime"
              readonly
              name="location"
              label="任务开始时间"
              input-align="right"
                :formatter="()=>{
                  return timestampToTimes(form.startTime) 
                }"
              :formatter="
                () => {
                  return timestampToTimes(form.startTime);
                }
              "
              :rules="[{ required: true, message: '任务开始时间不能为空' }]"
            />

@@ -113,9 +128,11 @@
              readonly
              name="location"
              label="任务结束时间"
                :formatter="()=>{
                  return timestampToTimes(form.endTime) 
                }"
              :formatter="
                () => {
                  return timestampToTimes(form.endTime);
                }
              "
              input-align="right"
              :rules="[{ required: true, message: '任务结束时间不能为空' }]"
            />
@@ -130,19 +147,22 @@
            />
          </van-form>
        </van-tab>
        <van-tab title="风险清单">


        </van-tab>
        <van-tab title="风险清单"> </van-tab>
        <van-tab title="审核记录">
          <div class="journal-wrap">
            <van-cell-group inset>
            <van-steps direction="vertical" :active="99999" v-if="riskLogList.length>0">
              <van-steps
                direction="vertical"
                :active="99999"
                v-if="riskLogList.length > 0"
              >
                <van-step v-for="(item, index) in riskLogList" :key="index">
                  <div class="step-wrap">
                    <van-row>
                      <van-col span="24"
                      ><div class="info-title">{{timestampToTimes(item.startTime)}}</div></van-col
                        ><div class="info-title">
                          {{ timestampToTimes(item.startTime) }}
                        </div></van-col
                      >
                    </van-row>
                    <van-row>
@@ -172,18 +192,22 @@
                  </div>
                </van-step>
              </van-steps>
          <div style="text-align: center;" v-if="riskLogList.length == 0">暂无数据</div>
              <div style="text-align: center;" v-if="riskLogList.length == 0">
                暂无数据
              </div>
            </van-cell-group>
          </div>
        </van-tab>
        <van-tab title="风险评估报告">
          <div style="height: 1.5rem;
          <div
            style="height: 1.5rem;
           background-color: #fff;
           border-bottom: 1px solid #97999a;
           display: flex;
           justify-content: space-between;
           line-height: 1.5rem;
           ">
           "
          >
            <div><van-icon name="column" size="26px" /></div>
            <div style="flex-grow:1;line-height: 0.6rem">
              <div>风险评估报告.PDF</div>
@@ -193,13 +217,15 @@
              <van-icon name="arrow" size="26px" />
            </div>
          </div>
          <div style="height: 1.5rem;
          <div
            style="height: 1.5rem;
           background-color: #fff;
           border-bottom: 1px solid #97999a;
           display: flex;
           justify-content: space-between;
           line-height: 1.5rem;
           ">
           "
          >
            <div><van-icon name="column" size="26px" /></div>
            <div style="flex-grow:1;line-height: 0.6rem">
              <div>风险评估报告.PDF</div>
@@ -212,7 +238,8 @@
        </van-tab>
      </van-tabs>
    </div>
      <div style="display: flex;
    <div
      style="display: flex;
        justify-content: space-around;
        background-color: #fff;
        border-top: 1px solid #e3e3e3;
@@ -220,15 +247,19 @@
        width: 100%;
        text-align: center;
        position: fixed;
        bottom: 0;">
        <div @click="performTasks" style="color: #4bced0;font-size: 14px;font-weight: 600;">
        bottom: 0;"
    >
      <div
        @click="performTasks"
        style="color: #4bced0;font-size: 14px;font-weight: 600;"
      >
        <div style="font-size: 22px;"><van-icon name="plus" /></div>
        <div>执行任务</div>
      </div>
        <div style="color: #ec808d;font-size: 14px;font-weight: 600;">
      <!-- <div style="color: #ec808d;font-size: 14px;font-weight: 600;">
          <div style="font-size: 22px;"><van-icon name="success" /></div>
          <div>任务完成</div>
        </div>
        </div> -->
    </div>
  </div>
</template>
@@ -238,9 +269,9 @@
import { timestampToTime, generateId } from "@/utils/format";
import { getFun, postFun } from "@/service/table.js";
export default {
    name:'risk-confirme',
  name: "risk-confirme",
  components: {
      LHeader,
    LHeader
  },
  data() {
    return {
@@ -252,50 +283,52 @@
      Loop: "", // 定时器
      showIndex: null, // 是否显示遮罩层,
      active: 0,
        form:{

        },
        tabs: [
        ],
      form: {},
      tabs: []
    };
  },
  created() {
      var planId=this.$route.params.id || sessionStorage.getItem('planId')
      this.postList(planId);
    var planId = this.$route.params.id || sessionStorage.getItem("planId");
    var buildingId =
      this.$route.params.buildingId || sessionStorage.getItem("buildingId");
    this.postList(planId, buildingId);
  },
  methods: {
    timestampToTimes(time) {
        return  timestampToTime(new Date(time),"DT2", true)
      return timestampToTime(new Date(time), "DT2", true);
    },
    performTasks() {
      this.$router.push({
        name: "riskInherent",
        params: {
          id: this.messageList.id
                },
          })
        }
      });
    },
    handadd() {
      this.$router.push({
        name: "riskAdd",
        params: {
                    title:'新增'
                },
            })
          title: "新增"
        }
      });
    },
      postList(id) {
    postList(id, buildingId) {
      console.log(buildingId, "123");
      this.$toast.loading({
        message: "加载中...",
        forbidClick: true,
        loadingType: "spinner",
          duration: 0,
        duration: 0
      });
        getFun(`/risk/plan/details/${id}`)
          .then((res) => {
      var url = `/risk/plan/details/${id}`;
      if (buildingId) url += "?buildingId=" + buildingId;
      getFun(url)
        .then(res => {
          this.$toast.clear();
          this.messageList = res.data || res.rows;
            this.form= this.messageList.detailsDto
            this.riskLogList= this.messageList.approveListDtos
          this.form = this.messageList.detailsDto;
          this.riskLogList = this.messageList.approveListDtos;
        })
        .catch(() => {
          this.$toast.clear();
@@ -318,8 +351,8 @@
      this.$router.push({
        name: "risk-big-detail",
        params: {
            id: data.businessId||data.id,
          },
          id: data.businessId || data.id
        }
      });
      this.showIndex = null;
    },
@@ -328,19 +361,18 @@
      this.$router.push({
        name: "risk-affirm",
        params: {
            data: data,
          },
          data: data
        }
      });
      this.showIndex = null;
      },
    },
    }
  }
};
</script>
<style lang="less" scoped>
  
#app {
  font-family: "";
    color: #2c3e50
  color: #2c3e50;
}
.cell-wrap {
  position: relative;
@@ -386,4 +418,3 @@
  z-index: 99;
}
</style>
  
 No newline at end of file
+190 −49
Original line number Diff line number Diff line
@@ -4,12 +4,24 @@
    <van-sticky offset-top="0">
      <LHeader :text="text"></LHeader>
    </van-sticky>
    <van-tabs v-model="active" @change="postList" color="#2980f7" animated :sticky="true">
      <van-tab v-for="(item) in tabs" :key="item.key" :title="item.title">
    <van-tabs
      v-model="active"
      @change="postList"
      color="#2980f7"
      animated
      :sticky="true"
    >
      <van-tab v-for="item in tabs" :key="item.key" :title="item.title">
        <!-- 内容列表 -->
        <div class="con-list" @touchmove="showIndex = null">
          <van-cell-group inset v-for="(item, index) in messageList" :key="index">
            <div style="font-size: 0.45rem;padding: 5px 0;">{{ item.title }}</div>
          <van-cell-group
            inset
            v-for="(item, index) in messageList"
            :key="index"
          >
            <div style="font-size: 0.45rem;padding: 5px 0;">
              {{ item.title }}
            </div>
            <van-row gutter="">
              <van-col span="17">
                <van-row gutter="">
@@ -18,26 +30,45 @@
                </van-row>
                <van-row gutter="">
                  <van-col span="9">发起时间:</van-col>
                  <van-col span="15">{{ timestampToTimes(item.startTime) }}</van-col>
                  <van-col span="15">{{
                    timestampToTimes(item.startTime)
                  }}</van-col>
                </van-row>
              </van-col>
              <van-col span="7">
                <van-row :style="{ 'color': (active == 0) ? '#f79648' : (active == 1) ? '#0069e5' : '#03b615' }">
                <van-row
                  :style="{
                    color:
                      active == 0
                        ? '#f79648'
                        : active == 1
                        ? '#0069e5'
                        : '#03b615'
                  }"
                >
                  {{ item.state }}
                </van-row>
                <van-row>
                  <van-button type="info" size="mini" @click="lookdetail(index, item)">查看详情</van-button>
                  <van-button
                    type="info"
                    size="mini"
                    @click="lookdetail(index, item)"
                    >执行情况</van-button
                  >
                </van-row>
              </van-col>
            </van-row>
          </van-cell-group>
          <div style="
          <div
            style="
              width: 100%;
              text-align: center;
              font-size: 0.48rem;
              position: fixed;
              top: 30%;
            " v-if="messageList['length'] == 0">
            "
            v-if="messageList['length'] == 0"
          >
            暂无数据
          </div>
        </div>
@@ -46,11 +77,95 @@
      </van-tab>
    </van-tabs>
    <!-- 长按显示遮罩层 -->
   <van-overlay :show="showIndex">
      <div class="wrapper" @click.stop="showIndex = false">
    <van-popup
      v-model="showIndex"
      closeable
      round
      position="right"
      :style="{ width: '90%', height: '100%' }"
    >
      <van-cell-group title="执行情况">
        <!-- 内容列表 -->
        <div class="con-list" @touchmove="showIndex = null">
          <van-cell-group
            inset
            v-for="(item, index) in buildingList"
            :key="index"
          >
            <van-row gutter="">
              <van-col span="16">{{ item.buildingName }}</van-col>
              <van-col
                span="8"
                :style="{
                  color:
                    item.status == 'wait'
                      ? '#F79648'
                      : item.status == 'finish'
                      ? '#03B615'
                      : '#FF041D'
                }"
                >{{
                  item.status == "wait"
                    ? "待评估"
                    : item.status == "finish"
                    ? "已完成"
                    : "已退回"
                }}</van-col
              >
            </van-row>

            <van-row>
              <van-col span="18">
                <van-row gutter="">
                  <van-col span="8">创 建 人:</van-col>
                  <van-col span="16">{{ item.createUserName }}</van-col>
                </van-row>

                <van-row gutter="">
                  <van-col span="8">处理人员:</van-col>
                  <van-col span="16">{{ item.workUserNames }}</van-col>
                </van-row>

                <van-row gutter="">
                  <van-col span="8">发起时间:</van-col>
                  <van-col span="16"
                    >{{ timestampToTimes(item.startTime) }}
                  </van-col>
                </van-row>
              </van-col>
              <van-col span="6">
                <van-row>
                  <van-button
                    type="info"
                    size="mini"
                    @click="todetail(index, item)"
                    >查看详情</van-button
                  >
                </van-row></van-col
              >
            </van-row>
          </van-cell-group>
          <div
            style="
              width: 100%;
              text-align: center;
              font-size: 0.48rem;
              position: fixed;
              top: 30%;
            "
            v-if="buildingList['length'] == 0"
          >
            暂无数据
          </div>
        </div>
    </van-overlay>
      </van-cell-group>
    </van-popup>
    <!-- <van-overlay :show="showIndex">
   
      <div class="wrapper" @click.stop="showIndex = false">
        111
      </div>
    </van-overlay> -->
  </div>
</template>

@@ -59,9 +174,9 @@ import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table.js";
import { timestampToTime, generateId } from "@/utils/format";
export default {
  name: 'risk-execution',
  name: "risk-execution",
  components: {
    LHeader,
    LHeader
  },
  data() {
    return {
@@ -70,9 +185,9 @@ export default {
      isHaveNews: false,
      messageList: [
        {
          title: 'XX项目评估任务单',
          time: '2022-12-12',
          name: 'Mr.周',
          title: "XX项目评估任务单",
          time: "2022-12-12",
          name: "Mr.周",
          state: 1
        }
      ],
@@ -83,17 +198,18 @@ export default {
      tabs: [
        {
          title: "待评估",
          key: 'wait'
          key: "wait"
        },
        {
          title: "执行中",
          key: 'running'
          key: "running"
        },
        {
          title: "已完成",
          key: 'finish'
        },
          key: "finish"
        }
      ],
      buildingList: []
    };
  },
  created() {
@@ -101,32 +217,33 @@ export default {
  },
  methods: {
    timestampToTimes(time) {
      return timestampToTime(new Date(time), "DT2", true)
      return timestampToTime(new Date(time), "DT2", true);
    },
    handadd() {
      this.$router.push({
        name: "riskAdd",
        params: {
          title: '新增'
        },
      })
          title: "新增"
        }
      });
    },
    postList(name, title) {
      this.$toast.loading({
        message: "加载中...",
        forbidClick: true,
        loadingType: "spinner",
        duration: 0,
        duration: 0
      });
      let url = `/risk/plan/allocation/list?status=wait`
      let url = `/risk/plan/allocation/list?status=wait`;
      if (name == 0) {
        url = `/risk/plan/allocation/list?status=wait`
        url = `/risk/plan/allocation/list?status=wait`;
      } else if (name == 1) {
        url = `/risk/plan/allocation/list?status=running`
        url = `/risk/plan/allocation/list?status=running`;
      } else {
        url = `/risk/plan/allocation/list?status=finish`
        url = `/risk/plan/allocation/list?status=finish`;
      }
      getFun(url).then(res => {
      getFun(url)
        .then(res => {
          this.$toast.clear();
          this.messageList = res.data || res.rows;
          // 判断有无数据返回
@@ -143,9 +260,34 @@ export default {
    onSearch(val) {
      this.postList(this.searchValue);
    },
    //查看详情
    //执行情况
    lookdetail(index, item) {
      this.showIndex = true
      this.showIndex = true;
      console.log(item);
      getFun("/risk/plan/allocation/building/list/" + item.id)
        .then(res => {
          console.log(res);
          this.buildingList = res.data;
        })
        .catch(() => {
          this.$toast.clear();
          this.$toast.fail("加载失败,请稍后再试");
        });
    },
    //查看详情
    todetail(index, item) {
      this.showIndex = true;
      console.log(item);
      this.$router.push({
        name: "riskTaskList",
        params: {
          id: item.id,
          buildingId: item.buildingId
        }
      });
      sessionStorage.setItem("planId", item.id);
      sessionStorage.setItem("buildingId", item.buildingId);
      this.showIndex = null;
    },

    // 详情
@@ -153,8 +295,8 @@ export default {
      this.$router.push({
        name: "risk-big-detail",
        params: {
          id: data.businessId || data.id,
        },
          id: data.businessId || data.id
        }
      });
      this.showIndex = null;
    },
@@ -163,12 +305,12 @@ export default {
      this.$router.push({
        name: "risk-affirm",
        params: {
          data: data,
        },
          data: data
        }
      });
      this.showIndex = null;
    },
  },
    }
  }
};
</script>
<style lang="less" scoped>
@@ -200,4 +342,3 @@ export default {
  }
}
</style>
  
 No newline at end of file