Browse Source

入库单

andy 3 years ago
parent
commit
f034f4673d

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/asn/WmsDocAsnHeaderController.java

@@ -121,6 +121,19 @@ public class WmsDocAsnHeaderController extends BaseController
         return toAjax(wmsDocAsnHeaderService.insertWmsDocAsnDetails(wmsDocAsnDetails));
     }
 
+    /**
+     * 新增入库单明细
+     */
+    @PreAuthorize("@ss.hasPermi('docAsn:docAsn:add')")
+    @Log(title = "入库单", businessType = BusinessType.INSERT)
+    @PostMapping("addDocAsnHeader")
+    public AjaxResult addDocAsnHeader(@RequestBody WmsDocAsnHeader wmsDocAsnHeader)
+    {
+        int result = wmsDocAsnHeaderService.insertWmsDocAsnHeader(wmsDocAsnHeader);
+        return toAjax(result);
+    }
+
+
     /**
      * 新增入库单明细
      */

+ 11 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/base/BaseLocationInfoController.java

@@ -2,20 +2,14 @@ package com.ruoyi.web.controller.warewms.base;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+import javax.websocket.server.PathParam;
 
 import com.ruoyi.base.domain.form.BasLocationForm;
 import com.ruoyi.base.mapper.BaseLocationInfoMapper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -110,6 +104,15 @@ public class BaseLocationInfoController extends BaseController {
         return toAjax(baseLocationInfoService.deleteBaseLocationInfoByIds(ids));
     }
 
+    /**
+     * 获取库位信息详细信息
+     */
+    @GetMapping("/queryDict/{zoneId}")
+    public AjaxResult queryDict(@PathVariable("zoneId") Long zoneId) {
+        List<BaseLocationInfo> locationInfoList = baseLocationInfoService.selectSortedLocatinListByZoneId(zoneId, 1L);
+        return AjaxResult.success("", locationInfoList);
+    }
+
     /**
      * 获取库位下拉树列表
      */

+ 8 - 0
ruoyi-ui/src/api/base/locationInfo.js

@@ -50,3 +50,11 @@ export function treeselect() {
     method: 'get'
   })
 }
+
+// 查询库位字典表
+export function queryLocationDict(zoneId) {
+  return request({
+    url: '/base/locationInfo/queryDict/'+zoneId,
+    method: 'get'
+  })
+}

+ 10 - 0
ruoyi-ui/src/api/docAsn/docAsn.js

@@ -59,3 +59,13 @@ export function initAsnHeader(asnNo) {
     method: 'get'
   })
 }
+
+// 新增入库单
+export function addDocAsnHeader(data) {
+  return request({
+    url: '/docAsn/docAsn/addDocAsnHeader',
+    method: 'post',
+    data: data
+  })
+}
+

+ 36 - 15
ruoyi-ui/src/views/docAsn/docAsnDetails-add-or-update.vue

@@ -35,7 +35,8 @@
       <el-row>
         <el-col :span="8">
           <el-form-item label="指定区域" prop="locationZone">
-            <el-select v-model="dataForm.locationZone" placeholder="请选择库区" clearable size="small" style="width: 100%">
+            <el-select v-model="dataForm.locationZone" @change="locationZoneChange" placeholder="请选择库区" clearable
+                       size="small" style="width: 100%">
               <el-option
                 v-for="dict in this.locationZoneCombo"
                 :key="dict.zoneId"
@@ -47,19 +48,26 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="指定库位" prop="locationId">
-            <el-input v-model="dataForm.locationId" placeholder=""></el-input>
+            <el-select v-model="dataForm.locationId" placeholder="请选择库位" clearable size="small" style="width: 100%">
+              <el-option
+                v-for="dict in locationCombo"
+                :key="dict.id"
+                :label="dict.locationNo"
+                :value="dict.id"
+              ></el-option>
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="预期数量" prop="expectedQty">
-            <el-input v-model="dataForm.expectedQty" placeholder=""></el-input>
+            <el-input v-model="dataForm.expectedQty" placeholder="" type="number"></el-input>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
         <el-col :span="8">
           <el-form-item label="收货数量" prop="receivedQty">
