mushencc преди 3 години
родител
ревизия
28aa9ac96b

+ 242 - 59
src/views/ChipPrintScreen/ChipPrintScreen.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <Modal v-model="fullscreenModal" fullscreen title="工位屏">
+    <Modal v-model="fullscreenModal" fullscreen title="工位屏" @on-cancel='cancel'>
       <div slot="header">
         <span style="font-size: 0.5rem">工位屏</span>
         <div class="fullscreen-title-btn">
@@ -132,6 +132,17 @@
               </div>
             </div>
           </div>
+           <div class="fullscreen-content-select-block">
+            <Button
+              @click="handleSelectionAll"
+              size="large"
+              type="primary"
+              :ghost='selectedAll?true:false'
+              style="margin-right: 10px"
+            >
+              {{selectedAll?"取消全选":'全选'}}
+            </Button>
+          </div>
         </div>
         <div class="fullscreen-content-choose">
           <div
@@ -427,9 +438,9 @@
       <Modal
         class="selection-print-modal"
         v-model="printModal"
-        title="打印"
         width="60%"
       >
+      <div slot="header" style="text-align:center;font-weight:bold"><h1>打  印</h1></div>
         <div class="selection-print-modal-body">
           <div class="selection-print-modal-body-top">
             <div>
@@ -445,7 +456,7 @@
               <InputNumber
                 :max="selectedObj.un_print==0?selectedObj.on_print:selectedObj.un_print"
                 :min="0"
-                size="large"
+                style="height:1em;font-size:1.5em;line-height:0.9em;width:2rem"
                 @on-focus="handlePrintInput"
                 v-model="selectedObj.print_num"
               ></InputNumber>
@@ -475,7 +486,7 @@
             </div>
           </div>
         </div>
-        <div slot="footer">
+        <div slot="footer" class="selection-print-modal-body-footer">
           <Button
             @click="printModal = false"
             type="primary"
@@ -484,11 +495,15 @@
             返回
           </Button>
           <Button @click="handlePrintComfirm(selectedObj)" type="primary">
-            确认
+            芯片打印
           </Button>
+          <Button @click="Print(selectedObj)" type="primary">
+            标签打印
+          </Button>
+          
         </div>
       </Modal>
-      <Modal
+      <!-- <Modal
         class="selection-print-modal"
         v-model="okModal"
         title="完成"
@@ -542,7 +557,7 @@
             确认
           </Button>
         </div>
-      </Modal>
+      </Modal> -->
       <Modal
         class="selection-modal"
         v-model="roomModal"
@@ -582,9 +597,13 @@
           >
             返回
           </Button>
-          <Button @click="handlePrintComfirm(selectedObj, 1)" type="primary">
-            确认
+           <Button @click="handlePrintComfirm(selectedObj, 1)" type="primary">
+            芯片打印
           </Button>
+          <Button @click="Print(selectedObj, 1)" type="primary">
+            标签打印
+          </Button>
+         
         </div>
       </Modal>
        <Modal
@@ -642,6 +661,15 @@
         </div>
       </Modal>
     </Modal>
+    <div ref='printRow' class="printRow">
+      <div v-for="(item,index) in tagPrintList" :key="index" class="printRow_content" style="width:300px">
+      <div style="display:flex"><span style="width:140px">项目:{{item.client_name}}</span><span>区域:{{item.house ? item.house + "-" : ""}}{{item.layer ? item.layer : ""}}{{item.position ? item.position : ""}}</span></div>
+      <div style="display:flex"><span style="width:140px">房号:{{item.number_detail}}</span><span>产品:{{item.product_title}}</span></div>
+      <div style="display:flex"><span style="width:140px">图号:{{item.url_number}}</span><span>部件:{{item.part_title}}</span></div>
+      <div><span>尺寸:{{item.measure}}</span></div>
+      <div><span>木皮:{{item.color_title}}</span></div>
+      </div>
+    </div>
   </div>
 </template>
 
