index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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. >
  10. </uni-nav-bar>
  11. <view class="tab-title">
  12. <view class="search-box">
  13. <uni-easyinput
  14. v-model="searchKey"
  15. placeholder="请输入搜索内容"
  16. @iconClick="handleSearch"
  17. suffixIcon="search"
  18. >
  19. </uni-easyinput>
  20. </view>
  21. </view>
  22. <view class="radio-wrapper">
  23. <view class="title"> 干燥区域 </view>
  24. <radio-group @change="(e) => selectVal(e)">
  25. <label v-for="item in tableList">
  26. <view class="list-item">
  27. <view class="list-col"
  28. ><text>编码</text><text>{{ item.code }}</text></view
  29. >
  30. <view class="list-col"
  31. ><text>区域名称</text><text>{{ item.name }}</text></view
  32. >
  33. <view class="list-col"
  34. ><text>区域位置</text><text>{{ item.workshopName }}</text></view
  35. >
  36. <radio
  37. :value="item.id"
  38. color="#fff"
  39. :disabled="item.disabled"
  40. :checked="item.id === (curItem && curItem.id)"
  41. />
  42. </view>
  43. </label>
  44. </radio-group>
  45. </view>
  46. <view class="footer">
  47. <ProcessOperate
  48. @handlePicking="handlePicking"
  49. @handleReport="handleReport"
  50. />
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import { factoryworkstation } from "@/api/mainData/index";
  56. import ProcessOperate from "../components/ProcessOperate.vue";
  57. let page = 1;
  58. let isEnd = false;
  59. export default {
  60. components: {
  61. ProcessOperate,
  62. },
  63. data() {
  64. return {
  65. searchVisible: false,
  66. tableList: [],
  67. searchKey: "",
  68. curItem: null,
  69. };
  70. },
  71. onShow() {
  72. page = 1;
  73. this.getList();
  74. },
  75. onReachBottom() {
  76. if (isEnd) {
  77. return;
  78. }
  79. page++;
  80. this.getList();
  81. },
  82. methods: {
  83. handleSearch() {
  84. page = 1;
  85. this.getList();
  86. },
  87. //勾选
  88. selectVal({ detail }) {
  89. this.curItem = this.tableList.find((i) => i.id === detail?.value);
  90. },
  91. // 投料、
  92. handlePicking() {
  93. if (!this.curItem) {
  94. return uni.showToast({
  95. title: "请选择干燥区域",
  96. icon: "none",
  97. });
  98. }
  99. uni.navigateTo({
  100. url: `/pages/production/execute/drying/picking?code=${this.curItem.code}&name=${this.curItem.name}`,
  101. });
  102. },
  103. // 报工
  104. handleReport() {
  105. if (!this.curItem) {
  106. return uni.showToast({
  107. title: "请选择干燥区域",
  108. icon: "none",
  109. });
  110. }
  111. this.curItem.path = this.curItem.workshopName;
  112. uni.navigateTo({
  113. url: `/pages/production/execute/drying/report?code=${this.curItem.code}&name=${this.curItem.name}&path=${this.curItem.path}&id=${this.curItem.id}&sourceAreaId=${this.curItem.id}`,
  114. });
  115. },
  116. //获取列表信息
  117. async getList() {
  118. const res = await factoryworkstation({
  119. pageNum: page,
  120. size: 15,
  121. code: this.searchKey,
  122. });
  123. this.curItem = null;
  124. this.tableList = page === 1 ? res.list : [...this.tableList, ...res.list];
  125. isEnd = res.count <= this.tableList.length;
  126. },
  127. },
  128. };
  129. </script>
  130. <style lang="scss" scoped>
  131. .mainBox {
  132. // display: flex;
  133. // flex-direction: column;
  134. box-sizing: border-box;
  135. padding-bottom: 230rpx;
  136. .radio-wrapper {
  137. .title {
  138. font-weight: bold;
  139. padding: 10rpx;
  140. }
  141. .list-item {
  142. position: relative;
  143. padding: 0 50rpx 10rpx 20rpx;
  144. border-bottom: 1rpx solid #ccc;
  145. radio {
  146. position: absolute;
  147. top: 50%;
  148. transform: translateY(-50%);
  149. right: 10rpx;
  150. }
  151. .list-col {
  152. display: flex;
  153. justify-content: space-between;
  154. text {
  155. flex: 1;
  156. }
  157. }
  158. }
  159. }
  160. .footer {
  161. background-color: #fff;
  162. position: fixed;
  163. bottom: 0;
  164. left: 0;
  165. right: 0;
  166. padding: 20rpx 0;
  167. }
  168. }
  169. .search-container {
  170. width: 70vw;
  171. padding: 30rpx 36rpx;
  172. .title {
  173. font-weight: bold;
  174. font-size: 30rpx;
  175. margin-bottom: 20rpx;
  176. }
  177. .status-wrapper {
  178. display: flex;
  179. align-items: center;
  180. justify-content: space-between;
  181. view {
  182. background-color: rgba(242, 242, 242, 1);
  183. height: 60rpx;
  184. border-radius: 30rpx;
  185. line-height: 60rpx;
  186. text-align: center;
  187. width: 160rpx;
  188. border: 1rpx solid rgba(242, 242, 242, 1);
  189. &.active {
  190. color: #157a2c;
  191. border-color: rgba(21, 122, 44, 1);
  192. }
  193. }
  194. }
  195. /deep/.uni-date {
  196. .uni-icons {
  197. display: none;
  198. }
  199. .uni-date-x {
  200. padding: 0;
  201. view {
  202. margin: 0 20rpx;
  203. }
  204. }
  205. }
  206. /deep/.uni-date__x-input,
  207. /deep/.uni-easyinput__content-input {
  208. height: 60rpx;
  209. border-radius: 30rpx;
  210. overflow: hidden;
  211. background-color: rgba(242, 242, 242, 1);
  212. }
  213. .version-group {
  214. display: flex;
  215. align-items: center;
  216. justify-content: flex-start;
  217. flex-wrap: wrap;
  218. }
  219. .wrapper-label {
  220. height: 50rpx;
  221. padding: 0 20rpx;
  222. border: 1rpx solid #ccc;
  223. display: flex;
  224. align-items: center;
  225. justify-content: center;
  226. font-size: 24rpx;
  227. margin: 0 20rpx 20rpx 0;
  228. }
  229. .picker-time {
  230. width: 100%;
  231. height: 60rpx;
  232. line-height: 60rpx;
  233. border: 1rpx solid #ccc;
  234. margin-bottom: 20rpx;
  235. text-indent: 10rpx;
  236. border-radius: 4rpx;
  237. }
  238. }
  239. .tab-title {
  240. width: 100%;
  241. display: flex;
  242. justify-content: space-between;
  243. align-items: center;
  244. height: $tab-height;
  245. line-height: $tab-height;
  246. background-color: #ffffff;
  247. border-bottom: 1px solid #f2f2f2;
  248. box-sizing: border-box;
  249. height: 110rpx;
  250. .search-box {
  251. width: 90%;
  252. margin: 0 auto;
  253. }
  254. .search-icon {
  255. display: flex;
  256. align-items: center;
  257. justify-content: space-around;
  258. font-size: 28rpx;
  259. white-space: nowrap;
  260. margin-left: 10rpx;
  261. image {
  262. width: 34rpx;
  263. height: 34rpx;
  264. }
  265. }
  266. .tab-item {
  267. width: 25%;
  268. text-align: center;
  269. font-size: 32rpx;
  270. color: $uni-text-color-grey;
  271. }
  272. .tab-item.active {
  273. color: $j-primary-border-green;
  274. border-bottom: 1px solid $j-primary-border-green;
  275. font-weight: bold;
  276. }
  277. .tab-item.filter {
  278. flex: 1;
  279. padding: 0px 30rpx;
  280. .uni-icons {
  281. display: flex;
  282. padding-top: 5px;
  283. }
  284. }
  285. }
  286. .listBox {
  287. margin-top: 10px;
  288. padding-top: 5px;
  289. padding-bottom: 8px;
  290. .listTit {
  291. display: flex;
  292. align-items: center;
  293. .stuts {
  294. width: 55px;
  295. font-size: 12px;
  296. // border: 1px solid red;
  297. }
  298. .name {
  299. font-size: $uni-font-size-base;
  300. padding-left: 15rpx;
  301. }
  302. .date {
  303. font-size: $uni-font-size-sm;
  304. padding-left: 45rpx;
  305. color: #999;
  306. }
  307. }
  308. .listCont {
  309. display: flex;
  310. align-items: center;
  311. flex-wrap: wrap;
  312. padding-left: 20rpx;
  313. flex-direction: row;
  314. margin-top: 10rpx;
  315. color: #666;
  316. // border: 1px solid red;
  317. .item {
  318. width: 50%;
  319. font-size: $uni-font-size-sm;
  320. overflow: hidden;
  321. white-space: nowrap;
  322. text-overflow: ellipsis;
  323. -o-text-overflow: ellipsis;
  324. }
  325. .item text {
  326. color: #666;
  327. }
  328. .item-left {
  329. font-size: 20px;
  330. font-weight: 600;
  331. color: #999;
  332. position: relative;
  333. left: 90%;
  334. top: -55rpx;
  335. }
  336. }
  337. .item-top {
  338. height: 5rpx;
  339. width: 96%;
  340. margin: 0 auto;
  341. border-bottom: 1px solid #d8d3d3;
  342. }
  343. .listbtn {
  344. margin-top: 20rpx;
  345. display: flex;
  346. justify-content: flex-end;
  347. align-items: center;
  348. .operBox {
  349. display: flex;
  350. align-items: center;
  351. }
  352. }
  353. .listbtn button {
  354. margin-right: 20rpx;
  355. }
  356. }
  357. </style>