Browse Source

组件开发

master
rui_li 4 years ago
parent
commit
52c49f4474
  1. 109
      src/views/modules/yieldReport/com_finish_roll.vue
  2. 97
      src/views/modules/yieldReport/com_produce_report_normal.vue
  3. 93
      src/views/modules/yieldReport/com_switch_operator.vue
  4. 84
      src/views/modules/yieldReport/produce_order.vue

109
src/views/modules/yieldReport/com_finish_roll.vue

@ -0,0 +1,109 @@
<template>
<el-dialog v-drag
width="830px" class="customer-dialog"
:close-on-click-modal="false"
:visible.sync="visibleFlag">
<div style="height: 380px;">
我是中国人tom是美国人!
</div>
</el-dialog>
</template>
<script>
export default {
name: "com_finish_roll",
data() {
return {
titleCon:'',
visibleFlag: false,
sfdcTimeList: [],
scheduleData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
seqNo: '',
orderNo: '',
partNo: '',
rollNo: '',
partDesc: '',
planStartTime: '',
planFinishTime: '',
qtyRequiredOriginal: 0,
scheduledDate: '',
shiftNo: '',
preItemDesc: '',
nextItemDesc: '',
nextItemNo: 0,
currentRollFlag: false
},
currentRollOps: {
site: this.$store.state.user.site,
seqNo: '',
rollNo: '',
finishedFlag: '',
},
operatorData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
operatorId: '',
operatorName: '',
status: '',
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: {
init1(seqNo, rollNo) {
alert(seqNo);
// this.scheduleData.seqNo = seqNo;
// this.currentRollOps.seqNo = seqNo;
// this.currentRollOps.rollNo = rollNo;
this.visibleFlag = true;
//
//this.refreshPageData();
},
},
created() {
// this.factoryList()
// this.getLanguageList()
}
}
</script>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content{
padding: 0px !important;
}
</style>

97
src/views/modules/yieldReport/produce_report_normal.vue → src/views/modules/yieldReport/com_produce_report_normal.vue

@ -71,7 +71,8 @@
创建分卷</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" :disabled="buttonTags.finishRollFlag" style="margin-left: 10px; margin-bottom: 5px;">
<el-button type="primary" :disabled="buttonTags.finishRollFlag"
@click="finishRoll" style="margin-left: 10px; margin-bottom: 5px;">
结束卷</el-button>
</el-form-item>
<el-form-item>
@ -292,7 +293,7 @@
刷新</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" style="margin-left: 25px; margin-top: 20px;">
<el-button type="primary" @click="switchOperatorModal" style="margin-left: 25px; margin-top: 20px;">
切换用户</el-button>
</el-form-item>
<el-form-item>
@ -341,10 +342,21 @@
</el-form-item>
</el-form>
</fieldset>
</el-form>
</el-dialog>
<!-- 切换操作员 -->
<comSwitchOperator v-show="showOperatorFlag" ref="comSwitchOperator"
@initOperatorData="initOperatorData">
</comSwitchOperator>
<!-- 结束卷的modal -->
<comFinishRoll ref="comFinishRoll" v-show="showFinishFlag" >
</comFinishRoll>
</div>
</template>
<script>
@ -360,12 +372,16 @@ import {
getSfdcDefectByCon,
getSfdcRollByCon,
} from "@/api/yieldReport/produce_report_normal.js";
/*引入组件*/
import comSwitchOperator from "./com_switch_operator";/*切换操作员*/
export default {
name: "produce_report_normal",
name: "com_produce_report_normal",
data() {
return {
titleCon:'',
visibleFlag: false,
showOperatorFlag: false,
showFinishFlag: false,
activeTable: 'sfdc_time',
sfdcTimeList: [],
orderToolList: [],
@ -2521,6 +2537,8 @@ export default {
seqNo: '',
orderNo: '',
partNo: '',
workCenterDesc: '',
resourceDesc: '',
rollNo: '',
partDesc: '',
planStartTime: '',
@ -2530,6 +2548,7 @@ export default {
shiftNo: '',
preItemDesc: '',
nextItemDesc: '',
nextItemNo: 0,
currentRollFlag: false
},
currentRollOps: {
@ -2544,13 +2563,14 @@ export default {
operatorId: '',
operatorName: '',
status: '',
seqNo: '',
showFlag: false
},
buttonTags:{
createRollFlag: true,
switchRollFlag: true,
separatorRollFlag: true,
finishRollFlag: true,
finishRollFlag: false,
mergeRollFlag: true,
tuningFlag: true,
produceFlag: true,
@ -2562,21 +2582,26 @@ export default {
dataListLoading: false,
}
},
components: {
comSwitchOperator,/*切换用户的组件*/
},
methods: {
//
getScheduleDataBySeqNo(){
getScheduleDataBySeqNo(this.scheduleData.seqNo).then(({data}) => {
this.scheduleData.seqNo= data.row.seqNo;
this.scheduleData.orderNo= data.row.orderNo;
this.scheduleData.partNo= data.row.partNo;
this.scheduleData.partDesc= data.row.partDesc;
this.scheduleData.planStartTime= data.row.planStartTime;
this.scheduleData.planFinishTime= data.row.planFinishTime;
this.scheduleData.qtyRequiredOriginal= data.row.qtyRequiredOriginal;
this.scheduleData.scheduledDate= data.row.scheduledDate;
this.scheduleData.shiftNo= data.row.shiftNo;
this.scheduleData.preItemDesc= data.row.preItemDesc;
this.scheduleData.nextItemDesc= data.row.nextItemDesc;
this.scheduleData.seqNo = data.row.seqNo;
this.scheduleData.orderNo = data.row.orderNo;
this.scheduleData.partNo = data.row.partNo;
this.scheduleData.partDesc = data.row.partDesc;
this.scheduleData.planStartTime = data.row.planStartTime;
this.scheduleData.planFinishTime = data.row.planFinishTime;
this.scheduleData.qtyRequiredOriginal = data.row.qtyRequiredOriginal;
this.scheduleData.scheduledDate = data.row.scheduledDate;
this.scheduleData.shiftNo = data.row.shiftNo;
this.scheduleData.preItemDesc = data.row.preItemDesc;
this.scheduleData.nextItemDesc = data.row.nextItemDesc;
this.scheduleData.workCenterDesc = data.row.workCenterDesc;
this.scheduleData.resourceDesc = data.row.resourceDesc;
});
},
//
@ -2676,9 +2701,22 @@ export default {
}
},
//modal
switchOperatorModal() {
//
if (JSON.stringify(this.currentRow) == '{}') {
this.$message.error('请先选择派工单!');
return false;
}
//
this.showOperatorFlag = true;
this.$nextTick(() => {
this.$refs.comSwitchOperator.init();
});
},
init(seqNo, operatorData) {
debugger;
this.scheduleData.seqNo = seqNo;
this.currentRollOps.seqNo = seqNo;
this.operatorData = operatorData;
@ -2700,6 +2738,8 @@ export default {
this.scheduleData.shiftNo= data.row.shiftNo;
this.scheduleData.preItemDesc= data.row.preItemDesc;
this.scheduleData.nextItemDesc= data.row.nextItemDesc;
this.scheduleData.workCenterDesc = data.row.workCenterDesc;
this.scheduleData.resourceDesc = data.row.resourceDesc;
//
this.titleCon = '机台工作台' + ' - ' + data.row.workCenterDesc + ' '
+ data.row.resourceDesc + ' (' + this.operatorData.operatorName+ ')';
@ -2718,6 +2758,29 @@ export default {
//this.refreshCurrentButtons();
});
},
//
initOperatorData(operatorData){
this.showOperatorFlag = false;
this.operatorData = JSON.parse(JSON.stringify(operatorData));
//
//
this.titleCon = '机台工作台' + ' - ' + this.scheduleData.workCenterDesc + ' '
+ this.scheduleData.resourceDesc + ' (' + this.operatorData.operatorName+ ')';
},
finishRoll(val1,val2){
alert(val1+val2)
//1.
//checkProduceButton('finishRollFlag');
//
this.$nextTick(() => {
this.showFinishFlag = true;
this.$refs.comFinishRoll.init1(val1,val2)
// this.$refs.com_finish_roll.init(this.scheduleData.seqNo, this.currentRollOps.rollNo);
});
},
},
created() {
// this.factoryList()

93
src/views/modules/yieldReport/com_switch_operator.vue

@ -0,0 +1,93 @@
<template>
<!-- 展示员工切换的模块 -->
<el-dialog :title="titleCon" :close-on-click-modal="false"
v-drag :visible.sync="visibleFlag" width="300px">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'操作员:'">
<el-input v-model="operatorData.operatorId" style="width: 110px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'操作员姓名:'">
<el-input v-model="operatorData.operatorName" style="width: 110px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px"
style="margin-left: 180px; margin-top: -80px; width: 60px;">
<el-form-item label="">
<el-button type="primary">列表</el-button>
</el-form-item>
<el-form-item label="" style="margin-top: 10px; margin-bottom: 0px;">
<el-button type="primary" @click="saveOperatorData()">保存</el-button>
</el-form-item>
<el-form-item label="" style="margin-top: 15px; margin-bottom: 5px;">
<el-button type="primary" @click="visibleFlag = false">关闭</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script>
import {
getOperatorData,
} from '@/api/yieldReport/produce_order.js'
export default {
name: "com_switch_operator",
data() {
return {
titleCon:'操作员切换',
visibleFlag: false,
operatorFlag: false,
operatorData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
operatorId: '',
operatorName: '',
status: ''
},
}
},
methods: {
//
init() {
this.visibleFlag = true;
//
//this.refreshPageData();
},
//
saveOperatorData() {
getOperatorData(this.operatorData).then(({data}) => {
//
if(!data.row){
this.$message.error('账号有误!');
}
let status = data.row.status;
this.operatorData.operatorName = data.row.operatorName;
//
this.operatorData.status = status;
//
if (status == 'N') {
this.operatorFlag = false;
} else {
this.operatorFlag = true;
}
if (!this.operatorFlag) {
this.$message.error('操作员信息不可用!');
}
})
//
.then(() => {
this.visibleFlag = false;
this.$emit('initOperatorData', this.operatorData)
});
},
},
created() {
}
}
</script>
<style scoped lang="scss">
</style>

84
src/views/modules/yieldReport/produce_order.vue

@ -106,38 +106,17 @@
</el-table>
</el-main>
<!-- 展示员工切换的模块 -->
<el-dialog title="操作员切换" :close-on-click-modal="false"
v-drag :visible.sync="operatorData.showFlag" width="300px">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'操作员:'">
<el-input v-model="operatorData.operatorId" style="width: 110px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
<el-form-item :label="'操作员姓名:'">
<el-input v-model="operatorData.operatorName" style="width: 110px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" label-width="100px"
style="margin-left: 180px; margin-top: -80px; width: 60px;">
<el-form-item label="">
<el-button type="primary">列表</el-button>
</el-form-item>
<el-form-item label="" style="margin-top: 10px; margin-bottom: 0px;">
<el-button type="primary" @click="saveOperatorData()">保存</el-button>
</el-form-item>
<el-form-item label="" style="margin-top: 15px; margin-bottom: 5px;">
<el-button type="primary" @click="operatorData.showFlag = false">关闭</el-button>
</el-form-item>
<!-- 切换操作员 -->
<comSwitchOperator v-show="showOperatorFlag" ref="comSwitchOperator"
@initOperatorData="initOperatorData">
</el-form>
</el-dialog>
<produceReportNormal class="customer-components" v-if="showReportFlag" ref="produceReportNormal">
</comSwitchOperator>
</produceReportNormal>
<!-- 正常报工的组件 -->
<comProduceReportNormal v-if="showReportFlag" ref="comProduceReportNormal"
@rollInit="rollInit" @switchOperatorModal>
</comProduceReportNormal>
</div>
</template>
@ -146,16 +125,19 @@
import {
getProduceScheduleList,
getOperatorData,
} from '@/api/yieldReport/produce_order.js'
import produceReportNormal from "./produce_report_normal";
} from '@/api/yieldReport/produce_order.js';
/*引入组件*/
import comSwitchOperator from "./com_switch_operator";/*切换操作员*/
import comProduceReportNormal from "./com_produce_report_normal";/* 报工的组件*/
import comFinishRoll from "./com_finish_roll";/*结束卷的组件*/
export default {
data() {
return {
height: 800,
operatorFlag: false,
showOperatorFlag: false,
showReportFlag: false,
showFinishFlag:false,
selectList: [],
searchData: {
site: this.$store.state.user.site,
@ -961,7 +943,9 @@ export default {
}
},
components: {
produceReportNormal,
comSwitchOperator,/*切换用户的组件*/
comProduceReportNormal,/*报工页面的组件*/
comFinishRoll,/*结束卷的组件*/
},
mounted() {
this.$nextTick(() => {
@ -969,6 +953,7 @@ export default {
})
},
methods: {
/*查询派工单*/
getProduceScheduleList() {
getProduceScheduleList(this.searchData).then(({data}) => {
@ -984,6 +969,15 @@ export default {
setCurrentRow(row, column, event) {
this.currentRow = JSON.parse(JSON.stringify(row));
},
//
initOperatorData(operatorData){
this.showOperatorFlag = false;
this.operatorData = JSON.parse(JSON.stringify(operatorData));
//
this.switchProduceReportModal();
},
//modal
switchOperatorModal() {
//
@ -992,9 +986,25 @@ export default {
return false;
}
//
this.operatorData.showFlag = true;
this.showOperatorFlag = true;
this.$nextTick(() => {
this.$refs.comSwitchOperator.init();
});
},
//modal
switchProduceReportModal() {
//
if (JSON.stringify(this.currentRow) == '{}') {
this.$message.error('请先选择派工单!');
return false;
}
//
this.showReportFlag = true;
this.$nextTick(() => {
this.$refs.comProduceReportNormal.init(this.currentRow.seqNo, this.operatorData);
});
},
//使
//
saveOperatorData() {
@ -1026,7 +1036,7 @@ export default {
this.showReportFlag = true;
//
this.$nextTick(() => {
this.$refs.produceReportNormal.init(this.currentRow.seqNo, this.operatorData);
this.$refs.comProduceReportNormal.init(this.currentRow.seqNo, this.operatorData);
});
})
}

Loading…
Cancel
Save