瀏覽代碼

多货登记功能

cz 1 年之前
父節點
當前提交
164caa1f08

+ 1 - 0
package.json

@@ -20,6 +20,7 @@
     "dingtalk-jsapi": "^3.0.20",
     "echarts": "^5.4.2",
     "pinia": "^2.0.33",
+    "mitt": "^3.0.1",
     "vant": "^4.1.1",
     "vue": "^3.2.13",
     "vue-i18n": "^9.3.0-beta.16",

+ 3 - 0
src/bus/index.js

@@ -0,0 +1,3 @@
+import mitt from 'mitt';
+const $bus = mitt();
+export default $bus;

+ 5 - 0
src/router/index.js

@@ -362,6 +362,11 @@ const routes = [{
 				component: () => import('../views/purchase-sales/inbound-outbound/waitInbound/manyGoods.vue')
 			},
 			{
+				path: 'manyGoodsPage',
+				name: '多货登记明细',
+				component: () => import('../views/purchase-sales/inbound-outbound/manyGoods/index.vue')
+			},
+			{
 				path: 'selectGood',
 				name: '物品选择',
 				component: () => import('../views/purchase-sales/inbound-outbound/waitInbound/selectGood.vue')

+ 3 - 0
src/store/manyGood.js

@@ -17,6 +17,9 @@ const useSelectGoodStore = defineStore(
       },
       clearGood() {
         this.selectGood = []
+      },
+      setGood(data) {
+        this.selectGood = data
       }
     }
   })

+ 1 - 1
src/views/main.vue

@@ -4,7 +4,7 @@
 			<router-view />
     	</KeepAlive> -->
     <router-view v-slot="{ Component, route }">
-      <keep-alive :include="['working','manyGoods']">
+      <keep-alive :include="['working']">
         <component v-if="!route.meta.link" :is="Component" :key="route.fullPath" />
       </keep-alive>
     </router-view>

+ 189 - 0
src/views/purchase-sales/inbound-outbound/manyGoods/index.vue