-            <el-input v-model="dataForm.receivedQty" placeholder=""></el-input>
+            <el-input v-model="dataForm.receivedQty" placeholder="" type="number"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -88,7 +96,8 @@
               <el-input v-model="scope.row.defaultValue" placeholder=""/>
             </div>
             <div v-if="scope.row.inputType === 'DateBox'">
-              <el-date-picker v-model="scope.row.defaultValue" type="date" placeholder="" style="width: 100%" value-format="yyyy-MM-dd"/>
+              <el-date-picker v-model="scope.row.defaultValue" type="date" placeholder="" style="width: 100%"
+                              value-format="yyyy-MM-dd"/>
             </div>
             <div v-if="scope.row.inputType === 'ComboBox'">
               <el-select v-model="scope.row.defaultValue" placeholder="请选择" clearable size="small" style="width: 100%">
@@ -113,14 +122,15 @@
 </template>
 
 <script>
-  import { lotattConfigList } from "@/api/ams/config"
-  import { queryLocationZoneDict } from "@/api/base/locationZone"
-  import { addDocAsnDetails } from "@/api/docAsn/docAsn"
+  import {lotattConfigList} from "@/api/ams/config"
+  import {queryLocationZoneDict} from "@/api/base/locationZone"
+  import {addDocAsnDetails} from "@/api/docAsn/docAsn"
   import SkuSearchDialog from '@/views/base/baseSku/skuSearchDialog'
