首页 > 其他分享 >移动端步骤2

移动端步骤2

时间:2024-05-10 14:12:39浏览次数:22  
标签:seeSure formBase 步骤 break item query 移动 true

 

<template>
  <!-- 新计划预约 -->
  <div class="wh main bgf" style="background-color: #f4f7f7">
    <div class="header w">
      <van-row>
        <van-col @click="backFn" span="7" class="f18 pl10 cor3 flexa"
          ><van-icon name="arrow-left" class="cor3" />返回</van-col
        >
        <van-col span="10" class="f16 tc">
          <span>当班主任复核</span>
        </van-col>
      </van-row>
    </div>

    <div class="content bxs w">
      <div class="bdr10 bxs ml10 mr10">
        <div class="pt50 mt10 f14 cor3" v-if="stepList && stepList.length">
          <!-- :style="{
              opacity: item.status == 1 ? 0.7 : 1,
            }" -->
          <div class="step-item" v-for="(item, index) in stepList" :key="index">
            <div class="item-left">
              <div
                class="item-index"
                :style="{ backgroundColor: setColor(item.status, index)[0] }"
              >
                <span v-if="item.status == 1 || item.status == 2"></span>
                <span v-if="item.status == 4">
                  <i class="iconfont icon-ticketgou1"></i>
                </span>
                <span v-if="item.status == 3">
                  <i class="iconfont icon-ticketshanchu2"></i>
                </span>
              </div>
              <div
                :class="{
                  activeLine: stepList[index + 1].status != 1,
                }"
                v-if="index != stepList.length - 1"
                class="item-line"
              ></div>
              <!-- :style="{ backgroundColor: setColor(item.status, index)[0] }" -->
            </div>
            <div
              class="item-right pl10"
              :style="{
                opacity: item.status == 1 ? 0.7 : 1,
              }"
            >
              <div
                class="cor9"
                :style="{ color: setColor(item.status, index)[1] }"
              >
                <!-- <div>{{ item.dictLabel }}</div>
                <div class="f12 cor9">{{ item.remark }}</div> -->
                <div>xxxx</div>
                <div class="f12 cor9">xxxx</div>
              </div>
              <div class="index-btn">
                <van-button
                  type="info"
                  class="mr10"
                  size="mini"
                  @click="nextStep(item, index)"
                  :style="{
                    backgroundColor: setColor(item.status, index)[0],
                    border: 0,
                  }"
                  v-if="item.status != 1 && item.index != 3"
                >
                  <template v-if="item.status == 4">
                    <span>详情</span>
                  </template>
                  <template v-else>
                    <span v-if="index == 3">去确定</span>
                    <span v-else-if="index == 4">去化验</span>
                    <span v-else-if="index == 5">去计量</span>
                    <span v-else>点击录入</span>
                  </template>
                </van-button>
                <van-button
                  type="info"
                  class="mr10"
                  size="mini"
                  @click="nextStep(item, index)"
                  :style="{
                    backgroundColor: setColor(item.status, index)[0],
                    border: 0,
                  }"
                  v-if="item.index == 3 && item.status == 3"
                >
                  <span>去修改</span>
                </van-button>
                <van-button
                  type="info"
                  class="mr10"
                  size="mini"
                  @click="checkCarNo(item, index)"
                  :style="{
                    backgroundColor: setColor(item.status, index)[0],
                    border: 0,
                  }"
                  v-if="item.index == 3 && item.status == 2"
                >
                  <span>点击校验</span>
                </van-button>
                <van-button
                  type="info"
                  class="mr10"
                  size="mini"
                  :style="{
                    backgroundColor: setColor(item.status, index)[0],
                    border: 0,
                  }"
                  v-if="item.index == 3 && item.status == 4"
                >
                  <span>校验通过</span>
                </van-button>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="p10">
        <div class="flexa bgf p10 box">
          <div class="f14 mr10">当班主任签字</div>
          <div>
            <van-button type="info">签字</van-button>
          </div>
        </div>
      </div>
    </div>
    <!-- 底部按钮 -->
    <div class="footer flexsa bxs tc w" v-if="!seeSure">
      <van-button
        type="info"
        style="width: 80%"
        class="mr10"
        @click="startWorkSureFn"
        :disabled="isDisabled"
        >提交</van-button
      >
    </div>
  </div>
