matchingDlg.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="container-macthing">
  3. <mDialog :show.sync="matchingDlgShow" @beforeClose="closeDlg" :width="'40%'">
  4. <div class="content-macthing">
  5. <el-select style="width: 100%" v-model="matchingValue" filterable clearable :filter-method="remoteMethod" placeholder="请输入活动名称关键字">
  6. <el-option v-for="item in dataQueryList" :key="item.RoadshowTitle + item.ActivityTime" :label="item.value" :value="item.RoadshowTitle +'{|}'+ item.ActivityTime"> </el-option>
  7. </el-select>
  8. </div>
  9. <div slot="title" style="display: flex; align-items: center">
  10. <img :src="$icons.warntop" style="color: #fff; width: 16px; height: 16px; margin-right: 5px" />
  11. <span style="fontsize: 16px">手动匹配</span>
  12. </div>
  13. <div slot="footer" style="margin-top: 40px">
  14. <el-button type="primary" @click="confirm">确定</el-button>
  15. <el-button type="primary" @click="closeDlg">取消</el-button>
  16. </div>
  17. </mDialog>
  18. </div>
  19. </template>
  20. <script>
  21. import mDialog from "@/components/mDialog.vue";
  22. import { raiInterface } from "@/api/api.js";
  23. export default {
  24. name: "",
  25. components: {
  26. mDialog,
  27. },
  28. props: {
  29. matchingDlgShow: {
  30. type: Boolean,
  31. default: false,
  32. },
  33. matchingId:{
  34. type: Number,
  35. }
  36. },
  37. data() {
  38. return {
  39. dataQueryList: [],
  40. matchingValue: "",
  41. };
  42. },
  43. computed: {},
  44. watch: {},
  45. created() {},
  46. mounted() {},
  47. methods: {
  48. closeDlg() {
  49. this.matchingValue=''
  50. this.dataQueryList = [];
  51. this.$parent.matchingDlgShow = false;
  52. },
  53. //作者的搜索
  54. async remoteMethod(query) {
  55. if (query !== "") {
  56. this.dataQueryList = [];
  57. const res = await raiInterface.activityMeetMatchingList({ KeyWord: query, ActivityId: this.matchingId, });
  58. if (res.Ret === 200) {
  59. let obj = {};
  60. res.Data.List &&
  61. res.Data.List.forEach((item) => {
  62. obj = {
  63. ...item,
  64. value: item.RoadshowTitle + `【` + item.ActivityTime + "】",
  65. };
  66. this.dataQueryList.push(obj);
  67. });
  68. }
  69. } else {
  70. this.dataQueryList = [];
  71. }
  72. },
  73. async confirm() {
  74. if(!this.matchingValue) return this.$message.error("请输入活动名称关键字")
  75. const res = await raiInterface.activityMeetMatchingByHand({
  76. ActivityId: this.matchingId,
  77. KeyWord: this.matchingValue,
  78. });
  79. if(res.Ret === 200){
  80. this.dataQueryList = [];
  81. this.matchingValue=''
  82. this.$message.success('操作成功!')
  83. this.$emit('update:matchingDlgShow',false)
  84. this.$parent.getsDataList()
  85. }
  86. },
  87. },
  88. };
  89. </script>
  90. <style scoped lang="scss">
  91. .content-macthing {
  92. margin: 30px;
  93. }
  94. </style>