浏览代码

购物车

lilei 2 年之前
父节点
当前提交
8c05b38be6

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1675933163094
+  "version": 1675934552970
 }

+ 8 - 2
src/views/common/shopingCatModal.vue

@@ -1,7 +1,6 @@
 <template>
   <a-drawer
     :zIndex="zIndex"
-    :title="title"
     placement="right"
     :visible="visible"
     :width="width"
@@ -9,6 +8,10 @@
     :wrap-style="{ position: 'absolute' }"
     @close="onClose"
     wrapClassName="shopingCat-drawer">
+     <div slot="title">
+       <strong>{{title}}</strong>
+       <span style="color:red;margin-left:10px;">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
+     </div>
      <shopingCat ref="shopingCat" modes="modals" @add="handleAdd"></shopingCat>
   </a-drawer>
 </template>
@@ -35,13 +38,16 @@ export default {
       type: Number,
       default: 1050
     },
+    paramsData: {
+      type: Object
+    }
   },
   watch: {
     showModal (newValue, oldValue) {
       this.visible = newValue
       if (newValue) {
          setTimeout(()=>{
-           this.$refs.shopingCat.pageInit()
+           this.$refs.shopingCat.pageInit(this.paramsData)
          },200)
       }
     },

+ 9 - 2
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -53,7 +53,7 @@
       <!-- 上次缺货 -->
       <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
       <!-- 购物车 -->
-      <shopingCatModal :showModal="openShopCatModal" @close="openShopCatModal=false"></shopingCatModal>
+      <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" @close="openShopCatModal=false"></shopingCatModal>
       <!-- 已选产品 -->
       <div>
         <div class="chooseBox-title">
@@ -65,7 +65,7 @@
             <a-button v-if="detail&&detail.totalCategory" id="purchaseNewOrderEdit-add-btn" type="danger" @click="openChooseProduct=true"><a-icon type="plus-circle" />添加产品</a-button>
             <a-button id="purchaseNewOrderEdit-import-btn" type="danger" ghost @click="openGuideModal=true"><a-icon type="import" />产品导入</a-button>
             <a-button id="purchaseNewOrderEdit-outStock-btn" type="danger" ghost @click="handleOutStock"><a-icon type="funnel-plot" />上次缺货</a-button>
-            <a-button id="purchaseNewOrderEdit-cart-btn" type="danger" ghost @click="openShopCatModal=true"><a-icon type="shopping" />购物车</a-button>
+            <a-button id="purchaseNewOrderEdit-cart-btn" type="danger" ghost @click="hanldCart"><a-icon type="shopping" />购物车</a-button>
           </div>
         </div>
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
@@ -385,6 +385,13 @@ export default {
     hanldeOks () {
       this.getOrderDetail(false, true, true)
     },
+    // 打开购物车
+    hanldCart(){
+      this.paramsData = {
+        purchaseBillSn: this.$route.params.sn
+      }
+      this.openShopCatModal=true
+    },
     // 上次缺货
     handleOutStock () {
       // 校验是否存在历史采购单,且上次采购存在缺货产品

+ 11 - 5
src/views/shoppingCarManagement/shoppingCar/list.vue

@@ -84,10 +84,11 @@
       <template slot="productCode" slot-scope="text, record">
         <div v-if="modes=='pages'">
           <span style="padding-right: 15px;">{{ text }}</span> 
-          <a-tag v-if="record.onlineFalg == 0">下架</a-tag>
+          <a-tag v-if="record.productEntity.onlineFalg == 0">下架</a-tag>
         </div>
         <div v-else>
-          
+          <span style="padding-right: 15px;">{{ text }}</span>
+          <a-tag v-if="record.productEntity.onlineFalg == 0">下架</a-tag>
         </div>
       </template>
     </s-table>
@@ -96,6 +97,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
 import { purchaseCartList, purchaseDeleteBatch, purchaseUpdateQty } from '@/api/purchaseCart'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
@@ -124,6 +126,7 @@ export default {
         productTypeSn3: '' ,//  产品三级分类
         onlineFalg: undefined
       },
+      paramsData: null,
       openEditPriceModal: false, // 自定义报价弹窗
       disabled: false, //  查询、重置按钮是否可操作
       columns: [],
@@ -131,11 +134,10 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return purchaseCartList(Object.assign(parameter, {productEntity:this.queryParam})).then(res => {
+        return purchaseCartList(Object.assign(parameter, {productEntity:this.queryParam}, this.paramsData)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            this.$store.commit('setCartCount', data.count)
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -151,6 +153,7 @@ export default {
     }
   },
   methods: {
+    ...mapActions(['getCartList']),
     // 查询
     searchForm () {
       this.$refs.table.clearSelected() // 清空表格选中项
@@ -164,6 +167,7 @@ export default {
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
+      this.queryParam.onlineFalg = undefined
       this.productType = []
       this.$refs.table.refresh(true)
       this.rowSelectionInfo = null
@@ -221,6 +225,7 @@ export default {
           }).then(res => {
             if(res.status == 200){
               this.$message.info(res.message)
+              this.getCartList()
               this.searchForm()
             }
             this.loading = false
@@ -243,8 +248,9 @@ export default {
         }
       })
     },
-    pageInit () {
+    pageInit (paramsData) {
       const _this = this
+      this.paramsData = paramsData || {}
       this.setTableH()
       this.getColumns()
       this.resetSearchForm()