@@ -658,6 +686,8 @@ export default {
   data() {
     // 这里存放数据
     return {
+      cancelData:[],
+      tagPrintList:[],
     produceID:null,
  employeeID:null,
     rownoList:[],
@@ -708,11 +738,12 @@ export default {
         rows: [],
       },
       page_index: 1,
-      page_size: 6,
+      // page_size: 6,
       total: 0,
       currentSearchValue: "",
       modal_1_page_index: 1,
       modal_1_page_size: 6,
+      selectedAll:false,//true全选;false取消全选
       modal_1_total: 0,
       modal_room_page_index: 1,
       modal_room_page_size: 9,
@@ -734,14 +765,23 @@ export default {
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
+  computed:{
+       page_size(){
+          if(this.isWideScreen){
+            return 12
+          }else{
+            return 6
+          }
+       }
+  },
   created() {},
   beforeRouteEnter(to, from, next) {
     next((vm) => {
       if (from.path == "/cms/ChipPrintScreen/ChipPrintScreenCheck") {
         vm.selectedInfo = JSON.parse(localStorage.getItem("printInfo"));
         vm.getChipDetail();
-      }
-    });
+       vm.handleGetType(JSON.parse(localStorage.getItem("printInfo")).order_no);
+      }})
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
@@ -759,6 +799,69 @@ export default {
     // })
   },
   methods: {
+    handleSelectionAll(){
+        this.selectedAll = !this.selectedAll;
+      if(this.selectedAll){
+        this.contentData.map(v=>{
+          v.isChoosed = true
+        });
+        this.saveData = [];
+      }else{
+        this.contentData.map(v=>{
+          v.isChoosed = false;
+        });
+        this.saveData=[];
+        this.cancelData = [];
+      }
+    },
+    Print(row,type){
+       if (
+        type &&
+        this.modalRoomListSelected.length != this.selectedObj.print_num
+      ) {
+        return this.$Message.warning("与打印数量不符");
+      }
+      let ids = this.modalRoomListSelected.map((v) => {
+        return v.id;
+      });
+      let data = type
+        ? {
+            order_no: this.selectedInfo.order_no,
+            product_id: this.selectedInfo.product_id,
+            rows: this.selectedInfo.rows,
+            num: this.selectedObj.print_num,
+            id: row.id,
+            ids,
+            type,
+          }
+        : {
+            order_no: this.selectedInfo.order_no,
+            product_id: this.selectedInfo.product_id,
+            rows: this.selectedInfo.rows,
+            num: this.selectedObj.print_num,
+            id: row.id,
+          };
+      // 获取打印数据
+      this.axios({
+        method: "post",
+        url: "/api/station_print",
+        data,
+      }).then((resp) => {
+        if (resp.code == 200) {
+          console.log(resp)
+          this.tagPrintList = resp.data;
+          setTimeout(()=>{
+               this.$print(this.$refs.printRow);
+          })
+         
+        }
+        });
+       
+    },
+    cancel(){
+       this.fullscreenModal = false;
+       this.$forceUpdate();
+    },
     focusChange(index){
         this.focusIndex = index;
         this.max = this.rownoList[index].num;
@@ -802,12 +905,28 @@ export default {
           this.$forceUpdate();
       },
       changeChooseProduceList(item){
-
+          let passData={
+             order_no: this.selectedInfo.order_no,
+          product_id: this.selectedInfo.product_id,
+          rows: this.selectedInfo.rows,
+          };
           let produce = item.id;
             let id = [];
-            this.saveData.map(v=>{
-                id.push(v.id)
+            let cancelId = [];
+            if(this.selectedAll){
+                this.cancelData.map(v=>{
+                  cancelId.push(v.id)
+                })
+                 passData.delete_id = cancelId;
+                passData.produce =produce;
+                passData.type =1;  //type1全选状态;
+            }else{
+               this.saveData.map(v=>{
+                id.push(v.id);
             });
+             passData.id = id;
+              passData.produce =produce;
+            }
           this.produceList.map(m=>{
              
               if(m.id==item.id){
@@ -818,7 +937,7 @@ export default {
           })
           console.log(item)
           if(item.isChoosed){
-               this.axios.post('/api/station_get_order_produce',{id,produce}).then(res=>{
+               this.axios.post('/api/station_get_order_produce',{...passData}).then(res=>{
                 if(res.code==200){
                     this.rownoList = res.data;
                     this.produceID = item.id;
@@ -909,14 +1028,28 @@ export default {
         }
         
       }
-      console.log(this.selectedObj)
+      if(this.selectedAll){
+        if(!row.isChoosed){
+        this.cancelData.push(row)
+        }else{
+          this.cancelData.map((v,index)=>{
+            if(v.id == row.id){
+              this.cancelData.splice(index,1)
+            }
+          })
+        }
+      }
+      console.log(this.saveData)
+      console.log(this.cancelData)
       // this.selectedObj = row;
     },
     goCheckPage() {
-      localStorage.setItem("printInfo", JSON.stringify(this.selectedInfo));
+     
+         localStorage.setItem("printInfo", JSON.stringify(this.selectedInfo));
       this.$router.push({
-        path: "/cms/ChipPrintScreen/ChipPrintScreenCheck",
+        path: "/cms/ChipPrintScreen/ChipPrintScreenCheck"
       });
+     
     },
     handleSelectionClick(row, obj) {
       row.list.map((v) => (v.isCurrent = false));
@@ -989,11 +1122,11 @@ export default {
       
       if (this.isWideScreen) {
         this.page_index =1;
-        this.page_size = 12;
+        // this.page_size = 12;
         this.enterWideScreen();
       } else {
         this.page_index =1;
-        this.page_size = 6;
+        // this.page_size = 6;
         this.exitWideScreen();
       }
       this.getChipDetail();
@@ -1084,6 +1217,20 @@ export default {
         }
       });
     },
+    handleGetType(row){
+  this.axios.post('/api/station_get_type',{order_no:row}).then(res=>{
+              if(res.code == 200){
+                  this.employeeList = res.data.employee_list;
+                  this.employeeList.map(item=>{
+                          item.isChoosed = false;
+                  })
+                  this.produceList = res.data.produce_list;
+                  this.produceList.map(item=>{
+                      item.isChoosed = false;
+                  })
+              }
+    })
+    },
     //项目、图号确认
     handleSelectionComfirm(row) {
       console.log(`row`, row);
@@ -1101,18 +1248,7 @@ export default {
                order_no = v.order_no;
           }
         })
-        this.axios.post('/api/station_get_type',{order_no}).then(res=>{
-              if(res.code == 200){
-                  this.employeeList = res.data.employee_list;
-                  this.employeeList.map(item=>{
-                          item.isChoosed = false;
-                  })
-                  this.produceList = res.data.produce_list;
-                  this.produceList.map(item=>{
-                      item.isChoosed = false;
-                  })
-              }
-    })
+       this.handleGetType(order_no);
       } else if (row.type == 2) {
         this.selectedInfo.url_number = this.chooseUrlNo.url_number;
         this.selectedInfo.product_id = this.chooseUrlNo.product_id;
@@ -1141,6 +1277,19 @@ export default {
           console.log(`res`, res);
           res.data.data.map((v) => (v.isChoosed = false));
           this.contentData = res.data.data;
+          if(this.selectedAll){
+            this.contentData.map(v=>{
+              v.isChoosed = true;
+            })
+            this.contentData.map(v=>{
+              this.cancelData.map(m=>{
+                if(v.id == m.id){
+                  v.isChoosed=false;
+                }
+              })
+            })
+          }
+
           this.contentData.map(v=>{
               this.saveData.map(m=>{
                   if(v.id==m.id){
@@ -1247,7 +1396,7 @@ export default {
         // this.finishWork = false;
     },
     handleOk() {
-      if (this.saveData.length==0) {
+      if (this.saveData.length==0&&!this.selectedAll) {
         return this.$Message.warning("请选择数据");
       }
     //   if (this.selectedObj.type == 1 && this.selectedObj.un_print == 0) {
@@ -1277,28 +1426,29 @@ export default {
       this.rownoList = [];
       this.finishWork = false;
     },
-    handleOkComfirm(row) {
-      this.axios({
-        method: "post",
-        url: "/api/station_complete",
-        data: {
-          order_no: this.selectedInfo.order_no,
-          product_id: this.selectedInfo.product_id,
-          rows: this.selectedInfo.rows,
-          num: this.selectedObj.ok_num,
-          id: row.id,
-        },
-      }).then((res) => {
-        if (res.code == 200) {
-          this.okModal = false;
-          this.getChipDetail();
-        }
-      });
-    },
+    // handleOkComfirm(row) {
+    //   this.axios({
+    //     method: "post",
+    //     url: "/api/station_complete",
+    //     data: {
+    //       order_no: this.selectedInfo.order_no,
+    //       product_id: this.selectedInfo.product_id,
+    //       rows: this.selectedInfo.rows,
+    //       num: this.selectedObj.ok_num,
+    //       id: row.id,
+    //     },
+    //   }).then((res) => {
+    //     if (res.code == 200) {
+    //       this.okModal = false;
+    //       this.getChipDetail();
+    //     }
+    //   });
+    // },
     //行号确认
     handleRowNoComfirm() {
       this.selectedInfo.rows = JSON.parse(JSON.stringify(this.chooseLineNo));
       this.selectionRownolModal = false;
+      this.page_index = 1;
       this.getChipDetail();
     },
     onInput(value) {
@@ -1342,19 +1492,19 @@ export default {
     keyboardPrintTap(value) {
       let max = this.selectedObj.on_print + this.selectedObj.un_print;
       this.selectedObj.print_num =
-        (this.selectedObj.print_num ? this.selectedObj.print_num : "") +
+        Number((this.selectedObj.print_num ? this.selectedObj.print_num : "") +
         "" +
-        value;
+        value);
       if (this.selectedObj.print_num * 1 > max) {
         this.selectedObj.print_num = max;
       }
       this.$forceUpdate();
     },
     keyboardPrintDele() {
-      this.selectedObj.print_num = (this.selectedObj.print_num + "").substring(
+      this.selectedObj.print_num = Number((this.selectedObj.print_num + "").substring(
         0,
         this.selectedObj.print_num.length - 1
-      );
+      ));
       this.$forceUpdate();
     },
     keyboardTap(value) {
@@ -1831,8 +1981,6 @@ export default {
       });
     },
   },
-  // 监听属性 类似于data概念
-  computed: {},
   // 监控data中的数据变化
   watch: {},
   beforeCreate() {}, // 生命周期 - 创建之前
@@ -1872,7 +2020,7 @@ export default {
       width: 30%;
     }
     .fullscreen-content-select-block:nth-child(3) {
-      width: 20%;
+      width: 30%;
     }
   }
   .fullscreen-content-choose {
@@ -1992,16 +2140,40 @@ export default {
 }
 .selection-print-modal {
   .selection-print-modal-body {
+    font-size: 0.5rem;
+    height: 4.5rem;
     .selection-print-modal-body-top {
       display: flex;
       justify-content: space-around;
       align-items: center;
       margin: 0.5rem 0;
+      /deep/.ivu-input-number-handler{
+        height: 20.5px;
+      }
+      // /deep/.ivu-input-number-input-warp{
+      //   margin: auto 0;
+      //    /deep/.ivu-input-number-input{
+      //  margin: auto 0;
+      // }
+      // }
     }
     .selection-print-modal-body-info {
       padding-top: 16px;
       border-top: 1px solid #e8eaec;
       text-align: center;
+      button{
+         height: 2em;
+      font-size: 1em;
+      }
+    }
+  }
+  .selection-print-modal-body-footer{
+    height: 1rem;
+    display: flex;
+    justify-content: space-around;
+    button{
+      height: 1.5em;
+      font-size: 3em;
     }
   }
 }
@@ -2060,4 +2232,15 @@ export default {
     background-color: #2d8cf0;
   }
 }
+.printRow{
+  // display: none;
+}
+@media print {
+        .printRow{
+            display: block;
+            width: 100%;
+            .printRow_content{
+              page-break-after: always;
+            }
+        }}
 </style>

+ 27 - 5
src/views/ChipPrintScreen/ChipPrintScreenCheck.vue

@@ -1,5 +1,6 @@
 <template>
-  <Modal v-model="fullscreenModal" fullscreen title="工位屏-补打">
+<div>
+  <Modal v-model="fullscreenModals" fullscreen title="工位屏-补打" @on-cancel='cancel'>
     <div slot="header">
       <span style="font-size: 0.5rem">工位屏-补打</span>
       <div class="fullscreen-title-btn">
@@ -512,7 +513,7 @@
         </Button>
       </div>
     </Modal>
-  </Modal>
+  </Modal></div>
 </template>
 
 <script>
@@ -532,7 +533,7 @@ export default {
       show2: false,
       show3: false,
       isFullScreen: false,
-      fullscreenModal: true,
+      fullscreenModals: true,
       selectionModal: false,
       selectionRownolModal: false,
       selectionDetailModal: false,
@@ -566,7 +567,7 @@ export default {
         rows: [],
       },
       page_index: 1,
-      page_size: 6,
+      // page_size: 6,
       total: 0,
       currentSearchValue: "",
       modal_1_page_index: 1,
@@ -597,6 +598,10 @@ export default {
     this.getChipDetail();
   },
   methods: {
+     cancel(){
+       this.fullscreenModals = false;
+       this.$forceUpdate();
+    },
     back() {
       this.$router.go(-1);
     },
@@ -874,6 +879,9 @@ export default {
     },
     // 获取具体详情
     getChipDetail() {
+      if(!this.selectedInfo.order_no&&!this.selectedInfo.product_id){
+        return
+      }else{
       this.axios({
         method: "post",
         url: "/api/station_get_order_on_product_pr",
@@ -892,6 +900,7 @@ export default {
           this.total = res.data.total;
         }
       });
+      }
     },
     handlePrint() {
       if (!this.selectedObj.isChoosed) {
@@ -940,6 +949,7 @@ export default {
           this.axios.get("/api/get_print_local_url").then((res) => {
             console.log(res);
             if (res.code == 200) {
+
               if (res.data.state) {
                 this.handlePrintChipsUsb(resp.data, res.data.type);
               } else {
@@ -947,6 +957,10 @@ export default {
               }
             }
           });
+          this.modalRoomList.map((v) => {
+        v.isCurrent = false;
+      });
+      this.modalRoomListSelected = [];
           this.printModal = false;
           this.roomModal = false;
         }
@@ -1472,7 +1486,15 @@ export default {
     },
   },
   // 监听属性 类似于data概念
-  computed: {},
+  computed: {
+     page_size(){
+          if(this.isWideScreen){
+            return 12
+          }else{
+            return 6
+          }
+       }
+  },
   // 监控data中的数据变化
   watch: {},
   beforeCreate() {}, // 生命周期 - 创建之前

+ 1 - 1
src/views/MountOrder/details.vue

@@ -59,7 +59,7 @@ export default {
                  {title:'图号',name:'Select',serverName:'url_number',placeholder:'请选择图号',value:'',optionValue: 'url_number', optionName: 'url_number',
                     option:[]
                 },
-                {title:'部件',name:'Select',serverName:'parts',placeholder:'部件',value:'',optionValue: 'title', optionName: 'title',
+                {title:'部件',name:'Select',serverName:'part',placeholder:'部件',value:'',optionValue: 'title', optionName: 'title',
                 option:[]} ,
                 {title:'出库时间',name:'Input',start_server:'start_time',end_server:'end_time',start_value:'',end_value:'',isDate:true,serverName:'id2',start_placeholder:'开始日期',end_placeholder:'结束日期'}
             ],

+ 69 - 1
src/views/ProductionOrderList/InboundForm/details.vue

@@ -23,6 +23,13 @@
           style="margin-right:10px;"
           >批量退回</Button
         >
+          <Button
+          v-if="$route.query.type == 4"
+          @click="inbound"
+          type="primary"
+          style="margin-right:10px;"
+          >包装统计</Button
+        >
         <Button @click="back" type="primary" ghost style="margin-right:10px;"
           >返回</Button
         >
@@ -148,6 +155,27 @@
         </Form>
       </Modal>
     </FullPage>
+    <Modal  
+       class-name="vertical-center-modal-inbound"
+        width="600"
+      :closable='false'
+        v-model="showInbound"
+        >
+   <div slot="header"><span>包装统计</span><span style="float:right">合计{{inboundVal}}包</span></div>
+   <Table
+   :data='inboundTableData'
+   border
+  max-height='500'
+   :columns="inboundColum">
+</Table>
+<div slot="footer" style="text-align:center">
+  <Button type="primary" @click="showInbound=false" long style="width:30%">
+    返回
+  </Button>
+</div>
+<Page :total="inboundTotal" prev-text="上一页" next-text="下一页" @on-change='changeIndex' @on-page-size-change='changeSizeIN' :page-size-opts='[10,20,30,100,1000]' 
+       :show-sizer='true' style="text-align:center;margin-top:10px"/>
+    </Modal>
   </div>
 </template>
 
@@ -156,6 +184,21 @@ import { mapActions } from "vuex";
 export default {
   data() {
     return {
+      inboundVal:0,
+      inboundTotal:0,
+      inboundPageSize:10,
+      inboundPageIndex:1,
+      inboundTableData:[],
+      inboundColum:[
+             {title: "房间号",
+          align: "center",
+          minWidth: 200,
+          key: "room_number"},
+        {title: "包装数",
+        align: "center",
+        minWidth: 200,
+        key: "num",}
+      ],
       list: [
         {
           title: "楼幢",
@@ -343,6 +386,7 @@ export default {
       ],
       tableData: [],
       pageIndex: 1,
+      showInbound:false,
       total: 0,
       pageSize: 10,
       loading: false,
@@ -412,6 +456,29 @@ export default {
   },
 
   methods: {
+    getInboundData(){
+       this.axios.get('/api/orders_list_detail_census',{params:{
+         page_size:this.inboundPageSize,
+         page_index:this.inboundPageIndex,
+         order_no:this.$route.query.order_no,
+         type:this.$route.query.type}}).then(res=>{
+               this.inboundTableData = res.data.data;
+              this.inboundTotal = res.data.total;
+              this.inboundVal = res.data.total_num;
+         })
+    },
+    changeIndex(e){
+          this.inboundPageIndex = e;
+          this.getInboundData();
+    },
+    changeSizeIN(e){
+       this.inboundPageSize = e;
+       this.getInboundData();
+    },
+    inbound(){
+      this.showInbound=true;
+      this.getInboundData();
+    },
       outDelivery(row){
          this.info.order_in_no = Array.isArray(row)
         ? row.join(",")
@@ -666,4 +733,5 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+</style>