|
@@ -3,7 +3,7 @@
|
|
|
<a-card size="small" :bordered="false" class="productInfoList-wrap searchBoxNormal">
|
|
|
<!-- 搜索条件 -->
|
|
|
<div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-form layout="inline" id="productInfoList-form" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品名称">
|
|
@@ -49,13 +49,13 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-model-item label="最近修改时间">
|
|
|
- <rangeDate ref="rangeDate" @change="dateChange" />
|
|
|
- </a-form-model-item>
|
|
|
+ <a-form-item label="最近修改时间">
|
|
|
+ <rangeDate id="productInfoList-rangeDate" ref="rangeDate" @change="dateChange" />
|
|
|
+ </a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="停产状态">
|
|
|
- <a-select v-model="queryParam.haltProdFlag" placeholder="请选择停产状态" allowClear>
|
|
|
+ <a-select v-model="queryParam.haltProdFlag" id="productInfoList-haltProdFlag" placeholder="请选择停产状态" allowClear>
|
|
|
<a-select-option value="0">
|
|
|
启用
|
|
|
</a-select-option>
|
|
@@ -78,7 +78,7 @@
|
|
|
:disabled="disabled"
|
|
|
:loading="exportLoading"
|
|
|
id="productInfoList-export">导出</a-button>
|
|
|
- <a @click="advanced=!advanced" style="margin-left: 5px">
|
|
|
+ <a @click="advanced=!advanced" id="productInfoList-isAdvanced" style="margin-left: 5px">
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
</a>
|
|
@@ -91,10 +91,9 @@
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<!-- 操作按钮 -->
|
|
|
<div class="table-operator">
|
|
|
- <a-button type="primary" v-if="$hasPermissions('B_productInfo_add')" @click="handleEdit()">新增</a-button>
|
|
|
- <a-button type="primary" class="button-info" @click="handleMenuClick({key:'1'})" v-if="$hasPermissions('B_productInfo_batchImport')"> 新增产品导入</a-button>
|
|
|
- <a-button type="primary" class="button-info" @click="handleMenuClick({key:'2'})" v-if="$hasPermissions('B_offlineProduct_import')"> 下线产品导入</a-button>
|
|
|
-
|
|
|
+ <a-button type="primary" id="productInfoList-add" v-if="$hasPermissions('B_productInfo_add')" @click="handleEdit()">新增</a-button>
|
|
|
+ <a-button type="primary" id="productInfoList-addProduct" class="button-info" @click="handleMenuClick({key:'1'})" v-if="$hasPermissions('B_productInfo_batchImport')"> 新增产品导入</a-button>
|
|
|
+ <a-button type="primary" id="productInfoList-import" class="button-info" @click="handleMenuClick({key:'2'})" v-if="$hasPermissions('B_offlineProduct_import')"> 下线产品导入</a-button>
|
|
|
<a-button
|
|
|
id="productInfoList-batchAudit"
|
|
|
type="primary"
|
|
@@ -120,9 +119,9 @@
|
|
|
:loading="loadingDownline"
|
|
|
@click="handleBatchDownline"
|
|
|
style="margin: 0 5px;">批量下线</a-button>
|
|
|
- <span style="margin-left: 8px" v-if="$hasPermissions('B_productInfo_batchAudit') || $hasPermissions('B_productInfo_batchLaunch') || $hasPermissions('B_productInfo_batchDownline')">
|
|
|
- <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
|
|
|
- </span>
|
|
|
+ <span style="margin-left: 8px" v-if="$hasPermissions('B_productInfo_batchAudit') || $hasPermissions('B_productInfo_batchLaunch') || $hasPermissions('B_productInfo_batchDownline')">
|
|
|
+ <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<s-table
|
|
|
class="sTable fixPagination"
|
|
@@ -146,6 +145,7 @@
|
|
|
自有<a-icon type="question-circle" :style="{ marginLeft: '10px' }" />
|
|
|
</a-tooltip>
|
|
|
</template>
|
|
|
+ <!-- 判断是否是自有产品 -->
|
|
|
<template slot="arrowFalg" slot-scope="text, record">
|
|
|
<span v-if="record.arrowFalg">{{ record.arrowFalg == 1 ? '是' : '否' }}</span>
|
|
|
<span v-else>--</span>
|
|
@@ -160,7 +160,7 @@
|
|
|
<a-switch
|
|
|
checkedChildren="启用"
|
|
|
unCheckedChildren="停产"
|
|
|
- id="roleList-isEnable"
|
|
|
+ id="productInfoList-isEnable"
|
|
|
v-model="record.stopFlag"
|
|
|
@change="changeFlagHandle(record)" />
|
|
|
</template>
|
|
@@ -231,14 +231,16 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import { exportExcel } from '@/libs/JGPrint.js'
|
|
|
+// 组件
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import productInfoDetailModal from './detailModal.vue'
|
|
|
import productInfoOfflineModal from './offlineModal.vue'
|
|
|
import ProductBrand from '@/views/common/productBrand.js'
|
|
|
import productTypeAll from '@/views/common/productTypeAll.js'
|
|
|
-import { exportExcel } from '@/libs/JGPrint.js'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
import importGuideModal from './importGuideModal.vue'
|
|
|
+// 接口
|
|
|
import { productList, productAudit, productBatchAudit, productDel, productOnline, productBatchOnline, productExport, saveBatchImportProduct, importSaveBatch, updateHaltProdFlag } from '@/api/product'
|
|
|
export default {
|
|
|
name: 'ProductInfoList',
|
|
@@ -248,11 +250,14 @@ export default {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
- tableHeight: 0,
|
|
|
- queryParam: { // 查询条件
|
|
|
+ tableHeight: 0, // 表格高度
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ exportLoading: false, // 导出按钮加载状态
|
|
|
+ // 查询条件
|
|
|
+ queryParam: {
|
|
|
haltProdFlag: undefined, // 停产状态
|
|
|
- updateBeginDate: '',
|
|
|
- updateEndDate: '',
|
|
|
+ updateBeginDate: '', // 最近修改时间 开始日期
|
|
|
+ updateEndDate: '', // 最近修改时间 结束日期
|
|
|
name: '', // 产品名称
|
|
|
queryWord: '', // 产品编码/原厂编码
|
|
|
productBrandSn: undefined, // 产品品牌
|
|
@@ -261,12 +266,11 @@ export default {
|
|
|
productTypeSn3: '', // 产品三级分类
|
|
|
state: undefined, // 产品状态
|
|
|
pricingState: undefined, // 定价状态
|
|
|
- picFlag: undefined
|
|
|
+ picFlag: undefined// 产品图片
|
|
|
},
|
|
|
- productType: [],
|
|
|
- disabled: false, // 查询、重置按钮是否可操作
|
|
|
- exportLoading: false,
|
|
|
- openGuideModal: false,
|
|
|
+ productType: [], // 产品类型
|
|
|
+
|
|
|
+ openGuideModal: false, // 导入产品 弹窗
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
@@ -284,17 +288,19 @@ export default {
|
|
|
{ title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '5%', align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
],
|
|
|
- loadingAudit: false,
|
|
|
- loadingLaunch: false,
|
|
|
- loadingDownline: false,
|
|
|
+ loadingAudit: false, // 审核按钮加载状态
|
|
|
+ loadingLaunch: false, // 上线按钮加载状态
|
|
|
+ loadingDownline: false, // 下线按钮加载状态
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
+ // 获取列表数据 有分页
|
|
|
return productList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
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
|
|
@@ -310,8 +316,8 @@ export default {
|
|
|
itemSn: '', // 当前sn
|
|
|
openOfflineModal: false, // 下线 弹框
|
|
|
offlineProductList: [], // 下线 当前所选数据
|
|
|
- pageFromInfo: null,
|
|
|
- rowSelectionInfo: null,
|
|
|
+ pageFromInfo: null, // 页面跳转来源 productInfoAdd
|
|
|
+ rowSelectionInfo: null, // 表格选中数据
|
|
|
guideModalType: ''// 1 新增产品批量导入 2下线产品批量导入
|
|
|
}
|
|
|
},
|
|
@@ -327,7 +333,7 @@ export default {
|
|
|
this.guideModalType = e.key
|
|
|
this.openGuideModal = true
|
|
|
},
|
|
|
- // 创建时间 change
|
|
|
+ // 最近修改时间 change
|
|
|
dateChange (date) {
|
|
|
this.queryParam.updateBeginDate = date[0] || ''
|
|
|
this.queryParam.updateEndDate = date[1] || ''
|
|
@@ -607,18 +613,21 @@ export default {
|
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
},
|
|
|
+ // 计算表格高度
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - 240
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ // 监听 展开关闭时表格高度变化
|
|
|
advanced (newValue, oldValue) {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|