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.

102 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
  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 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.refreshPageData();
  62. },
  63. //查询操作员信息
  64. saveOperatorData() {
  65. getOperatorData(this.operatorData).then(({data}) => {
  66. //判断是否存在
  67. if(!data.row){
  68. this.$message.error('账号有误!');
  69. }
  70. let status = data.row.status;
  71. this.operatorData.operatorName = data.row.operatorName;
  72. //重置操作员信息状态
  73. this.operatorData.status = status;
  74. //判断是否验证通过
  75. if (status == 'N') {
  76. this.operatorFlag = false;
  77. } else {
  78. this.operatorFlag = true;
  79. }
  80. if (!this.operatorFlag) {
  81. this.$message.error('操作员信息不可用!');
  82. }
  83. })
  84. //检查是否通过 不通过报错 通过继续
  85. .then(() => {
  86. this.visibleFlag = false;
  87. this.$emit('initOperatorData', this.operatorData)
  88. });
  89. },
  90. },
  91. created() {
  92. }
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. </style>