Blame view

src/views/djbworkflow/workFrameView.vue 8.33 KB
xiaomiao committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-05-24 15:31:00
-->
<template>
  <div class="container">
    <!-- 顶部内容框 -->
    <div class="topButton">
      <!-- 左侧业务功能按钮 -->
      <ul>
        <li
          @click="operation(item)"
          v-for="(item, index) in leftButtonList"
xiaomiao committed
15 16
          :key="index"
        >
xiaomiao committed
17 18 19 20 21 22 23 24
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <ul>
        <li
          @click="operation(item)"
          v-for="(item, index) in rightButtonList"
xiaomiao committed
25 26
          :key="index"
        >
xiaomiao committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <!-- <NoticeBar
        class="NoticeBar"
        :noticeList="noticeList"
        v-if="noticeList.length > 0"
      /> -->
    </div>
    <!-- 内容框架 -->
    <div class="containerFrame">
      <!-- 左侧菜单栏 区分业务-->
      <ordinaryMenu ref="Menu" @getCurrentSelectProps="getCurrentSelectProps" />
      <div class="leftCon">
        <!-- 分屏左侧预览 -->
        <div v-if="splitScreen" class="splitScreen-con">
          <component :is="clxxForm" v-bind="currentSelectProps" :key="fresh" />
        </div>
        <!-- 表单内容区域 -->
        <div class="rightContainer">
xiaomiao committed
48 49 50 51 52
          <el-tabs
            v-model="tabName"
            :before-leave="beforeLeave"
            @tab-click="handleClick"
          >
xiaomiao committed
53 54 55 56
            <el-tab-pane
              :label="item.name"
              :name="item.value"
              v-for="item in tabList"
xiaomiao committed
57 58
              :key="item.value"
            >
xiaomiao committed
59 60 61 62 63
            </el-tab-pane>
          </el-tabs>
          <component
            :key="fresh"
            :is="componentTag"
xiaomiao committed
64 65
            v-bind="currentSelectProps"
          />
xiaomiao committed
66 67 68 69 70 71 72 73
        </div>
      </div>
    </div>
    <!-- 新增补录信息勾选权利类型 -->
    <qllxDailog ref="qllxlist" />
  </div>
</template>
<style scoped lang="scss">
xiaomiao committed
74 75
@import "~@/styles/mixin.scss";
@import "./workFrame.scss";
xiaomiao committed
76 77
</style>
<script>
xiaomiao committed
78 79 80 81 82 83 84 85 86 87 88 89 90
import WorkFlow from "./mixin/index";
import { getForm } from "./flowform";
import { getBlYbxStepFormInfo } from "@/api/workFlow.js";
import NoticeBar from "@/components/NoticeBar/index";
// import ProcessViewer from "./components/processViewer.vue";
// 引入左侧菜单
import { leftMenubl } from "@/api/djbRepair.js";
import ordinaryMenu from "./components/leftmenu/ordinaryMenu.vue";
import qllxDailog from "./djbBook/components/qllxDailog";
import selectBdc from "@/views/ywbl/ywsq/selectBdc.vue";
import { loadTreeData, getNode } from "./components/leftmenu/djbFrameData.js";
// 登记簿数据信息
import { addRepairRecord } from "@/api/djbRepair.js";
xiaomiao committed
91