@@ -0,0 +1,189 @@
+<template>
+  <van-nav-bar :title="'入库多货明细'" left-text="" left-arrow @click-left="onClickLeft">
+    <!-- <template #right> 添加 </template> -->
+  </van-nav-bar>
+  <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
+  <van-pull-refresh v-model="loading" @refresh="onRefresh">
+    <div class="list">
+      <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
+        <commonList :data="listData" @onClick="toDtl" :config="listConfig" :showMore="false">
+          <template #businessType="{row}">
+            <div style="width:100%">
+              {{dictValueLabel(row.businessType,businessType)}}
+            </div>
+          </template>
+          <template #logistics="{row}">
+            <div style="width:100%">
+              {{ row.logisticsCompanyName }} (
+              <span style="cursor: pointer; color: #409eff"> {{ row.logisticsCode }} </span>
+              )
+            </div>
+          </template>
+
+          <template #processingMethod="{row}">
+            <div style="width:100%">
+              <span> {{dictValueLabel(row.processingMethod,statusData)}}</span>
+            </div>
+          </template>
+
+        </commonList>
+        <div></div>
+      </van-list>
+    </div>
+  </van-pull-refresh>
+</template>
+<script setup>
+import { ref, getCurrentInstance, onMounted } from "vue";
+import commonList from "@/components/common-list.vue";
+import { useRoute } from "vue-router";
+import { showSuccessToast, showConfirmDialog } from "vant";
+
+const loading = ref(false);
+const router = useRoute();
+const req = ref({
+  pageNum: 1,
+  keyword: null,
+});
+const finished = ref(false);
+const proxy = getCurrentInstance().proxy;
+const listData = ref([]);
+
+const listConfig = ref([
+  {
+    label: "入库单",
+    prop: "businessCode",
+  },
+  {
+    type: "slot",
+    slotName: "logistics",
+    label: "物流/快递信息",
+  },
+  {
+    label: "物品编码",
+    prop: "productCustomCode",
+  },
+  {
+    label: "物品名称",
+    prop: "productName",
+  },
+  {
+    label: "物品规格",
+    prop: "productSpec",
+  },
+  {
+    label: "数量",
+    prop: "quantity",
+  },
+  {
+    type: "slot",
+    slotName: "processingMethod",
+    label: "处理结果",
+  },
+]);
+const onRefresh = () => {
+  req.value.pageNum = 1;
+  finished.value = false;
+  getList("refresh");
+};
+const onLoad = () => {
+  getList();
+};
+
+const onClickLeft = () => proxy.$router.push("/main/working");
+
+const onClickRight = () => {
+  proxy.$router.push("/main/manualInboundAdd");
+};
+
+const toDtl = (row) => {
+  return;
+  proxy.$router.push({
+    path: "waitInboundAdd",
+    query: {
+      id: row.id,
+    },
+  });
+};
+const businessType = ref([
+  { label: "线边回仓", value: "1" },
+  { label: "完工入库", value: "2" },
+  { label: "采购到货", value: "3" },
+  { label: "退货出库", value: "4" },
+]);
+
+const statusData = ref([
+  {
+    label: "未处理",
+    value: "0",
+  },
+  {
+    label: "退货",
+    value: "10",
+  },
+  {
+    label: "入库",
+    value: "20",
+  },
+  {
+    label: "申购",
+    value: "30",
+  },
+]);
+
+const getList = (type) => {
+  loading.value = true;
+  proxy
+    .post("/excessGoodsDetails/page", req.value)
+    .then((res) => {
+      // res.data.rows = res.data.rows.map((x) => ({
+      //   ...x,
+      //   ...JSON.parse(x.victoriatouristJson),
+      // }));
+      listData.value =
+        type === "refresh"
+          ? res.data.rows
+          : listData.value.concat(res.data.rows);
+      if (req.value.pageNum * 10 >= res.data.total) {
+        finished.value = true;
+      }
+      req.value.pageNum++;
+      loading.value = false;
+    })
+    .catch((err) => {
+      loading.value = false;
+    });
+};
+getList();
+
+const handleEndInbound = (row) => {
+  showConfirmDialog({
+    title: "提示",
+    message: `您确定结束入库吗?`,
+  })
+    .then(() => {
+      proxy
+        .post("/stockWait/endInStock", {
+          id: row.id,
+        })
+        .then((res) => {
+          showSuccessToast("操作成功");
+          onRefresh();
+        });
+    })
+    .catch(() => {
+      return;
+    });
+};
+</script>
+
+<style lang="scss" scoped>
+.list {
+  min-height: 70vh;
+}
+.aa {
+  background: #fa9841;
+  border-radius: 2px;
+  color: #fff;
+  padding: 4px;
+}
+</style>

+ 144 - 23
src/views/purchase-sales/inbound-outbound/waitInbound/add.vue

@@ -1,7 +1,8 @@
 <template>
   <div class="form">
     <van-nav-bar :title="$t('waitInbound.name')" :left-text="$t('common.back')" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
-      <template #right> 多货登记 </template>
+      <template #right>
+        <van-button plain type="primary" size="small">多货登记</van-button> </template>
     </van-nav-bar>
     <van-tabs v-model:active="active">
       <van-tab title="入库明细" :name="0" />
@@ -22,46 +23,121 @@
       </van-cell-group>
       <!-- overflow-x: auto;width:calc(100% - 20px) -->
       <van-cell-group inset v-show="active==0" style="padding:10px;">
+        <van-search v-model="keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onSearch" style="padding:0px" />
         <table class="table">
           <thead>
             <tr>
-              <th style="width:40%;text-align:left;">物品信息</th>
-              <th style="width:15%">采购数量</th>
-              <th style="width:15%">本次发货</th>
+              <th style="width:46%;text-align:left;">物品信息</th>
+              <th style="width:13%">采购
+                <br>数量
+              </th>
+              <th style="width:13%">本次
+                <br>发货
+              </th>
               <th style="width:15%">已入库</th>
