完善库存报表,给商品页面增加修正成本

This commit is contained in:
jishenghua 2024-05-24 01:23:46 +08:00
parent 28548c7957
commit ed9a99c552
4 changed files with 35 additions and 4 deletions

View File

@ -99,6 +99,7 @@
<a-button v-if="btnEnableList.indexOf(3)>-1" @click="handleExportXls('商品信息')" icon="download">导出</a-button>
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="batchEdit()" icon="edit">批量编辑</a-button>
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="batchSetMaterialCurrentStock()" icon="stock">修正库存</a-button>
<a-button v-if="btnEnableList.indexOf(1)>-1" @click="batchSetMaterialCurrentUnitPrice()" icon="fund">修正成本</a-button>
<a-popover trigger="click" placement="right">
<template slot="content">
<a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
@ -293,7 +294,8 @@
importExcelUrl: "/material/importExcel",
exportXlsUrl: "/material/exportExcel",
batchSetStatusUrl: "/material/batchSetStatus",
batchSetMaterialCurrentStockUrl: "/material/batchSetMaterialCurrentStock"
batchSetMaterialCurrentStockUrl: "/material/batchSetMaterialCurrentStock",
batchSetMaterialCurrentUnitPriceUrl: "/material/batchSetMaterialCurrentUnitPrice",
}
}
},
@ -376,6 +378,35 @@
});
}
},
batchSetMaterialCurrentUnitPrice () {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录');
} else {
let ids = "";
for (let a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
let that = this;
this.$confirm({
title: "确认操作",
content: "是否操作选中数据?",
onOk: function () {
that.loading = true;
postAction(that.url.batchSetMaterialCurrentUnitPriceUrl, {ids: ids}).then((res) => {
if(res.code === 200){
that.$message.info('修正成本成功');
that.loadData();
that.onClearSelected();
} else {
that.$message.warning(res.data.message);
}
}).finally(() => {
that.loading = false;
});
}
});
}
},
batchEdit() {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录');

View File

@ -159,7 +159,7 @@
{title: '型号', dataIndex: 'materialModel', width: 80, ellipsis:true},
{title: '扩展信息', dataIndex: 'materialOther', width: 80, ellipsis:true},
{title: '单位', dataIndex: 'unitName', width: 60, ellipsis:true},
{title: '', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60},
{title: '成本', dataIndex: 'unitPrice', sorter: (a, b) => a.unitPrice - b.unitPrice, width: 60},
{title: '上月结存数量', dataIndex: 'prevSum', sorter: (a, b) => a.prevSum - b.prevSum, width: 80},
{title: '入库数量', dataIndex: 'inSum', sorter: (a, b) => a.inSum - b.inSum, width: 60},
{title: '出库数量', dataIndex: 'outSum', sorter: (a, b) => a.outSum - b.outSum, width: 60},

View File

@ -189,7 +189,7 @@
{title: '类别', dataIndex: 'categoryName', width: 60, ellipsis:true},
{title: '仓位货架', dataIndex: 'position', width: 60, ellipsis:true},
{title: '单位', dataIndex: 'unitName', width: 60, ellipsis:true},
{title: '', dataIndex: 'purchaseDecimal', sorter: (a, b) => a.purchaseDecimal - b.purchaseDecimal, width: 60},
{title: '成本', dataIndex: 'purchaseDecimal', sorter: (a, b) => a.purchaseDecimal - b.purchaseDecimal, width: 60},
{title: '初始库存', dataIndex: 'initialStock', width: 60},
{title: '库存', dataIndex: 'currentStock', sorter: (a, b) => a.currentStock - b.currentStock, width: 60,
scopedSlots: { customRender: 'customRenderStock' }

View File

@ -112,7 +112,7 @@
<a-col :lg="12" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="移动平均价">
<a-switch checked-children="启用" un-checked-children="关闭" v-model="moveAvgPriceFlagSwitch" @change="onMoveAvgPriceChange"></a-switch>
默认为关闭状态代表成本价等于商品信息页面录入的采购价开启之后将通过移动平均来计算成本价
默认为关闭状态代表成本价等于商品信息页面录入的采购价开启之后将通过移动平均来计算成本价需到<b>商品管理</b>批量<b>修正成本</b>请按实际业务谨慎操作
</a-form-item>
</a-col>
</a-row>