Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

andy 2 éve
szülő
commit
71cb1bcfe1

+ 18 - 0
ruoyi-ui/src/api/ams/invLotLocId.js

@@ -17,6 +17,24 @@ export function getInvLotLocId(lotnum) {
   })
 }
 
+// 库存调整
+export function adjInvLotLocId(data) {
+  return request({
+    url: '/ams/invLotLocId/adj',
+    method: 'post',
+    data: data
+  })
+}
+
+// 库存移动
+export function moveInvLotLocId(data) {
+  return request({
+    url: '/ams/invLotLocId/move',
+    method: 'post',
+    data: data
+  })
+}
+
 // 新增库位库存信息
 export function addInvLotLocId(data) {
   return request({

+ 95 - 0
ruoyi-ui/src/views/ams/inv/invLotLocId/adjDialog.vue

@@ -0,0 +1,95 @@
+<template>
+  <el-dialog :title="title" :visible.sync="adjDialogVisible" width="600px" append-to-body>
+    <el-form ref="form" :model="form" :rules="rules" label-width="80px" :inline="true">
+      <el-form-item label="库位编码" prop="locationNo">
+        <el-input v-model="form.locationNo" placeholder="请输入库位编码"/>
+      </el-form-item>
+      <el-form-item label="货主" prop="customerId">
+        <el-input v-model="form.customerId" placeholder="请输入货主"/>
+      </el-form-item>
+      <el-form-item label="产品代码" prop="sku">
+        <el-input v-model="form.sku" placeholder="请输入产品代码"/>
+      </el-form-item>
+      <el-form-item label="生产批号" prop="lotatt04">
+        <el-input v-model="form.lotatt04" placeholder="请输入产品批号"/>
+      </el-form-item>
+      <el-form-item label="库存件数" prop="qty">
+        <el-input v-model="form.qty" placeholder="请输入库存件数"/>
+      </el-form-item>
+      <el-form-item label="调整件数" prop="qtyTo">
+        <el-input v-model="form.qtyTo" placeholder="请输入调整件数"/>
+      </el-form-item>
+      <el-form-item label="序列号" prop="lotatt05">
+        <el-input v-model="form.lotatt05" placeholder="请输入序列号"/>
+      </el-form-item>
+      <el-form-item label="原因描述" prop="reason">
+        <el-input v-model="form.reason" placeholder="请输入原因描述"/>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="cancel">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+
+import {adjInvLotLocId} from "@/api/ams/invLotLocId";
+
+export default {
+  name: "adjDialog",
+  data() {
+    return {
+      adjDialogVisible: false,
+      title: "库存调整",
+      tableSelection: [],
+      form: {
+        locationNo: "",
+        customerId: "",
+        sku: "",
+        lotatt04: "",
+        lotatt05: "",
+        qty: "",
+        qtyTo: "",
+        reason: ""
+      },
+      rules: {
+        qtyTo: [
+          {required: true, message: "请输入调整件数", trigger: "blur"}
+        ],
+        reason: [
+          {required: true, message: "请输入调整原因", trigger: "blur"}
+        ],
+      }
+
+    };
+  },
+  methods: {
+    show(tableSelection) {
+      this.tableSelection = tableSelection;
+      console.log(tableSelection[0])
+      this.form = this.tableSelection[0];
+      this.adjDialogVisible = true;
+    },
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.$modal.loading();
+          adjInvLotLocId(this.form).then(response => {
+            this.$modal.msgSuccess("修改成功");
+            this.adjDialogVisible = false;
+            this.$emit('getList');
+          }).catch(error => {
+          }).finally(() => {
+            this.$modal.closeLoading();
+          });
+        }
+      });
+    },
+    cancel() {
+      this.adjDialogVisible = false;
+    }
+  }
+};
+</script>

+ 63 - 5
ruoyi-ui/src/views/ams/inv/invLotLocId/index.vue

@@ -25,6 +25,33 @@
       </el-form-item>
     </el-form>
 
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdj"
+          v-hasPermi="['ams:invLotLocId:adj']"
+        >库存调整
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleMove"
+          v-hasPermi="['ams:invLotLocId:move']"
+        >库存移动
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+
     <!--<el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
@@ -73,6 +100,7 @@
 
     <el-table v-loading="loading" :data="invLotLocIdList" @selection-change="handleSelectionChange">
       <!--<el-table-column label="lotnum" align="center" prop="lotnum" width="200"/>-->
+      <el-table-column type="selection" />
       <el-table-column label="物料" align="center" prop="sku" width="200"/>
       <el-table-column label="物料名称" align="center" prop="skuName" width="200"/>
       <el-table-column label="库位" align="center" prop="locationNo" width="200"/>
@@ -158,25 +186,34 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 库存调整dialog -->
+    <adj-dialog  ref="adjDialog" @getList="getList()"></adj-dialog>
   </div>
 </template>
 
 <script>
-import { listInvLotLocId, getInvLotLocId, delInvLotLocId, addInvLotLocId, updateInvLotLocId } from "@/api/ams/invLotLocId";
+import { listInvLotLocId, getInvLotLocId, adjInvLotLocId, moveInvLotLocId, delInvLotLocId, addInvLotLocId, updateInvLotLocId } from "@/api/ams/invLotLocId";
 import { lotattConfigList } from "@/api/ams/config";
+import adjDialog from "@/views/ams/inv/invLotLocId/adjDialog";
 
 export default {
   name: "InvLotLocId",
+  components: { adjDialog },
   data() {
     return {
       // 遮罩层
       loading: true,
       // 选中数组
       ids: [],
+      // 选中的数据
+      tableSelection: [],
+      // 是否勾选
+      isSelect: false,
       // 非单个禁用
-      single: true,
+      single: false,
       // 非多个禁用
-      multiple: true,
+      multiple: false,
       // 显示搜索条件
       showSearch: true,
       // 总条数
@@ -271,8 +308,29 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.lotnum)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.tableSelection = selection;
+      this.isSelect =  selection.length > 0;
+      this.single = selection.length == 1;
+      this.multiple = selection.length > 1;
+
+    },
+    /** 库存调整操作 */
+    handleAdj() {
+      if (!this.isSelect) {
+        this.$modal.alertWarning("请选择一条!");
+        return;
+      }
+      if (!this.single) {
+        this.$modal.alertWarning("库存调整只能选择单条!");
+        return;
+      }
+      this.$nextTick(() => {
+        this.$refs.adjDialog.show(this.tableSelection);
+      });
+    },
+    /** 库存移动操作 */
+    handleMove() {
+
     },
     /** 新增按钮操作 */
     handleAdd() {