myList.jsx 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. import React, { Component } from "react";
  2. import Taro from "@tarojs/taro";
  3. import { View, Image, Button } from "@tarojs/components";
  4. import Skeleton from "taro-skeleton";
  5. import { getClockState } from "../../utils/tools";
  6. import ListBottomStart from "../../components/common/listBottomStart";
  7. import RevokeWhite from "../../image/revokeWhite.png";
  8. import "./index.less";
  9. class MyList extends Component {
  10. constructor(props) {
  11. super(props);
  12. }
  13. render() {
  14. const { title, sonType } = this.props
  15. return (
  16. <View className="indexPage">
  17. <View className="list">
  18. {
  19. this.props.list.length === 0 && this.props.listState === "LOADING" &&
  20. this.props.typelist?.map((v) => (
  21. <Skeleton key={v} title row={3} avatarShape="square" loading />
  22. ))
  23. }
  24. {this.props.list.length > 0 && this.props.list?.map((v, k) => (
  25. <View
  26. key={k}
  27. className="item"
  28. onClick={() => {
  29. Taro.navigateTo({
  30. url: "/pages/egressDetails/index?id=" + v.id + "&index=" + k + "&status=" + title + "&sonType=" + sonType,
  31. });
  32. }}
  33. >
  34. {v.publicAgain == 1 && <View className="itype">再次</View>}
  35. {v.status === 3 &&
  36. <View className="revoke">
  37. <Image src={RevokeWhite} className="revokeImg" />
  38. </View>}
  39. <View className="infor">
  40. <View className="title">
  41. <View className="aname">
  42. {v.type === 3 ? v.mainName : v.aname}提交的公出申请
  43. {v.updateStatus == 1 && <View className="aIcon">改</View>}
  44. </View>
  45. <View className="createTimes">{v.createTimes}</View>
  46. </View>
  47. <View className="userName">
  48. <View className="uNtext">
  49. 公出企业:{v.userNames}
  50. </View>
  51. {
  52. title == "我的公出" &&
  53. (v.type === 0 || v.type === 1 || v.type === 2) &&
  54. v.status !== 3 &&
  55. <View
  56. className="reject"
  57. onClick={e => {
  58. e.stopPropagation();
  59. this.props.again(v)
  60. }}
  61. >
  62. 再次公出
  63. </View>
  64. }
  65. {
  66. (title == "我的公出" || title == "我的协单" || title === "协单审核") &&
  67. <View
  68. className="select"
  69. onClick={e => {
  70. e.stopPropagation();
  71. this.props.opinion(title, v)
  72. }}
  73. >
  74. 协单意见
  75. </View>
  76. }
  77. {
  78. (title == "我的协单" || title === "协单审核") &&
  79. v.status === 2 &&
  80. v.type === 3 &&
  81. <View
  82. className="reject"
  83. onClick={e => {
  84. e.stopPropagation();
  85. this.props.opens(v.id)
  86. }}
  87. >
  88. 驳回协单
  89. </View>
  90. }
  91. {/* {
  92. title === "协单审核" &&
  93. <View
  94. className="select"
  95. onClick={e => {
  96. e.stopPropagation();
  97. this.props.onSelect(v)
  98. }}
  99. >
  100. 查看协单意见
  101. </View>
  102. } */}
  103. </View>
  104. <View className="userName">
  105. <View className="uNtext">
  106. 公出地点:{v.districtName}
  107. </View>
  108. </View>
  109. <View className="releaseStarts">
  110. 开始时间:{v.releaseStarts}
  111. {/* this.props.type === 0 && */}
  112. {this.props.type === 0 && v.status === 2 && (
  113. v.type === 3
  114. ? v.publicAssistAdvice > 0
  115. ? <View
  116. className="punchClock"
  117. onClick={(e) => {
  118. e.stopPropagation();
  119. Taro.eventCenter.trigger("GoPunchIn", v);
  120. Taro.switchTab({
  121. url: "/pages/punchClock/index",
  122. });
  123. }}
  124. >
  125. {(v.clockIn === 1 || v.clockIn === 2) ? "更新打卡" : "去打卡"}
  126. </View>
  127. : null
  128. : <View
  129. className="punchClock"
  130. onClick={(e) => {
  131. e.stopPropagation();
  132. Taro.eventCenter.trigger("GoPunchIn", v);
  133. Taro.switchTab({
  134. url: "/pages/punchClock/index",
  135. });
  136. }}
  137. >
  138. {(v.clockIn === 1 || v.clockIn === 2) ? "更新打卡" : "去打卡"}
  139. </View>
  140. )}
  141. {/* {(v.type === 3 && v.publicAssistAdvice === 0) ? null : (v.status === 2 &&)(<View
  142. className="punchClock"
  143. onClick={(e) => {
  144. e.stopPropagation();
  145. Taro.eventCenter.trigger("GoPunchIn", v);
  146. Taro.switchTab({
  147. url: "/pages/punchClock/index",
  148. });
  149. }}
  150. >
  151. {(v.clockIn === 1 || v.clockIn === 2) ? "更新打卡" : "去打卡"}
  152. </View>)} */}
  153. </View>
  154. <View className="releaseEnds">
  155. 结束时间:{v.releaseEnds}
  156. </View>
  157. {
  158. v.assistAidName != null && v.assistAidName != "" &&
  159. <View className="coOder">
  160. 技术协单:{v.assistAidName.replace(/,/g, " ")}
  161. </View>
  162. }
  163. {
  164. v.assistantName != null && v.assistantName != "" &&
  165. <View className="coOder">
  166. 协单助手:{v.assistantName.replace(/,/g, " ")}
  167. </View>
  168. }
  169. <View className="examine">{v.adminExamine}</View>
  170. <View className="bottomContent">
  171. <View className="clockIn"
  172. style={{ color: ['red', "#6eb173", '#dbc037'][v.clockIn] }}
  173. >{['未打卡', '已打卡', '异常打卡'][v.clockIn]}</View>
  174. <View
  175. className="status"
  176. style={{ color: getClockState(v.status).color, }}
  177. >
  178. {(v.status === 0 || v.status === 4) && v.rejectName}{getClockState(v.status).title}
  179. </View>
  180. </View>
  181. </View>
  182. </View>
  183. ))}
  184. <ListBottomStart
  185. state={this.props.listState}
  186. reload={() => {
  187. this.props.onRefresh;
  188. }}
  189. />
  190. </View>
  191. </View >
  192. );
  193. }
  194. }
  195. export default MyList;