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.

93 lines
2.9 KiB

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