-              <th style="width:15%">本次清点
-                累计
+              <th style="width:13%">累计
+                <br>
+                清点
               </th>
             </tr>
           </thead>
         </table>
-        <div style="height:calc(100vh - 280px);overflow-y:auto">
-          <table class="table">
+        <div style="height:calc(100vh - 300px);overflow-y:auto">
+          <table class="table" v-if="!keyword">
             <tbody>
               <template v-for="(row,index) in formData.stockWaitDetailsList" :key="row.id">
                 <div style="height:10px">
+                </div>
+                <tr>
+                  <td style="text-align:left;width:46%">
+                    <div>编码:{{row.productCustomCode}}</div>
+                    <div style="margin-top:3px">名称:{{row.productName}}</div>
+                    <div style="margin-top:3px">规格:{{row.productSpec}}</div>
+                  </td>
+                  <td style="width:13%">
+                    <div>{{row.purchaseQuantity}}</div>
+                  </td>
+                  <td style="width:13%">
+                    <div>{{row.arrivalQuantity}}</div>
+                  </td>
+                  <td style="width:15%">
+                    <div>{{row.receiptQuantity}}</div>
+                  </td>
+                  <td style="width:13%">
+                    <div style="color:red">{{row.quantity}}</div>
+                  </td>
+                </tr>
+                <tr style="border-bottom:1px solid #f1f1f1;">
+                  <td colspan="5" style="padding:0 6px">
+                    <div style="text-align:center;color:#b7b0b0;margin-bottom:10px" @click="row.isArrow =!row.isArrow">
+                      <span>在线清点登记</span>
+                      <van-icon :name="!row.isArrow ?'arrow-down':'arrow-up'" style="margin-left:5px" />
+                    </div>
+                    <div v-show="row.isArrow" style="margin-top:5px;margin-bottom:10px">
+                      <div style="display:flex;margin-bottom:8px ;align-items:center">
+                        <van-field v-model="row.addQuantity" type="digit" label="" placeholder="请输入临时清点数量" style="background-color:#f7f7f7;" />
+                        <van-button type="success" size="small" style="width:60px;margin-left:10px" @click="handleStag(row,index)">暂存</van-button>
+                      </div>
+                      <div>
+                        <table class="tableTwo">
+                          <thead>
+                            <tr>
+                              <th>时间</th>
+                              <th style="width:70px">清点数量</th>
+                              <th style="width:70px">提交状态</th>
+                              <th style="width:50px">操作</th>
+                            </tr>
+                          </thead>
+                          <tbody>
+                            <tr v-for="(sonRow,sonIndex) in row.stockWaitDetailsCheckList" :key="sonIndex">
+                              <td>
+                                {{sonRow.createTime}}
+                              </td>
+                              <td>
+                                {{sonRow.quantity}}
+                              </td>
+                              <td>
+                                {{sonRow.status==2?'已提交':'未提交'}}
+                              </td>
+                              <td>
+                                <span style="color:#409EFF;cursor:pointer" v-if="sonRow.status !=2" @click="handleDelete(row,index,sonRow)">删除</span>
+                              </td>
+                            </tr>
+                          </tbody>
+                        </table>
+                      </div>
+                    </div>
+                  </td>
+                </tr>
+              </template>
+            </tbody>
+          </table>
 
+          <table class="table" v-else>
+            <tbody>
+              <template v-for="(row,index) in formData.stockWaitDetailsListCopy" :key="row.id">
+                <div style="height:10px">
                 </div>
                 <tr>
-                  <td style="text-align:left;width:40%">
+                  <td style="text-align:left;width:31%">
                     <div>编码:{{row.productCustomCode}}</div>
                     <div>名称:{{row.productName}}</div>
                     <div>规格:{{row.productSpec}}</div>
                   </td>
-                  <td style="width:15%">
+                  <td style="width:18%">
                     <div>{{row.purchaseQuantity}}</div>
                   </td>
