Browse Source

切换卷 和 创建分卷

master
Rui_Li 4 years ago
parent
commit
893260de8c
  1. 7
      src/api/yieldReport/com_separate_roll.js
  2. 7
      src/api/yieldReport/com_switch_roll.js
  3. 16
      src/views/modules/yieldReport/com_produce_report_normal.vue
  4. 171
      src/views/modules/yieldReport/com_separate_roll.vue
  5. 132
      src/views/modules/yieldReport/com_switch_roll.vue

7
src/api/yieldReport/com_separate_roll.js

@ -0,0 +1,7 @@
import { createAPI } from '@/utils/httpRequest.js'
// 校验创建分卷的操作
export const checkCreateSplitSfdcRoll = data => createAPI('schedule/checkCreateSplitSfdcRoll', 'POST', data)
// 执行创建分卷的操作
export const createSplitSfdcRoll = data => createAPI('schedule/createSplitSfdcRoll', 'POST', data)

7
src/api/yieldReport/com_switch_roll.js

@ -0,0 +1,7 @@
import { createAPI } from '@/utils/httpRequest.js'
// 校验切换卷的操作
export const checkSwitchSfdcRoll = data => createAPI('schedule/checkSwitchSfdcRoll', 'POST', data)
// 执行切换卷的操作
export const switchSfdcRoll = data => createAPI('schedule/switchSfdcRoll', 'POST', data)

16
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -165,7 +165,7 @@
width="75"
:label="'操作'">
<template slot-scope="scope">
<a class="customer-a" v-if="scope.row.finishedFlag == 'N'" @click="replaceToolModal(scope.row)"
<a class="customer-a" v-if="operatorData.operatorName != '' && scope.row.finishedFlag == 'N'" @click="replaceToolModal(scope.row)"
>刀模替换</a>
</template>
</el-table-column>
@ -240,11 +240,11 @@
width="115"
:label="'操作'">
<template slot-scope="scope">
<a class="customer-a" v-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="replaceMaterialModal(scope.row)"
<a class="customer-a" v-if="operatorData.operatorName != '' && scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="replaceMaterialModal(scope.row)"
>换料</a>
<a class="customer-a" v-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="cuttingMaterialModal(scope.row)"
<a class="customer-a" v-if="operatorData.operatorName != '' && scope.row.finishedFlag == 'N' && scope.row.histType == '发料'" @click="cuttingMaterialModal(scope.row)"
>下料</a>
<a class="customer-a" v-if="scope.row.finishedFlag == 'N' && scope.row.histType == '发料' && scope.row.keyRMFlag == 'N'" @click="replaceMaterialModal(scope.row)"
<a class="customer-a" v-if="operatorData.operatorName != '' && scope.row.finishedFlag == 'N' && scope.row.histType == '发料' && scope.row.keyRMFlag == 'N'" @click="replaceMaterialModal(scope.row)"
>生产结束</a>
</template>
</el-table-column>
@ -428,7 +428,7 @@
<!-- 开始生产组件 -->
<comSwitchRoll ref="comSwitchRoll" :close-on-click-modal="false"
:visible.sync="showSwitchFlag">
:visible.sync="showSwitchFlag" @refreshPageData="refreshPageData">
</comSwitchRoll>
@ -2990,7 +2990,7 @@ export default {
await this.refreshCurrentTabTable();
//
await this.refreshPageButtons();
//await this.refreshPageButtons();
},
@ -3123,7 +3123,7 @@ export default {
//
this.$nextTick(() => {
this.showSwitchFlag = true;
this.$refs.comSwitchRoll.init(this.scheduleData.seqNo, this.operatorData)
this.$refs.comSwitchRoll.init(this.scheduleData, this.operatorData)
});
},
@ -3134,7 +3134,7 @@ export default {
// 76
this.$nextTick(() => {
this.showSeparateFlag = true;
this.$refs.comSeparateRoll.init(this.scheduleData.seqNo, this.operatorData)
this.$refs.comSeparateRoll.init(this.scheduleData, this.operatorData)
});
},

171
src/views/modules/yieldReport/com_separate_roll.vue

