| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- <template>
- <el-dialog
- :visible.sync="equipmentdialog"
- :before-close="handleClose"
- :close-on-click-modal="true"
- :close-on-press-escape="false"
- append-to-body
- width="70%"
- >
- <div>
- <el-row>
- <el-col :span="12" class="table_col" v-if="equipmentdialog">
- <div class="title">工艺参数</div>
- <ele-pro-table
- ref="equiTable"
- :columns="columns"
- :datasource="datasource"
- :current.sync="current"
- highlight-current-row
- row-key="id"
- height="50vh"
- >
- <template v-slot:textType="{ row }">
- {{ row.textType == 1 ? '数值' : row.textType == 2 ? '选择' : row.textType == 3 ? '产品参数' : row.textType == 4 ? '规格' :
- row.textType == 5 ? '时间' : '' }}
- </template>
- </ele-pro-table>
- </el-col>
- <el-col :span="12" class="table_col" v-if="equipmentdialog">
- <div class="title">质检项</div>
- <ele-pro-table
- ref="equiTable"
- :columns="columns1"
- :datasource="datasource1"
- :current.sync="current1"
- highlight-current-row
- row-key="id"
- height="50vh"
- >
- </ele-pro-table>
- </el-col>
- </el-row>
- </div>
- <div class="btns">
- <el-button type="primary" size="small" @click="selected">选择</el-button>
- <el-button size="small" @click="handleClose">关闭</el-button>
- </div>
- </el-dialog>
- </template>
- <script>
- import { parameterList } from '@/api/inspectionStandard';
- import { getList } from '@/api/inspectionProject';
- export default {
- components: {},
- props: {
- selectList: Array,
- type: {
- default: 1 //1多选 2单选
- }
- },
- data() {
- return {
- equipmentdialog: false,
- current: null,
- current1: null,
- columns: [
- {
- prop: 'code',
- label: '参数编码',
- // sortable: 'custom',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'name',
- label: '参数名称',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'textType',
- label: '参数类型',
- showOverflowTooltip: true,
- align: 'center',
- slot: 'textType',
- minWidth: 110
- },
- {
- align: 'center',
- prop: 'description',
- label: '文本描述',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'maxValue',
- label: '参数上限',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'minValue',
- label: '参数下限',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'defaultValue',
- label: '默认值',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'categoryType',
- label: '参数分类',
- align: 'center',
- slot: 'status',
- showOverflowTooltip: true
- }
- ],
- columns1: [
- {
- prop: 'inspectionCode',
- label: '编码'
- },
- {
- label: '质检项名称',
- prop: 'inspectionName'
- },
- // {
- // label: '是否生成过程',
- // prop: 'isCreateCourse',
- // formatter: (row, column, cellValue) => {
- // return cellValue == 1 ? '是' : cellValue === 0 ? '否' : '';
- // }
- // },
- {
- label: '质检标准',
- prop: 'inspectionStandard'
- },
- // {
- // label: '质检工具',
- // prop: 'inspectionTool'
- // },
- {
- label: '状态',
- prop: 'status',
- formatter: (row, column, cellValue) => {
- return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
- }
- },
- {
- label: '描述',
- prop: 'description'
- },
- {
- label: '备注',
- prop: 'inspectionRemark'
- }
- ],
- categoryLevelId: null,
- code: null,
- selection: [],
- ids: []
- };
- },
- watch: {},
- methods: {
- datasource({ page, where, limit }) {
- return parameterList({
- ...where,
- pageNum: page,
- size: limit
- });
- },
- datasource1({ page, where, limit }) {
- return getList({
- ...where,
- pageNum: page,
- size: limit
- });
- },
- open() {
- this.equipmentdialog = true;
- },
- handleClose() {
- this.equipmentdialog = false;
- },
- // 选择
- selected() {
- this.$emit('choose', {
- parameter: JSON.parse(JSON.stringify(this.current)),
- project: JSON.parse(JSON.stringify(this.current1))
- });
- this.handleClose();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .title {
- font-size: 16px;
- margin-bottom: 20px;
- }
- .btns {
- text-align: center;
- padding: 10px 0;
- }
- </style>
|