XiaoRuby
2023-08-14 28243550e53fcdf0d8dc4d0dd20f8b35acb4f6ba
8-14-计量模块
已修改5个文件
已添加1个文件
2199 ■■■■■ 文件已修改
src/App.vue 348 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/laboratoryManagement.vue 829 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/measure/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/measurementManagement.vue 305 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 688 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -5,210 +5,210 @@
</template>
<script>
  export default {
    name: 'App',
    created() {
      // const changeFavicon = link => {
      //   let $favicon = document.querySelector('link[rel="icon"]');
      //   if ($favicon !== null) {
      //     $favicon.href = link;
      //   } else {
      //     $favicon = document.createElement("link");
      //     $favicon.rel = "icon";
      //     $favicon.href = link;
      //     document.head.appendChild($favicon);
      //   }
      // };
      // let icon = '../../../../../static/img/heisur/logo.png'; // å›¾ç‰‡åœ°å€
      // changeFavicon(icon); // åŠ¨æ€ä¿®æ”¹ç½‘ç«™å›¾æ ‡
    }
export default {
  name: "App",
  created() {
    // const changeFavicon = link => {
    //   let $favicon = document.querySelector('link[rel="icon"]');
    //   if ($favicon !== null) {
    //     $favicon.href = link;
    //   } else {
    //     $favicon = document.createElement("link");
    //     $favicon.rel = "icon";
    //     $favicon.href = link;
    //     document.head.appendChild($favicon);
    //   }
    // };
    // let icon = '../../../../../static/img/heisur/logo.png'; // å›¾ç‰‡åœ°å€
    // changeFavicon(icon); // åŠ¨æ€ä¿®æ”¹ç½‘ç«™å›¾æ ‡
  }
};
</script>
<style>
  /* @import url("../static/img/alifont/iconfont.css"); */
  @import url("//at.alicdn.com/t/c/font_4179845_enf3r8ak8d.css");
/* @import url("../static/img/alifont/iconfont.css"); */
@import url("//at.alicdn.com/t/c/font_4179845_lomzsmcvwfg.css");
  * {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-family: "微软雅黑";
  }
* {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-family: "微软雅黑";
}
  a {
    text-decoration: none;
  }
a {
  text-decoration: none;
}
  .router-link-active {
    text-decoration: none;
  }
.router-link-active {
  text-decoration: none;
}
  .el-scrollbar .el-scrollbar__bar {
    opacity: 1 !important;
  }
.el-scrollbar .el-scrollbar__bar {
  opacity: 1 !important;
}
  .el-select-dropdown__item span,.el-cascader-node__label{
    font-size: 0.8rem;
  }
.el-select-dropdown__item span,
.el-cascader-node__label {
  font-size: 0.8rem;
}
  .el-dialog{
    border-radius: 6px;
    overflow: hidden;
    margin: 0 !important;
  }
.el-dialog {
  border-radius: 6px;
  overflow: hidden;
  margin: 0 !important;
}
  .el-dialog__wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
  }
.el-dialog__wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}
  input::-webkit-input-placeholder,
  textarea::-webkit-input-placeholder {
    /* Chrome/Opera/Safari */
    color: #999 !important;
    font-size: 10px;
  }
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  /* Chrome/Opera/Safari */
  color: #999 !important;
  font-size: 10px;
}
  input::-moz-placeholder,
  textarea::-moz-placeholder {
    /* Firefox 19+ */
    color: #999 !important;
    font-size: 10px;
  }
input::-moz-placeholder,
textarea::-moz-placeholder {
  /* Firefox 19+ */
  color: #999 !important;
  font-size: 10px;
}
  input:-ms-input-placeholder,
  textarea:-ms-input-placeholder {
    /* IE 10+ */
    color: #999 !important;
    font-size: 10px;
  }
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  /* IE 10+ */
  color: #999 !important;
  font-size: 10px;
}
  input:-moz-placeholder,
  textarea:-moz-placeholder {
    /* Firefox 18- */
    color: #999 !important;
    font-size: 10px;
  }
input:-moz-placeholder,
textarea:-moz-placeholder {
  /* Firefox 18- */
  color: #999 !important;
  font-size: 10px;
}
  .el-message p{
    color: #666 !important;
    font-size: 12px;
  }
.el-message p {
  color: #666 !important;
  font-size: 12px;
}
  .el-message{
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 6px 10px;
    min-width: 0;
    border-radius: 6px;
  }
.el-message {
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 6px 10px;
  min-width: 0;
  border-radius: 6px;
}
  table{
    border-collapse:collapse;
  }
table {
  border-collapse: collapse;
}
  .el-popover{
    padding: 0;
  }
.el-popover {
  padding: 0;
}
  .el-popper .popper__arrow{
    display: none ;
  }
.el-popper .popper__arrow {
  display: none;
}
/**修改全局的滚动条*/
/**滚动条的宽度*/
::-webkit-scrollbar {
    width: 8px;
  width: 8px;
}
::-webkit-scrollbar-thumb {
    background-color: #bdbfc4;
    border-radius: 3px;
  background-color: #bdbfc4;
  border-radius: 3px;
}
/* å…¨å±€è¡¨æ ¼æ ·å¼ */
  .el-table th.el-table__cell ,
  .has-gutter .el-table__cell {
    background-color: #F0F1F5 !important;
    color: #333;
  }
  .has-gutter .el-table__cell .cell {
    font-size: 16px;
    font-weight: 500;
  }
   .cell {
    color:rgb(51, 51, 51);
    padding-left: 17px !important;
    font-size: 14px;
  }
  .cell span{
    font-size: 14px;
    font-weight: 400;
  }
  .el-table th.el-table__cell>.cell{
    font-size: 16px;
    font-weight: 400;
    color:rgb(51, 51, 51);
  }
.el-table th.el-table__cell,
.has-gutter .el-table__cell {
  background-color: #f0f1f5 !important;
  color: #333;
}
.has-gutter .el-table__cell .cell {
  font-size: 16px;
  font-weight: 500;
}
.cell {
  color: rgb(51, 51, 51);
  padding-left: 17px !important;
  font-size: 14px;
}
.cell span {
  font-size: 14px;
  font-weight: 400;
}
.el-table th.el-table__cell > .cell {
  font-size: 16px;
  font-weight: 400;
  color: rgb(51, 51, 51);
}
/* å…¨å±€åˆ†é¡µå™¨æ ·å¼ */
  .el-pager .number {
    font-size: 14px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin: 0 2px;
    color: #999;
    font-weight: 500;
  }
  .el-pager .number.active {
    background-color: #004EA2;
    color: #fff;
    border: 0;
  }
  /* å…¨å±€æ¨¡æ€æ¡†æ ·å¼ */
  .el-dialog__header{
    box-sizing: border-box;
    height: 56px;
    border-bottom: 1px solid rgb(238, 238, 238);
    padding: 0px;
    display: flex;
    align-items: center;
  }
  .el-dialog__header::before{
    content: '';
    display: inline-block;
    width: 4px;
    height: 30.24px;
    background: rgb(0, 95, 201);
    border-radius:10px;
    margin-left: 32px;
    margin-right: 8.5px;
  }
  .el-dialog__header .el-dialog__title{
    font-size: 16px !important;
  }
.el-pager .number {
  font-size: 14px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  margin: 0 2px;
  color: #999;
  font-weight: 500;
}
.el-pager .number.active {
  background-color: #004ea2;
  color: #fff;
  border: 0;
}
/* å…¨å±€æ¨¡æ€æ¡†æ ·å¼ */
.el-dialog__header {
  box-sizing: border-box;
  height: 56px;
  border-bottom: 1px solid rgb(238, 238, 238);
  padding: 0px;
  display: flex;
  align-items: center;
}
.el-dialog__header::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 30.24px;
  background: rgb(0, 95, 201);
  border-radius: 10px;
  margin-left: 32px;
  margin-right: 8.5px;
}
.el-dialog__header .el-dialog__title {
  font-size: 16px !important;
}
    .el-dialog__footer .el-button *{
        font-size: 14px !important;
    }
.el-dialog__footer .el-button * {
  font-size: 14px !important;
}
    .el-dialog__footer .el-button{
        height: 36px;
        border: 1px solid rgba(190, 190, 190, 0.44);
        box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
        padding: 0 14px;
    }
