|
@@ -7,7 +7,16 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-model-item label="门店名称">
|
|
|
- <a-input id="chainInventoryList-storeName" v-model.trim="queryParam.storeName" allowClear placeholder="请输入门店名称"/>
|
|
|
+ <a-select
|
|
|
+ placeholder="请选择门店名称"
|
|
|
+ id="chainInventoryList-storeName"
|
|
|
+ allowClear
|
|
|
+ v-model.trim="queryParam.tenantId"
|
|
|
+ :showSearch="true"
|
|
|
+ option-filter-prop="children"
|
|
|
+ :filter-option="filterOption">
|
|
|
+ <a-select-option v-for="item in linkageGroupData" :id="item.dealerSn" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -63,7 +72,7 @@
|
|
|
bordered>
|
|
|
<!-- 产品分类 -->
|
|
|
<template slot="productType" slot-scope="text, record">
|
|
|
- <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
|
|
|
+ <span v-if="record.productEntity&&(record.productEntity.productTypeName2 || record.productEntity.productTypeName3)">{{ record.productEntity.productTypeName2 }} {{ record.productEntity.productTypeName3 ? '>' : '' }} {{ record.productEntity.productTypeName3 }}</span>
|
|
|
<span v-else>--</span>
|
|
|
</template>
|
|
|
</s-table>
|
|
@@ -78,7 +87,8 @@ import { STable, VSelect } from '@/components'
|
|
|
import ProductType from '@/views/common/productType.js'// 产品分类
|
|
|
import ProductBrand from '@/views/common/productBrand.js'// 产品品牌
|
|
|
// 接口
|
|
|
-import { stockWarnList } from '@/api/stockWarn'
|
|
|
+import { stockQueryLinkPage } from '@/api/stock'
|
|
|
+import { linkageGroupList } from '@/api/reportData'
|
|
|
export default {
|
|
|
name: 'ChainInventoryList',
|
|
|
components: { STable, VSelect, ProductType, ProductBrand },
|
|
@@ -90,7 +100,8 @@ export default {
|
|
|
tableHeight: 0, // 表格高度
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
queryParam: { // 查询条件
|
|
|
- storeName: undefined, // 门店名称
|
|
|
+ tenantIdList: [],
|
|
|
+ tenantId: undefined, // 门店名称
|
|
|
productCode: '', // 产品编码
|
|
|
productName: '', // 产品名称
|
|
|
productOrigCode: '', // 原厂编码
|
|
@@ -100,21 +111,29 @@ export default {
|
|
|
productTypeSn3: undefined // 产品分类3
|
|
|
},
|
|
|
productType: [], // 产品分类默认值
|
|
|
+ linkageGroupData: [], // 门店列表
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '门店名称', dataIndex: 'storeName', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '门店名称', dataIndex: 'dealerName', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'dealerProduct.origCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品品牌', dataIndex: 'brandName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品品牌', dataIndex: 'productEntity.productBrandName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '15%', align: 'center' },
|
|
|
- { title: '可用库存数量(个)', dataIndex: 'stockNum', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ { title: '可用库存数量(个)', dataIndex: 'currentStockQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
+ if (this.queryParam.tenantId && this.queryParam.tenantId.length > 0) {
|
|
|
+ this.queryParam.tenantIdList[0] = this.queryParam.tenantId
|
|
|
+ } else {
|
|
|
+ this.queryParam.tenantIdList = []
|
|
|
+ }
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return stockWarnList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ const parames = Object.assign(parameter, this.queryParam)
|
|
|
+ delete parames.tenantId
|
|
|
+ return stockQueryLinkPage(parames).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -147,7 +166,8 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.storeName = undefined
|
|
|
+ this.queryParam.tenantIdList = []
|
|
|
+ this.queryParam.tenantId = undefined
|
|
|
this.queryParam.productCode = ''
|
|
|
this.queryParam.productName = ''
|
|
|
this.queryParam.productOrigCode = ''
|
|
@@ -159,6 +179,27 @@ export default {
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
this.$refs.table.clearTable()
|
|
|
},
|
|
|
+ // 门店店筛选
|
|
|
+ filterOption (input, option) {
|
|
|
+ return (
|
|
|
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ )
|
|
|
+ },
|
|
|
+ // 门店列表
|
|
|
+ getLinkageGroup () {
|
|
|
+ linkageGroupList({}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ const data = res.data || []
|
|
|
+ if (data.length > 0) {
|
|
|
+ this.linkageGroupData = data
|
|
|
+ } else {
|
|
|
+ this.linkageGroupData = []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.linkageGroupData = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 产品分类 change
|
|
|
changeProductType (val, opt) {
|
|
|
this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
@@ -171,11 +212,12 @@ export default {
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
+ _this.getLinkageGroup()
|
|
|
},
|
|
|
// 表格高度计算
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 180
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 190
|
|
|
}
|
|
|
},
|
|
|
watch: {
|