Browse Source

限定领料功能添加

asd26269546 2 năm trước cách đây
mục cha
commit
fa9f017fa4

+ 88 - 4
src/components/my-modal-form/my-modal-material.vue

@@ -57,7 +57,7 @@
             <div class="title">
               已选物料
             </div>
-            <div class="main">
+            <div class="main table-3">
               <my-table
                   ref="cfmTable"
                   :key="renderKey"
@@ -65,8 +65,21 @@
                   :columns="columns2"
                   :is-show-page="false"
                   :is-show-filter="false"
+                  style="height:auto"
                 >
               </my-table>
+              <ul>
+                <li v-for="(i,index) in restrictedPickingData" :key="index">
+                  <div style="width:30%">
+                    <span class="cl-blue">推荐卷</span><br>
+                    <span>长度</span>{{i.quantity}}m
+                  </div>
+                  <div>
+                    <span>标签值</span>{{i.rfidCode}}<br>
+                    <span>位置</span>{{i.areaName || '暂未绑定位置'}}
+                  </div>
+                </li>
+              </ul>
             </div>
           </div>
         </div>
@@ -85,6 +98,7 @@ import {
 } from '@/api/integrated'
 import MyTable from '@/components/my-table/my-table'
 import MyNumberBoardInput from '@/components/my-number-board-input/my-number-board-input'
