details.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div>
  3. <FullPage
  4. title='安装详情'
  5. :list='list'
  6. @init='init'
  7. :logList='logList'
  8. :loading='loading'
  9. @searchData='init'
  10. @changePage='changePage'
  11. @changeSize='changeSize'
  12. @selectTable='selectTable'
  13. :tableColums='tableColums'
  14. :tableData='tableData'
  15. :pageIndex='pageIndex'
  16. :total='total'
  17. >
  18. <div slot='titleButton'>
  19. <Button @click="back" type='primary' ghost style="margin-right:10px;">返回</Button>
  20. <Button @click="confirmSuccess(selects)" type="success" ghost style="margin-right:10px;" >批量完成</Button>
  21. </div>
  22. <template slot-scope="{ row }" slot="set">
  23. <a class="map-margin" v-if='row.sub_state!=3' @click="confirmSuccess(row)">完成</a>
  24. <!-- <span v-else>已完成</span> -->
  25. </template>
  26. </FullPage>
  27. </div>
  28. </template>
  29. <script>
  30. import {mapActions} from 'vuex'
  31. export default {
  32. data(){
  33. return {
  34. list:[
  35. {title:'楼幢',name:'Select',filterable:true,serverName:'house',placeholder:'请选择楼幢',value:'',
  36. option:[
  37. ]
  38. },
  39. {title:'单元',name:'Select',filterable:true,serverName:'unit',placeholder:'请选择单元',value:'',
  40. option:[
  41. {label:1,value:1}
  42. ]
  43. },
  44. {title:'楼层',name:'Select',filterable:true,serverName:'layer',placeholder:'请选择楼层',value:'',
  45. option:[
  46. {label:1,value:1}
  47. ]
  48. },
  49. {title:'房间',name:'Select',filterable:true,serverName:'number_detail',placeholder:'请选择房间',value:'',
  50. option:[
  51. {label:1,value:1}
  52. ]
  53. },
  54. {title:'产品',name:'Select',serverName:'product',placeholder:'请选择产品',value:'',
  55. option:[]
  56. },
  57. {title:'图号',name:'Select',serverName:'url_number',placeholder:'请选择图号',value:'',optionValue: 'url_number', optionName: 'url_number',
  58. option:[]
  59. },
  60. {title:'部件',name:'Select',serverName:'parts',placeholder:'部件',value:'',optionValue: 'title', optionName: 'title',
  61. option:[]} ,
  62. {title:'出库时间',name:'Input',start_server:'start_time',end_server:'end_time',start_value:'',end_value:'',isDate:true,serverName:'id2',start_placeholder:'开始日期',end_placeholder:'结束日期'}
  63. ],
  64. logList:[],
  65. tableColums:[
  66. {type:'selection',align:'center',width:'100',fixed:'left'},
  67. // {title:'订单编号',align:'center',key:'order_no',minWidth:200},
  68. {title:'房号',align:'center',minWidth:100,key:'number_detail',
  69. render:(h,params)=>{
  70. const {row} = params
  71. return h('span',`${row.house}-${row.unit}-${row.layer}-${row.number_detail}`)
  72. }
  73. },
  74. {title:'产品名称',align:'center',minWidth:200,key:'product_title'},
  75. {title:'图号',align:'center',minWidth:200,key:'url_number'},
  76. {title:'部件名称',align:'center',minWidth:200,key:'part_title'},
  77. {title:'位置',align:'center',minWidth:200,key:'position'},
  78. {title:'零部件名称',align:'center',minWidth:200,key:'sub_part_title'},
  79. {title:'芯片编码',align:'center',minWidth:200,key:'tag'},
  80. {title:'是否完成',align:'center',minWidth:200,key:'sub_state',
  81. render:(h,params)=>{
  82. const {row} = params
  83. return h('span',row.sub_state==3?"已完成":"未完成")
  84. }},
  85. {title:'出库时间',align:'center',minWidth:200,key:'dispatch_time',
  86. render:(h,params)=>h('span',{},this.func.replaceDate(params.row.dispatch_time))
  87. },
  88. {title:'运输开始时间',align:'center',minWidth:200,key:'transport_time',
  89. render:(h,params)=>h('span',{},this.func.replaceDate(params.row.transport_time))
  90. },
  91. {title:'实际结束时间',align:'center',minWidth:200,key:'end_time',
  92. render:(h,params)=>h('span',{},this.func.replaceDate(params.row.end_time))
  93. },
  94. {title:'实际运输时间',align:'center',minWidth:200,key:'at_time',
  95. render:(h,params)=>h('span',{},this.func.replaceDate(params.row.transport_time))
  96. },
  97. {title:'操作',align:'center',width:'150',fixed:'right',slot:'set'},
  98. ],
  99. tableData:[],
  100. pageIndex:1,
  101. total:0,
  102. pageSize:10,
  103. loading:false,
  104. selects:[],
  105. selects_out:[],
  106. showStock:false,
  107. info:{
  108. user_id:'',
  109. work_type:2,
  110. order_in_no:'',
  111. start_time:'',
  112. end_time:'',
  113. user_salary:''
  114. },
  115. users:[],
  116. time:''
  117. }
  118. },
  119. created(){
  120. this.getOptions()
  121. },
  122. methods:{
  123. init(row){
  124. this.axios('/api/user').then(res=>this.users = res.data.data)
  125. this.pageIndex = 1
  126. row.page_index = this.pageIndex;
  127. row.page_size = this.pageSize;
  128. if(this.func.isType(row.house) == 'Array'){
  129. row.house = row.house.join(',')
  130. }
  131. if(this.func.isType(row.unit) == 'Array'){
  132. row.unit = row.unit.join(',')
  133. }
  134. if(this.func.isType(row.layer) == 'Array'){
  135. row.layer = row.layer.join(',')
  136. }
  137. if(this.func.isType(row.number_detail) == 'Array'){
  138. row.number_detail = row.number_detail.join(',')
  139. }
  140. if(this.func.isType(row.product) == 'Array'){
  141. row.product = row.product.join(',')
  142. }
  143. Object.assign(row,this.$route.query)
  144. this.proxyObj = row;
  145. this.getData(row)
  146. },
  147. getOptions(){
  148. this.axios('/api/orders_list_detail',{params:{order_no:this.$route.query.order_no,type:this.$route.query.type}})
  149. .then(res=>{
  150. res.data.house.map(v=>{v.value = v.house;v.label = v.house})
  151. res.data.unit.map(v=>{v.value = v.unit;v.label = v.unit})
  152. res.data.layer.map(v=>{v.value = v.layer;v.label = v.layer})
  153. res.data.number_detail.map(v=>{v.value = v.number;v.label = v.number})
  154. res.data.product_title.map(v=>{v.value=v.title,v.label=v.title})
  155. this.list[0].option = res.data.house;
  156. this.list[1].option = res.data.unit;
  157. this.list[2].option = res.data.layer;
  158. this.list[3].option = res.data.number_detail;
  159. this.list[4].option = res.data.product_title;
  160. this.list[5].option = res.data.url_number;
  161. this.list[6].option = res.data.part_title;
  162. })
  163. },
  164. getData(row){
  165. this.loading = true;
  166. this.axios('/api/orders_list_detail',{params:row}).then(res=>{
  167. this.loading = false;
  168. this.tableData = res.data.data;
  169. this.logList = res.data.detail
  170. this.total = res.data.total||0;
  171. })
  172. },
  173. changePage(e){
  174. this.pageIndex = e;
  175. this.proxyObj.page_index = e;
  176. this.getData(this.proxyObj)
  177. },
  178. changeSize(e){
  179. this.pageSize = e;
  180. this.proxyObj.page_size = this.pageSize;
  181. this.getData(this.proxyObj)
  182. },
  183. back(){this.$router.go(-1)},
  184. selectTable(row){
  185. let result = [],outResult = [];
  186. row.map(v=>v.orders_procedure_id ? result.push(v.orders_procedure_id) : '')
  187. this.selects = result
  188. this.selects_out = outResult
  189. },
  190. confirmSuccess(row){
  191. let params = '';
  192. if(!row||row.length<1){return this.$Message.error('请至少选择一项')}
  193. params = Array.isArray(row) ? row.join(',') : row.orders_procedure_id
  194. this.confirmDelete({
  195. title:'确认完成么',
  196. content:'确认完成?',
  197. type:'primary',
  198. then:()=>{
  199. this.axios.post('/api/orders_dispatch_confirm',{orders_procedure_id:params})
  200. .then(res=>{
  201. if(res.code == 200){
  202. this.$Message.success(res.msg);
  203. this.getData(this.proxyObj)
  204. }
  205. })
  206. },
  207. cancel:()=>{
  208. this.$Message.warning('您取消了操作')
  209. }
  210. })
  211. },
  212. }
  213. }
  214. </script>
  215. <style lang="scss" scoped>
  216. </style>