taskBoard.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="taskBoard">
  3. <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true" leftIcon=""
  4. > </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" :minDate="minDate" v-model="searchTime" mode="single" closeOnClickOverlay
  30. @confirm="changeTime" @close="closeTime"
  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. minDate:moment().subtract(7, 'days').format('YYYY-MM-DD'),
  55. isShow: true,
  56. loadComponent: '',
  57. taskId: '',
  58. indexList: [],
  59. gasTitle: '巡检任务',//标题
  60. backPic0: "url(/static/topnavbar0.png)",
  61. backPic: "url(../../static/topnavbar.png)",
  62. }
  63. },
  64. computed: {
  65. teamCode: function () {
  66. return uni.getStorageSync('login_user_info')['districtTeam']
  67. },
  68. },
  69. mounted() {
  70. this.getTimeList()
  71. },
  72. methods: {
  73. //点击弹出日期下拉选项
  74. getChangeTime() {
  75. this.showCalendar = true
  76. },
  77. changeTime(e) {
  78. let that = this
  79. that.searchTime =e[0]
  80. uni.setStorageSync("searchTime", that.searchTime);
  81. that.showCalendar=false
  82. },
  83. closeTime(){
  84. this.searchTime=''
  85. this.showCalendar=false
  86. },
  87. //点击返回上一级
  88. getBackBoard() {
  89. let that = this
  90. that.isShow = true
  91. that.loadComponent = ''
  92. },
  93. //点击跳转到识别看板
  94. getBorad(item) {
  95. let that = this
  96. that.taskId = item.id
  97. that.showTime = true
  98. },
  99. //选择检测时间-确定
  100. confirmTime() {
  101. let that = this
  102. if (that.searchTime) {
  103. that.isShow = false
  104. that.showTime=false
  105. that.loadComponent = 'taskBoardAddress'
  106. }
  107. },
  108. //选择检测时间-取消
  109. cancelTime() {
  110. let that=this
  111. that.isShow = true
  112. that.showTime=false
  113. },
  114. //获取任务管理列表数据
  115. getTimeList() {
  116. let that = this
  117. new Promise((resolve, reject) => {
  118. api
  119. .teamList({ pageNo: 1, pageSize: 100,teamCode:that.teamCode })
  120. .then((response) => {
  121. if (response.data.code == 200) {
  122. that.indexList = response.data.result.records
  123. } else {
  124. reject(response);
  125. }
  126. })
  127. .catch((error) => {
  128. console.log("catch===>response", response);
  129. reject(error);
  130. });
  131. });
  132. }
  133. }
  134. };
  135. </script>
  136. <style lang="scss" scoped>
  137. .taskBoard {
  138. position: relative;
  139. width: 100%;
  140. height: 100%;
  141. background-color: #fff;
  142. }
  143. .dialog-item {
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. .dialog-label {
  148. width: 70px;
  149. text-align: center;
  150. }
  151. }
  152. ::v-deep .u-input {
  153. display: flex;
  154. flex-direction: row;
  155. align-items: center;
  156. justify-content: space-between;
  157. padding: 3px 9px !important;
  158. width: 180px;
  159. }
  160. ::v-deep .u-popup {
  161. flex: 0
  162. }
  163. ::v-deep .u-slot-title {
  164. display: flex;
  165. }
  166. </style>