moldDetails.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <template>
  2. <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
  3. <template #gHeader>
  4. <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
  5. <!-- 使用组件实现返回按钮及返回首页按钮 -->
  6. <text
  7. style="font-size:44rpx;"
  8. class="gui-header-leader-btns gui-color-white font-icons"
  9. @tap="goBack"
  10. >&#xe6c5;</text>
  11. <!-- 导航文本此处也可以是其他自定义内容 -->
  12. <text
  13. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text"
  14. >模具明细</text>
  15. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  16. <!-- 实际宽度请根据自己情况设置 -->
  17. <view style="width:40px;" />
  18. <!-- 如果右侧有其他内容可以利用条件编译和定位来实现-->
  19. </view>
  20. </template>
  21. <template #gBody>
  22. <view class="oqc-checkout">
  23. <view class="card-list-flexbox">
  24. <text class="card-list-title" :style="[isPad?'font-size: 18px':'font-size: 14px']">模具信息</text>
  25. <view class="card-list-item">
  26. <text>模具名称</text>
  27. <text>{{ moldDetails.toolingName }}</text>
  28. </view>
  29. <!-- <view class="card-list-item">
  30. <text>模具类型</text>
  31. <text>{{ moldDetails.toolingType }}</text>
  32. </view> -->
  33. <view class="card-list-item">
  34. <text>创建时间</text>
  35. <text>{{ !['', undefined, null, 0].includes(moldDetails.createTime) ? new Date(moldDetails.createTime).toLocaleString(): '' }}</text>
  36. </view>
  37. <view class="card-list-item">
  38. <text>额定使用次数</text>
  39. <text>{{ moldDetails.toolingLifeTime }}</text>
  40. </view>
  41. <view class="card-list-item">
  42. <text>实际使用次数</text>
  43. <text>{{ moldDetails.toolingRealTime }}</text>
  44. </view>
  45. </view>
  46. <view class="table-title">
  47. <span>保养记录</span>
  48. </view>
  49. <view class="custom-table">
  50. <uni-table border stripe empty-text="暂无更多数据">
  51. <!-- 表头行 -->
  52. <uni-tr class="custom-table-head">
  53. <uni-th align="center" width="55px">序号</uni-th>
  54. <uni-th align="center" width="110px">保养人</uni-th>
  55. <uni-th align="center" width="160px">保养日期</uni-th>
  56. <uni-th align="center" width="80px">寿命</uni-th>
  57. <uni-th align="center" width="180px">导柱导套无松动</uni-th>
  58. <uni-th align="center" width="180px">定位销无松动</uni-th>
  59. <uni-th align="center" width="180px">模板无变形,磨损</uni-th>
  60. <uni-th align="center" width="100px">刀锋无缺口</uni-th>
  61. <uni-th align="center" width="100px">刀锋无钝化</uni-th>
  62. <uni-th align="center" width="180px">模具表面清洁整理</uni-th>
  63. <uni-th align="center" width="200px">模具无生锈且添加防锈油</uni-th>
  64. <uni-th align="center" width="100px">备注</uni-th>
  65. </uni-tr>
  66. <!-- 表格数据行 -->
  67. <uni-tr v-for="(item, key) in moldList" :key="key">
  68. <uni-td align="center" width="120px">{{ ++key }}</uni-td>
  69. <uni-td align="center">{{ computedUserName(item.maintainUserid) }}</uni-td>
  70. <uni-td align="center">{{ item.maintainDate }}</uni-td>
  71. <uni-td align="center">{{ item.addCount }} {{ item.countFormat * 1 === "2"? "%": "" }}</uni-td>
  72. <uni-td
  73. align="center"
  74. style="font-weight: bold;font-size: 18px;"
  75. >{{ item.guidePillar * 1 === 1? '✓': '✕' }}</uni-td>
  76. <uni-td
  77. align="center"
  78. style="font-weight: bold;font-size: 18px;"
  79. >{{ item.orientation * 1 === 1? '✓': '✕' }}</uni-td>
  80. <uni-td
  81. align="center"
  82. style="font-weight: bold;font-size: 18px;"
  83. >{{ item.template * 1 === 1? '✓': '✕' }}</uni-td>
  84. <uni-td
  85. align="center"
  86. style="font-weight: bold;font-size: 18px;"
  87. >{{ item.gap * 1 === 1? '✓': '✕' }}</uni-td>
  88. <uni-td
  89. align="center"
  90. style="font-weight: bold;font-size: 18px;"
  91. >{{ item.passivation * 1 === 1? '✓': '✕' }}</uni-td>
  92. <uni-td
  93. align="center"
  94. style="font-weight: bold;font-size: 18px;"
  95. >{{ item.clean * 1 === 1? '✓': '✕' }}</uni-td>
  96. <uni-td
  97. align="center"
  98. style="font-weight: bold;font-size: 18px;"
  99. >{{ item.rust * 1 === 1? '✓': '✕' }}</uni-td>
  100. <uni-td align="center">{{ item.remark }}</uni-td>
  101. </uni-tr>
  102. </uni-table>
  103. </view>
  104. </view>
  105. <gui-right-menus>
  106. <!-- 扩展按钮 -->
  107. <template #menus-more>
  108. <view
  109. hover-class="gui-tap"
  110. class="menu-items gui-bg-blue gui-flex gui-columns gui-justify-content-center"
  111. @click="handleAddPreveser"
  112. >
  113. <text class="menu-text gui-block gui-text-center gui-color-white">新增保养</text>
  114. </view>
  115. </template>
  116. <!-- 核心按钮 -->
  117. <template #menus-primary>
  118. <view class="menu-items gui-bg-primary gui-flex gui-columns gui-justify-content-center">
  119. <text class="menu-icon gui-color-white gui-block gui-text-center gui-icons">&#xe614;</text>
  120. <text class="menu-text gui-color-white gui-block gui-text-center">操作</text>
  121. </view>
  122. </template>
  123. </gui-right-menus>
  124. </template>
  125. </gui-page>
  126. </template>
  127. <script>
  128. import {
  129. ref,
  130. computed,
  131. defineComponent,
  132. onBeforeMount
  133. } from 'vue'
  134. export default defineComponent({
  135. onLoad() {
  136. // // #ifdef APP-PLUS
  137. // plus.screen.lockOrientation('default');
  138. // // #endif
  139. },
  140. onUnload() {
  141. // // #ifdef APP-PLUS
  142. // plus.screen.lockOrientation('portrait-primary');
  143. // // #endif
  144. },
  145. onResize() {
  146. if ([90, -90].includes(plus.navigator.getOrientation())) {
  147. this.isLandscapeScreen = true
  148. } else {
  149. this.isLandscapeScreen = false
  150. }
  151. },
  152. setup(options) {
  153. const popup = ref()
  154. const isLandscapeScreen = ref(false)
  155. const toolingId = uni.getStorageSync('toolingId') ?? ''
  156. const moldDetails = ref({
  157. toolingName: '',
  158. toolingType: '',
  159. createTime: '',
  160. toolingLifeTime: '',
  161. toolingRealTime: ''
  162. })
  163. const userList = ref([])
  164. const moldList = ref([])
  165. // 发料人
  166. const computedUserName = computed(() => {
  167. return userId => {
  168. return userList.value.find(item => item.id === userId)?.nickname ?? ''
  169. }
  170. })
  171. onBeforeMount(() => {
  172. uni.$reqGet('getMesSystemUserList', {
  173. pageNo: 1,
  174. pageSize: 100
  175. })
  176. .then(({
  177. code,
  178. data,
  179. msg
  180. }) => {
  181. if (code === 0) {
  182. userList.value = data?.list ?? []
  183. } else {
  184. uni.showToast({
  185. title: msg,
  186. icon: 'none',
  187. duration: 2000
  188. })
  189. }
  190. })
  191. uni.$reqGet('moldBaseDetails', {
  192. id: toolingId
  193. })
  194. .then(({
  195. code,
  196. data,
  197. msg
  198. }) => {
  199. if (code === 0) {
  200. moldDetails.value = data ?? {}
  201. } else {
  202. uni.showToast({
  203. title: msg,
  204. icon: 'none',
  205. duration: 2000
  206. })
  207. }
  208. })
  209. uni.$reqGet('moldList', {
  210. pageNo: 1,
  211. pageSize: 10,
  212. toolingId: toolingId
  213. })
  214. .then(({
  215. code,
  216. data,
  217. msg
  218. }) => {
  219. if (code === 0) {
  220. moldList.value = data?.list ?? []
  221. } else {
  222. uni.showToast({
  223. title: msg,
  224. icon: 'none',
  225. duration: 2000
  226. })
  227. }
  228. })
  229. })
  230. const goBack = function() {
  231. uni.$goBack('/pages/workbranch/ETM/moldPreserve/indexPage')
  232. }
  233. const handleAddPreveser = function() {
  234. uni.navigateTo({
  235. url: `/pages/workbranch/ETM/moldPreserve/moldAdd`
  236. })
  237. }
  238. return {
  239. popup,
  240. goBack,
  241. moldList,
  242. moldDetails,
  243. isLandscapeScreen,
  244. computedUserName,
  245. handleAddPreveser
  246. }
  247. }
  248. })
  249. </script>
  250. <style lang="scss" scoped>
  251. .gui-header-leader-btns {
  252. color: black;
  253. font-size: 24px !important;
  254. margin-left: 24rpx;
  255. }
  256. .gui-sbody {
  257. background-color: rgba(234, 239, 242, 1);
  258. }
  259. .gui-relative {
  260. overflow: visible;
  261. height: 100vh;
  262. .oqc-checkout {
  263. width: 100vw;
  264. height: calc(100vh - 75px);
  265. position: absolute;
  266. top: 95px;
  267. overflow-y: scroll;
  268. }
  269. }
  270. .card-list-flexbox {
  271. width: calc(100vw - 24px);
  272. height: 195px;
  273. margin: 0 12px;
  274. display: flex;
  275. justify-content: center;
  276. flex-direction: column;
  277. align-items: center;
  278. overflow-y: scroll;
  279. .card-list-title {
  280. width: 100%;
  281. height: 35px;
  282. line-height: 35px;
  283. margin: 0 4px 0 4px;
  284. border-radius: 4px 4px 0 0;
  285. text-align: center;
  286. color: white;
  287. background-color: rgba(0, 160, 233, 1.0);
  288. }
  289. .card-list-item,
  290. .card-list-item-operation {
  291. width: 100%;
  292. height: 35px;
  293. margin: 0 4px 3rpx 4px;
  294. border-radius: 4px;
  295. display: flex;
  296. flex-direction: row;
  297. align-items: center;
  298. justify-content: space-between;
  299. background-color: #fff;
  300. uni-text {
  301. font-size: 14px;
  302. height: 50rpx;
  303. text-align: left;
  304. padding: 0 8px;
  305. display: flex;
  306. flex-direction: row;
  307. align-items: center;
  308. }
  309. .text-1 {
  310. flex: 1;
  311. height: 35px;
  312. justify-content: flex-start;
  313. }
  314. .text-2 {
  315. flex: 3;
  316. height: 35px;
  317. justify-content: flex-end;
  318. margin-right: 4px;
  319. padding: 2px 6px;
  320. }
  321. }
  322. }
  323. .popup-content {
  324. width: 100vw;
  325. height: 55vh;
  326. overflow-y: scroll;
  327. }
  328. .card-list-flexbox-popup {
  329. width: 100vw;
  330. display: flex;
  331. flex-direction: row;
  332. align-items: center;
  333. flex-wrap: wrap;
  334. .card-list-item,
  335. .card-list-item-input {
  336. width: 100vw;
  337. height: 100%;
  338. min-height: 40px;
  339. display: flex;
  340. flex-direction: row;
  341. align-items: center;
  342. background-color: #fff;
  343. uni-text {
  344. font-size: 14px;
  345. height: 50rpx;
  346. text-align: left;
  347. padding: 0 12px;
  348. display: flex;
  349. flex-direction: row;
  350. align-items: center;
  351. }
  352. .text-1 {
  353. flex: 1;
  354. height: 40px;
  355. justify-content: flex-start;
  356. }
  357. .text-2 {
  358. flex: 3;
  359. height: 40px;
  360. justify-content: flex-end;
  361. margin-right: 4px;
  362. padding: 2px 6px;
  363. }
  364. .text-3 {
  365. width: calc(100% - 15%);
  366. min-height: 35px;
  367. justify-content: flex-end;
  368. padding: 2px 6px;
  369. }
  370. .text-3::before {}
  371. .btn-mg {
  372. margin: 0 5px;
  373. }
  374. }
  375. .card-list-item {
  376. justify-content: center;
  377. }
  378. }
  379. .table-title {
  380. height: 40px;
  381. line-height: 40px;
  382. margin: 4px 0 -3px 0;
  383. padding: 0 12px;
  384. font-size: 16px;
  385. font-weight: bold;
  386. background-color: white;
  387. }
  388. .custom-table {
  389. height: 30vh;
  390. min-height: 230px;
  391. margin: 5px 0;
  392. // min-height: 600px;
  393. overflow-y: scroll;
  394. }
  395. .custom-table2 {
  396. height: 100px;
  397. margin: 5px 0;
  398. overflow-y: scroll;
  399. }
  400. .uni-list-cell {
  401. width: 100vw;
  402. height: 35px;
  403. margin: 4px 0;
  404. display: flex;
  405. flex-direction: row;
  406. align-items: center;
  407. justify-content: space-between;
  408. border-bottom: 2px solid #eaeff2;
  409. background-color: #fff;
  410. view {
  411. font-size: 14px;
  412. height: 50rpx;
  413. text-align: left;
  414. padding: 0 8px;
  415. display: flex;
  416. flex-direction: row;
  417. align-items: center;
  418. }
  419. .uni-list-cell-left {
  420. flex: 1;
  421. height: 35px;
  422. justify-content: flex-start;
  423. }
  424. .uni-list-cell-db {
  425. flex: 3;
  426. height: 35px;
  427. justify-content: flex-end;
  428. margin-right: 4px;
  429. padding: 2px 6px;
  430. uni-picker {
  431. width: 100%;
  432. display: flex;
  433. flex-direction: row;
  434. justify-content: center;
  435. }
  436. }
  437. }
  438. .modal-btns {
  439. height: 100rpx;
  440. line-height: 100rpx;
  441. display: flex;
  442. justify-content: center;
  443. align-items: center;
  444. }
  445. .line {
  446. margin-top: 10rpx;
  447. height: 80rpx;
  448. width: 1rpx;
  449. background-color: #dcdcdc;
  450. }
  451. </style>