|
@@ -63,7 +63,7 @@
|
|
|
ref="table"
|
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
|
size="small"
|
|
|
- :row-selection="modes=='pages'?{ columnWidth: 40 }:{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.productEntity.purchasePrice } }) }"
|
|
|
+ :row-selection="modes=='pages'?{ columnWidth: 40 }:{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.productEntity.purchasePrice || !(record.productEntity.onlineFalg == 1&& record.dealerScopeFlag == 1) } }) }"
|
|
|
@rowSelection="rowSelectionFun"
|
|
|
rowKeyName="productSn"
|
|
|
:rowKey="(record) => record.productSn"
|
|
@@ -83,12 +83,13 @@
|
|
|
<!-- 产品编码 -->
|
|
|
<template slot="productCode" slot-scope="text, record">
|
|
|
<div v-if="modes=='pages'">
|
|
|
- <span style="padding-right: 15px;">{{ text }}</span>
|
|
|
+ <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>
|
|
|
+ <a-tag color="red" v-else-if="record.productEntity.onlineFalg == 1&& record.dealerScopeFlag == 0">无权限</a-tag>
|
|
|
</div>
|
|
|
</template>
|
|
|
</s-table>
|
|
@@ -106,8 +107,8 @@ export default {
|
|
|
name: 'ShoppingCarList',
|
|
|
components: { STable, VSelect, ProductType, ProductBrand },
|
|
|
mixins: [commonMixin],
|
|
|
- props:{
|
|
|
- modes:{
|
|
|
+ props: {
|
|
|
+ modes: {
|
|
|
type: String,
|
|
|
default: 'pages'
|
|
|
}
|
|
@@ -123,7 +124,7 @@ export default {
|
|
|
productBrandSn: undefined, // 产品品牌
|
|
|
productTypeSn1: '', // 产品一级分类
|
|
|
productTypeSn2: '', // 产品二级分类
|
|
|
- productTypeSn3: '' ,// 产品三级分类
|
|
|
+ productTypeSn3: '', // 产品三级分类
|
|
|
onlineFalg: undefined
|
|
|
},
|
|
|
paramsData: null,
|
|
@@ -134,7 +135,7 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return purchaseCartList(Object.assign(parameter, {productEntity:this.queryParam}, this.paramsData)).then(res => {
|
|
|
+ return purchaseCartList(Object.assign(parameter, { productEntity: this.queryParam }, this.paramsData)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -149,7 +150,7 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- rowSelectionInfo: null,
|
|
|
+ rowSelectionInfo: null
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -177,13 +178,13 @@ export default {
|
|
|
getColumns () {
|
|
|
const _this = this
|
|
|
this.columns = [
|
|
|
- { 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: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '20%', align: 'center' },
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', width: '30%', 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: 'baozh' }, dataIndex: 'productEntity.packQty', width: '8%', align: 'center' },
|
|
|
+ { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '12%', align: 'center' }
|
|
|
]
|
|
|
},
|
|
|
// 产品分类 change
|
|
@@ -197,12 +198,12 @@ export default {
|
|
|
this.rowSelectionInfo = obj || null
|
|
|
},
|
|
|
// 修改数量
|
|
|
- updateQty(row){
|
|
|
- purchaseUpdateQty({qty: row.qty, purchaseCartSn: row.purchaseCartSn}).then(res => {
|
|
|
- if(res.status == 200){
|
|
|
+ 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{
|
|
|
+ } else {
|
|
|
row.qty = row.qtyBack
|
|
|
}
|
|
|
})
|
|
@@ -216,14 +217,14 @@ export default {
|
|
|
}
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: '您已经选择'+rows.length+'个产品,确认要将已选产品从购物车中移除吗?',
|
|
|
+ content: '您已经选择' + rows.length + '个产品,确认要将已选产品从购物车中移除吗?',
|
|
|
centered: true,
|
|
|
onOk: () => {
|
|
|
this.loading = true
|
|
|
purchaseDeleteBatch({
|
|
|
productSnList: rows
|
|
|
}).then(res => {
|
|
|
- if(res.status == 200){
|
|
|
+ if (res.status == 200) {
|
|
|
this.$message.info(res.message)
|
|
|
this.getCartList()
|
|
|
this.searchForm()
|
|
@@ -260,7 +261,7 @@ export default {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - (this.modes == 'pages' ? 200 : 320)
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
'$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|