loulijun2021
2022-09-14 5eeb8864bebb1dc4f97f2feef32b742d8a9a10d5
src/views/jcsz/wldw.vue
@@ -2,14 +2,16 @@
  <div>
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button
          icon="el-icon-refresh-right"
          @click="syncSeaveSearchPartner"
        >同步往来单位
        </el-button>
        <el-button icon="el-icon-download" @click="upload">导入</el-button>
        <div style="display: flex">
          <el-button
            icon="el-icon-refresh-right"
            @click="syncSeaveSearchPartner"
          >同步往来单位
          </el-button>
          <el-button icon="el-icon-download" @click="upload">导入</el-button>
        </div>
      </div>
      <div class="bodyTopFormGroup">
@@ -87,6 +89,7 @@
            label="单位名称"
            sortable="custom"
            min-width="160px"
            show-tooltip-when-overflow
          />
          <el-table-column
            label="单位属性"
@@ -154,6 +157,7 @@
            prop="addr"
            min-width="160"
            label="补充描述"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
@@ -257,25 +261,13 @@
} from '@/api/jcsz'
import { SeaveSearchPartner } from '@/api/ErpSyncMes'
import ImportPicker from '@/components/ImportPicker'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
import { validateCode } from '@/utils/global'
export default {
  name: 'WLDW',
  components: {
    Pagination, ImportPicker
  },
  data() {
    const validateName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请输入编码'))
      } else {
        if (SER_HZ.test(value)) {
          return callback(new Error('编码不能为中文'))
        } else {
          callback()
        }
      }
    }
    const validateMobile = (rule, value, callback) => {
      if (!value) {
        callback()
@@ -330,7 +322,7 @@
      operation: '',
      dialogFormRules: {
        unitcode: [
          { required: true, validator: validateName, trigger: ['blur', 'change'] }
          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
        ],
        unitname: [
          { required: true, message: '请输入供方名称', trigger: ['blur', 'change'] }
@@ -480,6 +472,9 @@
        DeleteCurrentUnit({ unitcode: row.code }).then(res => {
          if (res.code === '200') {
            this.$message.success('删除成功!')
            if (this.form.page > 1 && this.tableData.length === 1) {
              this.form.page--
            }
            this.getCurrentUnitSearch()
          }
        })