| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <ele-modal
- title="选择工艺路线"
- custom-class="ele-dialog-form long-dialog-form"
- :visible.sync="visible"
- :before-close="handleClose"
- :close-on-click-modal="false"
- top="5vh"
- :close-on-press-escape="false"
- append-to-body
- width="70%"
- :maxable="true"
- >
- <el-card shadow="never">
- <route-search @search="reload"></route-search>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- row-key="id"
- height="calc(100vh - 460px)"
- class="dict-table"
- @cell-click="cellClick"
- >
- <template v-slot:action="{ row }">
- <el-radio class="radio" v-model="radio" :label="row.id"
- ><i></i
- ></el-radio>
- </template>
- </ele-pro-table>
- </el-card>
- <div slot="footer">
- <el-button type="primary" size="small" @click="selected">选择</el-button>
- <el-button size="small" @click="handleClose">关闭</el-button>
- </div>
- </ele-modal>
- </template>
- <script>
- import { routeList } from '@/api/aps';
- import { reviewStatus } from '@/enum/dict';
- import routeSearch from './routeSearch.vue'
- export default {
- components: {
- routeSearch
- },
- props: {},
- data() {
- return {
- visible: false,
- columns: [
- {
- action: 'action',
- slot: 'action',
- align: 'center',
- label: '选择'
- },
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- label: '工艺路线编码',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110,
- slot: 'code'
- },
- {
- prop: 'name',
- label: '工艺路线名称',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'version',
- label: '工艺路线版本',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- slot: 'status',
- showOverflowTooltip: true,
- minWidth: 110,
- // filters: [
- // { text: '草稿', value: -1 },
- // { text: '失效', value: 0 },
- // { text: '生效', value: 1 }
- // ],
- filterMultiple: false,
- columnKey: 'status',
- formatter:(row)=>{
- if(row.status == -1){
- return '草稿'
- }else if(row.status == 0){
- return '失效'
- }else{
- return '生效'
- }
- }
- },
- {
- prop: 'approvalStatus',
- label: '审核状态',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100,
- formatter: (_row, _column, cellValue) => {
- return reviewStatus[_row.approvalStatus];
- }
- },
- {
- prop: 'factoriesName',
- label: '所属工厂',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- align: 'center',
- prop: 'createTime',
- label: '创建时间',
- showOverflowTooltip: true,
- minWidth: 110
- },
- ],
- radio: null
- };
- },
- watch: {},
- methods: {
- open(item) {
- if (item) {
- this.radio = item.id;
- }
- this.visible = true;
- },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return routeList({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ page: 1, where });
- },
- handleNodeClick(data, node) {
- this.curNodeData = data;
- this.reload({ categoryId: data.id });
- },
- // 单击获取id
- cellClick(row) {
- this.current = row;
- this.radio = row.id;
- },
- handleClose() {
- this.visible = false;
- this.current = null;
- this.radio = '';
- },
- selected() {
- if (!this.current) {
- return this.$message.warning('请选择工艺路线');
- }
- this.$emit('changeParent', this.current);
- this.handleClose();
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|