itdmTestPlanList1.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. {{ src/App.vue }}
  2. <template>
  3. <div class="container" style="height:650px;">
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="getHjlist">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="委托单位">
  9. <a-select
  10. v-model="tasks.queryParamNo.weituoClient"
  11. placeholder="请选择委托单位"
  12. show-search
  13. allowClear
  14. :options="weituoClientOptions"
  15. @change="getWeituoClientOptions">
  16. </a-select>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  20. <a-form-item label="委托编号">
  21. <!-- <a-input placeholder="请输入委托编号" v-model="tasks.queryParam.weituoNo"></a-input> -->
  22. <a-select
  23. v-model="tasks.queryParam.weituoNo"
  24. placeholder="请选择委托编号"
  25. show-search
  26. allowClear
  27. :options="weituoNoOptions">
  28. </a-select>
  29. </a-form-item>
  30. </a-col>
  31. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  32. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  33. <a-button type="primary" @click="getHjlist" icon="search">查询</a-button>
  34. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">提交</a-button>
  35. </span>
  36. </a-col>
  37. </a-row>
  38. </a-form>
  39. </div>
  40. <gantt ref="gantt" class="left-container" :tasks="tasks" style="height:600px;"></gantt>
  41. </div>
  42. </template>
  43. <script>
  44. import Gantt from '../../../components/Gantt.vue';
  45. import {getWeituoClientList, getWeituoInfoListByClient } from '@/api/api'
  46. import { getAction } from '@api/manage'
  47. import { gantt } from 'dhtmlx-gantt'
  48. export default {
  49. name: 'app',
  50. components: {Gantt},
  51. data () {
  52. return {
  53. tasks: {
  54. // data: [
  55. // ],
  56. // collections: {
  57. // staff:[],
  58. // manager:[],
  59. // chuanganqi:[],
  60. // },
  61. queryParam:{
  62. weituoNo: undefined
  63. },
  64. queryParamNo:{
  65. weituoClient: undefined
  66. },
  67. },
  68. // 委托单位列表
  69. weituoClientOptions : [],
  70. // 委托编号列表
  71. weituoNoOptions:[],
  72. }
  73. },
  74. created() {
  75. this.getClientList();
  76. // this.getHjlist();
  77. this.$nextTick(() => { this.getHjlist() })
  78. },
  79. methods: {
  80. // 获取委托单位下拉列表
  81. getClientList(){
  82. getWeituoClientList().then((res) =>{
  83. console.log(res)
  84. this.weituoClientOptions = res.result.map( res => {
  85. return{
  86. value: res,
  87. label: res
  88. }
  89. })
  90. })
  91. },
  92. // 监听委托单位获取
  93. getWeituoClientOptions(value){
  94. console.log(value);
  95. console.log(this.tasks.queryParamNo)
  96. this.weituoNoOptions = []
  97. this.tasks.queryParam.weituoNo = undefined
  98. getWeituoInfoListByClient(this.tasks.queryParamNo).then((res) =>{
  99. this.weituoNoOptions = res.result.map( res => {
  100. return{
  101. value: res.weituoNo, //传的值
  102. label: res.weituoNo, //展示
  103. }
  104. })
  105. })
  106. },
  107. getHjlist(){
  108. console.log(1111)
  109. let that = this
  110. var queryParam = that.tasks.queryParam
  111. queryParam.weituoClient = that.tasks.queryParamNo.weituoClient
  112. this.$refs.gantt.getinit( queryParam )
  113. },
  114. searchReset(){
  115. this.$refs.gantt.searchReset()
  116. }
  117. }
  118. }
  119. </script>
  120. <style>
  121. html, body {
  122. height: 100%;
  123. margin: 0;
  124. padding: 0;
  125. /* overflow:hidden; */
  126. }
  127. .container {
  128. height: 100%;
  129. width: 100%;
  130. }
  131. .left-container {
  132. overflow: hidden;
  133. position: relative;
  134. height: 100%;
  135. }
  136. </style>