-                  <td style="width:15%">
+                  <td style="width:18%">
                     <div>{{row.arrivalQuantity}}</div>
                   </td>
                   <td style="width:15%">
                     <div>{{row.receiptQuantity}}</div>
                   </td>
-                  <td style="width:15%">
+                  <td style="width:18%">
                     <div style="color:red">{{row.quantity}}</div>
                   </td>
                 </tr>
-                <tr style="border-bottom:1px solid #dbd4d4;">
+                <tr style="border-bottom:1px solid #f1f1f1;">
                   <td colspan="5" style="padding:0 6px">
                     <div style="text-align:center;color:#b7b0b0;margin-bottom:10px" @click="row.isArrow =!row.isArrow">
                       <span>在线清点登记</span>
@@ -83,7 +159,6 @@
                             </tr>
                           </thead>
                           <tbody>
-
                             <tr v-for="(sonRow,sonIndex) in row.stockWaitDetailsCheckList" :key="sonIndex">
                               <td>
                                 {{sonRow.createTime}}
@@ -108,11 +183,10 @@
             </tbody>
           </table>
         </div>
-
       </van-cell-group>
 
-      <div style="margin: 10px">
-        <van-button round block type="primary" native-type="submit">
+      <div style="margin: 5px">
+        <van-button round block type="primary" native-type="submit" style="height:30px">
           {{$t('common.submit')}}
         </van-button>
       </div>
@@ -221,6 +295,7 @@ onMounted(() => {
             isArrow: false,
             stockWaitDetailsCheckList: x.stockWaitDetailsCheckList || [],
           })),
+          stockWaitDetailsListCopy: [],
         };
       });
   }
@@ -229,11 +304,35 @@ onMounted(() => {
 
 const getSonList = (query, index) => {
   proxy.post("/stockWaitDetailsCheck/list", query).then((res) => {
-    formData.value.stockWaitDetailsList[index].stockWaitDetailsCheckList =
-      res.data;
-    formData.value.stockWaitDetailsList[index].quantity = res.data
-      .filter((x) => x.status != 2)
-      .reduce((total, y) => (total += Number(y.quantity)), 0);
+    if (keyword.value) {
+      formData.value.stockWaitDetailsListCopy[index].stockWaitDetailsCheckList =
+        res.data;
+      formData.value.stockWaitDetailsListCopy[index].quantity = res.data
+        .filter((x) => x.status != 2)
+        .reduce((total, y) => (total += Number(y.quantity)), 0);
+      // 修改数据
+      let id = formData.value.stockWaitDetailsListCopy[index].id;
+      if (id) {
+        let noKeywordIndex = formData.value.stockWaitDetailsList.findIndex(
+          (x) => x.id == id
+        );
+        if (noKeywordIndex != -1) {
+          formData.value.stockWaitDetailsList[
+            noKeywordIndex
+          ].stockWaitDetailsCheckList = res.data;
+          formData.value.stockWaitDetailsList[noKeywordIndex].quantity =
+            res.data
+              .filter((x) => x.status != 2)
+              .reduce((total, y) => (total += Number(y.quantity)), 0);
+        }
+      }
+    } else {
+      formData.value.stockWaitDetailsList[index].stockWaitDetailsCheckList =
+        res.data;
+      formData.value.stockWaitDetailsList[index].quantity = res.data
+        .filter((x) => x.status != 2)
+        .reduce((total, y) => (total += Number(y.quantity)), 0);
+    }
   });
 };
 
@@ -280,10 +379,32 @@ const onClickRight = () => {
     },
   });
 };
