Browse Source

切换用户的BUG

master
Rui_Li 4 years ago
parent
commit
826af2b6c8
  1. 2
      src/views/modules/yieldReport/com_produce_report_normal.vue
  2. 83
      src/views/modules/yieldReport/com_switch_operator.vue

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

@ -3006,7 +3006,7 @@ export default {
this.scheduleData.workCenterDesc = data.row.workCenterDesc; this.scheduleData.workCenterDesc = data.row.workCenterDesc;
this.scheduleData.resourceDesc = data.row.resourceDesc; this.scheduleData.resourceDesc = data.row.resourceDesc;
// //
this.titleCon = '机台工作台' + ' - ' + data.row.workCenterDesc + ' '
this.titleCon = '机台工作台' + ' - ' + data.row.itemDesc + ' '
+ data.row.resourceDesc + ' (' + this.operatorData.operatorName + ')'; + data.row.resourceDesc + ' (' + this.operatorData.operatorName + ')';
}) })
// //

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

@ -4,7 +4,7 @@
<el-form :inline="true" @submit.native.prevent label-position="top" label-width="100px" style="margin-top: -5px;"> <el-form :inline="true" @submit.native.prevent label-position="top" label-width="100px" style="margin-top: -5px;">
<el-row> <el-row>
<el-form-item :label="'操作员:'"> <el-form-item :label="'操作员:'">
<el-input ref="operatorId" @keyup.enter.native="saveOperatorData"
<el-input ref="operatorId" @keyup.enter.native="saveOperatorData" @blur="checkOperatorId"
v-model="operatorData.operatorId" v-model="operatorData.operatorId"
style="width: 110px"> style="width: 110px">
</el-input> </el-input>
@ -12,7 +12,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-form-item :label="'操作员姓名:'"> <el-form-item :label="'操作员姓名:'">
<el-input v-model="operatorData.operatorName" style="width: 110px"></el-input>
<el-input class="customer-color" v-model="operatorData.operatorName" readonly="readonly" style="width: 110px;"></el-input>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
@ -77,30 +77,65 @@ export default {
saveOperatorData() { saveOperatorData() {
getOperatorData(this.operatorData).then(({data}) => { getOperatorData(this.operatorData).then(({data}) => {
// //
if(!data.row){
//
if(data.code == 500){
this.operatorData.operatorName = '';
this.$message.error(data.msg);
return false;
}else if(!data.row){
this.$message.error('账号有误!'); this.$message.error('账号有误!');
this.operatorData.operatorName = '';
return false; return false;
}else{
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('操作员信息不可用!');
}
//
this.closeDialog();
//
this.$emit('initOperatorData', this.operatorData)
} }
let status = data.row.status;
//
if (status == 'N') {
this.operatorFlag = false;
} else {
this.operatorFlag = true;
}
//
this.operatorData.status = status;
if (!this.operatorFlag) {
this.$message.error('操作员信息不可用!');
this.operatorData.operatorName = '';
}
this.operatorData.operatorName = data.row.operatorName;
//
this.closeDialog();
//
this.$emit('initOperatorData', this.operatorData);
});
},
})
/*检查操作员的信息*/
checkOperatorId(){
getOperatorData(this.operatorData).then(({data}) => {
//
if(data.code == 500){
this.$message.error(data.msg);
this.operatorData.operatorName = '';
return false;
}else if(!data.row){
this.$message.error('账号有误!');
this.operatorData.operatorName = '';
return false;
}
let status = data.row.status;
//
if (status == 'N') {
this.operatorFlag = false;
} else {
this.operatorFlag = true;
}
//
this.operatorData.status = status;
if (!this.operatorFlag) {
this.$message.error('操作员信息不可用!');
this.operatorData.operatorName = '';
}
this.operatorData.operatorName = data.row.operatorName;
});
}, },
}, },
created() { created() {
@ -109,4 +144,8 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/*控制操作员的字体颜色*/
.customer-color /deep/ .el-input__inner{
color: red;
}
</style> </style>
Loading…
Cancel
Save