|
@@ -3,21 +3,18 @@
|
|
|
<vab-query-form>
|
|
<vab-query-form>
|
|
|
<vab-query-form-top-panel>
|
|
<vab-query-form-top-panel>
|
|
|
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
|
|
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
|
|
|
- <el-col :span="5">
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-input v-model.trim="queryForm.prodCode" clearable placeholder="产品编码" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="5">
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-input v-model.trim="queryForm.prodClass" clearable placeholder="产品类别" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="5">
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-input v-model.trim="queryForm.prodName" clearable placeholder="产品名称" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-input v-model.trim="queryForm.prodCode" clearable placeholder="产品编码" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-input v-model.trim="queryForm.prodName" clearable placeholder="产品名称" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-select v-model="queryForm.prodClass" placeholder="产品类别" style="width: 100%">
|
|
|
|
|
+ <el-option v-for="item in classOptions" :key="item.value" :label="item.value" :value="item.value" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
|
|
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
|
|
|
<el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
<el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
@@ -30,10 +27,14 @@
|
|
|
</vab-query-form-left-panel>
|
|
</vab-query-form-left-panel>
|
|
|
<vab-query-form-right-panel>
|
|
<vab-query-form-right-panel>
|
|
|
<table-tool :check-list.sync="checkList" :columns="columns" />
|
|
<table-tool :check-list.sync="checkList" :columns="columns" />
|
|
|
- <el-button icon="el-icon-download" style="float: right" />
|
|
|
|
|
</vab-query-form-right-panel>
|
|
</vab-query-form-right-panel>
|
|
|
|
|
|
|
|
<el-table v-loading="listLoading" border :data="list" :height="height" @selection-change="setSelectRows">
|
|
<el-table v-loading="listLoading" border :data="list" :height="height" @selection-change="setSelectRows">
|
|
|
|
|
+ <el-table-column align="center" label="序号" show-overflow-tooltip width="80">
|
|
|
|
|
+ <template #default="{ $index }">
|
|
|
|
|
+ {{ $index + 1 }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
v-for="(item, index) in finallyColumns"
|
|
v-for="(item, index) in finallyColumns"
|
|
|
:key="index"
|
|
:key="index"
|
|
@@ -44,28 +45,32 @@
|
|
|
:sortable="item.sortable"
|
|
:sortable="item.sortable"
|
|
|
:width="item.width">
|
|
:width="item.width">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <!-- <span v-if="item.prop === 'prodName'">
|
|
|
|
|
- {{ row.prodName }}
|
|
|
|
|
- </span> -->
|
|
|
|
|
<el-button v-if="item.prop === 'prodName'" style="font-size: 14px" type="text" @click="handleDetail(row)">
|
|
<el-button v-if="item.prop === 'prodName'" style="font-size: 14px" type="text" @click="handleDetail(row)">
|
|
|
{{ row.prodName }}
|
|
{{ row.prodName }}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <span v-if="item.prop === 'prodClass'">
|
|
|
|
|
|
|
+ <span v-else-if="item.prop === 'prodClass'">
|
|
|
{{ row.prodClass }}
|
|
{{ row.prodClass }}
|
|
|
</span>
|
|
</span>
|
|
|
- <span v-if="item.prop === 'prodCode'">
|
|
|
|
|
|
|
+ <span v-else-if="item.prop === 'prodCode'">
|
|
|
{{ row.prodCode }}
|
|
{{ row.prodCode }}
|
|
|
</span>
|
|
</span>
|
|
|
- <span v-if="item.prop === 'agentPrice'">{{ parseFloat(row.agentPrice.toFixed(2)).toLocaleString() }}¥</span>
|
|
|
|
|
- <span v-if="item.prop === 'distPrice'">{{ parseFloat(row.distPrice.toFixed(2)).toLocaleString() }}¥</span>
|
|
|
|
|
- <span v-if="item.prop === 'guidPrice'">{{ parseFloat(row.guidPrice.toFixed(2)).toLocaleString() }}¥</span>
|
|
|
|
|
- <span v-if="item.prop === 'marketPrice'">{{ parseFloat(row.marketPrice.toFixed(2)).toLocaleString() }}¥</span>
|
|
|
|
|
|
|
+ <span v-else-if="item.prop === 'agentPrice'">
|
|
|
|
|
+ {{ formatPrice(row.agentPrice) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop === 'distPrice'">
|
|
|
|
|
+ {{ formatPrice(row.distPrice) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop === 'guidPrice'">
|
|
|
|
|
+ {{ formatPrice(row.guidPrice) }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else-if="item.prop === 'marketPrice'">
|
|
|
|
|
+ {{ formatPrice(row.marketPrice) }}
|
|
|
|
|
+ </span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="操作" show-overflow-tooltip width="95">
|
|
|
|
|
|
|
+ <el-table-column align="center" label="操作" show-overflow-tooltip width="160">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
|
|
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
|
|
|
- <!-- <el-button type="text" @click="showDefail(row)">详情</el-button> -->
|
|
|
|
|
<el-button type="text" @click="handleDelete(row)">删除</el-button>
|
|
<el-button type="text" @click="handleDelete(row)">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -87,7 +92,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import Edit from './components/ProductEdit'
|
|
import Edit from './components/ProductEdit'
|
|
|
- import productApi from '@/api/product'
|
|
|
|
|
|
|
+ import productApi from '@/api/base/product'
|
|
|
import TableTool from '@/components/table/TableTool'
|
|
import TableTool from '@/components/table/TableTool'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -106,50 +111,53 @@
|
|
|
},
|
|
},
|
|
|
checkList: [],
|
|
checkList: [],
|
|
|
columns: [
|
|
columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '产品型号',
|
|
|
|
|
+ width: '160px',
|
|
|
|
|
+ prop: 'prodCode',
|
|
|
|
|
+ sortable: false,
|
|
|
|
|
+ disableCheck: true,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
label: '产品名称',
|
|
label: '产品名称',
|
|
|
- width: '120px',
|
|
|
|
|
prop: 'prodName',
|
|
prop: 'prodName',
|
|
|
sortable: false,
|
|
sortable: false,
|
|
|
|
|
+ disableCheck: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '产品类别',
|
|
label: '产品类别',
|
|
|
- width: 'auto',
|
|
|
|
|
|
|
+ width: '160px',
|
|
|
prop: 'prodClass',
|
|
prop: 'prodClass',
|
|
|
sortable: false,
|
|
sortable: false,
|
|
|
disableCheck: true,
|
|
disableCheck: true,
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- label: '产品型号',
|
|
|
|
|
- width: 'auto',
|
|
|
|
|
- prop: 'prodCode',
|
|
|
|
|
- sortable: false,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
label: '签约代理价',
|
|
label: '签约代理价',
|
|
|
- width: 'auto',
|
|
|
|
|
|
|
+ width: '160px',
|
|
|
prop: 'agentPrice',
|
|
prop: 'agentPrice',
|
|
|
sortable: false,
|
|
sortable: false,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '经销商价',
|
|
label: '经销商价',
|
|
|
- width: 'auto',
|
|
|
|
|
|
|
+ width: '160px',
|
|
|
prop: 'distPrice',
|
|
prop: 'distPrice',
|
|
|
- sortable: true,
|
|
|
|
|
|
|
+ sortable: false,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '建议成交价',
|
|
label: '建议成交价',
|
|
|
- width: 'auto',
|
|
|
|
|
|
|
+ width: '160px',
|
|
|
prop: 'guidPrice',
|
|
prop: 'guidPrice',
|
|
|
- sortable: true,
|
|
|
|
|
|
|
+ sortable: false,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '市场报价',
|
|
label: '市场报价',
|
|
|
- width: 'auto',
|
|
|
|
|
|
|
+ width: '160px',
|
|
|
prop: 'marketPrice',
|
|
prop: 'marketPrice',
|
|
|
- sortable: true,
|
|
|
|
|
|
|
+ sortable: false,
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
|
|
+ classOptions: [], //产品分类
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -162,6 +170,7 @@
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ this.getOptions()
|
|
|
this.fetchData()
|
|
this.fetchData()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -177,21 +186,24 @@
|
|
|
prodName: '',
|
|
prodName: '',
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getOptions() {
|
|
|
|
|
+ Promise.all([this.getDicts('product_type')])
|
|
|
|
|
+ .then(([productType]) => {
|
|
|
|
|
+ this.classOptions = productType.data.values || []
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => console.log(err))
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
//详情
|
|
//详情
|
|
|
handleDetail(row) {
|
|
handleDetail(row) {
|
|
|
- this.$router.push({
|
|
|
|
|
- path: '/base/detail',
|
|
|
|
|
- query: {
|
|
|
|
|
- id: row.id,
|
|
|
|
|
- },
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.$refs['edit'].init(row.id, true)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
handleEdit(row) {
|
|
handleEdit(row) {
|
|
|
if (row.id) {
|
|
if (row.id) {
|
|
|
- this.$refs['edit'].showEdit(row)
|
|
|
|
|
|
|
+ this.$refs['edit'].init(row.id)
|
|
|
} else {
|
|
} else {
|
|
|
- this.$refs['edit'].showEdit()
|
|
|
|
|
|
|
+ this.$refs['edit'].init()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|