Bladeren bron

修改仓库库存管理界面拉取库存按钮,新增按条件拉取

lvjian 2 jaren geleden
bovenliggende
commit
f980c31232

+ 3 - 2
eccs-biz/src/main/java/com/emato/biz/controller/warehouse/OWbInveMngController.java

@@ -2,6 +2,7 @@ package com.emato.biz.controller.warehouse;
 
 import java.util.List;
 
+import com.emato.biz.domain.warehouse.PullInveQueryVO;
 import com.emato.common.core.domain.entity.SysDept;
 import com.emato.common.core.domain.entity.SysUser;
 import com.emato.common.core.domain.model.LoginUser;
@@ -114,9 +115,9 @@ public class OWbInveMngController extends BaseController
 
     @PreAuthorize("@ss.hasPermi('biz:invemng:pull')")
     @PostMapping("/pullInveMng")
-    public AjaxResult pullInveMng()
+    public AjaxResult pullInveMng(PullInveQueryVO queryVO)
     {
-
+        logger.debug("前端请求参数 => {}", queryVO);
         // 获取当前的用户
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
         SysUser user = loginUser.getUser();

+ 40 - 0
eccs-biz/src/main/java/com/emato/biz/domain/warehouse/PullInveQueryVO.java

@@ -0,0 +1,40 @@
+package com.emato.biz.domain.warehouse;
+
+/**
+ * 拉取库存 VO
+ *
+ * @author frankeleyn
+ * @email lvjian@qhdswl.com
+ * @date 2023/4/18 11:22
+ */
+public class PullInveQueryVO {
+
+    private String merchSn;
+
+    private String sku;
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    public String getSku() {
+        return sku;
+    }
+
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    @Override
+    public String toString() {
+        return "PullInveQueryVO{" +
+                "merchSn='" + merchSn + '\'' +
+                ", sku='" + sku + '\'' +
+                '}';
+    }
+
+}

+ 3 - 4
eccs-biz/src/main/java/com/emato/biz/service/impl/OWbInveMngServiceImpl.java

@@ -39,7 +39,7 @@ import javax.annotation.Resource;
 @Service
 public class OWbInveMngServiceImpl implements IOWbInveMngService
 {
-    @Autowired
+    @Resource
     private OWbInveMngMapper oWbInveMngMapper;
 
     @Resource
@@ -163,8 +163,8 @@ public class OWbInveMngServiceImpl implements IOWbInveMngService
         //构建Request
         String  url = OmsConfig.getQueryMngInveUrl();
         String jsonParam = JSONObject.toJSONString(sParaTemp);
-        Request request = OkHttpUtils.buildRequest(jsonParam,url,"");
-        LOGGER.info("oms的请求报文:" + request);
+        LOGGER.info("Eccs 请求 OMS url => {}, 请求 OMS 报文 => {}", url, jsonParam);
+
         // 同步访问,返回结果字符串
         String responseString = null;
         try {
@@ -195,7 +195,6 @@ public class OWbInveMngServiceImpl implements IOWbInveMngService
             }
 
         } catch (Exception e) {
-            e.printStackTrace();
             LOGGER.error(e.getMessage());
             return 1;
         }

+ 2 - 6
eccs-ui/src/api/warehouse/invemng.js

@@ -52,17 +52,13 @@ export function exportInvemng(query) {
   })
 }
 
-// 导出库存管理,wms入库回传时,增加库存数
-export function pullInvemng(query,_this) {
+// 拉取库存
+export function pullInvemng(query) {
   return request({
     url: '/biz/invemng/pullInveMng',
     method: 'post',
     params: query,
     timeout: 3600 * 1000,
     loading: document.body
-  }).then(function (response) {
-    _this.$alert("拉取成功...");
-  }).catch(function () {
-    _this.$alert("拉取异常...");
   })
 }

+ 1 - 1
eccs-ui/src/views/mall/mallinvemng/index.vue

@@ -137,7 +137,7 @@
       </el-table-column>
       <el-table-column label="库存状态" align="center" prop="inveStatus" />
       <el-table-column label="海关代码" align="center" prop="cusCode" />-->
-      <el-table-column label="库存数" align="center" prop="inveNum" />
+      <!-- <el-table-column label="库存数" align="center" prop="inveNum" /> -->
       <!-- <el-table-column label="可用数" align="center" prop="validNum" />
       <el-table-column label="下单冻结数" align="center" prop="freezeNum" /> -->
       <!--<el-table-column label="进货数" align="center" prop="imWareNum" />

+ 64 - 5
eccs-ui/src/views/warehouse/invemng/index.vue

@@ -117,7 +117,7 @@
           type="warning"
           icon="el-icon-download"
           size="mini"
-          @click="handlePull"
+          @click="openPullDialog"
           v-hasPermi="['biz:invemng:pull']"
         >拉取</el-button>
       </el-col>
@@ -238,6 +238,26 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 拉取 dialog -->
+    <el-dialog title="拉取库存" :visible.sync="pullDialog" width="500px" append-to-body>
+      <el-form ref="pullForm" :model="pullForm" :rules="rules" label-width="80px">
+
+        <el-form-item label="商户编号" prop="merchSn">
+          <el-input v-model="pullForm.merchSn" placeholder="请输入商户编号" />
+        </el-form-item>
+
+        <el-form-item label="SKU" prop="sku">
+          <el-input v-model="pullForm.sku" placeholder="请输入SKU" />
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="handlePull">确 定</el-button>
+        <el-button @click="closePullDialog">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -250,6 +270,10 @@ export default {
   },
   data() {
     return {
+      // 拉取表单
+      pullForm: {},
+      // 拉取数据弹框
+      pullDialog: false,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -316,6 +340,30 @@ export default {
     });
   },
   methods: {
+    /**
+     * 打开拉取库存对话框
+     */
+    openPullDialog() {
+      this.resetPullForm();
+      this.pullDialog = true;
+    },
+    /**
+     * 关闭拉取库存对话框
+     */
+    closePullDialog() {
+      this.pullDialog = false;
+      this.resetPullForm();
+    },
+    /**
+     * 清除表单数据
+     */
+    resetPullForm() {
+      this.pullForm = {
+        merchSn: null,
+        sku: null
+      };
+      this.resetForm("pullForm");
+    },
     /** 查询库存管理,wms入库回传时,增加库存数列表 */
     getList() {
       this.loading = true;
@@ -345,11 +393,13 @@ export default {
     isValidFormat(row, column) {
       return this.selectDictLabel(this.isValidOptions, row.isValid);
     },
+
     // 取消按钮
     cancel() {
       this.open = false;
       this.reset();
     },
+    
     // 表单重置
     reset() {
       this.form = {
@@ -465,15 +515,24 @@ export default {
     },
     /** 拉取按钮操作 */
     handlePull() {
-      const queryParams = this.queryParams;
+      const queryParams = this.pullForm;
+      console.log("传入的拉取参数 => ", queryParams);
       // 添加遮罩
-      const _this=this
-      this.$confirm('是否确认拉取保税仓所有库存?', "警告", {
+      const _this = this;
+
+      this.$confirm('是否确认拉取仓库库存?', "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
-        return pullInvemng(queryParams,_this);
+        return pullInvemng(queryParams).then(res => {
+          // 关闭对话框
+          _this.closePullDialog();
+          _this.$alert("拉取库存成功...");
+        }).catch(err => {
+          _this.$alert("拉取库存异常...");
+        })
+
       }).then(function(){
         _this.handleQuery();
       })