details.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div>
  3. <FullPage
  4. title='查看详情'
  5. :showTopSearch='false'
  6. :logList='logList'
  7. @selectTable='selectTable'
  8. @changePage='changePage'
  9. @changeSize='changeSize'
  10. :tableColums='tableColums'
  11. :tableData='tableData'
  12. :pageIndex='pageIndex'
  13. :pageSize='pageSize'
  14. :total='total'
  15. >
  16. <div slot='titleButton'>
  17. <Button @click="back" style="margin-right:10px;">返回</Button>
  18. <Button @click="batchPrint" type="primary" style="margin-right:10px;" ghost>打印派工单</Button>
  19. <Button @click="finish(selectIds,2)" type="error" style="margin-right:10px;" ghost>批量驳回</Button>
  20. <Button @click="finish(selectIds,1)" type="success" ghost>批量完成</Button>
  21. </div>
  22. <template slot='set' slot-scope='{row}'>
  23. <div>
  24. <a v-if="row.sub_state<3" class="map-margin" style="color:#32C800" @click="finish(row,1)">完成</a>
  25. <a v-if="row.sub_state<3" class="map-margin" style="color:#ed4014" @click="finish(row,2)">驳回</a>
  26. </div>
  27. </template>
  28. </FullPage>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. data(){
  34. return {
  35. type:1,
  36. logList:[{title:'系统单号',value:'10998765'}],
  37. tableColums:[
  38. {type:'selection',fixed:'left',width:'90',align:'center'},
  39. {title:'房间号',align:'center',key:'number_detail',minWidth:150,
  40. render:(h,params)=>{
  41. const {row} = params
  42. return h('span',`${row.house}-${row.unit}-${row.layer}-${row.number_detail}`)
  43. }
  44. },
  45. {title:'产品',align:'center',minWidth:150,key:'product_title'},
  46. {title:'位置',align:'center',minWidth:150,key:'position'},
  47. {title:'部件',align:'center',minWidth:150,key:'part_title'},
  48. {title:'零部件',align:'center',minWidth:150,key:'part_detail_title'},
  49. {title:'部件是否贴标签',align:'center',minWidth:150,
  50. render:(h,params)=>h('span',{},params.row.label == '1' ? '是' : '否')
  51. },
  52. {title:'贴标签零部件',align:'center',minWidth:150,key:'sub_part'},
  53. {title:'工序分类',align:'center',minWidth:150,key:'basic_title'},
  54. {title:'工序',align:'center',minWidth:150,key:'procedure_title'},
  55. {title:'班组',align:'center',minWidth:150,key:'nickname'},
  56. {title:'测量尺寸',align:'center',minWidth:150,key:'measure'},
  57. {title:'单位',align:'center',minWidth:100,key:'company'},
  58. {title:'芯片编号',align:'center',minWidth:150,key:'chip'},
  59. {title:'完工状态',align:'center',minWidth:100,
  60. render:(h,params)=>h('span',{},params.row.sub_state == 3 ? '已完工' : '未完工')
  61. },
  62. {title:'操作',align:'center',slot:'set',fixed:'right',width:'150'},
  63. ],
  64. tableData:[],
  65. pageIndex:1,
  66. pageSize:10,
  67. total:0,
  68. selectIds:[],
  69. proxyObj:{...this.$route.query},
  70. }
  71. },
  72. mounted(){
  73. this.getData(this.$route.query)
  74. },
  75. methods:{
  76. back(){
  77. this.$router.go(-1)
  78. },
  79. getData(row){
  80. row.page_size = this.pageSize
  81. row.page_index = this.pageIndex
  82. this.axios('/api/orders_dispatch_detail',{params:row}).then(res=>{
  83. if(res.code == 200){
  84. this.tableData = res.data.list;
  85. this.logList = res.data.detail;
  86. this.total = res.data.total
  87. }
  88. })
  89. },
  90. postData(data,type){
  91. let url = type == 1 ? '/api/orders_dispatch_confirm' : '/api/orders_plan_cancer'
  92. this.axios.post(url,data).then(res=>{
  93. if(res.code == 200){
  94. this.$Message.success(res.msg);
  95. this.getData(this.$route.query)
  96. }
  97. })
  98. },
  99. finish(row,type){
  100. if(!row||row.length<1){return this.$Message.warning('请至少选择一项')}
  101. let str = Array.isArray(row) ? row.join(',') : row.id
  102. this.confirmDelete({
  103. content:type == 1 ? '是否手动操作此订单生产完成' : '确认驳回?',
  104. title:type == 1 ? '生产完成' : '驳回',
  105. type:type == 1 ? 'primary' : 'error',
  106. then:()=>{
  107. this.postData({id:str},type)
  108. },
  109. cancel:()=>{}
  110. })
  111. },
  112. selectTable(e){
  113. let result = [];
  114. e.map(v=>result.push(v.id));
  115. this.selectIds = result;
  116. },
  117. changePage(e){
  118. this.pageIndex = e;
  119. this.proxyObj.page_index = this.pageIndex;
  120. this.getData(this.proxyObj)
  121. },
  122. changeSize(e){
  123. this.pageSize = e;
  124. this.proxyObj.page_size = this.page_size;
  125. this.getData(this.proxyObj)
  126. },
  127. batchPrint(){
  128. this.confirmForm({
  129. title:'批量打印派工单',
  130. forms:[
  131. {name:'Select',title:'模板',value:'',serverName:'template_id',placeholder:'请选择模板',
  132. option:[
  133. {label:'木工',value:1},
  134. {label:'开料',value:2},
  135. {label:'贴皮',value:3},
  136. {label:'油漆',value:4},
  137. {label:'接、拼板',value:6}
  138. ]
  139. },
  140. ],
  141. then:(result)=>{
  142. this.axios('/api/produce_export',{params:{...result,...this.$route.query}}).then(res=>{
  143. if(res.code == 200){
  144. let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
  145. location.href = url
  146. }
  147. })
  148. }
  149. })
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .log-list{display: flex;flex-wrap:wrap;padding:10px 0;}
  156. </style>