lilei преди 1 седмица
родител
ревизия
6aedf04719
променени са 3 файла, в които са добавени 44 реда и са изтрити 14 реда
  1. 1 1
      public/version.json
  2. 6 6
      src/views/inventoryManagement/inventoryQuery/setPurchaseQty.vue
  3. 37 7
      src/views/salesManagement/productPricing/list.vue

+ 1 - 1
public/version.json

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

+ 6 - 6
src/views/inventoryManagement/inventoryQuery/setPurchaseQty.vue

@@ -17,11 +17,11 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="产品名称:">
-          {{ dateilData&&dateilData.productName }}
+        <a-form-model-item label="产品名称:" style="margin-bottom: 10px;">
+          {{ dateilData&&dateilData.productName||dateilData.name }}
         </a-form-model-item>
-        <a-form-model-item label="产品编码">
-          {{ dateilData&&dateilData.productCode }}
+        <a-form-model-item label="产品编码" style="margin-bottom: 10px;">
+          {{ dateilData&&dateilData.productCode||dateilData.code }}
         </a-form-model-item>
         <a-form-model-item label="采购数量" prop="qty">
           <a-input-number
@@ -81,8 +81,8 @@ export default {
     setData (row) {
       this.dateilData = row
       this.form.productSn = row.productSn
-      this.form.productCode = row.productCode
-      this.form.sysFlag = row.dealerProduct.sysFlag
+      this.form.productCode = row.productCode || row.code
+      this.form.sysFlag = row.dealerProduct ? row.dealerProduct.sysFlag : row.sysFlag
       this.form.qty = 1
     },
     //  保存

+ 37 - 7
src/views/salesManagement/productPricing/list.vue

@@ -92,10 +92,20 @@
           class="button-primary"
           @click="handleDetail(record)"
         >销售记录</a-button>
+        <a-button
+          v-if="record.sysFlag==1&&record.onlineFalg==1&&$hasPermissions('M_shoppingCart')"
+          :id="'productPricingList-cart-'+record.id"
+          size="small"
+          type="link"
+          class="button-error"
+          @click="addShopCar(record)"
+        >加入购物车</a-button>
       </template>
     </s-table>
     <!-- 销售记录 -->
     <product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="openModal = false" />
+    <!-- 设置采购数量 -->
+    <set-purchase-qty ref="setPurchaseQty" :openModal="openPurchaseModal" @close="openPurchaseModal=false" v-drag></set-purchase-qty>
   </a-card>
 </template>
 
@@ -106,9 +116,11 @@ import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import productSalesRecordModal from './productSalesRecordModal.vue'
 import { dealerProductPriceList } from '@/api/dealerProduct'
+import { purchaseCartExistProduct } from '@/api/purchaseCart'
+import setPurchaseQty from '@/views/inventoryManagement/inventoryQuery/setPurchaseQty.vue'
 export default {
   name: 'DealerProductPriceList',
-  components: { STable, VSelect, ProductType, ProductBrand, productSalesRecordModal },
+  components: { STable, VSelect, ProductType, ProductBrand, productSalesRecordModal, setPurchaseQty },
   mixins: [commonMixin],
   data () {
     return {
@@ -126,6 +138,7 @@ export default {
         onlineFalg: undefined, // 上下架状态
         putStockFlag: true // 是否包含未入库产品
       },
+      openPurchaseModal: false, // 设置采购数量弹框
       productType: [], // 产品分类默认值
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
@@ -160,13 +173,13 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '产品名称', dataIndex: 'name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+        { title: '产品名称', dataIndex: 'name', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '库存数量', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '车主价/自定义车主价', scopedSlots: { customRender: 'carOwners' }, width: '12%', align: 'right' },
+        { title: '车主价/自定义车主价', scopedSlots: { customRender: 'carOwners' }, width: '10%', align: 'right' },
         { title: '产品状态', dataIndex: 'onlineFalgDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '14%', align: 'center' }
       ]
       // 参考成本价
       if (this.isCostPrice) {
@@ -191,7 +204,7 @@ export default {
       }
       // 终端价
       if (this.isTerminalPrice) {
-        arr.splice(arr.length - 2, 0, { title: '终端价/自定义终端价', scopedSlots: { customRender: 'terminal' }, width: '12%', align: 'right' })
+        arr.splice(arr.length - 2, 0, { title: '终端价/自定义终端价', scopedSlots: { customRender: 'terminal' }, width: '10%', align: 'right' })
       }
       return arr
     }
@@ -222,6 +235,23 @@ export default {
       this.openModal = true
       this.$refs.salseRecord.getDetail(row)
     },
+    // 加入购物车
+    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
+      })
+    },
     // 初始化页面
     pageInit () {
       const _this = this