按钮级别的新版本,多级别的组织架构
loulijun2021
2023-09-06 59c007d769ea475ccd0ff1480959dbe83f40c3a8
src/views/materialManager/inventoryList.vue
@@ -106,7 +106,7 @@
                class="bodySearchReset"
                :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
              >
                <el-button v-waves type="primary" icon="el-icon-search" @click="">查询</el-button>
                <el-button v-waves type="primary" icon="el-icon-search" @click="getTMaterielData($refs.treeLeftRef.getCurrentNode())">查询</el-button>
                <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">重置</el-button>
              </div>
            </el-form>
@@ -146,7 +146,7 @@
            >
              <!--            prop="RowNum"-->
              <el-table-column
                type="index"
                prop="rowNum"
                width="50"
                fixed
                label="序号"
@@ -155,19 +155,22 @@
                prop="partcode"
                label="存货编码"
                sortable="custom"
                width="110"
              />
              <el-table-column
                prop="partname"
                label="存货名称"
                width="110"
                sortable="custom"
              />
              <el-table-column
                prop="partspec"
                label="规格型号"
                width="110"
                sortable="custom"
              >
                <template slot-scope="{row}">
                  {{ row.partspec?row.partspec:'/' }}
                  {{ row.partspec ? row.partspec : '/' }}
                </template>
              </el-table-column>
              <el-table-column
@@ -182,7 +185,7 @@
                sortable="custom"
              >
                <template slot-scope="{row}">
                  {{ row.isSingleUnit==='0'?row.idunitgroupname:row.idunitname }}
                  {{ row.isSingleUnit === '0' ? row.idunitgroupname : row.idunitname }}
                </template>
              </el-table-column>
              <el-table-column
@@ -200,14 +203,14 @@
              <el-table-column
                label="存货属性"
                sortable="custom"
                width="220"
                min-width="220"
              >
                <template slot-scope="{row}">
                  {{ row.isPurchase==='1'?'外购':'' }}
                  {{ row.isSale==='1'?'销售':'' }}
                  {{ row.isMadeSelf==='1'?'自制':'' }}
                  {{ row.isMaterial==='1'?'生产消耗':'' }}
                  {{ row.isMadeRequest==='1'?'委外':'' }}
                  {{ row.isPurchase === '1' ? '外购' : '' }}
                  {{ row.isSale === '1' ? '销售' : '' }}
                  {{ row.isMadeSelf === '1' ? '自制' : '' }}
                  {{ row.isMaterial === '1' ? '生产消耗' : '' }}
                  {{ row.isMadeRequest === '1' ? '委外' : '' }}
                </template>
              </el-table-column>
              <el-table-column
@@ -215,6 +218,18 @@
                prop="data_sources"
                sortable="custom"
                width="110"
              />
              <el-table-column
                label="创建人员"
                prop="lm_user"
                sortable="custom"
                width="110"
              />
              <el-table-column
                label="创建时间"
                prop="lm_date"
                sortable="custom"
                width="160"
              />
              <el-table-column
@@ -553,7 +568,7 @@
  TMaterielClassTree,
  TMaterielClassTreeAddUpdate,
  TMaterielClassTreeDelete,
  TMaterielData, TMaterielDelete, TUnitGroup
  TMaterielData, TMaterielDelete
} from '@/api/ProductModel'
import arrayToTree from 'array-to-tree'
import { UnitSerch } from '@/api/GeneralBasicData'
@@ -746,6 +761,50 @@
      this.$nextTick(() => {
        this.dialogForm.data_sources = row.data_sources
        this.dialogForm.partcode = row.partcode
        this.dialogForm.partname = row.partname
        this.dialogForm.partspec = row.partspec
        this.dialogForm.inventoryclasscode = row.idinventoryclasscode
        this.dialogForm.unittypcode = row.isSingleUnit
        // 计量方式(0:多计量,1:单计量)
        if (this.dialogForm.unittypcode === '1') {
          this.dialogForm.unitcode = row.idunitcode
          this.dialogForm.unitsubcode = ''
          this.dialogForm.idSubUnitByReport = ''
          const unitname = this.unitcodeSingleArr.find(i => i.unitcode === this.dialogForm.unitcode).unitname
          this.dialogForm.idUnitByStock = unitname
          this.dialogForm.idUnitByPurchase = unitname
          this.dialogForm.idUnitBySale = unitname
          this.dialogForm.idunitbymanufacture = unitname
        }
        if (this.dialogForm.unittypcode === '0') {
          this.dialogForm.unitcode = row.idunitgroupcode
          const t = this.unitcodeGroupArr.find(i => i.unitcode === this.dialogForm.unitcode).children
          this.idSubUnitByReportArr = t.filter(i => i.isMainUnit !== '1')
          this.idUnitBvStockArr = t
          const mainUnitCode = t.find(i => i.isMainUnit === '1').unitcode
          this.dialogForm.unitsubcode = mainUnitCode
          this.dialogForm.idSubUnitByReport = this.idSubUnitByReportArr[0].unitcode
          this.dialogForm.idUnitByStock = mainUnitCode
          this.dialogForm.idUnitByPurchase = mainUnitCode
          this.dialogForm.idUnitBySale = mainUnitCode
          this.dialogForm.idunitbymanufacture = mainUnitCode
        }
        this.dialogForm.isPurchase = row.isPurchase === '1'
        this.dialogForm.isSale = row.isSale === '1'
        this.dialogForm.isMadeSelf = row.isMadeSelf === '1'
        this.dialogForm.isMaterial = row.isMaterial === '1'
        this.dialogForm.isMadeRequest = row.isMadeRequest === '1'
        this.dialogForm.idwarehouse = row.idwarehousecode
        this.dialogForm.status = row.status
      })
    },
    del(row) {