task.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <view class="content">
  3. <view class="" v-if="tabListShow == true">
  4. <view class="" v-for="(obj, index) in tabList" :key="index">
  5. <view class="title">
  6. <text>任务编号:</text>
  7. <text
  8. :style="
  9. obj.state == '取消' ? 'color: #ff0000;' : 'color: #00ff08;'
  10. ">
  11. {{ obj.taskNo }}
  12. </text>
  13. </view>
  14. <view class="">
  15. <view class="content_boby">
  16. <view class="content_boby_view">
  17. <text>起始库区:</text>
  18. <text :class="obj.state == '取消' ? 'showFalw' : 'showTres'">
  19. {{ obj.areaFrom }}
  20. </text>
  21. </view>
  22. <view class="content_boby_view">
  23. <text>起始库位:</text>
  24. <text :class="obj.state == '取消' ? 'showFalw' : 'showTres'">
  25. {{ obj.locationFrom }}
  26. </text>
  27. </view>
  28. </view>
  29. <view class="content_boby">
  30. <view class="content_boby_view">
  31. <text>目标库区:</text>
  32. <text :class="obj.state == '取消' ? 'showFalw' : 'showTres'">
  33. {{ obj.areaTo }}
  34. </text>
  35. </view>
  36. <view class="content_boby_view">
  37. <text>目标库位:</text>
  38. <text :class="obj.state == '取消' ? 'showFalw' : 'showTres'">
  39. {{ obj.locationTo }}
  40. </text>
  41. </view>
  42. </view>
  43. <view class="content_boby">
  44. <view class="content_boby_view">
  45. <text>状态:</text>
  46. <text :class="obj.state == '取消' ? 'showFalw' : 'showTres'">
  47. {{ obj.state }}
  48. </text>
  49. </view>
  50. <view class="content_boby_view">
  51. <text>类型:</text>
  52. <text
  53. :class="obj.state == '取消' ? 'showFalw' : 'showTres'"
  54. v-if="obj.taskType == 'FW'">
  55. 转发任务
  56. </text>
  57. </view>
  58. </view>
  59. <view class="content_boby">
  60. <view class="content_boby_view">
  61. <text>时间:</text>
  62. <text :class="obj.state == '取消' ? 'showFalw' : 'showTres'">
  63. {{ obj.createDate }}
  64. </text>
  65. </view>
  66. <view class="content_boby_view">
  67. <text>操作人:</text>
  68. <text
  69. :class="obj.state == '取消' ? 'showFalw' : 'showTres'"
  70. v-if="obj.createUser == '' && obj.createUser == null">
  71. </text>
  72. <text
  73. :class="obj.state == '取消' ? 'showFalw' : 'showTres'"
  74. v-else>
  75. {{ obj.createUser }}
  76. </text>
  77. </view>
  78. </view>
  79. <view class="content_boby">
  80. <view class="content_boby_view">
  81. <text>备注:</text>
  82. <text>{{ obj.remark }}</text>
  83. </view>
  84. </view>
  85. <view class="hr"></view>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="text" v-else>
  90. <text>暂无数据</text>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. components: {},
  97. data() {
  98. return {
  99. obj: {},
  100. tabListShow: true,
  101. stateType: [
  102. {
  103. name: "开始",
  104. id: 1,
  105. },
  106. {
  107. name: "完成",
  108. id: 2,
  109. },
  110. {
  111. name: "开始取货",
  112. id: 3,
  113. },
  114. {
  115. name: "取货完成",
  116. id: 4,
  117. },
  118. {
  119. name: "开始卸货",
  120. id: 5,
  121. },
  122. {
  123. name: "卸货完成",
  124. id: 6,
  125. },
  126. {
  127. name: "取消",
  128. id: 7,
  129. },
  130. {
  131. name: "异常",
  132. id: 8,
  133. },
  134. {
  135. name: "待下发",
  136. id: 9,
  137. },
  138. {
  139. name: "已下发",
  140. id: 10,
  141. },
  142. {
  143. name: "取消并归于起点",
  144. id: 11,
  145. },
  146. {
  147. name: "取消并归于终点",
  148. id: 12,
  149. },
  150. {
  151. name: "生成",
  152. id: 13,
  153. },
  154. {
  155. name: "卸货待确认",
  156. id: 14,
  157. },
  158. ],
  159. page: 1,
  160. tabList: [],
  161. host: "",
  162. };
  163. },
  164. onLoad(option) {
  165. let _this = this;
  166. uni.getStorage({
  167. key: "hostappst",
  168. success(res) {
  169. console.log("获取成功", res.data);
  170. _this.host = res.data;
  171. },
  172. });
  173. this.getData();
  174. },
  175. onShow() {},
  176. created() {},
  177. mounted() {},
  178. onReachBottom() {
  179. this.page++;
  180. this.getData("addList");
  181. },
  182. methods: {
  183. getData(type) {
  184. let that = this;
  185. let data = {
  186. pageNum: this.page,
  187. pageSize: 10,
  188. };
  189. uni.getStorage({
  190. key: "GetPhone_Token",
  191. success: function (res) {
  192. uni.request({
  193. url: `http://${that.host}` + "/ams/wcsTask/selectBucketWcsTaskList",
  194. header: {
  195. Authorization: res.data,
  196. "content-type": "application/x-www-form-urlencoded",
  197. },
  198. data: data,
  199. method: "GET",
  200. success(respenon) {
  201. console.log("chaoShiPanDuan", respenon);
  202. if (respenon.data.code == 200) {
  203. respenon.data.rows.forEach((item, index) => {
  204. that.stateType.forEach((items, indexs) => {
  205. if (item.state == items.id) {
  206. item.state = items.name;
  207. }
  208. });
  209. });
  210. if (type == "addList") {
  211. that.tabList = [...that.tabList, ...respenon.data.rows];
  212. } else {
  213. that.tabList = respenon.data.rows;
  214. if (that.tabList.length > 0) {
  215. that.tabListShow = true;
  216. } else {
  217. that.tabListShow = false;
  218. }
  219. }
  220. } else if (respenon.data.code == 401) {
  221. uni.reLaunch({
  222. url: "/pages/index/login",
  223. });
  224. } else {
  225. uni.showToast({
  226. title: respenon.data.msg,
  227. icon: "none",
  228. });
  229. }
  230. },
  231. });
  232. },
  233. });
  234. },
  235. },
  236. };
  237. </script>
  238. <style scoped lang="scss">
  239. .content {
  240. color: #787878;
  241. font-size: 14px;
  242. font-weight: 400;
  243. .title {
  244. height: 44px;
  245. padding: 12px 15px;
  246. }
  247. .content_boby {
  248. padding: 0 15px;
  249. display: flex;
  250. justify-content: space-between;
  251. margin-bottom: 10px;
  252. .showFalw {
  253. color: red;
  254. }
  255. .showTres {
  256. color: #00ff08;
  257. }
  258. }
  259. .hr {
  260. width: 100%;
  261. height: 1px;
  262. background: #cfcfcf;
  263. }
  264. .text {
  265. text-align: center;
  266. height: 100%;
  267. margin: 32vw;
  268. font-size: 20px;
  269. }
  270. }
  271. </style>