4 changed files with 1016 additions and 405 deletions
-
11src/api/production/schedule.js
-
51src/assets/scss/global.scss
-
405src/views/modules/base/user.vue
-
954src/views/modules/schedule/schedule.vue
@ -0,0 +1,11 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
//------------生产订单派工----------------
|
|||
|
|||
// 获取生产订单工序数据
|
|||
export const getShopOrderRoutingData = data => createAPI(`/schedule/getShopOrderRoutingData`,'post',data) |
|||
|
|||
export const getWorkCenterOperatorList = data => createAPI(`/schedule/getWorkCenterOperatorList`,'post',data) |
|||
export const getAvailableResourceList = data => createAPI(`/schedule/getAvailableResourceList`,'post',data) |
|||
export const scheduleForShopOrder = data => createAPI(`/schedule/scheduleForShopOrder`,'post',data) |
|||
export const schedulesForShopOrder = data => createAPI(`/schedule/schedulesForShopOrder`,'post',data) |
|||
@ -1,405 +0,0 @@ |
|||
<template> |
|||
<div class="mod-user"> |
|||
<el-form :inline="true" label-position="top" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item> |
|||
<el-button @click="getDataList()" type="primary">查询</el-button> |
|||
<el-button v-if="isAuth('sys:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item label="用户账号"> |
|||
<el-input v-model="dataForm.userName" placeholder="用户账号" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="用户名"> |
|||
<el-input v-model="dataForm.userDisplay" placeholder="用户名" clearable></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:data="dataList" |
|||
border |
|||
:height="height" |
|||
v-loading="dataListLoading" |
|||
@selection-change="selectionChangeHandle" |
|||
highlight-current-row |
|||
@current-change="handleCurrentChange" |
|||
style="width: 100%;"> |
|||
<!-- <el-table-column--> |
|||
<!-- type="selection"--> |
|||
<!-- header-align="center"--> |
|||
<!-- align="center"--> |
|||
<!-- width="50">--> |
|||
<!-- </el-table-column>--> |
|||
<!-- <el-table-column--> |
|||
<!-- prop="userId"--> |
|||
<!-- header-align="center"--> |
|||
<!-- align="center"--> |
|||
<!-- width="80"--> |
|||
<!-- label="ID">--> |
|||
<!-- </el-table-column>--> |
|||
<el-table-column |
|||
prop="username" |
|||
header-align="center" |
|||
align="center" |
|||
label="用户账号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="userDisplay" |
|||
header-align="center" |
|||
align="center" |
|||
label="用户名"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="email" |
|||
header-align="center" |
|||
align="center" |
|||
label="邮箱"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="mobile" |
|||
header-align="center" |
|||
align="center" |
|||
label="手机号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="status" |
|||
header-align="center" |
|||
align="center" |
|||
label="状态"> |
|||
<template slot-scope="scope"> |
|||
<el-link v-if="scope.row.status === 0" type="success">禁用</el-link> |
|||
<el-link v-else type="danger">正常</el-link> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="createTime" |
|||
header-align="center" |
|||
align="center" |
|||
width="180" |
|||
label="创建时间"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
v-if="isAuth('sys:user:update') || isAuth('sys:user:workcenter') || isAuth('sys:user:delete')" |
|||
fixed="left" |
|||
header-align="center" |
|||
align="center" |
|||
width="150" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a v-if="isAuth('sys:user:workcenter')" type="text" size="small" @click="userWorkCenterAuthorize(scope.row)">加工中心</a> |
|||
<a v-if="isAuth('sys:user:update')" type="text" size="small" |
|||
@click="addOrUpdateHandle(scope.row.userId)">修改</a> |
|||
<a v-if="isAuth('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.userId)">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 200,500]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
|
|||
<!-- 加工中心授权--> |
|||
<el-dialog |
|||
style="font-size: 12px" |
|||
v-drag |
|||
:title="'加工中心'" |
|||
:visible.sync="workCenterVisible" |
|||
width="620px" |
|||
:append-to-body="true"> |
|||
<el-transfer v-model="selectWorkCenterList" :data="workCenterList" :titles="['未授权加工中心', '已授权加工中心']"></el-transfer> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<div style="margin-top: 5px"> |
|||
<el-button type="primary" @click="saveUserWorkCenter()">确定</el-button> |
|||
<el-button @click="workCenterVisible = false" type="primary">取消</el-button> |
|||
</div> |
|||
|
|||
</span> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
// import AddOrUpdate from './user-add-or-update' |
|||
// import {workCenterList} from "@/api/ifsapp/ifsWorkCenter.js" |
|||
// import {userWorkCenterList,saveBatchUserWorkCenter} from "@/api/userwork/userWorkCenter.js" |
|||
// import {debounce, throttle} from "../../../utils/common"; |
|||
|
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
showButton: true, |
|||
height: 200, |
|||
currentData: {}, |
|||
userId: this.$store.state.user.name, |
|||
site: this.$store.state.user.site, |
|||
transferData: [], |
|||
checked: [], |
|||
//设置 |
|||
setUp: { |
|||
reviewFlag: false, |
|||
saveButton: false, |
|||
}, |
|||
dataForm: { |
|||
userName: '', |
|||
userDisplay: '', |
|||
}, |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', |
|||
tableId: this.$route.meta.menuId + 'security', |
|||
tableName: "securityTable", |
|||
columnProp: "securitydesc", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "参数描述", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnWidth: 70, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', |
|||
tableId: this.$route.meta.menuId + 'security', |
|||
tableName: "securityTable", |
|||
columnProp: "module", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "模块", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 20, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', |
|||
tableId: this.$route.meta.menuId + 'security', |
|||
tableName: "securityTable", |
|||
columnProp: "itemvalue", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "参数值", |
|||
columnHidden: true, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
columnWidth: 10, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
}, |
|||
], |
|||
dataList: [], |
|||
workCenterVisible: false, |
|||
workCenterList: [], |
|||
selectWorkCenterList: [], |
|||
selectUser: {}, |
|||
pageIndex: 1, |
|||
pageSize: 20, |
|||
totalPage: 0, |
|||
dataListLoading: false, |
|||
dataListSelections: [], |
|||
addOrUpdateVisible: false |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
activated() { |
|||
this.getDataList() |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 220; |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 选中行 |
|||
handleCurrentChange(val) { |
|||
this.selectUser = val |
|||
this.showButton = false |
|||
}, |
|||
// 授权加工中心 |
|||
userWorkCenterAuthorize(val) { |
|||
|
|||
this.workCenterVisible = true |
|||
this.searchWorkCenterList() |
|||
|
|||
}, |
|||
// 保存用户加工中心 |
|||
saveUserWorkCenter() { |
|||
let workCenterList = this.selectWorkCenterList.map( item => { |
|||
let newItem = { |
|||
site: this.site, |
|||
userName: this.selectUser.username, |
|||
workCenterNo: item, |
|||
createdBy:this.selectUser.username, |
|||
} |
|||
return newItem; |
|||
}) |
|||
let dto ={ |
|||
workCenterList: workCenterList, |
|||
site: this.site, |
|||
userName: this.selectUser.username, |
|||
} |
|||
saveBatchUserWorkCenter(dto).then(({data}) =>{ |
|||
if (data && data.code == 0){ |
|||
this.$message.success('操作成功') |
|||
this.workCenterVisible = false; |
|||
}else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}, |
|||
// 获取用户已授权的加工中心 |
|||
searchUserWorkCenterList() { |
|||
userWorkCenterList({site: this.site,userName: this.selectUser.username}).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.selectWorkCenterList = data.data.map(item => { |
|||
return item.workCenterNo |
|||
}) |
|||
|
|||
} |
|||
}) |
|||
}, |
|||
// 获取所有可用加工中心 |
|||
searchWorkCenterList() { |
|||
getWorkCenterData({site: this.$store.state.user}).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.workCenterList = data.data.map(item => { |
|||
let newItem = { |
|||
key: item.workCenterNo, |
|||
label: item.workCenterNo +" - " + item.description, |
|||
} |
|||
return newItem |
|||
}) |
|||
this.searchUserWorkCenterList() |
|||
} |
|||
}) |
|||
}, |
|||
// 获取数据列表 |
|||
getDataList: throttle(function () { |
|||
this.dataListLoading = true |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/user/list'), |
|||
method: 'get', |
|||
params: this.$http.adornParams({ |
|||
'page': this.pageIndex, |
|||
'limit': this.pageSize, |
|||
'username': this.dataForm.userName, |
|||
'userDisplay': this.dataForm.userDisplay, |
|||
}) |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.dataList = data.page.list |
|||
this.totalPage = data.page.totalCount |
|||
} else { |
|||
this.dataList = [] |
|||
this.totalPage = 0 |
|||
} |
|||
this.dataListLoading = false |
|||
}) |
|||
}, 1000), |
|||
// 每页数 |
|||
sizeChangeHandle(val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
// 当前页 |
|||
currentChangeHandle(val) { |
|||
this.pageIndex = val |
|||
this.getDataList() |
|||
}, |
|||
// 多选 |
|||
selectionChangeHandle(val) { |
|||
this.dataListSelections = val |
|||
}, |
|||
// 新增 / 修改 |
|||
addOrUpdateHandle(id) { |
|||
this.addOrUpdateVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.addOrUpdate.init(id) |
|||
}) |
|||
}, |
|||
// 删除 |
|||
deleteHandle(id) { |
|||
var userIds = id ? [id] : this.dataListSelections.map(item => { |
|||
return item.userId |
|||
}) |
|||
this.$confirm(`确定对[id=${userIds.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/user/delete'), |
|||
method: 'post', |
|||
data: this.$http.adornData(userIds, false) |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success('操作成功') |
|||
this.getDataList() |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style> |
|||
.el-transfer-panel { |
|||
border: 2px solid #17b3a3; |
|||
border-radius: 4px; |
|||
overflow: hidden; |
|||
background: #fff; |
|||
display: inline-block; |
|||
vertical-align: middle; |
|||
width: 252px; |
|||
max-height: 100%; |
|||
-webkit-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
position: relative; |
|||
} |
|||
|
|||
.el-transfer-panel .el-transfer-panel__header { |
|||
height: 40px; |
|||
line-height: 40px; |
|||
background: #17b3a3; |
|||
margin: 0; |
|||
padding-left: 15px; |
|||
border-bottom: 1px solid #17b3a3; |
|||
-webkit-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
color: #000; |
|||
} |
|||
|
|||
.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label { |
|||
font-size: 14px; |
|||
color: #303133; |
|||
font-weight: 400; |
|||
} |
|||
|
|||
.el-dialog__title { |
|||
line-height: 24px; |
|||
font-size: 16px; |
|||
color: #303133; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,954 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form inline="true" v-model="searchData"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" > |
|||
<el-form-item :label="'生产订单号:'"> |
|||
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'录入日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.startDate1" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item style="margin-top: 23px;"> |
|||
<laber style="margin-left: -9px;font-size: 19px">➞</laber> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.endDate1" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item :label="'要求完工日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.startDate2" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item style="margin-top: 23px;"> |
|||
<laber style="margin-left: -9px;font-size: 19px">➞</laber> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.endDate2" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;"> |
|||
<el-form-item :label="'工序号:'"> |
|||
<el-input v-model="searchData.itemNo" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'状态:'"> |
|||
<el-select filterable v-model="searchData.status" style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="可派工" value="('已下达','已发料','已入库','已开工','已排产')"></el-option> |
|||
<el-option label="不可派工" value="('已计划','已取消','已关闭')"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(5)"><a herf="#">物料编码</a></span> |
|||
<el-input v-model="searchData.partNo" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'派工情况:'"> |
|||
<el-select filterable v-model="searchData.planStatus" style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="未派工完" value="ROUND(so.LotSize,3) >ROUND(ISNULL(SL.QtyScheduled,0),3)"></el-option> |
|||
<el-option label="已派工完" value="ROUND(ISNULL(SL.QtyScheduled,0),3) >=ROUND(so.LotSize,3)"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-button @click="search()" style="margin-left: 24px" type="primary">查询</el-button> |
|||
<download-excel |
|||
:fields="exportDataStandard" |
|||
:data="tableData" |
|||
type="xlsx" |
|||
:name="exportName" |
|||
:header="exportHeader" |
|||
:footer="exportFooter" |
|||
:defaultValue="exportDefaultValue" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
worksheet="导出信息" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
{{'导出'}} |
|||
</download-excel> |
|||
<el-button @click="schedulesModal()" style="margin-left: 24px" type="primary">批量派工</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-form> |
|||
<el-table |
|||
:height="height" |
|||
:data="tableData" |
|||
@selection-change="selectionChangeHandle" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
type="selection" |
|||
align="center" |
|||
width="30"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
fixed="left" |
|||
header-align="center" |
|||
align="center" |
|||
width="60" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" @click="openScheduleModel(scope.row)">派工</a> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="orderNo" |
|||
header-align="center" |
|||
align="left" |
|||
width="120" |
|||
label="生产订单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="itemNo" |
|||
header-align="center" |
|||
align="left" |
|||
width="60" |
|||
label="工序号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operationDesc" |
|||
header-align="center" |
|||
align="left" |
|||
width="160" |
|||
label="工序名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partNo" |
|||
header-align="center" |
|||
align="left" |
|||
width="120" |
|||
label="物料编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partDesc" |
|||
header-align="center" |
|||
align="left" |
|||
width="200" |
|||
label="物料名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="workCenterNo" |
|||
header-align="center" |
|||
align="left" |
|||
width="100" |
|||
label="加工中心"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="status" |
|||
header-align="center" |
|||
align="left" |
|||
width="60" |
|||
label="订单状态"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="needDate" |
|||
header-align="center" |
|||
align="left" |
|||
width="130" |
|||
label="要求完工日期"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="lotSize" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="订单数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyScheduled" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="已派工数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyReported" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="已报工数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="enterDate" |
|||
header-align="center" |
|||
align="left" |
|||
width="80" |
|||
label="录入时间"> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-dialog title="单次派工" :close-on-click-modal="false" v-drag :visible.sync="scheduledModalFlag" width="720px"> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="订单号:"> |
|||
<el-input v-model="schedulingModalData.orderNo" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工厂编号:"> |
|||
<el-input v-model="schedulingModalData.site" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="要求完工日期:"> |
|||
<el-input v-model="schedulingModalData.needDate" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="订单数量:"> |
|||
<el-input v-model="schedulingModalData.lotSize" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="待派工数:"> |
|||
<el-input v-model="schedulingModalData.qtyToSchedule" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="产品编码:"> |
|||
<el-input v-model="schedulingModalData.partNo" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="产品名称:"> |
|||
<el-input v-model="schedulingModalData.partDesc" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工序号:"> |
|||
<el-input v-model="schedulingModalData.itemNo" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工序名称:"> |
|||
<el-input v-model="schedulingModalData.operationDesc" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="加工中心:"> |
|||
<el-input v-model="schedulingModalData.workCenterNo" disabled style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="派工机台:"> |
|||
<el-select v-model="schedulingModalData.resourceId" style="width: 120px" |
|||
placeholder="请选择"> |
|||
<el-option |
|||
v-for="(item,index) in availableResourceList" |
|||
:key="index" |
|||
:label="item.resourceDesc" |
|||
:value="item.resourceID" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="派工班次:"> |
|||
<el-select v-model="schedulingModalData.shiftNo" style="width: 120px" |
|||
placeholder="请选择"> |
|||
<el-option label="白班" value="白班"></el-option> |
|||
<el-option label="晚班" value="晚班"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="派工人员:"> |
|||
<el-select v-model="schedulingModalData.operatorId" style="width: 120px" |
|||
placeholder="请选择"> |
|||
<el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName" |
|||
:value="item.operatorID"> |
|||
|
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="本次累计派工数量:"> |
|||
<el-input v-model="schedulingModalData.sumQty" type="number" disabled style="width: 120px"></el-input> |
|||
<el-button type="primary" @click="addPlans()" style="margin-left: 10px;">添加</el-button> |
|||
<el-button type="primary" @click="saveSchedule()">保存</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="rq "> |
|||
<el-table |
|||
height="200" |
|||
:data="schedulingModalTableData" |
|||
border |
|||
:row-style="{height: '25px'}" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="scheduleDate" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="派工日期"> |
|||
<template slot-scope="scope"> |
|||
<el-date-picker |
|||
style="width: 95%" |
|||
class="sl-input" |
|||
v-model="scope.row.scheduleDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="scheduleQty" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="派工数量"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.scheduleQty" type="number" @change="changeSum" placeholder="请输入数量" |
|||
style="width:98%"></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="resourceId" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="派工机台"> |
|||
<template slot-scope="scope"> |
|||
<el-select v-model="scope.row.resourceId" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|||
allow-create> |
|||
<el-option v-for="item in availableResourceList " :key="index" :label="item.resourceDesc |
|||
" |
|||
:value="item.resourceID"> |
|||
|
|||
</el-option> |
|||
</el-select> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="shiftNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="派工班次"> |
|||
<template slot-scope="scope"> |
|||
<el-select v-model="scope.row.shiftNo" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|||
allow-create> |
|||
<el-option label="白班" value="白班"></el-option> |
|||
<el-option label="晚班" value="晚班"></el-option> |
|||
</el-select> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operatorId" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="派工人员"> |
|||
<template slot-scope="scope"> |
|||
<el-select v-model="scope.row.operatorId" placeholder="请选择" style="height: 12px;padding: 0px " filterable |
|||
allow-create> |
|||
<el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName" |
|||
:value="item.operatorID"> |
|||
|
|||
</el-option> |
|||
</el-select> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
width="60" |
|||
label="操作"> |
|||
<template slot-scope="scope" class="foo_container"> |
|||
<a type="text" size="small" @click="splitScheduleTable(scope.$index)">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|||
<el-button type="primary" @click="scheduledModalFlag = false">关闭</el-button> |
|||
<!-- <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>--> |
|||
</el-footer> |
|||
</el-dialog> |
|||
<el-dialog title="批量派工" :close-on-click-modal="false" v-drag :visible.sync="schedulesModalFlag" width="720px"> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item :label="'派工日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="schedulesModalData.scheduleDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="派工机台:"> |
|||
<el-select v-model="schedulesModalData.resourceId" style="width: 120px" |
|||
placeholder="请选择"> |
|||
<el-option |
|||
v-for="(item,index) in availableResourceList" |
|||
:key="index" |
|||
:label="item.resourceDesc" |
|||
:value="item.resourceID" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="派工班次:"> |
|||
<el-select v-model="schedulesModalData.shiftNo" style="width: 120px" |
|||
placeholder="请选择"> |
|||
<el-option label="白班" value="白班"></el-option> |
|||
<el-option label="晚班" value="晚班"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="派工人员:"> |
|||
<el-select v-model="schedulesModalData.operatorId" style="width: 120px" |
|||
placeholder="请选择"> |
|||
<el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName" |
|||
:value="item.operatorID"> |
|||
|
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button type="primary" @click="saveSchedules()">保存</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
height="200" |
|||
:data="schedulesModalTableData" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="orderNo" |
|||
header-align="center" |
|||
align="left" |
|||
width="120" |
|||
label="生产订单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="itemNo" |
|||
header-align="center" |
|||
align="left" |
|||
width="60" |
|||
label="工序号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operationDesc" |
|||
header-align="center" |
|||
align="left" |
|||
width="160" |
|||
label="工序名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="lotSize" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="订单数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyScheduled" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="已派工数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partNo" |
|||
header-align="center" |
|||
align="left" |
|||
width="120" |
|||
label="物料编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partDesc" |
|||
header-align="center" |
|||
align="left" |
|||
width="200" |
|||
label="物料名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
width="60" |
|||
fixed="right" |
|||
label="操作"> |
|||
<template slot-scope="scope" class="foo_container"> |
|||
<a type="text" size="small" @click="splitSchedulesTable(scope.$index)">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|||
<el-button type="primary" @click="schedulesModalFlag = false">关闭</el-button> |
|||
<!-- <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>--> |
|||
</el-footer> |
|||
</el-dialog> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
import { |
|||
getShopOrderRoutingData, |
|||
getAvailableResourceList, |
|||
getWorkCenterOperatorList, |
|||
scheduleForShopOrder, |
|||
schedulesForShopOrder, |
|||
} from "@/api/production/schedule.js" |
|||
|
|||
export default { |
|||
name: 'schedule', |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
// 导出 start |
|||
exportData: [], |
|||
exportDataStandard: { |
|||
"生产订单号": "orderNo", |
|||
"工序号": "itemNo", |
|||
"工序名称": "operationDesc", |
|||
"物料编码": "partNo", |
|||
"物料名称": "partDesc", |
|||
"加工中心": "workCenterNo", |
|||
"生产订单状态": "status", |
|||
"要求完工日期": "needDate", |
|||
"订单数量": "lotSize", |
|||
"已派工数量": "qtyScheduled", |
|||
"已报工数量": "qtyReported", |
|||
"录入时间": "enterDate", |
|||
}, |
|||
exportName: "生产订单工序列表"+this.getStrDate(), |
|||
exportHeader: ["生产订单工序列表"], |
|||
exportFooter: [], |
|||
exportDefaultValue: "这一行这一列没有数据", |
|||
// 导出 end |
|||
height:200, |
|||
tableData:[], |
|||
date1:'', |
|||
searchData: { |
|||
orderNo: '', |
|||
startDate1: new Date(), |
|||
endDate1: '', |
|||
startDate2: '', |
|||
endDate2: '', |
|||
status: '(\'已下达\',\'已发料\',\'已入库\',\'已开工\',\'已排产\')', |
|||
partNo: '', |
|||
site: this.$store.state.user.site, |
|||
planStatus: 'ROUND(so.LotSize,3) >ROUND(ISNULL(SL.QtyScheduled,0),3)', |
|||
itemNo:'', |
|||
}, |
|||
schedulingModalData: { |
|||
orderNo: '', |
|||
site: '', |
|||
needDate: '', |
|||
lotSize: '', |
|||
qtyToSchedule: '', |
|||
partNo: '', |
|||
partDesc: '', |
|||
itemNo: '', |
|||
operationDesc: '', |
|||
workCenterNo: '', |
|||
scheduleDate: '', |
|||
scheduleQty: '', |
|||
resourceId: '', |
|||
shiftNo: '', |
|||
sumQty: '', |
|||
operatorId:'', |
|||
efficiency:'', |
|||
}, |
|||
schedulesModalData:{ |
|||
scheduleDate:'', |
|||
shiftNo: '', |
|||
resourceId: '', |
|||
operatorId:'', |
|||
}, |
|||
scheduledModalFlag: false, |
|||
availableResourceList: [], |
|||
schedulingModalTableData: [], |
|||
operatorIdList:[], |
|||
dataListSelections:[], |
|||
schedulesModalFlag:false, |
|||
schedulesModalTableData:[], |
|||
tagNo:'', |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(()=>{ |
|||
this.height = window.innerHeight - 220; |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 多选数据 |
|||
selectionChangeHandle (val) { |
|||
this.dataListSelections = val |
|||
}, |
|||
// 获取基础数据列表S |
|||
getBaseList (val,type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 5) { |
|||
strVal = this.searchData.partNo |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 5) { |
|||
this.searchData.partNo = val.PartNo |
|||
} |
|||
}, |
|||
search(){ |
|||
getShopOrderRoutingData(this.searchData).then(({data}) => { |
|||
this.tableData = data.rows; |
|||
}) |
|||
}, |
|||
createExportData() { |
|||
|
|||
return this.tableData; |
|||
}, |
|||
startDownload() { |
|||
// this.exportData = this.dataList |
|||
|
|||
}, |
|||
finishDownload() { |
|||
|
|||
}, |
|||
getStrDate() { |
|||
let dd = new Date(); |
|||
let Y = dd.getFullYear(); |
|||
let M = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);//获取当前月份的日期,不足10补0 |
|||
let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号,不足10补0 |
|||
let H = dd.getHours() < 10 ? "0" + dd.getHours() : dd.getHours(); |
|||
let MM = dd.getMinutes() < 10 ? "0" + dd.getMinutes() : dd.getMinutes(); |
|||
let S = dd.getSeconds() < 10 ? "0" + dd.getSeconds() : dd.getSeconds(); |
|||
return Y + M + D + H + MM + S; |
|||
|
|||
}, |
|||
openScheduleModel(row){ |
|||
if (row.lotSize-row.qtyScheduled <= 0) { |
|||
this.$alert('该订单已派工完毕!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
this.schedulingModalData = { |
|||
orderNo: row.orderNo, |
|||
site: row.site, |
|||
needDate: row.needDate, |
|||
lotSize: row.lotSize, |
|||
qtyToSchedule: row.lotSize-row.qtyScheduled, |
|||
partNo: row.partNo, |
|||
partDesc: row.partDesc, |
|||
itemNo: row.itemNo, |
|||
operationDesc: row.operationDesc, |
|||
workCenterNo: row.workCenterNo, |
|||
efficiency:row.efficiency, |
|||
scheduleDate: '', |
|||
scheduleQty: '', |
|||
resourceId: '', |
|||
shiftNo: '', |
|||
operatorId:'', |
|||
sumQty: 0, |
|||
} |
|||
this.schedulingModalTableData = [] |
|||
this.getAvailableResourceList(row) |
|||
this.getWorkCenterOperatorList(row); |
|||
|
|||
this.scheduledModalFlag = true |
|||
}, |
|||
addPlans () { |
|||
|
|||
// if (this.schedulingModalData.resourceId == '') { |
|||
// this.$alert('请选择机台!', '错误', { |
|||
// confirmButtonText: '确定' |
|||
// }) |
|||
// return false |
|||
// } |
|||
// if (this.schedulingModalData.shiftNo == '') { |
|||
// this.$alert('请选择派工班次!', '错误', { |
|||
// confirmButtonText: '确定' |
|||
// }) |
|||
// return false |
|||
// } |
|||
this.schedulingModalTableData.push({ |
|||
scheduleQty: '', |
|||
resourceId: this.schedulingModalData.resourceId, |
|||
shiftNo: this.schedulingModalData.shiftNo, |
|||
scheduleDate: null, |
|||
operatorId:this.schedulingModalData.operatorId, |
|||
}) |
|||
this.sumQty += this.schedulingModalData.scheduleQty |
|||
}, |
|||
changeSum () { |
|||
let sum = 0 |
|||
if (this.schedulingModalTableData.length > 0) { |
|||
for (let i = 0; i < this.schedulingModalTableData.length; i++) { |
|||
if (this.schedulingModalTableData[i].scheduleQty != '' && this.schedulingModalTableData[i].scheduleQty != null) { |
|||
sum += Number(this.schedulingModalTableData[i].scheduleQty) |
|||
} |
|||
} |
|||
} |
|||
this.schedulingModalData.sumQty = sum |
|||
}, |
|||
splitScheduleTable (index) { |
|||
|
|||
this.schedulingModalTableData.splice(index, 1) |
|||
this.changeSum() |
|||
}, |
|||
splitSchedulesTable (index) { |
|||
|
|||
this.schedulesModalTableData.splice(index, 1) |
|||
|
|||
}, |
|||
getWorkCenterOperatorList(row){ |
|||
let inData={ |
|||
site:row.site, |
|||
workCenterNo:row.workCenterNo, |
|||
} |
|||
getWorkCenterOperatorList(inData).then(({data}) => { |
|||
this.operatorIdList = data.rows; |
|||
}) |
|||
}, |
|||
getAvailableResourceList(row){ |
|||
let inData={ |
|||
site:row.site, |
|||
workCenterNo:row.workCenterNo, |
|||
} |
|||
getAvailableResourceList(inData).then(({data}) => { |
|||
this.availableResourceList = data.rows; |
|||
}) |
|||
}, |
|||
saveSchedule(){ |
|||
if(this.schedulingModalTableData.length==0){ |
|||
this.$alert('请添加派工记录!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
let flag2=false; |
|||
let flag=false; |
|||
for (let i = 0; i <this.schedulingModalTableData.length; i++) { |
|||
if(''==this.schedulingModalTableData[i].scheduleQty||this.schedulingModalTableData[i].scheduleQty==null){ |
|||
this.$alert('存在派工记录没有填写派工数量!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulingModalTableData[i].resourceId||this.schedulingModalTableData[i].resourceId==null){ |
|||
this.$alert('存在派工记录没有选择机台!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulingModalTableData[i].shiftNo||this.schedulingModalTableData[i].shiftNo==null){ |
|||
this.$alert('存在派工记录没有选择班次!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulingModalTableData[i].scheduleDate||this.schedulingModalTableData[i].scheduleDate==null){ |
|||
this.$alert('存在派工记录没有填写日期!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulingModalTableData[i].operatorId||this.schedulingModalTableData[i].operatorId==null){ |
|||
this.$alert('存在派工记录没有选择操作员!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(this.schedulingModalTableData[i].scheduleDate>this.schedulingModalData.needDate){ |
|||
flag=true; |
|||
} |
|||
} |
|||
if(flag){ |
|||
this.$confirm(`派工日期大于需求完成日期,是否继续`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
if(flag2){ |
|||
this.$confirm(`实际派工数量大于上工序完成数量,是否继续`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.doSchedule(); |
|||
}) |
|||
}else { |
|||
this.doSchedule(); |
|||
} |
|||
}) |
|||
}else { |
|||
if(flag2){ |
|||
this.$confirm(`实际派工数量大于上工序完成数量,是否继续`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.doSchedule(); |
|||
}) |
|||
}else { |
|||
this.doSchedule(); |
|||
} |
|||
} |
|||
}, |
|||
doSchedule(){ |
|||
let indata={ |
|||
orderNo: this.schedulingModalData.orderNo, |
|||
site: this.schedulingModalData.site, |
|||
needDate: this.schedulingModalData.needDate, |
|||
partNo: this.schedulingModalData.partNo, |
|||
itemNo: this.schedulingModalData.itemNo, |
|||
workCenterNo: this.schedulingModalData.workCenterNo, |
|||
sumQty: this.schedulingModalData.sumQty, |
|||
scheduleDetail:this.schedulingModalTableData, |
|||
efficiency:this.schedulingModalData.efficiency, |
|||
} |
|||
scheduleForShopOrder(indata).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.scheduledModalFlag = false |
|||
for (let i = 0; i <this.tableData.length ; i++) { |
|||
if(this.tableData[i].orderNo==indata.orderNo &&this.tableData[i].itemNo==indata.itemNo){ |
|||
this.tableData[i].qtyScheduled=data.qty; |
|||
} |
|||
} |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
|
|||
onClose: () => { |
|||
} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
schedulesModal(){ |
|||
if(this.dataListSelections.length==0){ |
|||
this.$alert('请勾选订单!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
let downFlag=false; |
|||
for (let i = 0; i < this.dataListSelections.length; i++) { |
|||
if(this.dataListSelections[i].lotSize<=this.dataListSelections[i].qtyScheduled){ |
|||
this.$alert(this.dataListSelections[i].orderNo+'生产订单派工数量已经满足!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
downFlag=true; |
|||
return false; |
|||
} |
|||
if(this.dataListSelections[i].workCenterNo!=this.dataListSelections[0].workCenterNo){ |
|||
this.$alert('请选择同一加工中心的订单!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
downFlag=true; |
|||
return false; |
|||
} |
|||
} |
|||
if(downFlag){ |
|||
return false; |
|||
} |
|||
this.schedulesModalTableData=JSON.parse(JSON.stringify(this.dataListSelections)) |
|||
this.schedulesModalData = [] |
|||
let inData={ |
|||
site:this.dataListSelections[0].site, |
|||
workCenterNo:this.dataListSelections[0].workCenterNo |
|||
} |
|||
this.getAvailableResourceList(inData) |
|||
this.getWorkCenterOperatorList(inData); |
|||
this.schedulesModalFlag=true; |
|||
|
|||
}, |
|||
saveSchedules(){ |
|||
if(this.schedulesModalTableData.length==0){ |
|||
this.$alert('列表中没有生产订单!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulesModalData.resourceId||this.schedulesModalData.resourceId==null){ |
|||
this.$alert('请选择机台!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulesModalData.shiftNo||this.schedulesModalData.shiftNo==null){ |
|||
this.$alert('请选择班次!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulesModalData.scheduleDate||this.schedulesModalData.scheduleDate==null){ |
|||
this.$alert('请填写日期!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
if(''==this.schedulesModalData.operatorId||this.schedulesModalData.operatorId==null){ |
|||
this.$alert('请选择操作员!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
let inList=[]; |
|||
for (let i = 0; i < this.schedulesModalTableData.length; i++) { |
|||
let modalData={ |
|||
resourceId:this.schedulesModalData.resourceId, |
|||
shiftNo:this.schedulesModalData.shiftNo, |
|||
scheduleDate:this.schedulesModalData.scheduleDate, |
|||
operatorId:this.schedulesModalData.operatorId, |
|||
} |
|||
let indata={ |
|||
orderNo: this.schedulesModalTableData[i].orderNo, |
|||
site: this.schedulesModalTableData[i].site, |
|||
needDate: this.schedulesModalTableData[i].needDate, |
|||
partNo: this.schedulesModalTableData[i].partNo, |
|||
itemNo: this.schedulesModalTableData[i].itemNo, |
|||
workCenterNo: this.schedulesModalTableData[i].workCenterNo, |
|||
sumQty: 0, |
|||
scheduleDetail:[modalData] |
|||
// efficiency:this.schedulingModalData.efficiency, |
|||
} |
|||
inList.push(indata); |
|||
} |
|||
schedulesForShopOrder(inList).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.schedulesModalFlag = false |
|||
this.search(); |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
|
|||
onClose: () => { |
|||
} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
}, |
|||
created() { |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue