|
@@ -25,6 +25,23 @@
|
|
<productType id="shoppingProductsList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></productType>
|
|
<productType id="shoppingProductsList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></productType>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
|
|
+ <a-col :md="6" :sm="24" v-if="!itemCategorySn">
|
|
|
|
+ <a-form-item label="商城类目">
|
|
|
|
+ <a-cascader
|
|
|
|
+ id="shoppingProductsList-category"
|
|
|
|
+ expandTrigger="hover"
|
|
|
|
+ :fieldNames="fieldNames"
|
|
|
|
+ :options="categoryOptions"
|
|
|
|
+ placeholder="请选择商城类目"
|
|
|
|
+ allowClear
|
|
|
|
+ v-model="category"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="热销产品">
|
|
|
|
+ <v-select code="FLAG" id="shoppingProductsList-hotFlag" v-model="queryParam.hotFlag" allowClear placeholder="请选择是否是热销产品"></v-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="产品商城状态">
|
|
<a-form-item label="产品商城状态">
|
|
<v-select code="SHOP_PRODUCT_STATUS" id="shoppingProductsList-status" v-model="queryParam.status" allowClear placeholder="请选择产品商城状态"></v-select>
|
|
<v-select code="SHOP_PRODUCT_STATUS" id="shoppingProductsList-status" v-model="queryParam.status" allowClear placeholder="请选择产品商城状态"></v-select>
|
|
@@ -43,7 +60,7 @@
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
<a-button type="primary" id="shoppingProductsList-addProduct-btn" v-if="itemCategorySn" @click="handleChooseProduct">选择产品</a-button>
|
|
<a-button type="primary" id="shoppingProductsList-addProduct-btn" v-if="itemCategorySn" @click="handleChooseProduct">选择产品</a-button>
|
|
<a-button type="primary" v-else id="shoppingProductsList-import-btn" @click="handleAddProduct">产品导入</a-button>
|
|
<a-button type="primary" v-else id="shoppingProductsList-import-btn" @click="handleAddProduct">产品导入</a-button>
|
|
- <span>
|
|
|
|
|
|
+ <span v-if="productNum&&productNum*1>0">
|
|
<a-button type="primary" id="shoppingProductsList-grounding-btn" class="button-info" @click="changeStatus('1')">批量上架</a-button>
|
|
<a-button type="primary" id="shoppingProductsList-grounding-btn" class="button-info" @click="changeStatus('1')">批量上架</a-button>
|
|
<a-button @click="changeStatus('0')" id="shoppingProductsList-off-btn">批量下架</a-button>
|
|
<a-button @click="changeStatus('0')" id="shoppingProductsList-off-btn">批量下架</a-button>
|
|
<a-button type="primary" class="button-error" id="shoppingProductsList-delProduct-btn" ghost @click="handleDel()">批量删除</a-button>
|
|
<a-button type="primary" class="button-error" id="shoppingProductsList-delProduct-btn" ghost @click="handleDel()">批量删除</a-button>
|
|
@@ -70,13 +87,28 @@
|
|
<!-- 产品编码 -->
|
|
<!-- 产品编码 -->
|
|
<template slot="productCode" slot-scope="text, record">
|
|
<template slot="productCode" slot-scope="text, record">
|
|
<span style="padding-right: 6px;">{{ record.productCode }}</span>
|
|
<span style="padding-right: 6px;">{{ record.productCode }}</span>
|
|
- <a-badge v-if="record.hotFlag==='1'" count="热" :number-style="{ zoom:'80%' }"></a-badge>
|
|
|
|
|
|
+ <a-badge v-if="record.hotFlag=='1'" count="热" :number-style="{ zoom:'80%' }"></a-badge>
|
|
</template>
|
|
</template>
|
|
<!-- 产品分类 -->
|
|
<!-- 产品分类 -->
|
|
<template slot="productType" slot-scope="text, record">
|
|
<template slot="productType" slot-scope="text, record">
|
|
<span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
|
|
<span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
|
|
<span v-else>--</span>
|
|
<span v-else>--</span>
|
|
</template>
|
|
</template>
|
|
|
|
+ <!-- 商城类目 -->
|
|
|
|
+ <template slot="categoryName" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.categoryName1 || record.categoryName2">{{ record.categoryName1 }} {{ record.categoryName2 ? '>' : '' }} {{ record.categoryName2 }}</span>
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 售价类型 -->
|
|
|
|
+ <template slot="priceType" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.priceType">{{ record.priceType=='OCS_PRICE'?'终端价':'自定义终端价' }}</span>
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 是否是热销产品 -->
|
|
|
|
+ <template slot="hotFlag" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.hotFlag">{{ record.hotFlag=='1'?'是':'否' }}</span>
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
+ </template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<!-- v-if="$hasPermissions('B_chooseProductEdit_edit')" -->
|
|
<!-- v-if="$hasPermissions('B_chooseProductEdit_edit')" -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -134,7 +166,7 @@ import productType from '@/views/common/productType.js'
|
|
import productBrand from '@/views/common/productBrand.js'
|
|
import productBrand from '@/views/common/productBrand.js'
|
|
import chooseProduct from '@/views/easyPassManagement/shoppingManagement/chooseProductsModal'
|
|
import chooseProduct from '@/views/easyPassManagement/shoppingManagement/chooseProductsModal'
|
|
// 接口
|
|
// 接口
|
|
-import { shopProductList, saveBatchProductExcel, shopProductDel, shopProductUpdateStatus, queryProductSnList, saveBatchProduct } from '@/api/shopProduct'
|
|
|
|
|
|
+import { shopProductList, saveBatchProductExcel, shopProductDel, shopProductUpdateStatus, queryProductSnList, saveBatchProduct, queryExtList } from '@/api/shopProduct'
|
|
export default {
|
|
export default {
|
|
name: 'ShoppingProductsList',
|
|
name: 'ShoppingProductsList',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -146,7 +178,6 @@ export default {
|
|
},
|
|
},
|
|
components: { STable, VSelect, importGuideModal, editProductModal, productType, productBrand, chooseProduct },
|
|
components: { STable, VSelect, importGuideModal, editProductModal, productType, productBrand, chooseProduct },
|
|
data () {
|
|
data () {
|
|
- const _this = this
|
|
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
@@ -167,25 +198,13 @@ export default {
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn3: '', // 产品三级分类
|
|
productTypeSn3: '', // 产品三级分类
|
|
- status: undefined
|
|
|
|
|
|
+ hotFlag: undefined, // 是否是热销产品
|
|
|
|
+ status: undefined, // 状态
|
|
|
|
+ categorySn: undefined// 商城类目
|
|
},
|
|
},
|
|
- // 表头
|
|
|
|
- columns: [
|
|
|
|
- { title: '序号', dataIndex: 'no', align: 'center', width: '60px' },
|
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', scopedSlots: { customRender: 'productCode' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '品牌', dataIndex: 'productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品分类', align: 'center', width: '15%', scopedSlots: { customRender: 'productType' } },
|
|
|
|
- { title: '售价', dataIndex: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
|
- { title: '售价类型', dataIndex: 'priceTypeDictValue', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '终端价', dataIndex: 'terminalPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
|
- { title: '车主价', dataIndex: 'carOwnersPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
|
- { title: '优先级', dataIndex: 'hotSort', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '添加时间', dataIndex: 'createDate', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品商城状态', dataIndex: 'statusDictValue', align: 'center', width: '9%', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
|
- ],
|
|
|
|
|
|
+ productNum: null, // 列表数据总条数
|
|
|
|
+ categoryOptions: [], // 产品类目列表
|
|
|
|
+ category: [], // 类目val
|
|
rowSelectionInfo: null, // 已选数据
|
|
rowSelectionInfo: null, // 已选数据
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
@@ -193,6 +212,8 @@ export default {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
if (this.itemCategorySn) {
|
|
if (this.itemCategorySn) {
|
|
this.queryParam.categorySn = this.itemCategorySn
|
|
this.queryParam.categorySn = this.itemCategorySn
|
|
|
|
+ } else {
|
|
|
|
+ this.queryParam.categorySn = this.category ? this.category.length > 1 ? this.category[1] : this.category[0] : undefined
|
|
}
|
|
}
|
|
return shopProductList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
return shopProductList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
let data
|
|
let data
|
|
@@ -203,6 +224,7 @@ export default {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
|
|
+ this.productNum = data.count
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
return data
|
|
return data
|
|
@@ -213,6 +235,32 @@ export default {
|
|
itemProductSn: null// 当前行商城产品sn
|
|
itemProductSn: null// 当前行商城产品sn
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ columns () {
|
|
|
|
+ const _this = this
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '序号', dataIndex: 'no', align: 'center', width: '60px' },
|
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', scopedSlots: { customRender: 'productCode' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: '16%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '品牌', dataIndex: 'productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品分类', align: 'center', width: '15%', scopedSlots: { customRender: 'productType' } },
|
|
|
|
+ { title: '售价', dataIndex: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
|
+ { title: '售价类型', dataIndex: 'priceType', scopedSlots: { customRender: 'priceType' }, align: 'center', width: '12%' },
|
|
|
|
+ { title: '终端价', dataIndex: 'terminalPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
|
+ { title: '车主价', dataIndex: 'carOwnersPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
|
+ { title: '热销产品', dataIndex: 'hotFlag', scopedSlots: { customRender: 'hotFlag' }, align: 'center', width: '7%' },
|
|
|
|
+ { title: '优先级', dataIndex: 'hotSort', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '添加时间', dataIndex: 'createDate', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品商城状态', dataIndex: 'statusDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
|
|
|
|
+ ]
|
|
|
|
+ if (!_this.itemCategorySn) {
|
|
|
|
+ arr.splice(6, 0, { title: '商城类目', scopedSlots: { customRender: 'categoryName' }, width: '15%', align: 'center' })
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
// 表格选中项
|
|
// 表格选中项
|
|
rowSelectionFun (obj) {
|
|
rowSelectionFun (obj) {
|
|
@@ -242,6 +290,17 @@ export default {
|
|
})
|
|
})
|
|
_this.hanldeOk(newList, 'chooseProduct')
|
|
_this.hanldeOk(newList, 'chooseProduct')
|
|
},
|
|
},
|
|
|
|
+ // 获取产品类目列表
|
|
|
|
+ getCategoryList () {
|
|
|
|
+ const _this = this
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ queryExtList({}).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.categoryOptions = res.data || []
|
|
|
|
+ }
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 关闭选择弹窗
|
|
// 关闭选择弹窗
|
|
closeProductModal () {
|
|
closeProductModal () {
|
|
this.showProModal = false
|
|
this.showProModal = false
|
|
@@ -273,8 +332,11 @@ export default {
|
|
this.queryParam.productTypeSn1 = ''
|
|
this.queryParam.productTypeSn1 = ''
|
|
this.queryParam.productTypeSn2 = ''
|
|
this.queryParam.productTypeSn2 = ''
|
|
this.queryParam.productTypeSn3 = ''
|
|
this.queryParam.productTypeSn3 = ''
|
|
- this.queryParam.status = ''
|
|
|
|
|
|
+ this.queryParam.hotFlag = undefined
|
|
|
|
+ this.queryParam.status = undefined
|
|
|
|
+ this.queryParam.categorySn = undefined
|
|
this.productType = []
|
|
this.productType = []
|
|
|
|
+ this.category = []
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 编辑
|
|
// 编辑
|
|
@@ -303,7 +365,7 @@ export default {
|
|
shopProductSnList = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys ? _this.rowSelectionInfo.selectedRowKeys : []
|
|
shopProductSnList = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys ? _this.rowSelectionInfo.selectedRowKeys : []
|
|
}
|
|
}
|
|
if (shopProductSnList && shopProductSnList.length == 0) {
|
|
if (shopProductSnList && shopProductSnList.length == 0) {
|
|
- this.$message.warning('请在列表中进行勾选!')
|
|
|
|
|
|
+ this.$message.warning('请在列表中勾选产品!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.confirmDel(shopProductSnList)
|
|
this.confirmDel(shopProductSnList)
|
|
@@ -365,6 +427,7 @@ export default {
|
|
// 初始化
|
|
// 初始化
|
|
pageInit () {
|
|
pageInit () {
|
|
const _this = this
|
|
const _this = this
|
|
|
|
+ this.getCategoryList()
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
_this.setTableH()
|
|
_this.setTableH()
|
|
})
|
|
})
|