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.

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