detail.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <div>
  3. <div class="header">
  4. <div class="header_top">
  5. <Button
  6. type="primary"
  7. class="header_btn"
  8. ghost
  9. @click="handleShow"
  10. :icon="is_show ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'"
  11. >
  12. <div style="margin-right: 0.6rem">
  13. {{ is_show ? "收起" : "展开" }}
  14. </div></Button
  15. >
  16. <div style="margin-right: 1rem; color: #66a9f0">王小伟</div>
  17. </div>
  18. <div class="header_middle">
  19. <b-dropdown size="sm" text="Large" class="m-2" :disabled="is_use">
  20. <b-dropdown-item-button>Action</b-dropdown-item-button>
  21. <b-dropdown-item-button>Another action</b-dropdown-item-button>
  22. <b-dropdown-item-button>Something else here</b-dropdown-item-button>
  23. </b-dropdown>
  24. <b-dropdown size="sm" text="Large" class="m-2" :disabled="is_use">
  25. <b-dropdown-item-button>Action</b-dropdown-item-button>
  26. <b-dropdown-item-button>Another action</b-dropdown-item-button>
  27. <b-dropdown-item-button>Something else here</b-dropdown-item-button>
  28. </b-dropdown>
  29. <b-dropdown size="sm" text="Large" class="m-2" :disabled="is_use">
  30. <b-dropdown-item-button>Action</b-dropdown-item-button>
  31. <b-dropdown-item-button>Another action</b-dropdown-item-button>
  32. <b-dropdown-item-button>Something else here</b-dropdown-item-button>
  33. </b-dropdown>
  34. </div>
  35. <div class="header_middle1 ot">
  36. <div class="ft">58 &nbsp;</div>
  37. <div class="ft">12 &nbsp;</div>
  38. <div class="ft">12 &nbsp;</div>
  39. </div>
  40. <div class="header_footer">
  41. <div style="margin-left: 1rem">已完成56/10</div>
  42. <div style="margin-right: 1.4rem">已完成10%</div>
  43. </div>
  44. </div>
  45. <div class="bdy">
  46. <table>
  47. <tr style="height: 2rem">
  48. <th style="width: 3rem">生产订单号</th>
  49. <th style="width: 4rem">产品名称</th>
  50. <th style="width: 3rem">规格型号</th>
  51. <th style="width: 3rem">已完工数量</th>
  52. <th style="width: 3rem">未完工数量</th>
  53. </tr>
  54. <tr
  55. v-for="(item, index) in tableData"
  56. :key="index"
  57. @click="handleChoose(item, index)"
  58. :class="item.is_choose ? 'choose_item' : ''"
  59. >
  60. <td>
  61. {{ item.production_no }}
  62. </td>
  63. <td>{{ item.product_title }}</td>
  64. <td>{{ item.size }}</td>
  65. <td>{{ item.finished_num }}</td>
  66. <td>{{ item.un_finished_quantity }}</td>
  67. </tr>
  68. </table>
  69. </div>
  70. <div class="footer">
  71. <Button
  72. type="primary"
  73. class="header_btn"
  74. style="margin-right: 3rem; height: 2.6rem"
  75. @click="handleReturn"
  76. >
  77. 返回</Button
  78. >
  79. <Button
  80. type="primary"
  81. class="header_btn"
  82. style="margin-left: 3rem; height: 2.6rem"
  83. @click="handelGoSure"
  84. >
  85. 确认</Button
  86. >
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. export default {
  92. data () {
  93. return {
  94. tableData: [],
  95. is_show: true,
  96. is_use: false
  97. }
  98. },
  99. mounted () {
  100. let data = {}
  101. if (localStorage.getItem('fyy_target')) {
  102. data.target = JSON.parse(localStorage.getItem('fyy_target'))
  103. }
  104. data = {
  105. url: 'http://121.36.142.167:7774/jbl/api/module-data/production_orders_list/page',
  106. post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"production_orders","developmentSystemId":null,"debugFlag":true},
  107. header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MjM3NzIyfQ.aO1_RGWVxXygefwuUg_au3ys71zc2KuIbxZNWgTBeLRK9JVEqQZeza4X1gtoA8_BxoKZUuaPnTP9gUrEGgF3UQ', 'Content-Sign: e2938faaabcd8654dfb07a98bd84d3f1', 'Content-Type:application/json']
  108. }
  109. this.initData(data)
  110. },
  111. methods: {
  112. initData (row) {
  113. this.axios.post('/api/testdwy', { ...row }).then(res => {
  114. this.tableData = res.data.content ? res.data.content : []
  115. this.tableData.forEach(v => {
  116. v.is_choose = false
  117. })
  118. })
  119. },
  120. handelGoSure () {
  121. if (this.tableData.filter(v => v.is_choose).length === 0) {
  122. return this.$Message.warning('请先选择数据!')
  123. }
  124. localStorage.removeItem('fyy_target')
  125. const id = this.tableData.filter(v => v.is_choose).map(v => v['dynamic_form_value_id']).toString()
  126. this.$router.push({ path: '/cms/Package/detailed', query: { id } })
  127. },
  128. handleReturn () {
  129. localStorage.removeItem('fyy_target');
  130. this.$router.push('/cms/home');
  131. },
  132. handleChoose(item, index) {
  133. item.is_choose = !item.is_choose;
  134. this.tableData.splice(index, 1, item);
  135. },
  136. handleShow () {
  137. this.is_show = !this.is_show;
  138. console.log(document.getElementsByClassName('header'))
  139. if (this.is_show) {
  140. document.getElementsByClassName('header')[0].style = 'height:7rem;overflow:hidden;transition:all .4s;'
  141. setTimeout(() => {
  142. document.getElementsByClassName('header')[0].style = 'overflow:none;'
  143. this.is_use = false
  144. }, 400)
  145. } else {
  146. this.is_use = true;
  147. document.getElementsByClassName('header')[0].style = 'height:2.7rem;overflow:hidden;transition:all .4s;'
  148. }
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .header {
  155. width: 94%;
  156. height: 7rem;
  157. // overflow: hidden;
  158. // transition: all 0.4s;
  159. position: relative;
  160. top: 0.5rem;
  161. left: 3%;
  162. box-shadow: 0.16rem 0.1rem 0.1rem 0.1rem #9d9b9b;
  163. border-radius: 1rem;
  164. padding: 0.4rem 0.7rem 0 1rem;
  165. background: #fff;
  166. }
  167. .header_btn {
  168. border-radius: 1rem;
  169. padding: 0.1rem;
  170. width: 5rem;
  171. display: flex;
  172. justify-content: space-around;
  173. align-items: center;
  174. }
  175. .header_top {
  176. display: flex;
  177. justify-content: space-between;
  178. align-items: center;
  179. }
  180. .ot {
  181. position: relative;
  182. top: -1.3rem;
  183. }
  184. .header_middle1 {
  185. display: flex;
  186. justify-content: space-between;
  187. align-items: center;
  188. .ft {
  189. font-size: 1.5rem;
  190. width: 5rem;
  191. text-align: center;
  192. }
  193. }
  194. .header_middle {
  195. position: relative;
  196. top: -0.3rem;
  197. display: flex;
  198. justify-content: space-between;
  199. align-items: center;
  200. }
  201. /deep/ .btn-group > .btn,
  202. .btn-group-vertical > .btn {
  203. background: #ffffff;
  204. color: #2c3e50;
  205. outline: none;
  206. border: none;
  207. margin: 0;
  208. z-index: 3;
  209. }
  210. .header_footer {
  211. position: relative;
  212. top: -1.7rem;
  213. display: flex;
  214. justify-content: space-between;
  215. align-items: center;
  216. div {
  217. font-size: 0.5rem;
  218. color: rgb(244, 136, 42);
  219. }
  220. }
  221. .bdy {
  222. width: 94%;
  223. height: calc(100% - 18.7rem);
  224. overflow: auto;
  225. position: relative;
  226. top: 1rem;
  227. left: 3%;
  228. }
  229. /deep/td {
  230. text-align: center;
  231. vertical-align: middle;
  232. }
  233. table {
  234. border-collapse: collapse; /* 合并边框 */
  235. width: 100%; /* 表格宽度 */
  236. background: #fff;
  237. table-layout: fixed;
  238. }
  239. th {
  240. font-size: 0.6rem;
  241. background: #66b1f4;
  242. color: #fff;
  243. }
  244. td {
  245. font-size: 0.6rem;
  246. word-break: break-all;
  247. }
  248. td,
  249. th {
  250. vertical-align: middle;
  251. text-align: center;
  252. border: 0.1rem solid #dddddd; /* 单元格边框样式 */
  253. padding: 0.02rem; /* 单元格内边距 */
  254. }
  255. .choose_item {
  256. background: #c8c8c8;
  257. }
  258. .footer {
  259. display: flex;
  260. justify-content: space-around;
  261. width: 100%;
  262. position: absolute;
  263. bottom: 4.8rem;
  264. }
  265. </style>