loulijun2021
2022-12-30 d1ce83391deac7bbafe7316e91ede5edd6ca30c9
src/views/jcsz/wldw.vue
@@ -18,12 +18,12 @@
        <el-form
          ref="form"
          :model="form"
          label-width="80px"
          label-width="100px"
          inline
          style="display: flex;justify-content: space-between"
        >
          <div class="elForm">
            <el-form-item label="单位编码" style=" display: flex;">
            <el-form-item label-width="70px" label="单位编码" style=" display: flex;">
              <el-input v-model="form.CuntUnitCode" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="单位名称" style=" display: flex;">
@@ -49,17 +49,22 @@
              <el-input v-model="form.CreateUser" style="width: 200px" placeholder="请输入" />
            </el-form-item>
          </div>
          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
            <el-button type="primary" icon="el-icon-search" @click="search">查询</el-button>
            <el-button type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
          </div>
        </el-form>
        <div
          class="bodyTopFormExpand"
        />
      </div>
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef"
          :data="tableData"
          border
          class="tableFixed"
          :height="tableHeight+'px'"
          :row-class-name="tableRowClassName"
          highlight-current-row
@@ -81,6 +86,7 @@
          <el-table-column
            prop="code"
            label="单位编码"
            show-tooltip-when-overflow
            sortable="custom"
            min-width="110"
          />
@@ -89,9 +95,11 @@
            label="单位名称"
            sortable="custom"
            min-width="160px"
            show-tooltip-when-overflow
          />
          <el-table-column
            label="单位属性"
            show-tooltip-when-overflow
            width="240"
          >
            <!--            sortable="custom"-->
@@ -134,6 +142,7 @@
            prop="conttacts"
            label="联系人"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
@@ -144,6 +153,7 @@
          <el-table-column
            prop="conttphone"
            label="联系方式"
            show-tooltip-when-overflow
            width="160"
            sortable="custom"
          >
@@ -156,6 +166,7 @@
            prop="addr"
            min-width="160"
            label="补充描述"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
@@ -167,6 +178,7 @@
            prop="lm_user"
            label="创建人员"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
@@ -174,6 +186,7 @@
            label="创建时间"
            sortable="custom"
            width="160"
            show-tooltip-when-overflow
          />
          <el-table-column
            label="操作"
@@ -183,10 +196,10 @@
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-tooltip class="item" effect="dark" content="编辑" placement="top">
                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />
                  <i :style="{color:$store.state.settings.theme}" class="el-icon-edit-outline" @click="edit('edit',row)" />
                </el-tooltip>
                <el-tooltip v-del-tab-index class="item" effect="dark" content="删除" placement="top">
                  <i class="el-icon-delete" @click="del(row)" />
                  <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
                </el-tooltip>
              </div>
            </template>
@@ -241,7 +254,12 @@
      <span slot="footer" class="dialog-footer">
        <div class="footerButton">
          <el-button @click="dialogVisibleCancel">取 消</el-button>
          <el-button type="primary" @click="dialogVisibleConfirm">确 定</el-button>
          <el-button
            type="primary"
            :loading="$store.state.app.buttonIsDisabled"
            :disabled="$store.state.app.buttonIsDisabled"
            @click="dialogVisibleConfirm"
          >确 定</el-button>
        </div>
      </span>
    </el-dialog>
@@ -259,25 +277,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()
@@ -332,7 +338,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'] }
@@ -510,6 +516,7 @@
    dialogVisibleConfirm() {
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
          this.$store.state.app.buttonIsDisabled = true
          let mtypecode = null // 外购编码
          let btypecode = null // 外协编码
          let htypecode = null // 客户编码
@@ -535,14 +542,16 @@
            description: this.dialogForm.description,
            OperType: this.operation === 'add' ? 'Add' : 'Update'
          }
          // console.log(data, 2)
          AddUpdateCurrentUnit(data).then(res => {
            if (res.code === '200') {
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.dialogVisible = false
              this.$message.success(this.operation === 'add' ? '添加成功!' : '修改成功!')
              this.getCurrentUnitSearch()
              this.$store.state.app.buttonIsDisabled = false
            } else {
              this.$message.error(this.operation === 'add' ? '添加失败!' : '修改失败!')
              this.$store.state.app.buttonIsDisabled = false
            }
          })
        }
@@ -552,10 +561,11 @@
    getHeight() {
      this.$nextTick(() => {
        this.mainHeight = window.innerHeight - 85
        this.tableHeight = this.mainHeight - 200
        this.tableHeight = this.mainHeight - 195
        if (window.innerHeight < 769) {
          this.tableHeight = this.tableHeight - 40
        }
        this.$refs.tableDataRef.doLayout()
      })
    },
@@ -663,7 +673,14 @@
.userDialogVisible ::v-deep .el-form-item {
  margin-bottom: 0;
}
.tableFixed{
  ::v-deep .el-table__fixed-right{
    height: 100% !important;
  }
  ::v-deep .el-table__fixed{
    height: 100% !important;
  }
}
</style>
<style>