.el-dialog__footer .el-button {
  height: 36px;
  border: 1px solid rgba(190, 190, 190, 0.44);
  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
  padding: 0 14px;
}
    .el-button--primary{
        background: #004EA2;
    }
.el-button--primary {
  background: #004ea2;
}
    .el-dialog__body{
        padding: 15px 20px;
    }
.el-dialog__body {
  padding: 15px 20px;
}
    .el-input.is-disabled input{
        color: #666 !important;
        background-color: rgba(0, 0, 0, 0.05) !important;
    }
  /* å…¨å±€è¾“入框样式 */
  /* å…¨å±€æŒ‰é’®æ ·å¼ */
.el-input.is-disabled input {
  color: #666 !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
}
/* å…¨å±€è¾“入框样式 */
/* å…¨å±€æŒ‰é’®æ ·å¼ */
</style>
src/components/view/laboratoryManagement.vue
@@ -3,22 +3,44 @@
    <el-row>
      <el-col :span="12" class="top_left_name">实验室管理</el-col>
      <el-col :span="12" style="text-align: right;">
        <el-button @click="testItem()" type="primary" size="mini" icon="el-icon-plus" style="background: #004EA2; ">新增仪器设备</el-button>
        <el-button
          @click="testItem()"
          type="primary"
          size="mini"
          icon="el-icon-plus"
          style="background: #004EA2; "
          >新增仪器设备</el-button
        >
        <el-dialog
          title="新增仪器设备"
          :visible.sync="dialogVisible"
          width="750px"
          :before-close="handleClose">
          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
          :before-close="handleClose"
        >
          <el-form
            :model="ruleForm"
            :rules="rules"
            ref="ruleForm"
            label-width="130px"
            class="demo-ruleForm"
          >
            <el-row>
              <el-col :span="12">
                <el-form-item label="设备名称" prop="name">
                  <el-input placeholder="请输入仪器设备编号" style="width: 206px" clearable v-model="ruleForm.name"></el-input>
                  <el-input
                    placeholder="请输入仪器设备编号"
                    style="width: 206px"
                    clearable
                    v-model="ruleForm.name"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="设备用途" prop="type">
                  <el-select v-model="ruleForm.type" placeholder="请选择设备用途">
                  <el-select
                    v-model="ruleForm.type"
                    placeholder="请选择设备用途"
                  >
                    <el-option label="生产设备" value="1"></el-option>
                    <el-option label="检测设备" value="2"></el-option>
                  </el-select>
@@ -28,7 +50,13 @@
            <el-row>
              <el-col :span="12">
                <el-form-item label="父级分类">
                  <el-select v-model="value" @blur="productSelect" filterable allow-create placeholder="请选择父级分类">
                  <el-select
                    v-model="value"
                    @blur="productSelect"
                    filterable
                    allow-create
                    placeholder="请选择父级分类"
                  >
                    <el-option
                      v-for="list in parentClassificationList"
                      :key="list.index"
@@ -41,14 +69,22 @@
              </el-col>
              <el-col :span="12">
                <el-form-item label="仪器设备编号" prop="name">
                  <el-input placeholder="请输入仪器设备编号" style="width: 206px" clearable v-model="ruleForm.code"></el-input>
                  <el-input
                    placeholder="请输入仪器设备编号"
                    style="width: 206px"
                    clearable
                    v-model="ruleForm.code"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="保管人" prop="keeper">
                  <el-select v-model="ruleForm.keeper" placeholder="请选择保管人">
                  <el-select
                    v-model="ruleForm.keeper"
                    placeholder="请选择保管人"
                  >
                    <el-option
                      v-for="list in keeperList"
                      :key="list.index"
@@ -74,29 +110,62 @@
            <el-row>
              <el-col :span="12">
                <el-form-item label="设备状态" prop="deviceStatus" required>
                  <el-select v-model="ruleForm.deviceStatus" placeholder="请选择设备状态">
                    <el-option label="运行" style="color: #66c03b" value="1"></el-option>
                    <el-option label="报废" style="color: #ac9299" value="2"></el-option>
                    <el-option label="检修" style="color: #52d6c0" value="3"></el-option>
                    <el-option label="故障" style="color: #f36b6c" value="4"></el-option>
                    <el-option label="空闲" style="color: #fcb642" value="5"></el-option>
                  <el-select
                    v-model="ruleForm.deviceStatus"
                    placeholder="请选择设备状态"
                  >
                    <el-option
                      label="运行"
                      style="color: #66c03b"
                      value="1"
                    ></el-option>
                    <el-option
                      label="报废"
                      style="color: #ac9299"
                      value="2"
                    ></el-option>
                    <el-option
                      label="检修"
                      style="color: #52d6c0"
                      value="3"
                    ></el-option>
                    <el-option
                      label="故障"
                      style="color: #f36b6c"
                      value="4"
                    ></el-option>
                    <el-option
                      label="空闲"
                      style="color: #fcb642"
                      value="5"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="厂家" prop="factory" required>
                  <el-input style="width: 206px" placeholder="请输入厂家" clearable v-model="ruleForm.factory"></el-input>
                  <el-input
                    style="width: 206px"
                    placeholder="请输入厂家"
                    clearable
                    v-model="ruleForm.factory"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="检测项目" prop="rawInsProductId" required>
                  <el-select v-model="ruleForm.rawInsProductId" placeholder="请选择检测项目">
                    <el-option v-for="item in inspectionList"
                               :key="item.index"
                               :label="item.name"
                               :value="item.id">
                  <el-select
                    v-model="ruleForm.rawInsProductId"
                    placeholder="请选择检测项目"
                  >
                    <el-option
                      v-for="item in inspectionList"
                      :key="item.index"
                      :label="item.name"
                      :value="item.id"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
@@ -108,7 +177,8 @@
                      placeholder="检测样品"
                      :disabled="true"
                      style="width: 206px"
                      v-model="showCodeNameModel.name">
                      v-model="showCodeNameModel.name"
                    >
                    </el-input>
                  </el-form-item>
                </el-form-item>
@@ -121,7 +191,8 @@
                    placeholder="规格型号"
                    :disabled="true"
                    style="width: 206px"
                    v-model="showCodeNameModel.specifications">
                    v-model="showCodeNameModel.specifications"
                  >
                  </el-input>
                </el-form-item>
              </el-col>
@@ -131,7 +202,8 @@
                    placeholder="检测人"
                    :disabled="true"
                    style="width: 206px"
                    v-model="showCodeNameModel.user_name">
                    v-model="showCodeNameModel.user_name"
                  >
                  </el-input>
                </el-form-item>
              </el-col>
@@ -145,13 +217,24 @@
      </el-col>
    </el-row>
    <el-row class="left_row">
      <div :style="`width: ${isCollapse?300:0}px;transition: 1s;opacity: ${isCollapse?1:0};`" class="class_sidebar">
        <el-radio-group class="ai-tab-change" style="width: 270px; margin-top: 5px" v-model="radio1">
      <div
        :style="
          `width: ${isCollapse ? 300 : 0}px;transition: 1s;opacity: ${
            isCollapse ? 1 : 0
          };`
        "
        class="class_sidebar"
      >
        <el-radio-group
          class="ai-tab-change"
          style="width: 270px; margin-top: 5px"
          v-model="radio1"
        >
          <el-radio-button size="small" label="true">
            <div class="el_radio_button_div">生产设备</div>
            <div>生产设备</div>
          </el-radio-button>
          <el-radio-button size="small" label="false">
            <div class="el_radio_button_div">检测设备</div>
            <div>检测设备</div>
          </el-radio-button>
        </el-radio-group>
        <el-input
