| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <div class="switch">
- <div class="switch_left">
- <ul>
- <li
- v-for="item in tabOptions"
- :key="item.key"
- :class="{ active: activeComp == item.key }"
- @click="activeComp = item.key"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- <!-- <div class="right" style="padding: 10px">
- <el-button @click="$router.go(-1)">返回</el-button>
- </div> -->
- </div>
- <div class="main">
- <div v-if="activeComp == 'point'">
- <InspectionPoint />
- </div>
- <div v-if="activeComp == 'anmac'">
- <Maintenance />
- </div>
- <div v-if="activeComp == 'plan'" class="plan">
- <inventory-search @search="reload"> </inventory-search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- cache-key="systemRoleTable14"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-plus"
- class="ele-btn-icon"
- @click="openEdit()"
- >
- 新建
- </el-button>
- <el-button
- size="small"
- type="primary"
- class="ele-btn-icon"
- @click="goDetail()"
- >
- 详情
- </el-button>
- </template>
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="openEdit(row)"
- >
- 修改
- </el-link>
- <el-popconfirm
- class="ele-action"
- title="确定要删除此角色吗?"
- @confirm="remove(row)"
- >
- <template v-slot:reference>
- <el-link
- type="danger"
- :underline="false"
- icon="el-icon-delete"
- >
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- </template>
- </ele-pro-table>
- </div>
- <div v-if="activeComp == 'measuringSubmit'">
- <InspectionPoint />
- </div>
- </div>
- </el-card>
- <!-- 新建或编辑弹窗 -->
- <AddInventoryDialog
- ref="addInventoryDialogRef"
- :dialogTile="dialogTitle"
- @refreshList="resetForm"
- :isBindPlan="isBindPlan"
- />
- </div>
- </template>
- <script>
- import InspectionPoint from '../inspectionPoint';
- import Maintenance from '../maintenance';
- import InventorySearch from './components/inventory-search.vue';
- import AddInventoryDialog from './components/addInventoryDialog.vue';
- import { pageRoles } from '@/api/system/role';
- export default {
- components: {
- InventorySearch,
- AddInventoryDialog,
- InspectionPoint,
- Maintenance
- },
- data() {
- return {
- activeComp: 'point',
- tabOptions: [
- { key: 'point', name: '巡点检配置' },
- { key: 'anmac', name: '保养配置' },
- { key: 'plan', name: '盘点配置' },
- { key: 'measuringSubmit', name: '量具送检配置' }
- ],
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- label: '计划单号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'groupId',
- label: '盘点名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'enable',
- label: '盘点仓库',
- align: 'center',
- showOverflowTooltip: true,
- slot: 'enable',
- minWidth: 110
- },
- {
- prop: 'name',
- label: '盘点部门',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'type',
- label: '资产分类',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'cycle',
- label: '规则名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'auto',
- label: '自动派单',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'creater',
- label: '创建人',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110,
- formatter: (_row, _column, cellValue) => {
- return this.$util.toDateString(cellValue);
- }
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 150,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- }
- ],
- // 加载状态
- loading: false,
- pageType: 'add',
- dialogTitle: '',
- isBindPlan: false
- };
- },
- computed: {},
- methods: {
- // 重置
- resetForm() {
- this.$refs.configFormRef.resetFields();
- // this.searchForm()
- },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return pageRoles({ pageNum: page, size: limit, ...where });
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ page: 1, where });
- },
- openEdit(row) {
- this.isBindPlan = false;
- this.dialogTitle = '新增盘点计划配置';
- this.$refs.addInventoryDialogRef.dialogVisible = true;
- // this.$store.dispatch('planRules/setAddOrUpdate', 'add')
- },
- goDetail() {
- this.$router.push({
- path: '/rulesManagement/planRules/detail'
- // query: {
- // id
- // }
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-card__body {
- padding-top: 0;
- padding-left: 0;
- }
- .main {
- padding-left: 17px;
- .plan {
- padding-top: 15px;
- }
- }
- </style>
|