Blame view

src/views/system/sqywgz/sqywDetail.vue 15.1 KB
1
<!--
yuanbo committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-10-13 13:38:21
5
-->
田浩浩 committed
6
<template>
7
  <div>
8
    <ul class="edit-title-list" v-if="djlxList.length > 0 ">
9 10
      <li v-for="(item, index) in djlxList" @click="handleTitleSelct(item, index)" :key="index"
        :class="{ active: index == tn }">
田浩浩 committed
11 12 13
        {{ item.nodename }}
      </li>
    </ul>
14 15 16 17
    <div class="contentBox">
      <el-form :model="form" v-show="n == 0" label-width="135px" ref="ruleForm">
        <el-row>
          <el-col :span="8">
18 19
            <el-form-item label="申请分类" v-if="form.sqdjyw">
              <el-select v-model="form.sqdjyw.sqfl" disabled placeholder="请选择" class="width100">
20
                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
21 22 23 24 25
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
26 27
            <el-form-item label="登记业务编码" v-if="form.sqdjyw">
              <el-input v-model="form.sqdjyw.djywbm" disabled></el-input>
28 29 30
            </el-form-item>
          </el-col>
          <el-col :span="8">
31 32
            <el-form-item label="登记业务名称" v-if="form.sqdjyw">
              <el-input v-model="form.sqdjyw.djywmc" disabled></el-input>
33 34 35 36 37
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
38
            <el-form-item label="发起业务单元类型" v-if="form.sqdjyw">
39 40 41
              <el-select v-model="form.sqdjyw.sqywdylx" placeholder="请选择" class="width100">
                <el-option v-for="item in sqywdylx" :key="item.dcode" :label="item.dname" :value="item.dcode">
                </el-option>
42 43 44 45
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
46 47
            <el-form-item label="是否启用" prop="enabled" v-if="form.sqdjyw">
              <el-radio-group v-model="form.sqdjyw.enabled">
48 49 50 51 52 53
                <el-radio label="1">启用</el-radio>
                <el-radio label="0">禁用</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8">
54 55 56 57 58 59 60
            <el-form-item label="是否效验土地确权" prop="enabled" v-if="form.sqdjyw">
              <el-radio-group v-model="form.sqdjyw.sfjytd">
                <el-radio label="1"></el-radio>
                <el-radio label="0"></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
61
        </el-row>
62 63
        <el-row>
          <el-col :span="8">
64 65
            <el-form-item label="业务流程ID" prop="flowid" v-if="form.sqdjyw">
              <el-input v-model="form.sqdjyw.flowid"></el-input>
66 67
            </el-form-item>
          </el-col>
68
          <el-col :span="16">
69 70
            <el-form-item label="流程参数" prop="flowparams" v-if="form.sqdjyw">
              <el-input v-model="form.sqdjyw.flowparams"></el-input>
赵千 committed
71 72
            </el-form-item>
          </el-col>
73 74 75
        </el-row>
        <el-row>
          <el-col :span="8">
76 77
            <el-form-item label="登记原因设置" prop="sfqydjyymb" v-if="form.sqdjyw">
              <el-radio-group v-model="form.sqdjyw.sfqydjyymb">
78 79 80 81 82 83 84
                <el-radio label="1">启用</el-radio>
                <el-radio label="0">禁用</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="登记情形及材料">
85
              <el-input v-model="form.fileUrl" placeholder="仅支持execl文件导入"></el-input>
86 87 88
            </el-form-item>
          </el-col>
          <el-col :span="1">
89
            <el-upload ref="upload" :action="imgUploadUrl" :limit="1" accept=".xls, .xlsx" :show-file-list="false"
90 91
              :before-upload="uploadRecord" :on-success="handleSuccess">
              <el-button type="primary" icon="el-icon-upload">上传材料</el-button>
92 93 94 95 96
            </el-upload>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
97 98
            <el-form-item label="登记原因模板" prop="djyy" v-if="form.sqdjyw">
              <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="form.sqdjyw.djyy">
99 100 101 102 103
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
104
      <el-collapse class="modifycollapse" accordion>
105
        <el-collapse-item title="权利信息" name="0" v-if="form.sqdjyw.sqfl=='2'">
renchao@pashanhoo.com committed
106
          <lb-table :column="qlxxCol" :pagination="false" heightNumSetting :minHeight="160" :data="form.djlx">
