mushencc 3 rokov pred
rodič
commit
70c993a8b1

+ 1 - 1
src/components/loading/index.vue

@@ -8,7 +8,7 @@
             :size="60"
             color="#ff1d5e"
             />
-            <span>玩命加载中</span>
+            <span>正在加载中</span>
         </div>
       </transition>
     </div>

+ 49 - 23
src/views/BidSystem/TotalBoard/detail.vue

@@ -110,14 +110,24 @@
         </Modal>
         <Modal title="板材绘制" v-model="show_sheet" width='100' :mask-closable='false'>
             <div class="sheetCanvas">
-                <div v-for="(item,index) in this.modalSheetData" :key="index" class='sheet_item' :style="{height:(item.measure[1]*1/item.measure[0]*1)*30+'vw',}">
-                <div v-for="(_item,_index) in item.list" :key="_index" class="sheet_part" :style="{
-                    left:(_item[1][0]*1/item.measure[0])*30+'vw',
-                    top:((item.measure[1]-_item[1][1])/item.measure[0])*30+'vw',
-                    width:(Math.abs(_item[3][0]-_item[0][0])/item.measure[0])*30+'vw',
-                    height:(Math.abs(_item[2][1]-_item[0][1])/item.measure[0]*30)+'vw'
+                <div v-for="(item,index) in this.modalSheetData" :key="index" class="sheetContent">
+                 <div class="sheet_title">
+                     <span>分类:{{item.type_title}}</span>
+                     <span>名称:{{item.material_title}}</span>
+                     <span>尺寸:{{item.measure}}</span>
+                     <span>数量:{{item.num}}</span>
+                 </div>
+                 <div class="sheet">
+                <div v-for="(_item,_index) in item.detail" :key="_index" class='sheet_item' :style="{height:(item.measure.split('*')[1]*1/item.measure.split('*')[0]*1)*30+'vw',}">
+                <div v-for="(__item,__index) in _item" :key="__index" class="sheet_part" :style="{
+                    left:(__item[1][0]*1/item.measure.split('*')[0])*30+'vw',
+                    top:((item.measure.split('*')[1]-__item[1][1])/item.measure.split('*')[0])*30+'vw',
+                    width:(Math.abs(__item[3][0]-__item[0][0])/item.measure.split('*')[0])*30+'vw',
+                    height:(Math.abs(__item[2][1]-__item[0][1])/item.measure.split('*')[0]*30)+'vw'
                     }"></div>
                 </div>
+                </div>
+                </div>
             </div>
         </Modal>
     </div>
