loulijun2021
2022-07-19 d71436544198b7b051115662fc9cf4b12ce0cda3
src/views/wlgl/ckdy.vue
@@ -32,6 +32,12 @@
      <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-refresh-right"
          @click="syncSeaveSearchWhareHouseLocation"
        >同步仓库/库位
        </el-button>
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
      </div>
      <el-divider />
@@ -139,6 +145,7 @@
<script>
import Pagination from '@/components/Pagination'
import { AddUpdateWareHouseDef, DeleteWareHouseDef, WareHouseDefSearch } from '@/api/wlgl'
import { SeaveSearchInventoryClass, SeaveSearchWhareHouseLocation } from '@/api/ErpSyncMes'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -207,6 +214,29 @@
      this.tableData = res.data
      this.total = res.count
    },
    // 同步仓库/库位
    async syncSeaveSearchWhareHouseLocation() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步仓库/库位,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      const res = await SeaveSearchWhareHouseLocation()
      if (res.code === '200') {
        setTimeout(() => {
          this.getWareHouseDefSearch()
          loading.close()
          this.$message.success('同步成功!')
        }, 2000)
      } else {
        setTimeout(() => {
          loading.close()
          this.$message.error('同步失败!')
        }, 10000)
      }
    },
    // 排序改变时
    sortChange({ column, prop, order }) {
      if (order === 'descending') {