Browse Source

0823更新

master
ruanqi 4 years ago
parent
commit
c37ace6f66
  1. 2
      src/api/production/dailyPlan.js
  2. 2
      src/api/production/pallet.js
  3. 210
      src/views/modules/production/dailyPlan.vue
  4. 856
      src/views/modules/production/search_schedule.vue

2
src/api/production/dailyPlan.js

@ -31,3 +31,5 @@ export const changeSoScheduledListSeqNo=data => createAPI(`/dailyPlan/changeSoS
export const resourceCapacityLoadingData=data => createAPI(`/dailyPlan/resourceCapacityLoadingData`,'post',data) export const resourceCapacityLoadingData=data => createAPI(`/dailyPlan/resourceCapacityLoadingData`,'post',data)
// //
export const checkScheduleLoad=data => createAPI(`/dailyPlan/checkScheduleLoad`,'post',data) export const checkScheduleLoad=data => createAPI(`/dailyPlan/checkScheduleLoad`,'post',data)
// 获取
export const getProduceScheduleList = data => createAPI('/dailyPlan/getProduceScheduleData', 'POST', data)

2
src/api/production/pallet.js

@ -8,7 +8,7 @@ export const savePallet=data => createAPI(`/pallet/savePallet`,'post',data)
export const savePalletAdds=data => createAPI(`/pallet/savePalletAdds`,'post',data) export const savePalletAdds=data => createAPI(`/pallet/savePalletAdds`,'post',data)
export const printPallet=data => createAPI(`/pallet/printPallet`,'post',data) export const printPallet=data => createAPI(`/pallet/printPallet`,'post',data)
export const printSerialNo=data => createAPI(`/pallet/printSerialNo`,'post',data)
//获取位置数据 //获取位置数据
export const getLocationData=data => createAPI(`/pallet/getLocationData`,'post',data) export const getLocationData=data => createAPI(`/pallet/getLocationData`,'post',data)
//保存位置数据 //保存位置数据

210
src/views/modules/production/dailyPlan.vue

@ -49,7 +49,8 @@
</fieldset> </fieldset>
<!-- 排序规则 --> <!-- 排序规则 -->
<fieldset class="customer-field" style="margin-left: 680px; margin-top: 0px; width: 135px;height: 108px"> <fieldset class="customer-field" style="margin-left: 680px; margin-top: 0px; width: 135px;height: 108px">
<legend>排序</legend><br>
<legend>排序</legend>
<br>
<el-form :inline="true" style="margin-top: -10px; margin-bottom: 15px;" label-position="top" label-width="100px"> <el-form :inline="true" style="margin-top: -10px; margin-bottom: 15px;" label-position="top" label-width="100px">
<el-form-item :label="''" style="margin-bottom: 5px;margin-top: 0px"> <el-form-item :label="''" style="margin-bottom: 5px;margin-top: 0px">
<el-radio-group v-model="searchData.sortField"> <el-radio-group v-model="searchData.sortField">
@ -414,7 +415,7 @@
header-align="center" header-align="center"
align="right" align="right"
min-width="80" min-width="80"
label="派工单需求">
label="排产需求数">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="qtyReported" prop="qtyReported"
@ -607,7 +608,8 @@
min-width="80" min-width="80"
label="排产数量"> label="排产数量">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.scheduleQty" type="number" @change="changeSum" placeholder="请输入数量" style="width:98%"></el-input>
<el-input v-model="scope.row.scheduleQty" type="number" @change="changeSum" placeholder="请输入数量"
style="width:98%"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -617,8 +619,10 @@
min-width="80" min-width="80"
label="排产机台"> label="排产机台">
<template slot-scope="scope"> <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-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-option>
</el-select> </el-select>
@ -631,8 +635,10 @@
min-width="80" min-width="80"
label="排产班次"> label="排产班次">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.shiftNo" placeholder="请选择" style="height: 12px;padding: 0px " filterable allow-create>
<el-option v-for="item in schedulingModalTableData[scope.$index].selectList " :key="index" :label="item.shiftno" :value="item.shiftno">
<el-select v-model="scope.row.shiftNo" placeholder="请选择" style="height: 12px;padding: 0px " filterable
allow-create>
<el-option v-for="item in schedulingModalTableData[scope.$index].selectList " :key="index"
:label="item.shiftno" :value="item.shiftno">
</el-option> </el-option>
</el-select> </el-select>
@ -724,7 +730,9 @@
min-width="80" min-width="80"
label="排产序号"> label="排产序号">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.scheduledSeqNo" type="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" style="width:98%;text-align: right"></el-input>
<el-input v-model="scope.row.scheduledSeqNo" type="number"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
style="width:98%;text-align: right"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -788,6 +796,7 @@
} from '@/api/prd.js' } from '@/api/prd.js'
import Chooselist from '@/views/modules/common/Chooselist' import Chooselist from '@/views/modules/common/Chooselist'
export default { export default {
name: 'dailyPlan', name: 'dailyPlan',
components: { components: {
@ -857,7 +866,7 @@
getShiftData().then(({data}) => { getShiftData().then(({data}) => {
let list = data.rows let list = data.rows
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
this.allShiftNoList=[];
this.allShiftNoList = []
let resultData = { let resultData = {
value: list[i].shiftno, value: list[i].shiftno,
label: list[i].shiftno + '(' + list[i].shiftdesc + ')' label: list[i].shiftno + '(' + list[i].shiftdesc + ')'
@ -881,7 +890,7 @@
if (this.tagNo === 88) { if (this.tagNo === 88) {
if (this.tagNo2 === 1) { if (this.tagNo2 === 1) {
this.searchData.resourceId = val.ResourceID this.searchData.resourceId = val.ResourceID
this.getWorkCenterNo();
this.getWorkCenterNo()
} else { } else {
this.searchData.resourceId = val.ResourceID this.searchData.resourceId = val.ResourceID
} }
@ -892,7 +901,7 @@
this.tagNo = val this.tagNo = val
this.tagNo2 = val2 this.tagNo2 = val2
this.$nextTick(() => { this.$nextTick(() => {
let strVal = "";
let strVal = ''
if (val === 24) { if (val === 24) {
if (val2 === 1) { if (val2 === 1) {
strVal = this.searchData.workCenterNo strVal = this.searchData.workCenterNo
@ -961,27 +970,27 @@
resourceId: '', resourceId: '',
shiftNo: '', shiftNo: '',
sumQty: 0, sumQty: 0,
};
this.schedulingModalTableData=[];
this.getAvailableResourceList(row);
this.getAllShiftNoList();
this.scheduledModalFlag=true;
}
this.schedulingModalTableData = []
this.getAvailableResourceList(row)
this.getAllShiftNoList()
this.scheduledModalFlag = true
}, },
searchAllData () { searchAllData () {
if(this.searchData.site==""||this.searchData.site==null){
if (this.searchData.site == '' || this.searchData.site == null) {
this.$alert('请输入工厂!', '错误', { this.$alert('请输入工厂!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.resourceId==""||this.searchData.resourceId==null){
if (this.searchData.resourceId == '' || this.searchData.resourceId == null) {
this.$alert('请输入机台!', '错误', { this.$alert('请输入机台!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
this.getShopOrderOutData();
this.getOrderScheduleList();
this.getShopOrderOutData()
this.getOrderScheduleList()
}, },
addPlans () { addPlans () {
@ -997,17 +1006,19 @@
}) })
return false return false
} }
this.schedulingModalTableData.push({ scheduleQty:'',
this.schedulingModalTableData.push({
scheduleQty: '',
resourceId: this.schedulingModalData.resourceId, resourceId: this.schedulingModalData.resourceId,
shiftNo: this.schedulingModalData.shiftNo, shiftNo: this.schedulingModalData.shiftNo,
scheduleDate: null, scheduleDate: null,
selectList:[]})
this.sumQty+=this.schedulingModalData.scheduleQty;
selectList: []
})
this.sumQty += this.schedulingModalData.scheduleQty
}, },
splitScheduleTable (index) { splitScheduleTable (index) {
this.schedulingModalTableData.splice(index,1);
this.changeSum();
this.schedulingModalTableData.splice(index, 1)
this.changeSum()
}, },
getWorkCenterNo () { getWorkCenterNo () {
let inData = { let inData = {
@ -1016,16 +1027,16 @@
} }
getWorkCenterNoWithSiteResourceId(inData).then(({data}) => { getWorkCenterNoWithSiteResourceId(inData).then(({data}) => {
this.searchData.workCenterNo = data.rows[0].workCenterNo this.searchData.workCenterNo = data.rows[0].workCenterNo
this.getWeekShiftData();
this.getOrderScheduleList();
this.getWeekShiftData()
this.getOrderScheduleList()
}) })
}, },
getTodayShiftNo () { getTodayShiftNo () {
let inData = { let inData = {
scheduledate: this.searchData.scheduleDate, scheduledate: this.searchData.scheduleDate,
site: this.searchData.site, site: this.searchData.site,
};
this.getOrderScheduleList();
}
this.getOrderScheduleList()
getTodayShiftNoList(inData).then(({data}) => { getTodayShiftNoList(inData).then(({data}) => {
this.shiftNoList = data.rows this.shiftNoList = data.rows
}) })
@ -1034,22 +1045,22 @@
let inData = { let inData = {
scheduledate: this.schedulingModalTableData[index].scheduleDate, scheduledate: this.schedulingModalTableData[index].scheduleDate,
site: this.searchData.site, site: this.searchData.site,
};
}
getTodayShiftNoList(inData).then(({data}) => { getTodayShiftNoList(inData).then(({data}) => {
this.schedulingModalTableData[index].selectList = data.rows this.schedulingModalTableData[index].selectList = data.rows
// //
if (data.rows.length > 0) { if (data.rows.length > 0) {
let flag=true;
let flag = true
for (let i = 0; i < data.rows.length; i++) { for (let i = 0; i < data.rows.length; i++) {
if (data.rows[i].shiftno == this.schedulingModalTableData[index].shiftNo) { if (data.rows[i].shiftno == this.schedulingModalTableData[index].shiftNo) {
flag=false;
flag = false
} }
} }
if (flag) { if (flag) {
this.schedulingModalTableData[index].shiftNo='';
this.schedulingModalTableData[index].shiftNo = ''
} }
} else { } else {
this.schedulingModalTableData[index].shiftNo='';
this.schedulingModalTableData[index].shiftNo = ''
} }
}) })
@ -1059,7 +1070,7 @@
orderNo: row.orderNo, orderNo: row.orderNo,
site: row.site, site: row.site,
itemNo: row.itemNo, itemNo: row.itemNo,
};
}
getSORoutingAvailableResourceList(inData).then(({data}) => { getSORoutingAvailableResourceList(inData).then(({data}) => {
this.availableResourceList = data.rows this.availableResourceList = data.rows
if (data.rows.length > 0) { if (data.rows.length > 0) {
@ -1082,7 +1093,7 @@
} }
getHasScheduledData(inData).then(({data}) => { getHasScheduledData(inData).then(({data}) => {
this.hasScheduledData = data.rows this.hasScheduledData = data.rows
let number=0;
let number = 0
if (this.hasScheduledData.length > 0) { if (this.hasScheduledData.length > 0) {
for (let i = 0; i < this.hasScheduledData.length; i++) { for (let i = 0; i < this.hasScheduledData.length; i++) {
if (this.hasScheduledData[i].timeRequired != null && this.hasScheduledData[i].timeRequired != '') { if (this.hasScheduledData[i].timeRequired != null && this.hasScheduledData[i].timeRequired != '') {
@ -1090,54 +1101,54 @@
} }
} }
} }
this.sumTime=number;
this.sumTime = number
}) })
this.hasScheduledModalFlag=true;
this.hasScheduledModalFlag = true
}, },
/*设置工艺的行*/ /*设置工艺的行*/
setCurrentRoutingRow (row, column, event) { setCurrentRoutingRow (row, column, event) {
this.currentRoutingRow = JSON.parse(JSON.stringify(row));
this.currentRoutingRow = JSON.parse(JSON.stringify(row))
}, },
/*设置当前行的下标*/ /*设置当前行的下标*/
routingRowClassName ({row, rowIndex}) { routingRowClassName ({row, rowIndex}) {
// //
if (row.qtyScheduled > 0) { if (row.qtyScheduled > 0) {
return 'customer-row-gray';
return 'customer-row-gray'
} }
}, },
/*开始排产的操作*/ /*开始排产的操作*/
routingRowClassName2 ({row, rowIndex}) { routingRowClassName2 ({row, rowIndex}) {
let date=new Date();
let planDate=new Date(row.planFinishTime.replace("-","/"))
let date = new Date()
let planDate = new Date(row.planFinishTime.replace('-', '/'))
// //
if(row.closedFlag=="Y" && row.qtyReported>=row.lotSize){
return 'customer-row-1';
}else if(row.closedFlag=="Y" && row.qtyReported<row.lotSize){
return 'customer-row-2';
if (row.closedFlag == 'Y' && row.qtyReported >= row.lotSize) {
return 'customer-row-1'
} else if (row.closedFlag == 'Y' && row.qtyReported < row.lotSize) {
return 'customer-row-2'
} else if (planDate < date) { } else if (planDate < date) {
return 'customer-row-3';
return 'customer-row-3'
} }
}, },
startScheduleOperation (row, $event, column) { startScheduleOperation (row, $event, column) {
if(this.searchData.site==""||this.searchData.site==null){
if (this.searchData.site == '' || this.searchData.site == null) {
this.$alert('请输入工厂!', '错误', { this.$alert('请输入工厂!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.resourceId==""||this.searchData.resourceId==null){
if (this.searchData.resourceId == '' || this.searchData.resourceId == null) {
this.$alert('请输入机台!', '错误', { this.$alert('请输入机台!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.scheduleDate==""||this.searchData.scheduleDate==null){
if (this.searchData.scheduleDate == '' || this.searchData.scheduleDate == null) {
this.$alert('请选择排产日期!', '错误', { this.$alert('请选择排产日期!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.shiftNo==""||this.searchData.shiftNo==null){
if (this.searchData.shiftNo == '' || this.searchData.shiftNo == null) {
this.$alert('请选择班次!', '错误', { this.$alert('请选择班次!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -1159,9 +1170,9 @@
if (data.code === 0) { if (data.code === 0) {
scheduleOne(inData).then(({data}) => { scheduleOne(inData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
row.qtyToSchedule = 0;
row.qtyToSchedule = 0
row.qtyScheduled = row.lotSize row.qtyScheduled = row.lotSize
this.getOrderScheduleList();
this.getOrderScheduleList()
} else { } else {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -1176,9 +1187,9 @@
}).then(() => { }).then(() => {
scheduleOne(inData).then(({data}) => { scheduleOne(inData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
row.qtyToSchedule = 0;
row.qtyToSchedule = 0
row.qtyScheduled = row.lotSize row.qtyScheduled = row.lotSize
this.getOrderScheduleList();
this.getOrderScheduleList()
} else { } else {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -1190,24 +1201,23 @@
} }
}) })
// //
//this.shopOrderList = JSON.parse(JSON.stringify(this.shopOrderList)); //this.shopOrderList = JSON.parse(JSON.stringify(this.shopOrderList));
//this.$message.error('time_required!'); //this.$message.error('time_required!');
}, },
changeSum () { changeSum () {
let sum=0;
let sum = 0
if (this.schedulingModalTableData.length > 0) { if (this.schedulingModalTableData.length > 0) {
for (let i = 0; i < this.schedulingModalTableData.length; i++) { 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);
if (this.schedulingModalTableData[i].scheduleQty != '' && this.schedulingModalTableData[i].scheduleQty != null) {
sum += Number(this.schedulingModalTableData[i].scheduleQty)
} }
} }
} }
this.schedulingModalData.sumQty = sum;
this.schedulingModalData.sumQty = sum
}, },
savePlans(){
async savePlans () {
if (this.schedulingModalTableData.length == 0) { if (this.schedulingModalTableData.length == 0) {
this.$alert('未添加排产记录!', '错误', { this.$alert('未添加排产记录!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -1220,21 +1230,21 @@
}) })
return false return false
} }
let inList=[];
let inList = []
for (let i = 0; i < this.schedulingModalTableData.length; i++) { for (let i = 0; i < this.schedulingModalTableData.length; i++) {
if (this.schedulingModalTableData[i].scheduleQty == "" || this.schedulingModalTableData[i].scheduleQty == null || this.schedulingModalTableData[i].scheduleQty ==0) {
if (this.schedulingModalTableData[i].scheduleQty == '' || this.schedulingModalTableData[i].scheduleQty == null || this.schedulingModalTableData[i].scheduleQty == 0) {
this.$alert('未输入排产数量!', '错误', { this.$alert('未输入排产数量!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if (this.schedulingModalTableData[i].scheduleDate == "" || this.schedulingModalTableData[i].scheduleDate == null) {
if (this.schedulingModalTableData[i].scheduleDate == '' || this.schedulingModalTableData[i].scheduleDate == null) {
this.$alert('未选择排产日期!', '错误', { this.$alert('未选择排产日期!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if (this.schedulingModalTableData[i].shiftNo == "" || this.schedulingModalTableData[i].shiftNo == null) {
if (this.schedulingModalTableData[i].shiftNo == '' || this.schedulingModalTableData[i].shiftNo == null) {
this.$alert('未选择排产班次!', '错误', { this.$alert('未选择排产班次!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -1251,29 +1261,35 @@
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
shiftNo: this.schedulingModalTableData[i].shiftNo, shiftNo: this.schedulingModalTableData[i].shiftNo,
} }
inList.push(thisData);
inList.push(thisData)
} }
let flag=true;
// this.checkId=0;
// this.checkList=inList;
// this.checkScheduledList();
let flag = true
for (let i = 0; i < this.schedulingModalTableData.length; i++) { for (let i = 0; i < this.schedulingModalTableData.length; i++) {
checkScheduleLoad(inList[i]).then(({data}) => {
if (flag === false) {
return false
}
await checkScheduleLoad(inList[i]).then(async ({data}) => {
if (data.code === 0) { if (data.code === 0) {
} else { } else {
this.$confirm(data.msg, '提示', {
await this.$confirm(data.msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then( () => { }).then( () => {
}).catch( () => { }).catch( () => {
flag=false;
return false;
flag = false
}) })
} }
}) })
} }
if (flag) { if (flag) {
scheduleDatas(inList).then(({data}) => {
await scheduleDatas(inList).then(async ({data}) => {
if (data.code === 0) { if (data.code === 0) {
for (let i = 0; i < this.ShopOrderTableData.length; i++) { for (let i = 0; i < this.ShopOrderTableData.length; i++) {
if (inList[0].orderNo == this.ShopOrderTableData[i].orderNo && inList[0].itemNo == this.ShopOrderTableData[i].itemNo) { if (inList[0].orderNo == this.ShopOrderTableData[i].orderNo && inList[0].itemNo == this.ShopOrderTableData[i].itemNo) {
@ -1281,17 +1297,10 @@
this.ShopOrderTableData[i].qtyScheduled = Number(this.ShopOrderTableData[i].qtyScheduled) + Number(this.schedulingModalData.sumQty) this.ShopOrderTableData[i].qtyScheduled = Number(this.ShopOrderTableData[i].qtyScheduled) + Number(this.schedulingModalData.sumQty)
} }
} }
this.getOrderScheduleList();
this.schedulingModalTableData = [];
this.scheduledModalFlag = false;
this.$message({
message: '保存成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
this.getOrderScheduleList()
this.schedulingModalTableData = []
this.scheduledModalFlag = false
await this.$message.success('保存成功')
} else { } else {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -1300,6 +1309,11 @@
}) })
} }
}, },
// checkScheduledList(){
// if(this.checkId<this.checkList.length){
//
// }
// },
cancelSchedule (row, $event, column) { cancelSchedule (row, $event, column) {
this.$confirm(`是否取消排产此条记录?`, '提示', { this.$confirm(`是否取消排产此条记录?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -1314,6 +1328,8 @@
workCenterNo: row.workCenterNo, workCenterNo: row.workCenterNo,
resourceID: row.resourceId, resourceID: row.resourceId,
scheduledQty: row.lotSize, scheduledQty: row.lotSize,
scheduleDate: row.scheduledDate,
shiftNo: row.shiftNo,
} }
cancelScheduleData(inData).then(({data}) => { cancelScheduleData(inData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
@ -1324,7 +1340,7 @@
} }
} }
this.getOrderScheduleList();
this.getOrderScheduleList()
} else { } else {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
@ -1334,19 +1350,19 @@
}) })
}, },
rescheduled () { rescheduled () {
if(this.searchData.site==""||this.searchData.site==null){
if (this.searchData.site == '' || this.searchData.site == null) {
this.$alert('请输入工厂!', '错误', { this.$alert('请输入工厂!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.resourceId==""||this.searchData.resourceId==null){
if (this.searchData.resourceId == '' || this.searchData.resourceId == null) {
this.$alert('请输入机台!', '错误', { this.$alert('请输入机台!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.scheduleDate==""||this.searchData.scheduleDate==null){
if (this.searchData.scheduleDate == '' || this.searchData.scheduleDate == null) {
this.$alert('请选择排产日期!', '错误', { this.$alert('请选择排产日期!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -1372,7 +1388,7 @@
this.ShopOrderTableData[i].qtyScheduled = Number(this.ShopOrderTableData[i].qtyScheduled) + Number(this.schedulingModalData.sumQty) this.ShopOrderTableData[i].qtyScheduled = Number(this.ShopOrderTableData[i].qtyScheduled) + Number(this.schedulingModalData.sumQty)
} }
} }
this.getOrderScheduleList();
this.getOrderScheduleList()
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -1390,19 +1406,19 @@
}) })
}, },
changeModal () { changeModal () {
if(this.searchData.site==""||this.searchData.site==null){
if (this.searchData.site == '' || this.searchData.site == null) {
this.$alert('请输入工厂!', '错误', { this.$alert('请输入工厂!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.resourceId==""||this.searchData.resourceId==null){
if (this.searchData.resourceId == '' || this.searchData.resourceId == null) {
this.$alert('请输入机台!', '错误', { this.$alert('请输入机台!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
} }
if(this.searchData.scheduleDate==""||this.searchData.scheduleDate==null){
if (this.searchData.scheduleDate == '' || this.searchData.scheduleDate == null) {
this.$alert('请选择排产日期!', '错误', { this.$alert('请选择排产日期!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
@ -1422,7 +1438,7 @@
}) })
return false return false
} }
this.changeModalFlag=true;
this.changeModalFlag = true
}) })
}, },
@ -1433,7 +1449,7 @@
}) })
return false return false
} }
let inList=[];
let inList = []
for (let i = 0; i < this.changeTableData.length; i++) { for (let i = 0; i < this.changeTableData.length; i++) {
let data1 = { let data1 = {
site: this.changeTableData[i].site, site: this.changeTableData[i].site,
@ -1442,7 +1458,7 @@
linkedSeqNo: this.changeTableData[i].linkedSeqNo, linkedSeqNo: this.changeTableData[i].linkedSeqNo,
scheduledSeqNo: this.changeTableData[i].scheduledSeqNo, scheduledSeqNo: this.changeTableData[i].scheduledSeqNo,
} }
inList.push(data1);
inList.push(data1)
} }
this.$confirm(`是否修改计划顺序?`, '提示', { this.$confirm(`是否修改计划顺序?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -1451,8 +1467,8 @@
}).then(() => { }).then(() => {
changeSoScheduledListSeqNo(inList).then(({data}) => { changeSoScheduledListSeqNo(inList).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.changeModalFlag=false;
this.getOrderScheduleList();
this.changeModalFlag = false
this.getOrderScheduleList()
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -1471,7 +1487,7 @@
}, },
}, },
created () { created () {
this.getTodayShiftNo();
this.getTodayShiftNo()
} }
} }
</script> </script>

856
src/views/modules/production/search_schedule.vue

@ -0,0 +1,856 @@
<template>
<div class="customer-css">
<!-- 查询时间和产品 -->
<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: 85px"></el-input>
</el-form-item>
<el-form-item :label="'物料编码:'">
<el-input v-model="searchData.partNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'机台编号:'">
<el-input v-model="searchData.resourceId" style="width: 110px"></el-input>
</el-form-item>
<el-form-item :label="'计划日期:'">
<el-date-picker
style="width: 120px"
v-model="searchData.date1"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="' '">
<el-date-picker
style="width: 120px"
v-model="searchData.date2"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'生产订单号:'">
<el-input v-model="searchData.orderNo" style="width: 120px" ></el-input>
</el-form-item>
<el-form-item :label="''" style="margin-left: -5px;">
<el-checkbox style="margin-top: 20px;" true-label="Y" false-label="N" v-model="searchData.closedFlag">显示已关闭计划
</el-checkbox>
</el-form-item>
<el-form-item :label="' '" style="margin-left: -5px;">
<el-button type="primary" @click="refreshTables()" class="customer-bun-mid"
style="margin-left: 10px; margin-bottom: 5px;">查询
</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
导出
</download-excel>
</el-form-item>
<div class="mainTable">
<el-table :height="height"
:data="dataList"
:row-class-name="routingRowClassName2"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
prop=""
header-align="center"
align="center"
width="70"
label="操作">
<template slot-scope="scope" class="foo_container">
<a type="text" size="small" @click="printAction(scope.row)">打印标签</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnArray" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</el-form>
</div>
</template>
<script>
import {
getProduceScheduleList
} from '@/api/production/dailyPlan.js'
import {
printSerialNo
} from '@/api/production/pallet.js'
export default {
name: 'search_schedule',
data () {
return {
// start
exportData: [],
exportName: "排产日计划清单"+this.dayjs().format('YYYYMMDDHHmmss'),
exportFooter: [],
// end
height:200,
dataList:[],
dataListLoading: false,
columnArray: [
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceScheduledDate',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "scheduledDate",
headerAlign: "center",
align: "left",
columnLabel: "排产日期",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceItemDesc',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "printFlag",
headerAlign: "center",
align: "left",
columnLabel: "是否打印",
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceOrderNo',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "orderNo",
headerAlign: "center",
align: "left",
columnLabel: "生产订单号",
columnWidth: 120,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceItemNo',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "itemNo",
headerAlign: "center",
align: "right",
columnLabel: "工序号",
columnWidth: 50,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceItemDesc',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "itemDesc",
headerAlign: "center",
align: "left",
columnLabel: "工序描述",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceResourceId',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "resourceId",
headerAlign: "center",
align: "left",
columnLabel: "机台",
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceTimeRequired',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "timeRequired",
headerAlign: "center",
align: "right",
columnLabel: "需求时间",
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceTimeReported',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "timeReported",
headerAlign: "center",
align: "right",
columnLabel: "已报告时间",
columnWidth: 70,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceQtyRequired',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "qtyRequired",
headerAlign: "center",
align: "right",
columnLabel: "需求数量",
columnWidth: 60,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceQtyReported',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "qtyReported",
headerAlign: "center",
align: "right",
columnLabel: "已报告数量",
columnWidth: 70,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceNeedDate',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "needDate",
headerAlign: "center",
align: "left",
columnLabel: "生产订单要求完工日期",
columnWidth: 130,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceClosedFlag',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "closedFlag",
headerAlign: "center",
align: "left",
columnLabel: "已关闭",
columnWidth: 50,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProducePartNo',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "partNo",
headerAlign: "center",
align: "left",
columnLabel: "产品编码",
columnWidth: 110,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProducePartDesc',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "partDesc",
headerAlign: "center",
align: "left",
columnLabel: "产品名称",
columnWidth: 180,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceSpec',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "spec",
headerAlign: "center",
align: "left",
columnLabel: "规格型号",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceSeqNo',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "seqNo",
headerAlign: "center",
align: "right",
columnLabel: "次序号",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceQtyApprove',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "qtyApprove",
headerAlign: "center",
align: "right",
columnLabel: "合格数量",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
// {
// userId: this.$store.state.user.name,
// functionId: 5302,
// serialNumber: '5302ProduceBarcodeId',
// tableId: "5302Produce",
// tableName: "",
// columnProp: "barcodeId",
// headerAlign: "center",
// align: "left",
// columnLabel: "",
// columnWidth: 80,
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false
// },
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceRemark',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "remark",
headerAlign: "center",
align: "left",
columnLabel: "备注",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceCrewSize',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "crewSize",
headerAlign: "center",
align: "right",
columnLabel: "操作工人数",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceQtyScrapt',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "qtyScrapt",
headerAlign: "center",
align: "right",
columnLabel: "报废数量",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceOutWorkFlag',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "outWorkFlag",
headerAlign: "center",
align: "left",
columnLabel: "是否外协",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
// {
// userId: this.$store.state.user.name,
// functionId: 5302,
// serialNumber: '5302ProduceScheduledSeqNo',
// tableId: "5302Produce",
// tableName: "",
// columnProp: "scheduledSeqNo",
// headerAlign: "center",
// align: "right",
// columnLabel: "",
// columnWidth: 80,
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false
// },
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceShiftNo',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "shiftNo",
headerAlign: "center",
align: "left",
columnLabel: "班次",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceMachSetupTime',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "machSetupTime",
headerAlign: "center",
align: "right",
columnLabel: "调机时间",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceMachRunFactor',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "machRunFactor",
headerAlign: "center",
align: "right",
columnLabel: "单位产出",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceFactorUnit',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "factorUnit",
headerAlign: "center",
align: "right",
columnLabel: "产出单位",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceEfficiency',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "efficiency",
headerAlign: "center",
align: "right",
columnLabel: "效率",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceSite',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "site",
headerAlign: "center",
align: "left",
columnLabel: "工厂编号",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceParkFlag',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "parkFlag",
headerAlign: "center",
align: "left",
columnLabel: "暂停",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
// {
// userId: this.$store.state.user.name,
// functionId: 5302,
// serialNumber: '5302ProduceCustomerName',
// tableId: "5302Produce",
// tableName: "",
// columnProp: "customerName",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnWidth: 80,
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false
// },
// {
// userId: this.$store.state.user.name,
// functionId: 5302,
// serialNumber: '5302ProduceCustPartNo',
// tableId: "5302Produce",
// tableName: "",
// columnProp: "custPartNo",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnWidth: 80,
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false
// },
// {
// userId: this.$store.state.user.name,
// functionId: 5302,
// serialNumber: '5302ProduceQtyRequiredOriginal',
// tableId: "5302Produce",
// tableName: "",
// columnProp: "qtyRequiredOriginal",
// headerAlign: "center",
// align: "center",
// columnLabel: "",
// columnWidth: 80,
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: false
// },
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceClosedBy',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "closedBy",
headerAlign: "center",
align: "left",
columnLabel: "关闭人",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceClosedDate',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "closedDate",
headerAlign: "center",
align: "left",
columnLabel: "关闭日期",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: 5302,
serialNumber: '5302ProduceCostRollUpFlag',
tableId: "5302Produce",
tableName: "待生产工单",
columnProp: "costRollUpFlag",
headerAlign: "center",
align: "left",
columnLabel: "已排料",
columnWidth: 80,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
],
searchData:{
site:'',
partNo:'',
resourceId:'',
date1:'',
date2:'',
orderNo:'',
closedFlag:'',
},
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 160
})
},
methods: {
//excel
createExportData() {
return this.dataList;
},
startDownload() {
// this.exportData = this.dataList
},
finishDownload() {
},
fields() {
let json = "{"
this.columnArray.forEach((item, index) => {
if (index == this.columnArray.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
// end
refreshTables(){
getProduceScheduleList(this.searchData).then(({data}) => {
//
this.dataList = data.rows;
})
},
printAction(row){
let array=[];
let data={
site:row.site,
orderNo:row.orderNo,
itemNo:row.itemNo,
scheduleDate:row.scheduledDate,
shiftNo:row.shiftNo,
}
array.push(data);
printSerialNo(array).then(({data}) => {
if(data.code===200){
this.$message({
message: '打印成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
},
routingRowClassName2({row, rowIndex}){
//
if(row.printFlag=="Y"){
return 'customer-row-2';
}
},
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save