Browse Source

0823更新

master
ruanqi 5 years ago
parent
commit
8b18ad3133
  1. 311
      src/views/modules/production/dailyPlan.vue
  2. 33
      src/views/modules/production/dailyPlanCirculation.vue
  3. 238
      src/views/modules/sys/shiftData.vue

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

@ -82,7 +82,6 @@
</el-form-item>
<el-form-item style="margin-top: 30px">
<el-button @click="search()" style="margin-left: 24px" type="primary">查询</el-button>
<el-button @click="shiftModel()" style="margin-left: 24px" type="primary">班次信息</el-button>
</el-form-item>
</el-form>
</el-form>
@ -91,7 +90,21 @@
:height="height"
:data="tableData"
border
style="width: 100%">
style="width: 100%"
@selection-change="selectionChangeHandle">
<el-table-column
type="selection"
:selectable="checkSelections"
width="44">
</el-table-column>
<!-- <el-table-column-->
<!-- align="center"-->
<!-- width="40"-->
<!-- type="selection">-->
<!-- <template slot-scope="scope">-->
<!-- <el-checkbox v-if="scope.row.status==1" ></el-checkbox>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="orderNo"
header-align="center"
@ -296,89 +309,6 @@
</el-footer>
</el-dialog>
<el-dialog title="班次信息" :close-on-click-modal="false" v-drag :visible.sync="shiftFlag" width="600px" >
<el-form :inline="true" label-position="top" style="margin-top: -5px;">
<el-button type="primary" @click="newShift()">新增班次</el-button>
</el-form>
<el-table
:height="300"
:data="shiftData"
border
style="width: 100%">
<el-table-column
prop="shiftno"
header-align="center"
align="left"
label="班次编码">
</el-table-column>
<el-table-column
prop="shiftdesc"
header-align="center"
align="left"
label="班次名称">
</el-table-column>
<el-table-column
prop="startexacttime"
header-align="center"
align="left"
label="上班时间">
</el-table-column>
<el-table-column
prop="endexacttime"
header-align="center"
align="left"
label="下班时间">
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="editShift(scope.row)">编辑</a>
<a type="text" size="small" @click="deleteShift(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<el-footer style="height: 40px;margin-top: 20px;text-align: center" >
<el-button type="primary" @click="shiftFlag = false">退出</el-button>
</el-footer>
</el-dialog>
<el-dialog title="维护班次" :close-on-click-modal="false" v-drag :visible.sync="newShiftFlag" width="341px" >
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'班次编码:'">
<el-input v-model="newShiftData.shiftno" :disabled="newShiftFlag1" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'班次名称:'">
<el-input v-model="newShiftData.shiftdesc" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'上班时间:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="newShiftData.startexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'下班时间:'" >
<el-time-picker
arrow-control
format="HH:mm"
style="width: 130px"
v-model="newShiftData.endexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="newShiftSave()">保存</el-button>
<el-button type="primary" @click="newShiftFlag = false">取消</el-button>
</el-footer>
</el-dialog>
</div>
@ -392,22 +322,17 @@
getWorkPlanData,
delPlan,
getShiftData,
saveNewShift,
deleteShift
} from "@/api/prd.js"
export default {
name: 'productionDispatch',
data () {
return {
shiftFlag:false,
selectList:[],
//
schedulingModalFlag:false,
newShiftFlag1:true,
newShiftFlag:false,
scheduleTableData:[],
shiftData:[],
scheduledModelData:{
orderNo:'',
planStartDate:'',
@ -415,14 +340,7 @@
schedulingSize:'',
unSchedulingSize:'',
},
newShiftData:{
shiftno:'',
shiftdesc:'',
startexacttime:'',
endexacttime:'',
id:'',
site:this.$store.state.user.site,
},
dataListSelections:[],
scheduledingData:{
orderNo:'',
orderDate:'',
@ -447,7 +365,7 @@
endDate1: '',
startDate2: '',
endDate2: '',
status: '',
status: "('已下达','已发料','已入库','已开工')",
partNo:'' ,
startDate3: '',
endDate3: '',
@ -469,6 +387,12 @@
},
//
schedulingModal () {
if(this.scheduledModelData.unSchedulingSize==0){
this.$alert("该日计划已排产完毕无需新增!", '错误', {
confirmButtonText: '确定',
});
return false;
}
this.scheduledingDataFlag1 = false;
this.scheduledingDataFlag3 = true;
this.scheduledingData.userName = this.$store.state.user.name;
@ -481,10 +405,27 @@
this.scheduledingData.shiftId = "";
this.schedulingModalFlag = true;
},
//
selectionChangeHandle (val) {
this.dataListSelections = val;
},
//
checkSelections(row){
if(row.status=="已计划"||row.status=="已取消"||row.status=="已关闭"){
return false;
}
if(row.schedulingSize>=row.orderQty){
return false;
}
return true;
},
//
openScheduleModel (row) {
if(row.status=="已计划"||row.status=="已取消"||row.status=="已关闭"){
this.$message.error("该日计划状态为"+row.status+"无法排产");
this.$alert("该订单状态为"+row.status+"无法排产", '错误', {
confirmButtonText: '确定',
});
return false;
}
let list={orderNo:row.orderNo}
@ -503,12 +444,7 @@
this.scheduleTableData = data.rows
})
},
shiftModel () {
this.shiftFlag = true;
getShiftData().then(({data}) => {
this.shiftData = data.rows;
})
},
//
getData () {
@ -520,26 +456,30 @@
planSave () {
if (this.scheduledingData.orderDate == "" || null == this.scheduledingData.orderDate) {
this.$message.error("请选择计划日期!");
this.$alert("请选择计划日期!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.scheduledingData.orderQty == "" || null == this.scheduledingData.orderQty) {
this.$message.error("请输入排产数量!");
this.$alert("请输入排产数量!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.scheduledingData.orderQty <= 0 ) {
this.$message.error("排产数量必须大于0!");
this.$alert("排产数量必须大于0!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.scheduledingData.shiftId == "") {
this.$message.error("请输入排产班次!");
this.$alert("请输入排产班次!", '错误', {
confirmButtonText: '确定',
});
return false;
}
this.$confirm(`是否保存?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// this.scheduledingData.orderDate = this.format(this.scheduledingData.orderDate,'yyyy-MM-dd')
@ -562,34 +502,38 @@
}
})
} else {
this.$message.error(data.msg)
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
}
})
}).catch(() => {
})
},
planSaveOn () {
if (this.scheduledingData.orderDate == "" || null == this.scheduledingData.orderDate) {
this.$message.error("请选择计划日期!");
this.$alert("请选择计划日期!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.scheduledingData.orderQty == "" || null == this.scheduledingData.orderQty) {
this.$message.error("请输入排产数量!");
this.$alert("请输入排产数量!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.scheduledingData.shiftId == "") {
this.$message.error("请输入排产班次!");
this.$alert("请输入排产班次!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.scheduledingData.orderQty <= 0 ) {
this.$message.error("排产数量必须大于0!");
this.$alert("排产数量必须大于0!", '错误', {
confirmButtonText: '确定',
});
return false;
}
this.$confirm(`是否保存?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
savePlan(this.scheduledingData).then(({data}) => {
if (data && data.code === 0) {
getShiftData().then(({data}) => {
@ -604,11 +548,11 @@
}
})
} else {
this.$message.error(data.msg)
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
}
})
}).catch(() => {
})
},
//
editSchedule (row) {
@ -653,79 +597,17 @@
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
})
},
newShift () {
this.newShiftFlag1 = false;
this.newShiftData.shiftno = '';
this.newShiftData.shiftdesc = '';
this.newShiftData.startexacttime = '';
this.newShiftData.endexacttime = '';
this.newShiftData.id = 0;
this.newShiftFlag = true;
},
newShiftSave(){
if (this.newShiftData.shiftno == "" || null == this.newShiftData.shiftno) {
this.$message.error("请输入班次编码!");
return false;
}
if (this.newShiftData.shiftdesc == "" || null == this.newShiftData.shiftdesc) {
this.$message.error("请输入班次名称!");
return false;
}
if (this.newShiftData.startexacttime == "") {
this.$message.error("请输入上班时间!");
return false;
}
if (this.newShiftData.endexacttime == "") {
this.$message.error("请输入下班时间!");
return false;
}
this.$confirm(`是否保存此条记录?`, '提示', {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let time1=this.newShiftData.startexacttime;
let time2=this.newShiftData.endexacttime;
this.newShiftData.startexacttime='2020-01-01 '+this.newShiftData.startexacttime+':00';
this.newShiftData.endexacttime='2020-01-01 '+this.newShiftData.endexacttime+':00';
saveNewShift(this.newShiftData).then(({data}) => {
this.newShiftData.startexacttime=time1;
this.newShiftData.endexacttime=time2;
if (data && data.code === 0) {
this.newShiftFlag=false;
getShiftData().then(({data}) => {
this.shiftData = data.rows;
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$message.error(data.msg)
});
}
})
}).catch(() => {
})
},
editShift(row){
this.newShiftData.shiftno = row.shiftno;
this.newShiftData.shiftdesc = row.shiftdesc;
this.newShiftData.startexacttime = row.startexacttime;
this.newShiftData.endexacttime = row.endexacttime;
this.newShiftData.id = row.id;
this.newShiftFlag1 = true;
this.newShiftFlag = true;
},
getTime(date) {
if(date==''){
return ""
@ -734,36 +616,7 @@
return new Date(new Date(json_date) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
}
},
deleteShift(row){
this.$confirm(`是否删除此条班次信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
id:row.id
}
deleteShift(inData).then(({data}) => {
if (data && data.code === 0) {
getShiftData().then(({data}) => {
this.shiftData = data.rows;
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {
})
},
getSelectData(){
this.selectList=[];
getShiftData().then(({data}) => {
@ -784,7 +637,5 @@
}
</script>
<style scoped>
foo_container{
text-align: center;
}
</style>

33
src/views/modules/production/dailyPlanCirculation.vue

@ -252,7 +252,9 @@
}
})
} else {
this.$message.error(data.msg)
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
}
})
}).catch(() => {
@ -260,14 +262,18 @@
},
circulationModal(row){
if(row.closeFlag=="已流转"){
this.$message.error("订单已流转无法再次流转!");
this.$alert("订单已流转无法再次流转!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if(row.qtyfinished>=row.orderQty){
this.$message.error("订单已全部入库无需流转!");
this.$alert("订单已全部入库无需流转!", '错误', {
confirmButtonText: '确定',
});
return false;
}
this.getSelectData()
this.getSelectData();
this.circulationFlag=true;
this.circulationData.orderNo=row.orderNo;
this.circulationData.unFinishQty=row.orderQty-row.qtyfinished;
@ -277,18 +283,17 @@
},
circulationSave() {
if (this.circulationData.shiftId == "" || null == this.circulationData.shiftId) {
this.$message.error("请选择班次!");
this.$alert("请选择班次!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.circulationData.orderDate == "") {
this.$message.error("请输入流转日期!");
this.$alert("请输入流转日期!", '错误', {
confirmButtonText: '确定',
});
return false;
}
this.$confirm(`是否流转此日计划?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
circulationSave(this.circulationData).then(({data}) => {
if (data && data.code === 0) {
this.search();
@ -301,11 +306,11 @@
}
})
} else {
this.$message.error(data.msg)
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
}
})
}).catch(() => {
})
},
getSelectData(){
this.selectList=[];

238
src/views/modules/sys/shiftData.vue

@ -0,0 +1,238 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-button type="primary" @click="searchShift()">查询</el-button>
<el-button type="primary" @click="newShift()">新增班次</el-button>
</el-form>
<el-table
:height="height"
:data="shiftData"
border
style="width: 100%">
<el-table-column
prop="shiftno"
header-align="center"
align="left"
label="班次编码">
</el-table-column>
<el-table-column
prop="shiftdesc"
header-align="center"
align="left"
label="班次名称">
</el-table-column>
<el-table-column
prop="startexacttime"
header-align="center"
align="left"
label="上班时间">
</el-table-column>
<el-table-column
prop="endexacttime"
header-align="center"
align="left"
label="下班时间">
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="editShift(scope.row)">编辑</a>
<a type="text" size="small" @click="deleteShift(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<el-dialog title="维护班次" :close-on-click-modal="false" v-drag :visible.sync="newShiftFlag" width="341px" >
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'班次编码:'">
<el-input v-model="newShiftData.shiftno" :disabled="newShiftFlag1" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'班次名称:'">
<el-input v-model="newShiftData.shiftdesc" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'上班时间:'">
<el-time-picker
format="HH:mm"
arrow-control
style="width: 130px"
v-model="newShiftData.startexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
<el-form-item :label="'下班时间:'" >
<el-time-picker
arrow-control
format="HH:mm"
style="width: 130px"
v-model="newShiftData.endexacttime"
placeholder="请选择"
value-format="HH:mm">
</el-time-picker>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="newShiftSave()">保存</el-button>
<el-button type="primary" @click="newShiftFlag = false">取消</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import {
getShiftData,
saveNewShift,
deleteShift
} from "@/api/prd.js";
export default {
name: 'shiftData',
data () {
return {
height: 200,
shiftData:[],
newShiftFlag:false,
newShiftFlag1:true,
newShiftData:{
shiftno:'',
shiftdesc:'',
startexacttime:'',
endexacttime:'',
id:'',
site:this.$store.state.user.site,
},
}
},
mounted() {
this.$nextTick(()=>{
this.height = window.innerHeight - 210;
})
},
methods: {
newShift () {
this.newShiftFlag1 = false;
this.newShiftData.shiftno = '';
this.newShiftData.shiftdesc = '';
this.newShiftData.startexacttime = '';
this.newShiftData.endexacttime = '';
this.newShiftData.id = 0;
this.newShiftFlag = true;
},
editShift(row){
this.newShiftData.shiftno = row.shiftno;
this.newShiftData.shiftdesc = row.shiftdesc;
this.newShiftData.startexacttime = row.startexacttime;
this.newShiftData.endexacttime = row.endexacttime;
this.newShiftData.id = row.id;
this.newShiftFlag1 = true;
this.newShiftFlag = true;
},
newShiftSave(){
if (this.newShiftData.shiftno == "" || null == this.newShiftData.shiftno) {
this.$alert("请输入班次编码!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.newShiftData.shiftdesc == "" || null == this.newShiftData.shiftdesc) {
this.$alert("请输入班次名称!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.newShiftData.startexacttime == "") {
this.$alert("请输入上班时间!", '错误', {
confirmButtonText: '确定',
});
return false;
}
if (this.newShiftData.endexacttime == "") {
this.$alert("请输入下班时间!", '错误', {
confirmButtonText: '确定',
});
return false;
}
let time1=this.newShiftData.startexacttime;
let time2=this.newShiftData.endexacttime;
let list={
shiftno:this.newShiftData.shiftno,
shiftdesc:this.newShiftData.shiftdesc,
startexacttime:'2020-01-01 '+this.newShiftData.startexacttime+':00',
endexacttime:'2020-01-01 '+this.newShiftData.endexacttime+':00',
id:this.newShiftData.id,
site:this.$store.state.user.site,
};
// this.newShiftData.startexacttime='2020-01-01 '+this.newShiftData.startexacttime+':00';
// this.newShiftData.endexacttime='2020-01-01 '+this.newShiftData.endexacttime+':00';
saveNewShift(list).then(({data}) => {
this.newShiftData.startexacttime=time1;
this.newShiftData.endexacttime=time2;
if (data && data.code === 0) {
this.newShiftFlag=false;
getShiftData().then(({data}) => {
this.shiftData = data.rows;
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
}
})
},
searchShift(){
getShiftData().then(({data}) => {
this.shiftData = data.rows;
})
},
deleteShift(row){
this.$confirm(`是否删除此条班次信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
id:row.id
}
deleteShift(inData).then(({data}) => {
if (data && data.code === 0) {
getShiftData().then(({data}) => {
this.shiftData = data.rows;
})
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
}
})
}).catch(() => {
})
},
},
created() {
this.searchShift();
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save