@@ -160,30 +243,57 @@
          placeholder="请输入分类名称"
          size="small"
        >
          <i slot="suffix" class="el-icon-search" style="font-size: 23px; padding: 5px 0;cursor:pointer;" @click="handlerDeptList"></i>
          <i
            slot="suffix"
            class="el-icon-search"
            style="font-size: 23px; padding: 5px 0;cursor:pointer;"
            @click="handlerDeptList"
          ></i>
        </el-input>
        <el-tree
          :data="towTree" ref="tree"
          :props="{children: 'children',label: 'father'}"
          :data="towTree"
          ref="tree"
          :props="{ children: 'children', label: 'father' }"
          node-key="id"
          default-expand-all
          @node-click="handleNodeClick"
          >
            <div class="custom-tree-node" slot-scope="{ node, data }">
              <span><i :class="`node_i ${data.code != '[4]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
                {{ data.name }}</span>
              <el-button type="text" size="mini" @click.stop="remove(node, data)">
                <i class="el-icon-delete"></i>
              </el-button>
            </div>
        >
          <div class="custom-tree-node" slot-scope="{ node, data }">
            <span
              ><i
                :class="
                  `node_i ${
                    data.code != '[4]'
                      ? 'el-icon-folder-opened'
                      : 'el-icon-tickets'
                  }`
                "
              ></i>
              {{ data.name }}</span
            >
            <el-button type="text" size="mini" @click.stop="remove(node, data)">
              <i class="el-icon-delete"></i>
            </el-button>
          </div>
        </el-tree>
      </div>
      <div class="table_div" :style="`width: calc(100vw - ${isCollapse?'475':'170'}px);`">
        <div :title="isCollapse ? '点击展开' : '点击收起'" class="box_bgd" @click="isC">
      <div
        class="table_div"
        :style="`width: calc(100vw - ${isCollapse ? '475' : '170'}px);`"
      >
        <div
          :title="isCollapse ? '点击展开' : '点击收起'"
          class="box_bgd"
          @click="isC"
        >
          <div class="upper_triangle"></div>
          <div class="corner">
            <!-- ç‚¹å‡»å±•开收起导航和切换对应图标 -->
            <i :class="!isCollapse ? 'el-icon-arrow-left' : 'el-icon-arrow-right'"></i>
            <i
              :class="
                !isCollapse ? 'el-icon-arrow-left' : 'el-icon-arrow-right'
              "
            ></i>
          </div>
          <div class="under_triangle"></div>
        </div>
@@ -195,83 +305,128 @@
              v-model="codeNameModel"
              prefix-icon="el-icon-search"
              placeholder="请输入编号/设备名称/型号规格"
              clearable>
              clearable
            >
            </el-input>
            <el-button size="mini" @click="reset"><span>重 ç½®</span></el-button>
            <el-button size="mini" type="primary" @click="selectSearch" style="background: #004EA2;"><span>查 è¯¢</span></el-button>
            <el-select v-model="value" size="small" placeholder="请选择设备状态" class="table_top">
              <el-option label="运行" style="color: #66c03b" value="1"></el-option>
              <el-option label="报废" style="color: #ac9299" value="2"></el-option>
              <el-option label="检修" style="color: #52d6c0" value="3"></el-option>
              <el-option label="故障" style="color: #f36b6c" value="4"></el-option>
              <el-option label="空闲" style="color: #fcb642" value="5"></el-option>
            <el-button
              size="mini"
              type="primary"
              @click="selectSearch"
              style="background: #004EA2;"
              ><span>查 è¯¢</span></el-button
            >
            <el-select
              @change="staueValueChange"
              v-model="staue_value"
              size="small"
              placeholder="请选择设备状态"
              class="table_top"
            >
              <el-option
                label="运行"
                style="color: #66c03b"
                value="1"
              ></el-option>
              <el-option
                label="报废"
                style="color: #ac9299"
                value="2"
              ></el-option>
              <el-option
                label="检修"
                style="color: #52d6c0"
                value="3"
              ></el-option>
              <el-option
                label="故障"
                style="color: #f36b6c"
                value="4"
              ></el-option>
              <el-option
                label="空闲"
                style="color: #fcb642"
                value="5"
              ></el-option>
            </el-select>
          </div>
          <el-table
            :data="tableData"
            border
            height="calc(100vh - 220px)"
            style="padding: 10px;">
            <el-table-column
              prop="date"
              label="序号"
              width="60">
            style="padding: 10px;"
          >
            <el-table-column prop="date" label="序号" width="60">
              <template v-slot="scope">
                {{ scope.$index + 1 }}
              </template>
            </el-table-column>
            <el-table-column
              prop="code"
              label="仪器设备编号"
              width="125">
            <el-table-column prop="code" label="仪器设备编号" width="125">
            </el-table-column>
            <el-table-column
              prop="name"
              label="仪器设备名称"
              width="125">
            <el-table-column prop="name" label="仪器设备名称" width="125">
            </el-table-column>
            <el-table-column
              prop="keeper"
              label="保管人">
            </el-table-column>
            <el-table-column prop="keeper" label="保管人"> </el-table-column>
            <el-table-column
              prop="end_measure"
              label="计量截至有效期"
              width="147">
              width="147"
            >
            </el-table-column>
            <el-table-column
              prop="device_status"
              label="使用状态">
            <el-table-column prop="device_status" label="使用状态">
              <template slot-scope="scope">
                <el-tag v-if="scope.row.device_status==1" disable-transitions type="success">运行</el-tag>
                <el-tag v-else-if="scope.row.device_status==2" disable-transitions type="info">报废</el-tag>
                <el-tag v-else-if="scope.row.device_status==3" style="color: #52d6c0" disable-transitions type="info">检修</el-tag>
                <el-tag v-else-if="scope.row.device_status==4" disable-transitions type="danger">故障</el-tag>
                <el-tag v-else-if="scope.row.device_status==5" style="color: #fcb642" disable-transitions type="info">空闲</el-tag>
                <el-tag
                  v-if="scope.row.device_status == 1"
                  disable-transitions
                  type="success"
                  >运行</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 2"
                  disable-transitions
                  type="info"
                  >报废</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 3"
                  style="color: #52d6c0"
                  disable-transitions
                  type="info"
                  >检修</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 4"
                  disable-transitions
                  type="danger"
                  >故障</el-tag
                >
                <el-tag
                  v-else-if="scope.row.device_status == 5"
                  style="color: #fcb642"
                  disable-transitions
                  type="info"
                  >空闲</el-tag
                >
              </template>
            </el-table-column>
            <el-table-column
              prop="factory"
              label="厂家"
              :show-overflow-tooltip="true">
              :show-overflow-tooltip="true"
            >
            </el-table-column>
            <el-table-column
              prop="inspectProject"
              label="检测项目">
            <el-table-column prop="inspectProject" label="检测项目">
            </el-table-column>
            <el-table-column
              prop="testSample"
              label="检验样品">
            <el-table-column prop="testSample" label="检验样品">
            </el-table-column>
            <el-table-column
              prop="user_name"
              label="检测人">
            </el-table-column>
            <el-table-column
              prop="name"
              label="操作">
            <el-table-column prop="user_name" label="检测人"> </el-table-column>
            <el-table-column prop="name" label="操作">
              <template v-slot="scope">
                <el-button @click="handleClick(scope.$index, tableData, scope.row)" type="text" size="small">删除</el-button>
                <el-button
                  @click="handleClick(scope.$index, tableData, scope.row)"
                  type="text"
                  size="small"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