107 108 109
          </lb-table>
        </el-collapse-item>
        <el-collapse-item title="登记情形设置" name="1" v-if="form.sqdjyw.sqfl=='1'">
110
          <lb-table :column="djqxCol" :pagination="false" heightNumSetting :minHeight="160" :data="form.djqx">
111 112
          </lb-table>
        </el-collapse-item>
113
        <el-collapse-item title="材料信息设置" name="2">
114
          <lb-table :column="clxxList" :heightNumSetting="true" :minHeight="160"
115
            :pagination="false" :data="form.clxx">
116 117
          </lb-table>
        </el-collapse-item>
118
        <el-collapse-item title="筛选权利设置" name="3" v-if="form.sqdjyw && form.sqdjyw.sfsxql == '1'">
119 120 121
          <div class="dyztsd-title">
            <b>请勾选需要查询的权利信息</b>
            <div>
122
              <el-button type="text" @click="handleSelectall">选择全部
田浩浩 committed
123
              </el-button>
124 125 126 127 128 129
              <el-button type="text" @click="handleInvert">清除全部</el-button>
            </div>
          </div>
          <el-divider></el-divider>
          <ul class="qlxx-list">
            <li v-for="(item, index) in form.sxql" :key="index">
田浩浩 committed
130
              <el-checkbox v-model="item.checked">{{
131
                item.sxzdmc
田浩浩 committed
132
              }}</el-checkbox>
133 134 135
            </li>
          </ul>
        </el-collapse-item>
136
        <el-collapse-item title="办理状态设置" name="4">
137 138 139 140
          <ul class="screen-list">
            <li v-for="(item, index) in form.sxzt" :key="index">
              <div class="screen-list-left">
                {{ item.sxzdmc }}
田浩浩 committed
141
                <el-checkbox v-model="item.checked">禁止办理</el-checkbox>
142 143 144 145 146 147
              </div>
            </li>
          </ul>
        </el-collapse-item>
      </el-collapse>
    </div>
148
    <div slot="footer" class="dialog_footer text-center">
149
      <el-button @click="$popupCacel()">取 消</el-button>
150
      <el-button type="primary" @click="submit" :loading="loading">提 交</el-button>
田浩浩 committed
151
    </div>
152
  </div>
田浩浩 committed
153 154
</template>
<script>
155
  import { uploadUrl } from '@/api/file'
156 157
  import { getUuid } from "@/utils/operation.js"
  import { datas, sendThis } from "./sqywDetail";
158
  import { upward, down } from "@/utils/operation";
159
  import { getDjlxInfo, getSqdjywDetail, saveSqdjyw } from "@/api/sysSqdjyw.js";
160

161
  import store from '@/store/index.js'
