1
李喆(开发组)
2025-06-13 337503701c6ebaf24d515dc1cc0ae5be522d180f
1
已添加1个文件
288 ■■■■■ 文件已修改
src/views/basesetting/machine.vue 288 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basesetting/machine.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,288 @@
<template>
  <basic-container>
    <avue-crud
      :addBtn="false"
      :option="option"
      :table-loading="loading"
      :data="data"
      ref="crud"
      v-model:search="search"
      v-model:page="mypage"
      @search-change="searchChange"
      @search-reset="searchReset"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template #menu-left>
        <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">导出</el-button>
        <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleView">导入</el-button>
      </template>
      <template #menu="scope">
        <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleEdit(scope.row, scope.index)">编辑</el-button>
        <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">删除</el-button>
        <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleView(scope.row, scope.index)">产生机床回传机构树</el-button>
      </template>
      <template #status="{ row }">
        <span>{{ row.status=="1"?"启用":"禁用" }}</span>
      </template>
    </avue-crud>
    <el-dialog title="编辑" append-to-body v-model="editBox" width="60%">
      <avue-form ref="editFormModal" :option="editFormModal" v-model="form" @submit="formSubmit" />
    </el-dialog>
  </basic-container>
</template>
<script>
export default {
  data() {
    var that = this;
    return {
      editBox: false,
      search: {
        keyword: "",
        machineGroupCode: ""
      },
      loading: true,
      mypage: {
        size: 10,
        current: 1,
        total: 0,
      },
      option: {
        index: true,
        addBtn: false,
        editBtn: false,
        delBtn: false,
        labelWidth: 120,
        emptyBtn: false,
        searchSpan: 8,
        column: [
          {
            label: '编号/名称',
            type: 'input',
            prop: 'keyword',
            search: true,
            hide: true
          },
          {
            label: '机床编号',
            prop: 'code'
          },
          {
            label: '机床型号',
            prop: 'name',
          },
          {
            label: '机床组',
            prop: 'machineGroupName',
            search: true,
            type: 'select',
            dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
            props: {
              label: 'dictValue',
              value: 'dictKey',
            },
            span: "8"
          },
          {
            label: '机床类型',
            prop: 'machineSpecName',
          },
          {
            label: '生产厂商',
            prop: 'manufacturer',
          },
          {
            label: '操作员',
            prop: 'operator',
          },
          {
            label: '状态',
            prop: 'status',
            slot: true,
          },
        ],
      },
      editFormModal: {
        labelWidth: 160,
        submitBtn: true,
        submitText: "保存",
        emptyBtn: false,
        column: [
          {
            label: '机床编号',
            prop: 'code',
            type: 'input',
            span: 12,
            dataType: 'string',
          },
          {
            label: '机床型号',
            prop: '',
            type: 'input',
            span: 12,
            dataType: 'string',
          },
          {
            label: '机床类型',
            prop: '',
            type: 'select',
            span: 12,
            dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
            props: {
              label: 'dictValue',
              value: 'dictKey',
            }
          },
          {
            label: '所属机床组',
            prop: '',
            type: 'select',
            span: 12,
            dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
            props: {
              label: 'dictValue',
              value: 'dictKey',
            }
          },
          {
            label: '操作员',
            prop: '',
            type: 'input',
            span: 12,
            dataType: 'string',
          },
          {
            label: '所属组织',
            prop: '',
            type: 'select',
            span: 12,
            dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
            props: {
              label: 'dictValue',
              value: 'dictKey',
            }
          },
          {
            label: '生产商',
            prop: '',
            type: 'input',
            span: 12,
            dataType: 'string',
          },
          {
            label: '轮询时间(小时)',
            prop: '',
            type: 'input',
            span: 12,
            dataType: 'string',
          },
          {
            label: '系统控制',
            prop: '',
            type: 'select',
            span: 12,
            dicUrl: '/blade-system/dict-biz/dictionary?code=machine_control_system',
            props: {
              label: 'dictValue',
              value: 'dictKey',
            }
          },
          {
            label: '状态',
            prop: 'checkbox',
            type: 'checkbox',
            span: 12,
            dicData: [{
              label: '启用',
              value: 1
            }]
          },
          {
            label: '程序下发目录',
            prop: '',
            type: 'input',
            span: 12,
            dataType: 'string',
          },
          {
            label: '程序回传目录',
            prop: '',
            type: 'input',
            span: 12,
            dataType: 'string',
          },
          {
            label: '备注',
            prop: '',
            type: 'textarea',
            span: 24,
            dataType: 'string',
          },
        ]
      },
      data: [],
    };
  },
  methods: {
    handleEdit() {
      this.editBox = true;
    },
    formSubmit() {
    },
    handleView() {
    },
    searchReset() {
      //this.onLoad(this.mypage);
    },
    searchChange(params, done) {
      this.mypage.current = 1;
      this.onLoad();
      done();
    },
    currentChange(current) {
      this.mypage.current = current;
    },
    sizeChange(size) {
      this.mypage.size = size;
    },
    refreshChange() {
    },
    onLoad(page, params = {}) {
      this.loading = true;
      var obj = {
        keyword: this.search.keyword,
        machineGroupCode: this.search.machineGroupCode,
        current: this.mypage.current,
        size: this.mypage.size,
      }
      axios({
        url: '/blade-mdm/machine/page',
        method: 'get',
        date: obj,
      }).then(
        res => {
          const data = res.data.data;
          this.mypage.total = data.total;
          this.data = data.records;
          this.loading = false;
        },
        error => {
        }
      );
    }
  },
};
</script>
<style lang="scss">
</style>