index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="生产工单"
  8. @clickLeft="back"
  9. @clickTitle="goDetail"
  10. >
  11. </uni-nav-bar>
  12. <view class="tab-title">
  13. <view class="search-box">
  14. <uni-easyinput
  15. prefixIcon="search"
  16. v-model="code"
  17. placeholder="请输入工单号"
  18. @iconClick="iconClick"
  19. @input="getFirstList()"
  20. >
  21. </uni-easyinput>
  22. </view>
  23. <view class="search-icon" @click="searchVisible = true">
  24. 筛选
  25. <image src="~@/static/filter.svg" mode=""></image>
  26. </view>
  27. </view>
  28. <view class="tab-title__placeholder"> </view>
  29. <card :list="tableList"></card>
  30. <!-- 搜索组件 -->
  31. <u-popup
  32. :show="searchVisible"
  33. mode="right"
  34. @close="searchVisible = false"
  35. @open="openSearch"
  36. >
  37. <view class="search-container">
  38. <view class="title">工单筛选</view>
  39. <uni-forms
  40. ref="customForm"
  41. :modelValue="popupInfo"
  42. label-position="top"
  43. >
  44. <!-- <uni-forms-item label="生产版本" name="createTime" label-width="200rpx">
  45. <view class="version-wrapper">
  46. <checkbox-group @change="checkboxChange" class="version-group">
  47. <label class="wrapper-label" v-for="item in items" :key="item.value"
  48. :style="item.checked?'background:#157a2c;color:#fff':''"
  49. >
  50. <view>
  51. <checkbox :value="item.value" :checked="item.checked" style="display: none;"/>
  52. </view>
  53. <view>{{item.name}}</view>
  54. </label>
  55. </checkbox-group>
  56. </view>
  57. </uni-forms-item> -->
  58. <uni-forms-item
  59. label="要求成型日期"
  60. name="dialNumber"
  61. label-width="500rpx"
  62. >
  63. <uni-datetime-picker
  64. type="date"
  65. v-model="popupInfo.startTime"
  66. @change="confirmStart"
  67. >
  68. <div class="picker-time">{{ showStart }}</div>
  69. </uni-datetime-picker>
  70. <uni-datetime-picker
  71. type="date"
  72. v-model="popupInfo.endTime"
  73. @change="confirmEnd"
  74. >
  75. <div class="picker-time">{{ showEnd }}</div>
  76. </uni-datetime-picker>
  77. </uni-forms-item>
  78. <uni-forms-item
  79. label="计划开始时间"
  80. name="warehouseId"
  81. label-width="500rpx"
  82. >
  83. <uni-datetime-picker
  84. type="date"
  85. v-model="popupInfo.startPlan"
  86. @change="confirmPlanStart"
  87. >
  88. <div class="picker-time">{{ planStart }}</div>
  89. </uni-datetime-picker>
  90. <uni-datetime-picker
  91. type="date"
  92. v-model="popupInfo.endPan"
  93. @change="confirmPlanEnd"
  94. >
  95. <div class="picker-time">{{ planEnd }}</div>
  96. </uni-datetime-picker>
  97. </uni-forms-item>
  98. </uni-forms>
  99. <view class="footer">
  100. <view class="btn reset" @click="handleReset"> 重置 </view>
  101. <view class="btn search" @click="handleSearch"> 搜索 </view>
  102. </view>
  103. </view>
  104. </u-popup>
  105. </view>
  106. </template>
  107. <script>
  108. import card from "./components/card.vue";
  109. let [page, size, isEnd] = [1, 10, false];
  110. import { getListByStatus } from "@/api/production/order.js";
  111. export default {
  112. components: {
  113. card,
  114. },
  115. data() {
  116. return {
  117. searchVisible: false,
  118. popupInfo: {
  119. createTimeStart: "",
  120. createTimeEnd: "",
  121. planStartTimeStart: "",
  122. planStartTimeEnd: "",
  123. }, //筛选数据
  124. showStart: "起始日期:",
  125. showEnd: "结束日期:",
  126. planStart: "起始日期:",
  127. planEnd: "结束日期:",
  128. tableList: [],
  129. code: "",
  130. };
  131. },
  132. onShow() {
  133. this.getFirstList();
  134. },
  135. //触底加载
  136. onReachBottom: function () {
  137. if (isEnd) {
  138. uni.showToast({
  139. title: "已经没有更多数据了!",
  140. icon: "none",
  141. duration: 1000, //提示持续时间
  142. });
  143. return;
  144. }
  145. // 显示加载图标
  146. uni.showLoading({
  147. title: "数据加载中",
  148. });
  149. this.getMoreLists();
  150. },
  151. methods: {
  152. confirmStart(e) {
  153. this.popupInfo.createTimeStart = e;
  154. this.showStart = "起始日期:" + e;
  155. },
  156. confirmEnd(e) {
  157. this.popupInfo.createTimeEnd = e;
  158. this.showEnd = "结束日期:" + e;
  159. },
  160. confirmPlanStart(e) {
  161. this.popupInfo.planStartTimeStart = e;
  162. this.planStart = "起始日期:" + e;
  163. },
  164. confirmPlanEnd(e) {
  165. this.popupInfo.planStartTimeEnd = e;
  166. this.planEnd = "结束日期:" + e;
  167. },
  168. checkboxChange: function (e) {
  169. var items = this.items,
  170. values = e.detail.value;
  171. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  172. const item = items[i];
  173. if (values.includes(item.value)) {
  174. this.$set(item, "checked", true);
  175. } else {
  176. this.$set(item, "checked", false);
  177. }
  178. }
  179. },
  180. getFirstList() {
  181. page = 1;
  182. this.searchVisible = false;
  183. isEnd = true;
  184. uni.showLoading({
  185. title: "数据加载中",
  186. });
  187. this.getList();
  188. },
  189. getMoreLists() {
  190. //获取更多数据
  191. page++;
  192. this.getList();
  193. },
  194. //获取列表信息
  195. getList() {
  196. uni.showLoading({
  197. title: "加载中",
  198. });
  199. let data = {
  200. pageNum: page,
  201. size,
  202. ...this.popupInfo,
  203. code: this.code,
  204. statusList: ["4", "5"],
  205. };
  206. if (data.range?.length) {
  207. data.createTimeStart = data.range[0];
  208. data.createTimeEnd = data.range[1];
  209. }
  210. delete data.range;
  211. getListByStatus(data)
  212. .then((res) => {
  213. if (page === 1) {
  214. this.tableList = res.data.list;
  215. } else {
  216. this.tableList.push(...res.data.list);
  217. }
  218. isEnd = this.tableList.length >= res.data.count;
  219. })
  220. .then(() => {
  221. uni.hideLoading();
  222. });
  223. },
  224. handleSearch() {
  225. this.getFirstList();
  226. },
  227. // 搜索弹窗
  228. openSearch() {
  229. // console.log('open');
  230. },
  231. handleReset() {
  232. this.popupInfo = {
  233. createTimeStart: "",
  234. createTimeEnd: "",
  235. planStartTimeStart: "",
  236. planStartTimeEnd: "",
  237. };
  238. this.tableList = [];
  239. this.getFirstList();
  240. },
  241. // 跳转详情
  242. goDetail() {
  243. uni.navigateTo({
  244. url: `/pages/production/execute/extrusion/detail`,
  245. });
  246. },
  247. },
  248. };
  249. </script>
  250. <style lang="scss" scoped>
  251. .mainBox {
  252. padding-bottom: 120rpx;
  253. }
  254. .search-container {
  255. width: 70vw;
  256. padding: 30rpx 36rpx;
  257. .footer {
  258. position: absolute;
  259. bottom: 0;
  260. left: 0;
  261. width: 100%;
  262. display: flex;
  263. box-shadow: 0 10rpx 30rpx 0 #000;
  264. .btn {
  265. width: 50%;
  266. height: 80rpx;
  267. border-radius: 0 !important;
  268. flex: 1;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. &.reset {
  273. color: $j-primary-border-green;
  274. }
  275. &.search {
  276. color: #fff;
  277. background-color: $j-primary-border-green;
  278. }
  279. }
  280. }
  281. .title {
  282. font-weight: bold;
  283. font-size: 30rpx;
  284. margin-bottom: 20rpx;
  285. }
  286. .status-wrapper {
  287. display: flex;
  288. align-items: center;
  289. justify-content: space-between;
  290. view {
  291. background-color: rgba(242, 242, 242, 1);
  292. height: 60rpx;
  293. border-radius: 30rpx;
  294. line-height: 60rpx;
  295. text-align: center;
  296. width: 160rpx;
  297. border: 1rpx solid rgba(242, 242, 242, 1);
  298. &.active {
  299. color: #157a2c;
  300. border-color: rgba(21, 122, 44, 1);
  301. }
  302. }
  303. }
  304. /deep/.uni-date {
  305. .uni-icons {
  306. display: none;
  307. }
  308. .uni-date-x {
  309. padding: 0;
  310. view {
  311. margin: 0 20rpx;
  312. }
  313. }
  314. }
  315. /deep/.uni-date__x-input,
  316. /deep/.uni-easyinput__content-input {
  317. height: 60rpx;
  318. border-radius: 30rpx;
  319. overflow: hidden;
  320. background-color: rgba(242, 242, 242, 1);
  321. }
  322. .version-group {
  323. display: flex;
  324. align-items: center;
  325. justify-content: flex-start;
  326. flex-wrap: wrap;
  327. }
  328. .wrapper-label {
  329. height: 50rpx;
  330. padding: 0 20rpx;
  331. border: 1rpx solid #ccc;
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. font-size: 24rpx;
  336. margin: 0 20rpx 20rpx 0;
  337. }
  338. .picker-time {
  339. width: 100%;
  340. height: 60rpx;
  341. line-height: 60rpx;
  342. border: 1rpx solid #ccc;
  343. margin-bottom: 20rpx;
  344. text-indent: 10rpx;
  345. border-radius: 4rpx;
  346. }
  347. }
  348. .tab-title {
  349. position: fixed;
  350. z-index: 99;
  351. width: 100%;
  352. display: flex;
  353. justify-content: space-between;
  354. align-items: center;
  355. height: $tab-height;
  356. line-height: $tab-height;
  357. background-color: #ffffff;
  358. border-bottom: 1px solid #f2f2f2;
  359. box-sizing: border-box;
  360. height: 110rpx;
  361. .search-box {
  362. width: 80%;
  363. margin-left: 10rpx;
  364. // height: 34rpx;
  365. }
  366. .search-icon {
  367. display: flex;
  368. align-items: center;
  369. justify-content: space-around;
  370. font-size: 28rpx;
  371. white-space: nowrap;
  372. margin-left: 10rpx;
  373. image {
  374. width: 34rpx;
  375. height: 34rpx;
  376. }
  377. }
  378. .tab-item {
  379. width: 25%;
  380. text-align: center;
  381. font-size: 32rpx;
  382. color: $uni-text-color-grey;
  383. }
  384. .tab-item.active {
  385. color: $j-primary-border-green;
  386. border-bottom: 1px solid $j-primary-border-green;
  387. font-weight: bold;
  388. }
  389. .tab-item.filter {
  390. flex: 1;
  391. padding: 0px 30rpx;
  392. .uni-icons {
  393. display: flex;
  394. padding-top: 5px;
  395. }
  396. }
  397. }
  398. .listBox {
  399. margin-top: 10px;
  400. padding-top: 5px;
  401. padding-bottom: 8px;
  402. .listTit {
  403. display: flex;
  404. align-items: center;
  405. .stuts {
  406. width: 55px;
  407. font-size: 12px;
  408. // border: 1px solid red;
  409. }
  410. .name {
  411. font-size: $uni-font-size-base;
  412. padding-left: 15rpx;
  413. }
  414. .date {
  415. font-size: $uni-font-size-sm;
  416. padding-left: 45rpx;
  417. color: #999;
  418. }
  419. }
  420. .listCont {
  421. display: flex;
  422. align-items: center;
  423. flex-wrap: wrap;
  424. padding-left: 20rpx;
  425. flex-direction: row;
  426. margin-top: 10rpx;
  427. color: #666;
  428. // border: 1px solid red;
  429. .item {
  430. width: 50%;
  431. font-size: $uni-font-size-sm;
  432. overflow: hidden;
  433. white-space: nowrap;
  434. text-overflow: ellipsis;
  435. -o-text-overflow: ellipsis;
  436. }
  437. .item text {
  438. color: #666;
  439. }
  440. .item-left {
  441. font-size: 20px;
  442. font-weight: 600;
  443. color: #999;
  444. position: relative;
  445. left: 90%;
  446. top: -55rpx;
  447. }
  448. }
  449. .item-top {
  450. height: 5rpx;
  451. width: 96%;
  452. margin: 0 auto;
  453. border-bottom: 1px solid #d8d3d3;
  454. }
  455. .listbtn {
  456. margin-top: 20rpx;
  457. display: flex;
  458. justify-content: flex-end;
  459. align-items: center;
  460. .operBox {
  461. display: flex;
  462. align-items: center;
  463. }
  464. }
  465. .listbtn button {
  466. margin-right: 20rpx;
  467. }
  468. }
  469. </style>