|
@@ -9,8 +9,8 @@
|
|
:rules="rules"
|
|
:rules="rules"
|
|
:model="queryParam"
|
|
:model="queryParam"
|
|
@keyup.enter.native="$refs.table.refresh(true)" >
|
|
@keyup.enter.native="$refs.table.refresh(true)" >
|
|
- <a-row :gutter="15">
|
|
|
|
- <a-col :md="7" :sm="24">
|
|
|
|
|
|
+ <a-row :gutter="5">
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
<a-form-model-item label="车架号(VIN)" prop="vinCode">
|
|
<a-form-model-item label="车架号(VIN)" prop="vinCode">
|
|
<a-input id="productInfoList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
|
|
<a-input id="productInfoList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
|
|
<a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
|
|
<a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
|
|
@@ -18,7 +18,7 @@
|
|
<input type="file" id="filed" hidden="" @change="filePreview">
|
|
<input type="file" id="filed" hidden="" @change="filePreview">
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
|
|
+ <a-col :md="5" :sm="24">
|
|
<a-form-model-item label="产品编码">
|
|
<a-form-model-item label="产品编码">
|
|
<a-input id="productInfoList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
|
|
<a-input id="productInfoList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
@@ -29,12 +29,12 @@
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<template v-if="advanced">
|
|
<template v-if="advanced">
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
|
|
+ <a-col :md="8" :sm="24">
|
|
<a-form-model-item label="原厂编码">
|
|
<a-form-model-item label="原厂编码">
|
|
<a-input id="productInfoList-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
|
|
<a-input id="productInfoList-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="7" :sm="24">
|
|
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
<a-form-model-item label="产品分类">
|
|
<a-form-model-item label="产品分类">
|
|
<a-cascader
|
|
<a-cascader
|
|
@change="changeProductType"
|
|
@change="changeProductType"
|
|
@@ -48,7 +48,7 @@
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
- <a-col :md="6" :sm="24">
|
|
|
|
|
|
+ <a-col :md="5" :sm="24">
|
|
<a-form-model-item label="产品品牌">
|
|
<a-form-model-item label="产品品牌">
|
|
<a-select
|
|
<a-select
|
|
placeholder="请选择产品品牌"
|
|
placeholder="请选择产品品牌"
|
|
@@ -77,21 +77,15 @@
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
</template>
|
|
</template>
|
|
- <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
|
|
|
+ <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
|
|
- <a @click="advanced=!advanced" style="margin:0 15px 0 8px">
|
|
|
|
|
|
+ <a @click="advanced=!advanced" style="margin:0 5px">
|
|
{{ advanced ? '收起' : '展开' }}
|
|
{{ advanced ? '收起' : '展开' }}
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
<a-icon :type="advanced ? 'up' : 'down'"/>
|
|
</a>
|
|
</a>
|
|
- <a-popover>
|
|
|
|
- <template slot="content">双击列表配件可快速选中添加</template>
|
|
|
|
- <a-icon type="question-circle" theme="twoTone" />
|
|
|
|
- </a-popover>
|
|
|
|
- <a-popover>
|
|
|
|
- <template slot="content">点击设置列的显示</template>
|
|
|
|
- <a-icon style="margin:0 5px;cursor: pointer;" @click="showSetting = true" type="setting" theme="twoTone" />
|
|
|
|
- </a-popover>
|
|
|
|
|
|
+ <a-checkbox v-model="cost" id="salesQuery-cost">成本价</a-checkbox>
|
|
|
|
+ <a-checkbox v-model="cityPrice" id="salesQuery-cityPrice">市级价</a-checkbox>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
@@ -101,12 +95,12 @@
|
|
class="sTable"
|
|
class="sTable"
|
|
ref="table"
|
|
ref="table"
|
|
size="small"
|
|
size="small"
|
|
- :rowKey="(record) => record.productSn"
|
|
|
|
|
|
+ :rowKey="(record) => record.productSn+record.currentQty"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
:customRow="handleClickRow"
|
|
:customRow="handleClickRow"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
- :scroll="{ x: tableWidth, y: 300 }"
|
|
|
|
|
|
+ :scroll="{ x: 1290, y: 300 }"
|
|
bordered>
|
|
bordered>
|
|
<!-- 售价 -->
|
|
<!-- 售价 -->
|
|
<template slot="salePrice" slot-scope="text, record">
|
|
<template slot="salePrice" slot-scope="text, record">
|
|
@@ -151,23 +145,6 @@
|
|
</s-table>
|
|
</s-table>
|
|
<!-- 销售记录 -->
|
|
<!-- 销售记录 -->
|
|
<product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="closeModal" />
|
|
<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>
|
|
|
|
|
|
@@ -196,20 +173,7 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
- showSetting: false, // 设置弹框
|
|
|
|
vinLoading: false,
|
|
vinLoading: false,
|
|
- 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: { // 查询条件
|
|
customerSn: '',
|
|
customerSn: '',
|
|
@@ -232,22 +196,6 @@ export default {
|
|
productBrandList: [], // 下拉数据
|
|
productBrandList: [], // 下拉数据
|
|
productTypeList: [], // 产品分类 下拉数据
|
|
productTypeList: [], // 产品分类 下拉数据
|
|
warehouseList: [], // 仓库列表
|
|
warehouseList: [], // 仓库列表
|
|
- columnsBak: [
|
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: 120, align: 'center', 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: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '成本价', dataIndex: 'putCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: 100, align: 'center' },
|
|
|
|
- { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 100, align: 'center' },
|
|
|
|
- { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
|
|
|
|
- ],
|
|
|
|
- columns: [],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
@@ -288,12 +236,34 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- openModal: false // 查看客户详情 弹框
|
|
|
|
|
|
+ openModal: false, // 查看客户详情 弹框
|
|
|
|
+ cost: false,
|
|
|
|
+ cityPrice: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ columns () {
|
|
|
|
+ const arr = [
|
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '库存数量', dataIndex: 'currentQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: 100, align: 'center' },
|
|
|
|
+ { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 100, align: 'center' },
|
|
|
|
+ { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
|
|
|
|
+ ]
|
|
|
|
+ if (this.cost) {
|
|
|
|
+ arr.splice(6, 0, { title: '成本价', dataIndex: 'putCost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
+ }
|
|
|
|
+ if (this.cityPrice) {
|
|
|
|
+ arr.splice(this.cost ? 7 : 6, 0, { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
- this.columns = this.columnsBak
|
|
|
|
- this.onSettingChange()
|
|
|
|
// 产品品牌
|
|
// 产品品牌
|
|
if (this.productBrandList.length == 0) {
|
|
if (this.productBrandList.length == 0) {
|
|
this.getProductBrand()
|
|
this.getProductBrand()
|
|
@@ -322,32 +292,6 @@ export default {
|
|
this.queryParam.productCodeList = undefined
|
|
this.queryParam.productCodeList = undefined
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 设置列
|
|
|
|
- onSettingChange (v) {
|
|
|
|
- const k = ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit', 'putCost', 'dealerProduct.cityPrice']
|
|
|
|
- const a = ['productCode', 'productName']
|
|
|
|
- const b = ['salePrice', 'salesNums', 'action']
|
|
|
|
- const c = this.settingColVal
|
|
|
|
- const q = k.filter(item => c.indexOf(item) >= 0)
|
|
|
|
- const o = a.concat(q).concat(b) // 列
|
|
|
|
- const r = q.concat(b) // 计算表格宽度
|
|
|
|
- const d = []
|
|
|
|
- let w = 0
|
|
|
|
- for (let i = 0; i < o.length; i++) {
|
|
|
|
- const row = this.columnsBak.find(item => item.dataIndex == o[i])
|
|
|
|
- if (row) {
|
|
|
|
- d.push(row)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- for (let i = 0; i < r.length; i++) {
|
|
|
|
- const row = this.columnsBak.find(item => item.dataIndex == r[i])
|
|
|
|
- if (row) {
|
|
|
|
- w = w + row.width
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.tableWidth = w + 350
|
|
|
|
- this.columns = d
|
|
|
|
- },
|
|
|
|
// 双击列表
|
|
// 双击列表
|
|
handleClickRow (record) {
|
|
handleClickRow (record) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -468,6 +412,11 @@ export default {
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ cost (newValue, oldValue) {
|
|
|
|
+ this.$emit('isCost', newValue)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|