Эх сурвалжийг харах

发起退货, 入库登记 调整

lxf 1 жил өмнө
parent
commit
126e6d3c58

+ 7 - 0
src/components/shengde/SelectBOM/index.vue

@@ -111,6 +111,13 @@
                         <span v-else>0</span>
                       </template>
                     </el-table-column>
+                    <el-table-column label="已退货数量" width="120" v-if="putInStorageStatus && purchaseContractId">
+                      <template slot-scope="scope">
+                        <span>已退货数量: </span>
+                        <span v-if="scope.row.returnBomQuantity">{{ Number(scope.row.returnBomQuantity) }}</span>
+                        <span v-else>0</span>
+                      </template>
+                    </el-table-column>
                     <el-table-column label="品号" prop="specCode" width="100" />
                     <el-table-column label="品名" prop="nameChinese" />
                     <el-table-column label="单品尺寸(L*W*H)" prop="specCode" width="120">

+ 20 - 15
src/views/shengde/productionSystem/purchase/salesReturn/addOrModified.vue

@@ -38,12 +38,6 @@
           >
             <el-table-column label="品号" prop="bomColorCode" width="130" />
             <el-table-column label="品名" prop="bomColorName" min-width="180" />
-            <!-- <el-table-column label="颜色" prop="color" width="140" />
-            <el-table-column label="尺寸(长宽高,cm)" width="140">
-              <template slot-scope="scope">
-                <span>{{ `${scope.row.productLong} *${scope.row.productWide}*${scope.row.productHigh}` }} </span>
-              </template>
-            </el-table-column> -->
             <el-table-column label="含税单价" width="100">
               <template slot-scope="scope">
                 <span>¥{{ moneyFormat(scope.row.price, 3) }}</span>
@@ -57,11 +51,19 @@
             <el-table-column label="已退货数量" width="100">
               <template slot-scope="scope">
                 <span v-if="scope.row.returnedQuantity">{{ Number(scope.row.returnedQuantity) }}</span>
+                <span v-else>0</span>
               </template>
             </el-table-column>
             <el-table-column label="剩余数量" width="100">
               <template slot-scope="scope">
                 <span v-if="scope.row.surplusQuantity">{{ Number(scope.row.surplusQuantity) }}</span>
+                <span v-else>0</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="已入库数量" width="100">
+              <template slot-scope="scope">
+                <span v-if="scope.row.stockQuantity">{{ Number(scope.row.stockQuantity) }}</span>
+                <span v-else>0</span>
               </template>
             </el-table-column>
             <el-table-column label="含税小计" align="right" width="100">
@@ -93,11 +95,6 @@
                 <span>¥{{ moneyFormat(scope.row.amount, 3) }}</span>
               </template>
             </el-table-column>
-            <!-- <el-table-column label="操作" align="center" width="80" fixed="right" v-if="!(this.rowData && this.rowData.id)">
-              <template slot-scope="scope">
-                <el-button type="text" @click="clickRemove(scope.$index)">删除</el-button>
-              </template>
-            </el-table-column> -->
           </el-table>
         </div>
       </el-card>
@@ -183,7 +180,7 @@
 
 <script>
 import * as API from '@/api/shengde/productionSystem/purchase/salesReturn'
-import { purchaseContractGetList, purchaseContractDetail } from '@/api/shengde/productionSystem/purchase/contract'
+import { purchaseContractList, purchaseContractDetail } from '@/api/shengde/productionSystem/purchase/contract'
 import LabelTemplate from '@/components/LabelTemplate'
 import Utils from '@/util/transit'
 import { mapGetters } from 'vuex'
@@ -214,8 +211,8 @@ export default {
     }
   },
   created() {
-    purchaseContractGetList({}).then((res) => {
-      this.contractList = res.data.data.list
+    purchaseContractList({ pageNum: 1, pageSize: 9999, type: 1 }).then((res) => {
+      this.contractList = res.data.data.records
     })
     this.rowData = this.$route.query
   },
@@ -327,6 +324,13 @@ export default {
         purchaseContractDetail({ id: val }).then((res) => {
           if (res.data.data.purchaseContractProductList && res.data.data.purchaseContractProductList.length > 0) {
             this.form.purchaseReturnBomList = res.data.data.purchaseContractProductList.map((item) => {
+              let surplusQuantity = 0
+              if (item.stockQuantity) {
+                surplusQuantity = Number(item.stockQuantity)
+              }
+              if (item.returnedQuantity) {
+                surplusQuantity = surplusQuantity - Number(item.returnedQuantity)
+              }
               return {
                 bomColorCode: item.bomColorCode,
                 bomColorName: item.bomColorName,
@@ -337,12 +341,13 @@ export default {
                 price: item.price,
                 recentQuantity: item.quantity,
                 returnedQuantity: item.returnedQuantity,
-                surplusQuantity: item.surplusQuantity,
+                surplusQuantity: surplusQuantity,
                 sumPrice: item.sumPrice,
                 quantity: undefined,
                 amount: 0,
                 purchaseContractProductId: item.id,
                 remark: item.remark,
+                stockQuantity: item.stockQuantity,
               }
             })
           } else {

+ 3 - 0
src/views/shengde/warehouse/putInStorage/material.vue

@@ -83,6 +83,9 @@ export default {
             if (row.stockQuantity) {
               quantity = Number(parseFloat(Number(quantity) - Number(row.stockQuantity)).toFixed(0))
             }
+            if (row.returnBomQuantity) {
+              quantity = Number(parseFloat(Number(quantity) + Number(row.returnBomQuantity)).toFixed(0))
+            }
             this.form.details.push({
               businessId: row.id,
               approveQuantity: quantity,