@@ -204,12 +214,13 @@ export default {
        switch(type){
            case 1:
                this.modalSheetData =[];
-               row.detail.forEach(v=>{
-                   let obj = {};
-                   obj.list=v;
-                   obj.measure =row.measure.split('*');
-                   this.modalSheetData.push(obj)
-               })
+               this.modalSheetData =[row];
+            //    row.detail.forEach(v=>{
+            //        let obj = {};
+            //        obj.list=v;
+            //        obj.measure =row.measure.split('*');
+            //        this.modalSheetData.push(obj)
+            //    })
             //    this.modalSheetMeasure = row.measure.split('*');
                this.show_sheet = true;
                break;
@@ -224,15 +235,15 @@ export default {
            this.axios.post('/api/finance_quota_detail_material_algorithm',{order_no:this.$route.query.order_no,
 	url_number,...this.woolModalData}).then(res=>{
                   this.modalSheetData =[];
-                  res.data.forEach(v=>{
-                       v.detail.forEach(x=>{
-                   let obj = {};
-                   obj.list=x;
-                   obj.measure =v.measure.split('*');
-                   this.modalSheetData.push(obj)
-               })
-                  })
-              
+            //       res.data.forEach(v=>{
+            //            v.detail.forEach(x=>{
+            //        let obj = {};
+            //        obj.list=x;
+            //        obj.measure =v.measure.split('*');
+            //        this.modalSheetData.push(obj)
+            //    })
+            //       })
+              this.modalSheetData = res.data;
             //    this.modalSheetMeasure = row.measure.split('*');
                this.show_sheet = true;
     })
@@ -428,9 +439,20 @@ export default {
     width:100%;
     max-height:70vh;
     overflow: auto;
-    display: flex;
+  
+    .sheetContent{
+        width: 100%;
+        .sheet_title{
+            display: flex;
+            justify-content: space-around;
+            border-bottom:1px solid #d8d7d7;
+            margin-bottom:.3rem
+        }
+    .sheet{
+        width: 100%;
+          display: flex;
     flex-wrap:wrap;
-    .sheet_item{
+            .sheet_item{
         width: 30vw;
         margin-right: 2vw;
         margin-bottom: 2vw;
@@ -442,6 +464,10 @@ export default {
           
         }
     }
+    }
+     
+    }
+   
       
 }
 </style>

+ 1 - 1
src/views/MaterialMannage/index.vue

@@ -19,7 +19,7 @@
                 :headers='headers'
                 :on-error='uploadError'
                 :on-success='uploadSuccess'
-                :action="$store.state.ip+'/api/material_import'">
+                :action="$store.state.ip+'/api/material_imports'">
           <Button type="success"
                   ghost
                   icon='md-exit'

+ 45 - 21
src/views/PackagingStatistics/confirm.vue

@@ -5,22 +5,22 @@
             <Button @click="$router.go(-1)" type="primary">返回</Button>
         </Toptitle>
        <Form :label-width='100' class="form_content">
-           <FormItem label='时间:'>
-               <DatePicker type='date' v-model="searchData.start_time" class="form_item"></DatePicker>~
-               <DatePicker type='date' v-model="searchData.end_time" class="form_item"></DatePicker>
+           <FormItem label='时间:' style="width:350px">
+                <span class="form_item">{{func.replaceDateNoHMS($route.query.start_time).replace(/-/g,'.')}}</span>~
+               <span class="form_item">{{func.replaceDateNoHMS($route.query.end_time*1-86400).replace(/-/g,'.')}}</span>
            </FormItem>
-            <FormItem label='包装班组:'>
+            <FormItem label='包装班组:' style="width:350px">
               <Select v-model="searchData.employee" filterable clearable class="form_item">
-                  <Option :value="1" :label="1"/>
+                  <Option v-for="item in employeeList" :key="item.id" :value="item.id" :label="item.nickname"/>
               </Select>
            </FormItem>
-            <FormItem label='项目名称:'>
+            <FormItem label='项目名称:' style="width:350px">
                   <Select v-model="searchData.project_title" filterable multiple :max-tag-count='1' class="form_item">
-                      <Option :value="1" :label='1'/>
+                     <Option v-for="(item,index) in projectList" :key="index" :value="item" :label="item"/>
                   </Select>
            </FormItem>
             <FormItem :label-width='40'>
-             <Button style="primary" type="primary">搜索</Button>
+             <Button style="primary" type="primary" @click="search">搜索</Button>
            </FormItem>
        </Form>
        <Table :data='tableData' :columns='setTableColumns' border max-height='550' :span-method="handleSpan">
@@ -31,17 +31,18 @@
 export default {
           data(){
               return{
+                proxyData:{},
+                employeeList:[],
+                projectList:[],
                   tableSlice:[],
                   tableData:[
-                      {time:'123',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'}
+                    //   {time:'123',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'}
                   ],
                   tableColumns:[
                       {title:'时间',key:'time',align:'center',minWidth:100}
                   ],
                   otherColumns:[],
                    searchData:{
-                       start_time:'',
-                       end_time:'',
                        project_title:'',
                        employee:''
                    }
@@ -62,6 +63,12 @@ export default {
           },
 
           methods:{
+            search(){
+               let obj = {};
+            obj = JSON.parse(JSON.stringify(this.searchData));
+            this.proxyData = obj;
+            this.initData(obj);
+            },
               handleSpan({ row, column, rowIndex, columnIndex }){
                    if (rowIndex ===this.tableData.length-2 && (columnIndex === 0||columnIndex===this.tableSlice[this.tableSlice.length-1]+1)) {
                     return {
@@ -104,14 +111,21 @@ export default {
                               arr = [1,this.tableSlice[0]] }
                 return arr;
               },
-               initData(){
-                   setTimeout(() => {
-                       let data=[
-                           {title:'包装一组',children:[{title:'项目A',key:'A'},{title:'项目B',key:'B'},{title:'项目C',key:'C'}],total_price:'1750'},
-                           {title:'包装二组',children:[{title:'项目D',key:'D'},{title:'项目E',key:'E'},{title:'项目F',key:'F'}],total_price:'1800'},
-                           {title:'包装三组',children:[{title:'项目G',key:'G'},{title:'项目H',key:'H'},{title:'项目I',key:'I'},{title:'项目j',key:'j'}],total_price:'1900'},
-                       ];
-                       let totalData = {time:'合计',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'};
+               initData(row){
+                   this.axios.post('/api/finance_pack_year',{...this.$route.query,state:'',...row}).then(res=>{
+                       this.otherColumns=[];
+                       this.employeeList = res.data.employee;
+                       this.projectList = res.data.order_list;
+                        let data = res.data.header;
+                       let totalData = res.data.price;
+                       totalData.time='合计';
+                       this.tableData = res.data.list;
+                    //    let data=[
+                    //        {title:'包装一组',children:[{title:'项目A',key:'A'},{title:'项目B',key:'B'},{title:'项目C',key:'C'}],total_price:'1750'},
+                    //        {title:'包装二组',children:[{title:'项目D',key:'D'},{title:'项目E',key:'E'},{title:'项目F',key:'F'}],total_price:'1800'},
+                    //        {title:'包装三组',children:[{title:'项目G',key:'G'},{title:'项目H',key:'H'},{title:'项目I',key:'I'},{title:'项目j',key:'j'}],total_price:'1900'},
+                    //    ];
+                    //    let totalData = {time:'合计',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'};
                        let totalSure = {};
                        let sum = 0;
                        data.forEach(v=>{
@@ -125,10 +139,20 @@ export default {
                                val.align='center';
                                val.minWidth=100;
                                val.render=(h,params)=>{
-                                   const {row} = params;
+                                   const {row,column} = params;
                                    return !row.time?h('span',{},row[val.key]):h('a',{on:{
                                     'click':()=>{
-                                        this.$router.push({path:'/cms/PackagingStatistics/urlNumberDetail',query:{...row}})
+                                        //   let year =  this.func.replaceDateNoHMS(this.$route.query.start_time).split('-')[0]*1;
+                                        //   let month = this.func.replaceDateNoHMS(this.$route.query.start_time).split('-')[1]*1;
+                                        let obj = {};
+                                        // obj.start_time = (new Date(`${year}/${month}/${row.time*1}`).getTime().toString().slice(0,10))*1;
+                                        // obj.end_time = (new Date(`${year}/${month}/${row.time*1}`).getTime().toString().slice(0,10))*1;
+                                        obj.day=row.time;
+                                        obj.employee = column.id;
+                                        obj.order_no = column.order_no;
+                                        obj.employee_title = column.employee;
+                                        obj.project_title = column.title;
+                                        this.$router.push({path:'/cms/PackagingStatistics/urlNumberDetail',query:{...obj,...this.$route.query}})
                                     }
                                    }},row[val.key])
                                }

+ 63 - 23
src/views/PackagingStatistics/detail.vue

@@ -5,22 +5,22 @@
             <Button @click="$router.go(-1)" type="primary">返回</Button>
         </Toptitle>
        <Form :label-width='100' class="form_content">
-           <FormItem label='时间:'>
-               <DatePicker type='date' v-model="searchData.start_time" class="form_item"></DatePicker>~
-               <DatePicker type='date' v-model="searchData.end_time" class="form_item"></DatePicker>
+           <FormItem label='时间:' style="width:350px">
+               <span class="form_item">{{(func.replaceDateNoHMS($route.query.start_time)).replace(/-/g,'.')}}</span>~
+               <span class="form_item">{{(func.replaceDateNoHMS($route.query.end_time)).replace(/-/g,'.')}}</span>
            </FormItem>
-            <FormItem label='包装班组:'>
+            <FormItem label='包装班组:' style="width:350px">
               <Select v-model="searchData.employee" filterable clearable class="form_item">
-                  <Option :value="1" :label="1"/>
+                  <Option v-for="item in employeeList" :key="item.id" :value="item.id" :label="item.nickname"/>
               </Select>
            </FormItem>
-            <FormItem label='项目名称:'>
+            <FormItem label='项目名称:' style="width:350px">
                   <Select v-model="searchData.project_title" filterable multiple :max-tag-count='1' class="form_item">
-                      <Option :value="1" :label='1'/>
+                      <Option v-for="(item,index) in projectList" :key="index" :value="item" :label="item"/>
                   </Select>
            </FormItem>
             <FormItem :label-width='40'>
-             <Button style="primary" type="primary">搜索</Button>
+             <Button style="primary" type="primary" @click="initData(searchData)">搜索</Button>
            </FormItem>
        </Form>
        <Table :data='tableData' :columns='setTableColumns' border max-height='550' :span-method="handleSpan">
@@ -34,17 +34,17 @@
 export default {
           data(){
               return{
+                employeeList:[],
+                projectList:[],
                   tableSlice:[],
                   tableData:[
-                      {time:'123',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'}
+                    //   {time:'123',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'}
                   ],
                   tableColumns:[
                       {title:'时间',key:'time',align:'center',minWidth:100}
                   ],
                   otherColumns:[],
                    searchData:{
-                       start_time:'',
-                       end_time:'',
                        project_title:'',
                        employee:''
                    }
@@ -64,10 +64,38 @@ export default {
           mounted(){
                  this.initData();   
           },
-
           methods:{
               goPage(row){
-           this.$router.push({path:'/cms/PackagingStatistics/confirm',query:{...row}})
+                //   let year =  this.func.replaceDateNoHMS(this.$route.query.start_time).split('-')[0]*1;
+                //   let start_time = this.func.replaceDateNoHMS(this.$route.query.start_time).split('-')[1]*1;
+                //   let end_time =  this.func.replaceDateNoHMS(this.$route.query.end_time).split('-')[1]*1;
+                //   let obj = {};
+                //   console.log(start_time);
+                //   if(row.time*1==start_time&&row.time*1<end_time){
+                //       obj.start_time = this.$route.query.start_time;
+                //       obj.end_time = (new Date(`${year}/${start_time+1}/1`).getTime().toString().slice(0,10))*1;
+                //   }else if(row.time*1>start_time&&row.time*1<end_time){
+                //        obj.start_time = (new Date(`${year}/${row.time}/1`).getTime().toString().slice(0,10))*1;
+                //         obj.end_time = (new Date(`${year}/${row.time+1}/1`).getTime().toString().slice(0,10))*1;
+                //   }else if(row.time*1>start_time&&row.time*1==end_time){
+                //     obj.start_time = (new Date(`${year}/${row.time}/1`).getTime().toString().slice(0,10))*1;
+                //     if(end_time==12&& this.func.replaceDateNoHMS(this.$route.query.end_time).split('-')[2]*1==31){
+                //          obj.end_time = (new Date(`${year+1}/1/1`).getTime().toString().slice(0,10))*1;
+                //     }else{
+                //         obj.end_time = this.$route.query.end_time*1+86400;
+                //     }
+                    
+                //   }else if(row.time*1==start_time&&row.time*1==end_time){
+                //       obj.start_time = this.$route.query.start_time;
+                //       if(end_time==12&& this.func.replaceDateNoHMS(this.$route.query.end_time).split('-')[2]*1==31){
+                         
+                //            obj.end_time = (new Date(`${year+1}/1/1`).getTime().toString().slice(0,10))*1;
+                //       }else{
+                         
+                //          obj.end_time = this.$route.query.end_time*1+86400;
+                //       }
+                //   }
+           this.$router.push({path:'/cms/PackagingStatistics/confirm',query:{...this.$route.query,month:row.time}})
               }, 
               handleSpan({ row, column, rowIndex, columnIndex }){
                    if (rowIndex ===this.tableData.length-2 && (columnIndex === 0||columnIndex===this.tableSlice[this.tableSlice.length-1]+1||columnIndex===this.tableSlice[this.tableSlice.length-1]+2)) {
@@ -111,14 +139,21 @@ export default {
                               arr = [1,this.tableSlice[0]] }
                 return arr;
               },
-               initData(){
-                   setTimeout(() => {
-                       let data=[
-                           {title:'包装一组',children:[{title:'项目A',key:'A'},{title:'项目B',key:'B'},{title:'项目C',key:'C'}],total_price:'1750'},
-                           {title:'包装二组',children:[{title:'项目D',key:'D'},{title:'项目E',key:'E'},{title:'项目F',key:'F'}],total_price:'1800'},
-                           {title:'包装三组',children:[{title:'项目G',key:'G'},{title:'项目H',key:'H'},{title:'项目I',key:'I'},{title:'项目j',key:'j'}],total_price:'1900'},
-                       ];
-                       let totalData = {time:'合计',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'};
+               initData(row){
+                   this.axios.post('/api/finance_pack_year',{...this.$route.query,state:'month',...row}).then(res=>{
+                       this.otherColumns = [];
+                       this.employeeList = res.data.employee;
+                       this.projectList = res.data.order_list;
+                       let data = res.data.header;
+                       let totalData = res.data.price;
+                       totalData.time='合计';
+                       this.tableData = res.data.list;
+                    //    let data=[
+                    //        {title:'包装一组',children:[{title:'项目A',key:'A'},{title:'项目B',key:'B'},{title:'项目C',key:'C'}],total_price:'1750'},
+                    //        {title:'包装二组',children:[{title:'项目D',key:'D'},{title:'项目E',key:'E'},{title:'项目F',key:'F'}],total_price:'1800'},
+                    //        {title:'包装三组',children:[{title:'项目G',key:'G'},{title:'项目H',key:'H'},{title:'项目I',key:'I'},{title:'项目j',key:'j'}],total_price:'1900'},
+                    //    ];
+                    //    let totalData = {time:'合计',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'};
                        let totalSure = {};
                        let sum = 0;
                        data.forEach(v=>{
@@ -132,10 +167,15 @@ export default {
                                val.align='center';
                                val.minWidth=100;
                                val.render=(h,params)=>{
-                                   const {row} = params;
+                                   const {row,column} = params;
                                    return !row.time?h('span',{},row[val.key]):h('a',{on:{
                                     'click':()=>{
-                                        this.$router.push({path:'/cms/PackagingStatistics/urlNumberDetail',query:{...row}})
+                                        let obj = {};
+                                        obj.employee = column.id;
+                                        obj.order_no = column.order_no;
+                                        obj.employee_title=column.employee;
+                                        obj.project_title = column.title;
+                                        this.$router.push({path:'/cms/PackagingStatistics/urlNumberDetail',query:{...this.$route.query,month:row.time,...obj}})
                                     }
                                    }},row[val.key])
                                }

+ 73 - 19
src/views/PackagingStatistics/list.vue

@@ -5,24 +5,24 @@
         </Toptitle>
        <Form :label-width='100' class="form_content">
            <FormItem label='时间:'>
-               <DatePicker type='date' v-model="searchData.start_time" class="form_item"></DatePicker>~
-               <DatePicker type='date' v-model="searchData.end_time" class="form_item"></DatePicker>
+               <DatePicker type='date' v-model="searchData.start_time" class="form_item" placeholder='年/月/日'></DatePicker>~
+               <DatePicker type='date' v-model="searchData.end_time" class="form_item" placeholder='年/月/日'></DatePicker>
            </FormItem>
             <FormItem label='包装班组:'>
               <Select v-model="searchData.employee" filterable clearable class="form_item">
-                  <Option :value="1" :label="1"/>
+                  <Option v-for="item in employeeList" :key="item.id" :value="item.id" :label="item.nickname"/>
               </Select>
            </FormItem>
             <FormItem label='项目名称:'>
                   <Select v-model="searchData.project_title" filterable multiple :max-tag-count='1' class="form_item">
-                      <Option :value="1" :label='1'/>
+                      <Option v-for="(item,index) in projectList" :key="index" :value="item" :label="item"/>
                   </Select>
            </FormItem>
             <FormItem :label-width='40'>
-             <Button style="primary" type="primary">搜索</Button>
+             <Button style="primary" type="primary" @click="search">搜索</Button>
            </FormItem>
        </Form>
-       <Table :data='tableData' :columns='setTableColumns' border max-height='550' :span-method="handleSpan">
+       <Table :data='tableData' :columns='setTableColumns' border max-height='550' :span-method="handleSpan" v-show='tableData.length!=0' @on-cell-click='handleClick'>
   <template slot="set" slot-scope="{row}">
       <a @click="goPage(row)" v-show="row.time!=='合计'">详情</a>
   </template>
@@ -33,9 +33,12 @@
 export default {
           data(){
               return{
+                num:'',
+                employeeList:[],
+                projectList:[],
                   tableSlice:[],
                   tableData:[
-                      {time:'123',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'}
+                    //   {time:'123',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'}
                   ],
                   tableColumns:[
                       {title:'时间',key:'time',align:'center',minWidth:100}
@@ -61,12 +64,46 @@ export default {
                 }
           },
           mounted(){
-                 this.initData();   
+                //  this.initData();   
           },
 
           methods:{
+            handleClick(row,column,data,event){
+               this.num = data;
+            },
+              search(){
+                  if(!this.searchData.start_time||!this.searchData.end_time){
+                      return this.$Message.warning('请将开始时间和结束时间填写完整!')
+                  }
+                let obj = JSON.parse(JSON.stringify(this.searchData));
+                obj.start_time = obj.start_time?Date.parse(obj.start_time).toString().slice(0,10):'';
+                obj.end_time = obj.end_time?Date.parse(obj.end_time).toString().slice(0,10):"";
+                this.initData(obj) 
+              },
               goPage(row){
-           this.$router.push({path:'/cms/PackagingStatistics/detail',query:{...row}})
+                //   (new Date(this.searchData.start_time).getTime().toString().slice(0,10))*1;
+                //   let start_time = new Date(this.searchData.start_time).getFullYear();
+                //   let end_time=new Date(this.searchData.end_time).getFullYear();
+                //   let obj = {};
+                //   if(row.time*1==start_time&&row.time*1<end_time){
+                //       obj.start_time = (new Date(this.searchData.start_time).getTime().toString().slice(0,10))*1;
+                //       obj.end_time = (new Date(`${row.time}/12/31`).getTime().toString().slice(0,10))*1;
+                //       console.log(obj.end_time);
+                //   }else if(row.time*1>start_time&&row.time*1<end_time){
+                //       obj.start_time = (new Date(`${row.time}/1/1`).getTime().toString().slice(0,10))*1;
+                //        obj.end_time = (new Date(`${row.time}/12/31`).getTime().toString().slice(0,10))*1;
+                //   }else if(row.time*1>start_time&&row.time*1==end_time){
+                //        obj.start_time = (new Date(`${row.time}/1/1`).getTime().toString().slice(0,10))*1;
+                //         obj.end_time = (new Date(this.searchData.end_time).getTime().toString().slice(0,10))*1;
+                //   }else if(row.time*1==start_time&&row.time*1==end_time){
+                //        obj.start_time = (new Date(this.searchData.start_time).getTime().toString().slice(0,10))*1;
+                //         obj.end_time = (new Date(this.searchData.end_time).getTime().toString().slice(0,10))*1;
+                //   }
+                let obj ={};
+                obj.start_time = (new Date(this.searchData.start_time).getTime().toString().slice(0,10))*1;
+                obj.end_time = (new Date(this.searchData.end_time).getTime().toString().slice(0,10))*1;
+                obj.year = row.time;
+               this.$router.push({path:'/cms/PackagingStatistics/detail',query:{...obj}})
               }, 
               handleSpan({ row, column, rowIndex, columnIndex }){
                    if (rowIndex ===this.tableData.length-2 && (columnIndex === 0||columnIndex===this.tableSlice[this.tableSlice.length-1]+1||columnIndex===this.tableSlice[this.tableSlice.length-1]+2)) {
@@ -110,14 +147,23 @@ export default {
                               arr = [1,this.tableSlice[0]] }
                 return arr;
               },
-               initData(){
-                   setTimeout(() => {
-                       let data=[
-                           {title:'包装一组',children:[{title:'项目A',key:'A'},{title:'项目B',key:'B'},{title:'项目C',key:'C'}],total_price:'1750'},
-                           {title:'包装二组',children:[{title:'项目D',key:'D'},{title:'项目E',key:'E'},{title:'项目F',key:'F'}],total_price:'1800'},
-                           {title:'包装三组',children:[{title:'项目G',key:'G'},{title:'项目H',key:'H'},{title:'项目I',key:'I'},{title:'项目j',key:'j'}],total_price:'1900'},
-                       ];
-                       let totalData = {time:'合计',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'};
+               initData(row){
+                   this.axios.post('/api/finance_pack_year',{...row,state:'year'}).then(res=>{
+                       this.otherColumns=[];
+                       this.projectList = res.data.order_list;
+                       this.employeeList = res.data.employee;
+                            let data = res.data.header;
+                            let totalData = res.data.price;
+                            totalData.time = '合计';    
+                            this.tableData = res.data.list;  
+                //    });
+                //    setTimeout(() => {
+                    //    let data=[
+                    //        {title:'包装一组',children:[{title:'项目A',key:'A'},{title:'项目B',key:'B'},{title:'项目C',key:'C'}],total_price:'1750'},
+                    //        {title:'包装二组',children:[{title:'项目D',key:'D'},{title:'项目E',key:'E'},{title:'项目F',key:'F'}],total_price:'1800'},
+                    //        {title:'包装三组',children:[{title:'项目G',key:'G'},{title:'项目H',key:'H'},{title:'项目I',key:'I'},{title:'项目j',key:'j'}],total_price:'1900'},
+                    //    ];
+                    //    let totalData = {time:'合计',A:"600",B:'700',C:'800',D:'900',E:'1000',F:'1100',G:"1200",H:'1300',I:"1400",j:'2000',total_price:'5000'};
                        let totalSure = {};
                        let sum = 0;
                        data.forEach(v=>{
@@ -131,10 +177,18 @@ export default {
                                val.align='center';
                                val.minWidth=100;
                                val.render=(h,params)=>{
-                                   const {row} = params;
+                                   const {row,column} = params;
                                    return !row.time?h('span',{},row[val.key]):h('a',{on:{
                                     'click':()=>{
-                                        this.$router.push({path:'/cms/PackagingStatistics/urlNumberDetail',query:{...row}})
+                                        let obj ={};
+                                        obj.employee = column.id;
+                                        obj.order_no = column.order_no;
+                              obj.start_time = (new Date(this.searchData.start_time).getTime().toString().slice(0,10))*1;
+                              obj.end_time = (new Date(this.searchData.end_time).getTime().toString().slice(0,10))*1;
+                              obj.year = row.time
+                            obj.employee_title = column.employee;
+                              obj.project_title = column.title;
+                                        this.$router.push({path:'/cms/PackagingStatistics/urlNumberDetail',query:{...obj}})
                                     }
                                    }},row[val.key])
                                }

+ 36 - 7
src/views/PackagingStatistics/urlNumberDetail.vue

@@ -6,22 +6,22 @@
        </Toptitle>
        <Form class="form_content">
            <FormItem label='时间:' style='width:25%'>
-               <span></span>
+               <span>{{formData.time}}</span>
            </FormItem>
            <FormItem label='包装班组:' style='width:25%'>
-               <span></span>
+               <span>{{$route.query.employee_title}}</span>
            </FormItem>
            <FormItem label='项目名称:' style='width:25%'>
-               <span></span>
+               <span>{{$route.query.project_title}}</span>
            </FormItem>
            <FormItem label='合计(包):' style='width:25%'>
-               <span></span>
+               <span>{{formData.num}}</span>
            </FormItem>
            <FormItem label='图号:' style="width:100%">
-               <Select class="form_item">
-                   <Option/>
+               <Select class="form_item" v-model="searchData.url_number" filterable clearable>
+                   <Option v-for="(item,index) in urlList" :key="index" :value="item" :label="item"/>
                </Select>
-               <Button type="primary">搜索</Button>
+               <Button type="primary" @click="search">搜索</Button>
            </FormItem>
            <FormItem :label-width='40'>
                
@@ -37,6 +37,15 @@
 export default {
     data(){
         return{
+            formData:{
+              num:'',
+              time:'',
+            },
+            searchData:{
+               url_number:''
+            },
+            urlList:[],
+            proxyData:{},
             total:0,
             pageIndex:1,
             pageSize:10,
@@ -47,13 +56,33 @@ export default {
             ]
         }
     },
+    mounted(){
+        this.initData();
+    },
     methods:{
+        search(){
+        let obj ={};
+        obj = JSON.parse(JSON.stringify(this.searchData));
+        this.proxyData = obj;
+        this.initData(obj)
+        },
+        initData(row){
+         this.axios.post('/api/finance_pack_detail',{...this.$route.query,...row}).then(res=>{
+            this.urlList = res.data.url_number;
+            this.formData.time = `20${res.data.start_time}~20${res.data.end_time}`;
+            this.formData.num = res.data.total_price;
+            this.tableData = res.data.data;
+            this.total = res.data.total;
+         })
+        },
         change(e){
            this.pageIndex = e;
+           this.initData(this.proxyData);
         },
         changeSize(e){
                   this.pageSize = e;
                   this.pageIndex=1;
+                  this.initData(this.proxyData);
         }
     }
 }

+ 93 - 22
src/views/ProductionOrderList/InboundForm/details.vue

@@ -25,6 +25,13 @@
         >
          <Button
           v-if="$route.query.type == 4"
+          @click="cancelOut(selectedReturnArr,1)"
+          type="primary"
+          style="margin-right:10px;"
+        >批量撤销发货指令</Button
+        >
+         <Button
+          v-if="$route.query.type == 4"
           @click="totalChangeStack"
           type="primary"
           style="margin-right:10px;"
@@ -126,6 +133,7 @@
           @click="row.order_in_no ? outDelivery(row) : $Message.warning('请先确认包装')">
           发货指令</a
         >
+        <a v-show="row.in_out_value!=0&&row.order_in_no" @click="cancelOut(row,0)">撤销发货指令</a>
       </template>
       <Modal
         class-name="vertical-center-modal"
@@ -496,7 +504,10 @@ export default {
               return h('span',{},this.func.replaceDateNoHMS(row.inb_time))
             }
           },
-           { title: "包装班组", align: "center", minWidth: 100, key: "employee" },
+           { title: "包装班组", align: "center", minWidth: 100, key: "team_id",render:(h,params)=>{
+             const {row} = params;
+             return h('span',{},this.list[14].option.find(v=>(row.team_id==v.value))?this.list[14].option.find(v=>(row.team_id==v.value)).label:'')
+           } },
         {
           title: "操作",
           align: "center",
@@ -579,9 +590,50 @@ export default {
   created() {
     this.getOptions();
      this.axios("/api/employee_list").then((res) => (this.band_list = res.data.data));
+     //获取包装班组
+       this.axios.post('/api/orders_in_employee',{title:'包装'}).then(res=>{
+        this.modalData[0].list = res.data;
+        let arr = [];
+      res.data.forEach(v=>{
+          let obj  ={};
+          obj.value = v.id;
+          obj.label = v.title;
+         arr.push(obj)
+        })
+        this.list[14].option =arr;
+      })
   },
 
   methods: {
+    cancelOut(row,type){
+      let order_in_nos=[];
+        if(type){
+          if(row.length==0){
+            return this.$Message.warning('请先选择数据!')
+          }
+          if(row.filter(v=>(!v.order_in_no||v.in_out_value==0)).length!=0){
+                return this.$Message.warning('有数据不能撤销发货指令!')
+          }
+        row.forEach(v=>{
+          order_in_nos.push(v.order_in_no)
+        })
+      }else{
+         order_in_nos.push(row.order_in_no);
+      }
+      this.confirmDelete(
+        {title:'确认',
+        content:'确认撤销发货吗?',
+        then:()=>{
+          this.axios.post('/api/return_send_instrcuct',{order_no:this.$route.query.order_no,order_in_nos}).then(res=>{
+            if(res.code==200){
+              this.$Message.success(res.msg);
+              this.getData(this.proxyObj);
+            }
+          })
+        }
+        }
+      )
+    },
     stackSure(){
       let tags = [];
          this.selectedReturnArr.forEach(v=>{
@@ -750,7 +802,6 @@ export default {
         this.list[4].option = res.data.product_title;
         this.list[5].option = res.data.url_number;
         this.list[6].option = res.data.part_title;
-        this.list[14].option = [];
         // this.list[7].option = arr;
         console.log(this.list[7]);
       });
@@ -828,9 +879,6 @@ export default {
       if (!row || row.length < 1) {
         return this.$Message.error("请至少选择一项");
       }
-      this.axios.post('/api/orders_in_employee',{title:'包装'}).then(res=>{
-        this.modalData[0].list = res.data;
-      })
       params = Array.isArray(row) ? row.join(",") : row.orders_procedure_id;
       this.confirmDelete({
         title: "包装完成",
@@ -839,9 +887,11 @@ export default {
         formData:this.modalData,
         then: () => {
           this.axios
-            .post("/api/orders_in", { orders_procedure_id: params,employee:this.modalData[0].value,buttress_no:this.modalData[1].value})
+            .post("/api/orders_in", { orders_procedure_id: params,team_id:this.modalData[0].value,buttress_no:this.modalData[1].value})
             .then((res) => {
               if (res.code == 200) {
+                 this.modalData[0].value = '';
+                this.modalData[1].value = '';
                 this.$Message.success(res.msg);
                 this.getData(this.proxyObj);
               }
@@ -884,23 +934,44 @@ export default {
     outShip(row, type) {
       //type 1出库  2运输
       if (type == 3) {
+        // this.confirmDelete({
+        //   title: "包装完成",
+        //   content: "是否确认包装完成",
+        //   type: "primary",
+        //   then: () => {
+        //     console.log(row)
+        //     this.axios
+        //       .post("/api/orders_in", { orders_procedure_id: row.orders_procedure_id })
+        //       .then((res) => {
+        //         if (res.code == 200) {
+        //           this.$Message.success(res.msg);
+        //           this.getData(this.proxyObj);
+        //         }
+        //       });
+        //   },
+        //   cancel: (e) => {},
+        // });
         this.confirmDelete({
-          title: "包装完成",
-          content: "是否确认包装完成",
-          type: "primary",
-          then: () => {
-            console.log(row)
-            this.axios
-              .post("/api/orders_in", { orders_procedure_id: row.orders_procedure_id })
-              .then((res) => {
-                if (res.code == 200) {
-                  this.$Message.success(res.msg);
-                  this.getData(this.proxyObj);
-                }
-              });
-          },
-          cancel: (e) => {},
-        });
+        title: "包装完成",
+        content: "是否确认包装完成",
+        type: "primary",
+        formData:this.modalData,
+        then: () => {
+          this.axios
+            .post("/api/orders_in", { orders_procedure_id: row.orders_procedure_id,team_id:this.modalData[0].value,buttress_no:this.modalData[1].value})
+            .then((res) => {
+              if (res.code == 200) {
+                this.modalData[0].value = '';
+                this.modalData[1].value = '';
+                this.$Message.success(res.msg);
+                this.getData(this.proxyObj);
+              }
+            });
+        },
+        cancel: () => {
+          this.$Message.warning("您取消了包装完成操作");
+        },
+      });
       } else {
         if (!row || row.length < 1) {
           return this.$Message.error("请至少选择一项");

+ 1 - 1
src/views/ProductionOrderList/ProductionPlanlist/BST_two.vue

@@ -722,7 +722,7 @@ export default {
           this.firstEnter++;
           this.tableData = res.data.data;
           let header = [];
-          if(res.data.header.length!=0){
+          if(res.data.header&&res.data.header.length!=0){
               res.data.header.forEach(v=>{
                 let obj = {};
                 obj.title = `${v.title}状态`;

+ 5 - 3
src/views/stack/confirm.vue

@@ -81,13 +81,15 @@ export default {
                 {title:'图号',align:'center',key:'url_number',minWidth:120},
                 {title:'组合名称',align:'center',key:'compose_name',minWidth:120},
                 {title:'部件',align:'center',key:'part_title',minWidth:120},
-                {title:'包装码',align:'center',key:'',minWidth:120},
-                {title:'单位',align:'center',key:'',minWidth:120},
+                {title:'包装码',align:'center',key:'order_in_no',minWidth:120},
                 {title:'包装时间',align:'center',key:'crt_time',minWidth:120,render:(h,params)=>{
                     const {row} = params;
                     return h('span',{},this.func.replaceDateNoHMS(row.crt_time))
                 }},
-                {title:'发货指令时间',align:'center',key:'state',minWidth:120}
+                {title:'发货指令时间',align:'center',key:'send_time',minWidth:120,render:(h,params)=>{
+                   const {row} =params;
+                    return h('span',{},this.func.replaceDateNoHMS(row.send_time))
+                }}
             ]
         }
     },

+ 1 - 1
vue.config.js

@@ -2,7 +2,7 @@ const axios_default_ip =
   process.env.NODE_ENV == "dev"
     ? "http://121.41.102.225:82"
     : process.env.NODE_ENV == "test-prd"
-    ? "http://hxy_api.qingyaokeji.com" //
+    ? "http://121.41.102.225:82" //
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
     : "http://124.71.176.88:882";