zss
2024-01-17 c49d413fe39ee6cb9062f6fa915a3d203933a73a
src/views/equipment/metering/index.vue
@@ -38,7 +38,7 @@
              <el-row>
                <el-col :span="10" :offset="3">设备二维码:</el-col>
                <el-col :span="10">
                  <vueQr :text="tem.code" :size="80" :margin="2"></vueQr>
                  <vueQr :text="tem.code+'id@'+tem.id" :size="80" :margin="2"></vueQr>
                </el-col>
              </el-row>
            </el-card>
@@ -68,8 +68,8 @@
        multipleSelection: [],
        uploadInfo: {
          // 是否展示上传EXCEL以及对应的url
          Download:false,
         isShow: true,
          download:false,
          isShow: true,
          url: '/mes/equipmentDevice/upload'
        },
        prelang: 'workstation',
@@ -85,7 +85,7 @@
          isRefresh: true, // 是否显示刷新按钮
          isShowHide: true, // 是否显示显影按钮
          isSearch: false, // 高级查询按钮
          defaultOrderBy: { column: 'manufactureDate', direction: 'desc' }
          defaultOrderBy: { column: 'id', direction: 'desc' }
        },
        table: {
          total: 0,
@@ -97,6 +97,7 @@
            // 设备编号
            {
              minWidth: '30',
              width: '100',
              prop: 'code',
              label: '设备编号',
              sort: true,
@@ -110,6 +111,7 @@
            // 设备名称
            {
              minWidth: '30',
              width: '100',
              prop: 'name',
              label: '设备名称',
              sort: true,
@@ -145,7 +147,7 @@
 // 制造日期
 {
              minWidth: '150',
              width: '250',
              width: '150',
              prop: 'createTime',
              label: '校准时间',
              sort: true,
@@ -157,7 +159,7 @@
           
            {
              minWidth: '150',
              width: '250',
              width: '150',
              prop: 'updateTime',
              label: '校准到期时间',
              sort: true,
@@ -261,16 +263,6 @@
            },
          ],
          toolbar: [
            {
              text: '新增',
              type: 'primary',
              fun: this.addOrUpdateHandle
            },
            {
              text: '标签打印',
              type: 'primary',
              fun: this.labelPrint
            },
            // {
            //   text: '同步',
            //   type: 'primary',
@@ -278,22 +270,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 +292,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