|
@@ -6,12 +6,12 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品名称">
|
|
|
- <a-input id="productPricingList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
|
|
|
+ <a-input id="productPricingList-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="productPricingList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
|
|
|
+ <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -24,7 +24,7 @@
|
|
|
:showSearch="true"
|
|
|
option-filter-prop="children"
|
|
|
:filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
|
|
|
+ <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn">{{ item.brandName }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -33,17 +33,19 @@
|
|
|
<a-form-item label="产品分类">
|
|
|
<a-cascader
|
|
|
@change="changeProductType"
|
|
|
+ expand-trigger="hover"
|
|
|
change-on-select
|
|
|
:options="productTypeList"
|
|
|
:fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
|
|
|
id="productPricingList-productType"
|
|
|
placeholder="请选择产品分类"
|
|
|
- allowClear />
|
|
|
+ allowClear
|
|
|
+ v-model="productType" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="定价状态">
|
|
|
- <v-select code="ENABLED_FLAG" id="productPricingList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择定价状态"></v-select>
|
|
|
+ <v-select code="PRICING_STATUS" id="productPricingList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
@@ -60,7 +62,7 @@
|
|
|
</div>
|
|
|
<!-- 总计 -->
|
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div slot="message">合计:<strong>300</strong>条</div>
|
|
|
+ <div slot="message">合计:<strong>{{ total }}</strong>条</div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -74,110 +76,95 @@
|
|
|
bordered>
|
|
|
<!-- 产品分类 -->
|
|
|
<template slot="productType" slot-scope="text, record">
|
|
|
- <a-tooltip placement="top">
|
|
|
- <template slot="title">
|
|
|
- <span>{{ record.productTypeName }}</span>
|
|
|
- </template>
|
|
|
- {{ record.productTypeName3 }}
|
|
|
- </a-tooltip>
|
|
|
- </template>
|
|
|
- <!-- 产品状态 -->
|
|
|
- <template slot="status" slot-scope="text, record">
|
|
|
- <a-tag :color="record.status==1?'green':'red'" >{{ record.status==1? '待提交': '待单据审核' }}</a-tag>
|
|
|
+ <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
</template>
|
|
|
<!-- 定价状态 -->
|
|
|
- <template slot="sstatus" slot-scope="text, record">
|
|
|
- <a-tag :color="record.status==1?'green':'red'" >{{ record.status==1? '待提交': '待单据审核' }}</a-tag>
|
|
|
+ <template slot="pricingState" slot-scope="text, record">
|
|
|
+ <a-badge :color="record.pricingState=='WAIT_PRICING'?'gold':record.pricingState=='WAIT_PRICING_AUDIT'?'volcano':'#87d068'" :text="record.pricingStateDictValue" />
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="link" @click="handleAudit(record)" id="productPricingList-audit-btn">审核</a-button>
|
|
|
- <a-divider type="vertical" style="margin: 0;" />
|
|
|
- <a-button size="small" type="link" @click="handleEdit(record)" id="productPricingList-edit-btn">编辑</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.state=='WAIT_PRICING_AUDIT'"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleAudit(record)"
|
|
|
+ id="productPricingList-audit-btn">审核</a-button>
|
|
|
+ <a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productPricingList-edit-btn">编辑</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
<!-- 编辑价格 -->
|
|
|
- <product-pricing-edit-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
|
|
|
+ <product-pricing-edit-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" @ok="$refs.table.refresh()" />
|
|
|
<!-- 审核价格 -->
|
|
|
- <product-pricing-audit-modal :openModal="openAuditModal" :itemId="itemId" @close="closeAuditModal" />
|
|
|
+ <product-pricing-audit-modal :openModal="openAuditModal" :itemSn="itemSn" @close="closeAuditModal" />
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
-// import { dealerProductTypeQuery } from '@/api/dealerProductType'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import productPricingEditModal from './editModal.vue'
|
|
|
import productPricingAuditModal from './auditModal.vue'
|
|
|
+import { productBrandQuery } from '@/api/productBrand'
|
|
|
+import { productTypeQuery } from '@/api/productType'
|
|
|
+import { productPricingList } from '@/api/product'
|
|
|
export default {
|
|
|
components: { STable, VSelect, productPricingEditModal, productPricingAuditModal },
|
|
|
data () {
|
|
|
return {
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
+ tableHeight: 0,
|
|
|
queryParam: { // 查询条件
|
|
|
- productName: '', // 产品名称
|
|
|
- productCode: '', // 产品编码/原厂编码
|
|
|
- productBrandSn: undefined, // 品牌
|
|
|
+ name: '', // 产品名称
|
|
|
+ queryWord: '', // 产品编码/原厂编码
|
|
|
+ productBrandSn: undefined, // 产品品牌
|
|
|
productTypeSn1: '', // 产品一级分类
|
|
|
productTypeSn2: '', // 产品二级分类
|
|
|
productTypeSn3: '', // 产品三级分类
|
|
|
- enabledFlag: undefined // 定价状态
|
|
|
+ pricingState: undefined // 定价状态
|
|
|
},
|
|
|
+ productType: [],
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
|
|
|
- { title: '原厂编码', dataIndex: 'origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '品牌', dataIndex: 'productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'code', width: 220, align: 'center' },
|
|
|
+ { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '品牌', dataIndex: 'productBrandName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 200, align: 'center' },
|
|
|
- { title: '产品状态', scopedSlots: { customRender: 'status' }, width: 120, align: 'center' },
|
|
|
- { title: '定价状态', scopedSlots: { customRender: 'sstatus' }, width: 120, align: 'center' },
|
|
|
+ { title: '产品状态', dataIndex: 'stateDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '定价状态', scopedSlots: { customRender: 'pricingState' }, width: 140, align: 'center' },
|
|
|
{ title: '成本价', dataIndex: 'sterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '省级价', dataIndex: 'sdterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '市级价', dataIndex: 'fterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '特约价', dataIndex: 'gterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '终端价', dataIndex: 'hterminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '车主价', dataIndex: 'terminaldsdPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '省级价', dataIndex: 'provincePrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '市级价', dataIndex: 'cityPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '终端价', dataIndex: 'terminalPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '车主价', dataIndex: 'carOwnersPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- // return dealerProductList(Object.assign(parameter, this.queryParam)).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
|
|
|
- // return data
|
|
|
- // })
|
|
|
- const _this = this
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
- const data = {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- list: [
|
|
|
- { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productPic: ['https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', 'https://qn.antdv.com/vue.png'], productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
|
|
|
- ]
|
|
|
- }
|
|
|
+ if (this.tableHeight == 0) {
|
|
|
+ this.tableHeight = window.innerHeight - 380
|
|
|
+ }
|
|
|
+ return productPricingList(Object.assign(parameter, this.queryParam)).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
|
|
|
}
|
|
|
- _this.disabled = false
|
|
|
- resolve(data)
|
|
|
+ this.total = data.count || 0
|
|
|
+ this.disabled = false
|
|
|
+ return data
|
|
|
})
|
|
|
},
|
|
|
+ total: 0, // 合计
|
|
|
openModal: false, // 编辑 弹框
|
|
|
openAuditModal: false, // 审核 弹框
|
|
|
- itemId: '', // 当前产品id
|
|
|
+ itemSn: '', // 当前产品sn
|
|
|
productBrandList: [], // 品牌下拉数据
|
|
|
productTypeList: [] // 分类下拉数据
|
|
|
}
|
|
@@ -185,18 +172,19 @@ export default {
|
|
|
methods: {
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.productCode = ''
|
|
|
- this.queryParam.productName = ''
|
|
|
+ this.queryParam.name = ''
|
|
|
+ this.queryParam.queryWord = ''
|
|
|
this.queryParam.productBrandSn = undefined
|
|
|
this.queryParam.productTypeSn1 = ''
|
|
|
this.queryParam.productTypeSn2 = ''
|
|
|
this.queryParam.productTypeSn3 = ''
|
|
|
- this.queryParam.enabledFlag = undefined
|
|
|
+ this.queryParam.pricingState = undefined
|
|
|
+ this.productType = []
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 审核
|
|
|
handleAudit (row) {
|
|
|
- this.itemId = row.id
|
|
|
+ this.itemSn = row.productSn
|
|
|
this.openAuditModal = true
|
|
|
},
|
|
|
filterOption (input, option) {
|
|
@@ -206,17 +194,17 @@ export default {
|
|
|
},
|
|
|
// 编辑
|
|
|
handleEdit (row) {
|
|
|
- this.itemId = row.id
|
|
|
+ this.itemSn = row.productSn
|
|
|
this.openModal = true
|
|
|
},
|
|
|
// 关闭弹框
|
|
|
closeModal () {
|
|
|
- this.itemId = ''
|
|
|
+ this.itemSn = ''
|
|
|
this.openModal = false
|
|
|
},
|
|
|
// 关闭审核弹框
|
|
|
closeAuditModal () {
|
|
|
- this.itemId = ''
|
|
|
+ this.itemSn = ''
|
|
|
this.openAuditModal = false
|
|
|
},
|
|
|
// 产品分类 change
|
|
@@ -227,7 +215,7 @@ export default {
|
|
|
},
|
|
|
// 产品品牌 列表
|
|
|
getProductBrand () {
|
|
|
- dealerProductBrandQuery({}).then(res => {
|
|
|
+ productBrandQuery({}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.productBrandList = res.data
|
|
|
} else {
|
|
@@ -237,7 +225,7 @@ export default {
|
|
|
},
|
|
|
// 产品分类 列表
|
|
|
getProductType () {
|
|
|
- dealerProductTypeQuery({}).then(res => {
|
|
|
+ productTypeQuery({}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.productTypeList = res.data
|
|
|
} else {
|