index.vue 8.4 KB

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