|
@@ -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
|