Bladeren bron

bug解决

cz 2 jaren geleden
bovenliggende
commit
9a5a2a562c

+ 25 - 0
src/api/inventory-management/query.js

@@ -0,0 +1,25 @@
+import request from '@/router/axios'
+
+// 库存查询按仓库列表 
+export function byWarehouseList(data = {}) {
+  return request({
+    url: '/api/victoriatourist/stock/pageByWarehouse',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+
+// 库存查询按产品列表 
+export function byProductList(data = {}) {
+  return request({
+    url: '/api/victoriatourist/stock/pageByProduct',
+    method: 'post',
+    data: data,
+  })
+}
+
+
+
+

+ 48 - 35
src/components/order/details.vue

@@ -1,46 +1,60 @@
 <template>
   <div>
     <el-form :model="form" label-position="left" v-loading="loading">
-      <el-row :gutter="10">
-        <el-col :span="12">
-          <el-form-item label="客户:" prop="customerName">
-            <span>{{ form.customerName }}</span>
-          </el-form-item>
-        </el-col>
-        <el-col :span="10">
-          <el-form-item label="订单类型:" prop="type">
-            <span>
-              {{ dictDataEcho(form.type, orderTypeList) }}
-            </span>
-          </el-form-item>
-        </el-col>
-      </el-row>
+      <div style="margin-bottom: 20px">
+        <labelTitle content="基本信息"></labelTitle>
+      </div>
+      <div style="padding: 0px 20px">
+        <el-row :gutter="10">
+          <el-col :span="12">
+            <el-form-item label="客户:" prop="customerName">
+              <span>{{ form.customerName }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="10">
+            <el-form-item label="订单类型:" prop="type">
+              <span>
+                {{ dictDataEcho(form.status, orderTypeList) }}
+              </span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
+
       <div style="margin-bottom: 20px">
         <labelTitle content="订单明细"></labelTitle>
       </div>
-      <el-table :data="form.orderDetailsList">
-        <el-table-column label="物品编码" prop="productCode"> </el-table-column>
-        <el-table-column label="物品名称" prop="productName"> </el-table-column>
-        <el-table-column label="物品单位" prop="productUnit"> </el-table-column>
-        <el-table-column label="数量" prop="quantity"> </el-table-column>
-      </el-table>
-      <el-row>
-        <el-col :span="10">
-          <el-form-item label="订单总金额:" prop="amountMoney">
-            {{ form.amountMoney }}
-          </el-form-item>
-        </el-col>
-      </el-row>
+      <div style="padding: 0px 20px">
+        <el-table :data="form.orderDetailsList">
+          <el-table-column label="物品编码" prop="productCode">
+          </el-table-column>
+          <el-table-column label="物品名称" prop="productName">
+          </el-table-column>
+          <el-table-column label="物品单位" prop="productUnit">
+          </el-table-column>
+          <el-table-column label="数量" prop="quantity"> </el-table-column>
+        </el-table>
+        <el-row>
+          <el-col :span="10">
+            <el-form-item label="订单总金额:" prop="amountMoney">
+              {{ form.amountMoney }}
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </div>
       <div style="margin-bottom: 20px">
         <labelTitle content="收货信息"></labelTitle>
       </div>
-      <el-form-item label="收件人:">
-        {{ form.contacts }} , {{ form.phone }}
-      </el-form-item>
-      <el-form-item label="收件地址:">
-        {{ form.countryName }} , {{ form.provinceName }} , {{ form.cityName }} ,
-        {{ form.detailedAddress }}
-      </el-form-item>
+      <div style="padding: 0px 20px">
+        <el-form-item label="收件人:">
+          {{ form.contacts }} , {{ form.phone }}
+        </el-form-item>
+        <el-form-item label="收件地址:">
+          {{ form.countryName }} , {{ form.provinceName }} ,
+          {{ form.cityName }} ,
+          {{ form.detailedAddress }}
+        </el-form-item>
+      </div>
     </el-form>
   </div>
 </template>
@@ -53,7 +67,6 @@ export default {
   props: {
     orderId: {
       type: String,
-      default: "",
     },
   },
   components: {

+ 1 - 0
src/components/select-product/index.vue

@@ -16,6 +16,7 @@
       <el-table-column label="产品编码" align="left" prop="code" />
       <el-table-column label="产品名称" align="left" prop="name" />
       <el-table-column label="产品单位" align="left" prop="unit" />
+      <el-table-column label="规格" align="left" prop="specs" width="130" />
       <el-table-column label="部门" align="left" prop="deptName" />
       <el-table-column
         label="生命周期"

+ 22 - 11
src/views/inbound-outbound/inbound/cgInbound/index.vue

@@ -17,6 +17,7 @@ export default {
     return {
       warehouseTypeList: [],
       warehouseSelectList: [],
+      inStockStatusList: [],
       btnForm: {
         otherButton: {
           list: [
@@ -49,10 +50,7 @@ export default {
         {
           label: "入库状态",
           prop: "inStockStatus",
-          data: [
-            { label: "未入库", value: "10" },
-            { label: "部分入库", value: "20" },
-          ],
+          data: [],
         },
       ],
       tableList: [],
@@ -74,10 +72,14 @@ export default {
     this.warehouseTypeList = businessDictData.find(
       (item) => item.code === "warehouseType"
     ).children;
-    // this.selectConfig[0].data = this.warehouseTypeList.map((item) => ({
-    //   label: item.dictValue,
-    //   value: item.dictKey,
-    // }));
+
+    this.inStockStatusList = businessDictData.find(
+      (item) => item.code === "inStockStatus"
+    ).children;
+    this.selectConfig[0].data = this.inStockStatusList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
     warehouseSelectList().then((res) => {
       this.warehouseSelectList = res.data.data;
     });
@@ -108,12 +110,17 @@ export default {
         this.$refs.purchaseInbound.loading = true;
         API.logisticsDetails({ logisticsInfoId: row.id }).then(
           (res) => {
+            let list = res.data.data;
+            list = list.map((x) => ({
+              ...x,
+              changeQuantity: x.shipmentQuantity,
+            }));
             this.form = {
               purchaseCode: row.purchaseCode,
               supplierName: row.supplierName,
               logisticsCompanyName: row.logisticsCompanyName,
               code: row.code,
-              changeDetailsList: res.data.data,
+              changeDetailsList: list,
             };
             this.$refs.purchaseInbound.loading = false;
           },
@@ -239,12 +246,16 @@ export default {
           prop="inStockStatus"
           width="100"
           :formatter="
-            (row) => (row.inStockStatus === 10 ? '未入库' : '部分入库')
+            (row) => dictDataEcho(row.inStockStatus, inStockStatusList)
           "
         />
         <el-table-column label="操作" align="left" width="100">
           <template slot-scope="scope">
-            <el-button type="text" @click="handleInbound(scope.row)">
+            <el-button
+              type="text"
+              @click="handleInbound(scope.row)"
+              v-if="scope.row.inStockStatus < 30"
+            >
               入库
             </el-button>
           </template>

+ 5 - 1
src/views/inbound-outbound/inbound/cgInbound/purchaseInbound.vue

@@ -47,7 +47,11 @@
             <el-table-column label="本次发货" prop="shipmentQuantity">
             </el-table-column>
 
-            <el-table-column label="本次入库" prop="changeQuantity">
+            <el-table-column
+              label="本次入库"
+              prop="changeQuantity"
+              align="center"
+            >
               <template slot-scope="scope">
                 <el-form-item
                   :prop="

+ 6 - 2
src/views/inbound-outbound/inbound/manualInbound/addManualInbound.vue

@@ -61,7 +61,7 @@
             </el-table-column>
             <el-table-column label="物品名称" prop="productName">
             </el-table-column>
-            <el-table-column label="规格" prop="productType"> </el-table-column>
+            <el-table-column label="规格" prop="specs"> </el-table-column>
 
             <el-table-column label="本次入库" prop="quantity">
               <template slot-scope="scope">
@@ -161,6 +161,9 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          if (this.form.changeProductList.length < 1) {
+            return this.msgInfo("请添加入库明细!");
+          }
           this.loading = true;
           this.form.changeProductList = this.form.changeProductList.map(
             (x) => ({
@@ -196,10 +199,11 @@ export default {
         productCode: row.code,
         productName: row.name,
         productId: row.id,
+        specs: row.specs,
         quantity: "",
       };
       this.form.changeProductList.push(product);
-      this.msgSuccess("添加成功");
+      this.msgSuccess("选择成功");
     },
     deleteRow(index) {
       this.form.changeProductList.splice(index, 1);

+ 1 - 1
src/views/inbound-outbound/inbound/manualInbound/index.vue

@@ -174,7 +174,7 @@ export default {
         <el-table-column
           label="操作人"
           align="left"
-          prop="createUser"
+          prop="createName"
           width="130"
         />
         <el-table-column

+ 4 - 1
src/views/inbound-outbound/outbound/manualOutbound/addManualOutbound.vue

@@ -65,7 +65,7 @@
             </el-table-column>
             <el-table-column label="产品名称" prop="productName">
             </el-table-column>
-            <el-table-column label="规格" prop="name"> </el-table-column>
+            <el-table-column label="规格" prop="specs"> </el-table-column>
 
             <el-table-column label="本次出库" prop="quantity">
               <template slot-scope="scope">
@@ -202,9 +202,12 @@ export default {
         productCode: row.code,
         productName: row.name,
         productId: row.id,
+        specs: row.specs,
+
         quantity: "",
       };
       this.form.changeProductList.push(product);
+      this.msgSuccess("选择成功");
     },
     deleteRow(index) {
       this.form.changeProductList.splice(index, 1);

+ 2 - 2
src/views/inbound-outbound/outbound/salesOutbound/index.vue

@@ -226,9 +226,9 @@ export default {
             <el-button type="text" @click="handleOutbound(scope.row)"
               >出库
             </el-button>
-            <el-button type="text" @click="handleOutbound(scope.row, '10')"
+            <!-- <el-button type="text" @click="handleOutbound(scope.row, '10')"
               >补发货
-            </el-button>
+            </el-button> -->
           </template>
         </el-table-column>
       </el-table>

+ 6 - 3
src/views/inbound-outbound/transfer/sendTransfer.vue

@@ -83,7 +83,7 @@
             </el-table-column>
             <el-table-column label="产品名称" prop="productName">
             </el-table-column>
-            <el-table-column label="规格" prop="name"> </el-table-column>
+            <el-table-column label="规格" prop="specs"> </el-table-column>
 
             <el-table-column label="调仓数量" prop="quantity">
               <template slot-scope="scope">
@@ -204,10 +204,11 @@ export default {
       this.$emit("cancel");
     },
     handleAddProduct() {
-      if (this.form.outWarehouseId === this.form.inWarehouseId)
-        return this.msgInfo("调出和调入仓库不可一致");
       if (!(this.form.outWarehouseId && this.form.inWarehouseId))
         return this.msgInfo("请先选择要调的仓库");
+      if (this.form.outWarehouseId === this.form.inWarehouseId)
+        return this.msgInfo("调出和调入仓库不可一致");
+
       this.selectDialog = true;
     },
     handleSelect(row) {
@@ -219,9 +220,11 @@ export default {
         productCode: row.code,
         productName: row.name,
         productId: row.id,
+        specs: row.specs,
         quantity: "",
       };
       this.form.changeProductList.push(product);
+      this.msgSuccess("选择成功");
     },
     deleteRow(index) {
       this.form.changeProductList.splice(index, 1);

+ 8 - 21
src/views/inventory-management/check/sendCheck.vue

@@ -93,36 +93,20 @@
       width="80%"
       top="60px"
     >
-      <el-table :data="tableList">
-        <el-table-column
-          label="产品类型"
-          align="left"
-          prop="type"
-          :formatter="(row) => dictDataEcho(row.type, productTypeList)"
-        />
-        <el-table-column label="产品编码" align="left" prop="code" />
-        <el-table-column label="产品名称" align="left" prop="name" />
-        <el-table-column label="产品单位" align="left" prop="unit" />
-        <el-table-column label="库存" align="left" prop="inventoryQuantity" />
-        <el-table-column label="操作" align="left" width="80">
-          <template slot-scope="scope">
-            <el-button type="text" @click="handleSelect(scope.row)"
-              >选择
-            </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
+      <selectProduct @select="handleSelect"></selectProduct>
     </el-dialog>
   </div>
 </template>
 
 <script>
 import labelTitle from "@/components/label-title/index.vue";
+import selectProduct from "@/components/select-product/index.vue";
+
 import { getProductsByWarehouseId } from "@/api/inventory-management/check.js";
 
 export default {
   name: "addInbound",
-  components: { labelTitle },
+  components: { labelTitle, selectProduct },
   props: {
     form: {
       type: Object,
@@ -183,7 +167,9 @@ export default {
       this.selectDialog = true;
     },
     handleSelect(row) {
-      const flag = this.form.checkDetailsList.some((x) => x.goodsId === row.id);
+      const flag = this.form.checkDetailsList.some(
+        (x) => x.productId === row.id
+      );
       if (flag) return this.msgInfo("该物品已经选择");
       const product = {
         productCode: row.code,
@@ -195,6 +181,7 @@ export default {
         checkQuantity: "",
       };
       this.form.checkDetailsList.push(product);
+      this.msgSuccess("选择成功");
     },
     deleteRow(index) {
       this.form.checkDetailsList.splice(index, 1);

+ 87 - 40
src/views/inventory-management/query/index.vue

@@ -2,7 +2,7 @@
 
 <script>
 import query from "@/components/query/index.vue";
-import * as API from "@/api/order-management/order/JDorder.js";
+import * as API from "@/api/inventory-management/query.js";
 
 export default {
   components: {
@@ -16,15 +16,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        status: "",
         keyword: "",
-        customerName: "",
-        code: "",
-        countryId: "",
-        provinceId: "",
-        cityId: "",
-        minAmountMoney: "",
-        maxAmountMoney: "",
       },
       selectConfigOne: [
         {
@@ -67,27 +59,82 @@ export default {
       value: item.dictKey,
     }));
 
-    // this.getList();
+    this.getList();
   },
   methods: {
     getList() {
       this.loading = true;
-      API.JDorderList(this.queryParams).then(
-        (res) => {
-          this.tableList = res.data.data.records;
-          this.total = res.data.data.total;
-          this.loading = false;
-        },
-        (err) => {
-          console.log("JDorderList: " + err);
-          this.loading = false;
-        }
-      );
+      // if (this.activeName === "first") {
+      //   console.log(1);
+      //   API.byWarehouseList(this.queryParams).then(
+      //     (res) => {
+      //       this.tableList = res.data.data.records;
+      //       this.total = res.data.data.total;
+      //       this.loading = false;
+      //     },
+      //     (err) => {
+      //       console.log("byWarehouseList: " + err);
+      //       this.loading = false;
+      //     }
+      //   );
+      // } else if (this.activeName === "second") {
+      //   console.log(2);
+
+      //   API.byProductList(this.queryParams).then(
+      //     (res) => {
+      //       this.tableList = res.data.data.records;
+      //       this.total = res.data.data.total;
+      //       this.loading = false;
+      //     },
+      //     (err) => {
+      //       console.log("byProductList: " + err);
+      //       this.loading = false;
+      //     }
+      //   );
+      // }
+      switch (this.activeName) {
+        case "first":
+          API.byWarehouseList(this.queryParams).then(
+            (res) => {
+              this.tableList = res.data.data.records;
+              this.total = res.data.data.total;
+              this.loading = false;
+            },
+            (err) => {
+              console.log("byWarehouseList: " + err);
+              this.loading = false;
+            }
+          );
+          break;
+        case "second":
+          API.byProductList(this.queryParams).then(
+            (res) => {
+              this.tableList = res.data.data.records;
+              this.total = res.data.data.total;
+              this.loading = false;
+            },
+            (err) => {
+              console.log("byProductList: " + err);
+              this.loading = false;
+            }
+          );
+          break;
+
+        default:
+          break;
+      }
     },
     handleQuery() {
       this.getList();
     },
-    handleClick() {},
+    handleClick() {
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        keyword: "",
+      };
+      this.handleQuery();
+    },
   },
 };
 </script>
@@ -97,11 +144,11 @@ export default {
       <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane label="按仓库" name="first"> </el-tab-pane>
         <el-tab-pane label="按产品" name="second"> </el-tab-pane>
-        <el-tab-pane label="按组合" name="third"> </el-tab-pane>
+        <!-- <el-tab-pane label="按组合" name="third"> </el-tab-pane> -->
       </el-tabs>
       <div v-show="activeName === 'first'">
         <query
-          :selectConfig="selectConfigTwo"
+          :selectConfig="[]"
           :req="queryParams"
           :isShowMore="false"
           @handleQuery="handleQuery"
@@ -117,13 +164,13 @@ export default {
             align="left"
             :formatter="(row) => dictDataEcho(row.type, productTypeList)"
           /> -->
-          <el-table-column label="仓库名称" align="left" prop="customerName" />
-          <el-table-column label="产品编码" align="left" prop="amountMoney" />
-          <el-table-column label="产品名称" align="left" />
-          <el-table-column label="规格" align="left" prop="orderTime" />
-          <el-table-column label="单位" align="left" prop="orderTime" />
-          <el-table-column label="库存数量" align="left" />
-          <el-table-column label="查看" align="left">
+          <el-table-column label="仓库名称" align="left" prop="warehouseName" />
+          <el-table-column label="产品编码" align="left" prop="productCode" />
+          <el-table-column label="产品名称" align="left" prop="productName" />
+          <el-table-column label="规格" align="left" prop="productSpecs" />
+          <el-table-column label="单位" align="left" prop="productUnit" />
+          <el-table-column label="库存数量" align="left" prop="quantity" />
+          <!-- <el-table-column label="查看" align="left">
             <template>
               <el-button type="text" @click="deleteRow(scope.$index)"
                 >出库记录</el-button
@@ -135,13 +182,13 @@ export default {
                 >调仓记录</el-button
               >
             </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
       </div>
 
       <div v-show="activeName === 'second'">
         <query
-          :selectConfig="selectConfigOne"
+          :selectConfig="[]"
           :req="queryParams"
           :isShowMore="false"
           @handleQuery="handleQuery"
@@ -152,12 +199,12 @@ export default {
           "
         ></query>
         <el-table :data="tableList" v-loading="loading">
-          <el-table-column label="产品编码" align="left" prop="amountMoney" />
-          <el-table-column label="产品名称" align="left" />
-          <el-table-column label="规格" align="left" prop="orderTime" />
-          <el-table-column label="单位" align="left" prop="orderTime" />
-          <el-table-column label="库存数量" align="left" />
-          <el-table-column label="查看" align="left">
+          <el-table-column label="产品编码" align="left" prop="productCode" />
+          <el-table-column label="产品名称" align="left" prop="productName" />
+          <el-table-column label="规格" align="left" prop="productSpecs" />
+          <el-table-column label="单位" align="left" prop="productUnit" />
+          <el-table-column label="库存数量" align="left" prop="quantity" />
+          <!-- <el-table-column label="查看" align="left">
             <template>
               <el-button type="text" @click="deleteRow(scope.$index)"
                 >出库记录</el-button
@@ -169,7 +216,7 @@ export default {
                 >调仓记录</el-button
               >
             </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
       </div>
 

+ 2 - 2
src/views/order-management/afterSales/addAfterSales.vue

@@ -240,8 +240,8 @@ export default {
   },
   created() {},
   mounted() {
-    if (this.form.oredrInfoId) {
-      this.selectOrderId = this.form.oredrInfoId;
+    if (this.form.orderInfoId) {
+      this.selectOrderId = this.form.orderInfoId;
     }
   },
   methods: {

+ 1 - 1
src/views/purchase-management/deliver-goods/index.vue

@@ -135,7 +135,7 @@ export default {
               quantity: x.quantity,
               purchaseId: row.id,
               applyPurchaseId: x.id,
-              shipmentQuantity: "",
+              shipmentQuantity: Number(x.quantity),
             }));
             this.$refs.sendGoods.loading = false;
           },

+ 15 - 3
src/views/purchase-management/deliver-goods/sendGoods.vue

@@ -83,7 +83,11 @@
             <el-table-column label="采购数量" prop="quantity">
             </el-table-column>
 
-            <el-table-column label="发货数量" prop="shipmentQuantity">
+            <el-table-column
+              label="发货数量"
+              prop="shipmentQuantity"
+              align="center"
+            >
               <template slot-scope="scope">
                 <el-form-item
                   :prop="'details.' + scope.$index + '.shipmentQuantity'"
@@ -91,12 +95,14 @@
                   :inline-message="true"
                   label-width="0"
                 >
-                  <el-input
+                  <el-input-number
                     v-model="scope.row.shipmentQuantity"
+                    :controls="false"
                     placeholder="请输入"
                     size="mini"
+                    style="width: 100%"
                   >
-                  </el-input>
+                  </el-input-number>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -171,6 +177,12 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          const sum = this.form.details.reduce((sum, x) => {
+            return sum + Number(x.shipmentQuantity);
+          }, 0);
+          if (sum < 1) {
+            return this.msgInfo("入库总数量不能为0");
+          }
           this.loading = true;
           this.$emit("submit");
         }