Browse Source

0823更新

master
ruanqi 4 years ago
parent
commit
633452b3f5
  1. 2
      src/api/production/dailyPlan.js
  2. 9
      src/api/production/pallet.js
  3. 262
      src/views/modules/base/location.vue
  4. 35
      src/views/modules/pallet/pallet.vue
  5. 123
      src/views/modules/production/dailyPlan.vue

2
src/api/production/dailyPlan.js

@ -29,3 +29,5 @@ export const rescheduleData=data => createAPI(`/dailyPlan/rescheduleData`,'post
export const changeSoScheduledListSeqNo=data => createAPI(`/dailyPlan/changeSoScheduledListSeqNo`,'post',data) export const changeSoScheduledListSeqNo=data => createAPI(`/dailyPlan/changeSoScheduledListSeqNo`,'post',data)
//机台产能负荷数据 //机台产能负荷数据
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)

9
src/api/production/pallet.js

@ -6,3 +6,12 @@ export const getPalletData=data => createAPI(`/pallet/getPalletData`,'post',dat
export const savePallet=data => createAPI(`/pallet/savePallet`,'post',data) 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 getLocationData=data => createAPI(`/pallet/getLocationData`,'post',data)
//保存位置数据
export const saveLocationData=data => createAPI(`/pallet/saveLocationData`,'post',data)
//删除位置数据
export const deleteLocationData=data => createAPI(`/pallet/deleteLocationData`,'post',data)

262
src/views/modules/base/location.vue

@ -0,0 +1,262 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 3px;margin-left: 2px" >
<el-form-item label="位置ID">
<el-input v-model="searchData.locationID" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="是否在用">
<el-select filterable v-model="searchData.active" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
<el-option label="全部" value=""></el-option>
</el-select>
<el-button type="primary" @click="getLocationData()">查询</el-button>
<el-button type="primary" @click="newLocation()">新增</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
style="width: 100%">
<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="editLocation(scope.row)">编辑</a>
</template>
</el-table-column>
<el-table-column
prop="site"
header-align="center"
align="left"
min-width="80"
label="工厂编号">
</el-table-column>
<el-table-column
prop="locationID"
header-align="center"
align="left"
min-width="80"
label="位置ID">
</el-table-column>
<el-table-column
prop="locationName"
header-align="center"
align="left"
min-width="120"
label="位置名称">
</el-table-column>
<el-table-column
prop="active"
header-align="center"
align="left"
min-width="80"
label="是否在用">
</el-table-column>
<el-table-column
prop="wareHouseID"
header-align="center"
align="left"
min-width="80"
label="所在仓库ID">
</el-table-column>
<el-table-column
prop="wareHouseName"
header-align="center"
align="left"
min-width="120"
label="仓库名称">
</el-table-column>
</el-table>
<el-dialog title="维护位置" :close-on-click-modal="false" v-drag :visible.sync="locationModalFlag" width="300px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="位置ID">
<el-input v-model="locationData.locationID" :disabled="disabledFlag" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="位置名称">
<el-input v-model="locationData.locationName" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="是否在用">
<el-select filterable v-model="locationData.active" :disabled="selectFlag" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item >
<span slot="label" style="" @click="getBaseList(20)"><a herf="#">所在仓库ID</a></span>
<el-input v-model="locationData.wareHouseID" style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="saveLocation">保存</el-button>
<el-button type="primary" @click="locationModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
getLocationData,
saveLocationData,
deleteLocationData,
} from '@/api/production/pallet.js'
import Chooselist from '@/views/modules/common/Chooselist'
export default {
name: 'location',
components: {
Chooselist
},
watch: {
locationData: {
deep: true,
handler: function (newV, oldV) {
this.locationData.locationID = this.locationData.locationID.toUpperCase()
this.locationData.wareHouseID = this.locationData.wareHouseID.toUpperCase()
}
},
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.locationID = this.searchData.locationID.toUpperCase()
}
}
},
data() {
return {
tagNo:'',
locationModalFlag:false,
height:200,
searchData:{
locationID:'',
active:'',
},
dataList:[],
disabledFlag:false,
selectFlag:false,
locationData:{
wareHouseID:'',
locationName:'',
locationID:'',
site:'',
user:'',
add:'',
active:'',
},
}
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 240;
})
},
methods: {
getBaseData(val){
if (this.tagNo === 20){
this.locationData.wareHouseID = val.WareHouseID
}
},
//
getBaseList(val){
this.tagNo = val
this.$nextTick(() => {
let strVal = "";
if (val === 20){
strVal = this.locationData.wareHouseID
}
this.$refs.baseList.init(val,strVal)
})
},
getLocationData(){
getLocationData(this.searchData).then(({data}) => {
if(data.code===0){
this.dataList=data.rows;
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
newLocation(){
this.locationData={
wareHouseID:'',
locationName:'',
locationID:'',
site:this.$store.state.user.site,
user:this.$store.state.user.name,
add:0,
active:'Y',
};
this.disabledFlag=false;
this.selectFlag=true;
this.locationModalFlag=true;
},
editLocation(row){
this.locationData={
wareHouseID:row.wareHouseID,
locationName:row.locationName,
locationID:row.locationID,
site:row.site,
user:this.$store.state.user.name,
add:1,
active:row.active,
};
this.disabledFlag=true;
this.selectFlag=false;
this.locationModalFlag=true;
},
saveLocation(){
if(this.locationData.locationID==""||this.locationData.locationID==null){
this.$alert('位置ID不能为空!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.locationData.locationName==""||this.locationData.locationName==null){
this.$alert('位置名称不能为空!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.locationData.wareHouseID==""||this.locationData.wareHouseID==null){
this.$alert('仓库ID不能为空!', '错误', {
confirmButtonText: '确定'
})
return false
}
saveLocationData(this.locationData).then(({data}) => {
if(data.code===0){
this.getLocationData();
this.locationModalFlag=false;
this.$message({
message: '保存成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
},
created() {
this.getLocationData();
}
}
</script>
<style scoped>
</style>

35
src/views/modules/pallet/pallet.vue

@ -45,7 +45,7 @@
label="操作"> label="操作">
<template slot-scope="scope" class="foo_container"> <template slot-scope="scope" class="foo_container">
<a type="text" size="small" @click="editModal(scope.row)">编辑</a> <a type="text" size="small" @click="editModal(scope.row)">编辑</a>
<a type="text" size="small" @click="scheduledModal(scope.row)">打印标签</a>
<a type="text" size="small" @click="print(scope.row)">打印标签</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -112,7 +112,7 @@
<!-- <el-option label="已装货" value="已装货"></el-option>--> <!-- <el-option label="已装货" value="已装货"></el-option>-->
<!-- <el-option label="已入库" value="已入库"></el-option>--> <!-- <el-option label="已入库" value="已入库"></el-option>-->
<!-- <el-option label="已出库" value="已出库"></el-option>--> <!-- <el-option label="已出库" value="已出库"></el-option>-->
<el-option label="报废" :value="addStatus"></el-option>
<el-option :label="addStatus" :value="addStatus"></el-option>
<el-option label="报废" value="报废"></el-option> <el-option label="报废" value="报废"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -143,7 +143,8 @@
<script> <script>
import {savePallet, import {savePallet,
getPalletData, getPalletData,
savePalletAdds
savePalletAdds,
printPallet,
} from '@/api/production/pallet.js' } from '@/api/production/pallet.js'
export default { export default {
@ -202,7 +203,11 @@
this.palletData.site=this.$store.state.user.site; this.palletData.site=this.$store.state.user.site;
this.palletData.updateBy=this.$store.state.user.name; this.palletData.updateBy=this.$store.state.user.name;
this.palletData.area=row.area; this.palletData.area=row.area;
this.addStatus=row.status;
if(row.status!='报废'){
this.addStatus=row.status;
}else {
this.addStatus='空置';
}
this.palletSelectFlag=false; this.palletSelectFlag=false;
this.palletInputFlag=true; this.palletInputFlag=true;
this.palletModalFlag=true; this.palletModalFlag=true;
@ -295,7 +300,27 @@
}) })
} }
}) })
}
},
print(row){
let array=[];
let data={palletNo:row.palletNo}
array.push(data);
printPallet(array).then(({data}) => {
if(data.code===200){
this.$message({
message: '打印成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
}, },
created() { created() {
this.getPalletData(); this.getPalletData();

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

@ -673,21 +673,21 @@
prop="itemNo" prop="itemNo"
header-align="center" header-align="center"
align="right" align="right"
min-width="80"
min-width="50"
label="工序号"> label="工序号">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="operationDesc" prop="operationDesc"
header-align="center" header-align="center"
align="left" align="left"
min-width="100"
min-width="160"
label="工序名称"> label="工序名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="timeRequired" prop="timeRequired"
header-align="center" header-align="center"
align="left"
min-width="100"
align="right"
min-width="80"
label="计划时间"> label="计划时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -780,6 +780,7 @@
cancelScheduleData, cancelScheduleData,
rescheduleData, rescheduleData,
changeSoScheduledListSeqNo, changeSoScheduledListSeqNo,
checkScheduleLoad,
} from '@/api/production/dailyPlan.js' } from '@/api/production/dailyPlan.js'
import { import {
@ -1154,22 +1155,47 @@
userId:this.$store.state.user.name, userId:this.$store.state.user.name,
shiftNo:this.searchData.shiftNo, shiftNo:this.searchData.shiftNo,
} }
scheduleOne(inData).then(({data}) => {
if(data.code===0){
row.qtyToSchedule = 0;
row.qtyScheduled = row.lotSize
this.getOrderScheduleList();
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
checkScheduleLoad(inData).then(({data}) => {
if(data.code===0){
scheduleOne(inData).then(({data}) => {
if(data.code===0){
row.qtyToSchedule = 0;
row.qtyScheduled = row.lotSize
this.getOrderScheduleList();
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}else {
this.$confirm(data.msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
scheduleOne(inData).then(({data}) => {
if(data.code===0){
row.qtyToSchedule = 0;
row.qtyScheduled = row.lotSize
this.getOrderScheduleList();
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
}
})
// //
//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) {
@ -1227,31 +1253,52 @@
} }
inList.push(thisData); inList.push(thisData);
} }
scheduleDatas(inList).then(({data}) => {
if(data.code===0){
for (let i = 0; i <this.ShopOrderTableData.length ; i++) {
if(inList[0].orderNo==this.ShopOrderTableData[i].orderNo && inList[0].itemNo==this.ShopOrderTableData[i].itemNo){
this.ShopOrderTableData[i].qtyToSchedule=Number(this.ShopOrderTableData[i].qtyToSchedule)-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,
let flag=true;
for (let i = 0; i < this.schedulingModalTableData.length; i++) {
checkScheduleLoad(inList[i]).then(({data}) => {
if(data.code===0){
onClose: () => {
}else {
this.$confirm(data.msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}).catch(() => {
flag=false;
return false;
})
}
})
}
if(flag) {
scheduleDatas(inList).then(({data}) => {
if (data.code === 0) {
for (let i = 0; i < this.ShopOrderTableData.length; i++) {
if (inList[0].orderNo == this.ShopOrderTableData[i].orderNo && inList[0].itemNo == this.ShopOrderTableData[i].itemNo) {
this.ShopOrderTableData[i].qtyToSchedule = Number(this.ShopOrderTableData[i].qtyToSchedule) - Number(this.schedulingModalData.sumQty)
this.ShopOrderTableData[i].qtyScheduled = Number(this.ShopOrderTableData[i].qtyScheduled) + Number(this.schedulingModalData.sumQty)
}
} }
})
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
this.getOrderScheduleList();
this.schedulingModalTableData = [];
this.scheduledModalFlag = false;
this.$message({
message: '保存成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
}, },
cancelSchedule(row, $event, column){ cancelSchedule(row, $event, column){
this.$confirm(`是否取消排产此条记录?`, '提示', { this.$confirm(`是否取消排产此条记录?`, '提示', {

Loading…
Cancel
Save