taskBoard.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="taskBoard">
  3. <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true" leftIcon=""
  4. @leftClick="handlerToggle"> </u-navbar>
  5. <u-list :height="708" v-if="isShow">
  6. <u-list-item v-for="(item, index) in indexList" :key="index">
  7. <u-cell icon="share" @click="getBorad(item)">
  8. <view slot="title" class="u-slot-title">
  9. <text class="u-cell-text">
  10. <text>{{ item.name }}</text>
  11. <text style="margin-left:10px">{{ item.checkPerson ? `(${item.checkPerson})` : '' }}</text>
  12. </text>
  13. </view>
  14. <view slot="value" class="u-slot-title">
  15. <u-tag :text="item.classType_dictText" plain size="mini"
  16. :type="item.classType_dictText == '早班' ? 'success' : item.classType_dictText == '中班' ? 'warning' : 'error'">
  17. </u-tag>
  18. </view>
  19. </u-cell>
  20. </u-list-item>
  21. </u-list>
  22. <!-- 填报日期弹窗 -->
  23. <u-modal v-if="isShow" showCancelButton showConfirmButton confirmText="确定" cancelText="取消" :show="showTime"
  24. :title="titleTime" @confirm="confirmTime" @cancel="cancelTime">
  25. <view class="dialog-item" @click="getChangeTime">
  26. <text class="dialog-label">任务日期:</text>
  27. <u--input v-model="searchTime" placeholder="请选择任务日期" inputAlign="center"
  28. suffixIcon="arrow-right"></u--input>
  29. <u-calendar :show="showCalendar" v-model="timeRan" mode="single" closeOnClickOverlay
  30. @confirm="changeTime" @cancel="showCalendar = false"
  31. ></u-calendar>
  32. </view>
  33. </u-modal>
  34. <component v-else :is="loadComponent" :taskId="taskId" @getBackBoard="getBackBoard"></component>
  35. </view>
  36. </template>
  37. <script>
  38. import api from "@/api/api";
  39. import taskBoardAddress from './taskBoardAddress.vue'
  40. import moment from 'moment'
  41. export default {
  42. name: 'taskBoard',
  43. components: {
  44. taskBoardAddress
  45. },
  46. props: {},
  47. data() {
  48. return {
  49. showTime: false,//是否显示填报日期弹窗
  50. titleTime: '',
  51. searchTime: '',//检测时间
  52. showCalendar: false,//控制日期选型下拉开启
  53. timeRan: Number(new Date()),
  54. isShow: true,
  55. loadComponent: '',
  56. taskId: '',
  57. indexList: [],
  58. gasTitle: '巡检任务',//标题
  59. backPic0: "url(/static/topnavbar0.png)",
  60. backPic: "url(../../static/topnavbar.png)",
  61. }
  62. },
  63. computed: {
  64. teamCode: function () {
  65. return uni.getStorageSync('login_user_info')['districtTeam']
  66. },
  67. },
  68. mounted() {
  69. this.getTimeList()
  70. },
  71. methods: {
  72. //点击弹出日期下拉选项
  73. getChangeTime() {
  74. this.showCalendar = true
  75. },
  76. changeTime(e) {
  77. let that = this
  78. that.searchTime = moment(e.value).format('YYYY-MM-DD')
  79. uni.setStorageSync("searchTime", that.searchTime);
  80. that.showCalendar=false
  81. },
  82. //点击返回上一级
  83. getBackBoard() {
  84. let that = this
  85. that.isShow = true
  86. that.loadComponent = ''
  87. },
  88. //点击跳转到识别看板
  89. getBorad(item) {
  90. let that = this
  91. that.taskId = item.id
  92. that.showTime = true
  93. },
  94. //选择检测时间-确定
  95. confirmTime() {
  96. let that = this
  97. if (that.searchTime) {
  98. that.isShow = false
  99. that.showTime=false
  100. that.loadComponent = 'taskBoardAddress'
  101. }
  102. },
  103. //选择检测时间-取消
  104. cancelTime() {
  105. let that=this
  106. that.isShow = true
  107. that.showTime=false
  108. },
  109. //获取任务管理列表数据
  110. getTimeList() {
  111. let that = this
  112. new Promise((resolve, reject) => {
  113. api
  114. .teamList({ pageNo: 1, pageSize: 100,teamCode:that.teamCode })
  115. .then((response) => {
  116. if (response.data.code == 200) {
  117. that.indexList = response.data.result.records
  118. } else {
  119. reject(response);
  120. }
  121. })
  122. .catch((error) => {
  123. console.log("catch===>response", response);
  124. reject(error);
  125. });
  126. });
  127. }
  128. }
  129. };
  130. </script>
  131. <style lang="scss" scoped>
  132. .taskBoard {
  133. position: relative;
  134. width: 100%;
  135. height: 100%;
  136. background-color: #fff;
  137. }
  138. .dialog-item {
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. .dialog-label {
  143. width: 70px;
  144. text-align: center;
  145. }
  146. }
  147. ::v-deep .u-input {
  148. display: flex;
  149. flex-direction: row;
  150. align-items: center;
  151. justify-content: space-between;
  152. padding: 3px 9px !important;
  153. width: 180px;
  154. }
  155. ::v-deep .u-popup {
  156. flex: 0
  157. }
  158. ::v-deep .u-slot-title {
  159. display: flex;
  160. }
  161. </style>