ludc
2023-04-15 716ded9c48898ff8fb9e4a1872ccfe676c7f2f99
Source/UBCS-WEB/src/views/code/code.vue
@@ -1,89 +1,96 @@
<template>
  <basic-container>
  <basic-container style="height: 350px;">
    <!-- 编码规则信息展示区域 -->
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               v-model="form"
               ref="crud"
               :before-open="beforeOpen"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <!-- 表格内操作按钮 -->
      <template slot="menu" slot-scope="scope">
        <el-button type="text"
                   size="small"
                   icon="el-icon-edit"
                   v-show="scope.row.lcStatusText=='编辑中' ? true:false"
                   plain
                   @click="openEdit(scope.row)">编 辑
        </el-button>
        <el-button type="text"
                   size="small"
                   icon="iconfont iconicon_shakehands"
                   v-show="scope.row.lcStatusText=='编辑中' ? true:false"
                   plain
                   @click="enableOrDeactivatse(scope.row.oid,'release')">发 布
        </el-button>
        <el-button type="text"
                   size="small"
                   v-show="scope.row.lcStatusText=='已发布' ? true:false"
                   icon="iconfont iconicon_details"
                   plain
                   @click="enableOrDeactivatse(scope.row.oid,'disable')">停 用
        </el-button>
        <el-button type="text"
                   size="small"
                   v-show="scope.row.lcStatusText=='停用' ? true:false"
                   icon="iconfont iconicon_task_done"
                   plain
                   @click="enableOrDeactivatse(scope.row.oid,'enable')">启 用
        </el-button>
      </template>
      <!-- 表格左上方按钮区域 -->
      <template slot="menuLeft" slot-scope="scope">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   @click="handleDelete">删 除
        </el-button>
        <el-button size="small"
                   icon="el-icon-coin"
                   plain
                   @click="cloneCodeSetting">克 隆
        </el-button>
        <el-button size="small"
                   icon="el-icon-coine"
                   plain
                   @click="handleDelete">从其他规则中克隆码段
        </el-button>
        <el-button size="small"
                   icon="el-icon-notebook-1"
                   plain
                   @click="handleRange">使用范围
        </el-button>
        <el-button size="small"
                   icon="el-icon-notebook-2"
                   plain
                   @click="handleDelete">清空码值
        </el-button>
      </template>
    </avue-crud>
    <basic-container>
      <p style="margin-top: -12px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">编码规则</p>
      <avue-crud :option="optionRule"
                :table-loading="loading"
                :data="data"
                :page.sync="page"
                :permission="permissionList"
                v-model="form"
                ref="crud"
                :before-open="beforeOpen"
                @cell-click="loadBasic"
                @row-update="rowUpdate"
                @row-save="rowSave"
                @search-change="searchChange"
                @search-reset="searchReset"
                @selection-change="selectionChange"
                @current-change="currentChange"
                @size-change="sizeChange"
                @refresh-change="refreshChange"
                @on-load="onLoad">
        <!-- 表格内操作按钮 -->
        <template slot="menu" slot-scope="scope">
          <el-button type="text"
                    size="small"
                    icon="el-icon-edit"
                    v-show="scope.row.lcStatusText=='编辑中' ? true:false"
                    plain
                    @click="openEdit(scope.row)">编 辑
          </el-button>
          <el-button type="text"
                    size="small"
                    icon="el-icon-position"
                    v-show="scope.row.lcStatusText=='编辑中' ? true:false"
                    plain
                    @click="enableOrDeactivatse(scope.row.oid,'release')">发 布
          </el-button>
          <el-button type="text"
                    size="small"
                    v-show="scope.row.lcStatusText=='已发布' ? true:false"
                    icon="el-icon-video-pause"
                    plain
                    @click="enableOrDeactivatse(scope.row.oid,'disable')">停 用
          </el-button>
          <el-button type="text"
                    size="small"
                    v-show="scope.row.lcStatusText=='停用' ? true:false"
                    icon="el-icon-video-play"
                    plain
                    @click="enableOrDeactivatse(scope.row.oid,'enable')">启 用
          </el-button>
        </template>
        <!-- 表格左上方按钮区域 -->
        <template slot="menuLeft" slot-scope="scope">
          <el-button type="danger"
                    size="small"
                    icon="el-icon-delete"
                    plain
                    @click="handleDelete">删 除
          </el-button>
          <el-button size="small"
                    icon="icon-kelong"
                    plain
                    @click="cloneCodeSetting">克 隆
          </el-button>
          <el-button size="small"
                    icon="icon-lianjiekelong"
                    style="font-size: 12px;"
                    plain
                    @click="handleDelete">从其他规则中克隆码段
          </el-button>
          <el-button size="small"
                    icon="el-icon-s-help"
                    plain
                    @click="handleRange">使用范围
          </el-button>
          <el-button size="small"
                    icon="icon-qingkong"
                    plain
                    @click="handleDelete">清空码值
          </el-button>
        </template>
      </avue-crud>
    </basic-container>
    <!-- 对话框 -->
    <el-dialog title="编码规则使用范围"
               append-to-body
               :visible.sync="codeRangeSettingBox"
               width="800px">
                append-to-body
                :visible.sync="codeRangeSettingBox"
                width="800px">
      <avue-crud
              :option="dialogeOption" 
              :table-loading="dialogLoading"
