商品进货退货盘点货损
This commit is contained in:
parent
70b1a6d39a
commit
9ea5b605ad
@ -86,3 +86,13 @@ export function abolitionDamageApi(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出信息
|
||||
export function exportExcelApi(data) {
|
||||
return request({
|
||||
url: '/business/convenience/mtDamageDetails/exportExcel',
|
||||
method: 'post',
|
||||
responseType:'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -85,3 +85,15 @@ export function abolitionInventoryApi(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 导出信息
|
||||
export function exportExcelApi(data) {
|
||||
return request({
|
||||
url: '/business/convenience/mtInventoryDetails/exportExcel',
|
||||
method: 'post',
|
||||
responseType:'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -89,3 +89,14 @@ export function abolitionPurchaseApi(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 导出库存统计信息
|
||||
export function exportExcelApi(data) {
|
||||
return request({
|
||||
url: '/business/convenience/mtPurchaseDetails/exportExcel',
|
||||
method: 'post',
|
||||
responseType:'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -86,3 +86,14 @@ export function abolitionReturnsApi(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 导出信息
|
||||
export function exportExcelApi(data) {
|
||||
return request({
|
||||
url: '/business/convenience/mtReturnsDetails/exportExcel',
|
||||
method: 'post',
|
||||
responseType:'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div slot="header" class="clearfix">
|
||||
<i class="el-icon-back" @click="goToAbout">返回 | </i>
|
||||
<!-- <el-link icon="el-icon-edit" :underline="false" @click="goToAbout">编辑</el-link>-->
|
||||
<span> 退货详情</span>
|
||||
<span> 货损详情</span>
|
||||
</div>
|
||||
<div style="height: 90px; display: flex; justify-content: space-between;">
|
||||
<div style="height: 100%; width: 50%; display: flex; justify-content: space-between;">
|
||||
@ -29,7 +29,7 @@
|
||||
<el-input v-model="damageForm.orderNumber"
|
||||
:disabled="numberInput"
|
||||
style="width: 220Px">
|
||||
<el-button slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
||||
<el-button v-if="!numberInput" slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报损时间" >
|
||||
@ -49,6 +49,8 @@
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
|
||||
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -59,6 +61,7 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="!numberInput"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="commodityAdd"
|
||||
@ -91,13 +94,13 @@
|
||||
<el-table-column label="库存" align="center" prop="preInboundInventory"/>
|
||||
<el-table-column label="报损数量" align="center" prop="damageQuantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.damageQuantity" @change="change(scope.row,1)" controls-position="right" :min="1" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.damageQuantity" @change="change(scope.row,1)" :precision="0" controls-position="right" :min="1" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前加权均进价" align="center" prop="weightedAverageCost"/>
|
||||
<el-table-column label="当前进价" align="center" prop="weightedAverageCost"/>
|
||||
<el-table-column label="小计金额" align="center" prop="subtotalAmount"/>
|
||||
|
||||
<el-table-column v-if="state =='await' || state=='ysh'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column v-if="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -150,7 +153,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="详细信息">
|
||||
<el-input v-model="commodityForm.detailed" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
@ -214,6 +217,7 @@ import {
|
||||
batchProcessingApi,
|
||||
auditDamageApi,
|
||||
storageDamageApi,
|
||||
exportExcelApi,
|
||||
abolitionDamageApi
|
||||
} from "@/api/convenienceStore/damage";
|
||||
|
||||
@ -236,9 +240,10 @@ export default {
|
||||
cvsGood: "",
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
remark: "",
|
||||
detailed: "",
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 1000,
|
||||
isRecovery:0,
|
||||
},
|
||||
damageForm: {
|
||||
@ -278,8 +283,8 @@ export default {
|
||||
queryParams: {
|
||||
// supplierId: '',
|
||||
damageId: null,
|
||||
page:null,
|
||||
pageSize:null
|
||||
page:1,
|
||||
pageSize:1000
|
||||
},
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
@ -300,7 +305,6 @@ export default {
|
||||
this.damageId = this.$props.PdamageId
|
||||
this.queryParams.damageId = this.$props.PdamageId
|
||||
this.damageForm.orderNumber = this.$props.PorderNumber
|
||||
this.damageForm.orderDate = this.$props.PorderDate
|
||||
this.damageForm.approvalStatus = this.$props.PapprovalStatus
|
||||
this.state = this.$props.PapprovalStatus
|
||||
|
||||
@ -319,6 +323,12 @@ export default {
|
||||
if (this.damageForm.orderNumber == null) {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
if (this.$route.query.inventoryDate != null) {
|
||||
this.damageForm.orderDate = new Date(parseInt(this.$props.PorderDate))
|
||||
}
|
||||
|
||||
|
||||
if (this.damageForm.orderDate == null) {
|
||||
this.damageForm.orderDate =new Date()
|
||||
}
|
||||
@ -340,7 +350,7 @@ export default {
|
||||
let this_ = this
|
||||
listLJGoods(this_.commodityForm).then(res=>{
|
||||
this_.commodityList = res.data.records;
|
||||
this_.sumMethod(res.data.records);
|
||||
// this_.sumMethod(res.data.records);
|
||||
// this.total = response.data.total;
|
||||
})
|
||||
},
|
||||
@ -352,14 +362,25 @@ export default {
|
||||
this.open = true;
|
||||
},
|
||||
commodityDel(data) {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
},
|
||||
// 查询商品
|
||||
inquire() {
|
||||
@ -375,16 +396,6 @@ export default {
|
||||
|
||||
data.subtotalAmount = subtotalAmount.toNumber();
|
||||
|
||||
|
||||
// let damageQuantity = new BigNumber( data.damageQuantity);
|
||||
// let weightedAverageCost = new BigNumber( data.weightedAverageCost);
|
||||
// let subtotalAmount = new BigNumber(0);
|
||||
|
||||
// data.subtotalAmount = damageQuantity.times(weightedAverageCost)
|
||||
// let subtotalAmount = damageQuantity.times(weightedAverageCost)
|
||||
// console.log("this.detailsList",subtotalAmount)
|
||||
// data.subtotalAmount = subtotalAmount
|
||||
|
||||
this.sumMethod(this.detailsList);
|
||||
// console.log("this.detailsList",this.detailsList)
|
||||
// 进行保存
|
||||
@ -419,8 +430,18 @@ export default {
|
||||
|
||||
addCommodity () {
|
||||
let this_ = this
|
||||
let sum = 0;
|
||||
|
||||
this.multipleSelection.forEach(mul=>{
|
||||
let now = {
|
||||
let flag = true;
|
||||
this_.detailsList.forEach(det=>{
|
||||
if (mul.id == det.goodsId) {
|
||||
flag = false
|
||||
sum++
|
||||
}
|
||||
})
|
||||
if(flag) {
|
||||
let now = {
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
supplierId: mul.supplierId,
|
||||
@ -432,7 +453,12 @@ export default {
|
||||
subtotalAmount: mul.buyingPrice
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
}
|
||||
|
||||
})
|
||||
if(sum>0) {
|
||||
this.$modal.msgError("同一货损单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
|
||||
this_.sumMethod(this_.detailsList);
|
||||
@ -571,19 +597,8 @@ export default {
|
||||
// 入库
|
||||
storage() {
|
||||
let this_ = this;
|
||||
// 保存之前进行判断
|
||||
if (this_.damageForm.orderNumber == null) {damageIde/Damage
|
||||
this.$modal.msgError("退货单号不能为空");
|
||||
return -1;
|
||||
}else if (this_.damageForm.orderDate == null) {
|
||||
this.$modal.msgError("退货时间不能为空");
|
||||
return -1;
|
||||
}else if(this_.detailsList.length<=0) {
|
||||
this.$modal.msgError("退货单不能为空");
|
||||
return -1;
|
||||
}
|
||||
|
||||
this.$confirm('确认后盘点中的对应油品入库油罐库存将发生变化,且不可逆,确认已按照盘点数量入库吗?', '提示', {
|
||||
this.$confirm('确认后货损中的对应商品出库商品库存将发生变化,且不可逆,确认已按照货损单数量出库吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@ -594,7 +609,8 @@ export default {
|
||||
}
|
||||
storageDamageApi(fil).then(res => {
|
||||
this.state = 'qrts'
|
||||
this.$modal.msgWarning("入库成功");
|
||||
this.$modal.msgWarning("出库成功");
|
||||
this.goToAbout()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
@ -611,7 +627,7 @@ export default {
|
||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定要废弃盘点好的数据吗', '提示', {
|
||||
this.$confirm('确定要废弃数据吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@ -634,6 +650,22 @@ export default {
|
||||
message: '已取消'
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
// 导出
|
||||
async exportExcel() {
|
||||
|
||||
let fil ={
|
||||
damageId: this.damageId
|
||||
}
|
||||
|
||||
exportExcelApi(fil).then(res=>{
|
||||
console.log("res",res)
|
||||
// this.downloadFile(res);
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
|
||||
this.$download.saveAs(blob,this.damageForm.orderNumber+'.xLsx')
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
@ -136,7 +136,7 @@ export default {
|
||||
status: '',
|
||||
supplierId: '',
|
||||
dateRange: '',
|
||||
page: null,
|
||||
pageNo: null,
|
||||
pageSize: null,
|
||||
},
|
||||
// 遮罩层
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div slot="header" class="clearfix">
|
||||
<i class="el-icon-back" @click="goToAbout">返回 | </i>
|
||||
<!-- <el-link icon="el-icon-edit" :underline="false" @click="goToAbout">编辑</el-link>-->
|
||||
<span> 退货详情</span>
|
||||
<span> 盘点详情</span>
|
||||
</div>
|
||||
<div style="height: 90px; display: flex; justify-content: space-between;">
|
||||
<div style="height: 100%; width: 40%; display: flex; justify-content: space-between;">
|
||||
@ -17,6 +17,14 @@
|
||||
<span>{{inventoryForm.inventoryQuantity}}</span>
|
||||
<span>盘点数量</span>
|
||||
</div>
|
||||
<div class="box">
|
||||
<span>{{inventoryForm.inventoryDiscrepancy}}</span>
|
||||
<span>库存差异</span>
|
||||
</div>
|
||||
<div class="box">
|
||||
<span>{{inventoryForm.profitLossAmount}}</span>
|
||||
<span>盈亏总额</span>
|
||||
</div>
|
||||
</div>
|
||||
<table class="container1">
|
||||
<tr>
|
||||
@ -42,6 +50,8 @@
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">生成差异单</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
|
||||
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -52,6 +62,7 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="!numberInput"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="commodityAdd"
|
||||
@ -68,14 +79,17 @@
|
||||
<el-table-column label="商品名称" align="center" prop="commodityName"/>
|
||||
<el-table-column label="商品编码" align="center" prop="goodsNo"/>
|
||||
<el-table-column label="单位" align="center" prop="unit"/>
|
||||
<el-table-column label="当前均进价" align="center" prop="purchasePrice"/>
|
||||
<el-table-column label="当前进价" align="center" prop="purchasePrice"/>
|
||||
<el-table-column label="库存数量" align="center" prop="stock"/>
|
||||
<el-table-column label="盘点数量" align="center" prop="inventoryQuantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.inventoryQuantity" @change="change(scope.row,2)" controls-position="right" :min="1" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.inventoryQuantity" @change="change(scope.row,2)" controls-position="right" :precision="0" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="state =='await' || state=='ysh'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="库存差异" align="center" prop="inventoryDiscrepancy"/>
|
||||
<el-table-column label="盈亏金额" align="center" prop="profitLossAmount"/>
|
||||
|
||||
<el-table-column v-if="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -128,7 +142,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="详细信息">
|
||||
<el-input v-model="commodityForm.detailed" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
@ -190,9 +204,10 @@ import {
|
||||
editInventoryApi,
|
||||
addInventoryApi,
|
||||
batchProcessingApi,
|
||||
auditInventoryApi,
|
||||
auditInventoryApi ,
|
||||
storageInventoryApi,
|
||||
abolitionInventoryApi
|
||||
abolitionInventoryApi,
|
||||
exportExcelApi
|
||||
} from "@/api/convenienceStore/inventory";
|
||||
|
||||
|
||||
@ -215,6 +230,7 @@ export default {
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
isRecovery:0,
|
||||
@ -228,7 +244,9 @@ export default {
|
||||
orderDate: this.$props.PorderDate,
|
||||
creataByName: this.$props.PcreataByName,
|
||||
roductQuantity:0, // 商品数量
|
||||
inventoryQuantity: 0 // 盘点数量
|
||||
inventoryQuantity: 0 ,// 盘点数量
|
||||
inventoryDiscrepancy: 0,// 库存差异
|
||||
profitLossAmount: 0// 盈亏总额
|
||||
},
|
||||
|
||||
|
||||
@ -281,10 +299,6 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
console.log("123123123",this.$props.PinventoryId)
|
||||
console.log("123123123",this.$props)
|
||||
|
||||
|
||||
// this.inventoryForm.inventoryId = this.$props.PinventoryId
|
||||
// this.inventoryId = this.$props.PinventoryId
|
||||
// this.queryParams.inventoryId = this.$props.PinventoryId
|
||||
@ -342,15 +356,31 @@ export default {
|
||||
this.open = true;
|
||||
},
|
||||
commodityDel(data) {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
this.inventoryForm.productQuantity--;
|
||||
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
this.inventoryForm.productQuantity--;
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 查询商品
|
||||
@ -360,6 +390,18 @@ export default {
|
||||
|
||||
// 改变数字时
|
||||
change(data,flag) {
|
||||
let profitLossAmount = new BigNumber(data.profitLossAmount);
|
||||
let inventoryDiscrepancy = new BigNumber(data.inventoryDiscrepancy);
|
||||
let inventoryQuantity = new BigNumber(data.inventoryQuantity);
|
||||
let purchasePrice = new BigNumber(data.purchasePrice);
|
||||
let stock = new BigNumber(data.stock);
|
||||
// 计算库存差异
|
||||
inventoryDiscrepancy = inventoryQuantity.minus(stock)
|
||||
// 计算盈亏金额
|
||||
profitLossAmount = inventoryDiscrepancy.multipliedBy(purchasePrice);
|
||||
data.inventoryDiscrepancy = inventoryDiscrepancy.toNumber();
|
||||
data.profitLossAmount = profitLossAmount.toNumber();
|
||||
|
||||
this.sumMethod(this.detailsList)
|
||||
},
|
||||
|
||||
@ -375,30 +417,55 @@ export default {
|
||||
|
||||
this_.inventoryForm.productQuantity = data.length,
|
||||
this_.inventoryForm.inventoryQuantity = new BigNumber(0),
|
||||
this_.inventoryForm.inventoryDiscrepancy = new BigNumber(0),
|
||||
this_.inventoryForm.profitLossAmount = new BigNumber(0),
|
||||
|
||||
|
||||
data.forEach(da => {
|
||||
if (da.inventoryQuantity != null) {
|
||||
this_.inventoryForm.inventoryQuantity= this_.inventoryForm.inventoryQuantity.plus(da.inventoryQuantity)
|
||||
}
|
||||
if (da.inventoryDiscrepancy != null) {
|
||||
this_.inventoryForm.inventoryDiscrepancy = this_.inventoryForm.inventoryDiscrepancy.plus(da.inventoryDiscrepancy)
|
||||
}
|
||||
if (da.profitLossAmount != null) {
|
||||
this_.inventoryForm.profitLossAmount = this_.inventoryForm.profitLossAmount.plus(da.profitLossAmount)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
addCommodity () {
|
||||
let this_ = this
|
||||
let sum = 0;
|
||||
|
||||
this.multipleSelection.forEach(mul=>{
|
||||
let now = {
|
||||
inventoryId: this.inventoryId,
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit:mul.unit,
|
||||
stock:mul.stock,
|
||||
purchasePrice: mul.buyingPrice,
|
||||
goodsNo:mul.goodsNo,
|
||||
inventoryQuantity:0
|
||||
let flag = true;
|
||||
this_.detailsList.forEach(det=>{
|
||||
if (mul.id == det.goodsId) {
|
||||
flag = false
|
||||
sum++
|
||||
}
|
||||
})
|
||||
if(flag) {
|
||||
let now = {
|
||||
inventoryId: this.inventoryId,
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit:mul.unit,
|
||||
stock:mul.stock,
|
||||
purchasePrice: mul.buyingPrice,
|
||||
goodsNo:mul.goodsNo,
|
||||
inventoryQuantity:1,
|
||||
profitLossAmount:0, // 盈亏金额
|
||||
inventoryDiscrepancy:0, // 库存差异
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
})
|
||||
if(sum>0) {
|
||||
this.$modal.msgError("同一货损单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
this_.inventoryForm.inventoryQuantity = this_.inventoryForm.inventoryQuantity + this_.multipleSelection.length
|
||||
this_.sumMethod(this_.detailsList);
|
||||
@ -490,12 +557,6 @@ export default {
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 保存并审核
|
||||
async audit(){
|
||||
@ -507,7 +568,7 @@ export default {
|
||||
id: this.inventoryId
|
||||
}
|
||||
console.log(" id: this.inventoryId",fil)
|
||||
await auditinventoryApi(fil).then(res => {
|
||||
await auditInventoryApi(fil).then(res => {
|
||||
if (res.data) {
|
||||
this.state = 'ysh'
|
||||
this.$modal.msgWarning("审核成功");
|
||||
@ -522,19 +583,8 @@ export default {
|
||||
// 入库
|
||||
storage() {
|
||||
let this_ = this;
|
||||
// 保存之前进行判断
|
||||
if (this_.inventoryForm.orderNumber == null) {
|
||||
this.$modal.msgError("退货单号不能为空");
|
||||
return -1;
|
||||
}else if (this_.inventoryForm.orderDate == null) {
|
||||
this.$modal.msgError("退货时间不能为空");
|
||||
return -1;
|
||||
}else if(this_.detailsList.length<=0) {
|
||||
this.$modal.msgError("退货单不能为空");
|
||||
return -1;
|
||||
}
|
||||
|
||||
this.$confirm('确认后盘点中的对应油品入库油罐库存将发生变化,且不可逆,确认已按照盘点数量入库吗?', '提示', {
|
||||
this.$confirm('确认后盘点中的对应商品入库商品库存将发生变化,且不可逆,确认已按照盘点数量入库吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@ -543,7 +593,7 @@ export default {
|
||||
let fil ={
|
||||
id: this.inventoryId
|
||||
}
|
||||
storageinventoryApi(fil).then(res => {
|
||||
storageInventoryApi(fil).then(res => {
|
||||
this.state = 'qrts'
|
||||
this.$modal.msgWarning("入库成功");
|
||||
})
|
||||
@ -586,6 +636,21 @@ export default {
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
async exportExcel() {
|
||||
|
||||
let fil ={
|
||||
inventoryId: this.inventoryId
|
||||
}
|
||||
|
||||
exportExcelApi(fil).then(res=>{
|
||||
console.log("res",res)
|
||||
// this.downloadFile(res);
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
|
||||
this.$download.saveAs(blob,this.inventoryForm.orderNumber+'.xlsx')
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -79,7 +79,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="制单人" align="center" prop="createByName">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createByName==null?"-":scope.row.createByName}}</span>
|
||||
<span>{{scope.row.createByName}}({{parseTime(scope.row.orderDate)}})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
@ -154,7 +154,7 @@ export default {
|
||||
status: '',
|
||||
supplierId: '',
|
||||
dateRange: '',
|
||||
page: null,
|
||||
pageNo: null,
|
||||
pageSize: null,
|
||||
},
|
||||
// 新增批次
|
||||
|
@ -1,10 +1,13 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<div slot="header" class="clearfix">
|
||||
<i class="el-icon-back" @click="goToAbout">返回 | </i>
|
||||
<div slot="header" class="clearfix" style="display: flex; justify-content: space-between;">
|
||||
<div>
|
||||
<i class="el-icon-back" @click="goToAbout">返回 | </i>
|
||||
<!-- <el-link icon="el-icon-edit" :underline="false" @click="goToAbout">编辑</el-link>-->
|
||||
<span> 盘点详情</span>
|
||||
<span> 进货详情</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="height: 90px; display: flex; justify-content: space-between;">
|
||||
<div style="height: 100%; width: 50%; display: flex; justify-content: space-between;">
|
||||
@ -24,14 +27,14 @@
|
||||
</div>
|
||||
<div style="height: 100%; width: 30%; display: flex; flex-direction: column; justify-content: space-between;">
|
||||
<el-form ref="myForm" label-width="100px">
|
||||
<el-form-item label="盘点单号">
|
||||
<el-form-item label="进货单号">
|
||||
|
||||
<el-input v-model="purchaseForm.orderNumber"
|
||||
style="width: 220Px" :disabled="numberInput">
|
||||
<el-button slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
||||
<el-button v-if="!numberInput" slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点时间" >
|
||||
<el-form-item label="进货时间" >
|
||||
<el-date-picker
|
||||
:disabled="numberInput"
|
||||
style="width: 220Px"
|
||||
@ -48,6 +51,7 @@
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库</el-button>
|
||||
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -58,6 +62,7 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="!numberInput"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="commodityAdd"
|
||||
@ -90,20 +95,20 @@
|
||||
<el-table-column label="当前库存" align="center" prop="stock"/>
|
||||
<el-table-column label="进货数量" align="center" prop="quantityPurchased">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.quantityPurchased" @change="change(scope.row,1)" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.quantityPurchased" @change="change(scope.row,1)" :precision="0" controls-position="right" :min="1" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进货单价" align="center" prop="unitPrice">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.unitPrice" @change="change(scope.row,2)" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.unitPrice" @change="change(scope.row,2)" :precision="2" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计金额" align="center" prop="subtotalAmount">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.subtotalAmount" @change="change(scope.row,3)" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.subtotalAmount" @change="change(scope.row,3)" :precision="2" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="state =='await' || state=='ysh'"label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column v-if="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -156,7 +161,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="详细信息">
|
||||
<el-input v-model="commodityForm.detailed" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
@ -193,7 +198,13 @@
|
||||
<el-table-column label="单位" align="center" prop="unit"/>
|
||||
<el-table-column label="当前库存" align="center" prop="stock"/>
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination
|
||||
v-show="commodityForm.total>0"
|
||||
:total="commodityForm.total"
|
||||
:page.sync="commodityForm.page"
|
||||
:limit.sync="commodityForm.pageSize"
|
||||
@pagination="getCommodityList"
|
||||
/> -->
|
||||
</el-main>
|
||||
</el-container>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -223,6 +234,7 @@ import {
|
||||
auditPurchaseApi,
|
||||
storagePurchaseApi,
|
||||
abolitionPurchaseApi,
|
||||
exportExcelApi,
|
||||
} from "@/api/convenienceStore/purchase";
|
||||
|
||||
|
||||
@ -245,8 +257,10 @@ export default {
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
},
|
||||
purchaseForm: {
|
||||
@ -281,13 +295,13 @@ export default {
|
||||
open: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
// supplierId: '',
|
||||
purchaseId: null,
|
||||
page:null,
|
||||
pageSize:null
|
||||
page:1,
|
||||
pageSize:10000
|
||||
},
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
@ -349,8 +363,8 @@ export default {
|
||||
let this_ = this
|
||||
listLJGoods(this_.commodityForm).then(res=>{
|
||||
this_.commodityList = res.data.records;
|
||||
this_.sumMethod(res.data.records);
|
||||
// this.total = response.data.total;
|
||||
this.commodityForm.total = response.data.total;
|
||||
// this_.sumMethod(res.data.records);
|
||||
})
|
||||
},
|
||||
// 页面跳转
|
||||
@ -361,14 +375,36 @@ export default {
|
||||
this.open = true;
|
||||
},
|
||||
commodityDel(data) {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
|
||||
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 查询商品
|
||||
inquire() {
|
||||
@ -417,20 +453,35 @@ export default {
|
||||
|
||||
addCommodity () {
|
||||
let this_ = this
|
||||
let sum = 0;
|
||||
this.multipleSelection.forEach(mul=>{
|
||||
let now = {
|
||||
let flag = true;
|
||||
this_.detailsList.forEach(det=>{
|
||||
if (mul.id == det.goodsId) {
|
||||
flag = false
|
||||
sum++
|
||||
}
|
||||
})
|
||||
if(flag) {
|
||||
let now = {
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
supplierId: mul.supplierId,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit:mul.unit,
|
||||
stock:mul.stock,
|
||||
quantityPurchased: 0,
|
||||
quantityPurchased: 1,
|
||||
unitPrice: 0,
|
||||
subtotalAmount: 0
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
if(sum>0) {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
|
||||
this_.sumMethod(this_.detailsList);
|
||||
@ -498,6 +549,8 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
async save(flag){
|
||||
let this_ = this
|
||||
// 保存之前进行判断
|
||||
@ -538,8 +591,6 @@ export default {
|
||||
})
|
||||
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
console.log("22222222222222")
|
||||
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag == -1) {
|
||||
this.goToAbout();
|
||||
@ -589,7 +640,7 @@ export default {
|
||||
return -1;
|
||||
}
|
||||
|
||||
this.$confirm('确认后盘点中的对应油品入库油罐库存将发生变化,且不可逆,确认已按照盘点数量入库吗?', '提示', {
|
||||
this.$confirm('确认后进货中的对应商品入库,商品库存将发生变化,且不可逆,确认已按照进货数量入库吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@ -602,6 +653,7 @@ export default {
|
||||
storagePurchaseApi(fil).then(res => {
|
||||
this.state = 'qrts'
|
||||
this.$modal.msgWarning("入库成功");
|
||||
this.goToAbout();
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
@ -616,13 +668,13 @@ export default {
|
||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定要废弃盘点好的数据吗', '提示', {
|
||||
this.$confirm('确定要废弃进货的数据吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let fil ={
|
||||
id: this.PurchaseId
|
||||
id: this.purchaseId
|
||||
}
|
||||
abolitionPurchaseApi(fil).then(res => {
|
||||
if (res.data) {
|
||||
@ -640,6 +692,37 @@ export default {
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
// 导出
|
||||
async exportExcel() {
|
||||
|
||||
let fil ={
|
||||
purchaseId: this.purchaseId
|
||||
}
|
||||
|
||||
exportExcelApi(fil).then(res=>{
|
||||
console.log("res",res)
|
||||
// this.downloadFile(res);
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
|
||||
this.$download.saveAs(blob,'库存统计.xLsx')
|
||||
})
|
||||
},
|
||||
|
||||
// downloadFile(blobData) {
|
||||
// this.$down()
|
||||
// // 创建一个 Blob 对象,并创建一个 URL,用于下载文件
|
||||
// const blob = new Blob([blobData], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
// const url = window.URL.createObjectURL(blob);
|
||||
// const link = document.createElement('a');
|
||||
// link.href = url;
|
||||
|
||||
// // 设置下载文件的名称
|
||||
// link.setAttribute('download', 'exportedFile.xlsx');
|
||||
|
||||
// // 模拟点击链接进行下载
|
||||
// link.click();
|
||||
// },
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<el-input v-model="returnsForm.orderNumber"
|
||||
:disabled="numberInput"
|
||||
style="width: 220Px">
|
||||
<el-button slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
||||
<el-button v-if="!numberInput" slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="退货时间" >
|
||||
@ -49,6 +49,9 @@
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
|
||||
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -59,6 +62,7 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="!numberInput"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="commodityAdd"
|
||||
@ -91,20 +95,20 @@
|
||||
<el-table-column label="入库前库存" align="center" prop="preInboundInventory"/>
|
||||
<el-table-column label="退货数量" align="center" prop="returnQuantity">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.returnQuantity" @change="change(scope.row,1)" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.returnQuantity" @change="change(scope.row,1)" :precision="0" controls-position="right" :min="1" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退货单价" align="center" prop="returnPrice">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.returnPrice" @change="change(scope.row,2)" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.returnPrice" @change="change(scope.row,2)" :precision="2" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计金额" align="center" prop="subtotalAmount">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.subtotalAmount" @change="change(scope.row,3)" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.subtotalAmount" @change="change(scope.row,3)" :precision="2" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="state =='await' || state=='ysh'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column v-if="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -157,7 +161,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="详细信息">
|
||||
<el-input v-model="commodityForm.detailed" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
@ -194,7 +198,13 @@
|
||||
<el-table-column label="单位" align="center" prop="unit"/>
|
||||
<el-table-column label="当前库存" align="center" prop="stock"/>
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination
|
||||
v-show="commodityForm.total>0"
|
||||
:total="commodityForm.total"
|
||||
:page.sync="commodityForm.page"
|
||||
:limit.sync="commodityForm.pageSize"
|
||||
@pagination="getCommodityList"
|
||||
/> -->
|
||||
</el-main>
|
||||
</el-container>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -221,7 +231,8 @@ import {
|
||||
batchProcessingApi,
|
||||
auditReturnsApi,
|
||||
storageReturnsApi,
|
||||
abolitionReturnsApi
|
||||
abolitionReturnsApi,
|
||||
exportExcelApi
|
||||
} from "@/api/convenienceStore/returns";
|
||||
|
||||
|
||||
@ -244,9 +255,11 @@ export default {
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 1000,
|
||||
isRecovery:0,
|
||||
total:0,
|
||||
},
|
||||
returnsForm: {
|
||||
orderNumber: null,
|
||||
@ -347,8 +360,8 @@ export default {
|
||||
let this_ = this
|
||||
listLJGoods(this_.commodityForm).then(res=>{
|
||||
this_.commodityList = res.data.records;
|
||||
this_.sumMethod(res.data.records);
|
||||
// this.total = response.data.total;
|
||||
this.commodityForm.total = response.data.total;
|
||||
// this_.sumMethod(res.data.records);
|
||||
})
|
||||
},
|
||||
// 页面跳转
|
||||
@ -359,14 +372,29 @@ export default {
|
||||
this.open = true;
|
||||
},
|
||||
commodityDel(data) {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 查询商品
|
||||
inquire() {
|
||||
@ -419,20 +447,34 @@ export default {
|
||||
|
||||
addCommodity () {
|
||||
let this_ = this
|
||||
let sum = 0;
|
||||
this.multipleSelection.forEach(mul=>{
|
||||
let now = {
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
supplierId: mul.supplierId,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit:mul.unit,
|
||||
preInboundInventory:mul.stock,
|
||||
returnQuantity: 0,
|
||||
returnPrice: 0,
|
||||
subtotalAmount: 0
|
||||
let flag = true;
|
||||
this_.detailsList.forEach(det=>{
|
||||
if (mul.id == det.goodsId) {
|
||||
flag = false
|
||||
sum++
|
||||
}
|
||||
})
|
||||
if(flag) {
|
||||
let now = {
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
supplierId: mul.supplierId,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit:mul.unit,
|
||||
preInboundInventory:mul.stock,
|
||||
returnQuantity: 0,
|
||||
returnPrice: 0,
|
||||
subtotalAmount: 0
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
|
||||
})
|
||||
if(sum>0) {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
|
||||
this_.sumMethod(this_.detailsList);
|
||||
@ -583,7 +625,7 @@ export default {
|
||||
return -1;
|
||||
}
|
||||
|
||||
this.$confirm('确认后盘点中的对应油品入库油罐库存将发生变化,且不可逆,确认已按照盘点数量入库吗?', '提示', {
|
||||
this.$confirm('确认后退货单中的对应商品出库,商品库存将发生变化,且不可逆,确认已按照退货单数量入库吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@ -611,7 +653,7 @@ export default {
|
||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定要废弃盘点好的数据吗', '提示', {
|
||||
this.$confirm('确定要废弃退货单的数据吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@ -634,6 +676,22 @@ export default {
|
||||
message: '已取消'
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
// 导出
|
||||
async exportExcel() {
|
||||
|
||||
let fil ={
|
||||
returnsId: this.returnsId
|
||||
}
|
||||
|
||||
exportExcelApi(fil).then(res=>{
|
||||
console.log("res",res)
|
||||
// this.downloadFile(res);
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
|
||||
this.$download.saveAs(blob,this.returnsForm.orderNumber+'.xLsx')
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.convenienceSore.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.dto.MtDamageDto;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamage;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamageDetails;
|
||||
import com.fuint.business.convenienceSore.service.MtDamageService;
|
||||
@ -45,9 +46,9 @@ public class MtDamageController extends BaseController {
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
@GetMapping("/getListByPage")
|
||||
public ResponseObject getListByPage(MtDamage mtDamage,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
public ResponseObject getListByPage(MtDamageDto mtDamage,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page =new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo,pageSize);
|
||||
IPage<MtDamageVO> list = mtDamageService.getListByPage(page,mtDamage);
|
||||
return getSuccessResult(list);
|
||||
@ -96,5 +97,28 @@ public class MtDamageController extends BaseController {
|
||||
return getSuccessResult(this.mtDamageService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
||||
/**
|
||||
* 盘点审核
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("audit")
|
||||
public ResponseObject audit(Integer id) {
|
||||
return getSuccessResult(this.mtDamageService.audit(id));
|
||||
}
|
||||
|
||||
@GetMapping("abolition")
|
||||
public ResponseObject abolition(Integer id) {
|
||||
return getSuccessResult(this.mtDamageService.abolition(id));
|
||||
}
|
||||
|
||||
@GetMapping("storage")
|
||||
public ResponseObject storage(Integer id) {
|
||||
return getSuccessResult(this.mtDamageService.storage(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -50,7 +51,7 @@ public class MtDamageDetailsController extends BaseController {
|
||||
@GetMapping("/getListByPage")
|
||||
public ResponseObject getListByPage(MtDamageDetails mtDamageDetails,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
@RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize){
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page =new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo,pageSize);
|
||||
IPage<MtDamageDetailsVO> list = mtDamageDetailsService.getListByPage(page,mtDamageDetails);
|
||||
return getSuccessResult(list);
|
||||
@ -107,9 +108,15 @@ public class MtDamageDetailsController extends BaseController {
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping("batchProcessing")
|
||||
public ResponseObject batchProcessing(@RequestBody List<MtDamageDetails> mtPurchaseDetails) {
|
||||
return getSuccessResult(this.mtDamageDetailsService.batchProcessing(mtPurchaseDetails));
|
||||
public ResponseObject batchProcessing(@RequestBody List<MtDamageDetails> mtDamageDetails) {
|
||||
return getSuccessResult(this.mtDamageDetailsService.batchProcessing(mtDamageDetails));
|
||||
}
|
||||
|
||||
@PostMapping("exportExcel")
|
||||
public void exportExcel(HttpServletResponse response, @RequestBody MtDamageDetails mtDamageDetails) {
|
||||
this.mtDamageDetailsService.export(response,mtDamageDetails);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.convenienceSore.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.dto.MtInventoryDto;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventory;
|
||||
|
||||
import com.fuint.business.convenienceSore.service.MtInventoryService;
|
||||
@ -43,11 +44,11 @@ public class MtInventoryController extends BaseController {
|
||||
}
|
||||
|
||||
@GetMapping("/getListByPage")
|
||||
public ResponseObject getListByPage(MtInventory mtInventory,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page =new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo,pageSize);
|
||||
IPage<MtInventoryVO> list = mtInventoryService.getListByPage(page,mtInventory);
|
||||
public ResponseObject getListByPage(MtInventoryDto mtInventory,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page pageNo =new com.baomidou.mybatisplus.extension.plugins.pagination.Page(page,pageSize);
|
||||
IPage<MtInventoryVO> list = mtInventoryService.getListByPage(pageNo,mtInventory);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
@ -95,5 +96,26 @@ public class MtInventoryController extends BaseController {
|
||||
return getSuccessResult(this.mtInventoryService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 盘点审核
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("audit")
|
||||
public ResponseObject audit(Integer id) {
|
||||
return getSuccessResult(this.mtInventoryService.audit(id));
|
||||
}
|
||||
|
||||
@GetMapping("abolition")
|
||||
public ResponseObject abolition(Integer id) {
|
||||
return getSuccessResult(this.mtInventoryService.abolition(id));
|
||||
}
|
||||
|
||||
@GetMapping("storage")
|
||||
public ResponseObject storage(Integer id) {
|
||||
return getSuccessResult(this.mtInventoryService.storage(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -51,7 +52,7 @@ public class MtInventoryDetailsController extends BaseController {
|
||||
@GetMapping("/getListByPage")
|
||||
public ResponseObject getListByPage(MtInventoryDetails mtInventoryDetails,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
@RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize){
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page =new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo,pageSize);
|
||||
IPage<MtInventoryDetailsVO> list = mtInventoryDetailsService.getListByPage(page,mtInventoryDetails);
|
||||
return getSuccessResult(list);
|
||||
@ -112,5 +113,11 @@ public class MtInventoryDetailsController extends BaseController {
|
||||
return getSuccessResult(this.mtInventoryDetailsService.batchProcessing(mtPurchaseDetails));
|
||||
}
|
||||
|
||||
@PostMapping("exportExcel")
|
||||
public void exportExcel(HttpServletResponse response, @RequestBody MtInventoryDetails mtPurchaseDetails) {
|
||||
this.mtInventoryDetailsService.export(response,mtPurchaseDetails);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -45,7 +46,7 @@ public class MtPurchaseDetailsController extends BaseController {
|
||||
@GetMapping("/getListByPage")
|
||||
public ResponseObject getListByPage(MtPurchaseDetails mtPurchaseDetails,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
@RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize){
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page =new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo,pageSize);
|
||||
IPage<MtPurchaseDetailsVO> list = mtPurchaseDetailsService.getListByPage(page,mtPurchaseDetails);
|
||||
return getSuccessResult(list);
|
||||
@ -108,5 +109,13 @@ public class MtPurchaseDetailsController extends BaseController {
|
||||
return getSuccessResult(this.mtPurchaseDetailsService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("exportExcel")
|
||||
public void exportExcel(HttpServletResponse response,@RequestBody MtPurchaseDetails mtPurchaseDetails) {
|
||||
this.mtPurchaseDetailsService.export(response,mtPurchaseDetails);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -49,7 +50,7 @@ public class MtReturnsDetailsController extends BaseController {
|
||||
@GetMapping("/getListByPage")
|
||||
public ResponseObject getListByPage(MtReturnsDetails mtReturnsDetails,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
@RequestParam(value = "pageSize",defaultValue = "1000") Integer pageSize){
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page =new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo,pageSize);
|
||||
IPage<MtReturnsDetailsVO> list = mtReturnsDetailsService.getListByPage(page,mtReturnsDetails);
|
||||
return getSuccessResult(list);
|
||||
@ -110,5 +111,11 @@ public class MtReturnsDetailsController extends BaseController {
|
||||
return ResponseEntity.ok(this.mtReturnsDetailsService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("exportExcel")
|
||||
public void exportExcel(HttpServletResponse response, @RequestBody MtReturnsDetails mtReturnsDetails) {
|
||||
this.mtReturnsDetailsService.export(response,mtReturnsDetails);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
package com.fuint.business.convenienceSore.dto;
|
||||
|
||||
import com.fuint.business.convenienceSore.entity.MtDamage;
|
||||
import com.fuint.business.convenienceSore.entity.MtReturns;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MtDamageDto extends MtDamage {
|
||||
private Integer supplierId;
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.fuint.business.convenienceSore.dto;
|
||||
|
||||
import com.fuint.business.convenienceSore.entity.MtInventory;
|
||||
import com.fuint.business.convenienceSore.entity.MtReturns;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MtInventoryDto extends MtInventory {
|
||||
private Integer supplierId;
|
||||
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
package com.fuint.business.convenienceSore.dto;
|
||||
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchase;
|
||||
import com.fuint.business.convenienceSore.entity.MtReturns;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MtReturnsDto extends MtPurchase {
|
||||
public class MtReturnsDto extends MtReturns {
|
||||
private Integer supplierId;
|
||||
|
||||
}
|
||||
|
@ -2,12 +2,12 @@ package com.fuint.business.convenienceSore.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamage;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamageDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.entity.*;
|
||||
import com.fuint.business.convenienceSore.vo.MtDamageDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtDamageVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtDamageDetailsExcel;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
@ -39,6 +39,11 @@ public interface MtDamageDetailsMapper {
|
||||
|
||||
IPage<MtDamageDetailsVO> getListByPage(Page page, @Param("mtDamageDetails") MtDamageDetails mtDamageDetails);
|
||||
|
||||
List<MtDamageDetailsVO> getAllList2(@Param("mtDamageDetails") MtDamageDetails mtDamageDetails);
|
||||
|
||||
|
||||
List<MtDamageDetailsExcel> getListByExcel(@Param("mtDamageDetails") MtDamageDetails mtDamageDetails);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
@ -90,5 +95,7 @@ public interface MtDamageDetailsMapper {
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
int editGoods(MtDamageDetailsVO mtDamageDetailsVO);
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.convenienceSore.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.dto.MtDamageDto;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamage;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtDamageVO;
|
||||
@ -35,7 +36,7 @@ public interface MtDamageMapper {
|
||||
*/
|
||||
IPage<MtDamage> queryAllByLimit(Page page, @Param("mtDamage") MtDamage mtDamage);
|
||||
|
||||
IPage<MtDamageVO> getListByPage(Page page, @Param("mtDamage") MtDamage mtDamage);
|
||||
IPage<MtDamageVO> getListByPage(Page page, @Param("mtDamage") MtDamageDto mtDamage);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
@ -86,6 +87,8 @@ public interface MtDamageMapper {
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
int editStateById(@Param("id") Integer id,@Param("status") String status);
|
||||
|
||||
|
||||
List<MtDamageVO> getDamageList(@Param("pId") Integer pId);
|
||||
|
||||
|
@ -4,7 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtReturnsDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtDamageDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtInventoryDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtInventoryDetailsExcel;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
@ -37,6 +42,12 @@ public interface MtInventoryDetailsMapper {
|
||||
|
||||
IPage<MtInventoryDetailsVO> getListByPage(Page page, @Param("mtInventoryDetails") MtInventoryDetails mtInventoryDetails);
|
||||
|
||||
|
||||
List<MtInventoryDetailsVO> getAllList2(@Param("mtInventoryDetails") MtInventoryDetails mtInventoryDetails);
|
||||
|
||||
|
||||
List<MtInventoryDetailsExcel> getListByExcel(@Param("mtInventoryDetails") MtInventoryDetails mtInventoryDetails);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
@ -87,5 +98,7 @@ public interface MtInventoryDetailsMapper {
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
int editGoods(MtInventoryDetailsVO mtInventoryDetailsVO);
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.convenienceSore.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.dto.MtInventoryDto;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventory;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtInventoryVO;
|
||||
@ -35,7 +36,7 @@ public interface MtInventoryMapper {
|
||||
*/
|
||||
IPage<MtInventory> queryAllByLimit(Page page, @Param("mtInventory") MtInventory mtInventory);
|
||||
|
||||
IPage<MtInventoryVO> getListByPage(Page page, @Param("mtInventory") MtInventory mtInventory);
|
||||
IPage<MtInventoryVO> getListByPage(Page page, @Param("mtInventory") MtInventoryDto mtInventory);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
@ -86,5 +87,8 @@ public interface MtInventoryMapper {
|
||||
*/
|
||||
int deleteById(Integer inventoryId);
|
||||
|
||||
|
||||
int editStateById(@Param("id") Integer id,@Param("status") String status);
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchase;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtPurchaseDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilInventoryOrder;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilInventoryOrderVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -41,6 +42,9 @@ public interface MtPurchaseDetailsMapper {
|
||||
|
||||
List<MtPurchaseDetailsVO> getAllList2(@Param("mtPurchaseDetails") MtPurchaseDetails mtPurchaseDetails);
|
||||
|
||||
|
||||
List<MtPurchaseDetailsExcel> getListByExcel(@Param("mtPurchaseDetails") MtPurchaseDetails mtPurchaseDetails);
|
||||
|
||||
int editGoods(MtPurchaseDetailsVO mtPurchaseDetails);
|
||||
/**
|
||||
* 统计总行数
|
||||
|
@ -7,6 +7,8 @@ import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtReturnsDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtPurchaseDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtReturnsDetailsExcel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
@ -40,6 +42,9 @@ public interface MtReturnsDetailsMapper {
|
||||
|
||||
List<MtReturnsDetailsVO> getAllList2(@Param("mtReturnsDetails") MtReturnsDetails mtReturnsDetails);
|
||||
|
||||
|
||||
List<MtReturnsDetailsExcel> getListByExcel(@Param("mtReturnsDetails") MtReturnsDetails mtReturnsDetails);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
@ -94,5 +99,7 @@ public interface MtReturnsDetailsMapper {
|
||||
|
||||
int editGoods(MtReturnsDetailsVO mtReturnsDetailsVO);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ public interface MtReturnsMapper {
|
||||
int editStateById(@Param("id") Integer id,@Param("status") String status);
|
||||
|
||||
|
||||
// List<MtReturnsVO> getMtReturnsList(@Param("pId") Integer pId);
|
||||
List<MtReturnsVO> getMtReturnsList(@Param("pId") Integer pId);
|
||||
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,13 @@
|
||||
<if test="goods.status != null and goods.status != ''">
|
||||
and status = #{goods.status}
|
||||
</if>
|
||||
<if test="goods.remark != null and goods.remark != ''">
|
||||
and(
|
||||
name like concat('%', #{goods.remark}, '%')
|
||||
or pinyin_code like concat('%', #{goods.remark}, '%')
|
||||
or shelf_number like concat('%', #{goods.remark}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -125,6 +125,48 @@
|
||||
md.store_id = #{mtDamageDetails.storeId}
|
||||
and damage_id = #{mtDamageDetails.damageId}
|
||||
</select>
|
||||
<select id="getAllList2" resultType="com.fuint.business.convenienceSore.vo.MtDamageDetailsVO">
|
||||
select
|
||||
md.id id,
|
||||
md.damage_quantity damageQuantity ,
|
||||
md.weighted_average_cost weightedAverageCost ,
|
||||
md.subtotal_amount subtotalAmount ,
|
||||
md.pre_inbound_inventory preInboundInventory ,
|
||||
mg.name commodityName,
|
||||
mg.cvs_good_id cvsGoodId,
|
||||
mg.unit unit,
|
||||
mg.supplier_id supplierId,
|
||||
mg.id goodsId,
|
||||
mg.stock stock,
|
||||
md2.order_number orderNumber
|
||||
from mt_damage_details md
|
||||
left join mt_damage md2 ON md.damage_id = md2.id
|
||||
left join mt_goods mg ON md.goods_id = mg.id
|
||||
where
|
||||
damage_id = #{mtDamageDetails.damageId}
|
||||
</select>
|
||||
<select id="getListByExcel"
|
||||
resultType="com.fuint.business.convenienceSore.vo.excel.MtDamageDetailsExcel">
|
||||
SELECT
|
||||
md.damage_quantity damageQuantity,
|
||||
md.weighted_average_cost weightedAverageCost,
|
||||
md.subtotal_amount subtotalAmount,
|
||||
mg.NAME commodityName,
|
||||
cg.NAME cvsGoodName,
|
||||
su.NAME supplierName,
|
||||
mg.unit unit,
|
||||
mg.stock stock
|
||||
FROM
|
||||
mt_damage_details md
|
||||
LEFT JOIN mt_damage mp ON md.damage_id = mp.id
|
||||
LEFT JOIN mt_goods mg ON md.goods_id = mg.id
|
||||
LEFT JOIN cvs_goods cg ON mg.cvs_good_id = cg.id
|
||||
LEFT JOIN supplier su ON mg.supplier_id = su.id
|
||||
where
|
||||
damage_id = #{mtDamageDetails.damageId}
|
||||
</select>
|
||||
<!-- and -->
|
||||
<!-- md.store_id = #{mtDamageDetails.storeId}-->
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -241,6 +283,14 @@
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<update id="editGoods">
|
||||
update mt_goods set
|
||||
stock = stock - #{damageQuantity} ,
|
||||
update_time = NOW()
|
||||
where id = #{goodsId}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from mt_damage_details where id = #{id}
|
||||
|
@ -201,6 +201,7 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from mt_damage where id = #{id}
|
||||
@ -214,8 +215,17 @@
|
||||
from mt_damage_details mpd
|
||||
left join mt_goods mg ON mg.id = mpd.goods_id
|
||||
left join supplier s ON mg.supplier_id = s.id
|
||||
where mpd.id = #{pId}
|
||||
where mpd.damage_id = #{pId}
|
||||
</select>
|
||||
|
||||
|
||||
<update id="editStateById">
|
||||
update mt_damage
|
||||
set approval_status = #{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getListByPage" resultType="com.fuint.business.convenienceSore.vo.MtDamageVO">
|
||||
SELECT
|
||||
mp.id id,
|
||||
@ -230,6 +240,7 @@
|
||||
FROM
|
||||
mt_damage mp
|
||||
LEFT JOIN mt_damage_details mpd ON mp.id = mpd.damage_id
|
||||
left join mt_goods mg ON mg.id = mpd.goods_id
|
||||
LEFT JOIN mt_staff ms1 ON mp.create_by = ms1.id
|
||||
LEFT JOIN mt_staff ms2 ON mp.approver = ms2.id
|
||||
where
|
||||
@ -240,10 +251,14 @@
|
||||
<if test="mtDamage.orderNumber != null and mtDamage.orderNumber != ''">
|
||||
and order_number LIKE CONCAT('%', #{mtDamage.orderNumber}, '%')
|
||||
</if>
|
||||
<if test="mtReturns.supplierId != null">
|
||||
and mp.store_id = #{mtReturns.storeId}
|
||||
<if test="mtDamage.supplierId != null">
|
||||
and mg.supplier_id = #{mtDamage.supplierId}
|
||||
</if>
|
||||
group by mp.id
|
||||
</select>
|
||||
|
||||
<!-- . <if test="mtReturns.supplierId != null">-->
|
||||
<!-- and mp.store_id = #{mtDamage.storeId}-->
|
||||
<!--</if>-->
|
||||
</mapper>
|
||||
|
||||
|
@ -163,6 +163,48 @@
|
||||
and md.update_by = #{mtInventoryDetails.updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getAllList2" resultType="com.fuint.business.convenienceSore.vo.MtInventoryDetailsVO">
|
||||
select
|
||||
md.id id,
|
||||
md.profit_loss_amount profitLossAmount,
|
||||
md.inventory_discrepancy inventoryDiscrepancy,
|
||||
md.inventory_quantity inventoryQuantity,
|
||||
md.purchase_price purchasePrice,
|
||||
mg.name commodityName,
|
||||
mg.goods_no goodsNo,
|
||||
mg.cvs_good_id cvsGoodId,
|
||||
mg.unit unit,
|
||||
mg.supplier_id supplierId,
|
||||
mg.id goodsId,
|
||||
md.stock stock,
|
||||
md2.order_number orderNumber
|
||||
from mt_inventory_details md
|
||||
left join mt_inventory md2 ON md.inventory_id = md2.id
|
||||
left join mt_goods mg ON md.goods_id = mg.id
|
||||
where
|
||||
md.inventory_id = #{mtInventoryDetails.inventoryId}
|
||||
|
||||
</select>
|
||||
<select id="getListByExcel"
|
||||
resultType="com.fuint.business.convenienceSore.vo.excel.MtInventoryDetailsExcel">
|
||||
SELECT
|
||||
md.purchase_price purchasePrice,
|
||||
md.inventory_quantity inventoryQuantity,
|
||||
md.inventory_discrepancy inventoryDiscrepancy,
|
||||
md.profit_loss_amount profitLossAmount,
|
||||
mg.NAME commodityName,
|
||||
mg.unit unit,
|
||||
mg.goods_no goodsNo,
|
||||
md.stock stock
|
||||
FROM
|
||||
mt_inventory_details md
|
||||
LEFT JOIN mt_inventory mp ON md.inventory_id = mp.id
|
||||
LEFT JOIN mt_goods mg ON md.goods_id = mg.id
|
||||
where md.inventory_id = #{mtInventoryDetails.inventoryId}
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
@ -294,5 +336,14 @@
|
||||
delete from mt_inventory_details where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
<update id="editGoods">
|
||||
update mt_goods set
|
||||
stock = stock + #{inventoryDiscrepancy} ,
|
||||
update_time = NOW()
|
||||
where id = #{goodsId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
@ -146,11 +146,16 @@
|
||||
ms2.real_name approverName,
|
||||
ms3.real_name confirmerName
|
||||
from mt_inventory mp
|
||||
LEFT JOIN mt_inventory_details mpd ON mp.id = mpd.inventory_id
|
||||
left join mt_goods mg ON mg.id = mpd.goods_id
|
||||
LEFT JOIN mt_staff ms1 ON mp.create_by = ms1.id
|
||||
LEFT JOIN mt_staff ms2 ON mp.approver = ms2.id
|
||||
LEFT JOIN mt_staff ms3 ON mp.confirmer = ms3.id
|
||||
<where>
|
||||
mp.store_id = #{mtInventory.storeId}
|
||||
<if test="mtInventory.supplierId != null">
|
||||
and mg.supplier_id = #{mtInventory.supplierId}
|
||||
</if>
|
||||
<if test="mtInventory.id != null">
|
||||
and id = #{mtInventory.id}
|
||||
</if>
|
||||
@ -192,6 +197,7 @@
|
||||
</if>
|
||||
|
||||
</where>
|
||||
group by mp.id
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
@ -279,6 +285,11 @@
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="editStateById">
|
||||
update mt_inventory
|
||||
set approval_status = #{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
|
@ -162,6 +162,27 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getListByExcel"
|
||||
resultType="com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel">
|
||||
SELECT
|
||||
md.quantity_purchased quantityPurchased,
|
||||
md.unit_price unitPrice,
|
||||
md.subtotal_amount subtotalAmount,
|
||||
mg.NAME commodityName,
|
||||
cg.NAME cvsGoodName,
|
||||
su.NAME supplierName,
|
||||
mg.unit unit,
|
||||
mg.stock stock
|
||||
FROM
|
||||
mt_purchase_details md
|
||||
LEFT JOIN mt_purchase mp ON md.purchase_id = mp.id
|
||||
LEFT JOIN mt_goods mg ON md.goods_id = mg.id
|
||||
LEFT JOIN cvs_goods cg ON mg.cvs_good_id = cg.id
|
||||
LEFT JOIN supplier su ON mg.supplier_id = su.id
|
||||
where
|
||||
purchase_id = #{mtPurchaseDetails.purchaseId}
|
||||
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
|
@ -135,11 +135,11 @@
|
||||
FROM
|
||||
mt_purchase mp
|
||||
LEFT JOIN mt_purchase_details mpd ON mp.id = mpd.purchase_id
|
||||
left join mt_goods mg ON mg.id = mpd.goods_id
|
||||
LEFT JOIN mt_staff ms1 ON mp.create_by = ms1.id
|
||||
LEFT JOIN mt_staff ms2 ON mp.approver = ms2.id
|
||||
<where>
|
||||
mp.store_id = #{mtPurchase.storeId}
|
||||
|
||||
<if test="mtPurchase.approvalStatus != null and mtPurchase.approvalStatus != ''">
|
||||
and approval_status = #{mtPurchase.approvalStatus}
|
||||
</if>
|
||||
@ -148,7 +148,7 @@
|
||||
</if>
|
||||
|
||||
<if test="mtPurchase.supplierId != null">
|
||||
and mp.store_id = #{mtPurchase.storeId}
|
||||
and mg.supplier_id = #{mtPurchase.supplierId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
|
@ -162,6 +162,27 @@
|
||||
where
|
||||
returns_id = #{mtReturnsDetails.returnsId}
|
||||
</select>
|
||||
<select id="getListByExcel"
|
||||
resultType="com.fuint.business.convenienceSore.vo.excel.MtReturnsDetailsExcel">
|
||||
SELECT
|
||||
md.return_quantity returnQuantity,
|
||||
md.return_price returnPrice,
|
||||
md.subtotal_amount subtotalAmount,
|
||||
mg.NAME commodityName,
|
||||
cg.NAME cvsGoodName,
|
||||
su.NAME supplierName,
|
||||
mg.unit unit,
|
||||
md.pre_inbound_inventory stock
|
||||
FROM
|
||||
mt_returns_details md
|
||||
LEFT JOIN mt_returns mp ON md.returns_id = mp.id
|
||||
LEFT JOIN mt_goods mg ON md.goods_id = mg.id
|
||||
LEFT JOIN cvs_goods cg ON mg.cvs_good_id = cg.id
|
||||
LEFT JOIN supplier su ON mg.supplier_id = su.id
|
||||
where
|
||||
returns_id = #{mtReturnsDetails.returnsId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
|
@ -135,6 +135,7 @@
|
||||
FROM
|
||||
mt_returns mp
|
||||
LEFT JOIN mt_returns_details mpd ON mp.id = mpd.returns_id
|
||||
left join mt_goods mg ON mg.id = mpd.goods_id
|
||||
LEFT JOIN mt_staff ms1 ON mp.create_by = ms1.id
|
||||
LEFT JOIN mt_staff ms2 ON mp.approver = ms2.id
|
||||
<where>
|
||||
@ -147,7 +148,7 @@
|
||||
and order_number LIKE CONCAT('%', #{mtReturns.orderNumber}, '%')
|
||||
</if>
|
||||
<if test="mtReturns.supplierId != null">
|
||||
and mp.store_id = #{mtReturns.storeId}
|
||||
and mg.supplier_id = #{mtReturns.supplierId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
@ -245,5 +246,18 @@
|
||||
where id = #{id}
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getMtReturnsList" resultType="com.fuint.business.convenienceSore.vo.MtReturnsVO">
|
||||
select
|
||||
mpd.id detailsId,
|
||||
s.id supplierId,
|
||||
s.name supplierName
|
||||
from mt_returns_details mpd
|
||||
left join mt_goods mg ON mg.id = mpd.goods_id
|
||||
left join supplier s ON mg.supplier_id = s.id
|
||||
where mpd.returns_id = #{pId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
@ -8,6 +8,7 @@ import com.fuint.business.convenienceSore.vo.MtDamageDetailsVO;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -60,7 +61,9 @@ public interface MtDamageDetailsService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
boolean batchProcessing(List<MtDamageDetails> mtPurchaseDetails);
|
||||
boolean batchProcessing(List<MtDamageDetails> mtDamageDetails);
|
||||
|
||||
void export(HttpServletResponse response, MtDamageDetails mtDamageDetails);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.convenienceSore.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.dto.MtDamageDto;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamage;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtDamageVO;
|
||||
@ -31,7 +32,7 @@ public interface MtDamageService {
|
||||
* @return 查询结果
|
||||
*/
|
||||
IPage<MtDamage> queryByPage(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, MtDamage mtDamage);
|
||||
IPage<MtDamageVO> getListByPage(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, MtDamage mtDamage);
|
||||
IPage<MtDamageVO> getListByPage(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, MtDamageDto mtDamage);
|
||||
|
||||
|
||||
|
||||
@ -59,4 +60,9 @@ public interface MtDamageService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
boolean audit(Integer id);
|
||||
boolean abolition(Integer id);
|
||||
boolean storage(Integer id);
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtInventoryDetailsVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -60,6 +61,8 @@ public interface MtInventoryDetailsService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
boolean batchProcessing(List<MtInventoryDetails> mtPurchaseDetails);
|
||||
boolean batchProcessing(List<MtInventoryDetails> mtInventoryDetails);
|
||||
|
||||
void export(HttpServletResponse response, MtInventoryDetails mtInventoryDetails);
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.convenienceSore.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.dto.MtInventoryDto;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventory;
|
||||
import com.fuint.business.convenienceSore.vo.MtInventoryVO;
|
||||
|
||||
@ -30,7 +31,7 @@ public interface MtInventoryService {
|
||||
*/
|
||||
IPage<MtInventory> queryByPage(Page page, MtInventory mtInventory);
|
||||
|
||||
IPage<MtInventoryVO> getListByPage(Page page, MtInventory mtInventory);
|
||||
IPage<MtInventoryVO> getListByPage(Page page, MtInventoryDto mtInventory);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
@ -56,4 +57,9 @@ public interface MtInventoryService {
|
||||
*/
|
||||
boolean deleteById(Integer inventoryId);
|
||||
|
||||
|
||||
boolean audit(Integer id);
|
||||
boolean abolition(Integer id);
|
||||
boolean storage(Integer id);
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtPurchaseDetailsVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -62,4 +63,7 @@ public interface MtPurchaseDetailsService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
void export(HttpServletResponse response, MtPurchaseDetails mtPurchaseDetails);
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtReturnsDetails;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsDetailsVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -56,9 +57,11 @@ public interface MtReturnsDetailsService {
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param purchaseDetailId 主键
|
||||
* @param detailId 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer purchaseDetailId);
|
||||
boolean deleteById(Integer detailId);
|
||||
|
||||
void export(HttpServletResponse response, MtReturnsDetails mtReturnsDetails);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamageDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
@ -7,6 +8,8 @@ import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.mapper.MtDamageDetailsMapper;
|
||||
import com.fuint.business.convenienceSore.service.MtDamageDetailsService;
|
||||
import com.fuint.business.convenienceSore.vo.MtDamageDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtDamageDetailsExcel;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -15,6 +18,7 @@ import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -131,4 +135,27 @@ public class MtDamageDetailsServiceImpl implements MtDamageDetailsService {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void export(HttpServletResponse response, MtDamageDetails mtDamageDetails) {
|
||||
// 需要导出的数据
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtDamageDetails.setStoreId(nowAccountInfo.getStoreId());
|
||||
List<MtDamageDetailsExcel> listByExcel = mtDamageDetailsDao.getListByExcel(mtDamageDetails);
|
||||
|
||||
// 设置文件名字
|
||||
// String fileName = System.currentTimeMillis() + ".xlsx";
|
||||
|
||||
// 设置响应头信息
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
|
||||
try{
|
||||
// 写入文件数据
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
EasyExcel.write(response.getOutputStream(), MtDamageDetailsExcel.class).sheet("download").doWrite(listByExcel);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,20 +1,23 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.entity.MtDamage;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
import com.fuint.business.convenienceSore.dto.MtDamageDto;
|
||||
import com.fuint.business.convenienceSore.entity.*;
|
||||
import com.fuint.business.convenienceSore.mapper.MtDamageDetailsMapper;
|
||||
import com.fuint.business.convenienceSore.mapper.MtDamageMapper;
|
||||
import com.fuint.business.convenienceSore.mapper.MtPurchaseMapper;
|
||||
import com.fuint.business.convenienceSore.service.MtDamageService;
|
||||
import com.fuint.business.convenienceSore.vo.MtDamageVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtPurchaseVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsVO;
|
||||
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
||||
import com.fuint.business.convenienceSore.service.StockTrackService;
|
||||
import com.fuint.business.convenienceSore.vo.*;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@ -30,8 +33,13 @@ public class MtDamageServiceImpl implements MtDamageService {
|
||||
@Resource
|
||||
private MtDamageMapper mtDamageDao;
|
||||
@Resource
|
||||
private MtPurchaseMapper mtPurchaseDao;
|
||||
|
||||
private MtDamageDetailsMapper detailsMapper;
|
||||
@Resource
|
||||
private ILJStaffService iljStaffService;
|
||||
@Resource
|
||||
private StockTrackService stockService;
|
||||
@Resource
|
||||
private StockStatisticService stockStatisticService;
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -60,7 +68,7 @@ public class MtDamageServiceImpl implements MtDamageService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<MtDamageVO> getListByPage(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, MtDamage mtDamage) {
|
||||
public IPage<MtDamageVO> getListByPage(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, MtDamageDto mtDamage) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
mtDamage.setStoreId(storeId);
|
||||
@ -81,6 +89,7 @@ public class MtDamageServiceImpl implements MtDamageService {
|
||||
int index = 0;
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (MtDamageVO mtDamageVO : returnsList) {
|
||||
if (mtDamageVO.getSupplierName() == null) continue;
|
||||
if (!stringBuilder.toString().contains(mtDamageVO.getSupplierName())) {
|
||||
if (index == 0) {
|
||||
stringBuilder.append(mtDamageVO.getSupplierName());
|
||||
@ -131,4 +140,82 @@ public class MtDamageServiceImpl implements MtDamageService {
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.mtDamageDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean audit(Integer id) {
|
||||
String oilIntake = "退货审核";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 根据id修改状态
|
||||
String status = "ysh";
|
||||
mtDamageDao.editStateById(id,status);
|
||||
// 增加审核人
|
||||
boolean edit = edit(id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean abolition(Integer id) {
|
||||
String oilIntake = "退货废止";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
String status = "yzf";
|
||||
mtDamageDao.editStateById(id,status);
|
||||
boolean edit = edit(id);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean storage(Integer id) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
String oilIntake = "退货出库";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 1.查询所有的数据
|
||||
MtDamageDetails mtDamageDetails = new MtDamageDetails();
|
||||
mtDamageDetails.setDamageId(id);
|
||||
List<MtDamageDetailsVO> allList2 = detailsMapper.getAllList2(mtDamageDetails);
|
||||
for (MtDamageDetailsVO mtReturnsDetailsVO : allList2) {
|
||||
// 修改库存
|
||||
int i = detailsMapper.editGoods(mtReturnsDetailsVO);
|
||||
if (i>0) {
|
||||
// 添加库存跟踪信息
|
||||
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
|
||||
StockTrack stockTrack = new StockTrack();
|
||||
stockTrack.setStockId(stockStatistic.getId());
|
||||
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId());
|
||||
stockTrack.setDocument("商品报损");
|
||||
stockTrack.setChangeNumber(-mtReturnsDetailsVO.getDamageQuantity());
|
||||
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());
|
||||
stockService.insertStockTrack(stockTrack);
|
||||
}
|
||||
}
|
||||
String status = "qrts";
|
||||
|
||||
boolean edit = edit(id);
|
||||
int i = mtDamageDao.editStateById(id, status);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 修改审核人
|
||||
public boolean edit(Integer id){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
MtDamage mtDamage = new MtDamage();
|
||||
mtDamage.setApprover(nowAccountInfo.getStaffId().toString());
|
||||
mtDamage.setId(id);
|
||||
int update = mtDamageDao.update(mtDamage);
|
||||
return update>0;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventoryDetails;
|
||||
@ -7,11 +8,14 @@ import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.mapper.MtInventoryDetailsMapper;
|
||||
import com.fuint.business.convenienceSore.service.MtInventoryDetailsService;
|
||||
import com.fuint.business.convenienceSore.vo.MtInventoryDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtInventoryDetailsExcel;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -104,14 +108,14 @@ public class MtInventoryDetailsServiceImpl implements MtInventoryDetailsService
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean batchProcessing(List<MtInventoryDetails> mtPurchaseDetails) {
|
||||
public boolean batchProcessing(List<MtInventoryDetails> mtInventoryDetails) {
|
||||
List<MtInventoryDetails> mtPurchaseDetailsIns = new ArrayList<>();
|
||||
List<MtInventoryDetails> mtPurchaseDetailsEdit = new ArrayList<>();
|
||||
|
||||
AccountInfo accountInfoByToken = TokenUtil.getNowAccountInfo();
|
||||
|
||||
if (mtPurchaseDetails.size() > 0) {
|
||||
for (MtInventoryDetails mtPurchaseDetail : mtPurchaseDetails) {
|
||||
if (mtInventoryDetails.size() > 0) {
|
||||
for (MtInventoryDetails mtPurchaseDetail : mtInventoryDetails) {
|
||||
mtPurchaseDetail.setStoreId(accountInfoByToken.getStoreId());
|
||||
mtPurchaseDetail.setCreateBy(accountInfoByToken.getStaffId().toString());
|
||||
if (mtPurchaseDetail.getId() != null) {
|
||||
@ -130,4 +134,27 @@ public class MtInventoryDetailsServiceImpl implements MtInventoryDetailsService
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void export(HttpServletResponse response, MtInventoryDetails mtInventoryDetails) {
|
||||
// 需要导出的数据
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtInventoryDetails.setStoreId(nowAccountInfo.getStoreId());
|
||||
List<MtInventoryDetailsExcel> listByExcel = mtInventoryDetailsDao.getListByExcel(mtInventoryDetails);
|
||||
|
||||
// 设置文件名字
|
||||
// String fileName = System.currentTimeMillis() + ".xlsx";
|
||||
|
||||
// 设置响应头信息
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
|
||||
try{
|
||||
// 写入文件数据
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
EasyExcel.write(response.getOutputStream(), MtInventoryDetailsExcel.class).sheet("download").doWrite(listByExcel);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,19 +1,29 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.dto.MtInventoryDto;
|
||||
import com.fuint.business.convenienceSore.entity.*;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventory;
|
||||
import com.fuint.business.convenienceSore.entity.MtInventory;
|
||||
import com.fuint.business.convenienceSore.mapper.MtInventoryDetailsMapper;
|
||||
import com.fuint.business.convenienceSore.mapper.MtInventoryMapper;
|
||||
import com.fuint.business.convenienceSore.mapper.MtPurchaseDetailsMapper;
|
||||
import com.fuint.business.convenienceSore.service.MtInventoryService;
|
||||
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
||||
import com.fuint.business.convenienceSore.service.StockTrackService;
|
||||
import com.fuint.business.convenienceSore.vo.MtInventoryDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtInventoryVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsDetailsVO;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品盘点表(MtInventory)表服务实现类
|
||||
@ -25,6 +35,14 @@ import javax.annotation.Resource;
|
||||
public class MtInventoryServiceImpl implements MtInventoryService {
|
||||
@Resource
|
||||
private MtInventoryMapper mtInventoryDao;
|
||||
@Resource
|
||||
private MtInventoryDetailsMapper mtInventoryDetailsDao;
|
||||
@Resource
|
||||
private ILJStaffService iljStaffService;
|
||||
@Resource
|
||||
private StockTrackService stockService;
|
||||
@Resource
|
||||
private StockStatisticService stockStatisticService;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
@ -55,7 +73,7 @@ public class MtInventoryServiceImpl implements MtInventoryService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<MtInventoryVO> getListByPage(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, MtInventory mtInventory) {
|
||||
public IPage<MtInventoryVO> getListByPage(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, MtInventoryDto mtInventory) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtInventory.setStoreId(nowAccountInfo.getStoreId());
|
||||
// mtInventory.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
@ -100,4 +118,93 @@ public class MtInventoryServiceImpl implements MtInventoryService {
|
||||
public boolean deleteById(Integer inventoryId) {
|
||||
return this.mtInventoryDao.deleteById(inventoryId) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean audit(Integer id) {
|
||||
String oilIntake = "退货审核";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 根据id修改状态
|
||||
String status = "ysh";
|
||||
mtInventoryDao.editStateById(id,status);
|
||||
// 增加审核人
|
||||
boolean edit = edit(id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean abolition(Integer id) {
|
||||
String oilIntake = "退货废止";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
String status = "yzf";
|
||||
mtInventoryDao.editStateById(id,status);
|
||||
boolean edit = edit(id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean storage(Integer id) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
String oilIntake = "退货出库";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 1.查询所有的数据
|
||||
MtInventoryDetails mtInventoryDetails = new MtInventoryDetails();
|
||||
mtInventoryDetails.setInventoryId(id);
|
||||
List<MtInventoryDetailsVO> allList2 = mtInventoryDetailsDao.getAllList2(mtInventoryDetails);
|
||||
for (MtInventoryDetailsVO mtReturnsDetailsVO : allList2) {
|
||||
// 修改库存
|
||||
int i = mtInventoryDetailsDao.editGoods(mtReturnsDetailsVO);
|
||||
if (i>0) {
|
||||
// 添加库存跟踪信息
|
||||
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
|
||||
StockTrack stockTrack = new StockTrack();
|
||||
stockTrack.setStockId(stockStatistic.getId());
|
||||
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId());
|
||||
stockTrack.setDocument("商品盘点");
|
||||
stockTrack.setChangeNumber(mtReturnsDetailsVO.getInventoryDiscrepancy().intValue());
|
||||
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());
|
||||
stockService.insertStockTrack(stockTrack);
|
||||
}
|
||||
}
|
||||
String status = "qrts";
|
||||
|
||||
boolean edit = edit2(id);
|
||||
int i = mtInventoryDao.editStateById(id, status);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 修改审核人
|
||||
public boolean edit(Integer id){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
MtInventory mtReturns = new MtInventory();
|
||||
mtReturns.setApprover(nowAccountInfo.getStaffId().toString());
|
||||
mtReturns.setId(id);
|
||||
int update = mtInventoryDao.update(mtReturns);
|
||||
return update>0;
|
||||
}
|
||||
|
||||
// 修改审核人
|
||||
public boolean edit2(Integer id){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
MtInventory mtReturns = new MtInventory();
|
||||
mtReturns.setConfirmer(nowAccountInfo.getStaffId().toString());
|
||||
mtReturns.setId(id);
|
||||
int update = mtInventoryDao.update(mtReturns);
|
||||
return update>0;
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,20 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.mapper.MtPurchaseDetailsMapper;
|
||||
import com.fuint.business.convenienceSore.service.MtPurchaseDetailsService;
|
||||
import com.fuint.business.convenienceSore.vo.MtPurchaseDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTank;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilTankExcel;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -134,4 +139,27 @@ public class MtPurchaseDetailsServiceImpl implements MtPurchaseDetailsService {
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.mtPurchaseDetailsDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
||||
public void export(HttpServletResponse response, MtPurchaseDetails mtPurchaseDetails) {
|
||||
// 需要导出的数据
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtPurchaseDetails.setStoreId(nowAccountInfo.getStoreId());
|
||||
List<MtPurchaseDetailsExcel> listByExcel = mtPurchaseDetailsDao.getListByExcel(mtPurchaseDetails);
|
||||
|
||||
// 设置文件名字
|
||||
// String fileName = System.currentTimeMillis() + ".xlsx";
|
||||
|
||||
// 设置响应头信息
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
|
||||
try{
|
||||
// 写入文件数据
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
EasyExcel.write(response.getOutputStream(), MtPurchaseDetailsExcel.class).sheet("download").doWrite(listByExcel);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ public class MtPurchaseServiceImpl implements MtPurchaseService {
|
||||
int index = 0;
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (MtPurchaseVO mtPurchaseVO : purcaseList) {
|
||||
if (mtPurchaseVO.getSupplierName() == null) continue;
|
||||
if (!stringBuilder.toString().contains(mtPurchaseVO.getSupplierName())) {
|
||||
if (index == 0) {
|
||||
stringBuilder.append(mtPurchaseVO.getSupplierName());
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.convenienceSore.entity.MtPurchaseDetails;
|
||||
import com.fuint.business.convenienceSore.entity.MtReturnsDetails;
|
||||
@ -7,11 +8,14 @@ import com.fuint.business.convenienceSore.mapper.MtReturnsDetailsMapper;
|
||||
import com.fuint.business.convenienceSore.service.MtReturnsDetailsService;
|
||||
import com.fuint.business.convenienceSore.vo.MtPurchaseDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtReturnsDetailsExcel;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -130,4 +134,28 @@ public class MtReturnsDetailsServiceImpl implements MtReturnsDetailsService {
|
||||
public boolean deleteById(Integer purchaseDetailId) {
|
||||
return this.mtReturnsDetailsDao.deleteById(purchaseDetailId) > 0;
|
||||
}
|
||||
|
||||
|
||||
public void export(HttpServletResponse response, MtReturnsDetails mtReturnsDetails) {
|
||||
// 需要导出的数据
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
mtReturnsDetails.setStoreId(nowAccountInfo.getStoreId());
|
||||
List<MtReturnsDetailsExcel> listByExcel = mtReturnsDetailsDao.getListByExcel(mtReturnsDetails);
|
||||
|
||||
// 设置文件名字
|
||||
// String fileName = System.currentTimeMillis() + ".xlsx";
|
||||
|
||||
// 设置响应头信息
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
|
||||
try{
|
||||
// 写入文件数据
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
EasyExcel.write(response.getOutputStream(), MtReturnsDetailsExcel.class).sheet("download").doWrite(listByExcel);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.dto.MtReturnsDto;
|
||||
@ -15,6 +16,7 @@ import com.fuint.business.convenienceSore.vo.MtPurchaseDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtPurchaseVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsDetailsVO;
|
||||
import com.fuint.business.convenienceSore.vo.MtReturnsVO;
|
||||
import com.fuint.business.convenienceSore.vo.excel.MtPurchaseDetailsExcel;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -22,6 +24,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -38,9 +41,6 @@ public class MtReturnsServiceImpl implements MtReturnsService {
|
||||
@Resource
|
||||
private MtReturnsDetailsMapper returnsDetailsMapper;
|
||||
|
||||
@Resource
|
||||
private MtPurchaseMapper mtPurchaseDao;
|
||||
|
||||
@Resource
|
||||
private ILJStaffService iljStaffService;
|
||||
@Resource
|
||||
@ -77,7 +77,7 @@ public class MtReturnsServiceImpl implements MtReturnsService {
|
||||
|
||||
for (MtReturnsVO record : mtPurchaseIPage.getRecords()) {
|
||||
// 根据订单查询所有的供应商信息
|
||||
List<MtPurchaseVO> returnsList = mtPurchaseDao.getPurcaseList(record.getId());
|
||||
List<MtReturnsVO> returnsList = mtReturnsDao.getMtReturnsList(record.getId());
|
||||
record.setSupplierName(assemblyData(returnsList));
|
||||
}
|
||||
|
||||
@ -85,11 +85,12 @@ public class MtReturnsServiceImpl implements MtReturnsService {
|
||||
}
|
||||
|
||||
|
||||
private String assemblyData(List<MtPurchaseVO> returnsList) {
|
||||
private String assemblyData(List<MtReturnsVO> returnsList) {
|
||||
if (returnsList.size()>0) {
|
||||
int index = 0;
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (MtPurchaseVO mtPurchaseVO : returnsList) {
|
||||
for (MtReturnsVO mtPurchaseVO : returnsList) {
|
||||
if (mtPurchaseVO.getSupplierName() == null) continue;
|
||||
if (!stringBuilder.toString().contains(mtPurchaseVO.getSupplierName())) {
|
||||
if (index == 0) {
|
||||
stringBuilder.append(mtPurchaseVO.getSupplierName());
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.fuint.business.convenienceSore.vo.excel;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MtDamageDetailsExcel {
|
||||
@ExcelProperty("商品名称")
|
||||
private String commodityName;
|
||||
@ExcelProperty("分类名称")
|
||||
private String cvsGoodName;
|
||||
@ExcelProperty("供应商")
|
||||
private String supplierName;
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
@ExcelProperty("库存")
|
||||
private String stock;
|
||||
@ExcelProperty("报损数量")
|
||||
private String damageQuantity;
|
||||
@ExcelProperty("当前进价")
|
||||
private String weightedAverageCost;
|
||||
@ExcelProperty("小计金额")
|
||||
private String subtotalAmount;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.fuint.business.convenienceSore.vo.excel;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MtInventoryDetailsExcel {
|
||||
@ExcelProperty("商品名称")
|
||||
private String commodityName;
|
||||
@ExcelProperty("商品编码")
|
||||
private String goodsNo;
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
@ExcelProperty("当前进价")
|
||||
private String purchasePrice;
|
||||
@ExcelProperty("库存")
|
||||
private String stock;
|
||||
@ExcelProperty("盘点数量")
|
||||
private String inventoryQuantity;
|
||||
@ExcelProperty("库存差异")
|
||||
private String inventoryDiscrepancy;
|
||||
@ExcelProperty("盈亏金额")
|
||||
private String profitLossAmount;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.fuint.business.convenienceSore.vo.excel;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class MtPurchaseDetailsExcel {
|
||||
@ExcelProperty("商品名称")
|
||||
private String commodityName;
|
||||
@ExcelProperty("分类名称")
|
||||
private String cvsGoodName;
|
||||
@ExcelProperty("供应商")
|
||||
private String supplierName;
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
@ExcelProperty("库存")
|
||||
private String stock;
|
||||
@ExcelProperty("进货数量")
|
||||
private String quantityPurchased;
|
||||
@ExcelProperty("进货单价")
|
||||
private String unitPrice;
|
||||
@ExcelProperty("小计金额")
|
||||
private String subtotalAmount;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.fuint.business.convenienceSore.vo.excel;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MtReturnsDetailsExcel {
|
||||
@ExcelProperty("商品名称")
|
||||
private String commodityName;
|
||||
@ExcelProperty("分类名称")
|
||||
private String cvsGoodName;
|
||||
@ExcelProperty("供应商")
|
||||
private String supplierName;
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
@ExcelProperty("入库前库存")
|
||||
private String stock;
|
||||
@ExcelProperty("退货数量")
|
||||
private String returnQuantity;
|
||||
@ExcelProperty("退货单价")
|
||||
private String returnPrice;
|
||||
@ExcelProperty("小计金额")
|
||||
private String subtotalAmount;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
# \u57FA\u672C\u914D\u7F6E
|
||||
server.port=8008
|
||||
env.profile=dev
|
||||
env.properties.path=D:/work/ServiceStation/oilSystem/fuintBackend/configure/
|
||||
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
|
||||
|
||||
|
||||
# \u6570\u636E\u5E93\u914D\u7F6E
|
||||
|
@ -30,14 +30,14 @@ public class BaseEntity implements Serializable
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
|
Loading…
Reference in New Issue
Block a user