Blame view

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

76 77 78 79 80
  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";
  // 登记簿数据信息
xiaomiao committed
81
  import { addRepairRecord } from "@/api/djbRepair.js";
82
  // 获取权利类型数组
83

84
  import { getBdcqljqtsx } from "@/api/djbDetail.js";
85 86 87 88 89 90
  export default {
    components: {
      selectBdc,
      NoticeBar,
      ordinaryMenu,
      qllxDailog,
xiaomiao committed
91
    },
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
    mixins: [WorkFlow],
    data () {
      return {
        bsmSlsq: this.$route.query.bsmSlsq,
        //当前流程所在环节
        bestepid: this.$route.query.bestepid,
        //设置那个表单选中
        tabName: "",
        isEdit: true,
        // 弹框显示
        dialogVisible: true,
        //表单集合
        tabList: [],
        //选择加载哪一个组件
        componentTag: "",
        //设置表单传递数据
        currentSelectProps: {},
        // 首次拿到的业务信息
        oneSelectProps: {},
        //材料信息选择卡索引
        oneget: true,
        //页面监听时间
        _beforeUnload_time: "",
        treedata: {},
        tabdata: [],
xiaomiao committed
117
        bsmRepair:"",
118
        defaultNode: {},
xiaomiao committed
119 120 121 122 123
          clxxForm: "",
        //材料信息选择卡索引
        clxxIndex: "",
        //材料信息选项卡对象
        clxxTab: {},
xiaomiao committed
124
        ableOperation:false
125
      };
126
    },
127 128
    mounted () {
      // this.getleftMenubl()
xiaomiao committed
129
    },
130 131

    methods: {
yuanbo committed
132 133 134 135 136
      /**
       * @description: stepForm
       * @param {*} qllx
       * @author: renchao
       */
137 138 139 140 141 142 143
      stepForm (qllx) {
        this.oneSelectProps.qllx = qllx;
        if (this.$refs.Menu.supplementarylist.length) {
          getStepFormInfo(this.oneSelectProps).then((res) => {
            this.$nextTick(function () {
              this.tabList = res.result;
              this.tabName = this.tabList[0].value;
xiaomiao committed
144
                this.ableOperation=this.tabList[0].ableOperation
145
              this.getFromRouter(this.tabName);
xiaomiao committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159

               if(this.tabList.length!=8){
                   let that = this;
                   this.tabList.forEach(function (item, index) {
                if (item.value == "clxx") {
                  that.clxxIndex = index;
                  that.clxxForm = getForm(item.value, that.$route.query.sqywbm);
                  that.clxxTab = item;
                }
              })
               }



xiaomiao committed
160
            });
xiaomiao committed
161 162 163 164




xiaomiao committed
165
          });
xiaomiao committed
166
        }
167
      },
xiaomiao committed
168

169
      // 获取右侧选项卡
yuanbo committed
170 171 172 173 174
      /**
       * @description: 获取右侧选项卡
       * @param {*} val
       * @author: renchao
       */
175
      getCurrentSelectProps (val) {
xiaomiao committed
176
       this.bsmRepair= val.bsmRepair
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
        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);
        }
      },
      // 获取渲染登记簿列表
yuanbo committed
192 193 194 195
      /**
       * @description: 获取渲染登记簿列表
       * @author: renchao
       */
196 197 198 199 200 201
      getdjblist () {
        getBdcqljqtsx({
          bdcdyid: this.currentSelectProps.bdcdyid,
          bdcdyh: this.currentSelectProps.bdcdyh,
        }).then((res) => {
          if (res.code === 200) {
xiaomiao committed
202
            this.treedata = loadTreeData(res.result);
203 204 205 206 207
            this.$nextTick(function () {
              this.defaultNode = getNode(this.currentSelectProps.qllx, {
                linShi: 0,
                xianShi: 0,
                liShi: 0,
xiaomiao committed
208
              });
209
              this.tabName = this.defaultNode.id; //data[0].id为默认选中的节点
xiaomiao committed
210
            });
211 212 213 214 215 216 217 218
            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;
xiaomiao committed
219
            });
220
            this.tabList = this.tabdata;
xiaomiao committed
221
          }
xiaomiao committed
222
        });
223 224
      },
      //右侧表单选项卡事件
yuanbo committed
225 226 227 228 229
      /**
       * @description: 右侧表单选项卡事件
       * @param {*} activeName
       * @author: renchao
       */
230 231 232 233
      beforeLeave (activeName) {
        if (activeName && activeName != 0) this.getFromRouter(activeName);
      },
      //切换选项卡内容组件
yuanbo committed
234 235 236 237 238
      /**
       * @description: 切换选项卡内容组件
       * @param {*} tabname
       * @author: renchao
       */
239 240 241
      getFromRouter (tabname) {
        this.componentTag = getForm(tabname);
      },
xiaomiao committed
242 243 244 245 246 247 248
      // 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);
      //   this.tabName = this.tabList[0].value
      // },
249
      // 增加补录记录
yuanbo committed
250 251 252 253 254 255
      /**
       * @description: 增加补录记录
       * @param {*} row
       * @param {*} del
       * @author: renchao
       */
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
      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";
          }
          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: "补录成功!",
                });
              });
            } else {
              this.$alert(res.message, "提示", {
                confirmButtonText: "确定",
                type: "warning",
              });
            }
          })
          .catch((res) => {
            console.log("错", res);
          })
      },
xiaomiao committed
295 296 297 298 299 300 301 302 303
      // openDialog () {
      //   this.$store.dispatch('user/refreshPage', false)
      //   let data = JSON.parse(localStorage.getItem('ywbl'))
      //   let title
      //   if (data?.sqywmc) {
      //     title = "申请业务:" + data?.sqywmc
      //   } else {
      //     title = "申请业务:" + data?.djywmc
      //   }
304

xiaomiao committed
305 306
      //   this.$popupDialog(title, "ywbl/ywsq/selectBdc", { 'djywbm': this.$route.query.sqywbm, 'isJump': true, 'sqywInfo': data }, "80%", true)
      // }
307 308
    }
  };
309
</script>
xiaomiao committed
310
<style scoped lang="scss"></style>