loulijun2021
2023-06-07 a93255e0a0334b51ecbaf3d8f496ad0fae1ed747
src/views/makeModel/processDefine.vue
@@ -83,8 +83,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'"
@@ -96,96 +101,45 @@
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <!--          <el-table-column-->
          <!--            type="selection"-->
          <!--            width="50"-->
          <!--          />-->
          <el-table-column
            prop="RowNum"
            width="50"
            label="序号"
            fixed
          />
          <el-table-column
            prop="stepcode"
            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
            label="工序编码"
            min-width="150"
            sortable="custom"
          />
          <el-table-column
            prop="stepname"
            min-width="150"
            show-tooltip-when-overflow
            label="工序名称"
            sortable="custom"
          />
          <el-table-column
            prop="flwtype"
            min-width="150"
            show-tooltip-when-overflow
            label="工序类型"
            sortable="custom"
            :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
          >
            <template slot-scope="{row}">
              <div v-if="row.flwtype.indexOf(';')!==-1">自制;外协</div>
              <div v-if="row.flwtype==='W'">外协</div>
              <div v-if="row.flwtype==='Z'">自制</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="descr"
            show-tooltip-when-overflow
            label="工序描述"
            min-width="180"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.descr">{{ row.descr }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="enable"
            label="启用状态"
            show-tooltip-when-overflow
            sortable="custom"
            width="110"
          >
            <template slot-scope="{row}">
              <div v-if="row.enable==='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==='flwtype'">
                {{ steptypeArr.find(i=>i.code===row[item.prop]).name }}
              </div>
              <div v-if="row.enable==='N'">
                <i class="el-icon-info" style="margin-right: 2px" />
                否
              <div v-else-if="item.prop==='enable'">
                <div v-if="row.enable==='Y'">
                  <i
                    class="el-icon-success"
                    :style="{color:$store.state.settings.theme}"
                    style="margin-right: 2px"
                  />
                  是
                </div>
                <div v-if="row.enable==='N'">
                  <i class="el-icon-info" style="margin-right: 2px" />
                  否
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="lm_user"
            label="创建人员"
            show-tooltip-when-overflow
            width="110"
            sortable="custom"
          />
          <el-table-column
            prop="lm_date"
            label="创建时间"
            show-tooltip-when-overflow
            width="160"
            sortable="custom"
          />
          <el-table-column
            label="关联工作站"
            prop="is_eqp"
            show-tooltip-when-overflow
            width="110"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <i v-if="row.is_eqp==='Y'" :style="{color:$store.state.settings.theme}" class="el-icon-share" @click="workClick(row)" />
              <div v-else-if="item.prop==='is_eqp'">
                <i
                  v-if="row.is_eqp==='Y'"
                  :style="{color:$store.state.settings.theme}"
                  class="el-icon-share"
                  @click="workClick(row)"
                />
                <i
                  v-if="row.is_eqp==='N'"
                  class="el-icon-share"
@@ -193,17 +147,13 @@
                  @click="workClick(row)"
                />
              </div>
            </template>
          </el-table-column>
          <el-table-column
            label="关联缺陷"
            prop="is_defect"
            show-tooltip-when-overflow
            width="110"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <i v-if="row.is_defect==='Y'" :style="{color:$store.state.settings.theme}" class="el-icon-share" @click="defectClick(row)" />
              <div v-else-if="item.prop==='is_defect'">
                <i
                  v-if="row.is_defect==='Y'"
                  :style="{color:$store.state.settings.theme}"
                  class="el-icon-share"
                  @click="defectClick(row)"
                />
                <i
                  v-if="row.is_defect==='N'"
                  class="el-icon-share"
@@ -211,8 +161,10 @@
                  @click="defectClick(row)"
                />
              </div>
              <div v-else>{{ row[item.prop] }}</div>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            fixed="right"
@@ -471,16 +423,17 @@
  StepAssociationDefect,
  StepAssociationEqp,
  StepSearch
} from '@/api/zzmx'
} from '@/api/makeModel'
import $ from 'jquery'
import { validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
import TableColumnSettings from '@/components/TableColumnSettings'
export default {
  name: 'GXDY',
  components: {
    Pagination
    Pagination, TableColumnSettings
  },
  directives: { elDragDialog, waves },
  data() {
@@ -512,6 +465,101 @@
      ],
      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: 'stepcode',
          label: '工序编码',
          id: 3,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'stepname',
          label: '工序名称',
          id: 4,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'flwtype',
          label: '工序类型',
          id: 5,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 330,
          width: false,
          prop: 'descr',
          label: '工序描述',
          id: 6,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'enable',
          label: '启用状态',
          id: 7,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'lm_user',
          label: '创建人员',
          id: 8,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 160,
          prop: 'lm_date',
          label: '创建时间',
          id: 9,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: false,
          width: 110,
          prop: 'is_eqp',
          label: '关联工作站',
          id: 10,
          show: true,
          fixed: false,
          sortable: false
        },
        {
          minWidth: false,
          width: 110,
          prop: 'is_defect',
          label: '关联缺陷',
          id: 11,
          show: true,
          fixed: false,
          sortable: false
        }
      ],
      tableTimeStampKey: new Date().getTime(), // 表格key
      dialogVisible: false,
      dialogForm: {
        'id': '',
@@ -567,6 +615,13 @@
    this.getHeight()
  },
  methods: {
    tableColumnUpdate(val, isCopyTrue) {
      if (isCopyTrue) {
        this.tableColumnSettingsArray = val
      }
      this.tableTimeStampKey = new Date().getTime()
      this.$refs.tableDataRef.doLayout()
    },
    tableRowClassName({ row, rowIndex }) {
      return 'custom-row'
    },