|
@@ -0,0 +1,232 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <FullPage
|
|
|
+ title='查看详情'
|
|
|
+ :showTopSearch='false'
|
|
|
+ :logList='logList'
|
|
|
+ @selectTable='selectTable'
|
|
|
+ @changePage='changePage'
|
|
|
+ @changeSize='changeSize'
|
|
|
+ :tableColums='tableColums'
|
|
|
+ :tableData='tableData'
|
|
|
+ :pageIndex='pageIndex'
|
|
|
+ :pageSize='pageSize'
|
|
|
+ :total='total'
|
|
|
+ >
|
|
|
+ <div slot='titleButton'>
|
|
|
+ <Button @click="back" style="margin-right:10px;">返回</Button>
|
|
|
+ <Button @click="batchPrint" type="primary" style="margin-right:10px;" ghost>打印派工单</Button>
|
|
|
+ <Button @click="del(selectIds,2)" type="error" style="margin-right:10px;" ghost>批量删除</Button>
|
|
|
+ <Button @click="finish(selectIds,1)" type="success" ghost>批量完成</Button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template slot='set' slot-scope='{row}'>
|
|
|
+ <div>
|
|
|
+ <a v-if="row.sub_state<3" class="map-margin" style="color:#32C800" @click="finish(row,1)">完成</a>
|
|
|
+ <a class="map-margin" style="color:#ed4014" @click="del(row,1)">删除</a>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </FullPage>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ form_modal:{
|
|
|
+ nickname:[],
|
|
|
+ user_id:'',
|
|
|
+ rework_reason:'',
|
|
|
+ id:[],
|
|
|
+ procedure:[],
|
|
|
+ procedure_title:[],
|
|
|
+ },
|
|
|
+ type:1,
|
|
|
+ logList:[{title:'系统单号',value:'10998765'}],
|
|
|
+ tableColums:[
|
|
|
+ {type:'selection',fixed:'left',width:'90',align:'center'},
|
|
|
+ {title:'房间号',align:'center',key:'number_detail',minWidth:150,
|
|
|
+ render:(h,params)=>{
|
|
|
+ const {row} = params
|
|
|
+ return h('span',`${row.house}-${row.unit}-${row.layer}-${row.number_detail}`)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title:'产品',align:'center',minWidth:150,key:'product_title'},
|
|
|
+ {title:'位置',align:'center',minWidth:150,key:'position'},
|
|
|
+ {title:'部件',align:'center',minWidth:150,key:'part_title'},
|
|
|
+ {title:'零部件',align:'center',minWidth:150,key:'part_detail_title'},
|
|
|
+ {title:'部件是否贴标签',align:'center',minWidth:150,
|
|
|
+ render:(h,params)=>h('span',{},params.row.label == '1' ? '是' : '否')
|
|
|
+ },
|
|
|
+ // {title:'贴标签零部件',align:'center',minWidth:150,key:'sub_part'},
|
|
|
+ {title:'工序分类',align:'center',minWidth:150,key:'basic_title'},
|
|
|
+ {title:'工序',align:'center',minWidth:150,key:'procedure_title'},
|
|
|
+ {title:'班组',align:'center',minWidth:150,key:'nickname'},
|
|
|
+ {title:'测量尺寸',align:'center',minWidth:150,key:'measure'},
|
|
|
+ {title:'单位',align:'center',minWidth:100,key:'company'},
|
|
|
+ {title:'芯片编号',align:'center',minWidth:150,key:'chip'},
|
|
|
+ {title:'完工状态',align:'center',minWidth:100,
|
|
|
+ render:(h,params)=>h('span',{},params.row.sub_state == 3 ? '已完工' : '未完工')
|
|
|
+ },
|
|
|
+ {title:'操作',align:'center',slot:'set',fixed:'right',width:'150'},
|
|
|
+ ],
|
|
|
+ tableData:[],
|
|
|
+ pageIndex:1,
|
|
|
+ pageSize:10,
|
|
|
+ total:0,
|
|
|
+ selectIds:[],
|
|
|
+ tag:[],
|
|
|
+ produce_id:[],
|
|
|
+ id:[],
|
|
|
+ modal8:false,
|
|
|
+ proxyObj:{...this.$route.query},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ this.getData(this.$route.query)
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ del(row,type){
|
|
|
+ switch(type){
|
|
|
+ case 1:
|
|
|
+
|
|
|
+ let id = [];
|
|
|
+ id.push(row.id)
|
|
|
+ console.log(this.tableData)
|
|
|
+
|
|
|
+ this.confirmDelete({
|
|
|
+ content: "确认删除么?",
|
|
|
+ then: () => {
|
|
|
+ this.axios
|
|
|
+ .post("/api/orders_rework_del", {
|
|
|
+ order_no:this.logList[0].value,
|
|
|
+ produce_id:this.produce_id,
|
|
|
+ id:id
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.getData({order_no:this.logList[0].value,
|
|
|
+ produce_id:this.produce_id
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ if(row.length == 0){
|
|
|
+ this.$Message.error('请选择要删除的产品')
|
|
|
+ }else{ this.confirmDelete({
|
|
|
+ content: "确认删除么?",
|
|
|
+ then: () => {
|
|
|
+ this.axios
|
|
|
+ .post("/api/orders_rework_del", {
|
|
|
+ order_no:this.logList[0].value,
|
|
|
+ produce_id:this.produce_id,
|
|
|
+ id:this.id
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.getData({order_no:this.logList[0].value,
|
|
|
+ produce_id:this.produce_id});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });}
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ back(){
|
|
|
+ this.$router.go(-1)
|
|
|
+ },
|
|
|
+ getData(row){
|
|
|
+ row.page_size = this.pageSize
|
|
|
+ row.page_index = this.pageIndex
|
|
|
+ this.axios('/api/orders_rework_detail',{params:row}).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.tableData = res.data.list;
|
|
|
+ this.logList = res.data.detail;
|
|
|
+ this.total = res.data.total;
|
|
|
+ this.produce_id = res.data.produce_id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ postData(data,type){
|
|
|
+ let url = type == 1 ? '/api/orders_dispatch_confirm' : '/api/orders_plan_cancer'
|
|
|
+ this.axios.post(url,data).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ this.getData(this.$route.query)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ finish(row,type){
|
|
|
+ if(!row||row.length<1){return this.$Message.warning('请至少选择一项')}
|
|
|
+ let str = Array.isArray(row) ? row.join(',') : row.id
|
|
|
+ this.confirmDelete({
|
|
|
+ content:type == 1 ? '是否手动操作此订单生产完成' : '确认驳回?',
|
|
|
+ title:type == 1 ? '生产完成' : '驳回',
|
|
|
+ type:type == 1 ? 'primary' : 'error',
|
|
|
+ then:()=>{
|
|
|
+ this.postData({id:str},type)
|
|
|
+
|
|
|
+ },
|
|
|
+ cancel:()=>{}
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectTable(e){
|
|
|
+
|
|
|
+ let id = [];
|
|
|
+ let result = [];
|
|
|
+ e.map(v=>{
|
|
|
+ result.push(v.id)
|
|
|
+ id.push(v.id)
|
|
|
+ });
|
|
|
+ this.selectIds = result;
|
|
|
+ this.id =id;
|
|
|
+ console.log(this.id);
|
|
|
+ },
|
|
|
+ changePage(e){
|
|
|
+ this.pageIndex = e;
|
|
|
+ this.proxyObj.page_index = this.pageIndex;
|
|
|
+ this.getData(this.proxyObj)
|
|
|
+ },
|
|
|
+ changeSize(e){
|
|
|
+ this.pageSize = e;
|
|
|
+ this.proxyObj.page_size = this.page_size;
|
|
|
+ this.getData(this.proxyObj)
|
|
|
+ },
|
|
|
+ batchPrint(){
|
|
|
+ this.confirmForm({
|
|
|
+ title:'批量打印派工单',
|
|
|
+ forms:[
|
|
|
+ {name:'Select',title:'模板',value:'',serverName:'template_id',placeholder:'请选择模板',
|
|
|
+ option:[
|
|
|
+ {label:'木工',value:1},
|
|
|
+ {label:'开料',value:2},
|
|
|
+ {label:'贴皮',value:3},
|
|
|
+ {label:'油漆',value:4},
|
|
|
+ {label:'接、拼板',value:6}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ then:(result)=>{
|
|
|
+ this.axios('/api/produce_export',{params:{...result,...this.$route.query}}).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
|
|
|
+ location.href = url
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.log-list{display: flex;flex-wrap:wrap;padding:10px 0;}
|
|
|
+</style>
|