xiaomiao committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
import { getBdcqljqtsx } from "@/api/djbDetail.js";
export default {
  components: {
    selectBdc,
    NoticeBar,
    ordinaryMenu,
    qllxDailog,
  },
  mixins: [WorkFlow],
  data() {
    return {
      bsmSlsq: this.$route.query.bsmSlsq,
      bestepid: this.$route.query.bestepid,
      bsmBusiness: this.$route.query.bsmBusiness,
      //设置那个表单选中
      tabName: "",
      // 弹框显示
      dialogVisible: true,
      isEdit: false,
      //表单集合
      tabList: [],
      type: "READ_ONLY",
      //选择加载哪一个组件
      componentTag: "",
      //设置表单传递数据
      currentSelectProps: {},
      // 首次拿到的业务信息
      oneSelectProps: {},
      //材料信息选择卡索引
      oneget: true,
      //页面监听时间
      _beforeUnload_time: "",
      treedata: {},
      bsmRepair: "",
      tabdata: [],
      defaultNode: {},
      ableOperation: false,
    };
  },
  mounted() {
    // this.getleftMenubl()
  },

  methods: {
    /**
     * @description: stepForm
     * @param {*} qllx
     * @author: renchao
     */
    stepForm(qllx) {
      this.oneSelectProps.qllx = qllx;
      if (this.$refs.Menu.supplementarylist.length) {
        this.oneSelectProps.type = this.type;
        getBlYbxStepFormInfo(this.oneSelectProps).then((res) => {
          this.$nextTick(function () {
            this.tabList = res.result;
            this.tabName = this.tabList[0].value;
            this.ableOperation = this.tabList[0].ableOperation;
            this.getFromRouter(this.tabName);
          });
        });
      }
154
    },
xiaomiao committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
    // 获取右侧选项卡
    /**
     * @description: 获取右侧选项卡
     * @param {*} val
     * @author: renchao
     */
    getCurrentSelectProps(val) {
      this.bsmRepair = val.bsmRepair;
      if (val.bdcdyid) {
        this.oneSelectProps = val;
      }
      this.currentSelectProps = val;
      if (this.currentSelectProps.bsmRepair) {
        this.stepForm(this.currentSelectProps.qllx);
      } else if (!this.oneget) {
        this.getdjblist();
      }
      if (this.oneget) {
        this.oneget = false;
        this.stepForm(this.currentSelectProps.qllx);
      }
xiaomiao committed
176
    },
xiaomiao committed
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
    // 获取渲染登记簿列表
    /**
     * @description: 获取渲染登记簿列表
     * @author: renchao
     */
    getdjblist() {
      getBdcqljqtsx({
        bdcdyid: this.currentSelectProps.bdcdyid,
        bdcdyh: this.currentSelectProps.bdcdyh,
      }).then((res) => {
        if (res.code === 200) {
          this.treedata = loadTreeData(res.result, this.bdcdyh);
          this.$nextTick(function () {
            this.defaultNode = getNode(this.currentSelectProps.qllx, {
              linShi: 0,
              xianShi: 0,
              liShi: 0,
xiaomiao committed
194
            });
xiaomiao committed
195
            this.tabName = this.defaultNode.id; //data[0].id为默认选中的节点
xiaomiao committed
196
          });
xiaomiao committed
197 198 199 200 201 202 203 204 205 206
          let settree = JSON.parse(JSON.stringify(this.treedata));
          this.tabdata = [
            ...settree,
            ...settree[1].children[0].children[0].children,
          ];
          this.tabdata.forEach((item, index, arr) => {
            arr[index].name = item.label;
            arr[index].value = item.id;
          });
          this.tabList = this.tabdata;
xiaomiao committed
207
        }
xiaomiao committed
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
      });
    },
    //选项卡切换事件
    /**
     * @description: 右侧表单选项卡事件
     * @param {*} handleClick
     * @author: renchao
     */
    handleClick(a) {
      let p = Object.keys(this.tabList[0]).filter(
        (item) => item == "ableOperation"
      );
      if (p) {
        this.ableOperation = this.tabList[a.index].ableOperation;
      }
    },
    //右侧表单选项卡事件
    /**
     * @description: 右侧表单选项卡事件
     * @param {*} activeName
     * @author: renchao
     */
    beforeLeave(activeName) {
      if (activeName && activeName != 0) this.getFromRouter(activeName);
    },
    //切换选项卡内容组件
    /**
     * @description: 切换选项卡内容组件
     * @param {*} tabname
     * @author: renchao
     */
    getFromRouter(tabname) {
      this.componentTag = getForm(tabname);
    },
    /**
     * @description: closefp
     * @author: renchao
     */
    closefp() {
      this.splitScreen = this.splitScreen ? false : true;
      this.$store.dispatch("app/set1tScreen", this.splitScreen);
      this.getFromRouter(this.tabList[0].value);
      this.clxxForm = getForm(this.tabList[1].value);
    },
    // 增加补录记录
    /**
     * @description: 增加补录记录
     * @param {*} row
     * @param {*} del
     * @author: renchao
     */
    addRepairRecord(row, del) {
      let from = {
        bsmQlxx: "",
        bsmSlsq: this.bsmSlsq,
        bsmSldy: this.currentSelectProps.bsmSldy,
        operate: "C",
        qllx: "",
      };
      if (row) {
        from.bsmQlxx = row.bsmQlxx;
        if (del) {
          from.operate = del;
        } else {
          from.operate = row.bsmQlxx ? "U" : "C";
xiaomiao committed
273
        }
xiaomiao committed
274 275 276 277 278 279 280 281 282 283 284
        from.qllx = row.qllx;
      }
      addRepairRecord(from)
        .then((res) => {
          if (res.code == "200") {
            this.$refs.qllxlist.dialogVisible = false;
            this.$nextTick(() => {
              this.$refs.Menu.getleftMenubl(res.result);
              this.$message({
                type: "success",
                message: "补录成功!",
xiaomiao committed
285 286
              });
            });
xiaomiao committed
287 288 289 290
          } else {
            this.$alert(res.message, "提示", {
              confirmButtonText: "确定",
              type: "warning",
xiaomiao committed
291 292
            });
          }
xiaomiao committed
293 294 295
        })
        .catch((res) => {
          console.log("错", res);
xiaomiao committed
296 297
        });
    },
xiaomiao committed
298 299
  },
};
xiaomiao committed
300 301
</script>
<style scoped lang="scss"></style>