loulijun2021
2023-04-18 07af2c5e2d9dd0978a401bc4c42ceef2f2938433
src/views/qualityManager/qualityPlaning.vue
@@ -89,7 +89,12 @@
      </div>
      <div class="elTableDiv">
        <TableColumnSettings
          :list1="tableColumnSettingsArray"
          @tableColumnUpdate="tableColumnUpdate"
        />
        <el-table
          :key="tableTimeStampKey"
          ref="tableDataRef"
          class="tableFixed"
          :data="tableData"
@@ -102,80 +107,119 @@
          :cell-style="this.$cellStyle"
          @sort-change="sortChange"
        >
          <!--          <el-table-column-->
          <!--            prop="RowNum"-->
          <!--            width="50"-->
          <!--            fixed-->
          <!--            label="序号"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="code"-->
          <!--            label="质检方案编码"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="name"-->
          <!--            label="质检方案名称"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="status"-->
          <!--            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:5px"-->
          <!--              />是-->
          <!--              </div>-->
          <!--              <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />否</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="checktype"-->
          <!--            label="质检类型"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.checktype">{{ checktypeArr.find(i => i.code === row.checktype).name }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="sampmethod"-->
          <!--            label="抽样方式"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.sampmethod">{{ sampltypeArr.find(i => i.code === row.sampmethod).name }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="suitobject"-->
          <!--            label="适用对象"-->
          <!--            sortable="custom"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div v-if="row.suitobject">{{ suitobjectArr.find(i => i.code === row.suitobject).name }}</div>-->
          <!--              <div v-else>/</div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--          <el-table-column-->
          <!--            prop="username"-->
          <!--            label="创建人员"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <!--          <el-table-column-->
          <!--            prop="lm_date"-->
          <!--            label="创建时间"-->
          <!--            width="160"-->
          <!--            sortable="custom"-->
          <!--          />-->
          <el-table-column
            prop="RowNum"
            width="50"
            fixed
            label="序号"
          />
          <el-table-column
            prop="code"
            label="质检方案编码"
            sortable="custom"
          />
          <el-table-column
            prop="name"
            label="质检方案名称"
            sortable="custom"
          />
          <el-table-column
            prop="status"
            label="有效状态"
            sortable="custom"
            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
            :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
          >
            <template slot-scope="{row}">
              <div v-if="row.status==='Y'"><i
                class="el-icon-success"
                :style="{color:$store.state.settings.theme}"
                style="margin-right:5px"
              />是
              <div v-if="!row[item.prop]">/</div>
              <div v-else-if="item.prop==='checktype'">
                {{ checktypeArr.find(i=>i.code===row[item.prop]).name }}
              </div>
              <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />否</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="checktype"
            label="质检类型"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.checktype">{{ checktypeArr.find(i => i.code === row.checktype).name }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="sampmethod"
            label="抽样方式"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.sampmethod">{{ sampltypeArr.find(i => i.code === row.sampmethod).name }}</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="suitobject"
            label="适用对象"
            sortable="custom"
          >
            <template slot-scope="{row}">
              <div v-if="row.suitobject">{{ suitobjectArr.find(i => i.code === row.suitobject).name }}</div>
              <div v-else>/</div>
              <div v-else-if="item.prop==='sampmethod'">
                {{ sampltypeArr.find(i=>i.code===row[item.prop]).name }}
              </div>
              <!--              适用对象-->
              <div v-else-if="item.prop==='suitobject'">
                {{ suitobjectArr.find(i => i.code === row.suitobject).name }}
              </div>
              <div v-else-if="item.prop==='status'">
                <div v-if="row.status==='Y'"><i
                  class="el-icon-success"
                  :style="{color:$store.state.settings.theme}"
                  style="margin-right:5px"
                />是
                </div>
                <div v-else-if="row.status==='N'"><i class="el-icon-info" style="margin-right: 5px" />否</div>
                <div v-else>/</div>
              </div>
              <div v-else>{{ row[item.prop] }}</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="username"
            label="创建人员"
            sortable="custom"
          />
          <el-table-column
            prop="lm_date"
            label="创建时间"
            width="160"
            sortable="custom"
          />
          <el-table-column
            label="操作"
            width="120"
@@ -646,11 +690,12 @@
  QualityInspectionSearch, QualityInspectionSeeEdit,
  StepCheckItemSelect
} from '@/api/qualityManager'
import TableColumnSettings from '@/components/TableColumnSettings'
export default {
  name: 'Zzjg',
  components: {
    Pagination
    Pagination, TableColumnSettings
  },
  directives: { elDragDialog, waves },
  data() {
@@ -688,6 +733,90 @@
      ],
      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: 130,
          width: false,
          prop: 'code',
          label: '质检方案编码',
          id: 3,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 130,
          width: false,
          prop: 'name',
          label: '质检方案名称',
          id: 4,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'status',
          label: '有效状态',
          id: 5,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'checktype',
          label: '质检类型',
          id: 6,
          show: true,
          fixed: false,
          sortable: true
        }, {
          minWidth: 110,
          width: false,
          prop: 'sampmethod',
          label: '抽样方式',
          id: 7,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'suitobject',
          label: '适用对象',
          id: 8,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 110,
          width: false,
          prop: 'lm_user',
          label: '创建人员',
          id: 9,
          show: true,
          fixed: false,
          sortable: true
        },
        {
          minWidth: 160,
          width: false,
          prop: 'lm_date',
          label: '创建时间',
          id: 10,
          show: true,
          fixed: false,
          sortable: true
        }
      ],
      tableTimeStampKey: new Date().getTime(), // 表格key
      dialogVisible: false,
      dialogForm: {
        qualityinsptcode: '', // 质检方案编码
@@ -757,6 +886,13 @@
    this.getHeight()
  },
  methods: {
    tableColumnUpdate(val, isCopyTrue) {
      if (isCopyTrue) {
        this.tableColumnSettingsArray = val
      }
      this.tableTimeStampKey = new Date().getTime()
      this.$refs.tableDataRef.doLayout()
    },
    handleRequest() {
      this.getQualityInspectionSearch().then(res => {
        if (res.code === '200') {