footBtn.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <div class="foot_box">
  3. <div
  4. v-for="(item, index) in btnList"
  5. :key="index"
  6. class="btn"
  7. :style="{ background: item.bjColor }"
  8. @click="footClick(item.type)"
  9. >
  10. <img src="../../../assets/Frame.png" class="Frame" />
  11. {{ item.name }}
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. btnList1: [
  20. {
  21. name: '领料',
  22. type: 'pick',
  23. bjColor: '#FC1B75'
  24. },
  25. {
  26. name: '投料',
  27. type: 'feed',
  28. bjColor: '#FBD114'
  29. },
  30. {
  31. name: '报工',
  32. type: 'job',
  33. bjColor: '#157A2C'
  34. },
  35. {
  36. name: '委外请托',
  37. type: 'Outsourcing',
  38. bjColor: '#39D9AC'
  39. },
  40. {
  41. name: '暂停启动',
  42. type: '',
  43. bjColor: '#858585'
  44. },
  45. // {
  46. // name: '工单交接',
  47. // type: '',
  48. // bjColor: '#2B56C2'
  49. // },
  50. {
  51. name: '工艺文件',
  52. type: 'work',
  53. bjColor: '#2f3033'
  54. },
  55. {
  56. name: '工步',
  57. type: 'workStep',
  58. bjColor: '#409EFF'
  59. },
  60. {
  61. name: '任务',
  62. type: 'task',
  63. bjColor: '#67c23a'
  64. },
  65. {
  66. name: '异常',
  67. type: 'error',
  68. bjColor: '#cc0000'
  69. }
  70. ],
  71. btnList2: [
  72. // {
  73. // name: '取样质检',
  74. // type: 'inspection',
  75. // bjColor: '#FBD114'
  76. // },
  77. {
  78. name: '报工',
  79. type: 'job',
  80. bjColor: '#157A2C'
  81. },
  82. {
  83. name: '委外请托',
  84. type: 'Outsourcing',
  85. bjColor: '#39D9AC'
  86. },
  87. {
  88. name: '暂停启动',
  89. type: '',
  90. bjColor: '#858585'
  91. },
  92. {
  93. name: '工艺文件',
  94. type: 'work',
  95. bjColor: '#2B56C2'
  96. },
  97. {
  98. name: '工步',
  99. type: 'workStep',
  100. bjColor: '#409EFF'
  101. },
  102. {
  103. name: '任务',
  104. type: 'task',
  105. bjColor: '#67c23a'
  106. },
  107. {
  108. name: '异常',
  109. type: 'error',
  110. bjColor: '#cc0000'
  111. }
  112. ],
  113. btnList3: [
  114. {
  115. name: '入库',
  116. type: 'job',
  117. bjColor: '#157A2C'
  118. },
  119. {
  120. name: '暂停启动',
  121. type: '',
  122. bjColor: '#858585'
  123. },
  124. {
  125. name: '工艺文件',
  126. type: 'work',
  127. bjColor: '#2B56C2'
  128. },
  129. {
  130. name: '异常',
  131. type: 'error',
  132. bjColor: '#cc0000'
  133. }
  134. ],
  135. btnList4: [
  136. {
  137. name: '取样质检',
  138. type: 'inspection',
  139. bjColor: '#FBD114'
  140. },
  141. {
  142. name: '报工',
  143. type: 'job',
  144. bjColor: '#157A2C'
  145. },
  146. {
  147. name: '委外请托',
  148. type: 'Outsourcing',
  149. bjColor: '#39D9AC'
  150. },
  151. {
  152. name: '暂停启动',
  153. type: '',
  154. bjColor: '#858585'
  155. },
  156. {
  157. name: '工艺文件',
  158. type: 'work',
  159. bjColor: '#2B56C2'
  160. },
  161. {
  162. name: '工步',
  163. type: 'workStep',
  164. bjColor: '#409EFF'
  165. },
  166. {
  167. name: '任务',
  168. type: 'task',
  169. bjColor: '#67c23a'
  170. },
  171. {
  172. name: '异常',
  173. type: 'error',
  174. bjColor: '#cc0000'
  175. }
  176. ],
  177. btnList: []
  178. };
  179. },
  180. props: {
  181. type: {
  182. type: String | Number,
  183. default: ''
  184. },
  185. singleReportInspection: {}
  186. },
  187. computed: {
  188. taskObj() {
  189. return this.$store.state.user.taskObj;
  190. },
  191. clientEnvironmentId() {
  192. return this.$store.state.user.info.clientEnvironmentId;
  193. }
  194. },
  195. watch: {
  196. taskObj(val) {
  197. // if (this.clientEnvironmentId == 2 && val.type == 3) {
  198. // this.btnList[1].name = '质检';
  199. // this.btnList[1].type = 'inspection';
  200. // } else {
  201. // this.btnList[1].name = '投料';
  202. // this.btnList[1].type = 'feed';
  203. // }
  204. if (
  205. this.clientEnvironmentId == 3 &&
  206. (this.taskObj.type == 3 || this.taskObj.type == 6)
  207. ) {
  208. let index = this.btnList2.findIndex((obj) => obj.name == '取样质检');
  209. if (index !== -1) {
  210. this.btnList2.splice(0, 1);
  211. }
  212. }
  213. },
  214. type: {
  215. handler(v) {
  216. if (v == '2' || v == '3' || v == '6') {
  217. let btnList2 = this.btnList2.filter((item) => {
  218. if (v != 6) {
  219. }
  220. });
  221. this.$set(this, 'btnList', this.btnList2);
  222. } else if (v == '5') {
  223. this.$set(this, 'btnList', this.btnList3);
  224. } else {
  225. this.$set(this, 'btnList', this.btnList1);
  226. }
  227. },
  228. immediate: true,
  229. deep: true
  230. },
  231. singleReportInspection: {
  232. handler(v) {
  233. if (v == 1 || v == null) {
  234. let index = this.btnList2.findIndex(
  235. (obj) => obj.name == '取样质检'
  236. );
  237. if (index !== -1) {
  238. this.btnList2.splice(0, 1);
  239. }
  240. } else if (v == 0 && this.clientEnvironmentId != 3) {
  241. let arr = {
  242. name: '取样质检',
  243. type: 'inspection',
  244. bjColor: '#FBD114'
  245. };
  246. this.btnList2.unshift(arr);
  247. }
  248. }
  249. }
  250. },
  251. created() {},
  252. mounted() {
  253. // if(this.clientEnvironmentId == 3 && (this.taskObj.type == 3||this.taskObj.type == 6)){
  254. // this.btnList2.splice(0, 1);
  255. // }
  256. },
  257. methods: {
  258. footClick(type) {
  259. this.$emit('footBtn', type);
  260. }
  261. }
  262. };
  263. </script>
  264. <style lang="scss" scoped>
  265. .foot_box {
  266. min-width: 1280px;
  267. width: 100%;
  268. height: 80px;
  269. padding: 0 20px;
  270. display: flex;
  271. align-items: center;
  272. // justify-content: space-between;
  273. font-size: 20px;
  274. }
  275. .btn {
  276. height: 70px;
  277. width: calc(100% / 11);
  278. margin: 0 10px;
  279. color: #fff;
  280. font-weight: 800;
  281. font-size: 20px;
  282. border-radius: 4px;
  283. display: flex;
  284. flex-direction: column;
  285. align-items: center;
  286. justify-content: center;
  287. cursor: pointer;
  288. .Frame {
  289. width: 26px;
  290. height: 26px;
  291. }
  292. }
  293. </style>