This commit is contained in:
cun-nan 2024-10-30 11:16:16 +08:00
parent 6298e9249f
commit 1a61e3aef9
8 changed files with 788 additions and 683 deletions

View File

@ -1,12 +1,12 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card > <div class="card-change">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="" prop="orderNumber"> <el-form-item label="" prop="orderNumber">
<el-input v-model="queryParams.orderNumber" placeholder="盘点批次号" /> <el-input v-model="queryParams.orderNumber" placeholder="请输入盘点单号"/>
</el-form-item> </el-form-item>
<el-form-item label="" v-model="queryParams.approvalStatus" prop="status"> <el-form-item label="" v-model="queryParams.approvalStatus" prop="status">
<el-select v-model="queryParams.approvalStatus" placeholder="状态" style="" clearable> <el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="" clearable>
<el-option <el-option
v-for="dict in dict.type.oilPurchasedStatus" v-for="dict in dict.type.oilPurchasedStatus"
:key="dict.value" :key="dict.value"
@ -15,104 +15,103 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="日期选择" prop="status"> <el-form-item label="">
<el-date-picker <el-date-picker
v-model="queryParams.dateRange" v-model="beginTime"
type="datetimerange" style="width: 160px"
range-separator="至" type="date"
start-placeholder="开始日期" placeholder="开始日期">
end-placeholder="结束日期"> </el-date-picker>
</el-date-picker>
</el-form-item> --> <el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card style="margin-top: 20px" >
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus"
@click="detailsAdd" @click="detailsAdd"
v-hasPermi="['convenienceStore:inventory:index']" v-hasPermi="['convenienceStore:inventory:index']"
>新增库存盘点
</el-button>
</el-form-item>
</el-form>
>新增盘点批次</el-button> <div style="height: 70vh;overflow: auto">
</el-col> <el-table ref="tables" border
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> v-loading="loading"
</el-row> :data="inventoryList"
:default-sort="defaultSort">
<el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
<el-table-column label="盘点批次" align="center" prop="orderNumber"></el-table-column>
<el-table-column label="盘点数量" align="center" prop="inventoryQuantity">
<template slot-scope="scope">
<span>{{ scope.row.inventoryQuantity == null ? "-" : scope.row.inventoryQuantity }}</span>
</template>
</el-table-column>
<el-table-column label="库存差异" align="center" prop="inventoryDiscrepancy">
<template slot-scope="scope">
<span>{{ scope.row.inventoryDiscrepancy == null ? "-" : scope.row.inventoryDiscrepancy }}</span>
</template>
</el-table-column>
<el-table-column label="盈亏金额" align="center" prop="profitLossAmount">
<template slot-scope="scope">
<span>{{ scope.row.profitLossAmount == null ? "-" : scope.row.profitLossAmount }}</span>
</template>
</el-table-column>
<el-table ref="tables" <el-table-column label="状态" align="center" prop="status">
v-loading="loading" <template slot-scope="scope">
:data="inventoryList" <div slot="reference" class="name-wrapper">
:default-sort="defaultSort"> <el-tag v-if="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
<el-table-column label="盘点批次" align="center" prop="orderNumber"> <el-tag v-if="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag>
<el-tag v-if="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag>
<el-tag v-if="scope.row.approvalStatus == 'ysh'" type="success" size="medium">已审核</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="制单人" align="center" prop="createByName" width="230px">
<template slot-scope="scope">
<span>{{ scope.row.createByName }}({{ parseTime(scope.row.orderDate) }})</span>
</template>
</el-table-column>
</el-table-column> <!-- <el-table-column label="制单日期" align="center" prop="orderDate" width="200">
<el-table-column label="盘点数量" align="center" prop="inventoryQuantity"> <template slot-scope="scope">
<template slot-scope="scope"> <span>{{ parseTime(scope.row.orderDate) }}</span>
<span>{{scope.row.inventoryQuantity==null?"-":scope.row.inventoryQuantity}}</span> </template>
</template> </el-table-column> -->
</el-table-column> <el-table-column label="审核人" align="center" prop="approverName">
<el-table-column label="库存差异" align="center" prop="inventoryDiscrepancy"> <template slot-scope="scope">
<template slot-scope="scope"> <span>{{ scope.row.approverName == null ? "-" : scope.row.approverName }}</span>
<span>{{scope.row.inventoryDiscrepancy==null?"-":scope.row.inventoryDiscrepancy}}</span> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="确认人" align="center" prop="confirmerName">
<el-table-column label="盈亏金额" align="center" prop="profitLossAmount"> <template slot-scope="scope">
<template slot-scope="scope"> <span>{{ scope.row.confirmerName == null ? "-" : scope.row.confirmerName }}</span>
<span>{{scope.row.profitLossAmount==null?"-":scope.row.profitLossAmount}}</span> </template>
</template> </el-table-column>
</el-table-column>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <el-button
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag> size="mini"
<el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag> type="text"
<el-tag v-if ="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag> icon="el-icon-edit"
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="success" size="medium">已审核</el-tag> @click="dispose(scope.row)"
</div> >处理单据
</template> </el-button>
</el-table-column> </template>
<el-table-column label="制单人" align="center" prop="createByName" width="230px">
<template slot-scope="scope">
<span>{{scope.row.createByName}}({{parseTime(scope.row.orderDate)}})</span>
</template>
</el-table-column>
<!-- <el-table-column label="制单日期" align="center" prop="orderDate" width="200"> </el-table-column>
<template slot-scope="scope"> </el-table>
<span>{{ parseTime(scope.row.orderDate) }}</span> </div>
</template>
</el-table-column> -->
<el-table-column label="审核人" align="center" prop="approverName">
<template slot-scope="scope">
<span>{{scope.row.approverName==null?"-":scope.row.approverName}}</span>
</template>
</el-table-column>
<el-table-column label="确认人" align="center" prop="confirmerName">
<template slot-scope="scope">
<span>{{scope.row.confirmerName==null?"-":scope.row.confirmerName}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="dispose(scope.row)"
>处理单据</el-button>
</template>
</el-table-column>
</el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
@ -121,13 +120,13 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</el-card> </div>
</div> </div>
</template> </template>
<script> <script>
import {getInventoryPageApi,delInventoryApi,addInventoryApi} from "@/api/convenienceStore/inventory"; import {getInventoryPageApi, delInventoryApi, addInventoryApi} from "@/api/convenienceStore/inventory";
import {listSupplier} from "@/api/convenienceStore/supplier"; import {listSupplier} from "@/api/convenienceStore/supplier";
export default { export default {
@ -136,11 +135,11 @@ export default {
data() { data() {
return { return {
inventoryList:[], inventoryList: [],
// //
supplierList:[], supplierList: [],
// //
title:'', title: '',
// //
showSearch: true, showSearch: true,
disableInput: false, // disableInput: false, //
@ -159,12 +158,14 @@ export default {
pageNo: null, pageNo: null,
pageSize: null, pageSize: null,
}, },
beginTime: "",
endTime: "",
// //
inventoryForm: { inventoryForm: {
orderNumber: null, orderNumber: null,
approvalStatus: "", approvalStatus: "",
orderDate: new Date(), orderDate: new Date(),
} , },
// //
loading: false, loading: false,
// //
@ -180,16 +181,21 @@ export default {
methods: { methods: {
// //
getList(){ getList() {
this.loading = true; this.loading = true;
getInventoryPageApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => { let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getInventoryPageApi(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.inventoryList = response.data.records; this.inventoryList = response.data.records;
this.total = response.data.total; this.total = response.data.total;
}) })
this.loading = false; this.loading = false;
}, },
// //
getQueryList(){ getQueryList() {
listSupplier().then(response => { listSupplier().then(response => {
this.supplierList = response.data.records this.supplierList = response.data.records
}) })
@ -227,7 +233,7 @@ export default {
let min = 100; // 1000 let min = 100; // 1000
let max = 999; // 9999 let max = 999; // 9999
let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min; let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
this.inventoryForm.orderNumber = timestamp+randomFourDigitNumber.toString(); this.inventoryForm.orderNumber = timestamp + randomFourDigitNumber.toString();
}, },
// //
@ -270,7 +276,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.app-container{ .app-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f6f8f9; background: #f6f8f9;

View File

@ -1,33 +1,35 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card > <div class="card-change-1-search">
<div slot="header" class="clearfix" style="display: flex; justify-content: space-between;"> <!-- <div slot="header" class="clearfix" style="display: flex; justify-content: space-between;">-->
<div> <!-- <div>-->
<i class="el-icon-back" @click="goToAbout">返回 | </i> <!-- <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>-->
</div>
<div class="" style="height: 90px; display: flex; justify-content: space-between;"> <div class="" style="height: 90px; display: flex; justify-content: space-between;">
<div style="height: 100%; display: flex; justify-content: space-between;"> <div style="height: 100%; display: flex; justify-content: space-between;">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;font-family: YouSheBiaoTiHei"> <div style="height: 100%; width: 70%; display: flex; justify-content: space-between;align-items: center">
<div class="box"> <div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{purchaseForm.totalAmount}}</span> <span style="font-size: 26px;color: #0DC291;font-weight: bold">{{ purchaseForm.totalAmount }}</span>
<span style="display: flex"> <span style="display: flex">
<div style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div> <div
总金额</span> style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
总金额
</span>
</div> </div>
<div class="box"> <div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{purchaseForm.productQuantity}}</span> <span style="font-size: 26px;color: #00CAFF;font-weight: bold">{{ purchaseForm.productQuantity }}</span>
<span style="display: flex"> <span style="display: flex">
<div style="background-color: #3B6ADE;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div> <div
style="background-color: #00CAFF;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
商品数量</span> 商品数量</span>
</div> </div>
<div class="box"> <div class="box">
<span style="font-size: 26px;color: #FF4347;font-weight: bold">{{purchaseForm.quantityPurchased}}</span> <span style="font-size: 26px;color: #F44522;font-weight: bold">{{ purchaseForm.quantityPurchased }}</span>
<span style="display: flex"> <span style="display: flex">
<div style="background-color: #FF4347;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div> <div
style="background-color: #F44522;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
进货数量</span> 进货数量</span>
</div> </div>
</div> </div>
@ -35,14 +37,14 @@
<el-form ref="myForm" label-width="100px"> <el-form ref="myForm" label-width="100px">
<el-form-item label="进货单号"> <el-form-item label="进货单号">
<el-input v-model="purchaseForm.orderNumber" <el-input v-model="purchaseForm.orderNumber"
style="width: 220Px" :disabled="numberInput"> style="width: 220Px" :disabled="numberInput">
<el-button v-if="!numberInput" 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-input>
</el-form-item> </el-form-item>
<el-form-item label="进货时间" > <el-form-item label="进货时间">
<el-date-picker <el-date-picker
:disabled="numberInput" :disabled="numberInput"
style="width: 220Px" style="width: 220Px"
v-model="purchaseForm.orderDate" v-model="purchaseForm.orderDate"
type="date" type="date"
@ -53,81 +55,94 @@
</div> </div>
</div> </div>
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;"> <div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button> <el-button type="primary" @click="cancelPurchase" v-if="state=='qrts'">关闭</el-button>
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button> <el-button @click="cancelPurchase" v-else>取消</el-button>
<el-button type="success" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库</el-button> <el-button type="success" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="warning" v-if="state =='!await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button> <el-button type="primary" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button> <el-button type="danger" v-if="state=='ysh'" :disabled="voidFlag" @click="abolition()">
作废
</el-button>
<el-button type="primary" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库
</el-button>
<!-- <el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>-->
</div> </div>
</div> </div>
</el-card> </div>
<el-card style="margin-top: 20px" > <div class="card-change-1-1">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5" style="text-align: right; float: right"> <el-col :span="1.5" style="text-align: right; float: right">
<el-button <el-button
v-if="!numberInput" v-if="!numberInput"
type="primary" type="primary"
icon="el-icon-plus"
@click="commodityAdd" @click="commodityAdd"
>添加进货</el-button> >添加采购商品
</el-button>
</el-col> </el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row> </el-row>
<el-table ref="tables" <div style="height: 68vh;overflow: auto">
v-loading="loading" <el-table ref="tables" border
:data="detailsList" v-loading="loading"
:default-sort="defaultSort"> :data="detailsList"
:default-sort="defaultSort">
<el-table-column label="商品名称" align="center" prop="commodityName"/> <el-table-column label="商品名称" align="center" prop="commodityName"/>
<el-table-column label="分类名称" prop="cvsGoodId" align="center"> <el-table-column label="分类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span> <span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="供应商" prop="supplierId" align="center"> <el-table-column label="供应商" prop="supplierId" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span> <span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位" align="center" prop="unit"> <el-table-column label="单位" align="center" prop="unit">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.unit == null?"-":scope.row.unit}}</span> <span>{{ scope.row.unit == null ? "-" : scope.row.unit }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="当前库存" align="center" prop="stock"/> <el-table-column label="当前库存" align="center" prop="stock"/>
<el-table-column label="进货数量" align="center" prop="quantityPurchased"> <el-table-column label="进货数量" align="center" prop="quantityPurchased">
<template slot-scope="scope"> <template slot-scope="scope">
<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> <el-input-number :disabled="numberInput" v-model="scope.row.quantityPurchased"
</template> @change="change(scope.row,1)"
</el-table-column> :precision="0" controls-position="right" :min="1" :max="100000000" :step="1"
<el-table-column label="进货单价" align="center" prop="unitPrice"> style="max-width: 100%"></el-input-number>
<template slot-scope="scope"> </template>
<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> </el-table-column>
</template> <el-table-column label="进货单价" align="center" prop="unitPrice">
</el-table-column> <template slot-scope="scope">
<el-table-column label="小计金额" align="center" prop="subtotalAmount"> <el-input-number :disabled="numberInput" v-model="scope.row.unitPrice" @change="change(scope.row,2)"
<template slot-scope="scope"> :precision="2" controls-position="right" :min="0" :max="100000000" :step="1"
<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> style="max-width: 100%"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="小计金额" align="center" prop="subtotalAmount">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-input-number :disabled="numberInput" v-model="scope.row.subtotalAmount" @change="change(scope.row,3)"
size="mini" :precision="2" controls-position="right" :min="0" :max="100000000" :step="1"
type="text" style="max-width: 100%"></el-input-number>
icon="el-icon-edit" </template>
@click="commodityDel(scope.row)" </el-table-column>
>删除</el-button> <el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
</template> <template slot-scope="scope">
<!-- v-hasPermi="['']"--> <el-button
size="mini"
</el-table-column> type="text"
</el-table> icon="el-icon-edit"
@click="commodityDel(scope.row)"
>删除
</el-button>
</template>
<!-- v-hasPermi="['']"-->
</el-table-column>
</el-table>
</div>
<!-- <pagination--> <!-- <pagination-->
<!-- v-show="total>0"--> <!-- v-show="total>0"-->
<!-- :total="total"--> <!-- :total="total"-->
@ -135,45 +150,37 @@
<!-- :limit.sync="queryParams.pageSize"--> <!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"--> <!-- @pagination="getList"-->
<!-- />--> <!-- />-->
</el-card> </div>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
<el-container> <el-container>
<el-header style=""> <el-header style="">
<el-form ref="tankForm" :model="commodityForm" label-width="80px"> <el-form ref="tankForm" :model="commodityForm" label-width="20px" :inline="true">
<el-row :gutter="24"> <el-form-item label="">
<el-col :span="6"> <el-select
<el-form-item label="商品分类"> v-model="commodityForm.cvsGoodId"
<el-select placeholder="请选择商品分类"
v-model="commodityForm.cvsGoodId" clearable
placeholder="全部" >
clearable <el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
> </el-select>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/> </el-form-item>
</el-select> <el-form-item label="" prop="supplierId">
</el-form-item> <el-select
</el-col> v-model="commodityForm.supplierId"
<el-col :span="6"> placeholder="请选择供应商名称"
<el-form-item label="供应商" prop="supplierId"> clearable
<el-select >
v-model="commodityForm.supplierId" <el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
placeholder="全部" </el-select>
clearable </el-form-item>
> <el-form-item label="">
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/> <el-input v-model="commodityForm.remark" placeholder="请输入商品名称,拼音码,条形码等"></el-input>
</el-select> </el-form-item>
</el-form-item> <el-form-item style="float: right;margin-right: 0px">
</el-col> <el-button type="primary" icon="el-icon-search" @click="inquire()">搜索</el-button>
<el-col :span="8"> </el-form-item>
<el-form-item label="详细信息">
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" @click="inquire()">查询</el-button>
</el-col>
</el-row>
</el-form> </el-form>
</el-header> </el-header>
<el-main> <el-main>
@ -183,14 +190,10 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border border
:default-sort="defaultSort"> :default-sort="defaultSort">
<el-table-column <el-table-column type="selection" align="center" width="55"></el-table-column>
type="selection"
width="55">
</el-table-column>
<el-table-column label="商品名称" align="center" prop="name"/> <el-table-column label="商品名称" align="center" prop="name"/>
<el-table-column label="商品编码" align="center" prop="goodsNo"/> <!-- <el-table-column label="商品编码" align="center" prop="goodsNo"/>-->
<el-table-column label="类名称" prop="cvsGoodId" align="center"> <el-table-column label="品类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span> <span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template> </template>
@ -201,21 +204,26 @@
<span>{{ getName(supplierList, scope.row.supplierId) }}</span> <span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位" align="center" prop="unit"/> <el-table-column label="商品规格" align="center" prop="goodsSpecs">
<template slot-scope="scope">
<div>{{scope.row.goodsSpecs || '-'}}</div>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="当前库存" align="center" prop="stock"/> <el-table-column label="当前库存" align="center" prop="stock"/>
</el-table> </el-table>
<!-- <pagination <!-- <pagination
v-show="commodityForm.total>0" v-show="commodityForm.total>0"
:total="commodityForm.total" :total="commodityForm.total"
:page.sync="commodityForm.page" :page.sync="commodityForm.page"
:limit.sync="commodityForm.pageSize" :limit.sync="commodityForm.pageSize"
@pagination="getCommodityList" @pagination="getCommodityList"
/> --> /> -->
</el-main> </el-main>
</el-container> </el-container>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="addCommodity"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
<el-button type="primary" @click="addCommodity"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -228,7 +236,7 @@ import {getAuditPremApi} from "@/api/oilConfig/staff";
import {BigNumber} from "bignumber.js"; import {BigNumber} from "bignumber.js";
import {listLJGoods} from "@/api/convenienceStore/ljgoods"; import {listLJGoods} from "@/api/convenienceStore/ljgoods";
import {getName,parseTime} from "../../../utils/fuint"; import {getName, parseTime} from "../../../utils/fuint";
import {selectParentById, selectTree} from "@/api/convenienceStore/goods"; import {selectParentById, selectTree} from "@/api/convenienceStore/goods";
import {listSupplier} from "@/api/convenienceStore/supplier"; import {listSupplier} from "@/api/convenienceStore/supplier";
import { import {
@ -246,7 +254,7 @@ import {
export default { export default {
name: "details", name: "details",
props:[ props: [
'PpurchaseId', 'PpurchaseId',
'PorderNumber', 'PorderNumber',
'PorderDate', 'PorderDate',
@ -256,8 +264,8 @@ export default {
return { return {
detailsList: [], detailsList: [],
commodityList: [], commodityList: [],
purchaseId:null, purchaseId: null,
commodityForm:{ commodityForm: {
cvsGoodId: "", cvsGoodId: "",
cvsGood: "", cvsGood: "",
supplierId: "", supplierId: "",
@ -267,7 +275,7 @@ export default {
page: 1, page: 1,
pageSize: 1000, pageSize: 1000,
total: 0, total: 0,
isRecovery:0, isRecovery: 0,
}, },
purchaseForm: { purchaseForm: {
orderNumber: null, orderNumber: null,
@ -276,24 +284,24 @@ export default {
totalAmount: 0, // totalAmount: 0, //
productQuantity: 0, // productQuantity: 0, //
quantityPurchased: 0 // quantityPurchased: 0 //
} , },
// //
cvsGoodList:[], cvsGoodList: [],
// //
supplierList:[], supplierList: [],
numberInput: false,
state: 'await',
state:'await', saveFlag: false,
auditFlag: false,
saveFlag:false, voidFlag: false,
auditFlag:false, storageFlag: false,
voidFlag:false, multipleSelection: [], //
storageFlag:false,
multipleSelection:[], //
// //
title:'选择商品', title: '添加采购商品',
// //
showSearch: true, showSearch: true,
disableInput: false, // disableInput: false, //
@ -306,8 +314,8 @@ export default {
queryParams: { queryParams: {
// supplierId: '', // supplierId: '',
purchaseId: null, purchaseId: null,
page:1, page: 1,
pageSize:10000 pageSize: 10000
}, },
// //
loading: false, loading: false,
@ -316,7 +324,7 @@ export default {
// //
rules: { rules: {
supplierName: [ supplierName: [
{ required: true, message: "供应商名称不能为空", trigger: "blur" }, {required: true, message: "供应商名称不能为空", trigger: "blur"},
], ],
}, },
} }
@ -331,24 +339,24 @@ export default {
this.purchaseForm.approvalStatus = this.$props.PapprovalStatus this.purchaseForm.approvalStatus = this.$props.PapprovalStatus
this.state = this.$props.PapprovalStatus this.state = this.$props.PapprovalStatus
console.log("this.purchaseForm",this.purchaseForm) console.log("this.purchaseForm", this.purchaseForm)
if ( this.state == null) { if (this.state == null) {
this.state = 'await' this.state = 'await'
} }
if (this.state=='await') { if (this.state == 'await') {
this.numberInput = false this.numberInput = false
}else { } else {
this.numberInput = true this.numberInput = true
} }
console.log(this.state, 357)
if (this.purchaseForm.orderNumber == null) { if (this.purchaseForm.orderNumber == null) {
this.refresh(); this.refresh();
} }
if (this.purchaseForm.orderDate == null) { if (this.purchaseForm.orderDate == null) {
this.purchaseForm.orderDate =new Date() this.purchaseForm.orderDate = new Date()
} }
this.getDetailsList(); this.getDetailsList();
@ -357,9 +365,13 @@ export default {
}, },
methods: { methods: {
//
cancelPurchase() {
this.$router.back()
},
getDetailsList() { getDetailsList() {
let this_ = this let this_ = this
getPurchaseDetailsPageApi(this.queryParams).then(res=>{ getPurchaseDetailsPageApi(this.queryParams).then(res => {
this_.detailsList = res.data.records; this_.detailsList = res.data.records;
this.total = res.data.total; this.total = res.data.total;
this.sumMethod(res.data.records); this.sumMethod(res.data.records);
@ -367,7 +379,7 @@ export default {
}, },
getCommodityList() { getCommodityList() {
let this_ = this let this_ = this
listLJGoods(this_.commodityForm).then(res=>{ listLJGoods(this_.commodityForm).then(res => {
this_.commodityList = res.data.records; this_.commodityList = res.data.records;
this.commodityForm.total = res.data.total; this.commodityForm.total = res.data.total;
// this_.sumMethod(res.data.records); // this_.sumMethod(res.data.records);
@ -384,32 +396,31 @@ export default {
this.$confirm('确定删除?', '提示', { this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (data.id != null) { if (data.id != null) {
delDetailsApi(data).then(res=>{ delDetailsApi(data).then(res => {
}) })
} }
const index = this.detailsList.indexOf(data); // const index = this.detailsList.indexOf(data); //
if (index !== -1) { if (index !== -1) {
this.detailsList.splice(index, 1); // 使splice this.detailsList.splice(index, 1); // 使splice
} }
this.sumMethod(this.detailsList); this.sumMethod(this.detailsList);
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
}); });
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}, },
@ -419,10 +430,10 @@ export default {
}, },
// //
change(data,flag) { change(data, flag) {
let quantityPurchased = new BigNumber( data.quantityPurchased); let quantityPurchased = new BigNumber(data.quantityPurchased);
let unitPrice = new BigNumber( data.unitPrice); let unitPrice = new BigNumber(data.unitPrice);
let subtotalAmount = new BigNumber(data.subtotalAmount); let subtotalAmount = new BigNumber(data.subtotalAmount);
if (flag == 1) { if (flag == 1) {
@ -438,7 +449,7 @@ export default {
} }
this.sumMethod(this.detailsList); this.sumMethod(this.detailsList);
console.log("this.detailsList",this.detailsList) console.log("this.detailsList", this.detailsList)
// //
// this.detailsList = data // this.detailsList = data
// this.edit() // this.edit()
@ -450,50 +461,50 @@ export default {
this_.purchaseForm.totalAmount = data.length this_.purchaseForm.totalAmount = data.length
this_.purchaseForm.productQuantity = data.length, this_.purchaseForm.productQuantity = data.length,
this_.purchaseForm.totalAmount = new BigNumber(0), this_.purchaseForm.totalAmount = new BigNumber(0),
this_.purchaseForm.quantityPurchased = new BigNumber(0), this_.purchaseForm.quantityPurchased = new BigNumber(0),
data.forEach(da => { data.forEach(da => {
if (da.unitPrice != null) { if (da.unitPrice != null) {
this_.purchaseForm.quantityPurchased= this_.purchaseForm.quantityPurchased.plus(da.quantityPurchased) this_.purchaseForm.quantityPurchased = this_.purchaseForm.quantityPurchased.plus(da.quantityPurchased)
} }
if (da.subtotalAmount != null) { if (da.subtotalAmount != null) {
this_.purchaseForm.totalAmount= this_.purchaseForm.totalAmount.plus(da.subtotalAmount) this_.purchaseForm.totalAmount = this_.purchaseForm.totalAmount.plus(da.subtotalAmount)
} }
}) })
}, },
addCommodity () { addCommodity() {
let this_ = this let this_ = this
let sum = 0; let sum = 0;
this.multipleSelection.forEach(mul=>{ this.multipleSelection.forEach(mul => {
let flag = true; let flag = true;
this_.detailsList.forEach(det=>{ this_.detailsList.forEach(det => {
if (mul.id == det.goodsId) { if (mul.id == det.goodsId) {
flag = false flag = false
sum++ sum++
} }
}) })
if(flag) { if (flag) {
let now = { let now = {
goodsId: mul.id, goodsId: mul.id,
commodityName: mul.name, commodityName: mul.name,
supplierId: mul.supplierId, supplierId: mul.supplierId,
cvsGoodId: mul.cvsGoodId, cvsGoodId: mul.cvsGoodId,
unit:mul.unit, unit: mul.unit,
stock:mul.stock, stock: mul.stock,
quantityPurchased: 1, quantityPurchased: 1,
unitPrice: 0, unitPrice: 0,
subtotalAmount: 0 subtotalAmount: 0
} }
this_.detailsList.push(now) this_.detailsList.push(now)
} }
}) })
if(sum>0) { if (sum > 0) {
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除"); this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了" + sum + "件相同的商品,已为您剔除");
} }
this_.open = false this_.open = false
this.multipleSelection = [] this.multipleSelection = []
@ -507,7 +518,7 @@ export default {
page: 1, page: 1,
pageSize: 1000, pageSize: 1000,
total: 0, total: 0,
isRecovery:0, isRecovery: 0,
} }
this.commodityList = [] this.commodityList = []
@ -515,7 +526,7 @@ export default {
}, },
// //
getQueryList(){ getQueryList() {
selectTree().then(response => { selectTree().then(response => {
this.cvsGoodList = response.data.records this.cvsGoodList = response.data.records
}); });
@ -536,41 +547,40 @@ export default {
let min = 100; // 100 let min = 100; // 100
let max = 999; // 999 let max = 999; // 999
let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min; let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
this.purchaseForm.orderNumber = timestamp+randomFourDigitNumber.toString(); this.purchaseForm.orderNumber = timestamp + randomFourDigitNumber.toString();
}, },
// //
async JudgmentButton(){ async JudgmentButton() {
let judgmentPermissions1 = await this.judgmentPermissions("进货审核"); let judgmentPermissions1 = await this.judgmentPermissions("进货审核");
if (judgmentPermissions1 > 0){ if (judgmentPermissions1 > 0) {
this.auditFlag=false this.auditFlag = false
// this.voidFlag=false // this.voidFlag=false
} else { } else {
this.auditFlag=true this.auditFlag = true
} }
let judgmentPermissions2 = await this.judgmentPermissions("进货入库"); let judgmentPermissions2 = await this.judgmentPermissions("进货入库");
console.log("judgmentPermissions2",judgmentPermissions2) console.log("judgmentPermissions2", judgmentPermissions2)
if (judgmentPermissions2 > 0){ if (judgmentPermissions2 > 0) {
this.storageFlag = false this.storageFlag = false
}else { } else {
this.storageFlag = true this.storageFlag = true
} }
let judgmentPermissions3 = await this.judgmentPermissions("进货废止"); let judgmentPermissions3 = await this.judgmentPermissions("进货废止");
if (judgmentPermissions3 > 0){ if (judgmentPermissions3 > 0) {
this.voidFlag=false this.voidFlag = false
}else { } else {
this.voidFlag=true this.voidFlag = true
} }
}, },
// //
async judgmentPermissions(data) { async judgmentPermissions(data) {
let fil ={ let fil = {
auditPrem:data auditPrem: data
} }
return await getAuditPremApi(fil).then(res => { return await getAuditPremApi(fil).then(res => {
return res.data return res.data
@ -578,86 +588,83 @@ export default {
}, },
async save(flag) {
async save(flag){
let this_ = this let this_ = this
let con = true let con = true
// //
if (this_.purchaseForm.orderNumber == null) { if (this_.purchaseForm.orderNumber == null) {
this.$modal.msgError("进货单号不能为空"); this.$modal.msgError("进货单号不能为空");
return -1; return -1;
}else if (this_.purchaseForm.orderDate == null) { } else if (this_.purchaseForm.orderDate == null) {
this.$modal.msgError("进货时间不能为空"); this.$modal.msgError("进货时间不能为空");
return -1; return -1;
}else if(this_.detailsList.length<=0) { } else if (this_.detailsList.length <= 0) {
this.$modal.msgError("进货单不能为空"); this.$modal.msgError("进货单不能为空");
return -1; return -1;
} }
if (this_.purchaseId == null) { if (this_.purchaseId == null) {
// //
await addPurchaseApi(this_.purchaseForm).then(res=>{ await addPurchaseApi(this_.purchaseForm).then(res => {
if (res.code === 200) { if (res.code === 200) {
this_.purchaseId = res.data.id this_.purchaseId = res.data.id
this.queryParams.purchaseId = res.data.id this.queryParams.purchaseId = res.data.id
}else { } else {
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con=false con = false
return -1; return -1;
} }
}).catch(res=>{ }).catch(res => {
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con=false con = false
return -1; return -1;
}) })
}else { } else {
// //
this_.purchaseForm.id = this_.purchaseId this_.purchaseForm.id = this_.purchaseId
this.queryParams.purchaseId = this_.purchaseId this.queryParams.purchaseId = this_.purchaseId
await editPurchaseApi(this_.purchaseForm).then(res=> { await editPurchaseApi(this_.purchaseForm).then(res => {
if (res.code !== 200){ if (res.code !== 200) {
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con=false con = false
return -1; return -1;
} }
}).catch(res=>{ }).catch(res => {
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con=false con = false
return -1; return -1;
}) })
} }
if (con) { if (con) {
// //
this_.detailsList.forEach(data=>{ this_.detailsList.forEach(data => {
data.purchaseId = this_.purchaseId data.purchaseId = this_.purchaseId
}) })
await batchProcessingApi(this_.detailsList).then(res=>{ await batchProcessingApi(this_.detailsList).then(res => {
this.$modal.msgSuccess("保存成功"); this.$modal.msgSuccess("保存成功");
if (flag == -1) { if (flag == -1) {
this.goToAbout(); this.goToAbout();
} }
}).catch(res=>{ }).catch(res => {
// this.$modal.msgError(""); // this.$modal.msgError("");
}) })
} }
}, },
// //
async audit(){ async audit() {
// //
let number = await this.save(-1); let number = await this.save(-1);
if (number != -1) { if (number != -1) {
// //
let fil ={ let fil = {
id: this.purchaseId id: this.purchaseId
} }
console.log(" id: this.purchaseId1",fil) console.log(" id: this.purchaseId1", fil)
await auditPurchaseApi(fil).then(res => { await auditPurchaseApi(fil).then(res => {
if (res.data) { if (res.data) {
@ -679,10 +686,10 @@ export default {
if (this_.purchaseForm.orderNumber == null) { if (this_.purchaseForm.orderNumber == null) {
this.$modal.msgError("进货单号不能为空"); this.$modal.msgError("进货单号不能为空");
return -1; return -1;
}else if (this_.purchaseForm.orderDate == null) { } else if (this_.purchaseForm.orderDate == null) {
this.$modal.msgError("进货时间不能为空"); this.$modal.msgError("进货时间不能为空");
return -1; return -1;
}else if(this_.detailsList.length<=0) { } else if (this_.detailsList.length <= 0) {
this.$modal.msgError("进货单不能为空"); this.$modal.msgError("进货单不能为空");
return -1; return -1;
} }
@ -693,10 +700,10 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// //
let fil ={ let fil = {
id: this.purchaseId id: this.purchaseId
} }
console.log("fil",fil) console.log("fil", fil)
storagePurchaseApi(fil).then(res => { storagePurchaseApi(fil).then(res => {
this.state = 'qrts' this.state = 'qrts'
this.$modal.msgWarning("入库成功"); this.$modal.msgWarning("入库成功");
@ -710,7 +717,7 @@ export default {
}); });
}, },
// //
abolition(){ abolition() {
if (this.PurchaseId < 0) { if (this.PurchaseId < 0) {
this.$modal.msgWarning("数据未保存,不可废弃"); this.$modal.msgWarning("数据未保存,不可废弃");
return; return;
@ -720,7 +727,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let fil ={ let fil = {
id: this.purchaseId id: this.purchaseId
} }
abolitionPurchaseApi(fil).then(res => { abolitionPurchaseApi(fil).then(res => {
@ -740,19 +747,19 @@ export default {
}) })
}, },
// //
async exportExcel() { async exportExcel() {
let fil ={ let fil = {
purchaseId: this.purchaseId purchaseId: this.purchaseId
} }
exportExcelApi(fil).then(res=>{ exportExcelApi(fil).then(res => {
console.log("res",res) console.log("res", res)
// this.downloadFile(res); // this.downloadFile(res);
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
this.$download.saveAs(blob,'库存统计.xLsx') this.$download.saveAs(blob, '库存统计.xLsx')
}) })
}, },
@ -775,19 +782,18 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.app-container{ .app-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f6f8f9; background: #f6f8f9;
} }
.box { .box {
height: 100%; height: 80%;
width: 212px; width: 212px;
margin-right: 10px; margin-right: 10px;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10px 10px 10px 10px; border: 1px solid #FF9655;
border: 1px solid #EEEEEE;
border-radius: 10px; border-radius: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -1,30 +1,32 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card > <div class="card-change-1-search">
<div slot="header" class="clearfix"> <!-- <div slot="header" class="clearfix">-->
<i class="el-icon-back" @click="goToAbout">返回 | </i> <!-- <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 class="" style="height: 90px; display: flex; justify-content: space-between;"> <div class="" style="height: 90px; display: flex; justify-content: space-between;">
<div style="height: 100%; display: flex; justify-content: space-between;"> <div style="height: 100%; display: flex; justify-content: space-between;">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;font-family: YouSheBiaoTiHei"> <div style="height: 100%; width: 70%; display: flex; justify-content: space-between;align-items: center">
<div class="box"> <div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{returnsForm.totalAmount}}</span> <span style="font-size: 26px;color: #0DC291;font-weight: bold">{{ returnsForm.totalAmount }}</span>
<span style="display: flex"> <span style="display: flex">
<div style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div> <div
style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
总金额</span> 总金额</span>
</div> </div>
<div class="box"> <div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{returnsForm.productQuantity}}</span> <span style="font-size: 26px;color: #00CAFF;font-weight: bold">{{ returnsForm.productQuantity }}</span>
<span style="display: flex"> <span style="display: flex">
<div style="background-color: #3B6ADE;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div> <div
style="background-color: #00CAFF;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
商品数量</span> 商品数量</span>
</div> </div>
<div class="box"> <div class="box">
<span style="font-size: 26px;color: #FF4347;font-weight: bold">{{returnsForm.returnQuantity}}</span> <span style="font-size: 26px;color: #F44522;font-weight: bold">{{ returnsForm.returnQuantity }}</span>
<span style="display: flex"> <span style="display: flex">
<div style="background-color: #FF4347;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div> <div
style="background-color: #F44522;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
退货数量</span> 退货数量</span>
</div> </div>
</div> </div>
@ -32,15 +34,15 @@
<el-form ref="myForm" label-width="100px"> <el-form ref="myForm" label-width="100px">
<el-form-item label="退货单号"> <el-form-item label="退货单号">
<el-input v-model="returnsForm.orderNumber" <el-input v-model="returnsForm.orderNumber"
:disabled="numberInput" :disabled="numberInput"
style="width: 220Px"> style="width: 220Px">
<el-button v-if="!numberInput" 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-input>
</el-form-item> </el-form-item>
<el-form-item label="退货时间" > <el-form-item label="退货时间">
<el-date-picker <el-date-picker
:disabled="numberInput" :disabled="numberInput"
style="width: 220Px" style="width: 220Px"
v-model="returnsForm.orderDate" v-model="returnsForm.orderDate"
type="date" type="date"
@ -51,82 +53,96 @@
</div> </div>
</div> </div>
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;"> <div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button> <el-button type="primary" @click="cancelPurchase" v-if="state=='qrts'">关闭</el-button>
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button> <el-button @click="cancelPurchase" v-else>取消</el-button>
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button> <el-button type="success" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button> <el-button type="primary" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button>
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button> <el-button type="danger" v-if="state=='ysh'" :disabled="voidFlag" @click="abolition()">
作废
</el-button>
<el-button type="primary" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存
</el-button>
<!-- <el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>-->
</div> </div>
</div> </div>
</el-card> </div>
<el-card style="margin-top: 20px" > <div class="card-change-1-1">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5" style="text-align: right; float: right"> <el-col :span="1.5" style="text-align: right; float: right">
<el-button <el-button
v-if="!numberInput" v-if="!numberInput"
type="primary" type="primary"
icon="el-icon-plus"
@click="commodityAdd" @click="commodityAdd"
>添加退货</el-button> >添加退货商品
</el-button>
</el-col> </el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row> </el-row>
<el-table ref="tables" <div style="height: 68vh;overflow: auto">
v-loading="loading" <el-table ref="tables" border
:data="detailsList" v-loading="loading"
:default-sort="defaultSort"> :data="detailsList"
:default-sort="defaultSort">
<el-table-column label="商品名称" align="center" prop="commodityName"/> <el-table-column label="商品名称" align="center" prop="commodityName"/>
<el-table-column label="分类名称" prop="cvsGoodId" align="center"> <el-table-column label="分类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span> <span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="供应商" prop="supplierId" align="center"> <el-table-column label="供应商" prop="supplierId" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span> <span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位" align="center" prop="unit"> <el-table-column label="单位" align="center" prop="unit">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.unit == null?"-":scope.row.unit}}</span> <span>{{ scope.row.unit == null ? "-" : scope.row.unit }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="入库前库存" align="center" prop="preInboundInventory"/> <el-table-column label="入库前库存" align="center" prop="preInboundInventory"/>
<el-table-column label="退货数量" align="center" prop="returnQuantity"> <el-table-column label="退货数量" align="center" prop="returnQuantity">
<template slot-scope="scope"> <template slot-scope="scope">
<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> <el-input-number :disabled="numberInput" v-model="scope.row.returnQuantity" @change="change(scope.row,1)"
</template> :precision="0" controls-position="right" :min="1" :max="100000000" :step="1"
</el-table-column> style="max-width: 100%"></el-input-number>
<el-table-column label="退货单价" align="center" prop="returnPrice"> </template>
<template slot-scope="scope"> </el-table-column>
<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> <el-table-column label="退货单价" align="center" prop="returnPrice">
</template> <template slot-scope="scope">
</el-table-column> <el-input-number :disabled="numberInput" v-model="scope.row.returnPrice" @change="change(scope.row,2)"
<el-table-column label="小计金额" align="center" prop="subtotalAmount"> :precision="2" controls-position="right" :min="0" :max="100000000" :step="1"
<template slot-scope="scope"> 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>
</template> </el-table-column>
</el-table-column> <el-table-column label="小计金额" align="center" prop="subtotalAmount">
<el-table-column v-if="!numberInput" label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope">
<template slot-scope="scope"> <el-input-number :disabled="numberInput" v-model="scope.row.subtotalAmount" @change="change(scope.row,3)"
<el-button :precision="2" controls-position="right" :min="0" :max="100000000" :step="1"
size="mini" style="max-width: 100%"></el-input-number>
type="text" </template>
icon="el-icon-edit" </el-table-column>
@click="commodityDel(scope.row)" <el-table-column v-if="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
>删除</el-button> <template slot-scope="scope">
</template> <el-button
<!-- v-hasPermi="['']"--> size="mini"
type="text"
icon="el-icon-edit"
@click="commodityDel(scope.row)"
>删除
</el-button>
</template>
<!-- v-hasPermi="['']"-->
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
<!-- <pagination--> <!-- <pagination-->
<!-- v-show="total>0"--> <!-- v-show="total>0"-->
@ -135,45 +151,37 @@
<!-- :limit.sync="queryParams.pageSize"--> <!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"--> <!-- @pagination="getList"-->
<!-- />--> <!-- />-->
</el-card> </div>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
<el-container> <el-container>
<el-header style=""> <el-header style="">
<el-form ref="tankForm" :model="commodityForm" label-width="80px"> <el-form ref="tankForm" :model="commodityForm" label-width="20px" :inline="true">
<el-row :gutter="24"> <el-form-item label="">
<el-col :span="6"> <el-select
<el-form-item label="商品分类"> v-model="commodityForm.cvsGoodId"
<el-select placeholder="请选择商品分类"
v-model="commodityForm.cvsGoodId" clearable
placeholder="全部" >
clearable <el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
> </el-select>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/> </el-form-item>
</el-select> <el-form-item label="" prop="supplierId">
</el-form-item> <el-select
</el-col> v-model="commodityForm.supplierId"
<el-col :span="6"> placeholder="请选择供应商名称"
<el-form-item label="供应商" prop="supplierId"> clearable
<el-select >
v-model="commodityForm.supplierId" <el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
placeholder="全部" </el-select>
clearable </el-form-item>
> <el-form-item label="">
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/> <el-input v-model="commodityForm.remark" placeholder="请输入商品名称,拼音码,条形码等信息"></el-input>
</el-select> </el-form-item>
</el-form-item> <el-form-item label="" style="float: right;margin-right: 0px">
</el-col> <el-button type="primary" icon="el-icon-search" @click="inquire()">搜索</el-button>
<el-col :span="8"> </el-form-item>
<el-form-item label="详细信息">
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" @click="inquire()">查询</el-button>
</el-col>
</el-row>
</el-form> </el-form>
</el-header> </el-header>
<el-main> <el-main>
@ -183,14 +191,11 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border border
:default-sort="defaultSort"> :default-sort="defaultSort">
<el-table-column <el-table-column align="center" type="selection" width="55"></el-table-column>
type="selection"
width="55">
</el-table-column>
<el-table-column label="商品名称" align="center" prop="name"/> <el-table-column label="商品名称" align="center" prop="name"/>
<el-table-column label="商品编码" align="center" prop="goodsNo"/> <!-- <el-table-column label="商品编码" align="center" prop="goodsNo"/>-->
<el-table-column label="类名称" prop="cvsGoodId" align="center"> <el-table-column label="类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span> <span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template> </template>
@ -201,14 +206,19 @@
<span>{{ getName(supplierList, scope.row.supplierId) }}</span> <span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位" align="center" prop="unit"/> <el-table-column label="商品规格" align="center" prop="goodsSpecs">
<template slot-scope="scope">
<div>{{ scope.row.goodsSpecs || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="当前库存" align="center" prop="stock"/> <el-table-column label="当前库存" align="center" prop="stock"/>
</el-table> </el-table>
</el-main> </el-main>
</el-container> </el-container>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="addCommodity"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
<el-button type="primary" @click="addCommodity"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -219,7 +229,7 @@
import {getAuditPremApi} from "@/api/oilConfig/staff"; import {getAuditPremApi} from "@/api/oilConfig/staff";
import {BigNumber} from "bignumber.js"; import {BigNumber} from "bignumber.js";
import {listLJGoods} from "@/api/convenienceStore/ljgoods"; import {listLJGoods} from "@/api/convenienceStore/ljgoods";
import {getName,parseTime} from "../../../utils/fuint"; import {getName, parseTime} from "../../../utils/fuint";
import {selectParentById, selectTree} from "@/api/convenienceStore/goods"; import {selectParentById, selectTree} from "@/api/convenienceStore/goods";
import {listSupplier} from "@/api/convenienceStore/supplier"; import {listSupplier} from "@/api/convenienceStore/supplier";
import { import {
@ -237,7 +247,7 @@ import {
export default { export default {
name: "details", name: "details",
props:[ props: [
'PreturnsId', 'PreturnsId',
'PorderNumber', 'PorderNumber',
'PorderDate', 'PorderDate',
@ -247,8 +257,8 @@ export default {
return { return {
detailsList: [], detailsList: [],
commodityList: [], commodityList: [],
ReturnsId:null, ReturnsId: null,
commodityForm:{ commodityForm: {
cvsGoodId: "", cvsGoodId: "",
cvsGood: "", cvsGood: "",
supplierId: "", supplierId: "",
@ -257,8 +267,8 @@ export default {
remark: "", remark: "",
page: 1, page: 1,
pageSize: 1000, pageSize: 1000,
isRecovery:0, isRecovery: 0,
total:0, total: 0,
}, },
returnsForm: { returnsForm: {
orderNumber: null, orderNumber: null,
@ -267,23 +277,23 @@ export default {
totalAmount: 0, // totalAmount: 0, //
productQuantity: 0, // productQuantity: 0, //
returnQuantity: 0 // returnQuantity: 0 //
} , },
// //
cvsGoodList:[], cvsGoodList: [],
// //
supplierList:[], supplierList: [],
state:'await', state: 'await',
saveFlag:false, saveFlag: false,
auditFlag:true, auditFlag: true,
voidFlag:true, voidFlag: true,
storageFlag:true, storageFlag: true,
multipleSelection:[], // multipleSelection: [], //
// //
title:'选择商品', title: '选择商品',
// //
showSearch: true, showSearch: true,
disableInput: false, // disableInput: false, //
@ -296,9 +306,10 @@ export default {
queryParams: { queryParams: {
// supplierId: '', // supplierId: '',
returnsId: null, returnsId: null,
page:null, page: null,
pageSize:null pageSize: null
}, },
numberInput: false,
// //
loading: false, loading: false,
// //
@ -306,7 +317,7 @@ export default {
// //
rules: { rules: {
supplierName: [ supplierName: [
{ required: true, message: "供应商名称不能为空", trigger: "blur" }, {required: true, message: "供应商名称不能为空", trigger: "blur"},
], ],
}, },
} }
@ -322,23 +333,23 @@ export default {
this.returnsForm.approvalStatus = this.$props.PapprovalStatus this.returnsForm.approvalStatus = this.$props.PapprovalStatus
this.state = this.$props.PapprovalStatus this.state = this.$props.PapprovalStatus
if ( this.state == null) { if (this.state == null) {
this.state = 'await' this.state = 'await'
} }
if (this.state=='await') { if (this.state == 'await') {
this.numberInput = false this.numberInput = false
}else { } else {
this.numberInput = true this.numberInput = true
} }
console.log("this.returnsForm",this.returnsForm) console.log("this.returnsForm", this.returnsForm)
if (this.returnsForm.orderNumber == null) { if (this.returnsForm.orderNumber == null) {
this.refresh(); this.refresh();
} }
if (this.returnsForm.orderDate == null) { if (this.returnsForm.orderDate == null) {
this.returnsForm.orderDate =new Date() this.returnsForm.orderDate = new Date()
} }
this.getDetailsList(); this.getDetailsList();
@ -346,9 +357,13 @@ export default {
this.JudgmentButton(); this.JudgmentButton();
}, },
methods: { methods: {
//
cancelPurchase() {
this.$router.back()
},
getDetailsList() { getDetailsList() {
let this_ = this let this_ = this
getReturnsDetailsPageApi(this.queryParams).then(res=>{ getReturnsDetailsPageApi(this.queryParams).then(res => {
this_.detailsList = res.data.records; this_.detailsList = res.data.records;
this.total = res.data.total; this.total = res.data.total;
this.sumMethod(res.data.records); this.sumMethod(res.data.records);
@ -356,7 +371,7 @@ export default {
}, },
getCommodityList() { getCommodityList() {
let this_ = this let this_ = this
listLJGoods(this_.commodityForm).then(res=>{ listLJGoods(this_.commodityForm).then(res => {
this_.commodityList = res.data.records; this_.commodityList = res.data.records;
this.commodityForm.total = response.data.total; this.commodityForm.total = response.data.total;
// this_.sumMethod(res.data.records); // this_.sumMethod(res.data.records);
@ -364,37 +379,35 @@ export default {
}, },
// //
goToAbout() { goToAbout() {
this.$router.push('/convenienceStore/returns/index'); this.$router.push('/convenienceStore/purchase/index');
}, },
commodityAdd() { commodityAdd() {
this.open = true; this.open = true;
}, },
commodityDel(data) { commodityDel(data) {
this.$confirm('确定删除?', '提示', { this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (data.id != null) { if (data.id != null) {
delDetailsApi(data).then(res=>{ delDetailsApi(data).then(res => {
}) })
} }
const index = this.detailsList.indexOf(data); // const index = this.detailsList.indexOf(data); //
if (index !== -1) { if (index !== -1) {
this.detailsList.splice(index, 1); // 使splice this.detailsList.splice(index, 1); // 使splice
this.sumMethod(this.detailsList); this.sumMethod(this.detailsList);
} }
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
});
}); });
});
}, },
@ -404,10 +417,10 @@ export default {
}, },
// //
change(data,flag) { change(data, flag) {
let returnQuantity = new BigNumber( data.returnQuantity); let returnQuantity = new BigNumber(data.returnQuantity);
let returnPrice = new BigNumber( data.returnPrice); let returnPrice = new BigNumber(data.returnPrice);
let subtotalAmount = new BigNumber(data.subtotalAmount); let subtotalAmount = new BigNumber(data.subtotalAmount);
if (flag == 1) { if (flag == 1) {
@ -423,7 +436,7 @@ export default {
} }
this.sumMethod(this.detailsList); this.sumMethod(this.detailsList);
console.log("this.detailsList",this.detailsList) console.log("this.detailsList", this.detailsList)
// //
// this.detailsList = data // this.detailsList = data
// this.edit() // this.edit()
@ -433,45 +446,45 @@ export default {
sumMethod(data) { sumMethod(data) {
let this_ = this let this_ = this
if (data.length>0) { if (data.length > 0) {
this_.returnsForm.totalAmount = data.length this_.returnsForm.totalAmount = data.length
} else { } else {
this_.returnsForm.totalAmount = 0 this_.returnsForm.totalAmount = 0
} }
this_.returnsForm.productQuantity = data.length, this_.returnsForm.productQuantity = data.length,
this_.returnsForm.totalAmount = new BigNumber(0), this_.returnsForm.totalAmount = new BigNumber(0),
this_.returnsForm.returnQuantity = new BigNumber(0), this_.returnsForm.returnQuantity = new BigNumber(0),
data.forEach(da => { data.forEach(da => {
if (da.returnPrice != null) { if (da.returnPrice != null) {
this_.returnsForm.returnQuantity= this_.returnsForm.returnQuantity.plus(da.returnQuantity) this_.returnsForm.returnQuantity = this_.returnsForm.returnQuantity.plus(da.returnQuantity)
} }
if (da.subtotalAmount != null) { if (da.subtotalAmount != null) {
this_.returnsForm.totalAmount= this_.returnsForm.totalAmount.plus(da.subtotalAmount) this_.returnsForm.totalAmount = this_.returnsForm.totalAmount.plus(da.subtotalAmount)
} }
}) })
}, },
addCommodity () { addCommodity() {
let this_ = this let this_ = this
let sum = 0; let sum = 0;
this.multipleSelection.forEach(mul=>{ this.multipleSelection.forEach(mul => {
let flag = true; let flag = true;
this_.detailsList.forEach(det=>{ this_.detailsList.forEach(det => {
if (mul.id == det.goodsId) { if (mul.id == det.goodsId) {
flag = false flag = false
sum++ sum++
} }
}) })
if(flag) { if (flag) {
let now = { let now = {
goodsId: mul.id, goodsId: mul.id,
commodityName: mul.name, commodityName: mul.name,
supplierId: mul.supplierId, supplierId: mul.supplierId,
cvsGoodId: mul.cvsGoodId, cvsGoodId: mul.cvsGoodId,
unit:mul.unit, unit: mul.unit,
preInboundInventory:mul.stock, preInboundInventory: mul.stock,
returnQuantity: 0, returnQuantity: 0,
returnPrice: 0, returnPrice: 0,
subtotalAmount: 0 subtotalAmount: 0
@ -480,8 +493,8 @@ export default {
} }
}) })
if(sum>0) { if (sum > 0) {
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除"); this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了" + sum + "件相同的商品,已为您剔除");
} }
this_.open = false this_.open = false
this.multipleSelection = [] this.multipleSelection = []
@ -495,14 +508,14 @@ export default {
page: 1, page: 1,
pageSize: 1000, pageSize: 1000,
total: 0, total: 0,
isRecovery:0, isRecovery: 0,
} }
this.commodityList = [] this.commodityList = []
this_.sumMethod(this_.detailsList); this_.sumMethod(this_.detailsList);
}, },
// //
getQueryList(){ getQueryList() {
selectTree().then(response => { selectTree().then(response => {
this.cvsGoodList = response.data.records this.cvsGoodList = response.data.records
}); });
@ -523,53 +536,52 @@ export default {
let min = 100; // 1000 let min = 100; // 1000
let max = 999; // 9999 let max = 999; // 9999
let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min; let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
this.returnsForm.orderNumber = timestamp+randomFourDigitNumber.toString(); this.returnsForm.orderNumber = timestamp + randomFourDigitNumber.toString();
}, },
// //
async JudgmentButton(){ async JudgmentButton() {
let judgmentPermissions1 = await this.judgmentPermissions("退货审核"); let judgmentPermissions1 = await this.judgmentPermissions("退货审核");
if (judgmentPermissions1 > 0){ if (judgmentPermissions1 > 0) {
this.auditFlag=false, this.auditFlag = false,
this.voidFlag=false this.voidFlag = false
} }
let judgmentPermissions2 = await this.judgmentPermissions("退货出库"); let judgmentPermissions2 = await this.judgmentPermissions("退货出库");
if (judgmentPermissions2 > 0){ if (judgmentPermissions2 > 0) {
this.storageFlag = false this.storageFlag = false
} }
let judgmentPermissions3 = await this.judgmentPermissions("退货废止"); let judgmentPermissions3 = await this.judgmentPermissions("退货废止");
if (judgmentPermissions3 > 0){ if (judgmentPermissions3 > 0) {
this.voidFlag=false this.voidFlag = false
}else { } else {
this.voidFlag=true this.voidFlag = true
} }
}, },
// //
async judgmentPermissions(data) { async judgmentPermissions(data) {
let fil ={ let fil = {
auditPrem:data auditPrem: data
} }
return await getAuditPremApi(fil).then(res => { return await getAuditPremApi(fil).then(res => {
return res.data return res.data
}); });
}, },
async save(flag){ async save(flag) {
let this_ = this let this_ = this
let con = true let con = true
// //
if (this_.returnsForm.orderNumber == null) { if (this_.returnsForm.orderNumber == null) {
this.$modal.msgError("退货单号不能为空"); this.$modal.msgError("退货单号不能为空");
return -1; return -1;
}else if (this_.returnsForm.orderDate == null) { } else if (this_.returnsForm.orderDate == null) {
this.$modal.msgError("退货时间不能为空"); this.$modal.msgError("退货时间不能为空");
return -1; return -1;
}else if(this_.detailsList.length<=0) { } else if (this_.detailsList.length <= 0) {
this.$modal.msgError("退货单不能为空"); this.$modal.msgError("退货单不能为空");
return -1; return -1;
} }
@ -577,21 +589,21 @@ export default {
if (this_.returnsId == null) { if (this_.returnsId == null) {
// //
this_.returnsForm.approvalStatus = 'await' this_.returnsForm.approvalStatus = 'await'
await addReturnsApi(this_.returnsForm).then(res=>{ await addReturnsApi(this_.returnsForm).then(res => {
this_.returnsId = res.data.id this_.returnsId = res.data.id
this.queryParams.returnsId = res.data.id this.queryParams.returnsId = res.data.id
}).catch(res=>{ }).catch(res => {
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con = false con = false
return; return;
}) })
}else { } else {
// //
this_.returnsForm.id = this_.returnsId this_.returnsForm.id = this_.returnsId
this.queryParams.returnsId = this_.returnsId this.queryParams.returnsId = this_.returnsId
await editReturnsApi(this_.returnsForm).then(res=> { await editReturnsApi(this_.returnsForm).then(res => {
}).catch(res=>{ }).catch(res => {
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
con = false con = false
@ -600,16 +612,16 @@ export default {
} }
// //
if (con) { if (con) {
this_.detailsList.forEach(data=>{ this_.detailsList.forEach(data => {
data.returnsId = this_.returnsId data.returnsId = this_.returnsId
}) })
await batchProcessingApi(this_.detailsList).then(res=>{ await batchProcessingApi(this_.detailsList).then(res => {
this.$modal.msgSuccess("保存成功"); this.$modal.msgSuccess("保存成功");
if (flag != -1) { if (flag != -1) {
this.goToAbout(); this.goToAbout();
} }
}).catch(res=>{ }).catch(res => {
this.$modal.msgError("保存失败"); this.$modal.msgError("保存失败");
}) })
} }
@ -617,20 +629,20 @@ export default {
}, },
// //
async audit(){ async audit() {
// //
let number = await this.save(-1); let number = await this.save(-1);
if (number != -1) { if (number != -1) {
// //
let fil ={ let fil = {
id: this.returnsId id: this.returnsId
} }
console.log(" id: this.ReturnsId",fil) console.log(" id: this.ReturnsId", fil)
await auditReturnsApi(fil).then(res => { await auditReturnsApi(fil).then(res => {
if (res.data) { if (res.data) {
this.state = 'ysh' this.state = 'ysh'
this.$modal.msgWarning("审核成功"); this.$modal.msgWarning("审核成功");
}else { } else {
this.$modal.msgWarning("暂无审核权限"); this.$modal.msgWarning("暂无审核权限");
} }
this.goToAbout() this.goToAbout()
@ -641,14 +653,14 @@ export default {
// //
storage() { storage() {
let this_ = this; let this_ = this;
// //
if (this_.returnsForm.orderNumber == null) { if (this_.returnsForm.orderNumber == null) {
this.$modal.msgError("退货单号不能为空"); this.$modal.msgError("退货单号不能为空");
return -1; return -1;
}else if (this_.returnsForm.orderDate == null) { } else if (this_.returnsForm.orderDate == null) {
this.$modal.msgError("退货时间不能为空"); this.$modal.msgError("退货时间不能为空");
return -1; return -1;
}else if(this_.detailsList.length<=0) { } else if (this_.detailsList.length <= 0) {
this.$modal.msgError("退货单不能为空"); this.$modal.msgError("退货单不能为空");
return -1; return -1;
} }
@ -659,7 +671,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// //
let fil ={ let fil = {
id: this.returnsId id: this.returnsId
} }
storageReturnsApi(fil).then(res => { storageReturnsApi(fil).then(res => {
@ -676,7 +688,7 @@ export default {
// //
abolition(){ abolition() {
if (this.returnsId < 0) { if (this.returnsId < 0) {
this.$modal.msgWarning("数据未保存,不可废弃"); this.$modal.msgWarning("数据未保存,不可废弃");
return; return;
@ -686,7 +698,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let fil ={ let fil = {
id: this.returnsId id: this.returnsId
} }
abolitionReturnsApi(fil).then(res => { abolitionReturnsApi(fil).then(res => {
@ -706,19 +718,19 @@ export default {
}) })
}, },
// //
async exportExcel() { async exportExcel() {
let fil ={ let fil = {
returnsId: this.returnsId returnsId: this.returnsId
} }
exportExcelApi(fil).then(res=>{ exportExcelApi(fil).then(res => {
console.log("res",res) console.log("res", res)
// this.downloadFile(res); // this.downloadFile(res);
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
this.$download.saveAs(blob,this.returnsForm.orderNumber+'.xLsx') this.$download.saveAs(blob, this.returnsForm.orderNumber + '.xLsx')
}) })
}, },
} }
@ -726,19 +738,18 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.app-container{ .app-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f6f8f9; background: #f6f8f9;
} }
.box { .box {
height: 100%; height: 80%;
width: 212px; width: 212px;
margin-right: 10px; margin-right: 10px;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10px 10px 10px 10px; border: 1px solid #FF9655;
border: 1px solid #EEEEEE;
border-radius: 10px; border-radius: 10px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -1,14 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card > <div class="card-change">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="" prop="orderNumber"> <el-form-item label="" prop="orderNumber">
<el-input v-model="queryParams.orderNumber" placeholder="业务单号" /> <el-input v-model="queryParams.orderNumber" placeholder="请输入退货单号"/>
</el-form-item> </el-form-item>
<el-form-item label="" v-model="queryParams.supplierId" prop="status"> <el-form-item label="" v-model="queryParams.supplierId" prop="status">
<el-select <el-select
v-model="queryParams.supplierId" v-model="queryParams.supplierId"
placeholder="供应商" placeholder="请选择供应商"
clearable clearable
style="width: 230px" style="width: 230px"
> >
@ -16,7 +16,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" v-model="queryParams.approvalStatus" prop="status"> <el-form-item label="" v-model="queryParams.approvalStatus" prop="status">
<el-select v-model="queryParams.approvalStatus" placeholder="状态" style=""> <el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="">
<el-option <el-option
v-for="dict in dict.type.oilPurchasedStatus" v-for="dict in dict.type.oilPurchasedStatus"
:key="dict.value" :key="dict.value"
@ -25,75 +25,102 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="日期选择" prop="status"> <el-form-item label="">
<el-date-picker <el-date-picker
v-model="queryParams.dateRange" v-model="beginTime"
type="datetimerange" style="width: 160px"
range-separator="至" type="date"
start-placeholder="开始日期" placeholder="开始日期">
end-placeholder="结束日期"> </el-date-picker>
</el-date-picker>
</el-form-item> --> <el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card style="margin-top: 20px" >
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus"
@click="detailsAdd" @click="detailsAdd"
v-hasPermi="['convenienceStore:returns:index']" v-hasPermi="['convenienceStore:returns:index']"
>新增退货订单</el-button> >新增退货订单
</el-col> </el-button>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> </el-form-item>
</el-row> </el-form>
<el-table ref="tables" <div style="height: 71vh;overflow: auto">
v-loading="loading" <el-table ref="tables" border
:data="returnsList" v-loading="loading"
:default-sort="defaultSort"> :data="returnsList"
<el-table-column label="业务单号" align="center" prop="orderNumber"/> :default-sort="defaultSort">
<el-table-column label="供应商" align="center" prop="supplierName"/> <el-table-column label="序号" align="center" type="index" width="60"/>
<el-table-column label="退货数量" align="center" prop="returnQuantity"/> <el-table-column label="退货单号" align="center" prop="orderNumber"/>
<el-table-column label="单据金额" align="center" prop="totalAmount"/> <el-table-column label="供应商" align="center" prop="supplierName"/>
<el-table-column label="退货数量" align="center" prop="returnQuantity"/>
<el-table-column label="单据金额" align="center" prop="totalAmount"/>
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag> <div style="color: #FF9655" v-if="scope.row.approvalStatus == 'await'">待审核</div>
<el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag> <div style="color: #0DC291" v-if="scope.row.approvalStatus == 'qrts'" >已审核入库</div>
<el-tag v-if ="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag> <div style="color: #F44522" v-if="scope.row.approvalStatus == 'yzf'" >已作废</div>
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="danger" size="medium">已审核</el-tag> <div style="color: #409EFF" v-if="scope.row.approvalStatus == 'ysh'" >已审核</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="制单人" align="center" prop="createByName"/> <el-table-column label="制单人" align="center" prop="createByName"/>
<el-table-column label="制单日期" align="center" prop="orderDate" width="200"> <el-table-column label="审核人" align="center" prop="approverName"/>
<template slot-scope="scope"> <el-table-column label="入库人" align="center" prop="storageName"/>
<span>{{ parseTime(scope.row.orderDate) }}</span> <el-table-column label="制单时间" align="center" prop="orderDate" width="200">
</template> <template slot-scope="scope">
</el-table-column> <span>{{ parseTime(scope.row.orderDate) }}</span>
<el-table-column label="审核人" align="center" prop="approverName"/> </template>
</el-table-column>
<el-table-column label="审核时间" align="center" prop="orderDate" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.examineTime) }}</span>
</template>
</el-table-column>
<el-table-column label="入库时间" align="center" prop="orderDate" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.storageTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" v-if="scope.row.approvalStatus == 'await'"
@click="dispose(scope.row)" @click="dispose(scope.row)"
>处理单据</el-button> >退货审核
</template> </el-button>
<el-button
size="mini"
type="text"
v-else-if="scope.row.approvalStatus == 'ysh'"
@click="dispose(scope.row)"
>退货入库
</el-button>
<el-button
size="mini"
type="text"
v-else
@click="dispose(scope.row)"
>查看详情
</el-button>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
<pagination <pagination
v-show="total>0" v-show="total>0"
@ -102,7 +129,7 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</el-card> </div>
</div> </div>
</template> </template>
@ -118,11 +145,11 @@ export default {
data() { data() {
return { return {
returnsList:[], returnsList: [],
// //
supplierList:[], supplierList: [],
// //
title:'', title: '',
// //
showSearch: true, showSearch: true,
disableInput: false, // disableInput: false, //
@ -141,6 +168,8 @@ export default {
page: null, page: null,
pageSize: null, pageSize: null,
}, },
beginTime: "",
endTime: "",
// //
loading: false, loading: false,
// //
@ -156,16 +185,21 @@ export default {
methods: { methods: {
// //
getList(){ getList() {
this.loading = true; this.loading = true;
getReturnsPageApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => { let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getReturnsPageApi(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.returnsList = response.data.records; this.returnsList = response.data.records;
this.total = response.data.total; this.total = response.data.total;
}) })
this.loading = false; this.loading = false;
}, },
// //
getQueryList(){ getQueryList() {
listSupplier().then(response => { listSupplier().then(response => {
this.supplierList = response.data.records this.supplierList = response.data.records
}) })
@ -194,6 +228,8 @@ export default {
// //
resetQuery() { resetQuery() {
this.queryParams = {} this.queryParams = {}
this.beginTime = ''
this.endTime = ''
this.handleQuery() this.handleQuery()
}, },
// //
@ -215,7 +251,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.app-container{ .app-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #f6f8f9; background: #f6f8f9;

View File

@ -37,6 +37,10 @@ public class MtReturns extends BaseEntity {
* 审核人 * 审核人
*/ */
private String approver; private String approver;
/**
* 入库人
*/
private String storage;
/** /**
* 总金额 * 总金额
*/ */
@ -53,7 +57,16 @@ public class MtReturns extends BaseEntity {
* 店铺ID * 店铺ID
*/ */
private Integer storeId; private Integer storeId;
/**
* 审核时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date examineTime;
/**
* 入库时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date storageTime;
} }

View File

@ -129,8 +129,11 @@
mp.return_quantity returnQuantity, mp.return_quantity returnQuantity,
mp.approval_status approvalStatus, mp.approval_status approvalStatus,
mp.order_date orderDate, mp.order_date orderDate,
mp.examine_time examineTime,
mp.storage_time storageTime,
ms1.real_name createByName, ms1.real_name createByName,
ms2.real_name approverName, ms2.real_name approverName,
ms3.real_name storageName,
mp.create_time createTime mp.create_time createTime
FROM FROM
mt_returns mp mt_returns mp
@ -138,6 +141,7 @@
left join mt_goods mg ON mg.id = mpd.goods_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 ms1 ON mp.create_by = ms1.id
LEFT JOIN mt_staff ms2 ON mp.approver = ms2.id LEFT JOIN mt_staff ms2 ON mp.approver = ms2.id
LEFT JOIN mt_staff ms3 ON mp.storage = ms3.id
<where> <where>
mp.store_id = #{mtReturns.storeId} mp.store_id = #{mtReturns.storeId}
@ -150,6 +154,12 @@
<if test="mtReturns.supplierId != null"> <if test="mtReturns.supplierId != null">
and mg.supplier_id = #{mtReturns.supplierId} and mg.supplier_id = #{mtReturns.supplierId}
</if> </if>
<if test="mtReturns.params.beginTime != null and mtReturns.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(mp.order_date,'%y%m%d') &gt;= date_format(#{mtReturns.params.beginTime},'%y%m%d')
</if>
<if test="mtReturns.params.endTime != null and mtPurchase.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(mp.order_date,'%y%m%d') &lt;= date_format(#{mtReturns.params.endTime},'%y%m%d')
</if>
</where> </where>
GROUP BY GROUP BY
mp.id mp.id
@ -208,6 +218,9 @@
<if test="approver != null and approver != ''"> <if test="approver != null and approver != ''">
approver = #{approver}, approver = #{approver},
</if> </if>
<if test="storage != null and storage != ''">
storage = #{storage},
</if>
<if test="totalAmount != null"> <if test="totalAmount != null">
total_amount = #{totalAmount}, total_amount = #{totalAmount},
</if> </if>
@ -220,6 +233,12 @@
<if test="storeId != null"> <if test="storeId != null">
store_id = #{storeId}, store_id = #{storeId},
</if> </if>
<if test="examineTime != null">
examine_time = #{examineTime},
</if>
<if test="storageTime != null">
storage_time = #{storageTime},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime}, create_time = #{createTime},
</if> </if>

View File

@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -201,7 +202,7 @@ public class MtReturnsServiceImpl implements MtReturnsService {
} }
String status = "qrts"; String status = "qrts";
boolean edit = edit(id); boolean edit = edit1(id);
int i = mtReturnsDao.editStateById(id, status); int i = mtReturnsDao.editStateById(id, status);
return true; return true;
} }
@ -215,6 +216,18 @@ public class MtReturnsServiceImpl implements MtReturnsService {
MtReturns mtReturns = new MtReturns(); MtReturns mtReturns = new MtReturns();
mtReturns.setApprover(nowAccountInfo.getStaffId().toString()); mtReturns.setApprover(nowAccountInfo.getStaffId().toString());
mtReturns.setExamineTime(new Date());
mtReturns.setId(id);
int update = mtReturnsDao.update(mtReturns);
return update>0;
}
// 修改入库人
public boolean edit1(Integer id){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
MtReturns mtReturns = new MtReturns();
mtReturns.setStorage(nowAccountInfo.getStaffId().toString());
mtReturns.setStorageTime(new Date());
mtReturns.setId(id); mtReturns.setId(id);
int update = mtReturnsDao.update(mtReturns); int update = mtReturnsDao.update(mtReturns);
return update>0; return update>0;

View File

@ -7,6 +7,7 @@ import lombok.Data;
public class MtReturnsVO extends MtReturns { public class MtReturnsVO extends MtReturns {
private String createByName; private String createByName;
private String approverName; private String approverName;
private String storageName;
private String supplierName; private String supplierName;
private Integer detailsId; private Integer detailsId;
private Integer supplierId; private Integer supplierId;