|
@@ -22,20 +22,38 @@
|
|
<template v-if="advanced">
|
|
<template v-if="advanced">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="产品品牌">
|
|
<a-form-item label="产品品牌">
|
|
- <ProductBrand id="inventoryWarningList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
|
|
|
|
|
|
+ <a-select
|
|
|
|
+ placeholder="请选择产品品牌"
|
|
|
|
+ id="inventoryWarningList-productBrandSn"
|
|
|
|
+ allowClear
|
|
|
|
+ v-model="queryParam.productBrandSn"
|
|
|
|
+ :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="产品分类">
|
|
- <ProductType id="inventoryWarningList-productType" v-model="productType" @change="changeProductType"></ProductType>
|
|
|
|
|
|
+ <a-cascader
|
|
|
|
+ @change="changeProductType"
|
|
|
|
+ change-on-select
|
|
|
|
+ v-model="productType"
|
|
|
|
+ expand-trigger="hover"
|
|
|
|
+ :options="productTypeList"
|
|
|
|
+ :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
|
|
+ id="inventoryWarningList-productType"
|
|
|
|
+ placeholder="请选择产品分类"
|
|
|
|
+ allowClear />
|
|
</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="预警提示">
|
|
<v-select
|
|
<v-select
|
|
- v-model="queryParam.warnTip"
|
|
|
|
- ref="warnTip"
|
|
|
|
- id="inventoryWarningList-warnTip"
|
|
|
|
|
|
+ v-model="queryParam.stockState"
|
|
|
|
+ ref="stockState"
|
|
|
|
+ id="inventoryWarningList-stockState"
|
|
code="STOCK_WARN_TIP"
|
|
code="STOCK_WARN_TIP"
|
|
placeholder="请选择预警提示"
|
|
placeholder="请选择预警提示"
|
|
allowClear
|
|
allowClear
|
|
@@ -77,8 +95,9 @@
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:dataSource="loadData"
|
|
:dataSource="loadData"
|
|
- :scroll="{ x: 2120, y: tableHeight }"
|
|
|
|
|
|
+ :scroll="{ x: 2220, y: tableHeight }"
|
|
:pagination="paginationProps"
|
|
:pagination="paginationProps"
|
|
|
|
+ :loading="tableLoading"
|
|
bordered>
|
|
bordered>
|
|
<!-- 产品分类 -->
|
|
<!-- 产品分类 -->
|
|
<template slot="productType" slot-scope="text, record">
|
|
<template slot="productType" slot-scope="text, record">
|
|
@@ -91,8 +110,8 @@
|
|
<span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
|
|
<span v-if="record.freezeQty">(冻结{{ record.freezeQty }})</span>
|
|
</template>
|
|
</template>
|
|
<!-- 预警提示 -->
|
|
<!-- 预警提示 -->
|
|
- <template slot="warnTip" slot-scope="text, record">
|
|
|
|
- <span v-if="record.warnTipDictValue" :class="[record.warnTip=='OVERFLOW'?'yellow':record.warnTip=='NOT_ENOUGH'?'red':record.warnTip=='LACK'?'blue':record.warnTip=='NORMAL'?'green':'']">{{ record.warnTipDictValue }}</span>
|
|
|
|
|
|
+ <template slot="stockState" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.stockStateDictValue" :class="[record.stockState=='OVERFLOW'?'yellow':record.stockState=='NOT_ENOUGH'?'red':record.stockState=='LACK'?'blue':record.stockState=='NORMAL'?'green':'']">{{ record.stockStateDictValue }}</span>
|
|
<span v-else>--</span>
|
|
<span v-else>--</span>
|
|
</template>
|
|
</template>
|
|
<!-- 在途数 -->
|
|
<!-- 在途数 -->
|
|
@@ -142,11 +161,11 @@
|
|
<script>
|
|
<script>
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import { stockWarnList, stockWarnSaveBatch } from '@/api/stockWarn'
|
|
|
|
-import ProductBrand from '@/views/common/productBrand.js'
|
|
|
|
-import ProductType from '@/views/common/productType.js'
|
|
|
|
|
|
+import { productBrandQuery } from '@/api/productBrand'
|
|
|
|
+import { productTypeQuery } from '@/api/productType'
|
|
|
|
+import { stockWarnList, stockWarnSaveBatch } from '@/api/stock'
|
|
export default {
|
|
export default {
|
|
- components: { STable, VSelect, ProductBrand, ProductType },
|
|
|
|
|
|
+ components: { STable, VSelect },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
@@ -159,25 +178,28 @@ export default {
|
|
productTypeSn1: undefined,
|
|
productTypeSn1: undefined,
|
|
productTypeSn2: undefined,
|
|
productTypeSn2: undefined,
|
|
productTypeSn3: undefined,
|
|
productTypeSn3: undefined,
|
|
- warnTip: undefined
|
|
|
|
|
|
+ stockState: undefined
|
|
},
|
|
},
|
|
exportLoading: false, // 导出loading
|
|
exportLoading: false, // 导出loading
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
|
+ tableLoading: false, // 表格加载中
|
|
|
|
+ productBrandList: [], // 产品品牌下拉数据
|
|
|
|
+ productTypeList: [], // 产品类别下拉数据
|
|
productType: [],
|
|
productType: [],
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '产品品牌', dataIndex: 'brandName', width: 200, 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: 'productType' }, width: 200, align: 'center' },
|
|
{ title: '实时库存数(个)', scopedSlots: { customRender: 'stockQty' }, width: 180, align: 'center' },
|
|
{ title: '实时库存数(个)', scopedSlots: { customRender: 'stockQty' }, width: 180, align: 'center' },
|
|
{ title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 130, align: 'center' },
|
|
{ title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 130, align: 'center' },
|
|
- { title: '总库存数(个)', dataIndex: 'totalStockQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '总库存数(个)', dataIndex: 'totalQty', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 130, align: 'center' },
|
|
{ title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 130, align: 'center' },
|
|
{ title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 130, align: 'center' },
|
|
{ title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 130, align: 'center' },
|
|
{ title: '差异数量', dataIndex: 'differenceNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '差异数量', dataIndex: 'differenceNum', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
- { title: '预警提示', scopedSlots: { customRender: 'warnTip' }, width: 100, align: 'center' },
|
|
|
|
|
|
+ { title: '预警提示', scopedSlots: { customRender: 'stockState' }, width: 100, align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
loadData: [],
|
|
loadData: [],
|
|
@@ -220,6 +242,7 @@ export default {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.pageNo = pageNo || this.pageNo
|
|
this.pageNo = pageNo || this.pageNo
|
|
const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
|
|
const params = Object.assign({ pageNo: this.pageNo, pageSize: this.pageSize }, this.queryParam)
|
|
|
|
+ this.tableLoading = true
|
|
stockWarnList(params).then(res => {
|
|
stockWarnList(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
const data = res.data
|
|
const data = res.data
|
|
@@ -230,6 +253,7 @@ export default {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
}
|
|
}
|
|
this.loadData = data.list
|
|
this.loadData = data.list
|
|
|
|
+ this.tableLoading = false
|
|
this.disabled = false
|
|
this.disabled = false
|
|
} else {
|
|
} else {
|
|
this.paginationProps.total = 0
|
|
this.paginationProps.total = 0
|
|
@@ -306,7 +330,7 @@ export default {
|
|
this.queryParam.productTypeSn1 = undefined
|
|
this.queryParam.productTypeSn1 = undefined
|
|
this.queryParam.productTypeSn2 = undefined
|
|
this.queryParam.productTypeSn2 = undefined
|
|
this.queryParam.productTypeSn3 = undefined
|
|
this.queryParam.productTypeSn3 = undefined
|
|
- this.queryParam.warnTip = undefined
|
|
|
|
|
|
+ this.queryParam.stockState = undefined
|
|
this.productType = []
|
|
this.productType = []
|
|
this.pageInit(1)
|
|
this.pageInit(1)
|
|
},
|
|
},
|
|
@@ -332,6 +356,31 @@ 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] : ''
|
|
},
|
|
},
|
|
|
|
+ // 产品品牌 列表
|
|
|
|
+ getProductBrand () {
|
|
|
|
+ productBrandQuery({}).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.productBrandList = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.productBrandList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 产品分类 列表
|
|
|
|
+ getProductType () {
|
|
|
|
+ productTypeQuery({}).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.productTypeList = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.productTypeList = []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ filterOption (input, option) {
|
|
|
|
+ return (
|
|
|
|
+ option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
|
+ )
|
|
|
|
+ },
|
|
// 导出
|
|
// 导出
|
|
handleExport () {
|
|
handleExport () {
|
|
const params = this.queryParam
|
|
const params = this.queryParam
|
|
@@ -358,6 +407,8 @@ export default {
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
vm.pageInit(1)
|
|
vm.pageInit(1)
|
|
|
|
+ vm.getProductType()
|
|
|
|
+ vm.getProductBrand()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|