taskBoard.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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="666" 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 readonly v-model="searchTime" placeholder="请选择任务日期" inputAlign="center"
  28. suffixIcon="arrow-right"></u--input>
  29. <u-calendar :show="showCalendar" :minDate="minDate" v-model="searchTime" mode="single"
  30. closeOnClickOverlay @confirm="changeTime" @close="closeTime"></u-calendar>
  31. </view>
  32. </u-modal>
  33. <component v-else :is="loadComponent" :taskId="taskId" @getBackBoard="getBackBoard"></component>
  34. </view>
  35. </template>
  36. <script>
  37. import api from "@/api/api";
  38. import taskBoardAddress from './taskBoardAddress.vue'
  39. import moment from 'moment'
  40. export default {
  41. name: 'taskBoard',
  42. components: {
  43. taskBoardAddress
  44. },
  45. props: {},
  46. data() {
  47. return {
  48. showTime: false,//是否显示填报日期弹窗
  49. titleTime: '',
  50. searchTime: '',//检测时间
  51. showCalendar: false,//控制日期选型下拉开启
  52. // timeRan: Number(new Date()),
  53. minDate: moment().subtract(7, 'days').format('YYYY-MM-DD'),
  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 = e[0]
  79. uni.setStorageSync("searchTime", that.searchTime);
  80. that.showCalendar = false
  81. },
  82. closeTime() {
  83. this.searchTime = ''
  84. this.showCalendar = false
  85. },
  86. //点击返回上一级
  87. getBackBoard() {
  88. let that = this
  89. that.isShow = true
  90. that.loadComponent = ''
  91. },
  92. //点击跳转到识别看板
  93. getBorad(item) {
  94. let that = this
  95. that.taskId = item.id
  96. that.showTime = true
  97. },
  98. //选择检测时间-确定
  99. confirmTime() {
  100. let that = this
  101. if (that.searchTime) {
  102. that.isShow = false
  103. that.showTime = false
  104. that.loadComponent = 'taskBoardAddress'
  105. }
  106. },
  107. //选择检测时间-取消
  108. cancelTime() {
  109. let that = this
  110. that.isShow = true
  111. that.showTime = false
  112. },
  113. //获取任务管理列表数据
  114. getTimeList() {
  115. let that = this
  116. new Promise((resolve, reject) => {
  117. api
  118. .teamList({ pageNo: 1, pageSize: 100, teamCode: that.teamCode })
  119. .then((response) => {
  120. if (response.data.code == 200) {
  121. that.indexList = response.data.result.records
  122. } else {
  123. reject(response);
  124. }
  125. })
  126. .catch((error) => {
  127. console.log("catch===>response", response);
  128. reject(error);
  129. });
  130. });
  131. }
  132. }
  133. };
  134. </script>
  135. <style lang="scss" scoped>
  136. .taskBoard {
  137. position: relative;
  138. width: 100%;
  139. height: 100%;
  140. background-color: #fff;
  141. }
  142. .dialog-item {
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. .dialog-label {
  147. width: 70px;
  148. text-align: center;
  149. }
  150. }
  151. ::v-deep .u-input {
  152. display: flex;
  153. flex-direction: row;
  154. align-items: center;
  155. justify-content: space-between;
  156. padding: 3px 9px !important;
  157. width: 180px;
  158. }
  159. ::v-deep .u-popup {
  160. flex: 0
  161. }
  162. ::v-deep .u-slot-title {
  163. display: flex;
  164. }
  165. </style>