|
@@ -1,51 +1,120 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="ele-body">
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never" v-loading="loading">
|
|
<el-card shadow="never" v-loading="loading">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ :model="queryParams"
|
|
|
|
|
+ ref="queryForm"
|
|
|
|
|
+ :inline="true"
|
|
|
|
|
+ v-show="showSearch"
|
|
|
|
|
+ label-width="68px"
|
|
|
|
|
+ >
|
|
|
<el-form-item label="年份" prop="year">
|
|
<el-form-item label="年份" prop="year">
|
|
|
- <el-select v-model="queryParams.year" placeholder="请选择年份" clearable>
|
|
|
|
|
- <el-option v-for="item in year_select" :key="item.value" :label="item.value"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.year"
|
|
|
|
|
+ placeholder="请选择年份"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in year_select"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.value"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="月份" prop="month">
|
|
<el-form-item label="月份" prop="month">
|
|
|
- <el-select v-model="queryParams.month" placeholder="请选择月份" clearable>
|
|
|
|
|
- <el-option v-for="item in month_select" :key="item.value" :label="item.value"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.month"
|
|
|
|
|
+ placeholder="请选择月份"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in month_select"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.value"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleQuery"
|
|
|
|
|
+ >搜索</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
|
+ >重置</el-button
|
|
|
|
|
+ >
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
- <ele-pro-table ref="tableRef" :columns="columns" :datasource="capacityList" :pageSize="20"
|
|
|
|
|
- :pageSizes="[20, 30, 40, 50, 100]" row-key="id" @selection-change="handleSelectionChange">
|
|
|
|
|
|
|
+ <ele-pro-table
|
|
|
|
|
+ ref="tableRef"
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ :datasource="capacityList"
|
|
|
|
|
+ :pageSize="20"
|
|
|
|
|
+ :pageSizes="[20, 30, 40, 50, 100]"
|
|
|
|
|
+ row-key="id"
|
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
|
+ >
|
|
|
<template v-slot:toolbar>
|
|
<template v-slot:toolbar>
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
|
|
|
|
- <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
|
|
|
|
- @click="handleUpdate">修改</el-button>
|
|
|
|
|
- <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
|
|
|
|
- @click="handleDelete">删除</el-button>
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="handleAdd"
|
|
|
|
|
+ >新增</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :disabled="single"
|
|
|
|
|
+ @click="handleUpdate"
|
|
|
|
|
+ >修改</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :disabled="multiple"
|
|
|
|
|
+ @click="handleDelete"
|
|
|
|
|
+ >删除</el-button
|
|
|
|
|
+ >
|
|
|
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
<!-- <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
:disabled="single">详情</el-button> -->
|
|
:disabled="single">详情</el-button> -->
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:plannedCapacity="{ row }">
|
|
<template v-slot:plannedCapacity="{ row }">
|
|
|
- {{ row.plannedCapacity }}{{ row.plannedCapacityUnit ? row.plannedCapacityUnit : '' }}
|
|
|
|
|
|
|
+ {{ row.plannedCapacity
|
|
|
|
|
+ }}{{ row.plannedCapacityUnit ? row.plannedCapacityUnit : '' }}
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:averageDailyCapacity="{ row }">
|
|
<template v-slot:averageDailyCapacity="{ row }">
|
|
|
- {{ row.averageDailyCapacity }}{{ row.plannedCapacityUnit ? row.plannedCapacityUnit : '' }}
|
|
|
|
|
|
|
+ {{ row.averageDailyCapacity
|
|
|
|
|
+ }}{{ row.plannedCapacityUnit ? row.plannedCapacityUnit : '' }}
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link type="primary" :underline="false" @click="handleExport(row)">
|
|
<el-link type="primary" :underline="false" @click="handleExport(row)">
|
|
|
详情
|
|
详情
|
|
|
</el-link>
|
|
</el-link>
|
|
|
- <el-link type="primary" :underline="false" icon="el-icon-edit" @click="handleUpdate(row)">
|
|
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
|
+ @click="handleUpdate(row)"
|
|
|
|
|
+ >
|
|
|
修改
|
|
修改
|
|
|
</el-link>
|
|
</el-link>
|
|
|
- <el-popconfirm class="ele-action" title='是否确认删除此数据?' @confirm="handleDelete(row)">
|
|
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ class="ele-action"
|
|
|
|
|
+ title="是否确认删除此数据?"
|
|
|
|
|
+ @confirm="handleDelete(row)"
|
|
|
|
|
+ >
|
|
|
<template v-slot:reference>
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
删除
|
|
删除
|
|
@@ -55,53 +124,93 @@
|
|
|
</template>
|
|
</template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<!-- 添加或修改工厂月产能定义对话框 -->
|
|
<!-- 添加或修改工厂月产能定义对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="70%" :close-on-click-modal="false" modal-append-to-body
|
|
|
|
|
- append-to-body>
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ :title="title"
|
|
|
|
|
+ :visible.sync="open"
|
|
|
|
|
+ width="70%"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ modal-append-to-body
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
<el-form-item label="工厂" prop="factoriesId">
|
|
<el-form-item label="工厂" prop="factoriesId">
|
|
|
<el-select v-model="form.factoriesId">
|
|
<el-select v-model="form.factoriesId">
|
|
|
- <el-option v-for="item of factoryList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item of factoryList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="年份" prop="year">
|
|
<el-form-item label="年份" prop="year">
|
|
|
<el-select v-model="form.year" placeholder="请选择年份">
|
|
<el-select v-model="form.year" placeholder="请选择年份">
|
|
|
- <el-option v-for="item in year_select" :key="item.value" :label="item.value"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in year_select"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.value"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="月份" prop="month">
|
|
<el-form-item label="月份" prop="month">
|
|
|
<el-select v-model="form.month" placeholder="请选择月份">
|
|
<el-select v-model="form.month" placeholder="请选择月份">
|
|
|
- <el-option v-for="item in month_select" :key="item.value" :label="item.value"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in month_select"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.value"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="规划产能" prop="plannedCapacity">
|
|
<el-form-item label="规划产能" prop="plannedCapacity">
|
|
|
- <div style="display: flex;align-items: center;justify-content: space-between;">
|
|
|
|
|
- <el-input v-model="form.plannedCapacity" placeholder="请输入规划产能" style="width: calc(100% - 300px)"
|
|
|
|
|
- @input="handleInput1" />
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ style="
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="form.plannedCapacity"
|
|
|
|
|
+ placeholder="请输入规划产能"
|
|
|
|
|
+ style="width: calc(100% - 300px)"
|
|
|
|
|
+ @input="handleInput1"
|
|
|
|
|
+ />
|
|
|
|
|
|
|
|
<el-select v-model="form.measureType" placeholder="计量类型">
|
|
<el-select v-model="form.measureType" placeholder="计量类型">
|
|
|
- <el-option v-for="item in measureTypeList" :key="item.value" :label="item.label"
|
|
|
|
|
- :value="item.value"></el-option>
|
|
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in measureTypeList"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
|
|
|
<!-- <el-select v-model="form.plannedCapacityUnit" placeholder="计量单位">
|
|
<!-- <el-select v-model="form.plannedCapacityUnit" placeholder="计量单位">
|
|
|
<el-option v-for="item in month_select" :key="item.value" :label="item.value"
|
|
<el-option v-for="item in month_select" :key="item.value" :label="item.value"
|
|
|
:value="item.value"></el-option>
|
|
:value="item.value"></el-option>
|
|
|
</el-select> -->
|
|
</el-select> -->
|
|
|
- <DictSelection dictName="计量单位" v-model="form.plannedCapacityUnit" filterable clearable
|
|
|
|
|
- style="width: 100px;">
|
|
|
|
|
|
|
+ <DictSelection
|
|
|
|
|
+ dictName="计量单位"
|
|
|
|
|
+ v-model="form.plannedCapacityUnit"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ style="width: 100px"
|
|
|
|
|
+ >
|
|
|
</DictSelection>
|
|
</DictSelection>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="工作日天数" prop="expandedCapacity">
|
|
<el-form-item label="工作日天数" prop="expandedCapacity">
|
|
|
- <el-input v-model="form.expandedCapacity" placeholder="请输入工作日天数" @input="handleInput2">
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="form.expandedCapacity"
|
|
|
|
|
+ placeholder="请输入工作日天数"
|
|
|
|
|
+ @input="handleInput2"
|
|
|
|
|
+ >
|
|
|
<template v-slot:append>天</template>
|
|
<template v-slot:append>天</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
-
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="getWorkDay">同步工作日</el-button>
|
|
<el-button type="primary" @click="getWorkDay">同步工作日</el-button>
|
|
@@ -109,17 +218,45 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
- <el-dialog :title="titleDetail" :visible.sync="openDetail" width="65%" append-to-body>
|
|
|
|
|
- <el-table v-loading="loading" :data="factory_capacity_detailList" height="550">
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ :title="titleDetail"
|
|
|
|
|
+ :visible.sync="openDetail"
|
|
|
|
|
+ width="65%"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ :data="factory_capacity_detailList"
|
|
|
|
|
+ height="550"
|
|
|
|
|
+ >
|
|
|
<el-table-column label="序号" align="center" prop="id" />
|
|
<el-table-column label="序号" align="center" prop="id" />
|
|
|
<el-table-column label="年份" align="center" prop="year" />
|
|
<el-table-column label="年份" align="center" prop="year" />
|
|
|
<el-table-column label="月份" align="center" prop="month" />
|
|
<el-table-column label="月份" align="center" prop="month" />
|
|
|
<el-table-column label="日期" align="center" prop="day" />
|
|
<el-table-column label="日期" align="center" prop="day" />
|
|
|
- <el-table-column label="规划产能" align="center" prop="plannedCapacity" />
|
|
|
|
|
- <el-table-column label="已排产产能" align="center" prop="plannedSumCapacity" />
|
|
|
|
|
- <el-table-column label="已排产单号" align="center" prop="plannedOrder" width="120" show-overflow-tooltip />
|
|
|
|
|
- <el-table-column label="已排产产能" align="center" prop="plannedOrderCapacity" width="120" show-overflow-tooltip />
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="规划产能"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="plannedCapacity"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="已排产产能"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="plannedSumCapacity"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="已排产单号"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="plannedOrder"
|
|
|
|
|
+ width="120"
|
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="已排产产能"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="plannedOrderCapacity"
|
|
|
|
|
+ width="120"
|
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
|
+ />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -127,21 +264,37 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { listSchedule, getSchedule, delSchedule, addSchedule, updateSchedule } from "@/api/aps_workday_schedule/schedule";
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ listSchedule,
|
|
|
|
|
+ getSchedule,
|
|
|
|
|
+ delSchedule,
|
|
|
|
|
+ addSchedule,
|
|
|
|
|
+ updateSchedule
|
|
|
|
|
+} from '@/api/aps_workday_schedule/schedule';
|
|
|
|
|
|
|
|
-import { listCapacity, getCapacity, delCapacity, addCapacity, updateCapacity } from "@/api/aps/capacity";
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ listCapacity,
|
|
|
|
|
+ getCapacity,
|
|
|
|
|
+ delCapacity,
|
|
|
|
|
+ addCapacity,
|
|
|
|
|
+ updateCapacity
|
|
|
|
|
+} from '@/api/aps/capacity';
|
|
|
|
|
|
|
|
-import { listFactory_capacity_detail, getFactory_capacity_detail, delFactory_capacity_detail, addFactory_capacity_detail, updateFactory_capacity_detail } from "@/api/aps/factory_capacity_detail";
|
|
|
|
|
import {
|
|
import {
|
|
|
- getFactoryList
|
|
|
|
|
-} from '@/api/saleOrder';
|
|
|
|
|
|
|
+ listFactory_capacity_detail,
|
|
|
|
|
+ getFactory_capacity_detail,
|
|
|
|
|
+ delFactory_capacity_detail,
|
|
|
|
|
+ addFactory_capacity_detail,
|
|
|
|
|
+ updateFactory_capacity_detail
|
|
|
|
|
+} from '@/api/aps/factory_capacity_detail';
|
|
|
|
|
+import { getFactoryList } from '@/api/saleOrder';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- name: "Capacity",
|
|
|
|
|
|
|
+ name: 'Capacity',
|
|
|
// dicts: ['year_select','month_select'],
|
|
// dicts: ['year_select','month_select'],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- titleDetail: "工厂能力详情",
|
|
|
|
|
|
|
+ titleDetail: '工厂能力详情',
|
|
|
openDetail: false,
|
|
openDetail: false,
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
|
loading: true,
|
|
loading: true,
|
|
@@ -149,7 +302,10 @@ export default {
|
|
|
ids: [],
|
|
ids: [],
|
|
|
scheduleList: [],
|
|
scheduleList: [],
|
|
|
year_select: [
|
|
year_select: [
|
|
|
- { "value": 2025 }, { "value": 2026 }, { "value": 2027 }, { "value": 2028 }
|
|
|
|
|
|
|
+ { value: 2025 },
|
|
|
|
|
+ { value: 2026 },
|
|
|
|
|
+ { value: 2027 },
|
|
|
|
|
+ { value: 2028 }
|
|
|
],
|
|
],
|
|
|
measureTypeList: [
|
|
measureTypeList: [
|
|
|
{
|
|
{
|
|
@@ -159,12 +315,21 @@ export default {
|
|
|
{
|
|
{
|
|
|
label: '重量',
|
|
label: '重量',
|
|
|
value: 2
|
|
value: 2
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
],
|
|
],
|
|
|
month_select: [
|
|
month_select: [
|
|
|
- { "value": 1 }, { "value": 2 }, { "value": 3 }, { "value": 4 },
|
|
|
|
|
- { "value": 5 }, { "value": 6 }, { "value": 7 }, { "value": 8 },
|
|
|
|
|
- { "value": 9 }, { "value": 10 }, { "value": 11 }, { "value": 12 },
|
|
|
|
|
|
|
+ { value: 1 },
|
|
|
|
|
+ { value: 2 },
|
|
|
|
|
+ { value: 3 },
|
|
|
|
|
+ { value: 4 },
|
|
|
|
|
+ { value: 5 },
|
|
|
|
|
+ { value: 6 },
|
|
|
|
|
+ { value: 7 },
|
|
|
|
|
+ { value: 8 },
|
|
|
|
|
+ { value: 9 },
|
|
|
|
|
+ { value: 10 },
|
|
|
|
|
+ { value: 11 },
|
|
|
|
|
+ { value: 12 }
|
|
|
],
|
|
],
|
|
|
// 非单个禁用
|
|
// 非单个禁用
|
|
|
single: true,
|
|
single: true,
|
|
@@ -179,7 +344,7 @@ export default {
|
|
|
// 工厂月产能定义详情表格数据
|
|
// 工厂月产能定义详情表格数据
|
|
|
factory_capacity_detailList: [],
|
|
factory_capacity_detailList: [],
|
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
|
|
|
|
+ title: '',
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
// 查询参数
|
|
// 查询参数
|
|
@@ -195,8 +360,7 @@ export default {
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {},
|
|
form: {},
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
- rules: {
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ rules: {},
|
|
|
columns: [
|
|
columns: [
|
|
|
{
|
|
{
|
|
|
width: 45,
|
|
width: 45,
|
|
@@ -208,41 +372,41 @@ export default {
|
|
|
{
|
|
{
|
|
|
prop: 'id',
|
|
prop: 'id',
|
|
|
label: '序号',
|
|
label: '序号',
|
|
|
- align: 'center',
|
|
|
|
|
|
|
+ align: 'center'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'year',
|
|
prop: 'year',
|
|
|
label: '年份',
|
|
label: '年份',
|
|
|
- align: 'center',
|
|
|
|
|
|
|
+ align: 'center'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'month',
|
|
prop: 'month',
|
|
|
label: '月份',
|
|
label: '月份',
|
|
|
- align: 'center',
|
|
|
|
|
|
|
+ align: 'center'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'plannedCapacity',
|
|
prop: 'plannedCapacity',
|
|
|
slot: 'plannedCapacity',
|
|
slot: 'plannedCapacity',
|
|
|
label: '规划产能',
|
|
label: '规划产能',
|
|
|
- align: 'center',
|
|
|
|
|
|
|
+ align: 'center'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'expandedCapacity',
|
|
prop: 'expandedCapacity',
|
|
|
label: '工作日天数',
|
|
label: '工作日天数',
|
|
|
- align: 'center',
|
|
|
|
|
|
|
+ align: 'center'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'averageDailyCapacity',
|
|
prop: 'averageDailyCapacity',
|
|
|
label: '平均天产能',
|
|
label: '平均天产能',
|
|
|
slot: 'averageDailyCapacity',
|
|
slot: 'averageDailyCapacity',
|
|
|
- align: 'center',
|
|
|
|
|
|
|
+ align: 'center'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'factoriesName',
|
|
prop: 'factoriesName',
|
|
|
label: '工厂名称',
|
|
label: '工厂名称',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- width: 120,
|
|
|
|
|
|
|
+ width: 120
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
columnKey: 'action',
|
|
columnKey: 'action',
|
|
@@ -268,20 +432,21 @@ export default {
|
|
|
/** 查询APS月度班制排班列表 */
|
|
/** 查询APS月度班制排班列表 */
|
|
|
getWorkDay() {
|
|
getWorkDay() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- listSchedule({ "year": this.form.year, "month": this.form.month }).then(response => {
|
|
|
|
|
- this.scheduleList = response.data;
|
|
|
|
|
- if (this.scheduleList == null || this.scheduleList.length == 0) {
|
|
|
|
|
- this.$message.success("没有配置工作日");
|
|
|
|
|
- this.form.expandedCapacity = 0;
|
|
|
|
|
|
|
+ listSchedule({ year: this.form.year, month: this.form.month }).then(
|
|
|
|
|
+ (response) => {
|
|
|
|
|
+ this.scheduleList = response.data;
|
|
|
|
|
+ if (this.scheduleList == null || this.scheduleList.length == 0) {
|
|
|
|
|
+ this.$message.success('没有配置工作日');
|
|
|
|
|
+ this.form.expandedCapacity = 0;
|
|
|
|
|
+ } else this.form.expandedCapacity = this.scheduleList[0].workdayCount;
|
|
|
}
|
|
}
|
|
|
- else this.form.expandedCapacity = this.scheduleList[0].workdayCount;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
/** 查询工厂月产能定义列表 */
|
|
/** 查询工厂月产能定义列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- listCapacity(this.queryParams).then(response => {
|
|
|
|
|
- console.log(response)
|
|
|
|
|
|
|
+ listCapacity(this.queryParams).then((response) => {
|
|
|
|
|
+ console.log(response);
|
|
|
this.capacityList = response.data;
|
|
this.capacityList = response.data;
|
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -309,7 +474,7 @@ export default {
|
|
|
expandedCapacity: null,
|
|
expandedCapacity: null,
|
|
|
averageDailyCapacity: null
|
|
averageDailyCapacity: null
|
|
|
};
|
|
};
|
|
|
- this.resetForm("form");
|
|
|
|
|
|
|
+ this.resetForm('form');
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
@@ -324,47 +489,46 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
|
|
- this.single = selection.length !== 1
|
|
|
|
|
- this.multiple = !selection.length
|
|
|
|
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
|
|
+ this.single = selection.length !== 1;
|
|
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
- this.title = "添加工厂月产能定义";
|
|
|
|
|
|
|
+ this.title = '添加工厂月产能定义';
|
|
|
},
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
|
|
- getCapacity(id).then(response => {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const id = row.id || this.ids;
|
|
|
|
|
+ getCapacity(id).then((response) => {
|
|
|
this.form = response.data.data;
|
|
this.form = response.data.data;
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
- this.title = "修改工厂月产能定义";
|
|
|
|
|
|
|
+ this.title = '修改工厂月产能定义';
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
|
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
delete this.form.averageDailyCapacity;
|
|
delete this.form.averageDailyCapacity;
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
|
- updateCapacity(this.form).then(response => {
|
|
|
|
|
|
|
+ updateCapacity(this.form).then((response) => {
|
|
|
if (response.data.code == -1) {
|
|
if (response.data.code == -1) {
|
|
|
return;
|
|
return;
|
|
|
- }
|
|
|
|
|
- this.$message.success("修改成功");
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$message.success('修改成功');
|
|
|
this.open = false;
|
|
this.open = false;
|
|
|
this.getList();
|
|
this.getList();
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- addCapacity(this.form).then(response => {
|
|
|
|
|
|
|
+ addCapacity(this.form).then((response) => {
|
|
|
if (response.data.code == -1) {
|
|
if (response.data.code == -1) {
|
|
|
return;
|
|
return;
|
|
|
- }
|
|
|
|
|
- this.$message.success("新增成功");
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$message.success('新增成功');
|
|
|
this.open = false;
|
|
this.open = false;
|
|
|
this.getList();
|
|
this.getList();
|
|
|
});
|
|
});
|
|
@@ -375,12 +539,15 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
const ids = row.id || this.ids;
|
|
|
- this.$confirm('是否确认删除工厂月产能定义编号为"' + ids + '"的数据项?').then(function () {
|
|
|
|
|
- return delCapacity(ids);
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.getList();
|
|
|
|
|
- this.$message.success("删除成功");
|
|
|
|
|
- }).catch(() => { });
|
|
|
|
|
|
|
+ this.$confirm('是否确认删除工厂月产能定义编号为"' + ids + '"的数据项?')
|
|
|
|
|
+ .then(function () {
|
|
|
|
|
+ return delCapacity(ids);
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
|
handleExport(row) {
|
|
handleExport(row) {
|
|
@@ -395,7 +562,11 @@ export default {
|
|
|
// const ids = this.ids;
|
|
// const ids = this.ids;
|
|
|
console.log(row.id, 'dddd');
|
|
console.log(row.id, 'dddd');
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- listFactory_capacity_detail({ factoriesId: row.factoriesId, year: row.year, month: row.month }).then(response => {
|
|
|
|
|
|
|
+ listFactory_capacity_detail({
|
|
|
|
|
+ factoriesId: row.factoriesId,
|
|
|
|
|
+ year: row.year,
|
|
|
|
|
+ month: row.month
|
|
|
|
|
+ }).then((response) => {
|
|
|
this.factory_capacity_detailList = response.data;
|
|
this.factory_capacity_detailList = response.data;
|
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -405,8 +576,16 @@ export default {
|
|
|
this.form.plannedCapacity = this.$handleInputPublicHasPoint(val);
|
|
this.form.plannedCapacity = this.$handleInputPublicHasPoint(val);
|
|
|
},
|
|
},
|
|
|
handleInput2(val) {
|
|
handleInput2(val) {
|
|
|
- this.form.expandedCapacity = this.$handleInputPublicHasPoint(val);
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ let pureNum = val.replace(/[^0-9]/g, '');
|
|
|
|
|
+ if (pureNum.length > 1) {
|
|
|
|
|
+ pureNum = pureNum.replace(/^0+/, '');
|
|
|
|
|
+ }
|
|
|
|
|
+ if (pureNum === '0' || pureNum === '') {
|
|
|
|
|
+ this.form.expandedCapacity = '';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.expandedCapacity = pureNum;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|