index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="approve-container">
  3. <view class="approve-search">
  4. <u-search
  5. :placeholder="type==='myLaunch'?'单号模糊搜索':'请输入关键字搜索'"
  6. v-model="keyword"
  7. bg-color="#fff"
  8. margin="16rpx 24rpx"
  9. :input-style="{
  10. fontSize: variables.mainFontSize,
  11. padding: '0rpx 40rpx',
  12. }"
  13. :action-style="{fontSize: variables.mainFontSize}"
  14. :border-color="'#F2F2F2'"
  15. :bg-color="'#F2F2F2'"
  16. :height="74"
  17. @search="() => searchKeyWord = keyword"
  18. @custom="() => searchKeyWord = keyword"
  19. :show-action="false"
  20. input-align="center"
  21. />
  22. <!-- 添加条件 -->
  23. <u-cell-group class="approve-search-options" v-if="type==='myLaunch'">
  24. <u-cell-item title="申请时间" @click="calendarShow=true" :value="applyTimeName"></u-cell-item>
  25. <u-cell-item title="所属流程" @click="processInstanceShow=true" :value="processDefinitionName"></u-cell-item>
  26. <u-cell-item title="流程状态" @click="processStatusShow=true" :value="processStatusName"></u-cell-item>
  27. </u-cell-group>
  28. <u-calendar v-model="calendarShow" mode="range" @change="calendarChange"></u-calendar>
  29. <u-select v-model="processInstanceShow" :list="processInstancelist" @confirm="processInstanceConfirm"></u-select>
  30. <u-select v-model="processStatusShow" :list="processStatusList" @confirm="processStatusConfirm"></u-select>
  31. <!-- <u-button type="primary" size="mini" style="width: 100%;margin: 2px;">重置</u-button> -->
  32. </view>
  33. <view class="approve-list">
  34. <todo-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-if="type === 'todo'"/>
  35. <done-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'done'"/>
  36. <cc-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'cc'"/>
  37. <manager-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'manager'"/>
  38. <launch-list :processStatus="processStatus" :processDefinitionName="processDefinitionName" :applyTime="applyTime" :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else/>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import {dibootApi} from '@/utils/dibootApi'
  44. import variables from '@/styles/variables.scss'
  45. import doneList from './doneList'
  46. import launchList from './launchList'
  47. import todoList from './todoList'
  48. import ccList from './ccList'
  49. import managerList from './managerList'
  50. export default {
  51. components: {
  52. todoList,
  53. launchList,
  54. doneList,
  55. ccList,
  56. managerList,
  57. },
  58. data() {
  59. return {
  60. keyword: '',
  61. searchKeyWord: '',
  62. current: 0,
  63. variables,
  64. searchHeight: 0,
  65. approveContainerHeight: 0,
  66. calendarShow: false,
  67. processInstanceShow:false,
  68. processStatusShow:false,
  69. applyTime:[],//申请时间
  70. applyTimeName:'',
  71. processDefinitionName:'',//流程实例
  72. processInstancelist:[],//流程列表
  73. processStatus:'',//流程状态
  74. processStatusName:'',//流程状态名称
  75. // 流程状态:1.进行中、2.已完成、3.已撤销、4.不通过
  76. processStatusList:[
  77. { label: '全部', value: undefined },
  78. { label: '进行中', value: 1 },
  79. { label: '已完成', value: 2 },
  80. { label: '已撤销', value: 3 },
  81. { label: '不通过', value: 4 },
  82. ]
  83. };
  84. },
  85. created() {
  86. this.computedHeight()
  87. //获取列表
  88. dibootApi.get('/workflow/processDefinition/list', {
  89. latest:true,
  90. noPage: true
  91. }).then((result) => {
  92. this.processInstancelist=result.data.map(e=>{
  93. return {
  94. label:e.name,
  95. value:e.name
  96. }
  97. })
  98. this.processInstancelist.unshift({ label: '全部', value: undefined })
  99. })
  100. },
  101. computed: {
  102. approveListHeight() {
  103. return this.approveContainerHeight - this.searchHeight
  104. }
  105. },
  106. props: {
  107. type: {
  108. type: String,
  109. required: true
  110. }
  111. },
  112. methods: {
  113. processStatusConfirm(e){
  114. console.log('e',e)
  115. this.processStatus=e[0].value
  116. this.processStatusName=e[0].label
  117. },
  118. processInstanceConfirm(e){
  119. console.log('e',e)
  120. this.processDefinitionName=e[0].value
  121. },
  122. calendarChange(e){
  123. console.log(e);
  124. this.applyTime=[e.startDate,e.endDate]
  125. this.applyTimeName=e.startDate+'至'+e.endDate
  126. },
  127. handleChange(index) {
  128. this.current = index
  129. this.keyword = ''
  130. this.searchKeyWord = ''
  131. },
  132. async computedHeight() {
  133. await this.$nextTick()
  134. const query = uni.createSelectorQuery().in(this)
  135. query.select(".approve-container")
  136. .boundingClientRect(data => {
  137. this.approveContainerHeight = data.height
  138. }).exec()
  139. query.select(".approve-search")
  140. .boundingClientRect(data => {
  141. this.searchHeight = data.height
  142. }).exec()
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss">
  148. .approve-container {
  149. height: 100%;
  150. display: flex;
  151. flex-direction: column;
  152. // background-color: #fff;
  153. // padding: 10rpx;
  154. .approve-search{
  155. background-color: #fff;
  156. padding: 0 10rpx;
  157. }
  158. }
  159. ::v-deep {
  160. .u-content {
  161. background-color: #F2F2F2 !important;
  162. }
  163. }
  164. .approve-search-options{
  165. ::v-deep {
  166. .u-cell{
  167. padding: 6px 16px;
  168. }
  169. }
  170. }
  171. </style>