ymy 11 months ago
parent
commit
7cbdff5797
4 changed files with 62 additions and 10 deletions
  1. 1 1
      .env.development
  2. 11 1
      src/api/currency.ts
  3. 45 3
      src/views/audit/sku/index.vue
  4. 5 5
      vue.config.js

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ VUE_APP_TITLE = OMS系统平台
 ENV = 'development'
 
 # SaaS协同平台/开发环境
-VUE_APP_BASE_API = '/prod-api'
+VUE_APP_BASE_API = '/dev-api'
 
 # 用户 "应用中心" 地址
 VUE_APP_CENTERURL = https://user.lzlxylsf.com/app

+ 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
 }

+ 45 - 3
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,6 +569,7 @@
 							v.volume = parseFloat(v.volume).toFixed(2)
 						}
 					});
+					this.tableData = res.data.records;
 					(this.$refs.moduleView as any).setTableValue(res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
@@ -562,6 +580,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' });

+ 5 - 5
vue.config.js

@@ -39,13 +39,13 @@ module.exports = defineConfig({
       // '/':{
         ws:false,
         // target: `http://192.168.2.32`,
-        target: `https://oms.lzlxylsf.com`,
-        // target:`https://omstest.benyuntech.com`,
+        // target: `https://oms.lzlxylsf.com`,
+        target:`http://192.168.1.75:8080`,
         // target: `http://47.107.53.207:9023`,
         changeOrigin: true,
-        // pathRewrite: {
-        //   ['^' + process.env.VUE_APP_BASE_API]: ''
-        // }
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_BASE_API]: ''
+        }
       }
     }
   },