|
@@ -1,27 +1,27 @@
|
|
<template>
|
|
<template>
|
|
- <a-card :bordered="false" class="inventoryQueryList-wrap">
|
|
|
|
|
|
+ <a-card :bordered="false" class="inventoryWarningList-wrap">
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
<div class="table-page-search-wrapper">
|
|
<div class="table-page-search-wrapper">
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-row :gutter="48">
|
|
<a-row :gutter="48">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-form-item label="产品编码">
|
|
<a-form-item label="产品编码">
|
|
- <a-input id="inventoryQueryList-orderBundleNo" v-model.trim="queryParam.orderBundleNo" allowClear placeholder="请输入产品编码"/>
|
|
|
|
|
|
+ <a-input id="inventoryWarningList-orderBundleNo" v-model.trim="queryParam.orderBundleNo" allowClear placeholder="请输入产品编码"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-form-item label="原厂编码">
|
|
<a-form-item label="原厂编码">
|
|
- <a-input id="inventoryQueryList-custMobile" v-model.trim="queryParam.orderBundle.custMobile" allowClear placeholder="请输入原厂编码"/>
|
|
|
|
|
|
+ <a-input id="inventoryWarningList-custMobile" v-model.trim="queryParam.orderBundle.custMobile" allowClear placeholder="请输入原厂编码"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-form-item label="产品名称">
|
|
<a-form-item label="产品名称">
|
|
- <a-input id="inventoryQueryList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
|
|
|
|
|
|
+ <a-input id="inventoryWarningList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入产品名称"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
<a-form-item label="产品品牌">
|
|
<a-form-item label="产品品牌">
|
|
- <a-select id="inventoryQueryList-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
|
|
|
|
|
|
+ <a-select id="inventoryWarningList-bundleNames" placeholder="请选择产品品牌" allowClear v-model="queryParam.brand">
|
|
<a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
|
|
<a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -32,35 +32,65 @@
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
- <a-form-item label="库存数量是否为0">
|
|
|
|
- <a-switch checkedChildren="是" unCheckedChildren="否" id="inventoryQueryList-bundleNamess" v-model="queryParam.inventoryNum" />
|
|
|
|
|
|
+ <a-form-item label="预警提示">
|
|
|
|
+ <a-select id="inventoryWarningList-bundleNames" placeholder="请选择预警提示" allowClear v-model="queryParam.brand">
|
|
|
|
+ <a-select-option v-for="item in brandData" :key="item.stationNo" :value="item.stationNo">{{ item.name }}</a-select-option>
|
|
|
|
+ </a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :lg="6" :sm="12">
|
|
<a-col :lg="6" :sm="12">
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
|
|
|
|
- <a-button style="margin-left: 8px" type="danger" @click="handleExport" :disabled="disabled" :loading="exportLoading" id="inventoryQueryList-export">导出</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryWarningList-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
|
|
|
|
+ <a-button style="margin-left: 8px" type="danger" @click="handleExport" :disabled="disabled" :loading="exportLoading" id="inventoryWarningList-export">导出</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
- <!-- 合计 -->
|
|
|
|
- <a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
|
- <div class="ftext" slot="message">现有库存总数量(个):<strong>998</strong>;现有库存总成本(¥):<strong>2009.00</strong>。</div>
|
|
|
|
- </a-alert>
|
|
|
|
|
|
+ <!-- 操作按钮 -->
|
|
|
|
+ <div class="table-operator">
|
|
|
|
+ <a-button id="inventoryWarningList-update" type="primary" @click="handleupdate" style="margin-top: 18px;">批量更新</a-button>
|
|
|
|
+ </div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<s-table
|
|
<s-table
|
|
|
|
+ class="sTable"
|
|
ref="table"
|
|
ref="table"
|
|
size="default"
|
|
size="default"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
bordered>
|
|
bordered>
|
|
|
|
+ <!-- 需要编辑的字段 -->
|
|
|
|
+ <template
|
|
|
|
+ v-for="col in ['onWayNum', 'maxInventory', 'minInventory']"
|
|
|
|
+ :slot="col"
|
|
|
|
+ slot-scope="text, record, index"
|
|
|
|
+ >
|
|
|
|
+ <div :key="col">
|
|
|
|
+ <a-input
|
|
|
|
+ v-if="record.editable"
|
|
|
|
+ style="margin: -5px 0"
|
|
|
|
+ :value="text"
|
|
|
|
+ @change="e => handleChange(e.target.value, record.key, col)"
|
|
|
|
+ />
|
|
|
|
+ <template v-else>
|
|
|
|
+ {{ text }}
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
- <span slot="action" slot-scope="text, record">
|
|
|
|
- <a-button type="primary" @click="goDetail(record)" id="inventoryQueryList-detail-btn">库存详情</a-button>
|
|
|
|
- <a-button style="margin-left: 8px" @click="goWarehouseDetail(record)" id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
|
|
|
|
- </span>
|
|
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <div class="editable-row-operations">
|
|
|
|
+ <span v-if="record.editable">
|
|
|
|
+ <a @click="() => save(record.key)">保存</a>
|
|
|
|
+ <a-popconfirm title="Sure to cancel?" @confirm="() => cancel(record.key)">
|
|
|
|
+ <a>取消</a>
|
|
|
|
+ </a-popconfirm>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else>
|
|
|
|
+ <a :disabled="editingKey !== ''" @click="() => edit(record.key)">编辑</a>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-card>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
@@ -93,11 +123,17 @@ export default {
|
|
{ title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'productNum', width: 160, align: 'center' },
|
|
{ title: '产品编码', dataIndex: 'productNum', width: 160, align: 'center' },
|
|
{ title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true },
|
|
{ title: '产品名称', dataIndex: 'productName', width: 200, align: 'center', ellipsis: true },
|
|
|
|
+ { title: '级别', dataIndex: 'productNasme', width: 100, align: 'center' },
|
|
{ title: '原厂编码', dataIndex: 'productOldNum', width: 160, align: 'center' },
|
|
{ title: '原厂编码', dataIndex: 'productOldNum', width: 160, align: 'center' },
|
|
{ title: '产品品牌', dataIndex: 'productBrand', width: 200, align: 'center' },
|
|
{ title: '产品品牌', dataIndex: 'productBrand', width: 200, align: 'center' },
|
|
{ title: '产品分类', dataIndex: 'productType', width: 200, align: 'center' },
|
|
{ title: '产品分类', dataIndex: 'productType', width: 200, align: 'center' },
|
|
- { title: '现有库存数量(个)', dataIndex: 'inventoryNum', width: 180, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '现有库存成本(¥)', dataIndex: 'inventoryMoney', width: 180, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
|
|
+ { title: '实时库存数(个)', dataIndex: 'inventoryNumy', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '在途数(个)', scopedSlots: { customRender: 'onWayNum' }, width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '总库存数(个)', dataIndex: 'inventoryNumw', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '最大库存数(个)', scopedSlots: { customRender: 'maxInventory' }, width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '最小库存数(个)', scopedSlots: { customRender: 'minInventory' }, width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '差异数量', dataIndex: 'inventoryNumh', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '预警提示', dataIndex: 'inventoryNum', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -130,7 +166,8 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
openModal: false, // 查看库存详情 弹框
|
|
openModal: false, // 查看库存详情 弹框
|
|
- itemId: '' // 当前库存记录id
|
|
|
|
|
|
+ itemId: '', // 当前库存记录id
|
|
|
|
+ editingKey: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -144,37 +181,70 @@ export default {
|
|
this.newTime = undefined
|
|
this.newTime = undefined
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
- // 库存详情
|
|
|
|
- goDetail(row){
|
|
|
|
- this.itemId = row.id
|
|
|
|
- this.openModal = true
|
|
|
|
|
|
+ // 批量更新
|
|
|
|
+ handleupdate(){
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确定提交批量更新的内容吗?',
|
|
|
|
+ okText: '确定',
|
|
|
|
+ cancelText: '取消',
|
|
|
|
+ onOk () {
|
|
|
|
+ // delectRolePower({
|
|
|
|
+ // id: row.id
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // console.log(res, 'res1111')
|
|
|
|
+ // if (res.status == 200) {
|
|
|
|
+ // _this.$message.success(res.message)
|
|
|
|
+ // _this.$refs.table.refresh()
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleChange(value, key, column) {
|
|
|
|
+ const newData = [...this.data];
|
|
|
|
+ const target = newData.filter(item => key === item.key)[0];
|
|
|
|
+ if (target) {
|
|
|
|
+ target[column] = value;
|
|
|
|
+ this.data = newData;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- // 关闭弹框
|
|
|
|
- closeModal(){
|
|
|
|
- this.itemId = ''
|
|
|
|
- this.openModal = false
|
|
|
|
|
|
+ edit(key) {
|
|
|
|
+ const newData = [...this.data];
|
|
|
|
+ const target = newData.filter(item => key === item.key)[0];
|
|
|
|
+ this.editingKey = key;
|
|
|
|
+ if (target) {
|
|
|
|
+ target.editable = true;
|
|
|
|
+ this.data = newData;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- // 出入库明细
|
|
|
|
- goWarehouseDetail(row){
|
|
|
|
- this.$router.push({ path: '/inventoryManagement/inventoryQuery/warehouseDetail' })
|
|
|
|
|
|
+ save(key) {
|
|
|
|
+ const newData = [...this.data];
|
|
|
|
+ const newCacheData = [...this.cacheData];
|
|
|
|
+ const target = newData.filter(item => key === item.key)[0];
|
|
|
|
+ const targetCache = newCacheData.filter(item => key === item.key)[0];
|
|
|
|
+ if (target && targetCache) {
|
|
|
|
+ delete target.editable;
|
|
|
|
+ this.data = newData;
|
|
|
|
+ Object.assign(targetCache, target);
|
|
|
|
+ this.cacheData = newCacheData;
|
|
|
|
+ }
|
|
|
|
+ this.editingKey = '';
|
|
|
|
+ },
|
|
|
|
+ cancel(key) {
|
|
|
|
+ const newData = [...this.data];
|
|
|
|
+ const target = newData.filter(item => key === item.key)[0];
|
|
|
|
+ this.editingKey = '';
|
|
|
|
+ if (target) {
|
|
|
|
+ Object.assign(target, this.cacheData.filter(item => key === item.key)[0]);
|
|
|
|
+ delete target.editable;
|
|
|
|
+ this.data = newData;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 导出
|
|
// 导出
|
|
handleExport () {
|
|
handleExport () {
|
|
const params = this.queryParam
|
|
const params = this.queryParam
|
|
- if (this.oldTime && this.oldTime.length > 0) {
|
|
|
|
- params.beginOldExpiryDate = moment(this.oldTime[0]).format('YYYY-MM-DD')
|
|
|
|
- params.endOldExpirydDate = moment(this.oldTime[1]).format('YYYY-MM-DD')
|
|
|
|
- } else {
|
|
|
|
- params.beginOldExpiryDate = ''
|
|
|
|
- params.endOldExpirydDate = ''
|
|
|
|
- }
|
|
|
|
- if (this.newTime && this.newTime.length > 0) {
|
|
|
|
- params.beginDate = moment(this.newTime[0]).format('YYYY-MM-DD')
|
|
|
|
- params.endDate = moment(this.newTime[1]).format('YYYY-MM-DD')
|
|
|
|
- } else {
|
|
|
|
- params.beginDate = ''
|
|
|
|
- params.endDate = ''
|
|
|
|
- }
|
|
|
|
this.exportLoading = true
|
|
this.exportLoading = true
|
|
customerBundleExportDelay(params).then(res => {
|
|
customerBundleExportDelay(params).then(res => {
|
|
this.exportLoading = false
|
|
this.exportLoading = false
|
|
@@ -188,7 +258,7 @@ export default {
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
link.href = url
|
|
link.href = url
|
|
const a = moment().format('YYYYMMDDHHmmss')
|
|
const a = moment().format('YYYYMMDDHHmmss')
|
|
- const fname = '服务延期记录' + a
|
|
|
|
|
|
+ const fname = '库存预警' + a
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
link.click()
|
|
link.click()
|
|
@@ -197,4 +267,12 @@ export default {
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less"></style>
|
|
|
|
|
|
+<style lang="less">
|
|
|
|
+ .inventoryWarningList-wrap{
|
|
|
|
+ .sTable{
|
|
|
|
+ table{
|
|
|
|
+ width: auto;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|