5 changed files with 2064 additions and 0 deletions
-
12src/api/production/schedule.js
-
81src/views/modules/print/print_seqNo_label.js
-
660src/views/modules/schedule/closeSchedule.vue
-
802src/views/modules/schedule/scheduleForShopOrder.vue
-
509src/views/modules/schedule/soscheduleRouting.vue
@ -0,0 +1,12 @@ |
|||
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 searchLastApproveQty=data => createAPI(`schedule/searchLastApproveQty`, 'post', data); |
|||
export const getSOScheduleRoutingData=data => createAPI(`schedule/getSOScheduleRoutingData`, 'post', data); |
|||
export const cancelJob=data => createAPI(`schedule/cancelJob`, 'post', data); |
|||
export const circulationSchedule=data => createAPI(`schedule/circulationSchedule`, 'post', data); |
|||
export const closeSchedule=data => createAPI(`schedule/closeSchedule`, 'post', data); |
|||
|
|||
@ -0,0 +1,81 @@ |
|||
/*调用js打印标签*/ |
|||
import getLodop from '@/utils/LodopFuncs.js' |
|||
/*打印材料卷标签*/ |
|||
export function printSeqNoLabel(printList) { |
|||
const LODOP = getLodop() |
|||
if (LODOP) { |
|||
//LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", "");
|
|||
LODOP.SET_LICENSES("", "AF8A5800B823CC8E18BCF67B925E7BF0", "", ""); |
|||
// LODOP.SET_PRINTER_INDEXA("小标签打印机");
|
|||
//循环调用打印机
|
|||
for(let i = 0; i < printList.length; i++){ |
|||
let printData = printList[i]; |
|||
LODOP.NewPage(); |
|||
LODOP.SET_PRINT_PAGESIZE(0,1000,700,""); |
|||
LODOP.ADD_PRINT_BARCODE(43,244,208,140,"QRCode",printData.seqNo); |
|||
LODOP.ADD_PRINT_TEXT(88,8,108,25,"Part:"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(88,50,200,50,printData.partNo+'|'+printData.partDesc); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(153,8,128,24,"Operator:"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(153,110,140,20,printData.operatorName); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(132,8,113,25,"Shift:"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(132,110,139,25,printData.sShiftNo); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(41,8,98,25,"Job No:"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(41,110,136,25,printData.seqNo); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(173,8,94,25,"Order No:"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(173,110,141,25,printData.orderNo); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(64,8,96,25,"Q.T.Y:"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(64,70,188,24,printData.qtyRequired+printData.umid); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(194,8,128,25,"MFG Date:"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(194,110,170,25,printData.sScheduledDate); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(224,5,256,24,"Manufactured by Jtem"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
|||
// LODOP.ADD_PRINT_TEXT(224,212,156,25,"IATF:16949 Certified");
|
|||
// LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
|
|||
// LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
|
|||
LODOP.ADD_PRINT_LINE(218,2,217,374,0,1); |
|||
LODOP.ADD_PRINT_TEXT(12,122,135,30,"派工单标签"); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",12); |
|||
LODOP.SET_PRINT_STYLEA(0,"Alignment",2); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(194,266,110,25,"工厂编码:"+printData.site); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",11); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
LODOP.ADD_PRINT_TEXT(175,265,110,20,"工序:"+printData.itemDesc); |
|||
LODOP.SET_PRINT_STYLEA(0,"FontSize",11); |
|||
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
|||
} |
|||
// LODOP.PRINT_DESIGN();
|
|||
LODOP.PREVIEW(); |
|||
// LODOP.PRINT();
|
|||
console.log("操作成功!") |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,660 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item :label="'工厂编码'"> |
|||
<el-input v-model="searchData.site" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'生产订单号'"> |
|||
<el-input v-model="searchData.orderNo" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span> |
|||
<el-input v-model="searchData.sWorkCenterNo" style="width: 120px"></el-input> |
|||
</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: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'工序名称'"> |
|||
<el-input v-model="searchData.itemDesc" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'是否报工完成'"> |
|||
<el-select v-model="searchData.reportFlag" style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="是" value="QtyReported>=QtyRequired"></el-option> |
|||
<el-option label="否" value="QtyRequired>QtyReported"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item :label="'派工日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.startDate" |
|||
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.endDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(26)"><a herf="#">操作员姓名</a></span> |
|||
<el-input v-model="searchData.operatorName" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台ID</a></span> |
|||
<el-input v-model="searchData.sResourceID" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'班次'"> |
|||
<el-select v-model="searchData.sShiftNo" 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 :label="'是否关闭'"> |
|||
<el-select v-model="searchData.closedFlag" style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="是" value="Y"></el-option> |
|||
<el-option label="否" value="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-button @click="search()" style="margin-left: 0px;margin-top:0px" 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-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="height" |
|||
:data="tableData" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="160" |
|||
label="操作"> |
|||
<template slot-scope="scope" class="foo_container"> |
|||
<a v-if="scope.row.circulationSeqNo===null" type="text" size="small" @click="closeSchedule(scope.row)">关闭派工单</a> |
|||
<a v-if="scope.row.circulationSeqNo!=null" type="text" size="small" >派工单已流转</a> |
|||
<a v-if="scope.row.circulationSeqNo==null" type="text" size="small" @click="cancelJob(scope.row)">取消派工单</a> |
|||
<a v-if="scope.row.circulationSeqNo===null" type="text" size="small" @click="circulation(scope.row)">流转</a> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="site" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="60" |
|||
label="工厂编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="seqNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="派工单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="orderNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="生产订单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sScheduledDate" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="派工日期"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operatorName" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="操作员姓名"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="产品编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partDesc" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="200" |
|||
label="产品名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="itemNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="工序号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="itemDesc" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="160" |
|||
label="工序名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyRequired" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="派工数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyReported" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="报工数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyApprove" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="合格数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="closedFlag" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="是否关闭"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="timeRequired" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="需求时间"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sResourceID" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="机台ID"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sShiftNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="班次"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sWorkCenterNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="加工中心编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="circulationSeqNo" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="90" |
|||
label="流转派工单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="circulationQty" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="流转数量"> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-dialog title="流转派工单" :close-on-click-modal="false" v-drag :visible.sync="circulationFlag" width="600px"> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 0px;margin-top: -5px;"> |
|||
<el-form-item :label="'派工单号:'"> |
|||
<el-input v-model="circulationData.seqNo" ref="start" type="number" style="width: 130px;" readonly></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'派工日期:'"> |
|||
<!-- <el-input v-model="circulationData.sScheduledDate" ref="start" type="number" style="width: 130px;" readonly></el-input>--> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="circulationData.sScheduledDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
readonly |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item :label="'未完成数量:'"> |
|||
<el-input v-model="circulationData.circulationQty" ref="start" type="number" style="width: 130px;" readonly></el-input> |
|||
</el-form-item> |
|||
|
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 0px;margin-top: 5px;"> |
|||
<el-form-item :label="'流转日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="circulationData.circulationDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="派工机台:"> |
|||
<el-select v-model="circulationData.sResourceID" style="width: 130px" |
|||
placeholder="请选择"> |
|||
<el-option |
|||
v-for="(item,index) in availableResourceList" |
|||
:key="index" |
|||
:label="item.ResouceDesc" |
|||
:value="item.ResourceID" |
|||
> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="派工班次:"> |
|||
<el-select v-model="circulationData.sShiftNo" style="width: 130px" |
|||
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="circulationData.operatorId" style="width: 130px" |
|||
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> |
|||
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|||
<el-button type="primary" @click="doCirculation()">流转</el-button> |
|||
<el-button type="primary" @click="circulationFlag = false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getWorkCenterOperatorList, |
|||
getAvailableResourceList, |
|||
cancelJob, |
|||
getSOScheduleRoutingData, |
|||
circulationSchedule, |
|||
closeSchedule |
|||
} from "@/api/production/schedule.js" |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
export default { |
|||
name: 'closeSchedule', |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
setUp: { |
|||
reviewFlag: false, |
|||
saveButton: false, |
|||
readonlyFlag: false, |
|||
disabled: false |
|||
}, |
|||
circulationData:{ |
|||
site:'', |
|||
seqNo:'', |
|||
sScheduledDate:'', |
|||
circulationQty:'', |
|||
circulationDate:'', |
|||
sResourceID:'', |
|||
sShiftNo:'', |
|||
operatorId:'', |
|||
}, |
|||
availableResourceList:[], |
|||
operatorIdList:[], |
|||
saveHeaderData: { |
|||
site: '', |
|||
seqNo: '', |
|||
itemNo: '', |
|||
partNo: '', |
|||
partDescription: '', |
|||
operationDesc: '', |
|||
workCenterNo: '', |
|||
workCenterDesc: '', |
|||
operatorId: '', |
|||
operatorName: '', |
|||
planStartTime: '', |
|||
planFinishTime: '', |
|||
qtyReported: 0, |
|||
qtyApprove: 0, |
|||
qtyRework: 0, |
|||
operatorId2: '', |
|||
operatorIdName2: '', |
|||
scrapReason: '', |
|||
preparationTime: 0, |
|||
manufacturingTime: 0, |
|||
cleaningTime: 0, |
|||
shutdownReason: '', |
|||
remark: '', |
|||
orderRef1:'', |
|||
scheduleType:'', |
|||
userId:'', |
|||
}, |
|||
sopFlag:false, |
|||
site: this.$store.state.user.site, |
|||
operatorType: 0, |
|||
// 导出 start |
|||
exportData: [], |
|||
exportDataStandard: { |
|||
'派工单号': 'seqNo', |
|||
'关联单号': 'orderNo', |
|||
'关联单号类型': 'scheduleType', |
|||
'工序号': 'itemNo', |
|||
'工序名称': 'itemDesc', |
|||
'派工数量': 'qtyRequired', |
|||
'报工数量': 'qtyReported', |
|||
'合格数量': 'qtyApprove', |
|||
'需求时间': 'timeRequired', |
|||
'派工日期': 'sScheduledDate', |
|||
'操作员姓名': 'operatorName', |
|||
'产品编码': 'partNo', |
|||
'产品名称': 'partDesc', |
|||
'机台ID': 'sResourceID', |
|||
'班次': 'sShiftNo', |
|||
'加工中心': 'sWorkCenterNo', |
|||
|
|||
}, |
|||
exportName: '派工单列表' + this.getStrDate(), |
|||
exportHeader: ['派工单列表'], |
|||
exportFooter: [], |
|||
exportDefaultValue: '这一行这一列没有数据', |
|||
// 导出 end |
|||
height: 200, |
|||
tableData: [], |
|||
date1: '', |
|||
searchData: { |
|||
orderNo: '', |
|||
sWorkCenterNo: '', |
|||
partNo: '', |
|||
site: '', |
|||
itemDesc:'', |
|||
scheduleType:'', |
|||
reportFlag:'QtyRequired>QtyReported', |
|||
startDate:'', |
|||
endDate:'', |
|||
operatorName:'', |
|||
sResourceID:'', |
|||
sShiftNo:'', |
|||
closedFlag:'', |
|||
userId:this.$store.state.user.name |
|||
}, |
|||
photoUrl:'', |
|||
sopData:{ |
|||
site:'', |
|||
partNo:'', |
|||
}, |
|||
partDescription:'', |
|||
fileTitle:'', |
|||
fileName:'', |
|||
num:1, |
|||
currentData:'', |
|||
photoDatas:[], |
|||
uploadImg:[], |
|||
showviewer: false, |
|||
url: '', |
|||
height2:600, |
|||
circulationFlag:false, |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 210 |
|||
this.height2 = window.innerHeight -100 |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 24) { |
|||
strVal = this.searchData.sWorkCenterNo |
|||
} |
|||
if (val === 5) { |
|||
strVal = this.searchData.partNo |
|||
} |
|||
if (val === 26) { |
|||
strVal = this.searchData.operatorName |
|||
} |
|||
if (val === 88) { |
|||
strVal = this.searchData.sResourceID |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 24) { |
|||
this.searchData.sWorkCenterNo = val.WorkCenterNo |
|||
} else if (this.tagNo === 5) { |
|||
this.searchData.partNo = val.PartNo |
|||
} |
|||
if (this.tagNo === 26) { |
|||
this.searchData.operatorName = val.OperatorName |
|||
} |
|||
if (this.tagNo === 88) { |
|||
this.searchData.sResourceID = val.ResourceID |
|||
} |
|||
}, |
|||
|
|||
search () { |
|||
getSOScheduleRoutingData(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 |
|||
}, |
|||
circulation(row){ |
|||
this.getWorkCenterOperatorList(row); |
|||
this.getAvailableResourceList(row); |
|||
this.circulationData.seqNo=row.seqNo; |
|||
this.circulationData.sScheduledDate=row.sScheduledDate; |
|||
this.circulationData.circulationQty=row.qtyRequired-row.qtyApprove; |
|||
this.circulationData.site=row.site; |
|||
this.circulationData.circulationDate=''; |
|||
this.circulationData.sResourceID=''; |
|||
this.circulationData.sShiftNo=''; |
|||
this.circulationData.operatorId=''; |
|||
this.circulationFlag=true; |
|||
}, |
|||
doCirculation(){ |
|||
if(this.circulationData.circulationDate==''||this.circulationData.circulationDate==null){ |
|||
this.$alert('请选择流转日期!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.circulationData.sResourceID==''||this.circulationData.sResourceID==null){ |
|||
this.$alert('请选择机台!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.circulationData.sShiftNo==''||this.circulationData.sShiftNo==null){ |
|||
this.$alert('请选择班次!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.circulationData.operatorId==''||this.circulationData.operatorId==null){ |
|||
this.$alert('请选择操作员!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
this.$confirm(`是否流转?流转后需要重新打印新派工单!`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
circulationSchedule(this.circulationData).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.circulationFlag=false; |
|||
this.search (); |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => { |
|||
} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
closeSchedule(row){ |
|||
this.$confirm(`确定关闭此派工单`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
closeSchedule(row).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.search(); |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => { |
|||
} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
getWorkCenterOperatorList(row){ |
|||
let inData={ |
|||
site:row.site, |
|||
workCenterNo:row.sWorkCenterNo, |
|||
} |
|||
getWorkCenterOperatorList(inData).then(({data}) => { |
|||
this.operatorIdList = data.rows; |
|||
}) |
|||
}, |
|||
getAvailableResourceList(row){ |
|||
let inData={ |
|||
site:row.site, |
|||
orderNo:row.orderNo, |
|||
itemNo:row.itemNo, |
|||
} |
|||
getAvailableResourceList(inData).then(({data}) => { |
|||
this.availableResourceList = data.rows; |
|||
}) |
|||
}, |
|||
cancelJob(row){ |
|||
if(row.qtyReported>0){ |
|||
this.$alert('该派工单已经有报工无法取消!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
this.$confirm(`确定取消此派工单`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
cancelJob(row).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.search (); |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => { |
|||
} |
|||
}) |
|||
}else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
}, |
|||
created () { |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.input_left{ |
|||
text-align: left; |
|||
} |
|||
.input_reight{ |
|||
text-align: right; |
|||
} |
|||
/deep/ input::-webkit-inner-spin-button { |
|||
-webkit-appearance: none !important; |
|||
} |
|||
input[type='number'] { |
|||
-moz-appearance: textfield !important; |
|||
} |
|||
|
|||
</style> |
|||
@ -0,0 +1,802 @@ |
|||
<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.site" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'订单号:'"> |
|||
<el-input v-model="searchData.orderNo" style="width: 130px"></el-input> |
|||
</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-item :label="'要求完工日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.startDate3" |
|||
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.endDate3" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item :label="'工序号:'"> |
|||
<el-input v-model="searchData.itemNo" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;"> |
|||
<el-form-item :label="'录入日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.startDate1" |
|||
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 > |
|||
<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: 130px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="未派工完" value="ROUND(a.LotSize,3) >ROUND(ISNULL(SL.scheduledQty,0),3)"></el-option> |
|||
<el-option label="已派工完" value="ROUND(ISNULL(SL.scheduledQty,0),3) >=ROUND(a.LotSize,3)"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<!-- <el-form-item :label="'订单类型:'">--> |
|||
<!-- <el-select filterable v-model="searchData.eLevels" style="width: 120px">--> |
|||
<!-- <el-option label="全部" value=""></el-option>--> |
|||
<!-- <el-option label="混炼订单" value=2 ></el-option>--> |
|||
<!-- <el-option label="产成品订单" value=0></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-form-item> |
|||
</el-form> |
|||
</el-form> |
|||
<el-table |
|||
:height="height" |
|||
:data="tableData" |
|||
border |
|||
:row-class-name="tableRowClassName" |
|||
style="width: 100%"> |
|||
<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="site" |
|||
header-align="center" |
|||
align="left" |
|||
width="60" |
|||
label="工厂编码"> |
|||
</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="partDescription" |
|||
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="planStartDate" |
|||
header-align="center" |
|||
align="left" |
|||
width="130" |
|||
label="计划开工日期"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="needDate" |
|||
header-align="center" |
|||
align="left" |
|||
sortable |
|||
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="lastApproveQty" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="上工序完成数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="scheduledQty" |
|||
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="qtyApprove" |
|||
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-column |
|||
prop="userName" |
|||
header-align="center" |
|||
align="left" |
|||
width="100" |
|||
label="录入人"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="machSetupTime" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="调机时间"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="machRunFactor" |
|||
header-align="center" |
|||
align="right" |
|||
width="80" |
|||
label="单位产出量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="factorUnit" |
|||
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="850px"> |
|||
<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-item label="上工序报工数:"> |
|||
<el-input v-model="schedulingModalData.lastApproveQty" 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.partDescription" 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.ResourceID" |
|||
: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-form-item> |
|||
<el-form-item label=" "> |
|||
<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> |
|||
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-form-item label="派工备注:"> |
|||
<el-input v-model="schedulingModalData.remark" style="width: 791px"></el-input> |
|||
</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.ResourceID" |
|||
: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> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getShopOrderRoutingData, |
|||
getWorkCenterOperatorList, |
|||
getAvailableResourceList, |
|||
scheduleForShopOrder, |
|||
searchLastApproveQty, |
|||
} from "@/api/production/schedule.js" |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
export default { |
|||
name: 'searchDailyPlan', |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
// 导出 start |
|||
exportData: [], |
|||
exportDataStandard: { |
|||
"生产订单号": "orderNo", |
|||
"工序号": "itemNo", |
|||
"工序名称": "operationDesc", |
|||
"物料编码": "partNo", |
|||
"物料名称": "partDescription", |
|||
"加工中心": "workCenterNo", |
|||
"状态": "status", |
|||
"计划开工日期": "planStartDate", |
|||
"要求完工日期": "needDate", |
|||
"订单数量": "lotSize", |
|||
"已派工数量": "scheduledQty", |
|||
"已报工数量": "qtyReported", |
|||
"合格数量": "qtyApprove", |
|||
"录入时间": "enterDate", |
|||
"录入人": "userName", |
|||
"调机时间": "machSetupTime", |
|||
"单位产出量": "machRunFactor", |
|||
"产出单位": "factorUnit", |
|||
}, |
|||
exportName: "生产订单工序列表"+this.getStrDate(), |
|||
exportHeader: ["生产订单工序列表"], |
|||
exportFooter: [], |
|||
exportDefaultValue: "这一行这一列没有数据", |
|||
// 导出 end |
|||
height:200, |
|||
tableData:[], |
|||
date1:'', |
|||
searchData: { |
|||
orderNo: '', |
|||
startDate1: new Date(), |
|||
endDate1: '', |
|||
startDate2: '', |
|||
endDate2: '', |
|||
partNo: '', |
|||
startDate3: '', |
|||
endDate3: '', |
|||
site: '', |
|||
planStatus: 'ROUND(a.LotSize,3) >ROUND(ISNULL(SL.scheduledQty,0),3)', |
|||
itemNo:'', |
|||
userId:this.$store.state.user.name, |
|||
}, |
|||
schedulingModalData: { |
|||
remark:'', |
|||
orderNo: '', |
|||
site: '', |
|||
needDate: '', |
|||
lotSize: '', |
|||
qtyToSchedule: '', |
|||
partNo: '', |
|||
partDescription: '', |
|||
itemNo: '', |
|||
operationDesc: '', |
|||
workCenterNo: '', |
|||
scheduleDate: '', |
|||
scheduleQty: '', |
|||
resourceId: '', |
|||
shiftNo: '', |
|||
sumQty: '', |
|||
operatorId:'', |
|||
efficiency:'', |
|||
lastApproveQty:'', |
|||
qtyAssembly:'', |
|||
}, |
|||
scheduledModalFlag: false, |
|||
availableResourceList: [], |
|||
schedulingModalTableData: [], |
|||
operatorIdList:[], |
|||
|
|||
tagNo:'', |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(()=>{ |
|||
this.height = window.innerHeight - 220; |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表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){ |
|||
this.schedulingModalData = { |
|||
remark:'', |
|||
orderNo: row.orderNo, |
|||
site: row.site, |
|||
needDate: row.needDate, |
|||
lotSize: row.lotSize, |
|||
qtyToSchedule: row.lotSize-row.scheduledQty, |
|||
partNo: row.partNo, |
|||
partDescription: row.partDescription, |
|||
itemNo: row.itemNo, |
|||
operationDesc: row.operationDesc, |
|||
workCenterNo: row.workCenterNo, |
|||
efficiency:row.efficiency, |
|||
scheduleDate: '', |
|||
scheduleQty: '', |
|||
resourceId: '*', |
|||
shiftNo: '', |
|||
operatorId:'*', |
|||
sumQty: 0, |
|||
lastApproveQty:null, |
|||
qtyAssembly:'', |
|||
} |
|||
let inData={ |
|||
site:row.site, |
|||
orderNo:row.orderNo, |
|||
itemNo:row.itemNo, |
|||
} |
|||
this.schedulingModalTableData = [] |
|||
this.getAvailableResourceList(row) |
|||
this.getWorkCenterOperatorList(row); |
|||
|
|||
searchLastApproveQty(inData).then(({data}) => { |
|||
if(data.code===0&&data.row.lastApproveQty!=null) { |
|||
this.schedulingModalData.lastApproveQty = data.row.lastApproveQty; |
|||
} |
|||
}) |
|||
this.scheduledModalFlag = true |
|||
}, |
|||
addPlans () { |
|||
|
|||
let data={ |
|||
scheduleQty: '', |
|||
resourceId: this.schedulingModalData.resourceId, |
|||
shiftNo: this.schedulingModalData.shiftNo, |
|||
scheduleDate: null, |
|||
operatorId:this.schedulingModalData.operatorId, |
|||
createBy:this.$store.state.user.name, |
|||
} |
|||
this.schedulingModalTableData.push(data) |
|||
this.changeSum(); |
|||
}, |
|||
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() |
|||
}, |
|||
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, |
|||
orderNo:row.orderNo, |
|||
itemNo:row.itemNo, |
|||
} |
|||
getAvailableResourceList(inData).then(({data}) => { |
|||
this.availableResourceList = data.rows; |
|||
}) |
|||
}, |
|||
saveSchedule(){ |
|||
if(this.schedulingModalTableData.length==0){ |
|||
this.$alert('请添加派工记录!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
// let flag2=false; |
|||
// if(this.schedulingModalData.qty1<this.schedulingModalData.sumQty&&this.schedulingModalData.lastApproveQty!=null){ |
|||
// flag2=true; |
|||
// } |
|||
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(() => { |
|||
|
|||
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, |
|||
remark:this.schedulingModalData.remark, |
|||
} |
|||
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].scheduledQty=data.qty; |
|||
} |
|||
} |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
|
|||
onClose: () => { |
|||
} |
|||
}) |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
|
|||
|
|||
tableRowClassName ({row, rowIndex}) { |
|||
|
|||
if (row.lastStartDate == this.dayjs().format('YYYY-MM-DD')) { |
|||
return 'success-row' |
|||
} |
|||
|
|||
return '' |
|||
}, |
|||
}, |
|||
created() { |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style > |
|||
.el-table .success-row { |
|||
background: #1bb61b; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,509 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'工厂编码'"> |
|||
<el-input v-model="searchData.site" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'生产订单号'"> |
|||
<el-input v-model="searchData.orderNo" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span> |
|||
<el-input v-model="searchData.sWorkCenterNo" style="width: 120px"></el-input> |
|||
</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: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'工序名称'"> |
|||
<el-input v-model="searchData.itemDesc" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'是否生产完成'"> |
|||
<el-select v-model="searchData.reportFlag" style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="是" value="QtyApprove>=QtyRequired"></el-option> |
|||
<el-option label="否" value="QtyRequired>QtyApprove"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item :label="'派工日期:'"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="searchData.startDate" |
|||
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.endDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(26)"><a herf="#">操作员姓名</a></span> |
|||
<el-input v-model="searchData.operatorName" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台ID</a></span> |
|||
<el-input v-model="searchData.sResourceID" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'班次'"> |
|||
<el-select v-model="searchData.sShiftNo" 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 :label="'是否关闭'"> |
|||
<el-select v-model="searchData.closedFlag" style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option label="是" value="Y"></el-option> |
|||
<el-option label="否" value="N"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-button @click="search()" style="margin-left: 0px;margin-top:0px" 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-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="height" |
|||
:data="tableData" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="60" |
|||
label="操作"> |
|||
<template slot-scope="scope" class="foo_container"> |
|||
<a type="text" size="small" @click="toPrint(scope.row)">打印</a> |
|||
<!-- <a v-if="scope.row.circulationSeqNo==null" type="text" size="small" @click="cancelJob(scope.row)">取消派工单</a>--> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="site" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="工厂编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="seqNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="派工单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="orderNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="生产订单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sScheduledDate" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="派工日期"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operatorName" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="操作员姓名"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="产品编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partDesc" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="200" |
|||
label="产品名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="itemNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="工序号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="itemDesc" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="160" |
|||
label="工序名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyRequired" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="派工数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyReported" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="报工数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="qtyApprove" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="合格数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="closedFlag" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="是否关闭"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="timeRequired" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="需求时间"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sScheduledDate" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="派工日期"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="operatorName" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="操作员姓名"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="80" |
|||
label="产品编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="partDesc" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="200" |
|||
label="产品名称"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sResourceID" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="机台ID"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sShiftNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="70" |
|||
label="班次"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="sWorkCenterNo" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="加工中心编码"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="circulationSeqNo" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="90" |
|||
label="流转派工单号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="circulationQty" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="80" |
|||
label="流转数量"> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getSOScheduleRoutingData |
|||
// , cancelJob, |
|||
} from '@/api/production/schedule.js' |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
import { |
|||
printSeqNoLabel, |
|||
} from "@/views/modules/print/print_seqNo_label.js" |
|||
export default { |
|||
name: 'soscheduleRouting', |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
setUp: { |
|||
reviewFlag: false, |
|||
saveButton: false, |
|||
readonlyFlag: false, |
|||
disabled: false |
|||
}, |
|||
saveHeaderData: { |
|||
site: '', |
|||
seqNo: '', |
|||
itemNo: '', |
|||
partNo: '', |
|||
partDescription: '', |
|||
operationDesc: '', |
|||
workCenterNo: '', |
|||
workCenterDesc: '', |
|||
operatorId: '', |
|||
operatorName: '', |
|||
planStartTime: '', |
|||
planFinishTime: '', |
|||
qtyReported: 0, |
|||
qtyApprove: 0, |
|||
qtyRework: 0, |
|||
operatorId2: '', |
|||
operatorIdName2: '', |
|||
scrapReason: '', |
|||
preparationTime: 0, |
|||
manufacturingTime: 0, |
|||
cleaningTime: 0, |
|||
shutdownReason: '', |
|||
remark: '', |
|||
orderRef1:'', |
|||
scheduleType:'', |
|||
userId:'', |
|||
}, |
|||
sopFlag:false, |
|||
site: this.$store.state.user.site, |
|||
operatorType: 0, |
|||
// 导出 start |
|||
exportData: [], |
|||
exportDataStandard: { |
|||
'派工单号': 'seqNo', |
|||
'关联单号': 'orderNo', |
|||
'工序号': 'itemNo', |
|||
'工序名称': 'itemDesc', |
|||
'派工数量': 'qtyRequired', |
|||
'报工数量': 'qtyReported', |
|||
'合格数量': 'qtyApprove', |
|||
'需求时间': 'timeRequired', |
|||
'派工日期': 'sScheduledDate', |
|||
'操作员姓名': 'operatorName', |
|||
'产品编码': 'partNo', |
|||
'产品名称': 'partDesc', |
|||
'机台ID': 'sResourceID', |
|||
'班次': 'sShiftNo', |
|||
'加工中心': 'sWorkCenterNo', |
|||
|
|||
}, |
|||
exportName: '派工单列表' + this.getStrDate(), |
|||
exportHeader: ['派工单列表'], |
|||
exportFooter: [], |
|||
exportDefaultValue: '这一行这一列没有数据', |
|||
// 导出 end |
|||
height: 200, |
|||
tableData: [], |
|||
date1: '', |
|||
searchData: { |
|||
userId:this.$store.state.user.name, |
|||
orderNo: '', |
|||
sWorkCenterNo: '', |
|||
partNo: '', |
|||
site: '', |
|||
itemDesc:'', |
|||
scheduleType:'', |
|||
reportFlag:'QtyRequired>QtyApprove', |
|||
startDate:'', |
|||
endDate:'', |
|||
operatorName:'', |
|||
sResourceID:'', |
|||
sShiftNo:'', |
|||
closedFlag:'', |
|||
}, |
|||
photoUrl:'', |
|||
sopData:{ |
|||
site:'', |
|||
partNo:'', |
|||
}, |
|||
partDescription:'', |
|||
fileTitle:'', |
|||
fileName:'', |
|||
num:1, |
|||
currentData:'', |
|||
photoDatas:[], |
|||
uploadImg:[], |
|||
showviewer: false, |
|||
url: '', |
|||
height2:600, |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 210 |
|||
this.height2 = window.innerHeight -100 |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 24) { |
|||
strVal = this.searchData.sWorkCenterNo |
|||
} |
|||
if (val === 5) { |
|||
strVal = this.searchData.partNo |
|||
} |
|||
if (val === 26) { |
|||
strVal = this.searchData.operatorName |
|||
} |
|||
if (val === 88) { |
|||
strVal = this.searchData.sResourceID |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 24) { |
|||
this.searchData.sWorkCenterNo = val.WorkCenterNo |
|||
} else if (this.tagNo === 5) { |
|||
this.searchData.partNo = val.PartNo |
|||
} |
|||
if (this.tagNo === 26) { |
|||
this.searchData.operatorName = val.OperatorName |
|||
} |
|||
if (this.tagNo === 88) { |
|||
this.searchData.sResourceID = val.ResourceID |
|||
} |
|||
}, |
|||
|
|||
search () { |
|||
getSOScheduleRoutingData(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 |
|||
}, |
|||
cancelJob(row){ |
|||
if(row.qtyReported>0){ |
|||
this.$alert('该派工单已经有报工无法取消!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false |
|||
} |
|||
this.$confirm(`确定取消此派工单`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
cancelJob(row).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.search (); |
|||
this.$message({ |
|||
message: '操作成功', |
|||
type: 'success', |
|||
duration: 1500, |
|||
onClose: () => { |
|||
} |
|||
}) |
|||
}else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
toPrint(row){ |
|||
let array=[]; |
|||
array.push(row) |
|||
printSeqNoLabel(array) |
|||
}, |
|||
|
|||
|
|||
}, |
|||
created () { |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.input_left{ |
|||
text-align: left; |
|||
} |
|||
.input_reight{ |
|||
text-align: right; |
|||
} |
|||
/deep/ input::-webkit-inner-spin-button { |
|||
-webkit-appearance: none !important; |
|||
} |
|||
input[type='number'] { |
|||
-moz-appearance: textfield !important; |
|||
} |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue