zouyu
2023-12-27 4e2bb29096ac63837f8d2c5e25766ee094f45d6c
src/views/equipment/metering/index.vue
@@ -261,16 +261,6 @@
            },
          ],
          toolbar: [
            {
              text: '新增',
              type: 'primary',
              fun: this.addOrUpdateHandle
            },
            {
              text: '标签打印',
              type: 'primary',
              fun: this.labelPrint
            },
            // {
            //   text: '同步',
            //   type: 'primary',
@@ -278,22 +268,7 @@
            //   fun: this.pullEquipFun
            // }
          ],
          operator: [
            {
              text: '修改',
              icon: 'el-icon-edit',
              type: 'text',
              size: 'small',
              fun: this.addOrUpdateHandle
            },
            {
              text: '删除',
              icon: 'el-icon-delete',
              type: 'text',
              size: 'small',
              fun: this.deleteHandle
            }
          ],
          operator: null,
          operatorConfig: {
            fixed: 'right',
            label: '操作',
@@ -315,6 +290,41 @@
      ...mapGetters(['permissions'])
    },
    created() {
      this.uploadInfo.isShow = this.permissions.equipment_metering_upload
      if(this.permissions.equipment_metering_add){
        this.table.toolbar.push({
              text: '新增',
              type: 'primary',
              fun: this.addOrUpdateHandle
            })
      }
      if(this.permissions.equipment_metering_labelprint){
        this.table.toolbar.push({
                text: '标签打印',
                type: 'primary',
                fun: this.labelPrint
              })
      }
      let arr = []
      if(this.permissions.equipment_metering_edit){
        arr.push({
              text: '修改',
              icon: 'el-icon-edit',
              type: 'text',
              size: 'small',
              fun: this.addOrUpdateHandle
            })
      }
      if(this.permissions.equipment_metering_del){
        arr.push({
              text: '删除',
              icon: 'el-icon-delete',
              type: 'text',
              size: 'small',
              fun: this.deleteHandle
            })
      }
      this.table.operator = arr.length>0 ? arr : null
      remote('work_shop').then((response) => {
        if (response.data.code === 0) {
          this.workshopList = response.data.data