loulijun2021
2023-04-23 06c8aa18a41393b564f48b42fe49db9fa761336c
src/views/makeModel/materialList.vue
@@ -92,8 +92,13 @@
      </div>
      <div class="elTableDiv">
        <TableColumnSettings
          :list1="tableColumnSettingsArray"
          @tableColumnUpdate="tableColumnUpdate"
        />
        <el-table
          ref="tableDataRef"
          :key="tableTimeStampKey"
          class="tableFixed"
          :data="tableData"
          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
@@ -105,115 +110,146 @@
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <el-table-column
            prop="RowNum"
            width="50"
            fixed
            label="序号"
          />
          <el-table-column
            prop="partcode"
            label="母件编码"
            min-width="160"
            v-for="item in tableColumnSettingsArray"
            v-if="item.show"
            :key="item.id"
            :sortable="item.sortable"
            :prop="item.prop"
            :min-width="item.minWidth"
            :label="item.label"
            :width="item.width"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partname"
            label="母件名称"
            min-width="160"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="partspec"
            label="母件规格"
            min-width="160"
            show-tooltip-when-overflow
            sortable="custom"
            :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
          >
            <template slot-scope="{row}">
              <div v-if="row.partspec">{{ row.partspec }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="stocktype_name"
            label="存货类型"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="uom_name"
            label="计量单位"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="quantity"
            label="基础数量"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="status"
            width="110"
            show-tooltip-when-overflow
            label="启用状态"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.status==='Y'">
                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
                是
              <div v-if="!row[item.prop]">/</div>
              <div v-else-if="item.prop==='startdate'">{{ row.startdate.substring(0,11) }}</div>
              <div v-else-if="item.prop==='status'">
                <div v-if="row[item.prop]==='Y'">
                  <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
                  是
                </div>
                <div v-if="row[item.prop]==='N'">
                  <i class="el-icon-info" style="margin-right: 2px" />
                  否
                </div>
              </div>
              <div v-if="row.status==='N'">
                <i class="el-icon-info" style="margin-right: 2px" />
                否
              </div>
              <div v-else>{{ row[item.prop] }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="startdate"
            label="启用日期"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.startdate">{{ row.startdate.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="version"
            label="版本号"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="username"
            label="创建人员"
            width="110"
            show-tooltip-when-overflow
            sortable="custom"
          />
          <el-table-column
            prop="lm_date"
            label="创建时间"
            show-tooltip-when-overflow
            width="110"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <!--          <el-table-column-->
          <!--            prop="RowNum"-->
          <!--            width="50"-->
          <!--            fixed-->
          <!--            label="序号"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="partcode"-->
          <!--            label="母件编码"-->
          <!--            min-width="160"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="partname"-->
          <!--            label="母件名称"-->
          <!--            min-width="160"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="partspec"-->
          <!--            label="母件规格"-->
          <!--            min-width="160"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.partspec">{{ row.partspec }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="stocktype_name"-->
          <!--            label="存货类型"-->
          <!--            width="110"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="uom_name"-->
          <!--            label="计量单位"-->
          <!--            width="110"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="quantity"-->
          <!--            label="基础数量"-->
          <!--            width="110"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="status"-->
          <!--            width="110"-->
          <!--            show-tooltip-when-overflow-->
          <!--            label="启用状态"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.status==='Y'">-->
          <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
          <!--                是-->
          <!--              </div>-->
          <!--              <div v-if="row.status==='N'">-->
          <!--                <i class="el-icon-info" style="margin-right: 2px" />-->
          <!--                否-->
          <!--              </div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="startdate"-->
          <!--            label="启用日期"-->
          <!--            width="110"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.startdate">{{ row.startdate.substring(0, 11) }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="version"-->
          <!--            label="版本号"-->
          <!--            width="110"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="username"-->
          <!--            label="创建人员"-->
          <!--            width="110"-->
          <!--            show-tooltip-when-overflow-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="lm_date"-->
          <!--            label="创建时间"-->
          <!--            show-tooltip-when-overflow-->
          <!--            width="110"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <el-table-column
            label="操作"
            width="120"
@@ -598,11 +634,12 @@
} from '@/api/makeModel'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import TableColumnSettings from '@/components/TableColumnSettings'
export default {
  name: 'Zzjg',
  components: {
    Pagination, ImportPicker
    Pagination, ImportPicker, TableColumnSettings
  },
  directives: { elDragDialog, waves },
  data() {
@@ -633,6 +670,121 @@
      total: 10,
      tableData: [],
      tableColumnSettingsArray: [
        { minWidth: 50, width: false, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 隐藏列  show: false隐藏,true显示
        { minWidth: 25, width: 50, prop: 'RowNum', label: '序号', id: 2, show: true, fixed: 'left', sortable: false }, // custom
        {
          minWidth: 110,
          width: false,
          prop: 'partcode',
          label: '母件编码',
          id: 3,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'partname',
          label: '母件名称',
          id: 4,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'partspec',
          label: '母件规格',
          id: 5,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'stocktype_name',
          label: '存货类型',
          id: 6,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'uom_name',
          label: '计量单位',
          id: 7,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'quantity',
          label: '基础数量',
          id: 8,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'status',
          label: '启动状态',
          id: 9,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: false,
          width: 110,
          prop: 'startdate',
          label: '启用日期',
          id: 10,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: false,
          width: 110,
          prop: 'version',
          label: '版本号',
          id: 11,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'username',
          label: '创建人员',
          id: 12,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 160,
          prop: 'lm_date',
          label: '创建时间',
          id: 13,
          show: true,
          fixed: false,
          sortable: true
        }
      ],
      tableTimeStampKey: new Date().getTime(), // 表格key
      dialogVisible: false,
      dialogForm: {
        bomid: '',
@@ -701,6 +853,13 @@
    this.getHeight()
  },
  methods: {
    tableColumnUpdate(val, isCopyTrue) {
      if (isCopyTrue) {
        this.tableColumnSettingsArray = val
      }
      this.tableTimeStampKey = new Date().getTime()
      this.$refs.tableDataRef.doLayout()
    },
    handleRequest() {
      this.getBoIventorySelect().then(res => {
        if (res.code === '200') {