86134
2023-11-07 000b6f8c42b1eb52a75d3fdf58a950a26bfe18f6
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,7 +197,13 @@
            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) {