|
@@ -20,56 +20,14 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<template v-if="advanced">
|
|
<template v-if="advanced">
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="车架号(VIN)">
|
|
|
|
- <a-input id="productInfoList-vinNo" v-model.trim="queryParam.vinNo" allowClear placeholder="请输入车架号(VIN)"/>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="产品品牌">
|
|
<a-form-item label="产品品牌">
|
|
- <a-select
|
|
+ <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
|
|
- placeholder="请选择产品品牌"
|
|
|
|
- id="productInfoList-productBrandSn"
|
|
|
|
- allowClear
|
|
|
|
- v-model="queryParam.brandSn"
|
|
|
|
- :showSearch="true"
|
|
|
|
- option-filter-prop="children"
|
|
|
|
- :filter-option="filterOption">
|
|
|
|
- <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-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="产品类别">
|
|
<a-form-item label="产品类别">
|
|
- <a-cascader
|
|
+ <ProductType id="productInfoList-productType" v-model="productType" @change="changeProductType"></ProductType>
|
|
- @change="changeProductType"
|
|
|
|
- change-on-select
|
|
|
|
- v-model="productType"
|
|
|
|
- expand-trigger="hover"
|
|
|
|
- :options="productTypeList"
|
|
|
|
- :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
|
|
- id="productInfoList-productType"
|
|
|
|
- placeholder="请选择产品分类"
|
|
|
|
- allowClear />
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="车型">
|
|
|
|
- <v-select code="CHECK_ENABLE_STATE" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择车型"></v-select>
|
|
|
|
- </a-form-item>
|
|
|
|
- </a-col>
|
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
- <a-form-item label="仓库">
|
|
|
|
- <a-select
|
|
|
|
- placeholder="请选择仓库"
|
|
|
|
- id="productInfoList-warehouseSn"
|
|
|
|
- allowClear
|
|
|
|
- v-model="queryParam.warehouseSn"
|
|
|
|
- :showSearch="true"
|
|
|
|
- option-filter-prop="children"
|
|
|
|
- :filter-option="filterOption">
|
|
|
|
- <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
</template>
|
|
</template>
|
|
@@ -84,10 +42,6 @@
|
|
<template slot="content">双击列表配件可快速选中添加</template>
|
|
<template slot="content">双击列表配件可快速选中添加</template>
|
|
<a-icon type="question-circle" theme="twoTone" />
|
|
<a-icon type="question-circle" theme="twoTone" />
|
|
</a-popover>
|
|
</a-popover>
|
|
- <a-popover>
|
|
|
|
- <template slot="content">点击设置列的显示</template>
|
|
|
|
- <a-icon style="margin:0 15px;cursor: pointer;" @click="showSetting = true" type="setting" theme="twoTone" />
|
|
|
|
- </a-popover>
|
|
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
@@ -104,19 +58,6 @@
|
|
:scroll="{ x: tableWidth, y: 300 }"
|
|
:scroll="{ x: tableWidth, y: 300 }"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
bordered>
|
|
bordered>
|
|
- <!-- 售价 -->
|
|
|
|
- <template slot="salePrice" slot-scope="text, record">
|
|
|
|
- <div @dblclick.stop>
|
|
|
|
- ¥
|
|
|
|
- <a-input-number
|
|
|
|
- size="small"
|
|
|
|
- v-model="record.salePrice"
|
|
|
|
- :precision="2"
|
|
|
|
- :min="0"
|
|
|
|
- :max="999999"
|
|
|
|
- placeholder="请输入" />
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
<!-- 销售数量 -->
|
|
<!-- 销售数量 -->
|
|
<template slot="nums" slot-scope="text, record">
|
|
<template slot="nums" slot-scope="text, record">
|
|
<div @dblclick.stop>
|
|
<div @dblclick.stop>
|
|
@@ -138,48 +79,20 @@
|
|
:loading="newLoading"
|
|
:loading="newLoading"
|
|
@click="handleAdd(record)"
|
|
@click="handleAdd(record)"
|
|
id="productInfoList-edit-btn">添加</a-button>
|
|
id="productInfoList-edit-btn">添加</a-button>
|
|
- <a-button
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- class="button-success"
|
|
|
|
- @click="handleDetail(record)"
|
|
|
|
- id="productInfoList-detail-btn"
|
|
|
|
- style="margin-left: 15px;">销售记录</a-button>
|
|
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
- <!-- 销售记录 -->
|
|
|
|
- <product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="closeModal" />
|
|
|
|
- <!-- 设置列 -->
|
|
|
|
- <a-modal
|
|
|
|
- v-model="showSetting"
|
|
|
|
- title="设置要显示的列"
|
|
|
|
- centered
|
|
|
|
- :footer="null"
|
|
|
|
- @ok="() => (showSetting = false)"
|
|
|
|
- >
|
|
|
|
- <a-checkbox-group v-model="settingColVal" @change="onSettingChange">
|
|
|
|
- <a-row>
|
|
|
|
- <a-col :span="8" v-for="item in settingColList" :key="item.value">
|
|
|
|
- <a-checkbox :value="item.value">
|
|
|
|
- {{ item.label }}
|
|
|
|
- </a-checkbox>
|
|
|
|
- </a-col>
|
|
|
|
- </a-row>
|
|
|
|
- </a-checkbox-group>
|
|
|
|
- </a-modal>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-// import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
|
|
-// import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
|
import { querySumByProductLocation } from '@/api/stock'
|
|
import { querySumByProductLocation } from '@/api/stock'
|
|
import { warehouseAllList } from '@/api/warehouse'
|
|
import { warehouseAllList } from '@/api/warehouse'
|
|
-import productSalesRecordModal from './productSalesRecordModal.vue'
|
|
+import ProductType from '@/views/common/productType.js'
|
|
|
|
+import ProductBrand from '@/views/common/productBrand.js'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
export default {
|
|
export default {
|
|
name: 'QueryPart',
|
|
name: 'QueryPart',
|
|
- components: { STable, VSelect, productSalesRecordModal },
|
|
+ components: { STable, VSelect, ProductBrand, ProductType },
|
|
props: {
|
|
props: {
|
|
buyerSn: {
|
|
buyerSn: {
|
|
type: [Number, String],
|
|
type: [Number, String],
|
|
@@ -196,17 +109,6 @@ export default {
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
showSetting: false, // 设置弹框
|
|
showSetting: false, // 设置弹框
|
|
tableWidth: 0,
|
|
tableWidth: 0,
|
|
- settingColVal: ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit'],
|
|
|
|
- settingColList: [
|
|
|
|
- { label: '原厂编码', value: 'productOrigCode' },
|
|
|
|
- { label: '品牌', value: 'brandName' },
|
|
|
|
- { label: '仓库', value: 'warehouseName' },
|
|
|
|
- { label: '仓位', value: 'warehouseLocationName' },
|
|
|
|
- { label: '库存数量', value: 'currentQty' },
|
|
|
|
- { label: '单位', value: 'unit' },
|
|
|
|
- { label: '成本价', value: 'putCost' },
|
|
|
|
- { label: '市级价', value: 'dealerProduct.cityPrice' }
|
|
|
|
- ],
|
|
|
|
productType: [],
|
|
productType: [],
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
salePriceType: '',
|
|
salePriceType: '',
|
|
@@ -216,48 +118,27 @@ export default {
|
|
brandSn: undefined, // 产品品牌
|
|
brandSn: undefined, // 产品品牌
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn1: '', // 产品一级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
productTypeSn2: '', // 产品二级分类
|
|
- productTypeSn3: '', // 产品三级分类
|
|
+ productTypeSn3: '' // 产品三级分类
|
|
- warehouseSn: undefined // 仓库
|
|
|
|
},
|
|
},
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
exportLoading: false, // 导出loading
|
|
exportLoading: false, // 导出loading
|
|
- productBrandList: [], // 下拉数据
|
|
+ columns: [
|
|
- productTypeList: [], // 产品类别 下拉数据
|
|
|
|
- warehouseList: [], // 仓库列表
|
|
|
|
- columnsBak: [
|
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
- { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
{ title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
|
|
{ title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
|
|
{ title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '成本价', dataIndex: 'putCost', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
|
|
- { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
|
|
{ title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: 150, align: 'center' },
|
|
{ title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: 150, align: 'center' },
|
|
|
|
+ { title: '包装数', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
|
|
{ title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
|
|
{ title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
|
|
{ title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
- columns: [],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.queryParam.salePriceType = this.priceType
|
|
this.queryParam.salePriceType = this.priceType
|
|
- // 排序
|
|
|
|
- if (parameter.sortField == 'productCode') {
|
|
|
|
- parameter.sortField = 'code'
|
|
|
|
- parameter.sortAlias = 'product '
|
|
|
|
- }
|
|
|
|
- if (parameter.sortField == 'brandName') {
|
|
|
|
- parameter.sortField = 'firstChar'
|
|
|
|
- parameter.sortAlias = 'brand'
|
|
|
|
- }
|
|
|
|
- if (parameter.sortField == 'warehouseName') {
|
|
|
|
- parameter.sortField = 'warehouseSn'
|
|
|
|
- parameter.sortAlias = 'sd'
|
|
|
|
- }
|
|
|
|
return querySumByProductLocation(Object.assign(parameter, this.queryParam)).then(res => {
|
|
return querySumByProductLocation(Object.assign(parameter, this.queryParam)).then(res => {
|
|
const data = res.data
|
|
const data = res.data
|
|
data.list = data.list.filter(item => item != null)
|
|
data.list = data.list.filter(item => item != null)
|
|
@@ -270,48 +151,10 @@ export default {
|
|
this.disabled = false
|
|
this.disabled = false
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
- },
|
|
+ }
|
|
- openModal: false // 查看客户详情 弹框
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- created () {
|
|
|
|
- this.columns = this.columnsBak
|
|
|
|
- this.onSettingChange()
|
|
|
|
- // 产品品牌
|
|
|
|
- if (this.productBrandList.length == 0) {
|
|
|
|
- this.getProductBrand()
|
|
|
|
- }
|
|
|
|
- // 产品分类
|
|
|
|
- if (this.productTypeList.length == 0) {
|
|
|
|
- this.getProductType()
|
|
|
|
- }
|
|
|
|
- // 仓库
|
|
|
|
- if (this.warehouseList.length == 0) {
|
|
|
|
- this.getWarehouse()
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 设置列
|
|
|
|
- onSettingChange (v) {
|
|
|
|
- const k = ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit', 'putCost', 'dealerProduct.cityPrice']
|
|
|
|
- const a = ['no', 'productCode', 'productName']
|
|
|
|
- const b = ['salePrice', 'salesNums', 'action']
|
|
|
|
- const c = this.settingColVal
|
|
|
|
- const q = k.filter(item => c.indexOf(item) >= 0)
|
|
|
|
- const r = a.concat(q).concat(b)
|
|
|
|
- const d = []
|
|
|
|
- let w = 0
|
|
|
|
- for (let i = 0; i < r.length; i++) {
|
|
|
|
- const row = this.columnsBak.find(item => item.dataIndex == r[i])
|
|
|
|
- if (row) {
|
|
|
|
- w = w + row.width
|
|
|
|
- d.push(row)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- console.log(w)
|
|
|
|
- this.tableWidth = w
|
|
|
|
- this.columns = d
|
|
|
|
- },
|
|
|
|
// 双击列表
|
|
// 双击列表
|
|
handleClickRow (record) {
|
|
handleClickRow (record) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -333,7 +176,6 @@ export default {
|
|
this.queryParam.productTypeSn1 = ''
|
|
this.queryParam.productTypeSn1 = ''
|
|
this.queryParam.productTypeSn2 = ''
|
|
this.queryParam.productTypeSn2 = ''
|
|
this.queryParam.productTypeSn3 = ''
|
|
this.queryParam.productTypeSn3 = ''
|
|
- this.queryParam.warehouseSn = undefined
|
|
|
|
this.productType = []
|
|
this.productType = []
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
@@ -341,54 +183,10 @@ export default {
|
|
resetCurForm () {
|
|
resetCurForm () {
|
|
this.$refs.table.refresh()
|
|
this.$refs.table.refresh()
|
|
},
|
|
},
|
|
- filterOption (input, option) {
|
|
|
|
- return (
|
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
- )
|
|
|
|
- },
|
|
|
|
// 选择配件
|
|
// 选择配件
|
|
handleAdd (row) {
|
|
handleAdd (row) {
|
|
this.$emit('add', row)
|
|
this.$emit('add', row)
|
|
},
|
|
},
|
|
- // 销售记录
|
|
|
|
- handleDetail (row) {
|
|
|
|
- this.openModal = true
|
|
|
|
- this.$refs.salseRecord.getDetail(this.buyerSn, row.productSn)
|
|
|
|
- },
|
|
|
|
- // 关闭弹框
|
|
|
|
- closeModal () {
|
|
|
|
- this.openModal = false
|
|
|
|
- },
|
|
|
|
- // 仓库
|
|
|
|
- getWarehouse () {
|
|
|
|
- warehouseAllList({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.warehouseList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.warehouseList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 产品品牌 列表
|
|
|
|
- getProductBrand () {
|
|
|
|
- dealerProductBrandQuery({ sysFlag: 0 }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productBrandList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productBrandList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 产品分类 列表
|
|
|
|
- getProductType () {
|
|
|
|
- dealerProductTypeList({}).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.productTypeList = res.data
|
|
|
|
- } else {
|
|
|
|
- this.productTypeList = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 产品分类 change
|
|
// 产品分类 change
|
|
changeProductType (val, opt) {
|
|
changeProductType (val, opt) {
|
|
this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|