| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- <template>
- <div>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="list"
- max-height="calc(100vh - 605px)"
- tool-class="ele-toolbar-form"
- row-key="qualityLevelId"
- @columns-change="handleColumnChange"
- :cache-key="cacheKeyUrl"
- >
- <template v-slot:textType="{ row }">
- {{
- row.textType == 1
- ? '数值'
- : row.textType == 2
- ? '选择'
- : row.textType == 3
- ? '上下限'
- : row.textType == 4
- ? '规格'
- : row.textType == 5
- ? '时间'
- : row.textType == 6
- ? '范围'
- : ''
- }}
- </template>
- <template v-slot:type="{ row }">
- {{ getDictValue('质检标准类型', row.qualityStandardType) }}
- </template>
- <template v-slot:defaultValue="{ row }">
- <div style="display: flex">
- <div
- v-if="row.textType == 3"
- style="display: flex; align-items: center"
- >
- {{ row.minValue }} {{row.unit}}
- <span> -</span>
- {{ row.maxValue }}{{row.unit}}
- </div>
- <div v-else >
- {{ row.defaultValue }} {{row.unit}}
- </div>
- </div>
- </template>
- <template v-slot:qualityResultValue="{ row }">
- <el-input
- v-model="row.qualityResultValue"
- ></el-input>
- </template>
- <template v-slot:qualityResult="{ row }">
- <el-select
- v-model="row.qualityResult"
- placeholder="请选择"
- style="width: 100%"
- clearable
- :disabled="isDetails"
- >
- <el-option
- v-for="item in qualityList"
- :label="item.name"
- :key="item.value"
- :value="item.value"
- />
- </el-select>
- </template>
-
- </ele-pro-table>
- </div>
- </template>
- <script>
- import dictMixins from '@/mixins/dictMixins';
- import { getByCode } from '@/api/system/dictionary-data';
- import tabMixins from '@/mixins/tableColumnsMixin';
- export default {
- components: {},
- mixins: [dictMixins,tabMixins],
- props: {
- qualityParam: {
- type: Array
- },
- isDetails: {
- type: Boolean,
- default: false
- }
- },
- watch: {
- qualityParam: {
- handler(val) {
- this.list = val;
- this.$forceUpdate();
- },
- deep: true,
- immediate: true
- }
- },
- data() {
- return {
- list: [],
- dictList: [],
-
- qualityList: [{
- name: '合格',
- value: 1
- },
- {
- name: '不合格',
- value: 2
- },
- {
- name: '让步接受',
- value: 3
- },
- ],
-
- cacheKeyUrl: 'qms-c2e9664a-inspectionWork-components-term',
- columns: [
- {
- prop: 'categoryLevelName',
- label: '质检类型',
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'inspectionName',
- label: '质检名称',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'defaultValue',
- slot: 'defaultValue',
- label: '工艺参数',
- align: 'center',
- minWidth: 180
- },
- {
- label: '工艺要求',
- prop: 'inspectionStandard',
- formatter: (row, column, cellValue) => {
- return row.symbol + ' ' + cellValue + ' ' + row.unit;
- },
- minWidth: 350
- },
- {
- prop: 'qualityResultValue',
- slot: 'qualityResultValue',
- label: '质检结果参数',
- align: 'center',
- minWidth: 160
- },
- {
- prop: 'qualityResult',
- slot: 'qualityResult',
- label: '质检结果',
- align: 'center',
- minWidth: 100
- },
- ]
- };
- },
- created() {
- this.requestDict('质检标准类型');
- // this.getDictList('mathematical_symbol');
- },
- methods: {
- async getDictList(code) {
- let { data: res } = await getByCode(code);
- this.dictList = res.map((item) => {
- let values = Object.keys(item);
- return {
- value: Number(values[0]),
- label: item[values[0]]
- };
- });
- },
- getDate() {
- return this.list;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .content_box {
- width: 100%;
- margin-top: 12px;
- max-height: 42vh;
- overflow-y: scroll;
- }
- .content_ll_case {
- display: flex;
- flex-wrap: wrap;
- background: #e6f7ff;
- line-height: 30px;
- }
- .content_ll {
- height: 30px;
- width: 23%;
- display: flex;
- flex-direction: row;
- align-items: center;
- margin: auto;
- .name {
- color: #000;
- font-weight: 500;
- margin-right: 8px;
- }
- }
- ::v-deep .el-table--medium .el-table__cell {
- padding: 4px 0 !important;
- }
- ::v-deep .el-form-item__content {
- line-height: 28px !important;
- }
- </style>
|