@@ -286,63 +441,68 @@
  name: "LaboratoryManagement",
  data() {
    return {
      value: '',
      value: "",
      dialogVisible: false,
      isCollapse: true, //默认为展开
      radio1: 'true', // åˆ†ç±»åˆ‡æ¢
      tableData: [],
      radio1: "true", // åˆ†ç±»åˆ‡æ¢
      tableData: [], // ä¸»é¡µè¡¨æ ¼æ•°æ®
      inspectionList: [], //检验项目下拉框列表
      showCodeNameModel: {}, // æ–°å¢žä»ªå™¨å±•示禁止框
      keeperList: [], // æ–°å¢žè®¾å¤‡ä¿ç®¡äººä¸‹æ‹‰æ¡†
      parentClassificationList: [], // æ–°å¢žè®¾å¤‡çˆ¶çº§åˆ†ç±»ä¸‹æ‹‰æ¡†
      search_class: '', // åˆ†ç±»æœç´¢æ¡†å†…容
      codeNameModel: '', // ç¼–码名称型号模糊查询
      search_class: "", // åˆ†ç±»æœç´¢æ¡†å†…容
      codeNameModel: "", // ç¼–码名称型号模糊查询
      staue_value: "", // ä¸»é¡µè¡¨æ ¼ä¸Šæ–¹çš„状态选择
      // BOM树数据结构
      towTree: [],
      ruleForm: {
        code: '',
        father: '',
        deviceStatus: '',
        endMeasure: '',
        factory: '',
        keeper: '',
        name: '',
        rawInsProductId: '',
        type: ''
        // æ–°å¢žä»ªå™¨è¡¨å•
        code: "",
        father: "",
        deviceStatus: "",
        endMeasure: "",
        factory: "",
        keeper: "",
        name: "",
        rawInsProductId: "",
        type: ""
      },
      rules: {
        name: [
          { required: true, message: '请输入仪器设备编号', trigger: 'blur' },
          { min: 2, max: 25, message: '长度在 2 åˆ° 25 ä¸ªå­—符', trigger: 'blur' }
          { required: true, message: "请输入仪器设备编号", trigger: "blur" },
          { min: 2, max: 25, message: "长度在 2 åˆ° 25 ä¸ªå­—符", trigger: "blur" }
        ],
        keeper: [
          { required: true, message: '请选择保管人', trigger: 'change' }
          { required: true, message: "请选择保管人", trigger: "change" }
        ],
        endMeasure: [
          { type: 'date', required: true, message: '请选择计量截至有效期', trigger: 'change' }
          {
            type: "date",
            required: true,
            message: "请选择计量截至有效期",
            trigger: "change"
          }
        ],
        deviceStatus: [
          { required: true, message: '请选择设备状态', trigger: 'change' }
          { required: true, message: "请选择设备状态", trigger: "change" }
        ],
        factory: [
          { required: true, message: '请输入厂家', trigger: 'blur' },
          { min: 2, max: 25, message: '长度在 2 åˆ° 50 ä¸ªå­—符', trigger: 'blur' }
          { required: true, message: "请输入厂家", trigger: "blur" },
          { min: 2, max: 25, message: "长度在 2 åˆ° 50 ä¸ªå­—符", trigger: "blur" }
        ],
        rawInsProductId: [
          { required: true, message: '请选择检测项目', trigger: 'change' }
          { required: true, message: "请选择检测项目", trigger: "change" }
        ],
        type: [
          { required: true, message: '请选择设备用途', trigger: 'change' }
        ]
        type: [{ required: true, message: "请选择设备用途", trigger: "change" }]
      },
      pickerOptions:{
      pickerOptions: {
        //禁用当前日期之前的日期
        disabledDate(time) {
          //Date.now()是javascript中的内置函数,它返回自1970å¹´1月1日00:00:00 UTC以来经过的毫秒数。
          return time.getTime() < Date.now() - 8.64e7;
        }
      },
    }
      }
    };
  },
  methods: {
    // åŠ¨æ€æŽ§åˆ¶å±•å¼€ä¸Žæ”¶èµ·å’Œåˆ‡æ¢å¯¹åº”å›¾æ ‡
@@ -351,220 +511,281 @@
    },
    productSelect(e) {
      let value = e.target.value; // è¾“入框值
      if(value) { // ä½ è¾“入才有这个值 ä¸ä¸ºç©ºï¼Œå¦‚果你下拉框选择的话 è¿™ä¸ªå€¼ä¸ºç©º
        this.value = value
      if (value) {
        // ä½ è¾“入才有这个值 ä¸ä¸ºç©ºï¼Œå¦‚果你下拉框选择的话 è¿™ä¸ªå€¼ä¸ºç©º
        this.value = value;
      }
    },
    submitForm() {
      this.$refs.ruleForm.validate((valid) => {
      this.$refs.ruleForm.validate(valid => {
        if (valid) {
          this.ruleForm.father = this.value
          this.$axios.post(this.$api.url.addDeviceInstrument, this.ruleForm,{
            headers: {
              'Content-Type': 'application/json'
            }
          }).then(res => {
            this.keeperList = res.data
            // æˆåŠŸå…³é—­æ–°å¢žå¼¹å‡ºæ¡†
            this.dialogVisible = false
          })
          this.ruleForm.father = this.value;
          this.$axios
            .post(this.$api.url.addDeviceInstrument, this.ruleForm, {
              headers: {
                "Content-Type": "application/json"
              }
            })
            .then(res => {
              this.keeperList = res.data;
              // æˆåŠŸå…³é—­æ–°å¢žå¼¹å‡ºæ¡†
              this.dialogVisible = false;
            });
        } else {
          console.log('error submit!!');
          console.log("error submit!!");
          return false;
        }
      });
    },
    handleClose(done) {
      this.$confirm('确认关闭?')
      this.$confirm("确认关闭?")
        .then(_ => {
          done();
        })
        .catch(_ => {});
    },
    testItem() {
      this.dialogVisible = true
      this.dialogVisible = true;
      this.$axios.get(this.$api.url.addDeviceKeeper).then(res => {
        this.keeperList = res.data
      })
        this.keeperList = res.data;
      });
      this.$axios.get(this.$api.url.addDeviceInspectDownBox).then(res => {
        this.inspectionList = res.data
      })
        this.inspectionList = res.data;
      });
      this.$axios.get(this.$api.url.addDeviceParentClassification).then(res => {
        this.parentClassificationList = res.data
      })
        this.parentClassificationList = res.data;
      });
    },
    twoTreeApi() {
      this.$axios.get(this.$api.url.towTree).then(res => {
        let list = res.data
        let list = res.data;
        list.forEach(i => {
          if (i.name === undefined){
            i.name = i.children[0].name
            i.children = undefined
          if (i.name === undefined) {
            i.name = i.children[0].name;
            i.id = i.children[0].id;
            i.children = undefined;
          }
        })
        this.towTree = res.data
      })
        });
        this.towTree = res.data;
      });
    },
    tableDataApi() {
      this.$axios.get(this.$api.url.tableDeviceList).then(res => {
        this.tableData = res.data
      })
        this.tableData = res.data;
      });
    },
    reset() {
      this.tableDataApi()
      this.radio1 = 'true'
      this.codeNameModel = ''
      this.tableDataApi();
      this.radio1 = "true";
      this.codeNameModel = "";
      this.staue_value = "";
    },
    handleNodeClick(data) {
      if (data.id === undefined) {
        this.$axios.get(this.$api.url.tableDeviceList, {params: {fatherName: data.name}}).then(res => {
          this.tableData = res.data
        })
      } else if (data.id !== undefined){
        this.$axios.get(this.$api.url.tableDeviceList, {params: {deviceId: data.id}}).then(res => {
          this.tableData = res.data
        })
        this.$axios
          .get(this.$api.url.tableDeviceList, {
            params: { fatherName: data.name }
          })
          .then(res => {
            this.tableData = res.data;
          });
      } else if (data.id !== undefined) {
        this.$axios
          .get(this.$api.url.tableDeviceList, { params: { deviceId: data.id } })
          .then(res => {
            this.tableData = res.data;
          });
      }
    },
    handlerDeptList() {
      this.towTree = []
      let val = 1
      if (this.radio1 === "false"){
        val = 2
      this.towTree = [];
      let val = 1;
      if (this.radio1 === "false") {
        val = 2;
      }
      this.$axios.get(this.$api.url.towTree, {params: {type: val, search_class: this.search_class}}).then(res => {
        this.towTree = res.data
      })
      this.$axios
        .get(this.$api.url.towTree, {
          params: { type: val, search_class: this.search_class }
        })
        .then(res => {
          this.towTree = res.data;
        });
    },
    selectSearch() {
      this.tableData = []
      if (this.radio1 === 'false'){
        this.$axios.get(this.$api.url.tableDeviceList, {params: {type: 1, codeNameModel: this.codeNameModel}}).then(res => {
          this.tableData = res.data
        })
      } else if (this.radio1 === 'true') {
        this.$axios.get(this.$api.url.tableDeviceList, {params: {type: 2, codeNameModel: this.codeNameModel}}).then(res => {
          this.tableData = res.data
        })
      this.tableData = [];
      if (this.radio1 === "false") {
        this.$axios
          .get(this.$api.url.tableDeviceList, {
            params: { type: 1, codeNameModel: this.codeNameModel }
          })
          .then(res => {
            this.tableData = res.data;
          });
      } else if (this.radio1 === "true") {
        this.$axios
          .get(this.$api.url.tableDeviceList, {
            params: { type: 2, codeNameModel: this.codeNameModel }
          })
          .then(res => {
            this.tableData = res.data;
          });
      }
    },
    handleClick(index, datas, row) {
      this.$confirm('此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      this.$confirm("此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.$axios.delete(this.$api.url.deleteDevice,{params: {deviceId: row.id}}).then(res => {
          this.$message({
            message: res.message,
            type: 'success'
        this.$axios
          .delete(this.$api.url.deleteDevice, { params: { deviceId: row.id } })
          .then(res => {
            this.$message({
              message: res.message,
              type: "success"
            });
            datas.splice(index, 1);
          })
          .catch(err => {
            this.$message({
              message: err.message,
              type: "warning"
            });
          });
          datas.splice(index, 1);
        }).catch(err => {
          this.$message({
            message: err.message,
            type: 'warning'
          });
        })
      })
      });
    },
    remove(node, data) {
      this.$confirm('此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      this.$confirm("此操作将永久删除该设备, æ˜¯å¦ç»§ç»­?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        console.log(data)
        let val = '';
        if(data.id === undefined && data.children === undefined ) {
          this.$axios.delete(this.$api.url.deleteIdorFather,{params: {deviceFather: data.name}}).then(res => {
            if (res.code === 200){
              this.$message({
                message: res.message,
                type: 'success'
              });
              this.handlerDeptList()
              this.selectSearch()
            } else {
              this.$message({
                message: res.message,
                type: 'warning'
              });
            }
          })
        } else if (data.id !== undefined){
          this.$axios.delete(this.$api.url.deleteIdorFather,{params: {id: data.id}}).then(res => {
            if (res.code === 200){
              this.$message({
                message: res.message,
                type: 'success'
              });
              this.handlerDeptList()
              this.selectSearch()
            } else {
              this.$message({
                message: res.message,
                type: 'warning'
              });
            }
          })
        console.log(`output->data`, data);
        let val = 1;
        if (this.radio1 === "false") {
          val = 2;
        }
      })
        if (data.id === undefined) {
          console.log(`output->执行力`, "+++++++++++++++");
          this.$axios
            .delete(this.$api.url.deleteIdorFather, {
              params: { deviceFather: data.name, type: val }
            })
            .then(res => {
              if (res.code === 200) {
                this.$message({
                  message: res.message,
                  type: "success"
                });
                this.handlerDeptList();
                this.selectSearch();
              } else {
                this.$message({
                  message: res.message,
                  type: "warning"
                });
              }
            });
        } else if (data.id !== undefined) {
          console.log(`output->执行力`, "----------------");
          this.$axios
            .delete(this.$api.url.deleteIdorFather, { params: { id: data.id } })
            .then(res => {
              if (res.code === 200) {
                this.$message({
                  message: res.message,
                  type: "success"
                });
                this.handlerDeptList();
                this.selectSearch();
              } else {
                this.$message({
                  message: res.message,
                  type: "warning"
                });
              }
            });
        }
      });
    },
    staueValueChange() {
      this.tableData = [];
      let val = 1;
      if (this.radio1 === "false") {
        val = 2;
      }
      this.$axios
        .get(this.$api.url.tableDeviceList, {
          params: { type: val, deviceStatue: this.staue_value }
        })
        .then(res => {
          this.tableData = res.data;
        });
    }
  },
  mounted() {
    // åˆå§‹åŒ–调用二级树
    this.twoTreeApi()
    this.twoTreeApi();
    // åˆå§‹åŒ–调用表格数据
    this.tableDataApi()
    this.tableDataApi();
  },
  watch: {
    'ruleForm.rawInsProductId': { //监听ruleForm.rawInsProductId
      handler: function (newVal, oldVal) {
        if (newVal != null && newVal !== ''){
          this.$axios.get(this.$api.url.selectDeviceInspectMessage,{params: {inspectId: newVal}}).then(res => {
            this.showCodeNameModel = res.data
          })
    "ruleForm.rawInsProductId": {
      //监听ruleForm.rawInsProductId
      handler: function(newVal, oldVal) {
        if (newVal != null && newVal !== "") {
          this.$axios
            .get(this.$api.url.selectDeviceInspectMessage, {
              params: { inspectId: newVal }
            })
            .then(res => {
              this.showCodeNameModel = res.data;
            });
        }
      }
    },
    dialogVisible: {
      handler: function (newVal, oldVal) {
        if (newVal){
      handler: function(newVal, oldVal) {
        if (newVal) {
          // æˆåŠŸæ¸…ç©ºè¾“å…¥å†…å®¹
          this.ruleForm = {}
          this.value = ''
          this.showCodeNameModel = {}
          this.$refs.ruleForm.resetFields()
          this.ruleForm = {};
          this.value = "";
          this.showCodeNameModel = {};
          this.$refs.ruleForm.resetFields();
        }
      }
    },
    radio1: {
      handler: function (newVal, oldVal) {
        this.towTree = []
        this.tableData = []
        if (newVal === "true"){
          this.twoTreeApi()
          this.tableDataApi()
      handler: function(newVal, oldVal) {
        this.towTree = [];
        this.tableData = [];
        if (newVal === "true") {
          this.twoTreeApi();
          this.tableDataApi();
        } else if (newVal === "false") {
          this.$axios.get(this.$api.url.towTree, {params: {type: 2}}).then(res => {
            let list = res.data
            list.forEach(i => {
              if (i.name === undefined){
                i.name = i.children[0].name
                i.children = undefined
              }
            })
            this.towTree = res.data
          })
          this.$axios.get(this.$api.url.tableDeviceList, {params: {type: 2}}).then(res => {
            this.tableData = res.data
          })
          this.$axios
            .get(this.$api.url.towTree, { params: { type: 2 } })
            .then(res => {
              let list = res.data;
              list.forEach(i => {
                if (i.name === undefined) {
                  i.name = i.children[0].name;
                  i.id = i.children[0].id;
                  i.children = undefined;
                }
              });
              this.towTree = res.data;
            });
          this.$axios
            .get(this.$api.url.tableDeviceList, { params: { type: 2 } })
            .then(res => {
              this.tableData = res.data;
            });
        }
      }
    }
  }
}
};
</script>
<style scoped>
@@ -577,7 +798,7 @@
  background-color: transparent;
}
.el-form-item >>> .el-form-item__error {
  color: #F56C6C;
  color: #f56c6c;
  font-size: 12px;
  line-height: 1;
  padding-top: 6px;
@@ -585,33 +806,33 @@
  top: 100%;
  left: 18px;
}
/deep/ .el-icon-arrow-left{
/deep/ .el-icon-arrow-left {
  display: flex;
  line-height: 60px !important;
  justify-content: center;
}
/deep/ .el-icon-arrow-right{
/deep/ .el-icon-arrow-right {
  display: flex;
  line-height: 60px !important;
  justify-content: center;
}
.top_left_name{
.top_left_name {
  padding-left: 20px;
  line-height: 32px;
}
.left_row{
.left_row {
  height: calc(100vh - 165px);
  margin-top: 9px;
}
.frame_input{
.frame_input {
  width: 90%;
  margin: 10px 0;
  transition: 1.5s;
}
.table_top_div{
.table_top_div {
  margin-left: 20px;
  padding-top: 15px;
  padding-bottom: 15px
  padding-bottom: 15px;
}
.el-dialog__footer {
  padding: 0px 20px 20px;
@@ -619,26 +840,26 @@
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.table_top{
.table_top {
  float: right;
  width: 224px;
  margin-right: 52px;
}
.main_table_div{
.main_table_div {
  background-color: #fbfbfd;
  height: 100%;
}
.dialog-footer{
.dialog-footer {
  display: block;
  text-align:center
  text-align: center;
}
.table_div{
.table_div {
  padding-left: 5px;
  transition: 1s;
  float: left;
  position: relative
  position: relative;
}
.table_top_input{
.table_top_input {
  width: 20%;
  margin-right: 24px;
}
@@ -651,16 +872,16 @@
  padding-right: 8px;
  width: 250px;
}
.el-tree{
.el-tree {
  width: 280px;
  margin: 0 10px;
}
.custom-tree-node span{
  font-size: 14px!important;
.custom-tree-node span {
  font-size: 14px !important;
}
.el-icon-delete {
  display: none;
  color: #004EA2;
  color: #004ea2;
}
.custom-tree-node:hover .el-icon-delete {
  display: inline;
@@ -669,12 +890,12 @@
  color: orange;
}
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
     background: #f2f2f2;
     border: 0 !important;
     color: #696969;
     line-height: 14px;
     outline: none;
     box-shadow: none;
  background: #f2f2f2;
  border: 0 !important;
  color: #696969;
  line-height: 14px;
  outline: none;
  box-shadow: none;
}
.class_sidebar {
  overflow: hidden;
@@ -692,34 +913,32 @@
  top: 40%;
  left: -10px;
}
.corner{
.corner {
  height: 60px;
  background: #ebebec;
}
.upper_triangle{
  width: 0px;                 /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
.upper_triangle {
  width: 0px; /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
  height: 0px;
  border: 6px solid #ebebec;
  border-left-color: transparent;
  border-top-color: transparent;
}
.under_triangle{
  width: 0px;                 /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
.under_triangle {
  width: 0px; /*  å®½é«˜è®¾ç½®ä¸º0,很重要,否则达不到效果 */
  height: 0px;
  border: 6px solid #ebebec;
  border-left-color: transparent;
  border-bottom-color: transparent;
}
.ai-tab-change {
  .el-radio-button__inner {
    border: 1px solid #ececed;
    line-height: 14px;
  }
  .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background: #fdfdfe;
    border: 1px solid #004da2;
    color: #004da2;
    line-height: 14px;
  }
.el-radio-button__inner {
  border: 1px solid #ececed;
  line-height: 14px;
}
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
  background: #fdfdfe;
  border: 1px solid #004da2;
  color: #004da2;
  line-height: 14px;
}
</style>
src/components/view/measure/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
<template>
  <div>
    1243124234
  </div>
</template>
<script>
export default {
  name: "MeasureManage"
};
</script>
<style></style>
src/components/view/measurementManagement.vue
@@ -3,22 +3,319 @@
    <el-row>
      <el-col :span="12" class="top_left_name">计量管理</el-col>
      <el-col :span="12" style="text-align: right;">
        <el-button size="mini" icon="el-icon-plus" style="color: #000;"
        <el-button
          v-show="radio1 == 2"
          @click="routingJump()"
          type="primary"
          size="mini"
          icon="el-icon-plus"
          style="background: #004EA2; "
          >新增</el-button
        >
        <el-button size="mini"
          ><i class="font icon-xiazaidaoru" style="padding-right: 3px;"></i
          >导出</el-button
        >
      </el-col>
    </el-row>
    <div class="top_div">
      <div class="table_top_div">
        <span>计量编号:</span>
        <el-select
          class="table_top_input"
          size="small"
          v-model="value"
          placeholder="请选择"
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <span>仪器设备名称:</span>
        <el-select
          class="table_top_input"
          size="small"
          v-model="value"
          placeholder="请选择"
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <span>计量单位:</span>
        <el-select
          class="table_top_input"
          size="small"
          v-model="value"
          placeholder="请选择"
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <el-button size="mini" @click="reset"><span>重 ç½®</span></el-button>
        <el-button
          size="mini"
          type="primary"
          @click="selectSearch"
          style="background: #004EA2;"
          ><span>查 è¯¢</span></el-button
        >
      </div>
    </div>
    <div class="middle_div">
      <div class="middle_top_div">
        <el-radio-group class="ai-tab-change" v-model="radio1">
          <el-radio-button size="small" label="1">
            <div class="el_radio_button_div">计量台账</div>
          </el-radio-button>
          <el-radio-button size="small" label="2">
            <div class="el_radio_button_div">计量计划</div>
          </el-radio-button>
        </el-radio-group>
      </div>
      <div class="middle_middle_div">
        <el-table
          v-show="radio1 == 1"
          ref="multipleTable"
          :data="tableData"
          border
          tooltip-effect="dark"
          class="middle_middle_table"
          height="calc(100vh - 325px)"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column label="日期" width="120">
            <template slot-scope="scope">{{ scope.row.date }}</template>
          </el-table-column>
          <el-table-column prop="name" label="姓名" width="120">
          </el-table-column>
          <el-table-column prop="address" label="地址" show-overflow-tooltip>
          </el-table-column>
        </el-table>
        <el-table
          v-show="radio1 == 2"
          ref="multipleTable"
          :data="tableData"
          border
          tooltip-effect="dark"
          class="middle_middle_table"
          height="calc(100vh - 325px)"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55"> </el-table-column>
          <el-table-column label="日期" width="120">
            <template slot-scope="scope">{{ scope.row.date }}</template>
          </el-table-column>
          <el-table-column prop="name" label="姓名" width="120">
          </el-table-column>
          <el-table-column prop="address" label="地址" show-overflow-tooltip>
          </el-table-column>
          <el-table-column prop="address" label="地址" show-overflow-tooltip>
          </el-table-column>
        </el-table>
      </div>
      <div class="middle_under_div">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[12, 20, 30, 40]"
          :pager-count="9"
          :page-size="12"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import zhLocale from "element-ui/lib/locale/lang/zh-CN";
// ç„¶åŽå°†element-ui中pagination选项改掉
zhLocale.el.pagination = {
  pagesize: "条/页",
  total: `共有 {total} æ¡`,
  goto: "跳至",
  pageClassifier: "页"
};
export default {
  name: "measurementManagement"
  name: "measurementManagement",
  data() {
    return {
      radio1: 1, // åˆ†ç±»åˆ‡æ¢
      currentPage4: 4,
      value: "",
      options: [
        {
          value: "选项1",
          label: "黄金糕"
        },
        {
          value: "选项2",
          label: "双皮奶"
        },
        {
          value: "选项3",
          label: "蚵仔煎"
        },
        {
          value: "选项4",
          label: "龙须面"
        },
        {
          value: "选项5",
          label: "北京烤鸭"
        }
      ],
      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-08",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-06",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 å¼„"
        }
      ]
    };
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} æ¡`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    routingJump() {
      this.$router.push("/measure/manage");
    }
  }
};
</script>
<style>
.div_acb {
  color: #000000;
.top_div {
  width: 100%;
  height: 70px;
  background-color: #ffffff;
  margin: 5px 0;
}
.middle_div {
  width: 100%;
  height: calc(100vh - 225px);
  background-color: #ffffff;
}
.middle_top_div {
  width: 100%;
  height: 60px;
}
.ai-tab-change {
  padding: 14px 0 15px 15px;
}
.middle_middle_div {
  width: 100%;
  height: calc(100vh - 325px);
  margin-top: 5px;
}
.middle_middle_table {
  width: 98%;
  margin: 0 15px;
}
.middle_under_div {
  width: 99%;
  height: 30px;
  margin-top: 5px;
  text-align: right;
}
.table_top_input {
  width: 13%;
  margin-right: 24px;
}
.table_top_div {
  margin-left: 20px;
  padding: 20px 0;
}
.table_top_div span {
  font-size: 15px;
}
.el-radio-button__inner {
  border: 1px solid #ececed;
  line-height: 14px;
}
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
  background: #fdfdfe;
  border: 1px solid #2661a0;
  color: #2661a0;
  line-height: 14px;
}
</style>
src/router/index.js
@@ -1,8 +1,9 @@
import Vue from 'vue'
import Router from 'vue-router'
import Index from "../view/index";
import Index from "../view/index.vue";
import NotFind from "../view/404.vue"
import Enter from "../view/enter.vue"
import { name } from 'file-loader';
Vue.use(Router)
@@ -22,5 +23,18 @@
  {
    path: "/enter",
    component: () => import("../view/enter.vue")
  },
  // æ·»åŠ è®¡é‡æ¨¡å—
  {
    path: "/measure",
    components: Index,
    redirect: "/manage",
    children: [
      {
        path: "/manage",
        name: "MeasureManage",
        component: () => import('../components/view/measure/index.vue')
      }
    ]
  }]
})
src/view/index.vue
@@ -1,228 +1,248 @@
<style scoped>
  .all {
    width: 100vw;
    height: 100vh;
    background-size: 100% 100%;
    display: flex;
    flex-wrap: wrap;
  }
.all {
  width: 100vw;
  height: 100vh;
  background-size: 100% 100%;
  display: flex;
  flex-wrap: wrap;
}
  .title {
    width: 100%;
    height: 58px;
    display: flex;
    align-items: center;
    padding: 0 30px;
  }
.title {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 30px;
}
  .logo {
    width: 130px;
  }
.logo {
  width: 130px;
}
  .logo img {
    width: 100%;
    height: 100%;
  }
.logo img {
  width: 100%;
  height: 100%;
}
  .title .label {
    font-size: 18px;
    text-align: center;
    width: calc(100% - 130px - 200px);
  }
.title .label {
  font-size: 18px;
  text-align: center;
  width: calc(100% - 130px - 200px);
}
  .user {
    width: 200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: right;
    color: #000;
  }
.user {
  width: 200px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: right;
  color: #000;
}
  .user * {
    margin: 0 5px;
  }
.user * {
  margin: 0 5px;
}
  .user img {
    margin-left: 20px;
    cursor: pointer;
    width: 14px;
  }
.user img {
  margin-left: 20px;
  cursor: pointer;
  width: 14px;
}
  .user span {
    font-size: 14px;
  }
.user span {
  font-size: 14px;
}
  .left {
    width: 92px;
    height: calc(100vh - 58px - 40px);
    background-color: #004EA2;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 20px 0;
  }
.left {
  width: 92px;
  height: calc(100vh - 58px - 40px);
  background-color: #004ea2;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 20px 0;
}
  .left .box {
    color: #fff;
    width: 68px;
    height: 68px;
    margin: 20px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 8px;
  }
.left .box {
  color: #fff;
  width: 68px;
  height: 68px;
  margin: 20px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 8px;
}
  .left .box:active {
    opacity: .8;
  }
.left .box:active {
  opacity: 0.8;
}
  .left .active_box {
    background-color: #fff;
    color: #004EA2;
  }
.left .active_box {
  background-color: #fff;
  color: #004ea2;
}
  .left .box i {
    font-size: 32px;
    margin-bottom: 8px;
  }
.left .box i {
  font-size: 32px;
  margin-bottom: 8px;
}
  .left .box div {
    font-size: 14px;
  }
.left .box div {
  font-size: 14px;
}
  .small_menu {
    color: #666;
  }
.small_menu {
  color: #666;
}
  .small_menu .active_p {
    color: #004EA2;
  }
.small_menu .active_p {
  color: #004ea2;
}
  .small_menu p {
    padding: 12px 15px;
    cursor: pointer;
  }
.small_menu p {
  padding: 12px 15px;
  cursor: pointer;
}
  .small_menu p:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }
.small_menu p:hover {
  background-color: rgba(0, 0, 0, 0.05);
}
  .small_menu i {
    font-size: 16px;
  }
.small_menu i {
  font-size: 16px;
}
  .small_menu span {
    font-size: 14px;
  }
.small_menu span {
  font-size: 14px;
}
  .right {
    width: calc(100% - 92px);
    height: calc(100vh - 58px);
  }
.right {
  width: calc(100% - 92px);
  height: calc(100vh - 58px);
}
  .tag {
    width: 100%;
    height: 36px;
    background: rgb(255, 255, 255);
    opacity: 0.8;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    color: #999;
    font-size: 14px;
  }
.tag {
  width: 100%;
  height: 36px;
  background: rgb(255, 255, 255);
  opacity: 0.8;
  box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  color: #999;
  font-size: 14px;
}
  .tag .el-icon-s-unfold {
    font-size: 18px;
    cursor: pointer;
    margin: 0 8px;
  }
.tag .el-icon-s-unfold {
  font-size: 18px;
  cursor: pointer;
  margin: 0 8px;
}
  .tabs {
    min-width: calc(100% - 34px);
    height: 100%;
    align-items: center;
    display: flex;
    overflow-x: auto;
  }
.tabs {
  min-width: calc(100% - 34px);
  height: 100%;
  align-items: center;
  display: flex;
  overflow-x: auto;
}
  .tab {
    cursor: pointer;
    font-size: 14px;
    margin: 0 8px;
    line-height: 32px;
    transition: .3s;
    border-top: 2px solid transparent;
    border-bottom: 2px solid transparent;
    user-select: none;
    flex-shrink: 0;
  }
.tab {
  cursor: pointer;
  font-size: 14px;
  margin: 0 8px;
  line-height: 32px;
  transition: 0.3s;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  user-select: none;
  flex-shrink: 0;
}
  .tab i {
    font-size: 12px;
    display: none;
  }
.tab i {
  font-size: 12px;
  display: none;
}
  .active_tab {
    border-bottom: 2px solid #004EA2;
    color: #004EA2;
  }
.active_tab {
  border-bottom: 2px solid #004ea2;
  color: #004ea2;
}
  .active_tab i {
    display: inline;
    color: #004EA2;
  }
.active_tab i {
  display: inline;
  color: #004ea2;
}
  .component_view {
    height: calc(100vh - 94px - 22px);
    width: calc(100% - 48px);
    padding: 11px 24px;
    background: rgb(245, 247, 251);
  }
.component_view {
  height: calc(100vh - 94px - 22px);
  width: calc(100% - 48px);
  padding: 11px 24px;
  background: rgb(245, 247, 251);
}
  .com_index {
    width: 100%;
    height: 100%;
  }
.com_index {
  width: 100%;
  height: 100%;
}
</style>
<style>
</style>
<style></style>
<template>
  <div class="all">
    <div class="title">
      <div class="logo">
        <img src="../../static/img/logo 1.png">
        <img src="../../static/img/logo 1.png" />
      </div>
      <div class="label">电缆附件新一代mom系统</div>
      <div class="user">
        <el-avatar :size="24">{{userName.substring(0,1)}}</el-avatar>
        <span>{{userName}}</span>
        <img src="../../static/img/退出.png" @click="out">
        <el-avatar :size="24">{{ userName.substring(0, 1) }}</el-avatar>
        <span>{{ userName }}</span>
        <img src="../../static/img/退出.png" @click="out" />
      </div>
    </div>
    <div class="left">
      <div :class="`box ${activeBox==0?'active_box':''}`" @click="addTab(menu[0].c[0])">
      <div
        :class="`box ${activeBox == 0 ? 'active_box' : ''}`"
        @click="addTab(menu[0].c[0])"
      >
        <i class="font icon-shouye"></i>
        <div>首页</div>
      </div>
            <div :class="`box ${activeBox==3?'active_box':''}`" @click="addTab(menu[1].c[0])">
              <i class="font icon-jine"></i>
              <div>销售管理</div>
            </div>
      <el-popover placement="right-start" width="90" trigger="click" v-for="(a, ai) in menu" :key="ai" v-if="a.k!='0'&&a.k!='3'">
        <div :class="`box ${activeBox==a.k?'active_box':''}`" @click="activeBox = a.k" slot="reference">
      <div
        :class="`box ${activeBox == 3 ? 'active_box' : ''}`"
        @click="addTab(menu[1].c[0])"
      >
        <i class="font icon-jine"></i>
        <div>销售管理</div>
      </div>
      <el-popover
        placement="right-start"
        width="90"
        trigger="click"
        v-for="(a, ai) in menu"
        :key="ai"
        v-if="a.k != '0' && a.k != '3'"
      >
        <div
          :class="`box ${activeBox == a.k ? 'active_box' : ''}`"
          @click="activeBox = a.k"
          slot="reference"
        >
          <i :class="a.i"></i>
          <div>{{a.v}}</div>
          <div>{{ a.v }}</div>
        </div>
        <div class="small_menu">
          <p v-for="(b, bi) in a.c" :key="bi" :class="activeP==b.k?'active_p':''" @click="addTab(b)">
          <p
            v-for="(b, bi) in a.c"
            :key="bi"
            :class="activeP == b.k ? 'active_p' : ''"
            @click="addTab(b)"
          >
            <i :class="b.i"></i>
            <span>{{b.v}}</span>
            <span>{{ b.v }}</span>
          </p>
        </div>
      </el-popover>
@@ -231,16 +251,25 @@
      <div class="tag">
        <i class="el-icon-s-unfold"></i>
        <div class="tabs">
          <div :class="`tab ${tabActive==a.k?'active_tab':''}`" v-for="(a, ai) in tabs" :key="ai"
            @click="upTabActive(a.k)">
            {{a.v}}
          <div
            :class="`tab ${tabActive == a.k ? 'active_tab' : ''}`"
            v-for="(a, ai) in tabs"
            :key="ai"
            @click="upTabActive(a.k)"
          >
            {{ a.v }}
            <i class="el-icon-close" @click="removeTab(ai)"></i>
          </div>
        </div>
      </div>
      <div class="component_view">
        <component class="com_index" v-for="(com,index) in tabs" :is="com.u" :key="upIndex+'|'+index"
          v-show="com.k == tabActive">
        <component
          class="com_index"
          v-for="(com, index) in tabs"
          :is="com.u"
          :key="upIndex + '|' + index"
          v-show="com.k == tabActive"
        >
        </component>
      </div>
    </div>
@@ -248,162 +277,185 @@
</template>
<script>
  const requireComponent = require.context('../components/view', false, /\.vue/)
  var comObj = {};
  requireComponent.keys().forEach(fileName => {
    var names = fileName
      .split("/")
      .pop()
      .replace(".vue", "")
    const componentConfig = requireComponent(fileName);
    comObj[names] = componentConfig.default || componentConfig;
  });
  export default {
    components: comObj,
    data() {
      return {
        userName: "value",
        menu: [{
const requireComponent = require.context("../components/view", false, /\.vue/);
var comObj = {};
requireComponent.keys().forEach(fileName => {
  var names = fileName
    .split("/")
    .pop()
    .replace(".vue", "");
  const componentConfig = requireComponent(fileName);
  comObj[names] = componentConfig.default || componentConfig;
});
export default {
  components: comObj,
  data() {
    return {
      userName: "value",
      menu: [
        {
          k: 0,
          v: "首页",
          i: "font icon-shouye",
          c: [{
            k: 0,
            v: "首页",
            i: "font icon-shouye",
            u: "index-index"
          }]
        },{
          c: [
            {
              k: 0,
              v: "首页",
              i: "font icon-shouye",
              u: "index-index"
            }
          ]
        },
        {
          k: 3,
          v: "销售管理",
          i: "font icon-jine",
          c: [{
            k: 11,
            v: "销售管理",
            i: "font icon-jine",
            u: "sale"
          }]
        }, {
          c: [
            {
              k: 11,
              v: "销售管理",
              i: "font icon-jine",
              u: "sale"
            }
          ]
        },
        {
          k: 1,
          v: "技术管理",
          i: "font icon-shouye",
          c: [{
            k: 1,
            v: "标准BOM",
            i: "font icon-shouye",
            u: "standard"
          }, {
            k: 2,
            v: "技术文件",
            i: "font icon-shouye",
            u: "technical"
          }]
        }, {
          c: [
            {
              k: 1,
              v: "标准BOM",
              i: "font icon-shouye",
              u: "standard"
            },
            {
              k: 2,
              v: "技术文件",
              i: "font icon-shouye",
              u: "technical"
            }
          ]
        },
        {
          k: 2,
          v: "QMS管理",
          i: "font icon-shouye",
          c: [{
            k: 3,
            v: "原材料检验",
            i: "font icon-shouye",
            u: "rawInsBox"
          }, {
            k: 4,
            v: "原材料不合格品",
            i: "font icon-shouye",
            u: "rawUnqualifiedBox"
          }, {
            k: 5,
            v: "过程检验",
            i: "font icon-shouye",
            u: "processInspection"
          }, {
            k: 6,
            v: "成品检验",
            i: "font icon-shouye",
            u: "finishedProductInspection"
          }, {
            k: 7,
            v: "不合格品管理",
            i: "font icon-shouye",
            u: "unqualifiedManagement"
          }, {
            k: 8,
            v: "实验室管理",
            i: "font icon-shouye",
            u: "laboratoryManagement"
          }, {
            k: 9,
            v: "质量统计",
            i: "font icon-shouye",
            u: ""
          }, {
            k: 10,
            v: "计量管理",
            i: "font icon-shouye",
            u: ""
          }]
        }],
        activeBox: 0,
        activeP: 0,
        tabActive: 0,
        tabs: [{
          c: [
            {
              k: 3,
              v: "原材料检验",
              i: "font icon-shouye",
              u: "rawInsBox"
            },
            {
              k: 4,
              v: "原材料不合格品",
              i: "font icon-shouye",
              u: "rawUnqualifiedBox"
            },
            {
              k: 5,
              v: "过程检验",
              i: "font icon-shouye",
              u: "processInspection"
            },
            {
              k: 6,
              v: "成品检验",
              i: "font icon-shouye",
              u: "finishedProductInspection"
            },
            {
              k: 7,
              v: "不合格品管理",
              i: "font icon-shouye",
              u: "unqualifiedManagement"
            },
            {
              k: 8,
              v: "实验室管理",
              i: "font icon-shouye",
              u: "laboratoryManagement"
            },
            {
              k: 9,
              v: "质量统计",
              i: "font icon-shouye",
              u: ""
            },
            {
              k: 10,
              v: "计量管理",
              i: "font icon-shouye",
              u: "measurementManagement"
            }
          ]
        }
      ],
      activeBox: 0,
      activeP: 0,
      tabActive: 0,
      tabs: [
        {
          k: 0,
          v: "首页",
          i: "font icon-shouye",
          u: "index-index"
        }],
        upIndex: 0
      };
    },
    created() {},
    mounted() {
      this.userName = JSON.parse(localStorage.getItem("user")).name
    },
    methods: {
      addTab(ob) {
        if (ob.k == 0) this.activeBox = 0
                if (ob.k == 11) this.activeBox = 3
        this.activeP = ob.k  //0
        this.tabActive = ob.k  //0
        let num = -1;
        this.tabs.forEach((a, ai) => {
          if (ob.k == a.k) {
            num = a.k
          }
        })
        // å¦‚果没有遍历到tabs里没有该ob对应的table,往tabs里面加入该ob
        if (num == -1) {
          this.tabs.push(ob)
        }
      },
      removeTab(index) {
        if (this.tabs.length > 1) {
          this.tabs.splice(index, 1)
          this.activeP = this.tabs[this.tabs.length - 1].k
          this.tabActive = this.tabs[this.tabs.length - 1].k
        } else {
          this.$message.warning("不能关闭最后的标签")
      ],
      upIndex: 0
    };
  },
  created() {},
  mounted() {
    this.userName = JSON.parse(localStorage.getItem("user")).name;
  },
  methods: {
    addTab(ob) {
      if (ob.k == 0) this.activeBox = 0;
      if (ob.k == 11) this.activeBox = 3;
      this.activeP = ob.k; //0
      this.tabActive = ob.k; //0
      let num = -1;
      this.tabs.forEach((a, ai) => {
        if (ob.k == a.k) {
          num = a.k;
        }
      },
      upTabActive(num) {
        this.tabActive = num
        this.activeP = num
        if (num == 0) {
          this.activeBox = 0
        } else if (num > 0 && num <= 2) {
          this.activeBox = 1
        } else if (num > 2 && num <= 10) {
          this.activeBox = 2
        } else if(num == 11){
                    this.activeBox = 3
                }
      },
      out() {
        sessionStorage.clear()
        localStorage.removeItem('autoenter')
        this.$router.push("/enter")
      });
      // å¦‚果没有遍历到tabs里没有该ob对应的table,往tabs里面加入该ob
      if (num == -1) {
        this.tabs.push(ob);
      }
    },
    removeTab(index) {
      if (this.tabs.length > 1) {
        this.tabs.splice(index, 1);
        this.activeP = this.tabs[this.tabs.length - 1].k;
        this.tabActive = this.tabs[this.tabs.length - 1].k;
      } else {
        this.$message.warning("不能关闭最后的标签");
      }
    },
    upTabActive(num) {
      this.tabActive = num;
      this.activeP = num;
      if (num == 0) {
        this.activeBox = 0;
      } else if (num > 0 && num <= 2) {
        this.activeBox = 1;
      } else if (num > 2 && num <= 10) {
        this.activeBox = 2;
      } else if (num == 11) {
        this.activeBox = 3;
      }
    },
    out() {
      sessionStorage.clear();
      localStorage.removeItem("autoenter");
      this.$router.push("/enter");
    }
  }
};
</script>