|
@@ -31,22 +31,15 @@
|
|
<ProductType id="productInfoList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
|
|
<ProductType id="productInfoList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col> -->
|
|
</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="ONLINE_FLAG" id="productInfoList-onlineFalg" v-model="queryParam.onlineFalg" allowClear placeholder="请选择状态"></v-select>
|
|
|
|
|
|
+ <v-select code="ENABLE_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- </a-col> -->
|
|
|
|
|
|
+ </a-col>
|
|
</template>
|
|
</template>
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
|
|
- <!-- <a-button
|
|
|
|
- style="margin: 0 0 18px 8px"
|
|
|
|
- type="danger"
|
|
|
|
- @click="handleExport"
|
|
|
|
- :disabled="disabled"
|
|
|
|
- :loading="exportLoading"
|
|
|
|
- id="inventoryQueryList-export">导出</a-button> -->
|
|
|
|
<a @click="advanced=!advanced" style="margin-left: 5px">
|
|
<a @click="advanced=!advanced" style="margin-left: 5px">
|
|
{{ advanced ? '收起' : '展开' }}
|
|
{{ advanced ? '收起' : '展开' }}
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
@@ -55,12 +48,25 @@
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 操作按钮 -->
|
|
|
|
+ <div class="table-operator">
|
|
|
|
+ <a-dropdown>
|
|
|
|
+ <a-menu slot="overlay" @click="handleMenuClick">
|
|
|
|
+ <a-menu-item key="1"> 批量启用</a-menu-item>
|
|
|
|
+ <a-menu-item key="2"> 批量禁用</a-menu-item>
|
|
|
|
+ </a-menu>
|
|
|
|
+ <a-button ghost type="danger"> 批量操作 <a-icon type="down" /> </a-button>
|
|
|
|
+ </a-dropdown>
|
|
|
|
+ <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
|
|
|
|
+ </div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<s-table
|
|
<s-table
|
|
class="sTable fixPagination"
|
|
class="sTable fixPagination"
|
|
ref="table"
|
|
ref="table"
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
size="small"
|
|
size="small"
|
|
|
|
+ :row-selection="{}"
|
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
@@ -79,6 +85,18 @@
|
|
<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="enabledFlag" slot-scope="text, record">
|
|
|
|
+ <a-switch
|
|
|
|
+ checkedChildren="启用"
|
|
|
|
+ unCheckedChildren="禁用"
|
|
|
|
+ v-if="$hasPermissions('B_JgProduct_enable')"
|
|
|
|
+ @change="changeStatus(record)"
|
|
|
|
+ :checked="record.enabledFlag == 1 ? true : false"
|
|
|
|
+ />
|
|
|
|
+ <span v-else :style="{ color: record.enabledFlag == 1 ? '#00aa00' : '#999' }">{{ record.enabledFlag == 1 ? '已启用' : '已禁用' }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
@@ -93,7 +111,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
-import { productList, getCurrentDealer } from '@/api/product'
|
|
|
|
|
|
+import { productList, getCurrentDealer, dealerProductUpdate } from '@/api/product'
|
|
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, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
@@ -142,10 +160,24 @@ export default {
|
|
},
|
|
},
|
|
openModal: false, // 查看客户详情 弹框
|
|
openModal: false, // 查看客户详情 弹框
|
|
itemId: '', // 当前产品id
|
|
itemId: '', // 当前产品id
|
|
- productTypeList: [] // 分类下拉数据
|
|
|
|
|
|
+ productTypeList: [], // 分类下拉数据
|
|
|
|
+ rowSelectionInfo: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 表格选中项
|
|
|
|
+ rowSelectionFun (obj) {
|
|
|
|
+ this.rowSelectionInfo = obj || null
|
|
|
|
+ },
|
|
|
|
+ // 批量操作
|
|
|
|
+ handleOutbounds (type) {
|
|
|
|
+ if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
|
|
|
|
+ this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleMenuClick (e) {
|
|
|
|
+ this.handleOutbounds(e.key)
|
|
|
|
+ },
|
|
inited (viewer) {
|
|
inited (viewer) {
|
|
if (viewer) {
|
|
if (viewer) {
|
|
const imageUrl = []
|
|
const imageUrl = []
|
|
@@ -181,15 +213,12 @@ export default {
|
|
{ title: '产品编码', dataIndex: 'code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'name', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'name', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'origCode', width: '17%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
|
|
{ title: '原厂编码', dataIndex: 'origCode', width: '17%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
|
|
- // { title: '产品品牌', dataIndex: 'productBrandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- // { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 120, align: 'center' }
|
|
|
|
]
|
|
]
|
|
const cArr = [
|
|
const cArr = [
|
|
{ title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
|
|
{ title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
|
|
{ title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
|
|
- // { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- // { title: '状态', dataIndex: 'onlineFalgDictValue', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
|
|
]
|
|
]
|
|
getCurrentDealer().then(res => {
|
|
getCurrentDealer().then(res => {
|
|
@@ -222,13 +251,34 @@ export default {
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
},
|
|
},
|
|
- // 导出
|
|
|
|
- handleExport () {
|
|
|
|
- this.exportLoading = true
|
|
|
|
- // dealerProductExport(this.queryParam).then(res => {
|
|
|
|
- // this.exportLoading = false
|
|
|
|
- // downloadExcel(res, '箭冠产品列表')
|
|
|
|
- // })
|
|
|
|
|
|
+ // 启用 禁用
|
|
|
|
+ changeStatus (record) {
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: record.enabledFlag == '1' ? '产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
|
|
|
|
+ centered: true,
|
|
|
|
+ onOk: () => {
|
|
|
|
+ this.setEnable(record)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 启用 禁用
|
|
|
|
+ setEnable (record) {
|
|
|
|
+ const params = {
|
|
|
|
+ id: record.id,
|
|
|
|
+ enabledFlag: record.enabledFlag == 1 ? '0' : '1'
|
|
|
|
+ }
|
|
|
|
+ this.spinning = true
|
|
|
|
+ dealerProductUpdate(params).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ this.spinning = false
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -239,7 +289,7 @@ export default {
|
|
},
|
|
},
|
|
setTableH () {
|
|
setTableH () {
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 195
|
|
|
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|