zss
2024-03-01 d3a486a2f3ae5e76b7bbf9e3d6a8c1e36ed73de7
src/views/basic/part/index.vue
@@ -12,7 +12,12 @@
        :ajaxFun="ajaxFun"
        ref="partTable"
      >
        <template #toolbar></template>
        <template #toolbar>
          <!-- <el-button type="primary" @click="addOrUpdateHandle"
          v-if="permissions.basic_part_add">新增</el-button> -->
          <!-- <el-button text="同步MDM" type="primary" @click=""
          v-if="permissions.basic_part_mdm">同步MDM</el-button> -->
        </template>
      </ttable>
      <!-- 弹窗, 新增 / 修改 -->
      <table-form
@@ -80,6 +85,8 @@
      uploadInfo: {
        // 是否展示上传EXCEL以及对应的url
        isShow: true,
        download: true,
        fileName: '已申请物料编码模板',
        url: '/mes/part/upload'
      },
      prelang: 'operation',
@@ -191,7 +198,7 @@
            searchInfoType: 'text'
          },
          // 一级分类
         /*  {
           {
            minWidth: '120',
            prop: 'assortment',
            label: '一级分类',
@@ -228,7 +235,7 @@
            optList: () => {
              return this.getThreeLevelClassification()
            }
          }, */
          },
          // 规格
          {
            minWidth: '140',
@@ -392,17 +399,6 @@
          } */
        ],
        toolbar: [
          {
            text: '新增',
            type: 'primary',
            fun: this.addOrUpdateHandle
          },
          {
            text: '同步MDM',
            type: 'primary',
            fun: () => (this.syncDateVisible = true),
            loading: false
          }
          // {
          //   text: '大标签',
          //   type: 'primary',
@@ -410,14 +406,7 @@
          //   loading: false
          // }
        ],
        operator: [
          {
            text: '删除',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          }
        ],
        operator: null,
        operatorConfig: {
          fixed: 'right',
          label: '操作',
@@ -447,16 +436,39 @@
    PrintLabelForm
  },
  created() {
if(this.permissions.basic_part_mdm){
        this.table.toolbar.push(
          {
            text: '同步MDM',
            type: 'primary',
            fun: () => this.syncDateVisible = true,
            loading: false
          }
        )
    }
    if(this.permissions.basic_part_del){
      this.table.operator = [
          {
            text: '删除',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          }
        ]
    }
    this.uploadInfo.isShow = this.permissions.basic_part_upload
    this.table.column.find((e) => e.label === 'IFS启用批次管理').isTrue = false
    this.table.column.find((e) => e.label === '计划方法').isTrue = false
    this.getUnitType('unit')
    this.getMaterialType('material_type')
    this.getCategoryType('category')
    this.getAssortmentType('assortment')
    this.getPlanningMethodType('planning_method_type')
    this.getThreeLevelClassificationType('three_classification_type')
    this.getMaterialAttributeType()
    this.getExaminerDict('examiner_type')
  },
  mounted(){
    this.getUnitType('unit')
    this.getMaterialType('material_type')
    this.getMaterialAttributeType()
  },
  computed: {
    ...mapGetters(['permissions'])
@@ -468,6 +480,10 @@
    },
    // 新增 / 修改
    addOrUpdateHandle(row) {
      if(!this.permissions.basic_part_edit && row.id!=null){
        this.$message.error("该角色没有操作权限")
        return
      }
      this.addOrUpdateVisible = true
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(row == null ? null : row.id)