|
@@ -38,12 +38,12 @@
|
|
|
allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品名称">
|
|
|
- <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
<template v-if="advanced">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="产品名称">
|
|
|
+ <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品编码">
|
|
|
<a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
|
|
@@ -58,13 +58,6 @@
|
|
|
<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 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="newProduct-export">导出</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 5px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
@@ -82,7 +75,8 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1300, y: tableHeight }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ :scroll="{ x: 1090, y: tableHeight }"
|
|
|
bordered>
|
|
|
<!-- 产品分类 -->
|
|
|
<template slot="productType" slot-scope="text, record">
|
|
@@ -104,10 +98,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import moment from 'moment'
|
|
|
import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
-// import { dealerProductList, dealerProductExport } from '@/api/dealerProduct'
|
|
|
import { queryNewProductPage } from '@/api/product'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
@@ -136,36 +128,32 @@ export default {
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
exportLoading: false, // 导出loading
|
|
|
columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
+ { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
|
|
|
{ title: '上线日期', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品品牌', dataIndex: 'productBrandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
|
|
|
+ { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 140, align: 'center' },
|
|
|
{ title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品编码', dataIndex: 'code', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单位', dataIndex: 'unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原厂编码', dataIndex: 'origCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
+ { title: '产品编码', dataIndex: 'code', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '原厂编码', dataIndex: 'origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return queryNewProductPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ return queryNewProductPage(Object.assign(parameter, this.queryParam, { onlineFalg: this.$route.params.onlineFalg })).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
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
|
|
|
}
|
|
|
this.disabled = false
|
|
|
this.spinning = false
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- openModal: false, // 查看客户详情 弹框
|
|
|
+ openModal: false, // 查看详情 弹框
|
|
|
itemId: '', // 当前产品productSn
|
|
|
productBrandList: [], // 品牌下拉数据
|
|
|
productTypeList: [] // 分类下拉数据
|
|
@@ -207,28 +195,6 @@ export default {
|
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
- // 导出
|
|
|
- handleExport () {
|
|
|
- this.exportLoading = true
|
|
|
- this.spinning = true
|
|
|
- dealerProductExport(this.queryParam).then(res => {
|
|
|
- this.exportLoading = false
|
|
|
- this.download(res)
|
|
|
- this.spinning = false
|
|
|
- })
|
|
|
- },
|
|
|
- download (data) {
|
|
|
- if (!data) { return }
|
|
|
- const url = window.URL.createObjectURL(new Blob([data]))
|
|
|
- const link = document.createElement('a')
|
|
|
- link.style.display = 'none'
|
|
|
- link.href = url
|
|
|
- const a = moment().format('YYYYMMDDHHmmss')
|
|
|
- const fname = '自建产品列表' + a
|
|
|
- link.setAttribute('download', fname + '.xlsx')
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- },
|
|
|
// 产品品牌 列表
|
|
|
getProductBrand () {
|
|
|
dealerProductBrandQuery({}).then(res => {
|
|
@@ -251,7 +217,7 @@ export default {
|
|
|
},
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 215
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -270,6 +236,7 @@ export default {
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
+ vm.$refs.table.refresh(true)
|
|
|
vm.getProductBrand()
|
|
|
vm.getProductType()
|
|
|
})
|