+const keyword = ref("");
+const onSearch = (val) => {
+  formData.value.stockWaitDetailsListCopy = [];
+  let list = formData.value.stockWaitDetailsList;
+  for (let i = 0; i < list.length; i++) {
+    const row = list[i];
+    if (
+      row.productCustomCode.indexOf(val) != -1 ||
+      row.productName.indexOf(val) != -1 ||
+      row.productSpec.indexOf(val) != -1
+    ) {
+      formData.value.stockWaitDetailsListCopy.push({ ...row });
+    }
+  }
+};
 </script>
 <style lang="scss" scoped>
 * {
-  font-size: 12px;
+  font-size: 11px;
+}
+:deep(.van-search__field) {
+  display: flex;
+  .van-field__label--top {
+    width: 20px;
+    margin-bottom: 0px;
+  }
 }
 .row {
   display: flex;

+ 100 - 55
src/views/purchase-sales/inbound-outbound/waitInbound/manyGoods.vue

@@ -13,38 +13,41 @@
         <van-field v-model="formData.businessTypeName" readonly :label="$t('waitInbound.dataSource')" />
         <van-field v-model="formData.businessCode" readonly label="入库单号" />
         <van-field v-model="formData.code" readonly label="物流信息" />
-        <div style="padding:0 16px;">
-          <van-button type="primary" round block @click="openSelectGood()">选择物品</van-button>
-        </div>
+
         <!-- <van-popup v-model:show="typeModal" round position="bottom">
           <van-picker :columns="columns" @cancel="typeModal = false" @confirm="onConfirm" />
         </van-popup> -->
       </van-cell-group>
       <!-- overflow-x: auto;width:calc(100% - 20px) -->
+      <div style="padding:0 5px;margin:5px 0">
+        <van-button type="primary" round block @click="openSelectGood()" style="height:30px">选择物品</van-button>
+      </div>
       <van-cell-group inset style="padding:10px;">
         <table class="table">
           <thead>
             <tr>
-              <th style="width:300px">物品信息</th>
+              <th style="width:60%;text-align: left">物品信息</th>
               <!-- <th style="min-width:60px">采购数量</th>
               <th style="min-width:60px">本次发货</th>
               <th style="min-width:45px">已入库</th> -->
-              <th style="min-width:85px">本次登记累计</th>
+              <th style="width:25%">本次登记累计</th>
+              <th style="width:15%">操作</th>
             </tr>
           </thead>
         </table>
-        <div style="height:calc(100vh - 495px);overflow-y:auto">
+        <!-- style="height:calc(100vh - 495px);overflow-y:auto" -->
+        <div>
           <table class="table">
             <tbody>
-              <template v-for="(row,index) in formData.stockWaitDetailsList" :key="row.id">
+              <template v-for="(row,index) in formData.productList" :key="row.id">
                 <div style="height:10px">
 
                 </div>
                 <tr>
-                  <td style="text-align:left;width:300px">
+                  <td style="text-align:left;width:60%">
                     <div>编码:{{row.productCode}}</div>
-                    <div>名称:{{row.productName}}</div>
-                    <div>规格:{{row.productSpec}}</div>
+                    <div style="margin-top:3px">名称:{{row.productName}}</div>
+                    <div style="margin-top:3px">规格:{{row.productSpec}}</div>
                   </td>
                   <!-- <td style="min-width:60px">
                     <div>{{row.purchaseQuantity}}</div>
@@ -55,14 +58,17 @@
                   <td style="min-width:45px">
                     <div>{{row.receiptQuantity}}</div>
                   </td> -->
-                  <td style="min-width:85px">
-                    <div style="color:red">{{row.quantity}}</div>
+                  <td style="width:25%">
+                    <div style="color:red;">{{row.quantity}}</div>
+                  </td>
+                  <td style="width:15%">
+                    <span style="color:#409EFF;cursor:pointer" @click="handleDeleteRow(row,index)">删除</span>
                   </td>
                 </tr>
-                <tr style="border-bottom:1px solid #dbd4d4;">
+                <tr style="border-bottom:1px solid #f1f1f1;">
                   <td colspan="5" style="padding:0 6px">
                     <div style="text-align:center;color:#b7b0b0;margin-bottom:10px" @click="row.isArrow =!row.isArrow">
-                      <span>在线登记登记</span>
+                      <span>在线登记</span>
                       <van-icon :name="!row.isArrow ?'arrow-down':'arrow-up'" style="margin-left:5px" />
                     </div>
                     <div v-show="row.isArrow" style="margin-top:5px;margin-bottom:10px">
@@ -76,13 +82,12 @@
                             <tr>
                               <th>时间</th>
                               <th style="width:70px">登记数量</th>
-                              <th style="width:70px">提交状态</th>
                               <th style="width:50px">操作</th>
                             </tr>
                           </thead>
                           <tbody>
 
-                            <tr v-for="(sonRow,sonIndex) in row.stockWaitDetailsCheckList" :key="sonIndex">
+                            <tr v-for="(sonRow,sonIndex) in row.excessGoodsRegisterList" :key="sonIndex">
                               <td>
                                 {{sonRow.createTime}}
                               </td>
@@ -90,9 +95,6 @@
                                 {{sonRow.quantity}}
                               </td>
                               <td>
-                                {{sonRow.status==2?'已提交':'未提交'}}
-                              </td>
-                              <td>
                                 <span style="color:#409EFF;cursor:pointer" v-if="sonRow.status !=2" @click="handleDelete(row,index,sonRow)">删除</span>
                               </td>
                             </tr>
@@ -109,8 +111,8 @@
 
       </van-cell-group>
 
-      <div style="margin: 10px">
-        <van-button round block type="primary" native-type="submit">
+      <div style="margin: 5px">
+        <van-button round block type="primary" native-type="submit" style="height:30px">
           {{$t('common.submit')}}
         </van-button>
       </div>
@@ -126,22 +128,13 @@ import { useRoute } from "vue-router";
 import { parseTime } from "@/utils/ruoyi";
 import useSelectGoodStore from "@/store/manyGood";
 const selectGoodStore = useSelectGoodStore();
+import $bus from "@/bus/index.js";
+
 const proxy = getCurrentInstance().proxy;
 const active = ref(0);
 const route = useRoute();
 const typeModal = ref(false);
 const formData = ref({});
-const list = computed(() =>
-  selectGoodStore.selectGood.map((x) => ({ ...x, quantity: 0 }))
-);
-watch(
-  () => list.value,
-  (val) => {
-    console.log(list.value, "sasaw");
-
-    formData.value.stockWaitDetailsList = list.value;
-  }
-);
 const getDict = () => {
   proxy.post("/warehouse/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
     columns.value = res.data.rows.map((item) => {
@@ -171,16 +164,19 @@ const onConfirm = ({ selectedOptions }) => {
 const onClickLeft = () => history.back();
 
 const onSubmit = () => {
-  const list = formData.value.stockWaitDetailsList;
+  const list = formData.value.productList;
+  if (!(list && list.length > 0)) {
+    return showFailToast("请选择物品");
+  }
   const total = list.reduce((total, x) => (total += Number(x.quantity)), 0);
   if (!(total > 0)) {
     return showFailToast("登记累计不能为0");
   }
-  proxy.post("/stockWait/addByWdly", formData.value).then(
+  proxy.post("/excessGoodsInfo/add", { stockWaitId: formData.value.id }).then(
     (res) => {
+      showSuccessToast("操作成功");
       setTimeout(() => {
-        showSuccessToast(proxy.$t("manualInbound.warehousingSuccess"));
-        proxy.$router.push("/main/waitInbound");
+        onClickLeft();
       }, 500);
     },
     (err) => {
@@ -199,23 +195,58 @@ const businessType = ref([
   { label: "退货出库", value: "4" },
 ]);
 
+const getProductList = () => {
+  proxy.post("/excessGoodsDetails/list", { stockWaitId: route.query.id }).then(
+    (res) => {
+      if (res && res.data && res.data.length > 0) {
+        formData.value.productList = res.data.map((x) => ({
+          ...x,
+          productCode: x.productCustomCode,
+          quantity: x.excessGoodsRegisterList
+            ? x.excessGoodsRegisterList.reduce(
+                (total, y) => (total += Number(y.quantity)),
+                0
+              )
+            : 0,
+        }));
+        selectGoodStore.setGood(formData.value.productList);
+      } else {
+        formData.value.productList = [];
+        selectGoodStore.clearGood();
+      }
+    },
+    (err) => {
+      console.log(err);
+    }
+  );
+};
 onMounted(() => {
   selectGoodStore.clearGood();
+  // $bus.on("selectGood", (row) => {
+  //   formData.value.productList.push({
+  //     productId: row.id,
+  //     productCode: row.customCode,
+  //     productName: row.name,
+  //     productSpec: row.spec,
+  //   });
+  // });
   if (route.query && route.query.id) {
     formData.value = {
       ...route.query,
+      productList: [],
     };
+    getProductList();
   }
   // getDict();
 });
 
 const getSonList = (query, index) => {
-  proxy.post("/stockWaitDetailsCheck/list", query).then((res) => {
-    formData.value.stockWaitDetailsList[index].stockWaitDetailsCheckList =
-      res.data;
-    formData.value.stockWaitDetailsList[index].quantity = res.data
-      .filter((x) => x.status != 2)
-      .reduce((total, y) => (total += Number(y.quantity)), 0);
+  proxy.post("/excessGoodsRegister/list", query).then((res) => {
+    formData.value.productList[index].excessGoodsRegisterList = res.data;
+    formData.value.productList[index].quantity = res.data.reduce(
+      (total, y) => (total += Number(y.quantity)),
+      0
+    );
   });
 };
 
@@ -223,16 +254,14 @@ const handleStag = (row, index) => {
   if (Number(row.addQuantity) > 0) {
     let obj = {
       stockWaitId: formData.value.id,
-      stockWaitDetailsId: row.id,
+      excessGoodsDetailsId: row.id,
       createTime: parseTime(new Date()),
       quantity: Number(row.addQuantity),
-      status: 0,
     };
-    // row.stockWaitDetailsCheckList.push(obj);
-
-    proxy.post("/stockWaitDetailsCheck/add", obj).then((res) => {
+    proxy.post("/excessGoodsRegister/add", obj).then((res) => {
       row.addQuantity = "";
-      getSonList({ stockWaitDetailsId: row.id }, index);
+      // getSonList({ stockWaitId: formData.value.id }, index);
+      getProductList();
       return showSuccessToast("暂存成功");
     });
   } else {
@@ -240,13 +269,23 @@ const handleStag = (row, index) => {
   }
 };
 
-const handleDelete = (row, index, sonRow) => {
-  // formData.value.stockWaitDetailsList[index].stockWaitDetailsCheckList.splice(
-  //   sonIndex,
-  //   1
+const handleDeleteRow = (row, index) => {
+  // let currentIndex = selectGoodStore.selectGood.findIndex(
+  //   (x) => x.productId == row.productId
   // );
-  proxy.post("/stockWaitDetailsCheck/delete", { id: sonRow.id }).then((res) => {
-    getSonList({ stockWaitDetailsId: row.id }, index);
+  // if (currentIndex != -1) {
+  //   selectGoodStore.selectGood.splice(currentIndex, 1);
+  // }
+  proxy.post("/excessGoodsDetails/delete", { id: row.id }).then((res) => {
+    getProductList();
+    return showSuccessToast("删除成功");
+  });
+};
+
+const handleDelete = (row, index, sonRow) => {
+  proxy.post("/excessGoodsRegister/delete", { id: sonRow.id }).then((res) => {
+    // getSonList({ stockWaitId: formData.value.id }, index);
+    getProductList();
     return showSuccessToast("删除成功");
   });
 };
@@ -254,10 +293,16 @@ const handleDelete = (row, index, sonRow) => {
 const openSelectGood = () => {
   proxy.$router.push({
     path: "/main/selectGood",
+    query: {
+      stockWaitId: formData.value.id,
+    },
   });
 };
 </script>
 <style lang="scss" scoped>
+* {
+  font-size: 11px;
+}
 .row {
   display: flex;
   padding: 5px 10px 0 10px;
@@ -280,7 +325,7 @@ const openSelectGood = () => {
   color: #606266;
   thead tr th {
     padding: 6px 2px;
-    text-align: left;
+    text-align: center;
     color: #000;
   }
   td {

+ 14 - 4
src/views/purchase-sales/inbound-outbound/waitInbound/selectGood.vue

@@ -11,7 +11,6 @@
           <template #btn="{row}">
             <div style="width:100%;text-align:right">
               <van-button type="primary" size="small" @click="selectRow(row)">选择</van-button>
-
             </div>
           </template>
         </commonList>
@@ -26,8 +25,9 @@ import { useRoute } from "vue-router";
 import useSelectGoodStore from "@/store/manyGood";
 import { showSuccessToast, showFailToast } from "vant";
 const selectGoodStore = useSelectGoodStore();
+import $bus from "@/bus/index.js";
 const loading = ref(false);
-const router = useRoute();
+const route = useRoute();
 const req = ref({
   pageNum: 1,
   keyword: null,
@@ -134,8 +134,18 @@ const getList = (type) => {
 };
 
 const selectRow = (row) => {
-  selectGoodStore.pushGood(row);
-  return showSuccessToast("选择成功");
+  let flag = selectGoodStore.selectGood.some((x) => x.productId == row.id);
+  if (!flag) {
+    // $bus.emit("selectGood", row);
+    selectGoodStore.pushGood(row);
+    proxy.post("/excessGoodsDetails/add", {
+      stockWaitId: route.query.stockWaitId,
+      productId: row.id,
+    });
+    return showSuccessToast("选择成功");
+  } else {
+    return showFailToast("该产品已选择");
+  }
 };
 </script>
 

+ 9 - 9
src/views/purchase-sales/inventory-management/Inventory/index.vue

@@ -24,7 +24,7 @@
       </thead>
     </table>
   </div>
-  <div style="overflow-y:auto" :style="{height:active!='three'?'calc(100vh - 300px)':'calc(100vh - 210px)'}">
+  <div style="overflow-y:auto" :style="{height:active!='three'?'calc(100vh - 275px)':'calc(100vh - 210px)'}">
     <van-pull-refresh v-model="loading" @refresh="onRefresh">
       <div class="list">
         <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="getList" style="margin-bottom: 60px">
@@ -43,16 +43,16 @@
                   <div>
                     仓库名称:{{row.warehouseName}}
                   </div>
-                  <div>
+                  <div style="margin-top:3px">
                     物品编码:{{row.productCustomCode}}
                   </div>
-                  <div>
+                  <div style="margin-top:3px">
                     物品名称:{{row.productName}}
                   </div>
-                  <div>
+                  <div style="margin-top:3px">
                     物品规格:{{row.productSpec}}
                   </div>
-                  <div>
+                  <div style="margin-top:3px">
                     可用库存:{{row.quantity}}
                   </div>
                 </div>
@@ -61,7 +61,7 @@
                 </div>
               </div>
 
-              <!-- style="border-bottom:1px solid #dbd4d4;" -->
+              <!-- style="border-bottom:1px solid #f1f1f1;" -->
               <div>
                 <div style="padding:0 6px">
                   <div style="text-align:center;color:#b7b0b0;margin-bottom:10px" @click="row.isArrow =!row.isArrow">
@@ -106,8 +106,8 @@
       </div>
     </van-pull-refresh>
   </div>
-  <div style="padding:0 16px;margin-top:10px" v-if="active!='three'">
-    <van-button type="primary" round block @click="onSubmit()">提交</van-button>
+  <div style="padding:0 16px;margin-top:5px;" v-if="active!='three'">
+    <van-button type="primary" round block @click="onSubmit()" style="height:30px">提交</van-button>
   </div>
 
 </template>
@@ -319,7 +319,7 @@ const onSubmit = () => {
 
 <style lang="scss" scoped>
 * {
-  font-size: 12px;
+  font-size: 11px;
 }
 .list {
   min-height: 70vh;

文件差異過大導致無法顯示
+ 711 - 694
yarn.lock


部分文件因文件數量過多而無法顯示