|
@@ -17,7 +17,7 @@
|
|
<template v-if="advanced">
|
|
<template v-if="advanced">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="产品品牌">
|
|
<a-form-item label="产品品牌">
|
|
- <ProductBrand id="productInfoList-productBrandSn" :sysFlag="0" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
|
|
|
|
|
|
+ <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
@@ -118,18 +118,18 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { commonMixin } from '@/utils/mixin';
|
|
|
|
-import ProductType from '../../common/productType.js';
|
|
|
|
-import ProductBrand from '../../common/productBrand.js';
|
|
|
|
-import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct';
|
|
|
|
-import { STable, VSelect } from '@/components';
|
|
|
|
-import productInfoDetailModal from './detailModal.vue';
|
|
|
|
-import { downloadExcel } from '@/libs/JGPrint.js';
|
|
|
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
|
+import ProductType from '../../common/productType.js'
|
|
|
|
+import ProductBrand from '../../common/productBrand.js'
|
|
|
|
+import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
|
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
|
+import productInfoDetailModal from './detailModal.vue'
|
|
|
|
+import { downloadExcel } from '@/libs/JGPrint.js'
|
|
export default {
|
|
export default {
|
|
name: 'ProductList',
|
|
name: 'ProductList',
|
|
components: { STable, VSelect, productInfoDetailModal, ProductType, ProductBrand },
|
|
components: { STable, VSelect, productInfoDetailModal, ProductType, ProductBrand },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
- data() {
|
|
|
|
|
|
+ data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
@@ -156,8 +156,8 @@ export default {
|
|
dataIndex: 'code',
|
|
dataIndex: 'code',
|
|
width: '12%',
|
|
width: '12%',
|
|
align: 'center',
|
|
align: 'center',
|
|
- customRender: function(text) {
|
|
|
|
- return text || '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -166,8 +166,8 @@ export default {
|
|
width: '13%',
|
|
width: '13%',
|
|
align: 'center',
|
|
align: 'center',
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
- customRender: function(text) {
|
|
|
|
- return text || '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -175,8 +175,8 @@ export default {
|
|
dataIndex: 'origCode',
|
|
dataIndex: 'origCode',
|
|
width: '11%',
|
|
width: '11%',
|
|
align: 'center',
|
|
align: 'center',
|
|
- customRender: function(text) {
|
|
|
|
- return text || '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -184,8 +184,8 @@ export default {
|
|
dataIndex: 'productBrandName',
|
|
dataIndex: 'productBrandName',
|
|
width: '9%',
|
|
width: '9%',
|
|
align: 'center',
|
|
align: 'center',
|
|
- customRender: function(text) {
|
|
|
|
- return text || '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{ title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
|
|
{ title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
|
|
@@ -194,8 +194,8 @@ export default {
|
|
dataIndex: 'specialPrice',
|
|
dataIndex: 'specialPrice',
|
|
width: '7%',
|
|
width: '7%',
|
|
align: 'center',
|
|
align: 'center',
|
|
- customRender: function(text) {
|
|
|
|
- return text || text == 0 ? text : '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || text == 0 ? text : '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -203,8 +203,8 @@ export default {
|
|
dataIndex: 'terminalPrice',
|
|
dataIndex: 'terminalPrice',
|
|
width: '6%',
|
|
width: '6%',
|
|
align: 'center',
|
|
align: 'center',
|
|
- customRender: function(text) {
|
|
|
|
- return text || text == 0 ? text : '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || text == 0 ? text : '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -212,8 +212,8 @@ export default {
|
|
dataIndex: 'carOwnersPrice',
|
|
dataIndex: 'carOwnersPrice',
|
|
width: '6%',
|
|
width: '6%',
|
|
align: 'center',
|
|
align: 'center',
|
|
- customRender: function(text) {
|
|
|
|
- return text || text == 0 ? text : '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || text == 0 ? text : '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -221,8 +221,8 @@ export default {
|
|
dataIndex: 'createDate',
|
|
dataIndex: 'createDate',
|
|
width: '7%',
|
|
width: '7%',
|
|
align: 'center',
|
|
align: 'center',
|
|
- customRender: function(text) {
|
|
|
|
- return text || '--';
|
|
|
|
|
|
+ customRender: function (text) {
|
|
|
|
+ return text || '--'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{ title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
|
|
{ title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
|
|
@@ -230,166 +230,166 @@ export default {
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
- this.disabled = true;
|
|
|
|
- this.spinning = true;
|
|
|
|
|
|
+ this.disabled = true
|
|
|
|
+ this.spinning = true
|
|
return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
- let data;
|
|
|
|
|
|
+ let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- data = res.data;
|
|
|
|
- const no = (data.pageNo - 1) * data.pageSize;
|
|
|
|
|
|
+ data = res.data
|
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
- data.list[i].no = no + i + 1;
|
|
|
|
- const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : '';
|
|
|
|
- const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : '';
|
|
|
|
- const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : '';
|
|
|
|
- data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3;
|
|
|
|
|
|
+ data.list[i].no = no + i + 1
|
|
|
|
+ const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
|
|
|
|
+ const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
|
|
|
|
+ const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
|
|
|
|
+ data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
|
|
}
|
|
}
|
|
- this.disabled = false;
|
|
|
|
|
|
+ this.disabled = false
|
|
}
|
|
}
|
|
- this.spinning = false;
|
|
|
|
- return data;
|
|
|
|
- });
|
|
|
|
|
|
+ this.spinning = false
|
|
|
|
+ return data
|
|
|
|
+ })
|
|
},
|
|
},
|
|
openModal: false, // 查看客户详情 弹框
|
|
openModal: false, // 查看客户详情 弹框
|
|
itemId: '', // 当前产品id
|
|
itemId: '', // 当前产品id
|
|
productBrandList: [], // 品牌下拉数据
|
|
productBrandList: [], // 品牌下拉数据
|
|
productTypeList: [] // 分类下拉数据
|
|
productTypeList: [] // 分类下拉数据
|
|
- };
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 重置
|
|
// 重置
|
|
- resetSearchForm() {
|
|
|
|
- this.queryParam.code = '';
|
|
|
|
- this.queryParam.name = '';
|
|
|
|
- this.queryParam.origCode = '';
|
|
|
|
- this.queryParam.productBrandSn = undefined;
|
|
|
|
- this.queryParam.productTypeSn1 = '';
|
|
|
|
- this.queryParam.productTypeSn2 = '';
|
|
|
|
- this.queryParam.productTypeSn3 = '';
|
|
|
|
- this.queryParam.enabledFlag = undefined;
|
|
|
|
- this.productType = [];
|
|
|
|
- this.$refs.table.refresh(true);
|
|
|
|
|
|
+ resetSearchForm () {
|
|
|
|
+ this.queryParam.code = ''
|
|
|
|
+ this.queryParam.name = ''
|
|
|
|
+ this.queryParam.origCode = ''
|
|
|
|
+ this.queryParam.productBrandSn = undefined
|
|
|
|
+ this.queryParam.productTypeSn1 = ''
|
|
|
|
+ this.queryParam.productTypeSn2 = ''
|
|
|
|
+ this.queryParam.productTypeSn3 = ''
|
|
|
|
+ this.queryParam.enabledFlag = undefined
|
|
|
|
+ this.productType = []
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 新增/编辑
|
|
// 新增/编辑
|
|
- handleEdit(row) {
|
|
|
|
|
|
+ handleEdit (row) {
|
|
if (row) {
|
|
if (row) {
|
|
// 编辑
|
|
// 编辑
|
|
- this.$router.push({ path: `/productManagement/productInfo/edit/${row.id}` });
|
|
|
|
|
|
+ this.$router.push({ path: `/productManagement/productInfo/edit/${row.id}` })
|
|
} else {
|
|
} else {
|
|
// 新增
|
|
// 新增
|
|
- this.$router.push({ path: '/productManagement/productInfo/add' });
|
|
|
|
|
|
+ this.$router.push({ path: '/productManagement/productInfo/add' })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 批量导入
|
|
// 批量导入
|
|
- handleImport() {},
|
|
|
|
- filterOption(input, option) {
|
|
|
|
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
|
|
|
|
+ handleImport () {},
|
|
|
|
+ filterOption (input, option) {
|
|
|
|
+ return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
},
|
|
},
|
|
// 详情
|
|
// 详情
|
|
- handleDetail(row) {
|
|
|
|
- this.itemId = row.id;
|
|
|
|
- this.openModal = true;
|
|
|
|
|
|
+ handleDetail (row) {
|
|
|
|
+ this.itemId = row.id
|
|
|
|
+ this.openModal = true
|
|
},
|
|
},
|
|
// 关闭弹框
|
|
// 关闭弹框
|
|
- closeModal() {
|
|
|
|
- this.itemId = '';
|
|
|
|
- this.openModal = false;
|
|
|
|
|
|
+ closeModal () {
|
|
|
|
+ this.itemId = ''
|
|
|
|
+ this.openModal = false
|
|
},
|
|
},
|
|
// 产品分类 change
|
|
// 产品分类 change
|
|
- changeProductType(val, opt) {
|
|
|
|
- this.queryParam.productTypeSn1 = val[0] ? val[0] : '';
|
|
|
|
- this.queryParam.productTypeSn2 = val[1] ? val[1] : '';
|
|
|
|
- this.queryParam.productTypeSn3 = val[2] ? val[2] : '';
|
|
|
|
|
|
+ changeProductType (val, opt) {
|
|
|
|
+ this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
|
+ this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
|
+ this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
},
|
|
},
|
|
// 启用 禁用
|
|
// 启用 禁用
|
|
- changeStatus(record) {
|
|
|
|
|
|
+ changeStatus (record) {
|
|
if (record.enabledFlag == '1') {
|
|
if (record.enabledFlag == '1') {
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '产品被禁用后,不能再销售,确定禁用吗?',
|
|
content: '产品被禁用后,不能再销售,确定禁用吗?',
|
|
centered: true,
|
|
centered: true,
|
|
onOk: () => {
|
|
onOk: () => {
|
|
- this.setEnable(record);
|
|
|
|
|
|
+ this.setEnable(record)
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
- this.setEnable(record);
|
|
|
|
|
|
+ this.setEnable(record)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 启用 禁用
|
|
// 启用 禁用
|
|
- setEnable(record) {
|
|
|
|
|
|
+ setEnable (record) {
|
|
const params = {
|
|
const params = {
|
|
id: record.id,
|
|
id: record.id,
|
|
enabledFlag: record.enabledFlag == 1 ? '0' : '1'
|
|
enabledFlag: record.enabledFlag == 1 ? '0' : '1'
|
|
- };
|
|
|
|
- this.spinning = true;
|
|
|
|
|
|
+ }
|
|
|
|
+ this.spinning = true
|
|
dealerProductUpdate(params).then(res => {
|
|
dealerProductUpdate(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.$message.success(res.message);
|
|
|
|
- this.$refs.table.refresh();
|
|
|
|
- this.spinning = false;
|
|
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ this.spinning = false
|
|
} else {
|
|
} else {
|
|
- this.$refs.table.refresh();
|
|
|
|
- this.spinning = false;
|
|
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ this.spinning = false
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 导出
|
|
// 导出
|
|
- handleExport() {
|
|
|
|
- this.exportLoading = true;
|
|
|
|
- this.spinning = true;
|
|
|
|
|
|
+ handleExport () {
|
|
|
|
+ this.exportLoading = true
|
|
|
|
+ this.spinning = true
|
|
dealerProductExport(this.queryParam).then(res => {
|
|
dealerProductExport(this.queryParam).then(res => {
|
|
- this.exportLoading = false;
|
|
|
|
- this.spinning = false;
|
|
|
|
- downloadExcel(res, '自建产品列表');
|
|
|
|
- });
|
|
|
|
|
|
+ this.exportLoading = false
|
|
|
|
+ this.spinning = false
|
|
|
|
+ downloadExcel(res, '自建产品列表')
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- pageInit() {
|
|
|
|
- const _this = this;
|
|
|
|
|
|
+ pageInit () {
|
|
|
|
+ const _this = this
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
// 页面渲染完成后的回调
|
|
// 页面渲染完成后的回调
|
|
- _this.setTableH();
|
|
|
|
- });
|
|
|
|
|
|
+ _this.setTableH()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- setTableH() {
|
|
|
|
- const tableSearchH = this.$refs.tableSearch.offsetHeight;
|
|
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 235;
|
|
|
|
|
|
+ setTableH () {
|
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
- advanced(newValue, oldValue) {
|
|
|
|
- const _this = this;
|
|
|
|
|
|
+ advanced (newValue, oldValue) {
|
|
|
|
+ const _this = this
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
// 页面渲染完成后的回调
|
|
// 页面渲染完成后的回调
|
|
- _this.setTableH();
|
|
|
|
- });
|
|
|
|
|
|
+ _this.setTableH()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- '$store.state.app.winHeight'(newValue, oldValue) {
|
|
|
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) {
|
|
// 窗口变更时,需同时更改表格高度
|
|
// 窗口变更时,需同时更改表格高度
|
|
- this.setTableH();
|
|
|
|
|
|
+ this.setTableH()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
|
|
+ mounted () {
|
|
if (!this.$store.state.app.isNewTab) {
|
|
if (!this.$store.state.app.isNewTab) {
|
|
// 页签刷新时调用
|
|
// 页签刷新时调用
|
|
- this.pageInit();
|
|
|
|
- this.resetSearchForm();
|
|
|
|
|
|
+ this.pageInit()
|
|
|
|
+ this.resetSearchForm()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- activated() {
|
|
|
|
|
|
+ activated () {
|
|
// 如果是新页签打开,则重置当前页面
|
|
// 如果是新页签打开,则重置当前页面
|
|
if (this.$store.state.app.isNewTab) {
|
|
if (this.$store.state.app.isNewTab) {
|
|
- this.pageInit();
|
|
|
|
- this.resetSearchForm();
|
|
|
|
|
|
+ this.pageInit()
|
|
|
|
+ this.resetSearchForm()
|
|
}
|
|
}
|
|
// 仅刷新列表,不重置页面
|
|
// 仅刷新列表,不重置页面
|
|
if (this.$store.state.app.updateList) {
|
|
if (this.$store.state.app.updateList) {
|
|
- this.pageInit();
|
|
|
|
- this.$refs.table.refresh();
|
|
|
|
|
|
+ this.pageInit()
|
|
|
|
+ this.$refs.table.refresh()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- beforeRouteEnter(to, from, next) {
|
|
|
|
- next(vm => {});
|
|
|
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
|
+ next(vm => {})
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
+}
|
|
</script>
|
|
</script>
|