Browse Source

0823

master
ruanqiJialidiannao 5 years ago
parent
commit
69b07ad71b
  1. 1
      .eslintignore
  2. 3
      src/api/prd.js
  3. 112
      src/views/modules/production/dailyPlan.vue
  4. 2
      src/views/modules/production/dailyPlanCirculation.vue
  5. 167
      src/views/modules/sys/shiftData.vue

1
.eslintignore

@ -4,3 +4,4 @@
/*.js
/test/unit/coverage/
/src/icons/iconfont.js
/*.vue

3
src/api/prd.js

@ -29,3 +29,6 @@ export const getShiftData=data => createAPI(`dailyPlan/getShiftData`, 'post', da
export const saveNewShift =data => createAPI(`dailyPlan/saveNewShift`, 'post', data);
export const deleteShift= data => createAPI(`dailyPlan/deleteShift`, 'post', data);
export const savePlans= data => createAPI(`dailyPlan/savePlans`, 'post', data);

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

@ -82,6 +82,7 @@
</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="savePlansModal()" style="margin-left: 24px" type="primary">批量排产</el-button>
</el-form-item>
</el-form>
</el-form>
@ -267,7 +268,7 @@
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="schedulingFlag = false">取消</el-button>
<el-button type="primary" @click="schedulingFlag = false">关闭</el-button>
<!-- <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>-->
</el-footer>
</el-dialog>
@ -306,7 +307,39 @@
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" v-if="scheduledingDataFlag3" @click="planSaveOn()">保存并继续</el-button>
<el-button type="primary" @click="planSave()">保存</el-button>
<el-button type="primary" @click="schedulingModalFlag = false">取消</el-button>
<el-button type="primary" @click="schedulingModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="批量排产" :close-on-click-modal="false" v-drag :visible.sync="savePlansModalFlag" width="341px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'计划日期:'">
<el-date-picker
style="width: 130px"
v-model="schedulingModalData.orderDate"
type="date"
value-format="yyyy-MM-dd"
:disabled="scheduledingDataFlag1"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item :label="'计划班次:'">
<!-- <el-input v-model="scheduledingData.shiftId" :disabled="scheduledingDataFlag1" style="width: 130px"></el-input>-->
<el-select v-model="schedulingModalData.shiftId" style="width: 130px"
placeholder="请选择">
<el-option
v-for="(item,index) in selectList"
:key="index"
:label="item.label"
:value="item.value"
>
</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="savePlans()">保存</el-button>
<el-button type="primary" @click="savePlansModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
@ -322,14 +355,15 @@
savePlan,
getWorkPlanData,
delPlan,
getShiftData
getShiftData,
savePlans
} from '@/api/prd.js'
export default {
name: 'productionDispatch',
data () {
return {
savePlansModalFlag:false,
selectList: [],
//
schedulingModalFlag: false,
@ -356,6 +390,10 @@
planAdd: 0,
partNo: ''
},
schedulingModalData:{
orderDate:'',
shiftId: '',
},
scheduledingDataFlag1: false,
scheduledingDataFlag3: true,
schedulingFlag: false,
@ -414,7 +452,7 @@
if (row.status == '已计划' || row.status == '已取消' || row.status == '已关闭') {
return false
}
if (row.schedulingSize >= row.orderQty) {
if (row.schedulingSize >= row.lotSize) {
return false
}
return true
@ -622,7 +660,69 @@
this.selectList.push(resultData)
}
})
}
},
savePlansModal(){
if(this.dataListSelections.length ==0){
this.$alert('请选择订单!', '错误', {
confirmButtonText: '确定'
})
return false
}
this.schedulingModalData.orderDate='';
this.schedulingModalData.shiftId='';
this.savePlansModalFlag=true;
},
savePlans() {
if( this.schedulingModalData.orderDate==''){
this.$alert('请选择排产日期!', '错误', {
confirmButtonText: '确定'
})
return false
}
if( this.schedulingModalData.shiftId==''){
this.$alert('请选择班次!', '错误', {
confirmButtonText: '确定'
})
return false
}
let inList=[];
for(let i = this.dataListSelections.length - 1; i >= 0; i--){
let newlist={
orderNo: this.dataListSelections[i].orderNo,
orderDate: this.schedulingModalData.orderDate,
orderQty: this.dataListSelections[i].lotSize-this.dataListSelections[i].schedulingSize,
shiftId: this.schedulingModalData.shiftId,
userName: this.$store.state.user.name,
lotSize: this.dataListSelections[i].lotSize,
planStartDate: this.dataListSelections[i].planStartDate,
needDate: this.dataListSelections[i].needDate,
site: this.$store.state.user.site,
productionType: '生产订单',
planAdd: 0,
partNo: this.dataListSelections[i].partNo
};
inList.push(newlist);
}
console.log(JSON.parse(JSON.stringify(inList)))
savePlans(JSON.parse(JSON.stringify(inList))).then(({data}) => {
if (data && data.code === 0) {
this.savePlansModalFlag = false;
this.getData()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
},
created () {
this.getSelectData()

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

@ -177,7 +177,7 @@
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center" >
<el-button type="primary" @click="circulationSave()">流转</el-button>
<el-button type="primary" @click="circulationFlag = false">取消</el-button>
<el-button type="primary" @click="circulationFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>

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

@ -76,7 +76,7 @@
</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-button type="primary" @click="newShiftFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
@ -86,94 +86,94 @@
getShiftData,
saveNewShift,
deleteShift
} from "@/api/prd.js";
export default {
} 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,
},
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;
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;
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;
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;
newShiftSave () {
if (this.newShiftData.shiftno == '' || this.newShiftData.shiftno == null) {
this.$alert('请输入班次编码!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.newShiftData.shiftdesc == "" || null == this.newShiftData.shiftdesc) {
this.$alert("请输入班次名称!", '错误', {
confirmButtonText: '确定',
});
return false;
if (this.newShiftData.shiftdesc == '' || this.newShiftData.shiftdesc == null) {
this.$alert('请输入班次名称!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.newShiftData.startexacttime == "") {
this.$alert("请输入上班时间!", '错误', {
confirmButtonText: '确定',
});
return false;
if (this.newShiftData.startexacttime == '') {
this.$alert('请输入上班时间!', '错误', {
confirmButtonText: '确定'
})
return false
}
if (this.newShiftData.endexacttime == "") {
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';
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;
this.newShiftData.startexacttime = time1
this.newShiftData.endexacttime = time2
if (data && data.code === 0) {
this.newShiftFlag=false;
this.newShiftFlag = false
getShiftData().then(({data}) => {
this.shiftData = data.rows;
this.shiftData = data.rows
})
this.$message({
message: '操作成功',
@ -184,30 +184,29 @@
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
confirmButtonText: '确定'
})
}
})
},
searchShift(){
searchShift () {
getShiftData().then(({data}) => {
this.shiftData = data.rows;
this.shiftData = data.rows
})
},
deleteShift(row){
deleteShift (row) {
this.$confirm(`是否删除此条班次信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
id:row.id
let inData = {
id: row.id
}
deleteShift(inData).then(({data}) => {
if (data && data.code === 0) {
getShiftData().then(({data}) => {
this.shiftData = data.rows;
this.shiftData = data.rows
})
this.$message({
message: '操作成功',
@ -219,17 +218,17 @@
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
});
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
}
},
created() {
this.searchShift();
}
created () {
this.searchShift()
}
}
</script>

Loading…
Cancel
Save