162 163 164 165 166 167 168 169 170 171
  export default {
    name: "componentDialog",
    props: {
      formData: {
        type: Object,
        default: () => { }
      }
    },
    data () {
      return {
172
        loading: false,
173
        key: 0,
174 175 176
        tn: 0,
        n: 0,
        djlxList: [],
177
        sqywdylx: store.getters.dictData['sqywdylx'],
178
        options: [
179 180 181 182
          { label: "正常申请", value: "1" },
          { label: "一并申请", value: "2" },
          { label: "补录申请", value: "3" }
        ],
183 184 185 186
        imgUploadUrl: uploadUrl(),
        title: "",
        activeName: "1",
        form: {
187 188 189 190
          // bsmSqyw: '',
          // ywDetail: {},
          // djqx: [],
          // clxx: []
191 192
        },
        djqxCol: datas.djqxCol(),
193
        clxxList: [],
194
        clxxCol: datas.clxxCol(),
195
        ybsqClxxCol: datas.ybsqClxxCol(),
renchao@pashanhoo.com committed
196
        qlxxCol: datas.qlxxCol(),
197
      };
田浩浩 committed
198
    },
199
    created () {
200 201
      sendThis(this)
      this.init()
田浩浩 committed
202
    },
203 204 205 206 207 208 209 210 211 212
    watch: {
      'form.djlx': {
        handler (newName, oldName) {
          this.form.ywmcList = this.form.djlx.map(item => ({ nodename: item.djywmc + '+' + item.nodename, bsmSqyw: item.bsmSqyw }))
        },
        // 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
        immediate: true,
        deep: true
      }
    },
213 214
    methods: {
      //页面初始化
yuanbo committed
215 216 217 218
      /**
       * @description: 页面初始化
       * @author: renchao
       */
219 220
      init () {
        this.tn = 0;
221 222
        if (this.formData.sqfl == "2") {
          this.getDetail(this.formData.bsmSqyw);
223
          this.clxxList = this.ybsqClxxCol
224
        } else {
225
          this.clxxList = this.clxxCol
226 227 228 229 230 231 232 233 234 235
          getDjlxInfo(this.formData.bsmSqyw).then((res) => {
            let { result } = res;
            this.djlxList = result ? result : [];
            if (this.djlxList.length > 0) {
              this.getDetail(this.djlxList[0].bsmSqyw);
            } else {
              this.getDetail(this.formData.bsmSqyw);
            }
          })
        }
236
      },
yuanbo committed
237 238 239 240
      /**
       * @description: orderNoChange
       * @author: renchao
       */
241 242 243
      orderNoChange () {
        this.$forceUpdate();
      },
yuanbo committed
244 245 246 247 248
      /**
       * @description: uploadRecord
       * @param {*} file
       * @author: renchao
       */
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
      uploadRecord (file) {
        this.requested = true
        this.files = file;
        const extension = file.name.split('.')[1] === 'xls'
        const extension2 = file.name.split('.')[1] === 'xlsx'
        const isLt5M = file.size / 1024 / 1024 < 5
        if (!extension && !extension2) {
          this.$message.warning('上传模板只能是 xls、xlsx格式!')
          this.requested = false
        }
        if (!isLt5M) {
          this.$message.warning('上传模板大小不能超过 5MB!')
          this.requested = false
        }
        return (extension || extension2) && isLt5M
      },
yuanbo committed
265 266 267 268
      /**
       * @description: handleSuccess
       * @author: renchao
       */
269 270
      handleSuccess () { },
      //tab选项卡事件
yuanbo committed
271 272 273 274 275 276
      /**
       * @description: tab选项卡事件
       * @param {*} obj
       * @param {*} index
       * @author: renchao
       */
277 278 279 280 281
      handleTitleSelct (obj, index) {
        this.n = 0;
        this.tn = index;
        this.getDetail(this.djlxList[index].bsmSqyw);
      },
yuanbo committed
282 283 284 285 286
      /**
       * @description: 获取业务具体明细内容
       * @param {*} bsmSqyw
       * @author: renchao
       */
287
      getDetail (bsmSqyw) {
288
        let that = this
289 290
        getSqdjywDetail(bsmSqyw).then((res) => {
          if (res.code === 200) {
291
            this.form = res.result;
292
            console.log(this.form.clxx);
293
            if (that.formData.sqfl == "2") {
294
              that.form.ywmcList = that.form.djlx.map(item => ({ nodename: item.djywmc + '+' + item.nodename, bsmSqyw: item.bsmSqyw }))
295
            }
296 297 298 299 300 301 302 303 304
            // _this.form.bsmSqyw = res.result.bsmSqyw;
            // _this.form.ywDetail = res.result.ywDetail;
            // _this.$set(_this.form, 'djqx', res.result.djqx);
            // _this.$set(_this.form, 'sxql', res.result.sxql);
            // _this.$set(_this.form, 'clxx', res.result.clxx);
            // _this.$set(_this.form, 'sxzt', res.result.sxzt);
            // _this.$set(_this.form, 'ywDetail', res.result.ywDetail);
            // _this.$set(_this.form, 'sqdjyw', res.result.sqdjyw);
            // _this.$set(_this.form, 'parentRule', res.result.parentRule);
305
          } else {
306
            this.$alert(res.message)
307
          }
308
        })
309
      },
yuanbo committed
310 311 312 313
      /**
       * @description: 提交保存数据
       * @author: renchao
       */
314 315
      submit () {
        let that = this;
316
        this.loading = true
317
        saveSqdjyw(this.form).then((res) => {
318
          this.loading = false
319 320 321
          if (res.code == 200) {
            that.$message({
              message: "修改成功",
322
              type: "success"
323 324 325
            });
            this.$popupCacel()
          }
326 327
        }).catch(() => {
          this.loading = false
328
        })
329
      },
330 331 332 333 334 335 336
      // 筛选权利设置
      handleSelectall () {
        this.form.sxql.forEach(item => item.checked = true)
      },
      handleInvert () {
        this.form.sxql.forEach(item => item.checked = false)
      },
yuanbo committed
337 338 339 340 341 342 343
      /**
       * @description: 上移下移
       * @param {*} index
       * @param {*} row
       * @param {*} type
       * @author: renchao
       */
344 345 346
      moveUpward (index, row, type) {
        if (type == "clxx") {
          upward(index, this.form.clxx);
田浩浩 committed
347
        } else {
348
          upward(index, this.form.djlx);
田浩浩 committed
349
        }
350
      },
yuanbo committed
351 352 353 354 355 356 357
      /**
       * @description: moveDown
       * @param {*} index
       * @param {*} row
       * @param {*} type
       * @author: renchao
       */
358 359 360 361
      moveDown (index, row, type) {
        if (type == "clxx") {
          down(index, this.form.clxx);
        } else {
362
          down(index, this.form.djlx);
363
        }
364
      },
yuanbo committed
365 366 367 368
      /**
       * @description: addDjqx
       * @author: renchao
       */
369 370
      addDjqx () {
        this.form.djqx.push({
371
          bsmSqyw: getUuid(32),
372 373 374 375 376 377 378
          nodecode: "",
          nodename: "",
          enabled: "1",
          djyy: "",
          sfqydjyymb: "0",
        });
      },
yuanbo committed
379 380 381 382 383 384
      /**
       * @description: removeDjqx
       * @param {*} index
       * @param {*} row
       * @author: renchao
       */
385 386 387
      removeDjqx (index, row) {
        this.form.djqx.splice(index, 1);
      },
yuanbo committed
388 389 390 391
      /**
       * @description: addClxx
       * @author: renchao
       */
392 393 394 395 396 397 398 399 400 401
      addClxx () {
        this.form.clxx.push({
          isrequired: "1",
          djqxbm: "",
          clbm: "",
          clmc: "",
          cllx: "",
          sfggcl: "1",
        });
      },
yuanbo committed
402 403 404 405 406 407
      /**
       * @description: removeClxx
       * @param {*} index
       * @param {*} row
       * @author: renchao
       */
408 409
      removeClxx (index, row) {
        this.form.clxx.splice(index, 1);
410 411 412
      }
    }
  }
