zouyu
2023-10-30 746fc975621dc0538d0dcc6d4c8b3f17fc13fe3c
src/views/equipment/equipment/index.vue
@@ -23,7 +23,7 @@
</template>
<script>
import { delObj, fetchList } from '@/api/equipment/equipment'
import { delObj, fetchList,pullEquip } from '@/api/equipment/equipment'
import TableForm from './equipment-form'
import ttable from '@/views/common/ztt-table.vue'
import { mapGetters } from 'vuex'
@@ -188,7 +188,7 @@
            label: '状态',
            sort: true,
            isTrue: true,
            isSearch: false,
            isSearch: true,
            searchInfoType: 'text'
          }
        ],
@@ -197,6 +197,12 @@
            text: '新增',
            type: 'primary',
            fun: this.addOrUpdateHandle
          },
          {
            text: '同步',
            type: 'primary',
            loading: false,
            fun: this.pullEquipFun
          }
        ],
        operator: [
@@ -243,6 +249,17 @@
    })
  },
  methods: {
    pullEquipFun(){
      this.table.toolbar.find((e) => e.text === '同步').loading = true
      pullEquip().then(res=>{
        this.$message.success(res.data.data.msg)
        this.table.toolbar.find((e) => e.text === '同步').loading = false
      }).catch(error=>{
        this.$message.error("同步失败",error)
        this.getData()
        this.table.toolbar.find((e) => e.text === '同步').loading = false
      })
    },
    workShopFormatter(row, column, cellValue) {
      this.workshopList.forEach((obj) => {
        if (obj.value == cellValue) {