+  import {queryLocationDict} from "@/api/base/locationInfo"
 
   export default {
     dicts: ['sys_yes_no', 'ams_inv_quality', 'asn_status'],
-    data () {
+    data() {
       return {
         visible: false,
         skuSearchDialogVisible: false,
@@ -160,14 +170,15 @@
         dataRule: {},
         tableOption: [],
         attShowFlag: false,
-        locationZoneCombo: []
+        locationZoneCombo: [],
+        locationCombo: []
       }
     },
     components: {
       SkuSearchDialog
     },
     methods: {
-      init (id) {
+      init(id) {
         this.initData()
         this.dataForm.asnNo = id
         this.visible = true
@@ -176,11 +187,11 @@
         })
       },
       // 表单提交
-      dataFormSubmit () {
+      dataFormSubmit() {
         this.$refs["dataForm"].validate(valid => {
           if (valid) {
             for (let i = 0; i < this.tableOption.length; i++) {
-              this.dataForm[''+this.tableOption[i].lotattId] = this.tableOption[i].defaultValue
+              this.dataForm['' + this.tableOption[i].lotattId] = this.tableOption[i].defaultValue
             }
             console.log(this.dataForm)
             addDocAsnDetails(this.dataForm).then(response => {
@@ -198,11 +209,12 @@
         queryLocationZoneDict().then(response => {
           this.locationZoneCombo = response.data
         })
+
       },
-      showHidden () {
+      showHidden() {
         this.attShowFlag = !this.attShowFlag
       },
-      handleSkuIconClick () {
+      handleSkuIconClick() {
         this.skuSearchDialogVisible = true
         this.$nextTick(() => {
           this.$refs.skuSearch.init()
@@ -210,6 +222,15 @@
       },
       afterChoseUser: function (userName, value) {
         this.dataForm.sku = value
+      },
+      locationZoneChange: function (value) {
+        let param = 0
+        if (value != '') {
+          param = value
+        }
+        queryLocationDict(param).then(response => {
+          this.locationCombo = response.data
+        })
       }
     }
   }

+ 13 - 58
ruoyi-ui/src/views/docAsn/docAsnDetails.vue

@@ -74,15 +74,13 @@
         align="center" :prop="item.prop" width="150">
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="sizeChangeHandle"
-      @current-change="currentChangeHandle"
-      :current-page="pageIndex"
-      :page-sizes="[10, 20, 50, 100]"
-      :page-size="pageSize"
-      :total="totalPage"
-      layout="total, sizes, prev, pager, next, jumper">
-    </el-pagination>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
     <div>
       <el-button type="primary" size="mini" @click="addOrUpdateHandle(dataForm.asnNo)">明细新增</el-button>
       <el-button type="primary" size="mini" >明细编辑</el-button>
@@ -101,13 +99,13 @@
     data () {
       return {
         choseAsn: '',
-        dataForm: {
+        total: 0,
+        dataList: [],
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
           asnNo: ''
         },
-        dataList: [],
-        pageIndex: 1,
-        pageSize: 10,
-        totalPage: 0,
         dataListLoading: false,
         dataListSelections: [],
         addOrUpdateVisible: false,
@@ -124,11 +122,9 @@
       // s
     },
     methods: {
-      initAsnNo (asnNo) {
-        this.dataForm.asnNo = asnNo
-      },
       // 获取数据列表
       getDataList (asnNo) {
+        this.dataForm.asnNo = asnNo
         this.initLotatt()
         /*if (asnNo) {
           this.dataForm.asnNo = asnNo
@@ -156,17 +152,6 @@
           this.totalPage = 0
         }*/
       },
-      // 每页数
-      sizeChangeHandle (val) {
-        this.pageSize = val
-        this.pageIndex = 1
-        this.getDataList()
-      },
-      // 当前页
-      currentChangeHandle (val) {
-        this.pageIndex = val
-        this.getDataList()
-      },
       // 多选
       selectionChangeHandle (val) {
         this.dataListSelections = val
@@ -178,36 +163,6 @@
           this.$refs.addOrUpdate.init(id)
         })
       },
-      // 删除
-      deleteHandle (id) {
-        var ids = id ? [id] : this.dataListSelections.map(item => {
-          return item.asnNo
-        })
-        this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          this.$http({
-            url: this.$http.adornUrl('/sys/docAsnHeader/delete'),
-            method: 'post',
-            data: this.$http.adornData(ids, false)
-          }).then(({data}) => {
-            if (data && data.code === 0) {
-              this.$message({
-                message: '操作成功',
-                type: 'success',
-                duration: 1500,
-                onClose: () => {
-                  this.getDataList()
-                }
-              })
-            } else {
-              this.$message.error(data.msg)
-            }
-          })
-        }).catch(() => {})
-      },
       initLotatt() {
         this.tableOption.length = 0
         lotattConfigList().then(response => {

+ 34 - 7
ruoyi-ui/src/views/docAsn/docAsnHeader-add-or-update.vue

@@ -88,8 +88,8 @@
             </el-form-item>
           </el-col>
           <el-col :span="4" style="text-align: right;">
-            <el-button size="mini" type="primary" :disabled="dataFormHead.asnNo ? true : false" @click="dataFormHeadSubmit()">提交</el-button>
-            <el-button size="mini" type="primary" :disabled="!dataFormHead.asnNo ? true : false" @click="dataFormHeadSubmit()">修改</el-button>
+            <el-button size="mini" type="primary" :disabled=" id !== '' ? true : false" @click="dataFormHeadSubmit()">提交</el-button>
+            <el-button size="mini" type="primary" :disabled=" id === '' ? true : false" @click="dataFormHeadSubmit()">修改</el-button>
           </el-col>
         </el-row>
       </el-form>
@@ -106,7 +106,7 @@
 
 <script>
 
-  import { initAsnHeader } from "@/api/docAsn/docAsn";
+  import { initAsnHeader , addDocAsnHeader, updateDocAsn, getDocAsn } from "@/api/docAsn/docAsn";
   import {querySupplierDict} from "@/api/base/supplier";
   import {queryCustomerDict} from "@/api/base/customer";
   import AsnDetails from './docAsnDetails'
@@ -120,16 +120,16 @@
         visible: false,
         roleList: [],
         dataFormHead: {
-          createUserId: '',
+          createBy: '',
           notes: '',
           supplierId: '',
-          editUserId: '',
+          updateBy: '',
           paNo: '',
           qcNo: '',
           userdefine1: '',
           userdefine2: '',
           userdefine3: '',
-          editDate: '',
+          updateTime: '',
           userdefine4: '',
           userdefine5: '',
           asnNo: '',
@@ -141,7 +141,7 @@
           expectedArriveTime: '',
           asnStatus: '00',
           customerNo: '',
-          createDate: '',
+          createTime: '',
           activeFlag: ''
         },
         dataRule: {
@@ -164,9 +164,17 @@
           initAsnHeader(id).then(response => {
             if(response.code == 200) {
               let asnHeader = response.data;
+              this.id = asnHeader.asnNo
               this.dataFormHead.asnNo = asnHeader.asnNo
               this.dataFormHead.asnStatus = asnHeader.asnStatus
               this.dataFormHead.asnType = asnHeader.asnType
+              this.dataFormHead.customerNo = asnHeader.customerNo
+              this.dataFormHead.asnReference1 = asnHeader.asnReference1
+              this.dataFormHead.expectedArriveTime = asnHeader.expectedArriveTime
+              this.dataFormHead.asnStatus = asnHeader.asnStatus
+              this.dataFormHead.supplierId = parseInt(asnHeader.supplierId) ? parseInt(asnHeader.supplierId) : ''
+              this.dataFormHead.customerId = parseInt(asnHeader.customerId) ? parseInt(asnHeader.customerId) : ''
+              this.dataFormHead.notes = asnHeader.notes
             } else {
               this.$modal.msgError(response.msg);
             }
@@ -182,6 +190,25 @@
         queryCustomerDict().then(response => {
           this.customerIdCombo = response.data;
         });
+      },
+      dataFormHeadSubmit () {
+        if(this.id === '') {
+          addDocAsnHeader(this.dataFormHead).then(response => {
+            if(response.code == 200) {
+              this.$modal.msgSuccess(response.msg);
+            } else {
+              this.$modal.msgError(response.msg);
+            }
+          })
+        } else {
+          updateDocAsn(this.dataFormHead).then(response => {
+            if(response.code == 200) {
+              this.$modal.msgSuccess(response.msg);
+            } else {
+              this.$modal.msgError(response.msg);
+            }
+          })
+        }
       }
     }
   }

+ 6 - 21
ruoyi-ui/src/views/docAsn/index.vue

@@ -76,17 +76,6 @@
           v-hasPermi="['docAsn:docAsn:add']"
         >新增</el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['docAsn:docAsn:edit']"
-        >修改</el-button>
-      </el-col>
       <el-col :span="1.5">
         <el-button
           type="danger"
@@ -124,10 +113,10 @@
           <dict-tag :options="dict.type.asn_status" :value="scope.row.asnStatus"/>
         </template>
       </el-table-column>
-      <el-table-column label="货主代码" align="center" prop="customerId" />
+      <!--<el-table-column label="客户" align="center" prop="customerId" />-->
       <el-table-column label="客户单号" align="center" prop="customerNo" />
       <el-table-column label="采购单号" align="center" prop="asnReference1" />
-      <el-table-column label="asn参考信息" align="center" prop="asnReference2" />
+      <!--<el-table-column label="asn参考信息" align="center" prop="asnReference2" />-->
       <el-table-column label="预期到货时间" align="center" prop="expectedArriveTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.expectedArriveTime, '{y}-{m}-{d}') }}</span>
@@ -138,7 +127,6 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="备注" align="center" prop="notes" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -318,13 +306,10 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const asnNo = row.asnNo || this.ids
-      getDocAsn(asnNo).then(response => {
-        this.form = response.data;
-        this.wmsDocAsnDetailsList = response.data.wmsDocAsnDetailsList;
-        this.open = true;
-        this.title = "修改入库单";
-      });
+      this.addOrUpdateVisible = true
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(row.asnNo)
+      })
     },
     /** 提交按钮 */
     submitForm() {