@@ -92,21 +99,34 @@
    </el-dialog>
    <!-- 克隆对话框 -->
    <el-dialog title="克隆编码规则"
               append-to-body
               :visible.sync="cloneSettingBox"
               width="800px">
                append-to-body
                :visible.sync="cloneSettingBox"
                width="800px">
      <clone-code></clone-code>
    </el-dialog>
    <!-- 基础编码信息 -->
    <!-- 基础码段展示区域 -->
    <basic-container>
        <p style="margin-top: -12px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">码段管理</p>
        <avue-crud :option="optionBasic"
        :table-loading="loadingBasic"
        :data="basicData"
        :permission="permissionList"
        @refresh-change="refreshChange">
    </avue-crud>
    </basic-container>
  </basic-container>
</template>
<script>
  import {gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus} from "@/api/code/mdmrule";
  import option from "@/const/code/mdmrule";
  import { gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus } from "@/api/code/mdmrule";
  import { gridCodeBasicSec } from "@/api/code/codebasic";
  import optionBasic from "@/const/code/codebasic";
  import optionRule from "@/const/code/mdmrule";
  import {mapGetters} from "vuex";
export default {
    data() {
      return {
@@ -120,13 +140,21 @@
          total: 0
        },
        selectionList: [],
        option: option,
        //编码规则表格配置
        optionRule: optionRule,
        data: [],
        /*使用范围*/
        codeRangeSettingBox: false,
        /*克隆弹窗*/
        /*克隆按钮对话框控制*/
        cloneSettingBox: false,
        optionBasic: optionBasic,
        //基础码段展示
        basicData:[],
        loadingBasic: true,
        /*使用范围对话框控制*/
        codeRangeSettingBox: false,
        useRangeData: [],
        dialogLoading: true,
        /*使用范围对话框*/
@@ -173,6 +201,19 @@
      },
    },
    methods: {
      //点击出发加载基础码段信息
      loadBasic(row){
        this.loadingBasic = true;
        //console.log(row.oid);
        gridCodeBasicSec(1, -1, {"pkCodeRule":row.oid}).then(res => {
          const data = res.data.data;
          this.basicData = data.records;
          //console.log(this.basicData);
          this.loadingBasic = false;
        });
      },
      //查询使用范围
      handleRange(){
        if (this.selectionList.length === 0) {
@@ -332,6 +373,7 @@
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.loadBasic(data.records[0])
          this.selectionClear();
        });
      }
@@ -340,4 +382,7 @@
</script>
<style>
.icon-lianjiekelong {
  font-size: 12px;
}
</style>