GY02.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div class="add-table">
  3. <div class="leftMessage">
  4. <div class="list" v-for="(item, index) in baseMessage" :key="index">
  5. <span class="titile" style="background:rgb(52,191,163); color:white;"> {{ item.title}} </span>
  6. <span class="content" style="background:rgb(235,237,242); color:rgb(232,83,152);"> {{ item.content}} </span>
  7. </div>
  8. <div class="content"></div>
  9. </div>
  10. <div class="rightMessage">
  11. <div class="top">
  12. <div class="state">
  13. <div class="list">
  14. <span>工序状态:</span>
  15. <p>初始</p>
  16. </div>
  17. <div class="list">
  18. <span>是否外协:</span>
  19. <p>初始</p>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="button">
  24. <el-button-group>
  25. <el-button type="primary" icon="el-icon-video-play" plain round>开始</el-button>
  26. <el-button type="danger" icon="el-icon-video-pause" plain>暂停</el-button>
  27. <el-button type="success" icon="el-icon-circle-check" plain>完成</el-button>
  28. <el-button type="info" icon="el-icon-refresh" plain round>重置</el-button>
  29. </el-button-group>
  30. </div>
  31. <div class="middle">
  32. <el-table :data="tableData2" border >
  33. <el-table-column>
  34. </el-table-column>
  35. </el-table>
  36. <div class="name">人员及工时分配</div>
  37. <el-table :data="tableData1" border ref="addTableRowRef">
  38. <el-table-column label="人员姓名">
  39. <template slot-scope="scope">
  40. <el-input v-model="scope.row.name"></el-input>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="分配工时">
  44. <template slot-scope="scope">
  45. <el-input-number v-model="scope.row.time" controls-position="right" @change="handleChange" :min="0.25" :max="8" :step="0.25"></el-input-number>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="操作" width="120" align="center">
  49. <template slot-scope="scope">
  50. <el-button
  51. icon="el-icon-delete"
  52. size="mini"
  53. @click="deleteTableRow(scope.row)"
  54. >删除</el-button>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <div class="block">
  59. <el-pagination
  60. layout="prev, pager, next"
  61. :total="50">
  62. </el-pagination>
  63. </div>
  64. <el-button size="mini" icon="el-icon-plus" type="primary" @click="addTableRow">新 增</el-button>
  65. <el-button size="mini" icon="el-icon-check" type="success" @click="saveTableRow(newRow)">保 存</el-button>
  66. </div>
  67. <div class="footer">
  68. <div class="total">
  69. <span>当前工序总工时: 10</span>
  70. <span>当前已分配工时: 10</span>
  71. <span>当前剩余工时: 10</span>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. export default {
  79. name: 'GY02',
  80. data() {
  81. return {
  82. tableData1: [],
  83. tableData2: [],
  84. newRow: {},
  85. baseMessage: [
  86. { title:'任务', content:'47as04-51-1238'},
  87. { title:'图号', content:'1CG12-38'},
  88. { title:'名称', content:'支架'},
  89. { title:'数量', content:'1'},
  90. { title:'工艺', content:'1'},
  91. { title:'质控', content:'1'},
  92. ]
  93. }
  94. },
  95. methods: {
  96. addTableRow() {
  97. const newRow = {
  98. name: '',
  99. time: 0.25,
  100. };
  101. this.tableData1.push(newRow);
  102. },
  103. deleteTableRow(row) {
  104. const index = this.tableData1.indexOf(row);
  105. if (index !== -1) {
  106. this.tableData1.splice(index, 1);
  107. }
  108. },
  109. saveTableRow(tableData1) {
  110. let item = '';
  111. for(let i = 0; i < this.tableData1.length; i++) {
  112. item += tableData1[i]
  113. }
  114. this.tableData2 = this.item;
  115. this.tableData1 = [];
  116. },
  117. handleChange(value) {
  118. console.log(value);
  119. }
  120. },
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .add-table {
  125. display: flex;
  126. flex-direction: row;
  127. justify-content: space-between;
  128. .leftMessage {
  129. display: flex;
  130. flex-direction: column;
  131. width: 180px;
  132. .list {
  133. padding: 10px 0px ;
  134. span {
  135. border-radius: 10px;
  136. padding: 5px;
  137. margin-right: 10px;
  138. }
  139. }
  140. }
  141. .rightMessage {
  142. display: flex;
  143. width: 500px;
  144. flex-direction: column;
  145. .top {
  146. background: #53B0F8;
  147. color: white;
  148. height: 60px;
  149. .state {
  150. display: flex;
  151. flex-direction: row;
  152. padding: 10px 20px;
  153. span {
  154. padding-right: 150px;
  155. }
  156. p {
  157. padding-top: 5px;
  158. font-size: 10px;
  159. }
  160. }
  161. }
  162. .button {
  163. width: 100%;
  164. padding: 20px 0px;
  165. .el-button {
  166. width: 140px;
  167. background: none;
  168. }
  169. .el-button--info {
  170. width: 80px;
  171. }
  172. }
  173. .middle {
  174. .name {
  175. color: black;
  176. font-weight: bold;
  177. text-align: center;
  178. padding: 10px 0px;
  179. }
  180. .block {
  181. text-align: center;
  182. }
  183. }
  184. .footer {
  185. display: inline-block;
  186. flex-direction: row;
  187. margin-top: 10px;
  188. span {
  189. font-weight: bold;
  190. color: black;
  191. }
  192. }
  193. }
  194. }
  195. </style>