index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. noPage: true
  90. }).then((result) => {
  91. this.processInstancelist=result.data.map(e=>{
  92. return {
  93. label:e.name,
  94. value:e.name
  95. }
  96. })
  97. this.processInstancelist.unshift({ label: '全部', value: undefined })
  98. })
  99. },
  100. computed: {
  101. approveListHeight() {
  102. return this.approveContainerHeight - this.searchHeight
  103. }
  104. },
  105. props: {
  106. type: {
  107. type: String,
  108. required: true
  109. }
  110. },
  111. methods: {
  112. processStatusConfirm(e){
  113. console.log('e',e)
  114. this.processStatus=e[0].value
  115. this.processStatusName=e[0].label
  116. },
  117. processInstanceConfirm(e){
  118. console.log('e',e)
  119. this.processDefinitionName=e[0].value
  120. },
  121. calendarChange(e){
  122. console.log(e);
  123. this.applyTime=[e.startDate,e.endDate]
  124. this.applyTimeName=e.startDate+'至'+e.endDate
  125. },
  126. handleChange(index) {
  127. this.current = index
  128. this.keyword = ''
  129. this.searchKeyWord = ''
  130. },
  131. async computedHeight() {
  132. await this.$nextTick()
  133. const query = uni.createSelectorQuery().in(this)
  134. query.select(".approve-container")
  135. .boundingClientRect(data => {
  136. this.approveContainerHeight = data.height
  137. }).exec()
  138. query.select(".approve-search")
  139. .boundingClientRect(data => {
  140. this.searchHeight = data.height
  141. }).exec()
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss">
  147. .approve-container {
  148. height: 100%;
  149. display: flex;
  150. flex-direction: column;
  151. // background-color: #fff;
  152. // padding: 10rpx;
  153. .approve-search{
  154. background-color: #fff;
  155. padding: 0 10rpx;
  156. }
  157. }
  158. ::v-deep {
  159. .u-content {
  160. background-color: #F2F2F2 !important;
  161. }
  162. }
  163. .approve-search-options{
  164. ::v-deep {
  165. .u-cell{
  166. padding: 6px 16px;
  167. }
  168. }
  169. }
  170. </style>