田浩浩 committed
413 414
</script>
<style lang='scss' scoped>
415 416 417 418
  @import "~@/styles/mixin.scss";
  @import "~@/styles/dialogBox.scss";
  @import "~@/styles/collapse.scss";
  @import "~@/styles/dialogBoxheader.scss";
419

420 421 422 423
  .contentBox {
    height: 75vh;
    overflow-y: scroll;
  }
424 425 426 427 428 429
  /deep/.el-radio__label {
    display: inline-block !important;
  }
  /deep/.el-radio {
    margin-right: 5px;
  }
430 431 432 433 434 435 436
  .el-radio-group {
    white-space: nowrap;
  }
  .form {
    background: #eee;
    padding: 0 10px;
  }
437

438 439
  .edit-title-list {
    @include flex;
田浩浩 committed
440

441 442 443 444 445 446 447 448
    li {
      flex: 1;
      @include flex-center;
      border: 1px solid $borderColor;
      line-height: 36px;
      margin-bottom: 10px;
      cursor: pointer;
      transition: all 0.3s;
田浩浩 committed
449

450 451 452
      &:hover {
        @extend .active;
      }
田浩浩 committed
453 454
    }
  }
田浩浩 committed
455

456 457 458
  .active {
    background: $light-blue !important;
    color: #fff;
田浩浩 committed
459 460
  }

461
  .dyztsd-title {
田浩浩 committed
462 463
    @include flex;
    align-items: center;
464
    justify-content: space-between;
田浩浩 committed
465 466 467
    padding-left: 20px;
  }

468 469 470 471 472 473 474 475 476
  .qlxx-list {
    @include flex;
    flex-wrap: wrap;
    padding-left: 20px;

    li {
      width: 25%;
      margin-bottom: 15px;
    }
田浩浩 committed
477 478
  }

479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
  .screen-list {
    @include flex;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid $borderColor;
    border-bottom: none;

    li {
      @include flex;
      align-items: center;
      width: 25%;
      line-height: 50px;
      border-bottom: 1px solid $borderColor;
      padding-left: 20px;
    }

    &-left {
      margin-right: 20px;
      width: 160px;
      white-space: nowrap;
    }

    li:nth-child(odd) {
      border-right: 1px solid $borderColor;
    }
田浩浩 committed
504
  }
505
</style>