loulijun2021
2023-12-05 2f45123bb9911c4dacf08b527482e4f855c988b8
src/views/basicSettings/warehouseList.vue
@@ -3,7 +3,17 @@
    <div class="body" :style="{height:mainHeight+'px'}">
      <div class="bodyTopButtonGroup" style="justify-content: space-between">
        <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=6')">导入</el-button>
        <div style="display:flex">
          <!--          <el-button-->
          <!--            v-waves-->
          <!--            type="success"-->
          <!--            icon="el-icon-download"-->
          <!--            @click="$router.push('./../systemSetting/dataImport?fileCode=6')"-->
          <!--          >导入-->
          <!--          </el-button>-->
          <el-button v-waves icon="el-icon-refresh-right" @click="syncERP">同步仓库</el-button>
        </div>
      </div>
      <div class="bodyTopFormGroup">
@@ -142,11 +152,11 @@
              {{ row.description ? row.description : '/' }}
            </template>
          </el-table-column>
          <el-table-column
            prop="data_sources"
            label="数据来源"
            sortable="custom"
          />
          <!--          <el-table-column-->
          <!--            prop="data_sources"-->
          <!--            label="数据来源"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            prop="username"
            label="创建人员"
@@ -249,14 +259,11 @@
<script>
import Pagination from '@/components/Pagination'
import {
  AddUpdateGroup,
  DeleteGroup,
  GroupData, TSecStckAddUpdate, TSecStckData, TSecStckDelete
} from '@/api/basicSettings'
import { TSecStckAddUpdate, TSecStckData, TSecStckDelete } from '@/api/basicSettings'
import { validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import { SaveSearchWareHouse } from '@/api/ErpSyncMes'
export default {
  name: 'Zzjg',
@@ -425,6 +432,34 @@
        this.tableHeight = this.mainHeight - 200
        this.$refs.tableDataRef.doLayout()
      })
    },
    // 同步ERP
    syncERP() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步ERP,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      SaveSearchWareHouse().then(res => {
        if (res.code === '200') {
          setTimeout(() => {
            this.getTSecStckData()
            loading.close()
            this.$notify.success('同步成功!')
          }, 2000)
        }
        // else if (res.code === '300') {
        //   setTimeout(() => {
        //     loading.close()
        //     this.$message.error('同步失败!')
        //   }, 10000)
        // }
      }).catch(e => {
        loading.close()
      })
    }
  }
}