</template>
<script>
import { mapState, mapMutations, mapActions } from "vuex";
import {
  saveBeforeWork,
  getBeforeWork,
  checkSlot,
} from "@/api/workRail/workRail";
import { createWorkFPSOplan } from "@/api/oneTwo/workFPSO/workFPSO";
export default {
  name: "workRailStartWork",
  components: {},
  data () {
    return {
      formBase: {},
      curIndex: 0,
      stepList: [],
      seeSure: false,
      isDisabled: true,
    };
  },
  computed: {
    // ...mapState("workRailStartWork", ["stepListCopy", "curIndexCopy"]),
  },
  filters: {},

  created () {
    console.log(this.$sysDicts);
    console.log(this.stepListCopy);

    if (this.$route.query.formBase) {
      this.formBase = JSON.parse(this.$route.query.formBase);
    }
    if (
      this.$route.query.seeSure === true ||
      this.$route.query.seeSure === "true"
    ) {
      this.seeSure = true;
    }
    // this.formatStepList();
    this.getBeforeWork();
  },
  mounted () { },

  methods: {
    ...mapMutations("workRailStartWork", ["SAVE_STEPLIST"]),
    ...mapActions("workRailStartWork", ["saveData"]),
    // 复核
    reviewFn () {

      this.nextStep('', 6)
    },
    async checkCarNo (item, index) {
      const res = await checkSlot({
        planId: this.$route.query.planInfoId,
        frontWorkIndex: 3,
      });
      if (res.data == 200) this.getBeforeWork();
    },
    // 开始接卸
    async startWorkSureFn (oilTankNoBase) {
      let userDepartmentObj = JSON.parse(
        localStorage.getItem("userDepartmentObj")
      );
      let orgId = userDepartmentObj.belongToCompanyId;
      let orgName = userDepartmentObj.belongToCompanyName;
      let oilTankNo = null; //进油罐号
      // if (oilTankNoBase) {
      //   // 弹框选中的进油罐
      //   oilTankNo = oilTankNoBase;
      // } else {

      // 开始接卸按钮 点击
      // if (this.formBase.oilIntake.length == 1) {
      //   // 只有一个进油罐
      //   oilTankNo = this.formBase.oilIntake[0].oilTankNo;
      // } else {
      //   if (this.formBase.bizStatus == '1004') {
      //     this.showAllWare = true;
      //     return;
      //   } else {
      //     oilTankNo = this.formBase.oilIntake[0].oilTankNo;
      //   }

      // }
      // }

      let datVal = {
        planInfoId: this.formBase.id,
        orgId,
        orgName,
        bizType: 3,
        // oilTankNo: oilTankNo,
      };
      // this.formBase.oilIntake
      console.log(datVal);
      // return;
      this.$toast.loading({
        duration: 0,
        forbidClick: true,
        mask: true,
        message: "请稍等...",
      });
      // return
      const result = await createWorkFPSOplan(datVal);
      this.$toast.clear();
      if (result.code == 200) {
        this.$router
          .replace({
            name: "startWork",
            query: {
              planInfoId: this.formBase.id,
              fromType: "workRailPlanDetail",
              stypObj: JSON.stringify(result.data),
              warehouseStationId: this.formBase.pickupUnitId,
            },
          })
          .catch((error) => {
            console.log(error);
          });
      }
    },
    formatStepList () {
      let dict = this.$sysDicts["railway_oil_recovery_plan_front_work"];
      console.log(dict);
      this.stepList = dict.map((val) => {
        let { dictLabel, dictValue, remark } = val;
        return {
          dictLabel,
          index: dictValue,
          status: 1,
          remark,
        };
      });
      console.log(this.stepList);
    },
    setColor (status, index) {
      switch (status) {
        case 1:
          return ["#E0E5F7", "#bfbfbf"];
          break;
        case 2:
          return ["#2e7cf9", "#333"];
          break;
        case 4:
          return ["#4caf5f", "#4caf5f"];
          break;
        case 3:
          return ["#e65b54", "#e65b54"];
          break;
        default:
          return ["#e7e7e7", "#bfbfbf"];
          break;
      }
    },
    backFn () {
      this.$router.back();
    },
    async saveBeforeWork () {
      const res = await saveBeforeWork({
        planId: this.$route.query.planInfoId,
        frontWorkList: this.stepList,
      });
    },
    async getBeforeWork () {
      const res = await getBeforeWork({
        planId: this.$route.query.planInfoId,
      });
      if (res.code == 200) {
        this.stepList = res.data.list;
        if (
          this.stepList &&
          this.stepList.length &&
          this.stepList[this.stepList.length - 1].status == 4
        )
          this.isDisabled = false;
        if (this.$sysDicts) {
          let dict = this.$sysDicts["railway_oil_recovery_plan_front_work"];
          console.log(dict);
          this.stepList = dict.map((val, i) => {
            let { dictLabel, dictValue, remark } = val;
            let { status, index } = res.data.list[i];
            return {
              dictLabel,
              index,
              status,
              remark,
            };
          });
          console.log(this.stepList);
        }
      }
    },
    downStep () { },
    nextStep (item, index) {
      let name = "";
      let query = {
        planInfoId: this.$route.query.planInfoId,
        formBase: this.$route.query.formBase, //计划详情
        seeSure: this.$route.query.seeSure, //是否查看
      };

      switch (index) {
        case 0:
          // 中控室录入
          name = "workRailPlanStepCenter";
          query.type = 1;
          query.fromType = "ZKSLR";
          query.frontWorkIndex = "1";
          if (item.status > 2) query.seeSure = true;
          break;
        case 1:
          // 现场录入
          name = "workRailPlanStepScene";
          query.type = 2;
          query.fromType = "XCLR";
          query.frontWorkIndex = "2";
          if (item.status > 2) query.seeSure = true;
          break;
        case 2:
          // 车号校验
          name = "workRailPlanStepModify";
          query.type = 3;
          query.fromType = "JYJG";
          break;
        case 3:
          name = "workRailPlanStepOilcenter";
          query.frontWorkIndex = "4";
          if (item.status > 2) query.seeSure = true;
          // 确定进油罐
          break;
        case 4:
          // 油品入库采样化验
          name = "workRailPlanStepOilstore";
          query.frontWorkIndex = "5";
          if (item.status > 2) query.seeSure = true;
          break;
        case 5:
          //油品计量
          name = "workRailPlanStepOilmeter";
          query.fromType = "YPJL";
          query.frontWorkIndex = "6";
          // query.seeSure = true;
          if (item.status > 2) query.seeSure = true;
          break;
        case 6:
          //当班主任复核
          name = "workRailPlanStepReview";
          // query.fromType = "YPJL";
          query.frontWorkIndex = "7";
          // query.seeSure = true;
          // if (item.status > 2) query.seeSure = true;
          break;
        default:
          break;
      }

      this.$router.push({
        name,
        query,
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.activeLine {
  background-color: #2e7cf9 !important;
}
.red {
  color: #e65b54;
  background-color: #e65b54;
}
.green {
  color: #4caf5f;
  background-color: #4caf5f;
}

.step-item {
  display: flex;
  justify-content: flex-start;
  .item-left {
    width: 40px;
    .item-index {
      margin: -1px auto;
      width: 18px;
      height: 18px;
      line-height: 18px;
      text-align: center;
      font-size: 16px;
      color: #fff;
      background-color: #2e7cf9;
      border-radius: 50%;
      position: relative;
      z-index: 10;
      transform: scale(1.2);
    }
    .item-line {
      margin: 0 auto;
      width: 8px;
      height: 60px;
      background-color: #e0e5f7;
      // background-color: #eaeaea;
    }
  }
  .item-right {
    flex: 1;
    display: flex;
    justify-content: space-between;
    position: relative;
    top: -20px;
    height: 60px;
    background-color: #fff;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 8px;
  }
}

.main {
  position: relative;
  .header {
    // height: 50px;
    line-height: 50px;
    position: fixed;
    background: #fff;
    top: 0;
    left: 0;
    z-index: 100;
  }
  .content {
    height: calc(100%);
    background: #f5f8f8;
    padding-top: 50px;
    padding-bottom: 70px;
    overflow: auto;
    .contentTitle {
      background: #fff;
      height: 50px;
      border-bottom: 1px solid #ddd;
      div:nth-child(2) {
        line-height: 50px;
      }
      div:nth-child(3) {
        height: 16px;
        margin-top: 20px;
      }
    }
    .contentForm {
      .formList {
        background: #fff;
        border-bottom: 1px solid #ddd;
      }
    }
  }
  .formList \deep\ .van-field--error .van-field__control,
  .van-field--error .van-field__control::placeholder {
    color: #c8c9cc;
  }
  .footer {
    // height: 50px;
    padding: 5px 0;
    position: fixed;
    background: #fff;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    & > span {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .iconfont {
      font-size: 20px;
    }
  }
}
.index-btn {
  .van-button {
    width: 70px;
  }
}
</style>

 

标签:seeSure,formBase,步骤,break,item,query,移动,true
From: https://www.cnblogs.com/dianzan/p/18184187

相关文章

  • 使用Python进行数据分析的基本步骤和技巧
    ......
  • Vue的step步骤条的使用
    效果如下:代码:1、父组件<template><el-containerclass="container"><el-steps:active="active"finish-status="success"simplestyle="margin-top:20px;background-color:white;height:30px;width:34%"&g......
  • 移动端步骤1
       <template><!--新计划预约--><divclass="whmainbgf"style="background-color:#f4f7f7"><divclass="headerw"><van-row><van-col@click="backFn"span=&qu......
  • 学习python步骤
    参考链接:https://zhuanlan.zhihu.com/p/693208513一、Python基础学习Python语言基础的路线可以分为以下几个阶段:Python3入门:了解Python3的安装方法、如何运行Python程序以及交互模式的使用,同时学习注释的添加方法。数据类型:掌握Python中的各种数据类型,包括数字、布尔值、......
  • GCC编译C++步骤
    在使用GCC编译器编译多个源文件时,你需要将所有需要编译的源文件列出,并在命令行中将它们一起传递给GCC。GCC会将这些源文件编译成目标文件(.o文件),然后链接成最终的可执行文件或动态库。下面是一个示例命令行:bashCopycodeg++-cfile1.cppfile2.cppfile3.cpp在这个......
  • 中国移动光猫Fiberhome HG6145F获取超级管理员密码和解决第四号口不能用的问题
    第一步获取光猫MAC地址你看光猫背后就行了,如果没有,就用命令:arp-a192.168.1.1第二步开启telnet访问地址:http://192.168.1.1/cgi-bin/telnetenable.cgi?telnetenable=1&key=你的Mac地址,要求全大写如果成功,网页会显示:telnet开启第三步进入telnet地址还是在电脑用cmd输入:t......
  • 如何把多个文件(夹)向上移动1层(或多层)(在批量复制前或后进行)
    首先,需要用到的这个工具:度娘网盘提取码:qwu2蓝奏云提取码:2r1z 假定情况是,我要把下图里的4个文件夹内部的全部文件,合并到04的当前位置来(4个文件夹里面各有5个兔兔的图片)打开工具,切换到文件批量复制版块找到右下角的更多,点击,来设置上移的情况勾选“来源路径”向上......
  • 移动吉比特H5-9光猫获取超级管理员权限
    开启telnet权限先用普通用户账号进行正常登录后在浏览器打开下面链接http://192.168.1.1/usr=CMCCAdmin&psw=aDm8H%25MdA&cmd=1&telnet.gch,页面提示success表示开启telnet权限成功telnet进入光猫前提window电脑开启telnet权限CMD下输入telnet192.168.1.1依次输入账......
  • 如何把多个文件(夹)向下移动1层(在复制前或后进行)
    首先,需要用到的这个工具:度娘网盘提取码:qwu2蓝奏云提取码:2r1z 先看一下文件夹的结构,一共4个文件夹,1-4编号,每个里面都有兔兔的图片,作为操作说明(实际就按自己要处理的文件)打开工具,切换到“文件批量复制”的版块思路:先把4个文件夹拖入到“来源路径”里,整理一下,去掉1......
  • dataframe的构造,取值,赋值,移动,交集,并集,排序,打印,转List,导出csv
    一、构造  da=pd.read_csv(filepath_or_buffer='data.csv',sep='\t')  print(da)  datas=pd.DataFrame(da)2、直接赋值df=pd.DataFrame([[1.4,np.nan],[7,-4],[np.nan,np.nan],[0.75,-1.3]],index=[1,2,3,4],         columns=[......