loulijun2021
2022-08-31 d105bd9dd591264a7b1f79f1fdbbf0e764ff073e
src/views/template.vue
@@ -3,7 +3,7 @@
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button icon="el-icon-upload2" @click="upload">导入</el-button>
        <el-button icon="el-icon-download" @click="upload">导入</el-button>
      </div>
      <div class="bodyTopFormGroup">
@@ -22,7 +22,7 @@
              <el-input v-model="form.OrgName" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="组织类型" style=" display: flex;">
              <el-select v-model="form.OrgType" :popper-append-to-body="false" style="width: 200px" placeholder="请选择">
              <el-select v-model="form.OrgType" style="width: 200px" placeholder="请选择">
                <el-option
                  v-for="item in OrgTypeArr"
                  :key="item.code"
@@ -129,7 +129,8 @@
    <el-dialog
      :title="operation==='add'?'新增':'编辑'"
      :visible.sync="dialogVisible"
      width="800"
      width="800px"
      :close-on-click-modal="false"
      top="15vh"
      @closed="handleClose"
      @close="handleClose"
@@ -164,6 +165,10 @@
        </div>
      </span>
    </el-dialog>
    <!--导入组件-->
    <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
  </div>
</template>
@@ -171,12 +176,13 @@
import Pagination from '@/components/Pagination'
import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
import { getCookie } from '@/utils/auth'
import ImportPicker from '@/components/ImportPicker'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Zzjg',
  components: {
    Pagination
    Pagination, ImportPicker
  },
  data() {
    const validateName = (rule, value, callback) => {
@@ -241,8 +247,19 @@
        SupUnit: [
          { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
        ]
      }
      },
      title_value: '数据导入 / 点检部位',
      code: '4',
      shows: false
    }
  },
  watch: {
    shows() {
      if (!this.shows) {
        this.getOrganizationSearch()
      }
    }
  },
  created() {
@@ -275,8 +292,13 @@
    search() {
      this.getOrganizationSearch()
    },
    // 导入按钮
    upload() {
      this.shows = true
      this.$refs.importPickerFunc.newDataFunc()
    },
    colos() {
      this.shows = false
    },
    // 重置
    reset() {
@@ -313,6 +335,9 @@
        DeleteOrganization({ orgid: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            if (this.form.page > 1 && this.tableData.length === 1) {
              this.form.page--
            }
            this.getOrganizationSearch()
          }
        })
@@ -357,8 +382,8 @@
    // 获取页面高度
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 200
      })
    },
    tableRowClassName({ row, rowIndex }) {
@@ -462,6 +487,11 @@
  margin-bottom: 0;
}
::v-deep .el-select__caret{
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
<style>