ymy 1 年之前
父節點
當前提交
afe2140088

+ 11 - 1
src/api/currency.ts

@@ -137,6 +137,15 @@ function outQueryBySku(data? : any) {
 	})
 }
 
+//查wms库存
+function wmsStore(ids: any) {
+	return request({
+		url: '/omsOrder/WMSwork/WMSInventory',
+		method: 'POST',
+		params: ids
+	})
+}
+
 export default {
 	treeList,
 	treeUseList,
@@ -154,5 +163,6 @@ export default {
 	getFinancialCode,
 	queryByProductId,
 	inQueryBySku,
-	outQueryBySku
+	outQueryBySku,
+	wmsStore
 }

+ 1 - 1
src/benyun/utils/auth.ts

@@ -6,7 +6,7 @@ const ExpiresInKey = 'AdminOMS-Expires-In'
 
 export function getToken() {
   if(process.env.NODE_ENV === 'development'){
-    return 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxNzUsInVzZXJfa2V5IjoiYjU1NjczMmUtNDE0Zi00ODM3LWFhMTAtYjI3NDQ3MWQ2YjdiIiwidXNlcm5hbWUiOiIxNTY2NjY2NjY2NiJ9.ExD31Uuvo7TUTxI8FAF8k4yQ-667k6gy3qx0XRm27kVM3yZhBniuKNm0wNpK5fBs_2f_0U5XNf_GlBDC2-wV2A'
+    return 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijc0YWE2YjA3LTdiYTktNDM4NS04ZWVjLWE3MjAyMzg1NmIxNCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.W4u_8IAKqYBKUv4yEU9g-9YBrv5qABkRkZvsHF-WPBgIlTY3TrPnd-pes-1pZY6J0SekqM0JsR8_lLZ7zDlAPw'
   }else{
     return Cookies.get(TokenKey)
   }

+ 45 - 2
src/views/audit/sku/index.vue

@@ -360,6 +360,11 @@
 						title: '69码-商品条码',
 						field: 'barCode',
 					},
+					{
+						width: '120px',
+						title: '可销售库存',
+						field: 'remainAmount',
+					},
 					{
 						width: '140px',
 						title: '财务编号',
@@ -422,7 +427,7 @@
 						field: 'volume',
 					},
 					{
-						width: 70,
+						width: 140,
 						title: '操作',
 						action: true,
 						plugins: [{
@@ -434,11 +439,23 @@
 									(this as any).openEdit(item)
 								}
 							}
-						}]
+						}
+						,{
+							// icon: 'el-icon-setting',
+							name: '查wms库存',
+							audit: '',
+							event: {
+								click: (item : any) => {
+									(this as any).getWMSStore(item)
+								}
+							}
+						}
+					]
 					},
 				]
 			},
 		}
+		tableData:Array<any>=[]
 		mounted() {
 			this.timer = setInterval(() => {
 				this.getDataList();
@@ -552,7 +569,9 @@
 							v.volume = parseFloat(v.volume).toFixed(2)
 						}
 					});
+					this.tableData = res.data.records;
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
+					// this.getWMSStore(res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
 						pageSize: res.data.size, //每页条数
@@ -562,6 +581,30 @@
 				} else this.$message.error(res.msg);
 			}).catch(() => loading.close());
 		}
+		//查wms库存
+		getWMSStore(item:any){
+			let index = -1;
+			for(const da of this.tableData){
+				index++;
+				if(da.id === item.id){
+					break
+				}
+			}
+			let loading = this.$loading({ target: '.main-container' });
+			api.wmsStore({ids:item.id}).then((res:any) => {
+				loading.close()
+				if(res.code == 200){
+					if(res.data && res.data[item.id]){
+						this.tableData[index].remainAmount = res.data[item.id].remainAmount;
+						(this.$refs.moduleView as any).setTableValue(this.tableData);
+					}
+				}
+			}).catch((err:any) => {
+				loading.close()
+				this.tableData[index].remainAmount = 'WMS库存查询失败!';
+				(this.$refs.moduleView as any).setTableValue(this.tableData);
+			})
+		}
 		// 打开编辑
 		openEdit(e : any) {
 			let loading = this.$loading({ target: '.main-container' });

+ 2 - 2
src/views/oms/B2BOrder/components/sendModeModal.vue

@@ -28,7 +28,7 @@
         </div>
         <div class="msg">同一客户同一目的地订单形成一张物流单<br />优惠多多</div>
       </div>
-      <div class="moda-item" :class="{'onModal': mode==='2'}" @click="modeHandle('2')">
+      <!-- <div class="moda-item" :class="{'onModal': mode==='2'}" @click="modeHandle('2')">
         <div class="img-tag">
           <img src="../../../../assets/images/img1.png" />
         </div>
@@ -39,7 +39,7 @@
           </div>
         </div>
         <div class="msg">处理后形成新物流单</div>
-      </div>
+      </div> -->
     </div>
   </vxe-modal>
 </template>

+ 31 - 14
src/views/oms/WMSProduct/index.vue

@@ -2,6 +2,7 @@
   <div class="wmsProduct">
     <module-view :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @modalHandle="modalHandle" @onRefresh="getList" 
     @resert="queryList" @search="queryList" @clickHandle="clickHandle" @detail="detail" />
+    <itemsModal ref="itemsModal" />
   </div>
 </template>
 
@@ -10,7 +11,8 @@ import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import TagState from "./component/tagState.vue";
 import ItemSku from "./component/ItemSku.vue";
 import {query,WMSCreateEntryOrder} from '@/api/WMSInstoreBill'
-@Component({components:{}})
+import itemsModal from './component/itemsModal.vue'
+@Component({components:{itemsModal}})
 export default class WMSProduct extends Vue {
   load=false;
   time:any;
@@ -152,19 +154,19 @@ export default class WMSProduct extends Vue {
         field:'orderConfirmTime',
         width:150
       },
-      // {
-      //   title:'操作',
-      //   action:true,
-      //   width:100,
-      //   plugins:[{
-      //     name:'删除',
-      //     event:{
-      //       click:(item:any) => {
-      //         this.del(item);
-      //       }
-      //     }
-      //   }]
-      // }
+      {
+        title:'操作',
+        action:true,
+        width:100,
+        plugins:[{
+          name:'查看商品',
+          event:{
+            click:(item:any) => {
+              this.itemInfo(item.items);
+            }
+          }
+        }]
+      }
     ]
     },
     modal:{
@@ -252,6 +254,21 @@ export default class WMSProduct extends Vue {
       this.getList()
     })
   }
+  //查看商品信息
+  itemInfo(item:any){
+    if(!item){
+      this.$message('无法查到商品信息!');
+      return
+    }
+    try{
+      let data = JSON.parse(item);
+      (this.$refs.itemsModal as any).setShow(true);
+      (this.$refs.itemsModal as any).setData(data);
+    }catch(e){
+      this.$message('商品信息有误,请检查!');
+    }
+    
+  }
   //分页
   pagination(){
     if(this.isSearch){