index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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" >
  24. <template v-if="type==='myLaunch'">
  25. <u-cell-item title="申请时间" @click="calendarShow=true" :value="applyTimeName"></u-cell-item>
  26. <u-cell-item title="所属流程" @click="processInstanceShow=true" :value="processDefinitionName"></u-cell-item>
  27. <u-cell-item title="流程状态" @click="processStatusShow=true" :value="processStatusName"></u-cell-item>
  28. </template>
  29. <u-cell-item v-if="type!='manager'" title="药剂类型" @click="medicineTypeShow=true" :value="medicineTypeName"></u-cell-item>
  30. </u-cell-group>
  31. <u-calendar v-model="calendarShow" mode="range" @change="calendarChange"></u-calendar>
  32. <u-select v-model="processInstanceShow" :list="processInstancelist" @confirm="processInstanceConfirm"></u-select>
  33. <u-select v-model="processStatusShow" :list="processStatusList" @confirm="processStatusConfirm"></u-select>
  34. <u-select v-model="medicineTypeShow" :list="medicineTypeList" @confirm="medicineTypeConfirm"></u-select>
  35. <!-- <u-button type="primary" size="mini" style="width: 100%;margin: 2px;">重置</u-button> -->
  36. </view>
  37. <view class="approve-list">
  38. <todo-list :approve-list-height="approveListHeight" :medicineType="medicineType" :search-key-word="searchKeyWord" :type="type" v-if="type === 'todo'"/>
  39. <done-list :approve-list-height="approveListHeight" :medicineType="medicineType" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'done'"/>
  40. <cc-list :approve-list-height="approveListHeight" :medicineType="medicineType" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'cc'"/>
  41. <manager-list :approve-list-height="approveListHeight" :medicineType="medicineType" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'manager'"/>
  42. <launch-list :processStatus="processStatus" :medicineType="medicineType" :processDefinitionName="processDefinitionName" :applyTime="applyTime" :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else/>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import {dibootApi} from '@/utils/dibootApi'
  48. import variables from '@/styles/variables.scss'
  49. import doneList from './doneList'
  50. import launchList from './launchList'
  51. import todoList from './todoList'
  52. import ccList from './ccList'
  53. import managerList from './managerList'
  54. export default {
  55. components: {
  56. todoList,
  57. launchList,
  58. doneList,
  59. ccList,
  60. managerList,
  61. },
  62. data() {
  63. return {
  64. keyword: '',
  65. searchKeyWord: '',
  66. current: 0,
  67. variables,
  68. searchHeight: 0,
  69. approveContainerHeight: 0,
  70. calendarShow: false,
  71. processInstanceShow:false,
  72. processStatusShow:false,
  73. medicineTypeShow:false,
  74. applyTime:[],//申请时间
  75. applyTimeName:'',
  76. processDefinitionName:'',//流程实例
  77. processInstancelist:[],//流程列表
  78. processStatus:'',//流程状态
  79. processStatusName:'',//流程状态名称
  80. medicineType:'',//药剂类型
  81. medicineTypeName:'',//药剂类型
  82. // 流程状态:1.进行中、2.已完成、3.已撤销、4.不通过
  83. processStatusList:[
  84. { label: '全部', value: undefined },
  85. { label: '进行中', value: 1 },
  86. { label: '已完成', value: 2 },
  87. { label: '已撤销', value: 3 },
  88. { label: '不通过', value: 4 },
  89. ],
  90. medicineTypeList: [],//药剂类型列表
  91. };
  92. },
  93. created() {
  94. this.computedHeight()
  95. //获取列表
  96. dibootApi.get('/workflow/processDefinition/list', {
  97. latest:true,
  98. noPage: true
  99. }).then((result) => {
  100. this.processInstancelist=result.data.map(e=>{
  101. return {
  102. label:e.name,
  103. value:e.name
  104. }
  105. })
  106. this.processInstancelist.unshift({ label: '全部', value: undefined })
  107. })
  108. this.getdictlist()
  109. },
  110. computed: {
  111. approveListHeight() {
  112. return this.approveContainerHeight - this.searchHeight
  113. }
  114. },
  115. props: {
  116. type: {
  117. type: String,
  118. required: true
  119. }
  120. },
  121. methods: {
  122. getdictlist() {
  123. dibootApi.get(
  124. '/system/system/dict/data/type/medicine_type',
  125. { dictType: 'medicine_type' }
  126. ).then(res => {
  127. this.medicineTypeList = res.data.map((e) => {
  128. return {
  129. label: e.dictLabel,
  130. value: e.dictValue,
  131. }
  132. })
  133. this.medicineTypeList.unshift({ label: '全部', value: undefined })
  134. })
  135. },
  136. medicineTypeConfirm(e){
  137. console.log('e',e)
  138. this.medicineType=e[0].value
  139. this.medicineTypeName=e[0].label
  140. },
  141. processStatusConfirm(e){
  142. console.log('e',e)
  143. this.processStatus=e[0].value
  144. this.processStatusName=e[0].label
  145. },
  146. processInstanceConfirm(e){
  147. console.log('e',e)
  148. this.processDefinitionName=e[0].value
  149. },
  150. calendarChange(e){
  151. console.log(e);
  152. this.applyTime=[e.startDate,e.endDate]
  153. this.applyTimeName=e.startDate+'至'+e.endDate
  154. },
  155. handleChange(index) {
  156. this.current = index
  157. this.keyword = ''
  158. this.searchKeyWord = ''
  159. },
  160. async computedHeight() {
  161. await this.$nextTick()
  162. const query = uni.createSelectorQuery().in(this)
  163. query.select(".approve-container")
  164. .boundingClientRect(data => {
  165. this.approveContainerHeight = data.height
  166. }).exec()
  167. query.select(".approve-search")
  168. .boundingClientRect(data => {
  169. this.searchHeight = data.height
  170. }).exec()
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss">
  176. .approve-container {
  177. height: 100%;
  178. display: flex;
  179. flex-direction: column;
  180. // background-color: #fff;
  181. // padding: 10rpx;
  182. .approve-search{
  183. background-color: #fff;
  184. padding: 0 10rpx;
  185. }
  186. }
  187. ::v-deep {
  188. .u-content {
  189. background-color: #F2F2F2 !important;
  190. }
  191. }
  192. .approve-search-options{
  193. ::v-deep {
  194. .u-cell{
  195. padding: 6px 16px;
  196. }
  197. }
  198. }
  199. </style>