You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.1 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <!-- 展示员工切换的模块 -->
  3. <el-dialog :title="titleCon" v-bind="$attrs" v-on="$listeners" width="300px">
  4. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
  5. <el-form-item :label="'操作员:'">
  6. <el-input ref="operatorId" v-model="operatorData.operatorId" style="width: 110px"></el-input>
  7. </el-form-item>
  8. </el-form>
  9. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
  10. <el-form-item :label="'操作员姓名:'">
  11. <el-input v-model="operatorData.operatorName" style="width: 110px"></el-input>
  12. </el-form-item>
  13. </el-form>
  14. <el-form :inline="true" label-position="top" label-width="100px"
  15. style="margin-left: 180px; margin-top: -80px; width: 60px;">
  16. <el-form-item label="">
  17. <el-button type="primary">列表</el-button>
  18. </el-form-item>
  19. <el-form-item label="" style="margin-top: 10px; margin-bottom: 0px;">
  20. <el-button type="primary" @click="saveOperatorData()">保存</el-button>
  21. </el-form-item>
  22. <el-form-item label="" style="margin-top: 15px; margin-bottom: 5px;">
  23. <el-button type="primary" @click="closeDialog">关闭</el-button>
  24. </el-form-item>
  25. </el-form>
  26. </el-dialog>
  27. </template>
  28. <script>
  29. import {
  30. getOperatorData,
  31. } from '@/api/yieldReport/produce_order.js'
  32. export default {
  33. name: "com_switch_operator",
  34. data() {
  35. return {
  36. titleCon:'操作员切换',
  37. operatorFlag: false,
  38. operatorData: {
  39. site: this.$store.state.user.site,
  40. username: this.$store.state.user.name,
  41. operatorId: '',
  42. operatorName: '',
  43. status: ''
  44. },
  45. }
  46. },
  47. methods: {
  48. /*关闭modal*/
  49. closeDialog(){
  50. //调用不初始化用户的方法
  51. this.$emit('notInitOperatorData');
  52. //关闭组件
  53. this.$emit('update:visible', false);
  54. },
  55. //初始化的
  56. init() {
  57. //删除操作的信息
  58. this.operatorData.operatorName = '';
  59. this.operatorData.operatorId = '';
  60. //自动获取焦点
  61. this.$refs.operatorId.focus();
  62. //刷新当前派工单的信息
  63. //this.refreshPageData();
  64. },
  65. //查询操作员信息
  66. saveOperatorData() {
  67. getOperatorData(this.operatorData).then(({data}) => {
  68. //判断是否存在
  69. if(!data.row){
  70. this.$message.error('账号有误!');
  71. }
  72. let status = data.row.status;
  73. this.operatorData.operatorName = data.row.operatorName;
  74. //重置操作员信息状态
  75. this.operatorData.status = status;
  76. //判断是否验证通过
  77. if (status == 'N') {
  78. this.operatorFlag = false;
  79. } else {
  80. this.operatorFlag = true;
  81. }
  82. if (!this.operatorFlag) {
  83. this.$message.error('操作员信息不可用!');
  84. }
  85. })
  86. //检查是否通过 不通过报错 通过继续
  87. .then(() => {
  88. this.visibleFlag = false;
  89. this.$emit('initOperatorData', this.operatorData)
  90. });
  91. },
  92. },
  93. created() {
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. </style>