detailed.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. <template>
  2. <div style=" overflow-y: scroll;padding-bottom: 5rem;">
  3. <div style="background-image: url('../../../assets/images/bc.png');background-size: 100% 100%;">
  4. <div class="home_header">完工</div>
  5. <div class="home_header_line"></div>
  6. <div class="home_con_body">
  7. <div class="send_work" v-for="(item, index) in list" :key="index">
  8. <div class="check_box">
  9. <div @click="handleChoose(item, index)" class="check_box_c">
  10. </div>
  11. </div>
  12. <div class="secd_flex">
  13. <div class="secd_title">
  14. <span>派工单号:</span><span>{{ item.dispatch_order_no }}</span>
  15. </div>
  16. <span class="secd_title_d">{{ item.product_title }}</span>
  17. <div style="height: 1px;background-color: #fff;opacity: 0.3;"></div>
  18. <div style="display: flex;flex-direction: column;gap: 1rem;margin-top: 1rem;">
  19. <div class="secd_input">
  20. <div class="secd_input_l">数量:</div>
  21. <div class="secd_input_r">
  22. <input type="text" v-model="item.finished_num" @on-change="handleChangeNumber($event, index)"
  23. placeholder="请输入数量">
  24. </div>
  25. </div>
  26. <div class="secd_input">
  27. <div class="secd_input_l">班组:</div>
  28. <div class="secd_input_r">
  29. <b-form-select id="input-3" v-model="item.team_finish_id" :options="teamList" class="inp select_list"
  30. required placeholder="请选择站点" @change="(e) => handleChangeTeam(e, index)"></b-form-select>
  31. </div>
  32. </div>
  33. <div class="secd_input">
  34. <div class="secd_input_l">人员:</div>
  35. <div class="secd_input_r">
  36. <b-form-select id="input-3" :options="employeeList" v-model="item.employee_id" class="inp select_list"
  37. required placeholder="请选择站点" @on-change="handleChangeEmployee($event, index)"></b-form-select>
  38. </div>
  39. </div>
  40. <div class="secd_input">
  41. <div class="secd_input_l">设备:</div>
  42. <div class="secd_input_r">
  43. <b-form-select id="input-3" v-model="item.equipment_id" :options="equipmentList" class="inp select_list"
  44. required placeholder="请选择站点" @change="(e) => handleChangeEquipment(e, index)"></b-form-select>
  45. </div>
  46. </div>
  47. </div>
  48. <div style="height: 1px;background-color: #fff;opacity: 0.3;margin-top: .8rem;margin-bottom: .8rem;"></div>
  49. <div class="defective_products">
  50. <div>不良品</div>
  51. <div style="display: flex;align-items: center;gap: .625rem;">
  52. <img @click="handleBreakAdd(_index, item, index)" src="../../../assets/home/j.png" alt="">
  53. <img @click="handleBreakCancel(_index, item, index)" src="../../../assets/home/z.png" alt="">
  54. </div>
  55. </div>
  56. <div v-for="(_item, _index) in item.break" :key="_index"
  57. style="display: flex;flex-direction: column;gap: 1rem;margin-top: .5rem;">
  58. <div class="secd_input">
  59. <div class="secd_input_l">不良品原因:</div>
  60. <div class="secd_input_r">
  61. <b-form-select id="input-3" v-model="_item.break_id" :options="breakList" class="inp select_list"
  62. required placeholder="请选择站点"></b-form-select>
  63. </div>
  64. </div>
  65. <div class="secd_input">
  66. <div class="secd_input_l">不良品数量:</div>
  67. <div class="secd_input_r">
  68. <input type="text" placeholder="请输入数量" v-model="_item.break_num">
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="footer">
  75. <div class="return_btn" @click="handleReturn">返回</div>
  76. <div class="confirm_btn" @click="handleSure">确认</div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. export default {
  84. data() {
  85. return {
  86. list: [],
  87. name: '',
  88. formData: {},
  89. teamList: [],
  90. employeeList: [],
  91. equipmentList: [],
  92. state: true,
  93. breakList: []
  94. }
  95. },
  96. created() {
  97. // 获取不良品原因
  98. const data2 = {
  99. url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_list/page',
  100. post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "dynamicFormCode": "defective", "developmentSystemId": null, "debugFlag": true }
  101. }
  102. this.axios.post('/api/testdwy', { ...data2 }).then(res => {
  103. this.breakList = res.data.content.filter(v => v.status)
  104. this.breakList.forEach(v => {
  105. v.value = v.defective_code
  106. v.text = v.title
  107. })
  108. })
  109. // 获取设备
  110. const data1 = {
  111. url: 'http://121.36.142.167:7774/jbl/api/module-data/device_list/page',
  112. post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "dynamicFormCode": "device", "developmentSystemId": null, "debugFlag": true }
  113. }
  114. this.axios.post('/api/testdwy', { ...data1 }).then(res => {
  115. this.equipmentList = res.data.content.filter(v => v.status)
  116. this.equipmentList.forEach(v => {
  117. v.value = v.device_code
  118. v.text = v.title
  119. })
  120. })
  121. // 获取班组
  122. const data = {
  123. url: 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
  124. post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "dynamicFormCode": "team", "developmentSystemId": null, "debugFlag": true }
  125. }
  126. this.axios.post('/api/testdwy', { ...data }).then(res => {
  127. this.teamList = res.data.content.filter(v => v.status)
  128. this.teamList.forEach(v => {
  129. v.value = v.team_code
  130. v.text = v.title
  131. })
  132. })
  133. // 获取人员
  134. const data3 = {
  135. url: 'http://121.36.142.167:7774/jbl/api/module-data/team_code_btn/page',
  136. post: { "direction": "DESC", "property": "id", "fromClientType": "pc", "number": 0, "sorts": [], "rules": [], "size": 15, "specialConditions": [], "workflowSearchBean": {}, "dynamicFormCode": "person", "dynamicFormTable": null, "ignoreField": true, "developmentSystemId": null, "debugFlag": true }
  137. }
  138. this.axios.post('/api/testdwy', { ...data3 }).then(res => {
  139. this.employeeList = res.data.content
  140. this.employeeList.forEach(v => {
  141. v.value = v.no
  142. v.text = v.name
  143. })
  144. })
  145. },
  146. beforeRouteLeave(to, from, next) {
  147. localStorage.removeItem(this.$route.query.id + '')
  148. next()
  149. },
  150. beforeRouteEnter(to, from, next) {
  151. if (localStorage.getItem(to.query.id)) {
  152. next()
  153. } else {
  154. next(vm => {
  155. vm.$router.replace('/cms/finish/detail')
  156. // 跳到该路由页面后,再替换为from.path来源路径
  157. })
  158. }
  159. },
  160. mounted() {
  161. const id = this.$route.query.id
  162. this.initData(id)
  163. },
  164. methods: {
  165. handleChangeNumber(e, index) {
  166. this.list[index].not_finished_num = this.list[index].dispatch_num - (e.target.value * 1)
  167. },
  168. handleChangeEmployee(e, index) {
  169. this.list[index].employee_id_show = this.employeeList.filter(v => e.indexOf(v.no) !== -1).map(v => v.name).toString().replace(/,/g, '/$/$/$').replace(/\//g, '')
  170. console.log(this.list[index])
  171. },
  172. handleChangeTeam(e, index) {
  173. this.list[index].team_id_show = this.teamList.find(v => v.team_code === e).title
  174. },
  175. handleChangeEquipment(e, index) {
  176. this.list[index].equipment_id_show = this.equipmentList.find(v => v.device_code === e).title
  177. },
  178. initData(id) {
  179. this.list = JSON.parse(localStorage.getItem(id + ''))
  180. this.list.forEach(v => {
  181. v.team_finish_id = v.dispatch_orders.team_id
  182. v.team_id_show = v.dispatch_orders.team_id_show
  183. v.equipment_id = v.dispatch_orders.equipment_id
  184. v.equipment_id_show = v.dispatch_orders.equipment_id_show
  185. v.finished_num = v.not_finished_num
  186. v.dispatch_order_no = v.dispatch_no
  187. v.id = null
  188. v.employee_id = v.dispatch_orders.employee_id.split(',')
  189. v.employee_id_show = v.dispatch_orders.employee_id_show
  190. v.break = [
  191. { break_id: '', break_num: 0 }
  192. ]
  193. })
  194. },
  195. handleBreakAdd(_index, item, index) {
  196. item.break.splice(_index + 1, 0, {
  197. break_id: '',
  198. break_num: 0
  199. })
  200. this.list.splice(index, 1, item)
  201. },
  202. handleBreakCancel(_index, item, index) {
  203. if (_index === 0) {
  204. item.break = [{ break_id: '', break_num: 0 }]
  205. } else {
  206. item.break.splice(_index, 1)
  207. }
  208. this.list.splice(index, 1, item)
  209. },
  210. handleReturn() {
  211. localStorage.removeItem(this.$route.query.id + '')
  212. this.$router.go(-1)
  213. },
  214. // handleChooseTeam (e) {
  215. // if (e) {
  216. // this.formData.team_id = e
  217. // // 获取班组下的人员
  218. // const id = this.teamList.find(v => v.team_code === this.formData.team_id).dynamic_form_value_id
  219. // const data = {
  220. // url: `http://121.36.142.167:7774/jbl/api/module-data/team/team/472629516238663680/${id}`
  221. // }
  222. // this.axios.post('/api/testdwyget', { ...data }).then(res => {
  223. // this.employeeList = res.data.data.employee
  224. // this.employeeList.forEach(v => {
  225. // v.value = v.team_code
  226. // v.text = v.team_code_show
  227. // })
  228. // this.formData.employee_id = []
  229. // })
  230. // } else {
  231. // this.formData.employee_id = []
  232. // }
  233. // },
  234. handleSure() {
  235. // console.log(this.list);return false;
  236. this.list.forEach(v => {
  237. const data3 = {
  238. url: 'http://121.36.142.167:7774/jbl/api/module-data/completion_orders/completion_orders',
  239. post: {
  240. bizId: -1,
  241. bizTypeEk: 'LOWCODE',
  242. dynamicFormId: "474201923419320320",
  243. showModelId: "474382714828959744",
  244. data: {
  245. completion_orders: {
  246. completion_order_no: null,
  247. completion_time: new Date(),
  248. created_by: null,
  249. created_date: null,
  250. employee_id: v.employee_id.toString(),
  251. employee_id_show: v.employee_id_show,
  252. equipment_id: v.equipment_id,
  253. equipment_id_show: v.equipment_id_show,
  254. last_modified_by: null,
  255. last_modified_date: null,
  256. process_id: v.dispatch_orders.process_id,
  257. process_id_show: v.dispatch_orders.process_id_show,
  258. remark: null,
  259. site: null,
  260. team_id: v.team_finish_id,
  261. team_id_show: v.team_id_show
  262. },
  263. completion_orders_dtl: [v]
  264. }
  265. }
  266. }
  267. // this.axios.post('/api/testdwy', { ...data3 }).then(res => {
  268. // if (res.code == 200) {
  269. // this.$Message.success(res.msg)
  270. // // this.$router.push('/cms/home')
  271. // }
  272. // })
  273. const data4Dtil = [];
  274. v.break.forEach(vv => {
  275. if (vv.break_id && vv.break_num) {
  276. v.defective_num = vv.break_num;
  277. v.defective_remark = vv.break_id;
  278. data4Dtil.push(v);
  279. }
  280. })
  281. if (data4Dtil.length > 0) {
  282. const data4 = {
  283. url: 'http://121.36.142.167:7774/jbl/api/module-data/defective_orders/defective_orders',
  284. post: {
  285. bizId: -1,
  286. bizTypeEk: 'LOWCODE',
  287. dynamicFormId: "474139280406949888",
  288. showModelId: "474140935059877888",
  289. data: {
  290. defective_orders: {
  291. defective_order_no: null,
  292. defection_time: new Date(),
  293. created_by: null,
  294. created_date: null,
  295. employee_id: v.employee_id.toString(),
  296. employee_id_show: v.employee_id_show,
  297. equipment_id: v.equipment_id,
  298. equipment_id_show: v.equipment_id_show,
  299. last_modified_by: null,
  300. last_modified_date: null,
  301. process_id: v.dispatch_orders.process_id,
  302. process_id_show: v.dispatch_orders.process_id_show,
  303. site: null,
  304. team_id: v.team_finish_id,
  305. team_id_show: v.team_id_show,
  306. },
  307. defective_orders_dtl: data4Dtil
  308. }
  309. }
  310. }
  311. console.log(JSON.stringify(data4)); return false;
  312. // this.axios.post('/api/testdwy', { ...data3 }).then(res => {
  313. // if (res.code == 200) {
  314. // // this.$Message.success(res.msg)
  315. //
  316. //
  317. // }
  318. // })
  319. }
  320. })
  321. }
  322. }
  323. }
  324. </script>
  325. <style lang="scss" scoped>
  326. /deep/.inp {
  327. background: #032a64 !important;
  328. // opacity: 0.4;
  329. border: none;
  330. color: #fff;
  331. }
  332. ::-webkit-input-placeholder {
  333. color: #ffffff84;
  334. /* 设置占位符文字的颜色 */
  335. }
  336. .defective_products {
  337. display: flex;
  338. justify-content: space-between;
  339. color: #fff;
  340. &>div {
  341. img {
  342. width: 1.2rem;
  343. height: 1.2rem;
  344. }
  345. }
  346. }
  347. .secd_input {
  348. display: flex;
  349. height: 2.06rem;
  350. font-size: 1rem;
  351. color: #FFFFFF;
  352. .secd_input_l {
  353. display: flex;
  354. align-items: center;
  355. width: fit-content;
  356. height: 100%;
  357. }
  358. .secd_input_r {
  359. flex: 1;
  360. input {
  361. width: 100%;
  362. height: 100%;
  363. border-radius: 0.38rem;
  364. border: 0.03rem solid #76CFFF;
  365. background-color: #00000000;
  366. outline: none;
  367. padding: 0 .625rem;
  368. box-sizing: border-box;
  369. color: #fff;
  370. }
  371. }
  372. }
  373. .select_list {
  374. border-radius: 0.38rem;
  375. border: 0.03rem solid #76CFFF;
  376. background-color: #00000000;
  377. outline: none;
  378. padding: 0 .625rem;
  379. box-sizing: border-box;
  380. color: #fff;
  381. width: 100%;
  382. height: 100%;
  383. font-weight: 500;
  384. letter-spacing: 0.1rem;
  385. }
  386. .return_btn {
  387. background-image: url('../../../assets/home/return.png');
  388. background-size: 100% 100%;
  389. }
  390. .confirm_btn {
  391. background-image: url('../../../assets/home/confirm.png');
  392. background-size: 100% 100%;
  393. }
  394. .return_btn,
  395. .confirm_btn {
  396. width: 10.97rem;
  397. height: 3.93rem;
  398. display: flex;
  399. align-items: center;
  400. justify-content: center;
  401. color: #fff;
  402. font-size: 1.06rem;
  403. font-weight: 500;
  404. letter-spacing: 1px;
  405. }
  406. .secd_flex_s>span:nth-child(1) {
  407. font-size: 0.94rem;
  408. color: #ABDFFF;
  409. }
  410. .secd_flex_s>span:nth-child(2) {
  411. font-size: 0.94rem;
  412. color: #03FCD3;
  413. }
  414. .secd_g {
  415. font-size: 1rem;
  416. color: #ABDFFF
  417. }
  418. .secd_title_d {
  419. font-size: 1.13rem;
  420. color: #FFFFFF;
  421. text-shadow: 0px 0px 0px rgba(255, 255, 255, 0.5);
  422. white-space: nowrap;
  423. overflow: hidden;
  424. text-overflow: ellipsis;
  425. }
  426. .secd_flex_w {
  427. display: flex;
  428. justify-content: space-between;
  429. padding-right: 1.6rem;
  430. box-sizing: border-box;
  431. }
  432. .secd_flex {
  433. display: flex;
  434. flex-direction: column;
  435. gap: .375rem;
  436. .secd_title {
  437. font-size: 0.88rem;
  438. color: #ABDFFF;
  439. opacity: 0.5;
  440. }
  441. }
  442. .check_box_c {
  443. width: 1.19rem;
  444. height: 100%;
  445. background-image: url('../../../assets/home/check.png');
  446. background-size: 100% 100%;
  447. }
  448. .check_box_c_active {
  449. width: 1.3rem;
  450. height: 100%;
  451. background-image: url('../../../assets/home/checked.png');
  452. background-size: 100% 100%;
  453. }
  454. .send_work {
  455. background-image: url('../../../assets/home/packUpback.png');
  456. background-size: 100% 100%;
  457. margin-top: 1.38rem;
  458. padding: 0.44rem 0.4rem 1.34rem 1.22rem;
  459. box-sizing: border-box;
  460. .check_box {
  461. height: 1.19rem;
  462. display: flex;
  463. justify-content: right;
  464. }
  465. }
  466. .com_top {
  467. margin-top: 1.72rem !important;
  468. }
  469. .completion_con {
  470. height: 5.19rem;
  471. background-image: url('../../../assets/home/completion.png');
  472. background-size: 100% 100%;
  473. margin-top: 0.72rem;
  474. padding: 1rem 1.28rem;
  475. box-sizing: border-box;
  476. display: flex;
  477. align-items: center;
  478. justify-content: space-between;
  479. }
  480. .home_con_s {
  481. position: relative;
  482. .pack_up {
  483. position: absolute;
  484. top: 0;
  485. left: 50%;
  486. transform: translateX(-50%);
  487. width: 5.56rem;
  488. background-image: url('../../../assets/home/packUp.png');
  489. background-size: 100% 100%;
  490. height: 1.97rem;
  491. display: flex;
  492. align-items: center;
  493. justify-content: center;
  494. img {
  495. width: 2.59rem;
  496. height: 0.88rem;
  497. }
  498. }
  499. .pack_up_d {
  500. top: -1.1rem;
  501. }
  502. .pack_up_con {
  503. height: 14.09rem;
  504. background-image: url('../../../assets/home/packUpback.png');
  505. background-size: 100% 100%;
  506. padding: 1.78rem 2.03rem;
  507. box-sizing: border-box;
  508. .pack_up_name {
  509. height: 1.25rem;
  510. font-size: 1.25rem;
  511. color: #fff;
  512. font-weight: 600;
  513. }
  514. .pack_up_grid {
  515. display: grid;
  516. grid-template-columns: repeat(2, 1fr);
  517. row-gap: .625rem;
  518. &>div {
  519. display: flex;
  520. flex-direction: column;
  521. row-gap: .625rem;
  522. &>div {
  523. display: flex;
  524. gap: .125rem;
  525. span:nth-child(1) {
  526. font-size: 1.63rem;
  527. font-family: DIN-BoldItalic, DIN;
  528. font-weight: 600;
  529. color: #04FFD5;
  530. line-height: 1.31rem;
  531. transform: skewX(-10deg);
  532. text-shadow: 0px 0px 0px rgba(4, 255, 213, 0.23);
  533. }
  534. span:nth-child(2) {
  535. font-size: 1rem;
  536. font-family: PingFangSC-Regular, PingFang SC;
  537. font-weight: 400;
  538. color: #ABDFFF;
  539. }
  540. }
  541. &>p:nth-child(1) {
  542. font-size: 1rem;
  543. font-family: PingFangSC-Regular, PingFang SC;
  544. font-weight: 400;
  545. color: #ABDFFF;
  546. margin-bottom: 0px;
  547. }
  548. }
  549. }
  550. }
  551. }
  552. .home_con_body {
  553. width: 100%;
  554. padding: 1rem;
  555. padding-top: 0px;
  556. box-sizing: border-box;
  557. }
  558. .home_header {
  559. height: 3.125rem;
  560. display: flex;
  561. align-items: center;
  562. justify-content: center;
  563. color: #fff;
  564. font-size: 1.125rem;
  565. font-weight: 600;
  566. }
  567. .home_header_line {
  568. width: 100%;
  569. height: .0625rem;
  570. background-color: #fff;
  571. opacity: 0.2;
  572. }
  573. .content {
  574. height: calc(100% - 5rem);
  575. overflow: auto;
  576. .item {
  577. width: 94%;
  578. position: relative;
  579. left: 3%;
  580. margin: 1.5rem 0;
  581. border-radius: 1rem;
  582. background-color: #fff;
  583. box-shadow: 0.16rem 0.1rem 0.1rem 0.1rem #9d9b9b;
  584. font-size: 0.8rem;
  585. display: flex;
  586. flex-wrap: wrap;
  587. .add {
  588. position: absolute;
  589. width: 1.5rem;
  590. height: 1.5rem;
  591. bottom: -0.5rem;
  592. left: -0.5rem;
  593. display: flex;
  594. align-items: center;
  595. justify-content: center;
  596. font-size: 1.3rem;
  597. border-radius: 50%;
  598. box-shadow: 0.1rem 0.1rem 0.1rem 0rem #777676;
  599. background: #fff;
  600. }
  601. .delete {
  602. width: 1.5rem;
  603. height: 1.5rem;
  604. display: flex;
  605. align-items: center;
  606. justify-content: center;
  607. font-size: 1.3rem;
  608. position: absolute;
  609. top: -0.5rem;
  610. right: -0.5rem;
  611. border-radius: 50%;
  612. box-shadow: 0.1rem 0.1rem 0.1rem 0rem #777676;
  613. background: #fff;
  614. }
  615. .unit {
  616. width: 50%;
  617. padding: 0.5rem;
  618. display: flex;
  619. align-items: center;
  620. label {
  621. width: 30%;
  622. text-align: right;
  623. }
  624. }
  625. }
  626. }
  627. .footer_btn {
  628. display: flex;
  629. justify-content: space-between;
  630. align-items: center;
  631. }
  632. .footer {
  633. display: flex;
  634. justify-content: space-between;
  635. margin-top: 2rem;
  636. }
  637. .boo {
  638. font-size: 2rem;
  639. border-radius: 50%;
  640. width: 2rem;
  641. height: 2rem;
  642. display: flex;
  643. align-items: center;
  644. justify-content: center;
  645. margin: 0.5rem;
  646. border: 0.1rem solid;
  647. }
  648. </style>