+import axios from 'axios'
 
 export default {
   name: 'material_maintenance',
@@ -201,7 +215,21 @@ export default {
         {
           title: '物料名称',
           key: 'name',
-          minWidth: 150
+          minWidth: 200,
+          render:(h,p)=>{
+            return h('div',[
+              h('span',{
+                style:{
+                  padding:'5px',
+                  background:"red",
+                  margin:"0 5px",
+                  borderRadius:"5px",
+                  color:"#fff"
+                },
+              },'限'),
+              h('span',{},p.row.name)
+            ])
+          }
         },
         {
           title: '排班面积',
@@ -265,10 +293,38 @@ export default {
       data2: [],
       handleData: [],
       checkedList: [],
-      renderKey: new Date().getTime()
+      renderKey: new Date().getTime(),
+      restrictedPickingData:[]
     }
   },
   methods: {
+    //查询限定领料
+    getRestrictedPicking(){
+      const v = this
+      axios.post('/cloudApi/stockDetail/restrictedPicking',{jobNo:window.localStorage.getItem('jobNo')}).then(res=>{
+        for (let i = 0; i < res.data.data.length; i++) {
+          const element = res.data.data[i];
+          this.data2.push({
+            name:element.materialName,
+            canTakeQty:element.availableArea,
+            icon:"xian"
+          })
+          this.data.push({
+            name:element.materialName,
+            stockQty:element.totalArea,
+            width:element.materialWidth,
+            canTakeQty:element.quantity || '未匹配到合适的物料',
+            _checked:true,
+            _disabled: true,
+            bgRed:true,
+          })
+        }
+
+        v.restrictedPickingData = res.data.data
+        
+        console.log(res)
+      })
+    },
     handlePageChange () {
       let arr = []
       this.handleData.forEach(item => {
@@ -343,7 +399,7 @@ export default {
     cfm () {
       // this.$refs.table.clear()
       // this.modal = false
-      this.$emit('getselectedList', this.handleData)
+      this.$emit('getselectedList', this.handleData,this.restrictedPickingData)
       console.log(this.handleData)
     },
     cancel () {
@@ -357,6 +413,7 @@ export default {
         }
       })
     },
+    
     getList () {
       this.params.jobNo = window.localStorage.getItem('jobNo')
       GetV3PlanData2(this.params).then(res => {
@@ -368,6 +425,7 @@ export default {
             item.name = item.materialName
             item.code = item.materialCode
           })
+          this.getRestrictedPicking()
           this.handlePageChange()
           console.log('??????????')
           console.log(this.data)
@@ -474,11 +532,37 @@ export default {
   mounted () {
     this.getList()
     this.getTree()
+    
   }
 }
 </script>
 
 <style lang="scss" scoped>
+.table-3 .table-content{
+  height: auto!important;
+  
+}
+.table-3{
+  ul{
+    color: #6E6E6E;
+    li{
+      background: #FFE7E7;
+      border-bottom: 1px solid #DDDCDC;
+      display: flex;
+      text-align: left;
+      padding: 0 10px;
+      line-height: 30px;
+      span{
+        display: inline-block;
+        width: 50px;
+      }
+      .cl-blue{
+        color: #0268FF;
+        font-weight: bold;
+      }
+    }
+  }
+}
 .container-wrap {
   width: 100%;
   height: 100%;

+ 13 - 1
src/components/my-table/my-table.vue

@@ -171,13 +171,17 @@ export default {
   },
   methods: {
     rowClassName (row, index) {
+      if(row.bgRed == true)
+        return 'select-row-bg-red'
       if (index === this.selectRow) {
         return 'select-row-bg'
       }
-      return ''
+      
     },
     rowClick (row, index) {
       this.selectRow = index
+      
+      if(row._disabled) return
       this.$refs.table.toggleSelect(index)
     },
     /* 给检索框设置绑定一个值 */
@@ -419,4 +423,12 @@ export default {
     background: transparent;
   }
 }
+
+/deep/ .select-row-bg-red {
+  background: #ebf7ff;
+  td {
+    background: #FFE7E7;
+    color:#6E6E6E;
+  }
+}
 </style>

+ 22 - 10
src/views/store-out-list.vue

@@ -32,27 +32,39 @@ export default {
     helperHandle (data) {
       this.otherData = data
     },
-    getselectedList (data) {
-      ApplyTakeAdd({
-        materialList: data.map(item => {
-          return {
-            materialCode: item.code,
-            takeQty: item.quantity
-          }
+
+    getselectedList (data,newData) {
+      const materialList = []
+      for (let i = 0; i < data.length; i++) {
+        const element = data[i];
+        materialList.push({
+          materialCode: element.code,
+          takeQty: element.quantity
         })
+      }
+      for (let i = 0; i < newData.length; i++) {
+        const element = newData[i];
+        materialList.push({
+          materialCode: element.materialCode,
+          takeQty: element.quantity
+        })
+      }
+      ApplyTakeAdd({
+        materialList: materialList
       }).then(res => {
         if (res.code === 0) {
           this.$Message.success(res.msg || '领料成功!')
-          this.handle(data)
+          this.handle(data,newData)
         }
       })
     },
-    handle(data) {
+    handle(data,newData) {
       this.$router.replace({
         name: 'store-out',
         query: {
           data: JSON.stringify(data),
-          otherData: JSON.stringify(this.otherData)
+          otherData: JSON.stringify(this.otherData),
+          newData:JSON.stringify(newData)
         }
       })
     }

+ 2 - 0
src/views/store-out-old.vue

@@ -119,6 +119,8 @@ export default {
           this.scanData = {}
         }, 500)
       } else if (type === 1) {
+        console.log(this.data.inOutStorageNo)
+        return
         // 出库
         PlcStorageOut({
           inOutStorageNo: this.data.inOutStorageNo,

+ 45 - 1
src/views/store-out.vue

@@ -59,6 +59,29 @@
 										</div>
 									</div>
 								</div>
+								<!-- <div
+									class="row"
+									v-for="(item) in newData"
+									:key="item.id"
+								>
+									<div
+										class="col"
+										style="width: 50px; align-items: center"
+									>
+										<Icon
+											type="ios-checkmark-circle"
+											color="red"
+											size="18"
+											v-if="item.checked"
+										/>
+									</div>
+									<div class="col" style="flex: 1">
+										<div>{{ item.materialName }}</div>
+										<div>
+											物料长度:{{ item.quantity }}米
+										</div>
+									</div>
+								</div> -->
 							</div>
 						</div>
 						<div class="list">
@@ -297,6 +320,7 @@ import MyNav from '@/components/my-nav'
 import * as signalR from '@microsoft/signalr'
 import withUrl from '@/config/withUrl'
 import { MessagePackHubProtocol } from '@microsoft/signalr-protocol-msgpack'
+import axios from 'axios'
 import {
 	PlcStorageOut,
 	ReScan,
@@ -326,6 +350,7 @@ export default {
 			remarkShow: false,
 			remark: '',
 			rfidTagItemsCopy:[],
+			newData:[],
 		}
 	},
 	components: {
@@ -358,8 +383,9 @@ export default {
 		},
 		cfm() {
 			this.remarkShow = false
-		},
+		}, 
 		faceCheck(val) {
+			const v = this
 			PlcStorageOut({
 				inOutStorageNo: '',
 				storageDoor: sessionStorage.getItem('door'),
@@ -371,9 +397,25 @@ export default {
 			}).then((res) => {
 				if (res.code === 0) {
 					this.$Message.info('出库成功!')
+					const actual = []
+					for (let i = 0; i < scanData.rfidTagItems.length; i++) {
+						const element = scanData.rfidTagItems[i];
+						actual.push({
+							materialCode:element.materialCode,
+							materialRfid:element.rfidCode,
+							quantity:element.quantity
+						})
+					}
+					axios.post('/cloudApi/stockDetail/restrictedPicking',{
+						appointInfo:v.newData,
+						actual:actual,
+					}).then(res=>{
+						
+					})
 					logOut()
 				}
 			})
+			
 		},
 		/* 临时删除 */
 		del(item, index) {
@@ -490,6 +532,8 @@ export default {
 	},
 	mounted() {
 		this.otherData = JSON.parse(this.$route.query.otherData)
+		this.newData = JSON.parse(this.$route.query.newData)
+		console.log(JSON.parse(this.$route.query.newData))
 		this.tempDelData = []
 		this.getApplyTakeStockOut()
 		this.getList()

+ 22 - 6
vue.config.js

@@ -9,18 +9,34 @@ const createServerConfig = function (compilation) {
     return JSON.stringify(config)
 }
 
-function resolve(dir){
-    return path.join(__dirname,dir)//设置绝对路径
+function resolve(dir) {
+    return path.join(__dirname, dir)//设置绝对路径
 }
 
-module.exports={
-    chainWebpack:(config)=>{
+module.exports = {
+    devServer: {
+        port: "8080", //代理端口
+        open: false, //项目启动时是否自动打开浏览器,我这里设置为false,不打开,true表示打开
+        headers: {
+            'Access-Control-Allow-Origin': '*',
+        },
+        proxy: {
+            '/cloudApi': {
+                target: 'http://120.79.80.64:8050',
+                ws: true,
+                pathRewrite: {
+                    '^/api': '/'
+                }
+            },
+        }
+    },
+    chainWebpack: (config) => {
         config.resolve.alias
-            .set('_static',resolve('src/assets'))//参数1,设置的别名,参数2:设置的路径
+            .set('_static', resolve('src/assets'))//参数1,设置的别名,参数2:设置的路径
         config
             .plugin('html')
             .tap(args => {
-                args[0].title= '智能仓储一体机'
+                args[0].title = '智能仓储一体机'
                 return args
             })
     },