Browse Source

1008 批量报工

master
ruanqi 5 years ago
parent
commit
fd03b6ea15
  1. 4
      config/index.js
  2. 2
      src/api/production.js
  3. 10
      src/views/modules/board/nextWeekShipmentBoard.vue
  4. 10
      src/views/modules/board/thisWeekShipmentBoard.vue
  5. 9
      src/views/modules/pad/padPartPhoto.vue
  6. 22
      src/views/modules/production/dailyPlan.vue
  7. 113
      src/views/modules/production/dailyPlanReport.vue
  8. 4
      src/views/modules/production/productionBlankingSearch.vue
  9. 2
      static/config/index.js

4
config/index.js

@ -13,7 +13,7 @@ module.exports = {
// 代理列表, 是否开启代理通过[./dev.env.js]配置
proxyTable: devEnv.OPEN_PROXY === false ? {} : {
'/proxyApi': {
target: 'http://192.168.0.193:9090',
target: 'http://192.168.1.130:9090',
changeOrigin: true,
pathRewrite: {
// 把 /proxyApi 替换成 /
@ -23,7 +23,7 @@ module.exports = {
},
// Various Dev Server settings
host: '192.168.0.193', // can be overwritten by process.env.HOST
host: '192.168.1.130', // can be overwritten by process.env.HOST
port: 8002, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,

2
src/api/production.js

@ -25,7 +25,7 @@ export const getDailyPlanData=data => createAPI(`dailyPlan/getDailyPlanData`, 'p
export const dailyPlanReportSave=data => createAPI(`dailyPlan/dailyPlanReportSave`, 'post', data);
export const dailyPlanReportsSave=data => createAPI(`dailyPlan/dailyPlanReportsSave`, 'post', data);
export const productionBlankingSearch=data => createAPI(`dailyPlan/productionBlankingSearch`, 'post', data);

10
src/views/modules/board/nextWeekShipmentBoard.vue

@ -48,7 +48,8 @@
header-align="center"
align="right"
min-width="40"
label="袋装重量">
label="袋装重量"
:formatter="getFormatterNumber">
</el-table-column>
<el-table-column
prop="bagsperBox"
@ -132,6 +133,13 @@
})
},
methods: {
getFormatterNumber (row, column){
if(parseInt(row.weightperBag)==row.weightperBag){
return parseInt(row.weightperBag);
}else{
return row.weightperBag.toFixed(3);
}
},
tableRowClassName ({row, rowIndex}) {
if (row.finishedFlag == '2') {
return 'success-row'

10
src/views/modules/board/thisWeekShipmentBoard.vue

@ -48,7 +48,8 @@
header-align="center"
align="right"
min-width="40"
label="袋装重量">
label="袋装重量"
:formatter="getFormatterNumber">
</el-table-column>
<el-table-column
prop="bagsperBox"
@ -135,6 +136,13 @@
// this.autoRoll()
},
methods: {
getFormatterNumber (row, column){
if(parseInt(row.weightperBag)==row.weightperBag){
return parseInt(row.weightperBag);
}else{
return row.weightperBag.toFixed(3);
}
},
tableRowClassName ({row, rowIndex}) {
if (row.finishedFlag == '2') {
return 'success-row'

9
src/views/modules/pad/padPartPhoto.vue

@ -32,8 +32,8 @@
</el-form-item>
</el-form>
</div>
<div style="text-align: center;float: left;height: 100%;width: 66%;vertical-align:middle;" >
<img style="max-width: 100%;max-height: 100%;vertical-align:middle;" :src="photoUrl">
<div id="padPhoto" style="text-align: center;float: left;height: 750px;width: 66%;vertical-align:middle;" >
<img style="max-width: 100%;max-height: 100%;vertical-align:middle;" :src="photoUrl">
</div>
@ -93,6 +93,7 @@
this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
// this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
})
},
nextPicture(){
@ -137,5 +138,7 @@
</script>
<style >
.padPhoto .img{
object-fit: cover;
}
</style>

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

@ -1,7 +1,7 @@
<template>
<div class="mod-config">
<el-form inline="true" style="margin-top: -25px;" v-model="searchData">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
<el-form-item :label="'订单号:'">
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
</el-form-item>
@ -54,7 +54,7 @@
<el-form-item :label="'状态:'">
<el-select filterable v-model="searchData.status" style="width: 120px">
<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-select>
</el-form-item>
@ -375,12 +375,12 @@
endDate1: '',
startDate2: '',
endDate2: '',
status: '(\'已下达\',\'已发料\',\'已入库\',\'已开工\')',
status: '(\'已下达\',\'已发料\',\'已入库\',\'已开工\',\'已排产\')',
partNo: '',
startDate3: '',
endDate3: '',
site: this.$store.state.user.site,
planStatus: 'ISNULL(so.scheduling_size,0) >=a.LotSize'
planStatus: 'a.LotSize >ISNULL(so.scheduling_size,0)'
},
// table
height: 200
@ -445,7 +445,7 @@
let list = {orderNo: row.orderNo}
getSchedulingSize(list).then(({data}) => {
this.scheduledModelData.schedulingSize = data.schedulingSize
this.scheduledModelData.unSchedulingSize = row.lotSize - data.schedulingSize
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize)
})
this.scheduledingData.lotSize = row.lotSize
this.scheduledingData.partNo = row.partNo
@ -490,7 +490,7 @@
savePlan(this.scheduledingData).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize)
this.schedulingModalFlag = false
let data1 = {orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {
@ -531,8 +531,8 @@
})
return false
}
if (this.scheduledingsData.dayQty > 10 ) {
this.$alert('计划天数不可大于10天!', '错误', {
if (this.scheduledingsData.dayQty > 30 ) {
this.$alert('计划天数不可大于30天!', '错误', {
confirmButtonText: '确定'
})
return false
@ -578,7 +578,7 @@
savePlans(JSON.stringify(scheduledList)).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize)
this.schedulingsFlag = false
let data1 = {orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {
@ -625,7 +625,7 @@
savePlan(this.scheduledingData).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize;
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize;
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize);
let data1 = {orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {
this.scheduleTableData = data.rows
@ -676,7 +676,7 @@
delPlan(delData).then(({data}) => {
if (data && data.code === 0) {
this.scheduledModelData.schedulingSize = data.schedulingSize
this.scheduledModelData.unSchedulingSize = this.scheduledingData.lotSize - data.schedulingSize
this.scheduledModelData.unSchedulingSize = this.decimalUtil.sub(this.scheduledingData.lotSize,data.schedulingSize);
this.getData()
let data1 = {orderNo: this.scheduledModelData.orderNo}
getWorkPlanData(data1).then(({data}) => {

113
src/views/modules/production/dailyPlanReport.vue

@ -39,12 +39,19 @@
</el-select>
</el-form-item>
<el-button @click="search()" style="margin-left: 0px;margin-top: 33px" type="primary">查询</el-button>
<el-button @click="reports()" style="margin-left: 0px;margin-top: 33px" type="primary">批量报工</el-button>
</el-form>
<el-table
:height="height"
:data="tableData"
border
@selection-change="selectionChangeHandle"
style="width: 100%">
<el-table-column
type="selection"
align="center"
width="30">
</el-table-column>
<el-table-column
prop="orderNo"
header-align="center"
@ -134,6 +141,21 @@
<el-button type="primary" @click="reportModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="批量报工" :close-on-click-modal="false" v-drag :visible.sync="reportsModalFlag" width="341px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'总报工数量:'">
<el-input v-model="qtyIn" @change="changeAverage" type="number" style="width: 130px"></el-input>
</el-form-item>
<el-form-item :label="'平均报工数量:'">
<el-input v-model="qtyAverage" disabled style="width: 130px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="reportsSave()">保存</el-button>
<el-button type="primary" @click="reportsModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
@ -141,12 +163,14 @@
<script>
import {
getDailyPlanData,
dailyPlanReportSave
dailyPlanReportSave,
dailyPlanReportsSave
} from "@/api/production.js"
export default {
name: 'dailyPlanReport',
data () {
return {
reportsModalFlag:false,
reportModalFlag:false,
reportData:{
orderNo:'',
@ -157,6 +181,8 @@
needQty:0,
height:200,
tableData:[],
qtyAverage:0,
qtyIn:'',
date1:'',
searchData:{
finishFlag:'N',
@ -167,7 +193,9 @@
endDate1:'',
status:'all',
site:this.$store.state.user.site,
},
dataListSelections:[],
}
},
mounted() {
@ -176,6 +204,9 @@
})
},
methods: {
selectionChangeHandle (val) {
this.dataListSelections = val
},
search(){
getDailyPlanData(this.searchData).then(({data}) => {
this.tableData = data.rows;
@ -198,11 +229,11 @@
this.$alert('报工数量小于计划数量无法报工!', '错误', {
confirmButtonText: '确定'
})
return false
return false;
}
dailyPlanReportSave(this.reportData).then(({data}) => {
if (data && data.code === 0) {
this.search()
this.search();
this.reportModalFlag=false;
this.$message({
message: '操作成功',
@ -218,12 +249,84 @@
}
})
},
//
reports(){
if(this.dataListSelections.length==0){
this.$alert('请勾选需要报工的日计划!','错误',{
confirmButtonText: '确定'
})
return false;
}
let orderRef=this.dataListSelections[0].orderRef1;
for (let i = 0; i <this.dataListSelections.length ; i++) {
if(orderRef!=this.dataListSelections[i].orderRef1){
this.$alert('请选择同一订单的日计划!','错误',{
confirmButtonText: '确定'
})
return false;
}
if(this.dataListSelections[i].orderQty<=this.dataListSelections[i].qtyfinished){
this.$alert('存在已报工完成的订单!','错误',{
confirmButtonText: '确定'
})
return false;
}
}
this.qtyIn='';
this.qtyAverage='0';
this.reportsModalFlag=true;
},
changeAverage(){
this.qtyAverage=this.decimalUtil.div(this.qtyIn,this.dataListSelections.length);
if(this.qtyAverage!=Math.ceil(this.qtyAverage)){
this.qtyAverage=this.decimalUtil.div(this.qtyIn,this.dataListSelections.length).toFixed(1);
}
},
reportsSave(){
for (let i = 0; i <this.dataListSelections.length ; i++) {
if(this.dataListSelections[i].orderQty>this.qtyAverage){
this.$alert('存在计划数量大于平均报工数量的订单!','错误',{
confirmButtonText: '确定'
})
return false;
}
}
let inList=[];
for (let i = 0; i <this.dataListSelections.length ; i++) {
let indata={
orderNo:this.dataListSelections[i].orderNo,
reportQty:this.qtyAverage,
reportBy:this.$store.state.user.name,
site:this.$store.state.user.site,
}
inList.push(indata)
}
dailyPlanReportsSave(inList).then(({data}) => {
if (data && data.code === 0) {
this.search();
this.reportsModalFlag=false;
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
created() {
}
}
</script>
<style scoped>
<style >
.el-table .cell {
padding: 0px;
}
</style>

4
src/views/modules/production/productionBlankingSearch.vue

@ -200,4 +200,8 @@
/*background: #cbcb14;*/
background: #db1212;
}
.search1 .el-table .cell {
padding: 0px;
}
</style>

2
static/config/index.js

@ -5,7 +5,7 @@
window.SITE_CONFIG = {};
// api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://192.168.0.193:9090/';
window.SITE_CONFIG['baseUrl'] = 'http://192.168.1.130:9090/';
// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名

Loading…
Cancel
Save