日排程
This commit is contained in:
@@ -374,7 +374,7 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style src="./bootstrap.css" scoped></style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.list-element {
|
||||
padding: 10px;
|
||||
|
||||
@@ -8,63 +8,263 @@
|
||||
<el-form-item label="周">
|
||||
<el-input v-model="search.week" placeholder="输入周"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="日">
|
||||
<el-select v-model="search.date" placeholder="请选择日">
|
||||
<el-option label="周一" value="1"> </el-option>
|
||||
<el-option label="周二" value="2"> </el-option>
|
||||
<el-option label="周三" value="3"> </el-option>
|
||||
<el-option label="周四" value="4"> </el-option>
|
||||
<el-option label="周五" value="5"> </el-option>
|
||||
<el-option label="周六" value="6"> </el-option>
|
||||
<el-option label="周日" value="7"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleClick">搜索</el-button>
|
||||
</el-form>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="1.5"> <el-button type="primary" size="mini">新建工单</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="warning" size="mini" @click="importworkorder">导入工单</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="info" size="mini" @click="download_workorder">导出工单</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="danger" size="mini" @click="handleAllworkorder">删除工单</el-button> </el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
||||
<el-tab-pane label="周一" name="first">
|
||||
<el-button type="danger">紧急插单</el-button>
|
||||
<vxe-table
|
||||
border
|
||||
resizable
|
||||
show-overflow
|
||||
ref="xTable"
|
||||
height="500"
|
||||
:row-config="{ isHover: true }"
|
||||
:data="tableData"
|
||||
@cell-dblclick="cellDBLClickEvent"
|
||||
@radio-change="radioChangeEvent"
|
||||
>
|
||||
<vxe-column type="radio" width="60">
|
||||
<template #header>
|
||||
<vxe-button type="text" @click="clearRadioRowEevnt" :disabled="!selectRow">取消</vxe-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column type="seq" width="60"></vxe-column>
|
||||
<vxe-column field="year" title="年" width="80"></vxe-column>
|
||||
<vxe-column field="week" title="周" width="80"></vxe-column>
|
||||
<vxe-column field="week" title="日" width="80"></vxe-column>
|
||||
<vxe-column field="week" title="序号"></vxe-column>
|
||||
<vxe-column field="week" title="产品名称"></vxe-column>
|
||||
<vxe-column field="week" title="排程数量"></vxe-column>
|
||||
<vxe-column field="week" title="占用时间"></vxe-column>
|
||||
<vxe-column title="操作" width="100" show-overflow>
|
||||
<template>
|
||||
<vxe-button type="text" icon="vxe-icon-edit"></vxe-button>
|
||||
<vxe-button type="text" icon="vxe-icon-delete"></vxe-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="周二" name="second">配置管理</el-tab-pane>
|
||||
<el-tab-pane label="周三" name="third">角色管理</el-tab-pane>
|
||||
<el-tab-pane label="周四" name="fourth">定时任务补偿</el-tab-pane>
|
||||
<el-tab-pane label="周五" name="fourth">定时任务补偿</el-tab-pane>
|
||||
<el-tab-pane label="周六" name="fourth">定时任务补偿</el-tab-pane>
|
||||
<el-tab-pane label="周日" name="fourth">定时任务补偿</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
name="file"
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip"><el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的生产计划</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="download_.title" :visible.sync="download_.open" width="400px" append-to-body>
|
||||
<el-form :model="download_.query" inline>
|
||||
<el-form-item label="年">
|
||||
<el-input v-model="download_.query.year" placeholder="输入年份"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="周">
|
||||
<el-input v-model="download_.query.week" placeholder="输入周"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="日">
|
||||
<el-input v-model="download_.query.date" placeholder="输入日"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitdowm">确 定</el-button>
|
||||
<el-button @click="download_.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<vxe-table
|
||||
border
|
||||
resizable
|
||||
show-overflow
|
||||
ref="xTable"
|
||||
v-loading="loading_1"
|
||||
height="500"
|
||||
:row-config="{ isHover: true }"
|
||||
:data="workorder_table_data"
|
||||
>
|
||||
<vxe-column type="seq" width="60"></vxe-column>
|
||||
<vxe-column field="id" title="工单号"></vxe-column>
|
||||
<vxe-column field="blankNumber" title="毛坯号"></vxe-column>
|
||||
<vxe-column field="finishedPartNumber" title="成品零件号"></vxe-column>
|
||||
<vxe-column field="productDescription" title="产品描述"></vxe-column>
|
||||
<vxe-column field="colour" title="颜色"></vxe-column>
|
||||
<vxe-column field="specifications" title="规格"></vxe-column>
|
||||
<vxe-column field="codeNumber" title="编码号"></vxe-column>
|
||||
<vxe-column field="vehicleNumber" title="车数"></vxe-column>
|
||||
<vxe-column field="hangNumber" title="挂具摆放数"></vxe-column>
|
||||
<vxe-column field="previousNumber" title="上件数"></vxe-column>
|
||||
<vxe-column field="cylinderNumber" title="双组号缸号"></vxe-column>
|
||||
<vxe-column field="remark1" title="备注1"></vxe-column>
|
||||
<vxe-column field="remark2" title="备注2"></vxe-column>
|
||||
<vxe-column title="操作" width="100" show-overflow>
|
||||
<template #default>
|
||||
<vxe-button size="mini" type="text" status="primary" content="修改"></vxe-button>
|
||||
<vxe-button size="mini" type="text" status="danger" content="删除"></vxe-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
<pagination
|
||||
v-show="pagination.total > 0"
|
||||
:total="pagination.total"
|
||||
:page.sync="pagination.pageNum"
|
||||
:limit.sync="pagination.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getWorkoderList, dowmloadWorkorder,deleteAllWorkorder} from '@/api/productManagement/workoder_v2.js'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'workorder2',
|
||||
data() {
|
||||
return {
|
||||
search: {},
|
||||
activeName: '',
|
||||
search: {
|
||||
year: new Date().getFullYear(),
|
||||
week: null,
|
||||
date: null,
|
||||
},
|
||||
pagination: {
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
loading_1: true,
|
||||
workorder_table_data: [],
|
||||
upload: {
|
||||
// 用户导入参数
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: '',
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/mes/pro/workorder_v2/importData',
|
||||
},
|
||||
download_: {
|
||||
title: '下载生产工单',
|
||||
open: false,
|
||||
query: {
|
||||
year: 0,
|
||||
week: 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.getList()
|
||||
},
|
||||
//todo 获取生产工单列表
|
||||
getList() {
|
||||
const query = { ...this.search, ...this.pagination }
|
||||
if (query.week == null || query.week == undefined || query.week == '') query.week = -1
|
||||
if (query.year == null || query.year == undefined || query.year == '') query.year = -1
|
||||
getWorkoderList(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.loading_1 = false
|
||||
this.workorder_table_data = res.data.item1
|
||||
this.pagination.total = res.data.item2
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//todo 导入生产工单
|
||||
importworkorder() {
|
||||
this.upload.open = true
|
||||
this.upload.title = '生产工单导入'
|
||||
},
|
||||
//todo 下载模板
|
||||
importTemplate() {
|
||||
// @/utils/ruoyi"
|
||||
this.download('/mes/pro/workorder_v2/importTemplate', '生产工单导入模板')
|
||||
},
|
||||
|
||||
// todo 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true
|
||||
},
|
||||
//todo 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
//todo 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
if (response.code == 200) {
|
||||
this.$alert(response.data, '导入结果', { dangerouslyUseHTMLString: true })
|
||||
} else {
|
||||
this.$alert(response.msg, '导入结果', {
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
|
||||
this.getList()
|
||||
},
|
||||
|
||||
//todo 下载
|
||||
async submitdowm() {
|
||||
this.download_.open = false
|
||||
await dowmloadWorkorder(this.download_.query)
|
||||
},
|
||||
//todo
|
||||
download_workorder() {
|
||||
this.download_.open = true
|
||||
this.download_.query.year = this.search.year
|
||||
this.download_.query.week = this.search.week
|
||||
this.download_.query.date = this.search.date
|
||||
},
|
||||
|
||||
//todo 删除本周计划
|
||||
handleAllworkorder() {
|
||||
if (this.search.week == undefined||this.search.date == undefined ) {
|
||||
return
|
||||
}
|
||||
const query = {
|
||||
year: this.search.year,
|
||||
week: this.search.week,
|
||||
date: this.search.date,
|
||||
}
|
||||
|
||||
this.$modal
|
||||
.confirm('是否确认删除本周所有生产计划?')
|
||||
.then(function () {
|
||||
return deleteAllWorkorder(query)
|
||||
// return deleteworkplan(query)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data>1) {
|
||||
this.$notify.success('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.$notify.error('删除失败')
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -14,13 +14,75 @@
|
||||
<el-form-item label="颜色">
|
||||
<el-input v-model="search.color" placeholder="输入颜色名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleClick">搜索</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-col :span="1.5"> <el-button type="primary" size="mini" @click="addworkplan">新建生产计划</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="warning" size="mini" @click="importworkplan">导入生产计划</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="info" size="mini" @click="download_workplan">导出生产计划</el-button> </el-col>
|
||||
<el-col :span="1.5"> <el-button type="danger" size="mini" @click="handleAllworkplan">删除本周计划</el-button> </el-col>
|
||||
<el-col :span="13" style="float: right">
|
||||
<el-form :model="weekAll" inline class="form_define">
|
||||
<!-- 周汇总 -->
|
||||
<el-form-item label="本周要货数量">
|
||||
<el-tag type="success">{{ weekAll.requireNum }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单需生产挂具数量">
|
||||
<el-tag type="success">{{ weekAll.requireHanger }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="圈数">
|
||||
<el-tag type="success">{{ weekAll.turnnum }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单生产时间(分钟)">
|
||||
<el-tag type="success">{{ weekAll.productiontime }}</el-tag>
|
||||
</el-form-item>
|
||||
</el-form></el-col
|
||||
>
|
||||
</el-row>
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
name="file"
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip"><el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的生产计划</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :title="download_.title" :visible.sync="download_.open" width="400px" append-to-body>
|
||||
<el-form :model="download_.query" inline>
|
||||
<el-form-item label="年">
|
||||
<el-input v-model="download_.query.year" placeholder="输入年份"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="周">
|
||||
<el-input v-model="download_.query.week" placeholder="输入周"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitdowm">确 定</el-button>
|
||||
<el-button @click="download_.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<vxe-table
|
||||
border
|
||||
resizable
|
||||
@@ -67,7 +129,7 @@
|
||||
|
||||
<!-- 添加或修改生产计划对话框 -->
|
||||
<el-dialog :title="dialog.title" :visible.sync="dialog.open" width="63%">
|
||||
<el-form :model="workplanItem" :rules="rules" ref="dialog">
|
||||
<el-form :model="workplanItem" :rules="rules" ref="workplan">
|
||||
<el-row>
|
||||
<el-col :span="8"
|
||||
><el-form-item label="毛坯号" prop="blankNum"> <el-input v-model="workplanItem.blankNum" placeholder="毛坯号"></el-input> </el-form-item
|
||||
@@ -98,7 +160,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品合格率%" prop="qualificationRate">
|
||||
<el-form-item label="产品合格率(0.9)" prop="qualificationRate">
|
||||
<el-input v-model="workplanItem.qualificationRate" placeholder="产品合格率" type="number"></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
@@ -110,6 +172,7 @@
|
||||
<el-input v-model="workplanItem.productionBeat" placeholder="生产节拍(分钟)"></el-input> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总挂具数" prop="allHangerNum">
|
||||
@@ -125,10 +188,18 @@
|
||||
<el-form-item label="圈数"> <el-input v-model="calculate_turnNumber" placeholder="圈数" disabled></el-input> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="订单生产时间(分钟)">
|
||||
<el-input v-model="calculate_productTime" placeholder="订单生产时间(分钟)" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="订单生产时间(分钟)">
|
||||
<el-input v-model="calculate_productTime" placeholder="订单生产时间(分钟)" disabled></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="年"> <el-input v-model="workplanItem.year" placeholder="年"></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="周次"> <el-input v-model="workplanItem.week" placeholder="周次"></el-input> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -136,61 +207,27 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 周汇总 -->
|
||||
<el-form :model="weekAll" inline>
|
||||
<el-form-item label="本周要货数量">
|
||||
<el-input v-model="weekAll.requireNum" placeholder="本周要货数量" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单需生产挂具数量">
|
||||
<el-input v-model="weekAll.requireHanger" placeholder="订单需生产挂具数量" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="圈数">
|
||||
<el-input v-model="weekAll.turnnum" placeholder="圈数" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单生产时间(分钟)">
|
||||
<el-input v-model="weekAll.productiontime" placeholder="订单生产时间(分钟)" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
name="file"
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip"><el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getWorkplanList, addNewworkplan, deleteworkplan, updateworkplan } from '@/api/productManagement/workplan_v2.js'
|
||||
import {
|
||||
getWorkplanList,
|
||||
addNewworkplan,
|
||||
deleteworkplan,
|
||||
updateworkplan,
|
||||
handleWeekSummary,
|
||||
dowmloadWorkplan,
|
||||
deleteAllWorkplan,
|
||||
} from '@/api/productManagement/workplan_v2.js'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'workplan2',
|
||||
data() {
|
||||
return {
|
||||
workplan_table_data: [],
|
||||
search: {
|
||||
year: null, // new Date().getFullYear(),
|
||||
year: new Date().getFullYear(),
|
||||
week: null,
|
||||
partnumber: '',
|
||||
color: '',
|
||||
@@ -217,6 +254,8 @@ export default {
|
||||
turnNumber: null,
|
||||
productTime: null,
|
||||
requireHanger: null,
|
||||
year: 0,
|
||||
week: 0,
|
||||
},
|
||||
rules: {
|
||||
blankNum: [{ required: true, message: '毛坯号不能为空', trigger: 'blur' }],
|
||||
@@ -245,8 +284,9 @@ export default {
|
||||
},
|
||||
|
||||
flag: '', //判断新增还是修改
|
||||
// 用户导入参数
|
||||
|
||||
upload: {
|
||||
// 用户导入参数
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
@@ -254,11 +294,19 @@ export default {
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
updateSupport: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/system/user/importData',
|
||||
url: process.env.VUE_APP_BASE_API + '/mes/pro/workplan_v2/importData',
|
||||
},
|
||||
download_: {
|
||||
title: '下载生产计划',
|
||||
open: false,
|
||||
query: {
|
||||
year: 0,
|
||||
week: 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -271,7 +319,7 @@ export default {
|
||||
this.workplanItem.requireHanger = (
|
||||
this.workplanItem.requireNum /
|
||||
this.workplanItem.everyHangerNum /
|
||||
(this.workplanItem.qualificationRate / 100)
|
||||
this.workplanItem.qualificationRate
|
||||
).toFixed(2)
|
||||
return this.workplanItem.requireHanger
|
||||
},
|
||||
@@ -282,11 +330,45 @@ export default {
|
||||
},
|
||||
//计算 订单生产时间(分钟)
|
||||
calculate_productTime() {
|
||||
this.workplanItem.productTime = (this.workplanItem.everyHangerNum * this.workplanItem.requireHanger).toFixed(2)
|
||||
this.workplanItem.productTime = (this.workplanItem.productionBeat * this.workplanItem.requireHanger).toFixed(2)
|
||||
return this.workplanItem.productTime
|
||||
},
|
||||
|
||||
// 本周合计
|
||||
// 本周要货数量
|
||||
// calculate_requireNum() {
|
||||
// this.workplan_table_data.forEach((item) => {
|
||||
// this.weekAll.requireNum += Number(item.requireNum)
|
||||
// })
|
||||
// return this.weekAll.requireNum
|
||||
// },
|
||||
// // 订单需生产挂具数量
|
||||
// calculate_requireHanger() {
|
||||
// this.workplan_table_data.forEach((item) => {
|
||||
// this.weekAll.requireHanger += Number(item.requireHanger)
|
||||
// })
|
||||
// return this.weekAll.requireHanger
|
||||
// },
|
||||
// // 圈数
|
||||
// calculate_turnnum() {
|
||||
// this.workplan_table_data.forEach((item) => {
|
||||
// this.weekAll.turnnum += Number(item.turnNumber)
|
||||
// })
|
||||
// return this.weekAll.turnnum
|
||||
// },
|
||||
// //订单生产时间(分钟)
|
||||
// calculate_productiontime() {
|
||||
// this.workplan_table_data.forEach((item) => {
|
||||
// this.weekAll.productiontime += Number(item.productTime)
|
||||
// })
|
||||
// return this.weekAll.productiontime
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.getList()
|
||||
this.getWeekSummary()
|
||||
},
|
||||
//todo 获取生产计划列表
|
||||
getList() {
|
||||
const query = { ...this.search, ...this.pagination }
|
||||
@@ -326,14 +408,14 @@ export default {
|
||||
this.workplanItem.turnNumber = row.turnNumber
|
||||
this.workplanItem.productTime = row.productTime
|
||||
this.workplanItem.requireHanger = row.requireHanger
|
||||
this.workplanItem.year = row.year
|
||||
this.workplanItem.week = row.week
|
||||
},
|
||||
|
||||
//todo 导入生产计划
|
||||
importworkplan() {},
|
||||
|
||||
|
||||
//todo 新增或者修改 提交按钮
|
||||
submitForm() {
|
||||
this.dialog.open = false
|
||||
const query = { ...this.workplanItem }
|
||||
;(query.requireNum = Number(query.requireNum)),
|
||||
(query.qualificationRate = Number(query.qualificationRate)),
|
||||
@@ -342,42 +424,51 @@ export default {
|
||||
(query.allHangerNum = Number(query.allHangerNum)),
|
||||
(query.productTime = Number(query.productTime)),
|
||||
(query.requireHanger = Number(query.requireHanger)),
|
||||
(query.year = Number(query.year)),
|
||||
(query.week = Number(query.week)),
|
||||
(query.turnNumber = Number(query.turnNumber))
|
||||
|
||||
if (this.flag == 'insert') {
|
||||
this.$refs['dialog'].validate((valid) => {
|
||||
this.$refs['workplan'].validate((valid) => {
|
||||
if (valid) {
|
||||
addNewworkplan(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success('新增成功')
|
||||
this.getList()
|
||||
this.dialog.open = false
|
||||
// 清空表单
|
||||
this.clearworkplanItem()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (this.flag == 'update') {
|
||||
this.$refs['dialog'].validate((valid) => {
|
||||
this.$refs['workplan'].validate((valid) => {
|
||||
if (valid) {
|
||||
updateworkplan(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success('修改成功')
|
||||
this.getList()
|
||||
this.dialog.open = false
|
||||
// 清空表单
|
||||
//this.resetForm('workplan')
|
||||
this.clearworkplanItem()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 清空表单
|
||||
this.resetForm('dialog')
|
||||
},
|
||||
//todo 清空表单
|
||||
clearworkplanItem() {
|
||||
Object.keys(this.workplanItem).forEach((key) => {
|
||||
this.workplanItem[key] = null
|
||||
})
|
||||
},
|
||||
//todo 返回
|
||||
cancel() {
|
||||
this.dialog.open = false
|
||||
|
||||
this.resetForm('dialog')
|
||||
this.clearworkplanItem()
|
||||
},
|
||||
//todo 删除事件
|
||||
deleteitem(row) {
|
||||
@@ -401,7 +492,92 @@ export default {
|
||||
//todo 导入文件
|
||||
importworkplan() {
|
||||
this.upload.open = true
|
||||
this.upload.title="生产计划导入"
|
||||
this.upload.title = '生产计划导入'
|
||||
},
|
||||
|
||||
//todo 下载模板
|
||||
importTemplate() {
|
||||
// @/utils/ruoyi"
|
||||
this.download('/mes/pro/workplan_v2/importTemplate', '生产计划导入模板')
|
||||
},
|
||||
|
||||
// todo 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true
|
||||
},
|
||||
//todo 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
//todo 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
if (response.code == 200) {
|
||||
this.$alert(response.data, '导入结果', { dangerouslyUseHTMLString: true })
|
||||
} else {
|
||||
this.$alert(response.msg, '导入结果', {
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
|
||||
this.getList()
|
||||
},
|
||||
//todo 获取周汇总
|
||||
getWeekSummary() {
|
||||
const query = {}
|
||||
query.year = this.search.year
|
||||
query.week = this.search.week
|
||||
handleWeekSummary(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.weekAll = res.data
|
||||
} else if ((res.code = 210)) {
|
||||
Object.keys(this.weekAll).forEach((key) => {
|
||||
this.weekAll[key] = null
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//todo 下载
|
||||
async submitdowm() {
|
||||
this.download_.open = false
|
||||
await dowmloadWorkplan(this.download_.query)
|
||||
},
|
||||
//todo
|
||||
download_workplan() {
|
||||
this.download_.open = true
|
||||
this.download_.query.year = this.search.year
|
||||
this.download_.query.week = this.search.week
|
||||
},
|
||||
|
||||
//todo 删除本周计划
|
||||
handleAllworkplan() {
|
||||
if (this.search.week == undefined) {
|
||||
return
|
||||
}
|
||||
const query = {
|
||||
year: this.search.year,
|
||||
week: this.search.week,
|
||||
}
|
||||
|
||||
this.$modal
|
||||
.confirm('是否确认删除本周所有生产计划?')
|
||||
.then(function () {
|
||||
return deleteAllWorkplan(query)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data >1) {
|
||||
this.$notify.success('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.$notify.error('删除失败')
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -415,4 +591,11 @@ export default {
|
||||
.el-icon-arrow-down {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form_define ::v-deep .el-form-item__content {
|
||||
height: 27.6px;
|
||||
}
|
||||
.form_define {
|
||||
height: 37px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user