@ -9,7 +9,7 @@
<el-col :span="8">
<el-form-item :label="'当前时间:'">
<el-date-picker style="width: 100px;"
v-model="scheduleData.reportDate"
v-model="pageData.reportDate"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="">
@ -20,7 +20,7 @@
<el-form-item :label="''">
<el-form-item :label="''">
<el-time-picker style="width: 80px;"
v-model="scheduleData.reportTime"
v-model="pageData.reportTime"
format="HH:mm:ss"
value-format="HH:mm:ss"
placeholder="">
@ -33,12 +33,12 @@
<el-row>
<el-col :span="12" style="margin-top: -5px;">
<el-form-item :label="'良品数量:'">
<el-input v-model="scheduleData.orderNo" style="width: 120px;" ></el-input>
<el-input ref="rollQty" v-model="pageData.rollQty" style="width: 120px;" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12" style="margin-top: -5px;">
<el-form-item :label="'卷数:'">
<el-input v-model="scheduleData.orderNo" style="width: 120px;" ></el-input>
<el-input v-model="pageData.rollNums" style="width: 120px;" ></el-input>
</el-form-item>
</el-col>
</el-row>
@ -52,36 +52,51 @@
</template>
<script>
import {
checkCreateSplitSfdcRoll,/*校验是否可以创建分卷*/
createSplitSfdcRoll,/*执行创建分卷的操作*/
} from '@/api/yieldReport/com_separate_roll.js'
export default {
name: "com_separate_roll",
data() {
return {
titleCon: '创建分卷',
sfdcTimeList: [],
scheduleData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
seqNo: '',
orderNo: '',
itemNo: 0,
resourceId: '',
scheduledDate: '',
shiftNo: '',
partNo: '',
workCenterNo: '',
workCenterDesc: '',
resourceDesc: '',
rollNo: '',
partDesc: '',
reportDate: '',
reportTime: '',
reportedFlag: 'N',
planStartTime: '',
planFinishTime: '',
qtyRequiredOriginal: 0,
scheduledDate: '',
shiftNo: '',
preItemDesc: '',
nextItemDesc: '',
nextItemNo: 0,
operatorId: '',
functionName: '',
currentRollFlag: false
},
currentRollOps: {
pageData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
orderNo: '',
itemNo: '',
seqNo: '',
rollNo: '',
finishedFlag: '',
reportDate: '',
reportTime: '',
rollQty: 0,
rollNums: 1
},
operatorData: {
site: this.$store.state.user.site,
@ -92,53 +107,117 @@ export default {
seqNo: '',
showFlag: false
},
buttonTags:{
createRollFlag: true,
switchRollFlag: true,
separatorRollFlag: true,
finishRollFlag: true,
mergeRollFlag: true,
tuningFlag: true,
produceFlag: true,
defectFlag: true,
toolFlag: true,
materialFlag: true,
downTimeFlag: true
},
dataListLoading: false,
}
},
methods: {
//
init(scheduleData, operatorData) {
//
this.scheduleData = scheduleData;
//
this.operatorData = JSON.parse(JSON.stringify(operatorData));
//
this.pageData.reportDate = this.dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
this.pageData.reportTime = this.dayjs(new Date()).format('HH:mm:ss');
//
this.pageData.orderNo = scheduleData.orderNo;
this.pageData.itemNo = scheduleData.itemNo;
this.pageData.seqNo = scheduleData.seqNo;
this.pageData.rollNo = scheduleData.rollNo;
//
this.pageData.rollQty = 0;
this.pageData.rollNums = 1;
//
this.$nextTick(() => {
this.$refs.rollQty.focus();
});
},
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
},
/*检查材料卷号的数据*/
checkValidQty() {
//
let rollQty = this.pageData.rollQty;
//
if (rollQty <= 0 || !Number.isInteger(rollQty)){
this.$message.error('良品数量必须是正整数!');
return false;
}
},
/*检查材料卷号的数据*/
checkRollNums() {
//
let rollNums = this.pageData.rollNums;
//
if (rollNums <= 0 || !Number.isInteger(rollNums)){
this.$message.error('卷数必须是正整数!');
return false;
}
},
init(seqNo, operatorData) {
//
this.scheduleData.seqNo = seqNo;
//
this.operatorData = JSON.parse(JSON.stringify(operatorData));
//
this.pageData.reportDate = this.dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
this.pageData.reportTime = this.dayjs(new Date()).format('HH:mm:ss');
// this.currentRollOps.seqNo = seqNo;
// this.currentRollOps.rollNo = rollNo;
//
//this.refreshPageData();
checkCreateSeparateRolllBun() {
//
if (this.pageData.operatorId == '' || this.pageData.operatorId == null) {
this.$message.error('请先切换人员!');
return false;
}
//
let rollQty = this.pageData.rollQty;
//
if (rollQty <= 0 || !Number.isInteger(rollQty)){
this.$message.error('良品数量必须大于零且是整数!');
return false;
}
//
let rollNums = this.pageData.rollNums;
//
if (rollNums <= 0 || !Number.isInteger(rollNums)){
this.$message.error('卷数必须大于零且是整数!');
return false;
}
//
checkCreateSplitSfdcRoll(this.pageData).then(({data}) => {
//
if (data.code == 500) {
this.$message.error(data.msg);
} else if (data.resultMap.resultCode == '201') {
//
this.$confirm(data.resultMap.resultMsg, '提示', {
confirmButtonText: '确认',
celButtonText: '取消',
type: 'warning'
}).then(() => {
//
this.createSeparateRolllOperation();
});
} else { //
this.createSeparateRolllOperation();
}
});
},
/*执行创建分卷的操作*/
createSeparateRolllOperation() {
//
createSplitSfdcRoll(this.pageData).then(({data}) => {
//
if (data.code == 500) {
this.$message.error(data.msg);
} else {
//
this.$emit('refreshPageData');
//
this.closeDialog();
}
})
},
},
created() {
// this.factoryList()

132
src/views/modules/yieldReport/com_switch_roll.vue

@ -8,7 +8,7 @@
<el-row style="">
<el-col :span="24">
<el-form-item :label="'半成品卷卷号:'">
<el-input v-model="scheduleData.orderNo" style="width: 120px;" ></el-input>
<el-input ref="newRollNo" v-model="pageData.newRollNo" style="width: 120px;" ></el-input>
</el-form-item>
</el-col>
</el-row>
@ -18,39 +18,57 @@
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
/*添加组件*/
import comExceptionReason from "./com_exception_reason";//
/*添加js的方法和请求*/
import {
checkSwitchSfdcRoll,/*校验是否可以切换卷*/
switchSfdcRoll,/*执行切换卷的操作*/
} from '@/api/yieldReport/com_switch_roll.js'
export default {
name: "com_merge_roll",
data() {
return {
titleCon: '切换卷',
sfdcTimeList: [],
scheduleData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
seqNo: '',
orderNo: '',
itemNo: 0,
resourceId: '',
scheduledDate: '',
shiftNo: '',
partNo: '',
workCenterNo: '',
workCenterDesc: '',
resourceDesc: '',
rollNo: '',
partDesc: '',
reportTime: this.dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
reportedFlag: 'N',
planStartTime: '',
planFinishTime: '',
qtyRequiredOriginal: 0,
scheduledDate: '',
shiftNo: '',
preItemDesc: '',
nextItemDesc: '',
nextItemNo: 0,
operatorId: '',
functionName: '',
currentRollFlag: false
},
currentRollOps: {
pageData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
seqNo: '',
rollNo: '',
finishedFlag: '',
orderNo: '',
itemNo: '',
newRollNo: '',
operatorId: ''
},
operatorData: {
site: this.$store.state.user.site,
@ -61,48 +79,82 @@ export default {
seqNo: '',
showFlag: false
},
buttonTags:{
createRollFlag: true,
switchRollFlag: true,
separatorRollFlag: true,
finishRollFlag: true,
mergeRollFlag: true,
tuningFlag: true,
produceFlag: true,
defectFlag: true,
toolFlag: true,
materialFlag: true,
downTimeFlag: true
},
dataListLoading: false,
}
},
components: {
comExceptionReason,/*异常原因的组件*/
},
methods: {
//
init(scheduleData, operatorData) {
//
this.scheduleData = scheduleData;
//
this.operatorData = JSON.parse(JSON.stringify(operatorData));
//
this.pageData.orderNo = scheduleData.orderNo;
this.pageData.itemNo = scheduleData.orderNo;
this.pageData.seqNo = scheduleData.seqNo;
this.pageData.operatorId = operatorData.operatorId;
//
this.$nextTick(() => {
this.$refs.newRollNo.focus();
});
},
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
},
init(seqNo, operatorData) {
//
this.scheduleData.seqNo = seqNo;
//
this.operatorData = JSON.parse(JSON.stringify(operatorData));
// this.currentRollOps.seqNo = seqNo;
// this.currentRollOps.rollNo = rollNo;
//
//this.refreshPageData();
switchRollBun() {
//
if (this.pageData.operatorId == '' || this.pageData.operatorId == null) {
this.$message.error('请先切换人员!');
return false;
}
//
let newRollNo = this.pageData.newRollNo;
if (newRollNo == null || newRollNo == '') {
this.$message.error('请输入半成品卷号!');
return false;
}
//
checkSwitchSfdcRoll(this.pageData).then(({data}) => {
//
if (data.code == 500) {
this.$message.error(data.msg);
} else if (data.resultMap.resultCode == '201') {
//
this.$confirm(data.resultMap.resultMsg, '提示', {
confirmButtonText: '确认',
celButtonText: '取消',
type: 'warning'
}).then(() => {
//
this.switchRollOperation();
});
} else { //
this.switchRollOperation();
}
});
},
/*执行切换卷的操作*/
switchRollOperation() {
//
switchSfdcRoll(this.pageData).then(({data}) => {
//
if (data.code == 500) {
this.$message.error(data.msg);
} else {
//
this.$emit('refreshPageData');
//
this.closeDialog();
}
})
},
},
created() {
// this.factoryList()

Loading…
Cancel
Save