loulijun2021
2023-12-19 0696d8d133a06348bd7be04cd09ae6d0ce0cec0a
src/views/basicSettings/contactUnitList.vue
@@ -63,7 +63,11 @@
        >
          <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=5')">导入</el-button>
            <div style="display: flex">
              <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=5')">导入</el-button>
              <el-button v-waves icon="el-icon-refresh-right" @click="syncERP">同步往来单位</el-button>
            </div>
          </div>
          <div class="bodyTopFormGroup">
@@ -217,12 +221,12 @@
                  {{ row.addr?row.addr:'/' }}
                </template>
              </el-table-column>
              <el-table-column
                label="数据来源"
                prop="data_sources"
                sortable="custom"
                width="110"
              />
              <!--              <el-table-column-->
              <!--                label="数据来源"-->
              <!--                prop="data_sources"-->
              <!--                sortable="custom"-->
              <!--                width="110"-->
              <!--              />-->
              <el-table-column
                label="创建人员"
                prop="username"
@@ -419,6 +423,7 @@
  TCunstomerClassTreeDelete,
  TCunstomerData, TCunstomerDelete
} from '@/api/basicSettings'
import { SeaveSearchPartner } from '@/api/ErpSyncMes'
export default {
  name: 'RoleList',
@@ -664,7 +669,7 @@
    treeEditClick(node, data, operation) {
      this.dialogClassForm.data_sources = data.data_sources
      this.dialogClassForm.customerclasscode = data.code
      this.dialogClassForm.customerclassname = data.name
      this.dialogClassForm.customerclassname = data.name.split(' ')[1]
      this.dialogClassForm.parentcode = data.idparent === '-1' ? '' : data.idparent
      this.dialogClassForm.OperType = 'Update'
      this.operation = operation
@@ -766,6 +771,35 @@
        this.dialogForm.idUnitBySale = mainUnitCode
        this.dialogForm.idunitbymanufacture = mainUnitCode
      }
    },
    // 同步ERP
    syncERP() {
      const loading = this.$loading({
        lock: true,
        text: '正在同步ERP,请稍等...',
        spinner: 'el-icon-loading',
        customClass: 'osloading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      SeaveSearchPartner().then(res => {
        if (res.code === '200') {
          setTimeout(() => {
            this.getTCunstomerData(this.$refs.treeLeftRef.getCurrentNode())
            this.getTCunstomerClassTree()
            loading.close()
            this.$notify.success('同步成功!')
          }, 2000)
        }
        // else if (res.code === '300') {
        //   setTimeout(() => {
        //     loading.close()
        //     this.$message.error('同步失败!')
        //   }, 10000)
        // }
      }).catch(e => {
        loading.close()
      })
    }
  }
}