taskBoard.vue 5.6 KB

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