loulijun2021
2022-07-16 392f9468875a8721c17c4e15c288333017cac4a1
src/views/jcsz/wldw.vue
@@ -39,14 +39,14 @@
      <el-divider />
      <div style="margin-left: 10px;display: flex">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button type="primary" icon="el-icon-upload2">导入</el-button>
        <!--        <el-button type="primary" icon="el-icon-upload2">导入</el-button>-->
      </div>
      <el-divider />
      <div class="elTableDiv">
        <el-table
          :data="tableData"
          border
          :height="tableHeight"
          :height="tableHeight+'px'"
          stripe
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
@@ -71,7 +71,6 @@
          <el-table-column
            prop="name"
            label="单位名称"
            show-overflow-tooltip
            sortable="custom"
            min-width="200px"
          />
@@ -134,14 +133,13 @@
            label="创建时间"
            sortable="custom"
            width="200"
            show-overflow-tooltip
          />
          <el-table-column
            label="操作"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="edit('edit',row)">修改</el-button>
                <el-button type="text" @click="edit('edit',row)">编辑</el-button>
                <el-button type="text" @click="del(row)">删除</el-button>
              </div>
            </template>
@@ -162,9 +160,9 @@
    </div>
    <el-dialog
      :title="operation==='add'?'新增':'修改'"
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="50%"
      width="800px"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
@@ -212,7 +210,7 @@
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Zzjg',
  name: 'WLDW',
  components: {
    Pagination
  },
@@ -225,6 +223,22 @@
          return callback(new Error('编码不能为中文'))
        } else {
          callback()
        }
      }
    }
    const validateMobile = (rule, value, callback) => {
      if (!value) {
        callback()
        // return callback(new Error('请输入电话号码'))
      } else {
        const mobile = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ // 长号
        const mobile2 = /^[0-9]{6}$/ // 短号
        if (mobile.test(value) || mobile2.test(value)) {
          callback()
          // return callback(new Error('电话号码不符合规则'))
        } else {
          return callback(new Error('电话号码不符合规则'))
          // callback()
        }
      }
    }
@@ -273,6 +287,9 @@
        ],
        checkboxIsSelected: [
          { required: true, message: '请选择供方属性', trigger: ['blur', 'change'] }
        ],
        contact: [
          { required: true, validator: validateMobile, trigger: ['blur', 'change'] }
        ]
      }