浏览代码

Merge branch 'develop_yh13' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh13

chenrui 2 年之前
父节点
当前提交
78e50f0312

+ 1 - 1
public/version.json

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

+ 45 - 0
src/api/purchaseCart.js

@@ -0,0 +1,45 @@
+import { axios } from '@/utils/request'
+
+// 购物车列表
+export const purchaseCartList = (params) => {
+  const url = `/purchaseCart/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 添加到购物车
+export const purchaseCartSave = params => {
+  return axios({
+    url: '/purchaseCart/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 购物车已存在的产品
+export const purchaseCartExistProduct = params => {
+  return axios({
+    url: '/purchaseCart/existProduct',
+    data: params,
+    method: 'post'
+  })
+}
+// 批量删除购物车产品
+export const purchaseDeleteBatch = params => {
+  return axios({
+    url: '/purchaseCart/deleteBatch',
+    data: params,
+    method: 'post'
+  })
+}
+// 修改购物车数量
+export const purchaseUpdateQty = params => {
+  return axios({
+    url: '/purchaseCart/updateQty',
+    data: params,
+    method: 'post'
+  })
+}

+ 5 - 3
src/components/tools/UserMenu.vue

@@ -6,8 +6,10 @@
         <span style="vertical-align: middle;">帮助</span>
         <span style="vertical-align: middle;">帮助</span>
       </p>
       </p>
       <p class="help-cont" @click="showShopCar">
       <p class="help-cont" @click="showShopCar">
-        <a-icon type="shopping-cart" style="font-size:16px;vertical-align: middle;margin: 0 5px;"/>
-        <span style="vertical-align: middle;">购物车</span>
+        <a-badge :count="cartCount">
+          <a-icon type="shopping-cart" style="font-size:16px;margin: 0 5px;"/>
+          <span>购物车</span>
+        </a-badge>
       </p>
       </p>
       <!-- 通知 -->
       <!-- 通知 -->
       <notice-icon class="action"/>
       <notice-icon class="action"/>
@@ -106,7 +108,7 @@ export default {
     NoticeIcon
     NoticeIcon
   },
   },
   computed: {
   computed: {
-    ...mapGetters(['nickname', 'avatar', 'authOrgs', 'userInfo', 'nowRoute', 'theme', 'fontSize', 'printDefNeedle']),
+    ...mapGetters(['nickname', 'avatar', 'authOrgs', 'userInfo', 'nowRoute', 'theme', 'fontSize', 'printDefNeedle','cartCount']),
     authOrgsList () { //  过滤掉当前登录账户(不可由自己切换为自己)
     authOrgsList () { //  过滤掉当前登录账户(不可由自己切换为自己)
       const _this = this
       const _this = this
       const arr = []
       const arr = []

+ 1 - 0
src/config/router.config.js

@@ -76,6 +76,7 @@ export const asyncRouterMap = [
                 meta: {
                 meta: {
                   title: '购物车',
                   title: '购物车',
                   icon: 'contacts',
                   icon: 'contacts',
+                  replaceTab: true,
                   hidden: true
                   hidden: true
                 }
                 }
               }
               }

+ 2 - 1
src/store/getters.js

@@ -27,7 +27,8 @@ const getters = {
   printDefInk:state => state.app.printDefInk,
   printDefInk:state => state.app.printDefInk,
   printUseing:state => state.app.printUseing,
   printUseing:state => state.app.printUseing,
   printSettingType:state => state.app.printSettingType,
   printSettingType:state => state.app.printSettingType,
-  returnReason: state => state.app.returnReason
+  returnReason: state => state.app.returnReason,
+  cartCount: state => state.cart.cartCount
 }
 }
 
 
 export default getters
 export default getters

+ 3 - 1
src/store/index.js

@@ -4,6 +4,7 @@ import Vuex from 'vuex'
 import app from './modules/app'
 import app from './modules/app'
 import user from './modules/user'
 import user from './modules/user'
 import socket from './modules/websocketStore'
 import socket from './modules/websocketStore'
+import cart from './modules/shoppingCart'
 
 
 // default router permission control
 // default router permission control
 import permission from './modules/permission'
 import permission from './modules/permission'
@@ -19,7 +20,8 @@ export default new Vuex.Store({
     app,
     app,
     user,
     user,
     permission,
     permission,
-    socket
+    socket,
+    cart
   },
   },
   state: {
   state: {
 
 

+ 28 - 0
src/store/modules/shoppingCart.js

@@ -0,0 +1,28 @@
+import { purchaseCartList } from '@/api/purchaseCart'
+export default {
+  state: {
+    cartCount: 0,
+  },
+  getters: {
+    cartCount: state => {
+      return () => state.cartCount
+    },
+  },
+  mutations: {
+    setCartCount (state, count) {
+      state.cartCount = count
+    },
+  },
+  actions: {
+    // 获取购物车列表
+    getCartList ({ state, commit }) {
+      purchaseCartList({pageNo:1,pageSize:1}).then(res => {
+        commit('setCartCount', res.data ? res.data.count : 0)
+      })
+    },
+    // 更新购物车数量
+    updateCartCount ({ state, commit }, count) {
+      commit('setCartCount', count)
+    }
+  }
+}

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

@@ -1,7 +1,6 @@
 <template>
 <template>
   <a-drawer
   <a-drawer
     :zIndex="zIndex"
     :zIndex="zIndex"
-    :title="title"
     placement="right"
     placement="right"
     :visible="visible"
     :visible="visible"
     :width="width"
     :width="width"
@@ -9,6 +8,10 @@
     :wrap-style="{ position: 'absolute' }"
     :wrap-style="{ position: 'absolute' }"
     @close="onClose"
     @close="onClose"
     wrapClassName="shopingCat-drawer">
     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>
      <shopingCat ref="shopingCat" modes="modals" @add="handleAdd"></shopingCat>
   </a-drawer>
   </a-drawer>
 </template>
 </template>
@@ -35,13 +38,16 @@ export default {
       type: Number,
       type: Number,
       default: 1050
       default: 1050
     },
     },
+    paramsData: {
+      type: Object
+    }
   },
   },
   watch: {
   watch: {
     showModal (newValue, oldValue) {
     showModal (newValue, oldValue) {
       this.visible = newValue
       this.visible = newValue
       if (newValue) {
       if (newValue) {
          setTimeout(()=>{
          setTimeout(()=>{
-           this.$refs.shopingCat.pageInit()
+           this.$refs.shopingCat.pageInit(this.paramsData)
          },200)
          },200)
       }
       }
     },
     },

+ 19 - 4
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -156,7 +156,7 @@
             class="button-primary"
             class="button-primary"
             @click="goWarehouseDetail(record)"
             @click="goWarehouseDetail(record)"
             id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
             id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
-          <a-button type="link" @click="addShopCar">加入购物车</a-button>
+          <a-button type="link" @click="addShopCar(record)">加入购物车</a-button>
           <span v-if="!$hasPermissions('B_inventoryInventoryQueryDetail') && !$hasPermissions('B_inventoryInventoryQueryStock')">--</span>
           <span v-if="!$hasPermissions('B_inventoryInventoryQueryDetail') && !$hasPermissions('B_inventoryInventoryQueryStock')">--</span>
         </template>
         </template>
       </s-table>
       </s-table>
@@ -164,13 +164,14 @@
     <!-- 库存详情 -->
     <!-- 库存详情 -->
     <inventory-query-detail-modal v-drag :openModal="openModal" :nowData="nowData" @close="closeModal" />
     <inventory-query-detail-modal v-drag :openModal="openModal" :nowData="nowData" @close="closeModal" />
     <!-- 设置采购数量 -->
     <!-- 设置采购数量 -->
-    <set-purchase-qty :openModal="openPurchaseModal" @close="openPurchaseModal=false" v-drag></set-purchase-qty>
+    <set-purchase-qty ref="setPurchaseQty" :openModal="openPurchaseModal" @close="openPurchaseModal=false" v-drag></set-purchase-qty>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
 <script>
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
 import { stockList, stockCount, stockExport } from '@/api/stock'
 import { stockList, stockCount, stockExport } from '@/api/stock'
+import { purchaseCartExistProduct } from '@/api/purchaseCart'
 import ProductType from '../../common/productType.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import ProductBrand from '../../common/productBrand.js'
 import Warehouse from '@/views/common/warehouse.js'
 import Warehouse from '@/views/common/warehouse.js'
@@ -297,8 +298,22 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
-    addShopCar () {
-      this.openPurchaseModal = true
+    // 加入购物车
+    addShopCar (row) {
+      this.spinning = true
+      purchaseCartExistProduct({
+        productSn: row.productSn
+      }).then(res => {
+        if(res.status == 200){
+          if(res.data){
+            this.$message.info("此产品已添加到购物车!")
+          }else{
+            this.$refs.setPurchaseQty.setData(row)
+            this.openPurchaseModal = true
+          }
+        }
+        this.spinning = false
+      })
     },
     },
     // 校验滞销天数数值范围
     // 校验滞销天数数值范围
     checkValueRange () {
     checkValueRange () {

+ 38 - 65
src/views/inventoryManagement/inventoryQuery/setPurchaseQty.vue

@@ -17,16 +17,17 @@
         :label-col="formItemLayout.labelCol"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
       >
-        <a-form-model-item label="产品名称:" prop="checkType">
-          BBB滤清器
+        <a-form-model-item label="产品名称:">
+          {{dateilData&&dateilData.productName}}
         </a-form-model-item>
         </a-form-model-item>
-        <a-form-model-item label="产品编码" prop="warehouseFlag">
-          XX-108
+        <a-form-model-item label="产品编码">
+          {{dateilData&&dateilData.productCode}}
         </a-form-model-item>
         </a-form-model-item>
-        <a-form-model-item label="采购数量" prop="warehouseSnList">
+        <a-form-model-item label="采购数量" prop="qty">
           <a-input-number
           <a-input-number
             id="shelfMonitoringList-maxUnsalableDays"
             id="shelfMonitoringList-maxUnsalableDays"
-            v-model="formItemLayout.warehouseSnList"
+            style="width:60%"
+            v-model="form.qty"
             :precision="0"
             :precision="0"
             :min="0"
             :min="0"
             :max="999999"
             :max="999999"
@@ -43,11 +44,10 @@
 
 
 <script>
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
-import { VSelect } from '@/components'
-import { checkWarehouseSave, checkWarehouseWarehouse } from '@/api/checkWarehouse'
+import { purchaseCartSave } from '@/api/purchaseCart'
+import { mapActions } from 'vuex'
 export default {
 export default {
   name: 'ChainTransferOutBasicInfoModal',
   name: 'ChainTransferOutBasicInfoModal',
-  components: { VSelect },
   mixins: [commonMixin],
   mixins: [commonMixin],
   props: {
   props: {
     openModal: {
     openModal: {
@@ -65,78 +65,51 @@ export default {
         wrapperCol: { span: 20 }
         wrapperCol: { span: 20 }
       },
       },
       form: {
       form: {
-        checkType: 'ALL',
-        warehouseFlag: '0',
-        warehouseSnList: undefined
+        qty: 1,
+        productSn:'',
+        productCode: '',
+        sysFlag: ''
       },
       },
       rules: {
       rules: {
-        checkType: [{ required: true, message: '请选择盘点类型', trigger: 'change' }],
-        warehouseFlag: [{ required: true, message: '请选择是否区分仓库', trigger: 'change' }],
-        warehouseSnList: [{ required: true, message: '请选择盘点仓库', trigger: 'change' }]
+        qty: [{ required: true, message: '请输入采购数量', trigger: 'change' }],
       },
       },
-      checkTypeList: [
-        { dispName: '全盘', code: 'ALL' },
-        { dispName: '自选盘点', code: 'SELECT' }
-      ],
-      warehouseFlagList: [
-        { dispName: '不区分仓库', code: '0' },
-        { dispName: '区分仓库', code: '1' }
-      ],
-      warehouseList: []
+      dateilData: null
     }
     }
   },
   },
   methods: {
   methods: {
+    ...mapActions(['getCartList']),
+    setData(row){
+      this.dateilData = row
+      this.form.productSn = row.productSn
+      this.form.productCode = row.productCode
+      this.form.sysFlag = row.dealerProduct.sysFlag
+      this.form.qty = 1
+    },
     //  保存
     //  保存
     handleSave () {
     handleSave () {
       const _this = this
       const _this = this
-      _this.$emit('close')
-      _this.$router.push({ name: 'shoppingCarList', params: { type: 'pageBtn' } })
       this.$refs.ruleForm.validate(valid => {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
         if (valid) {
-
-          // const form = JSON.parse(JSON.stringify(_this.form))
-          // if (form.checkType == 'ALL') {
-          //   delete form.warehouseFlag
-          // }
-          // if (form.warehouseSnList) {
-          //   form.warehouseSnList = form.warehouseSnList.join(',')
-          // }
-          // _this.spinning = true
-          // checkWarehouseSave(form).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     setTimeout(() => {
-          //       _this.isShow = false
-          //       _this.$emit('ok', res.data)
-          //       _this.spinning = false
-          //     }, 1000)
-          //   } else {
-          //     _this.spinning = false
-          //   }
-          // })
+          const form = JSON.parse(JSON.stringify(_this.form))
+          _this.spinning = true
+          purchaseCartSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.getCartList()
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
         } else {
         } else {
-          console.log('error submit!!')
           return false
           return false
         }
         }
       })
       })
     },
     },
-    checkTypeChange (e) {
-      this.form.warehouseFlag = '0'
-      this.form.warehouseSnList = undefined
-    },
-    warehouseFlagChange (e) {
-      this.form.warehouseSnList = undefined
-    },
-    // 获取仓库列表
-    getWarehouseList () {
-      checkWarehouseWarehouse({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data || []
-        } else {
-          this.warehouseList = []
-        }
-      })
-    }
   },
   },
   watch: {
   watch: {
     //  父页面传过来的弹框状态
     //  父页面传过来的弹框状态

+ 24 - 2
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -166,7 +166,7 @@
             class="button-primary"
             class="button-primary"
             @click="handleSave(record)"
             @click="handleSave(record)"
             id="inventoryWarningList-add-btn">保存</a-button>
             id="inventoryWarningList-add-btn">保存</a-button>
-          <a-button type="link">加入购物车</a-button>
+          <a-button type="link" @click="addShopCar(record)">加入购物车</a-button>
           <span v-if="!$hasPermissions('B_inventoryWarningSave')">--</span>
           <span v-if="!$hasPermissions('B_inventoryWarningSave')">--</span>
         </template>
         </template>
       </s-table>
       </s-table>
@@ -174,6 +174,8 @@
 
 
     <!-- 导入产品 -->
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="resetSearchForm" />
     <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="resetSearchForm" />
+    <!-- 设置采购数量 -->
+    <set-purchase-qty ref="setPurchaseQty" :openModal="openPurchaseModal" @close="openPurchaseModal=false" v-drag></set-purchase-qty>
   </a-card>
   </a-card>
 </template>
 </template>
 
 
@@ -181,18 +183,21 @@
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { STable, VSelect } from '@/components'
 import { stockWarnList, stockWarnSaveBatch, stockWarnExport } from '@/api/stockWarn'
 import { stockWarnList, stockWarnSaveBatch, stockWarnExport } from '@/api/stockWarn'
+import { purchaseCartExistProduct } from '@/api/purchaseCart'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import { downloadExcel } from '@/libs/JGPrint.js'
 import ProductType from '../../common/productType.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import ProductBrand from '../../common/productBrand.js'
 import importGuideModal from './importGuideModal.vue'
 import importGuideModal from './importGuideModal.vue'
+import setPurchaseQty from '@/views/inventoryManagement/inventoryQuery/setPurchaseQty.vue'
 export default {
 export default {
   name: 'InventoryWarningList',
   name: 'InventoryWarningList',
-  components: { STable, VSelect, ProductType, ProductBrand, importGuideModal },
+  components: { STable, VSelect, ProductType, ProductBrand, importGuideModal, setPurchaseQty },
   mixins: [commonMixin],
   mixins: [commonMixin],
   data () {
   data () {
     return {
     return {
       spinning: false,
       spinning: false,
       openGuideModal: false,
       openGuideModal: false,
+      openPurchaseModal: false,
       advanced: true, // 高级搜索 展开/关闭
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       tableHeight: 0,
       queryParam: { //  查询条件
       queryParam: { //  查询条件
@@ -256,6 +261,23 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
+    // 加入购物车
+    addShopCar (row) {
+      this.spinning = true
+      purchaseCartExistProduct({
+        productSn: row.productSn
+      }).then(res => {
+        if(res.status == 200){
+          if(res.data){
+            this.$message.info("此产品已添加到购物车!")
+          }else{
+            this.$refs.setPurchaseQty.setData(row)
+            this.openPurchaseModal = true
+          }
+        }
+        this.spinning = false
+      })
+    },
     // 表格选中项
     // 表格选中项
     rowSelectionFun (obj) {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
       this.rowSelectionInfo = obj || null

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

@@ -53,7 +53,7 @@
       <!-- 上次缺货 -->
       <!-- 上次缺货 -->
       <outStockModal :openModal="openOutStockModal" :paramsData="paramsData" @close="openOutStockModal=false" @ok="hanldeOkOutStock" />
       <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>
         <div class="chooseBox-title">
         <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 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-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-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>
         </div>
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
@@ -385,6 +385,13 @@ export default {
     hanldeOks () {
     hanldeOks () {
       this.getOrderDetail(false, true, true)
       this.getOrderDetail(false, true, true)
     },
     },
+    // 打开购物车
+    hanldCart(){
+      this.paramsData = {
+        purchaseBillSn: this.$route.params.sn
+      }
+      this.openShopCatModal=true
+    },
     // 上次缺货
     // 上次缺货
     handleOutStock () {
     handleOutStock () {
       // 校验是否存在历史采购单,且上次采购存在缺货产品
       // 校验是否存在历史采购单,且上次采购存在缺货产品

+ 73 - 25
src/views/shoppingCarManagement/shoppingCar/list.vue

@@ -25,7 +25,18 @@
               </a-select>
               </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
-          <a-col flex="auto">
+          <a-col flex="250px" v-if="modes=='pages'">
+            <a-form-item label="产品状态">
+              <v-select
+                code="ONLINE_FLAG2"
+                id="productPricingList-onlineFalg"
+                v-model="queryParam.onlineFalg"
+                allowClear
+                placeholder="请选择产品状态"
+              ></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col flex="auto" style="margin-bottom:10px;">
             <a-button type="primary" @click="searchForm" :disabled="disabled" id="shoppingCar-refresh">查询</a-button>
             <a-button type="primary" @click="searchForm" :disabled="disabled" id="shoppingCar-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shoppingCar-reset">重置</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shoppingCar-reset">重置</a-button>
           </a-col>
           </a-col>
@@ -35,10 +46,10 @@
       <div class="table-operator">
       <div class="table-operator">
         <a-row :gutter="16">
         <a-row :gutter="16">
           <a-col class="gutter-row" :span="24">
           <a-col class="gutter-row" :span="24">
-            <a-button type="primary" ghost v-if="modes=='pages'" @click="deleteMore">
+            <a-button type="primary" :loading="loading" ghost v-if="modes=='pages'" @click="deleteMore">
               批量删除
               批量删除
             </a-button>
             </a-button>
-            <a-button type="primary" ghost v-if="modes=='modals'" @click="addMore">
+            <a-button type="primary" :loading="loading" ghost v-if="modes=='modals'" @click="addMore">
               批量添加
               批量添加
             </a-button>
             </a-button>
             <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
             <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
@@ -52,7 +63,7 @@
       ref="table"
       ref="table"
       :style="{ height: tableHeight+84.5+'px' }"
       :style="{ height: tableHeight+84.5+'px' }"
       size="small"
       size="small"
-      :row-selection="{ columnWidth: 40 }"
+      :row-selection="modes=='pages'?{ columnWidth: 40 }:{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.productEntity.purchasePrice } }) }"
       @rowSelection="rowSelectionFun"
       @rowSelection="rowSelectionFun"
       rowKeyName="productSn"
       rowKeyName="productSn"
       :rowKey="(record) => record.productSn"
       :rowKey="(record) => record.productSn"
@@ -63,7 +74,22 @@
       bordered>
       bordered>
       <!-- 采购数量 -->
       <!-- 采购数量 -->
       <template slot="purchaseQty" slot-scope="text, record">
       <template slot="purchaseQty" slot-scope="text, record">
-        <a-input placeholder="请输入采购数量" v-model="record.qty"/>
+        <a-input placeholder="请输入采购数量" v-model="record.qty" @change="updateQty(record)"/>
+      </template>
+      <!-- 包装数 -->
+      <template slot="baozh" slot-scope="text, record">
+        {{ record.productEntity.packQty||'--' }}/{{ record.productEntity.packQtyUnit||'--' }}
+      </template>
+      <!-- 产品编码 -->
+      <template slot="productCode" slot-scope="text, record">
+        <div v-if="modes=='pages'">
+          <span style="padding-right: 15px;">{{ text }}</span> 
+          <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>
       </template>
     </s-table>
     </s-table>
   </a-card>
   </a-card>
@@ -71,13 +97,14 @@
 
 
 <script>
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { commonMixin } from '@/utils/mixin'
-import { productList, getCurrentDealer, productUpdate } from '@/api/product'
+import { mapActions } from 'vuex'
+import { purchaseCartList, purchaseDeleteBatch, purchaseUpdateQty } from '@/api/purchaseCart'
 import ProductType from '../../common/productType.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import ProductBrand from '../../common/productBrand.js'
-import { STable } from '@/components'
+import { STable, VSelect } from '@/components'
 export default {
 export default {
   name: 'ShoppingCarList',
   name: 'ShoppingCarList',
-  components: { STable, ProductType, ProductBrand },
+  components: { STable, VSelect, ProductType, ProductBrand },
   mixins: [commonMixin],
   mixins: [commonMixin],
   props:{
   props:{
     modes:{
     modes:{
@@ -87,6 +114,7 @@ export default {
   },
   },
   data () {
   data () {
     return {
     return {
+      loading: false,
       tableHeight: 0,
       tableHeight: 0,
       productType: [],
       productType: [],
       queryParam: { //  查询条件
       queryParam: { //  查询条件
@@ -95,26 +123,25 @@ export default {
         productBrandSn: undefined, //  产品品牌
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '' ,//  产品三级分类
+        onlineFalg: undefined
       },
       },
+      paramsData: null,
       openEditPriceModal: false, // 自定义报价弹窗
       openEditPriceModal: false, // 自定义报价弹窗
-      iconShowFlag: false, // 列表配置图标显示
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
-      dateFormat: 'YYYY-MM-DD',
       columns: [],
       columns: [],
-      chooseShowList: ['A', 'B', 'C', 'D', 'E'],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
         this.spinning = true
         this.spinning = true
-        return productList(Object.assign(parameter, this.queryParam)).then(res => {
+        return purchaseCartList(Object.assign(parameter, {productEntity:this.queryParam}, this.paramsData)).then(res => {
           let data
           let data
           if (res.status == 200) {
           if (res.status == 200) {
             data = res.data
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].no = no + i + 1
+              data.list[i].qtyBack = data.list[i].qty
             }
             }
             this.disabled = false
             this.disabled = false
           }
           }
@@ -122,13 +149,11 @@ export default {
           return data
           return data
         })
         })
       },
       },
-      openModal: false, //  查看客户详情  弹框
-      itemId: '', //  当前产品id
-      productTypeList: [], //  分类下拉数据
       rowSelectionInfo: null,
       rowSelectionInfo: null,
     }
     }
   },
   },
   methods: {
   methods: {
+    ...mapActions(['getCartList']),
     // 查询
     // 查询
     searchForm () {
     searchForm () {
       this.$refs.table.clearSelected() // 清空表格选中项
       this.$refs.table.clearSelected() // 清空表格选中项
@@ -142,6 +167,7 @@ export default {
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.productTypeSn3 = ''
+      this.queryParam.onlineFalg = undefined
       this.productType = []
       this.productType = []
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
       this.rowSelectionInfo = null
       this.rowSelectionInfo = null
@@ -151,12 +177,12 @@ export default {
     getColumns () {
     getColumns () {
       const _this = this
       const _this = this
       this.columns = [
       this.columns = [
-        { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', width: '33%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '可用库存数量', dataIndex: 'carOwnersPrice', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '单位', dataIndex: 'origCode', width: '8%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } },
-        { title: '包装数', dataIndex: 'terminalPrice', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品编码', dataIndex: 'productEntity.code',scopedSlots: { customRender: 'productCode' }, width: '15%', align: 'center' },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '33%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '可用库存数量', dataIndex: 'currentStockQty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本价', dataIndex: 'productEntity.purchasePrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } },
+        { title: '包装数',scopedSlots: { customRender: 'baozh' }, dataIndex: 'productEntity.packQty', width: '8%', align: 'center' },
         { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '15%', align: 'center' }
         { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '15%', align: 'center' }
       ]
       ]
     },
     },
@@ -170,6 +196,17 @@ export default {
     rowSelectionFun (obj) {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
       this.rowSelectionInfo = obj || null
     },
     },
+    // 修改数量
+    updateQty(row){
+      purchaseUpdateQty({qty: row.qty, purchaseCartSn: row.purchaseCartSn}).then(res => {
+        if(res.status == 200){
+          this.$message.info(res.message)
+          row.qtyBack = row.qty
+        }else{
+          row.qty = row.qtyBack
+        }
+      })
+    },
     // 批量删除
     // 批量删除
     deleteMore () {
     deleteMore () {
       const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
       const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
@@ -182,7 +219,17 @@ export default {
         content: '您已经选择'+rows.length+'个产品,确认要将已选产品从购物车中移除吗?',
         content: '您已经选择'+rows.length+'个产品,确认要将已选产品从购物车中移除吗?',
         centered: true,
         centered: true,
         onOk: () => {
         onOk: () => {
-          console.log('确定删除')
+          this.loading = true
+          purchaseDeleteBatch({
+            productSnList: rows
+          }).then(res => {
+            if(res.status == 200){
+              this.$message.info(res.message)
+              this.getCartList()
+              this.searchForm()
+            }
+            this.loading = false
+          })
         }
         }
       })
       })
     },
     },
@@ -201,8 +248,9 @@ export default {
         }
         }
       })
       })
     },
     },
-    pageInit () {
+    pageInit (paramsData) {
       const _this = this
       const _this = this
+      this.paramsData = paramsData || {}
       this.setTableH()
       this.setTableH()
       this.getColumns()
       this.getColumns()
       this.resetSearchForm()
       this.resetSearchForm()

+ 2 - 2
vue.config.js

@@ -211,8 +211,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        // target: 'http://192.168.0.183:8503/qpls-md',
-        target: 'http://p.iscm.360arrow.com/qpls-md',
+        target: 'http://192.168.0.216:8503/qpls-md',
+        // target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         // ws: false,
         ws: true,
         ws: true,
         changeOrigin: true,
         changeOrigin: true,