markingIssues.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div>
  3. <normal-dialog
  4. v-if="modalShow"
  5. ref="normalDialog"
  6. :show-dialog="false"
  7. is-succes
  8. :title="titleName"
  9. width="400px"
  10. @succes="updateModule"
  11. >
  12. <el-form label-width="100px" style="padding-right: 20px">
  13. <el-form-item label="问题">
  14. <el-input
  15. v-model="normalAreaName"
  16. autocomplete="off"
  17. size="mini"
  18. maxlength="100"
  19. show-word-limit
  20. placeholder="请输入问题"
  21. />
  22. </el-form-item>
  23. <el-form-item label="责任团队">
  24. <Cascader v-model="cascaderValue" />
  25. <!-- <el-cascader-->
  26. <!-- v-model="cascaderValue"-->
  27. <!-- style="width: 100%"-->
  28. <!-- :options="selectEnum"-->
  29. <!-- size="mini"-->
  30. <!-- collapse-tags-->
  31. <!-- :props="{ multiple: true }"-->
  32. <!-- clearable-->
  33. <!-- />-->
  34. </el-form-item>
  35. <el-form-item label="责任人">
  36. <searchPeople
  37. style="width: 100%"
  38. :value.sync="multiplePeople"
  39. :multiple="true"
  40. />
  41. </el-form-item>
  42. </el-form>
  43. </normal-dialog>
  44. </div>
  45. </template>
  46. <script>
  47. import { uuid10 } from '@/utils'
  48. import Cascader from './Cascader'
  49. import normalDialog from '@/components/dialog/normalDialog'
  50. import Clickoutside from 'element-ui/src/utils/clickoutside'
  51. import searchPeople from '@/components/select/searchPeople'
  52. // import _ from 'lodash' // 人员select
  53. export default {
  54. name: 'CreatedItem',
  55. components: {
  56. normalDialog,
  57. searchPeople,
  58. Cascader
  59. },
  60. directives: { Clickoutside },
  61. data() {
  62. return {
  63. modalShow: false,
  64. titleName: '标记为重点问题',
  65. normalAreaName: '',
  66. menuData: '',
  67. callBack: null,
  68. columns: null,
  69. cascaderValue: null,
  70. multiplePeople: null
  71. }
  72. },
  73. computed: {
  74. tabPageData() {
  75. return this.$store.state.monthlyReportEdit.tabPageData
  76. },
  77. selectEnum() {
  78. return this.$store.state.monthlyReportEdit.selectEnum
  79. }
  80. },
  81. methods: {
  82. uuid10,
  83. openModal({ title, scope, columns, normalAreaName }) {
  84. console.log({ title, scope, columns, normalAreaName })
  85. this.titleName = title
  86. if (scope) this.menuData = scope.row
  87. if (columns) this.columns = columns
  88. this.$refs.normalDialog.visible = true
  89. this.modalShow = true
  90. if (normalAreaName) this.normalAreaName = normalAreaName
  91. this.setDefaultValues()
  92. },
  93. // 设置默认值
  94. setDefaultValues() {
  95. this.columns &&
  96. this.columns.forEach((elm) => {
  97. if (elm.name === '问题') {
  98. this.normalAreaName = this.menuData[elm.headerKey]
  99. }
  100. if (elm.name === '归属团队') {
  101. this.cascaderValue = this.menuData[elm.headerKey]
  102. }
  103. if (elm.name === '负责人') {
  104. this.multiplePeople = [this.menuData[elm.headerKey]]
  105. }
  106. })
  107. },
  108. updateModule() {
  109. this.$store.commit('monthlyReportEdit/MARK_ISSUES', {
  110. cascaderValue: this.cascaderValue,
  111. normalAreaName: this.normalAreaName,
  112. multiplePeople: this.multiplePeople
  113. })
  114. this.modalShow = false
  115. this.$refs.normalDialog.visible = false
  116. }
  117. }
  118. }
  119. </script>
  120. <style scoped lang="less">
  121. /deep/ .el-form-item__label {
  122. text-align: left!important;
  123. }
  124. </style>