10.30
This commit is contained in:
parent
6298e9249f
commit
1a61e3aef9
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<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-item label="" prop="orderNumber">
|
||||
<el-input v-model="queryParams.orderNumber" placeholder="盘点批次号" />
|
||||
<el-input v-model="queryParams.orderNumber" placeholder="请输入盘点单号"/>
|
||||
</el-form-item>
|
||||
<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
|
||||
v-for="dict in dict.type.oilPurchasedStatus"
|
||||
:key="dict.value"
|
||||
@ -15,104 +15,103 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="日期选择" prop="status">
|
||||
<el-date-picker
|
||||
v-model="queryParams.dateRange"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="">
|
||||
<el-date-picker
|
||||
v-model="beginTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="开始日期">
|
||||
</el-date-picker>
|
||||
至
|
||||
<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-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</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 type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="detailsAdd"
|
||||
v-hasPermi="['convenienceStore:inventory:index']"
|
||||
>新增库存盘点
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
>新增盘点批次</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
</el-row>
|
||||
<div style="height: 70vh;overflow: auto">
|
||||
<el-table ref="tables" border
|
||||
v-loading="loading"
|
||||
: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"
|
||||
v-loading="loading"
|
||||
:data="inventoryList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="盘点批次" align="center" prop="orderNumber">
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
|
||||
<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="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-column label="制单日期" align="center" prop="orderDate" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderDate) }}</span>
|
||||
</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" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
|
||||
<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 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 label="制单日期" align="center" prop="orderDate" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderDate) }}</span>
|
||||
</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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
@ -121,13 +120,13 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getInventoryPageApi,delInventoryApi,addInventoryApi} from "@/api/convenienceStore/inventory";
|
||||
import {getInventoryPageApi, delInventoryApi, addInventoryApi} from "@/api/convenienceStore/inventory";
|
||||
import {listSupplier} from "@/api/convenienceStore/supplier";
|
||||
|
||||
export default {
|
||||
@ -136,11 +135,11 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
inventoryList:[],
|
||||
inventoryList: [],
|
||||
// 供应商列表
|
||||
supplierList:[],
|
||||
supplierList: [],
|
||||
// 弹出框标题
|
||||
title:'',
|
||||
title: '',
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
disableInput: false, // 默认不禁用
|
||||
@ -159,12 +158,14 @@ export default {
|
||||
pageNo: null,
|
||||
pageSize: null,
|
||||
},
|
||||
beginTime: "",
|
||||
endTime: "",
|
||||
// 新增批次
|
||||
inventoryForm: {
|
||||
orderNumber: null,
|
||||
approvalStatus: "",
|
||||
orderDate: new Date(),
|
||||
} ,
|
||||
},
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 默认排序
|
||||
@ -180,16 +181,21 @@ export default {
|
||||
methods: {
|
||||
|
||||
// 获取列表
|
||||
getList(){
|
||||
getList() {
|
||||
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.total = response.data.total;
|
||||
})
|
||||
this.loading = false;
|
||||
},
|
||||
// 查询搜索列表信息
|
||||
getQueryList(){
|
||||
getQueryList() {
|
||||
listSupplier().then(response => {
|
||||
this.supplierList = response.data.records
|
||||
})
|
||||
@ -227,7 +233,7 @@ export default {
|
||||
let min = 100; // 最小的四位数是 1000
|
||||
let max = 999; // 最大的四位数是 9999
|
||||
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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container{
|
||||
.app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
|
@ -1,33 +1,35 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-change-1-search">
|
||||
<!-- <div slot="header" class="clearfix" style="display: flex; justify-content: space-between;">-->
|
||||
<!-- <div>-->
|
||||
<!-- <i class="el-icon-back" @click="goToAbout">返回 | </i>-->
|
||||
<!-- <span> 进货详情</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<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%; 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">
|
||||
<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">
|
||||
<div style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
|
||||
总金额</span>
|
||||
<div
|
||||
style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
|
||||
总金额
|
||||
</span>
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,14 +37,14 @@
|
||||
<el-form ref="myForm" label-width="100px">
|
||||
<el-form-item label="进货单号">
|
||||
|
||||
<el-input v-model="purchaseForm.orderNumber"
|
||||
style="width: 220Px" :disabled="numberInput">
|
||||
<el-input v-model="purchaseForm.orderNumber"
|
||||
style="width: 220Px" :disabled="numberInput">
|
||||
<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"
|
||||
:disabled="numberInput"
|
||||
style="width: 220Px"
|
||||
v-model="purchaseForm.orderDate"
|
||||
type="date"
|
||||
@ -53,81 +55,94 @@
|
||||
</div>
|
||||
</div>
|
||||
<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="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>
|
||||
<el-button type="primary" @click="cancelPurchase" v-if="state=='qrts'">关闭</el-button>
|
||||
<el-button @click="cancelPurchase" v-else>取消</el-button>
|
||||
<el-button type="success" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
|
||||
<el-button type="primary" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</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>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
<div class="card-change-1-1">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" style="text-align: right; float: right">
|
||||
<el-button
|
||||
v-if="!numberInput"
|
||||
v-if="!numberInput"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="commodityAdd"
|
||||
>添加进货</el-button>
|
||||
>添加采购商品
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
</el-row>
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="detailsList"
|
||||
:default-sort="defaultSort">
|
||||
<div style="height: 68vh;overflow: auto">
|
||||
<el-table ref="tables" border
|
||||
v-loading="loading"
|
||||
:data="detailsList"
|
||||
:default-sort="defaultSort">
|
||||
|
||||
<el-table-column label="商品名称" align="center" prop="commodityName"/>
|
||||
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" prop="commodityName"/>
|
||||
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="供应商" prop="supplierId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="unit">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.unit == null?"-":scope.row.unit}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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)" :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)" :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)" :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'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="commodityDel(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
<!-- v-hasPermi="['']"-->
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table-column label="供应商" prop="supplierId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="unit">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.unit == null ? "-" : scope.row.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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)"
|
||||
: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)"
|
||||
: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)"
|
||||
: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'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="commodityDel(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- v-hasPermi="['']"-->
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="total>0"-->
|
||||
<!-- :total="total"-->
|
||||
@ -135,45 +150,37 @@
|
||||
<!-- :limit.sync="queryParams.pageSize"-->
|
||||
<!-- @pagination="getList"-->
|
||||
<!-- />-->
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
|
||||
<el-container>
|
||||
<el-header style="">
|
||||
<el-form ref="tankForm" :model="commodityForm" label-width="80px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="商品分类">
|
||||
<el-select
|
||||
v-model="commodityForm.cvsGoodId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select
|
||||
v-model="commodityForm.supplierId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<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 ref="tankForm" :model="commodityForm" label-width="20px" :inline="true">
|
||||
<el-form-item label="">
|
||||
<el-select
|
||||
v-model="commodityForm.cvsGoodId"
|
||||
placeholder="请选择商品分类"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="supplierId">
|
||||
<el-select
|
||||
v-model="commodityForm.supplierId"
|
||||
placeholder="请选择供应商名称"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-input v-model="commodityForm.remark" placeholder="请输入商品名称,拼音码,条形码等"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right;margin-right: 0px">
|
||||
<el-button type="primary" icon="el-icon-search" @click="inquire()">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-header>
|
||||
<el-main>
|
||||
@ -183,14 +190,10 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
||||
<el-table-column label="商品名称" align="center" prop="name"/>
|
||||
<el-table-column label="商品编码" align="center" prop="goodsNo"/>
|
||||
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
|
||||
<!-- <el-table-column label="商品编码" align="center" prop="goodsNo"/>-->
|
||||
<el-table-column label="品类名称" prop="cvsGoodId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
@ -201,21 +204,26 @@
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</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>
|
||||
<!-- <pagination
|
||||
v-show="commodityForm.total>0"
|
||||
:total="commodityForm.total"
|
||||
:page.sync="commodityForm.page"
|
||||
:limit.sync="commodityForm.pageSize"
|
||||
@pagination="getCommodityList"
|
||||
/> -->
|
||||
<!-- <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">
|
||||
<el-button type="primary" @click="addCommodity">确 定</el-button>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="addCommodity">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@ -228,7 +236,7 @@ import {getAuditPremApi} from "@/api/oilConfig/staff";
|
||||
|
||||
import {BigNumber} from "bignumber.js";
|
||||
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 {listSupplier} from "@/api/convenienceStore/supplier";
|
||||
import {
|
||||
@ -246,7 +254,7 @@ import {
|
||||
|
||||
export default {
|
||||
name: "details",
|
||||
props:[
|
||||
props: [
|
||||
'PpurchaseId',
|
||||
'PorderNumber',
|
||||
'PorderDate',
|
||||
@ -256,8 +264,8 @@ export default {
|
||||
return {
|
||||
detailsList: [],
|
||||
commodityList: [],
|
||||
purchaseId:null,
|
||||
commodityForm:{
|
||||
purchaseId: null,
|
||||
commodityForm: {
|
||||
cvsGoodId: "",
|
||||
cvsGood: "",
|
||||
supplierId: "",
|
||||
@ -267,7 +275,7 @@ export default {
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
isRecovery: 0,
|
||||
},
|
||||
purchaseForm: {
|
||||
orderNumber: null,
|
||||
@ -276,24 +284,24 @@ export default {
|
||||
totalAmount: 0, //总金额
|
||||
productQuantity: 0, //商品数量
|
||||
quantityPurchased: 0 //进货数量
|
||||
} ,
|
||||
},
|
||||
|
||||
// 商品分类列表
|
||||
cvsGoodList:[],
|
||||
cvsGoodList: [],
|
||||
// 供应商列表
|
||||
supplierList:[],
|
||||
supplierList: [],
|
||||
|
||||
numberInput: false,
|
||||
state: 'await',
|
||||
|
||||
state:'await',
|
||||
|
||||
saveFlag:false,
|
||||
auditFlag:false,
|
||||
voidFlag:false,
|
||||
storageFlag:false,
|
||||
multipleSelection:[], // 表格
|
||||
saveFlag: false,
|
||||
auditFlag: false,
|
||||
voidFlag: false,
|
||||
storageFlag: false,
|
||||
multipleSelection: [], // 表格
|
||||
|
||||
// 弹出框标题
|
||||
title:'选择商品',
|
||||
title: '添加采购商品',
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
disableInput: false, // 默认不禁用
|
||||
@ -306,8 +314,8 @@ export default {
|
||||
queryParams: {
|
||||
// supplierId: '',
|
||||
purchaseId: null,
|
||||
page:1,
|
||||
pageSize:10000
|
||||
page: 1,
|
||||
pageSize: 10000
|
||||
},
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
@ -316,7 +324,7 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
supplierName: [
|
||||
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
|
||||
{required: true, message: "供应商名称不能为空", trigger: "blur"},
|
||||
],
|
||||
},
|
||||
}
|
||||
@ -331,24 +339,24 @@ export default {
|
||||
this.purchaseForm.approvalStatus = 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'
|
||||
}
|
||||
|
||||
if (this.state=='await') {
|
||||
if (this.state == 'await') {
|
||||
this.numberInput = false
|
||||
}else {
|
||||
} else {
|
||||
this.numberInput = true
|
||||
}
|
||||
|
||||
console.log(this.state, 357)
|
||||
|
||||
if (this.purchaseForm.orderNumber == null) {
|
||||
this.refresh();
|
||||
}
|
||||
if (this.purchaseForm.orderDate == null) {
|
||||
this.purchaseForm.orderDate =new Date()
|
||||
this.purchaseForm.orderDate = new Date()
|
||||
}
|
||||
|
||||
this.getDetailsList();
|
||||
@ -357,9 +365,13 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 返回页面
|
||||
cancelPurchase() {
|
||||
this.$router.back()
|
||||
},
|
||||
getDetailsList() {
|
||||
let this_ = this
|
||||
getPurchaseDetailsPageApi(this.queryParams).then(res=>{
|
||||
getPurchaseDetailsPageApi(this.queryParams).then(res => {
|
||||
this_.detailsList = res.data.records;
|
||||
this.total = res.data.total;
|
||||
this.sumMethod(res.data.records);
|
||||
@ -367,7 +379,7 @@ export default {
|
||||
},
|
||||
getCommodityList() {
|
||||
let this_ = this
|
||||
listLJGoods(this_.commodityForm).then(res=>{
|
||||
listLJGoods(this_.commodityForm).then(res => {
|
||||
this_.commodityList = res.data.records;
|
||||
this.commodityForm.total = res.data.total;
|
||||
// this_.sumMethod(res.data.records);
|
||||
@ -384,32 +396,31 @@ export default {
|
||||
|
||||
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
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.sumMethod(this.detailsList);
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res => {
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
this.sumMethod(this.detailsList);
|
||||
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
this.$message({
|
||||
type: 'success',
|
||||
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 unitPrice = new BigNumber( data.unitPrice);
|
||||
let quantityPurchased = new BigNumber(data.quantityPurchased);
|
||||
let unitPrice = new BigNumber(data.unitPrice);
|
||||
let subtotalAmount = new BigNumber(data.subtotalAmount);
|
||||
|
||||
if (flag == 1) {
|
||||
@ -438,7 +449,7 @@ export default {
|
||||
}
|
||||
|
||||
this.sumMethod(this.detailsList);
|
||||
console.log("this.detailsList",this.detailsList)
|
||||
console.log("this.detailsList", this.detailsList)
|
||||
// 进行保存
|
||||
// this.detailsList = data
|
||||
// this.edit()
|
||||
@ -450,50 +461,50 @@ export default {
|
||||
|
||||
this_.purchaseForm.totalAmount = data.length
|
||||
|
||||
this_.purchaseForm.productQuantity = data.length,
|
||||
this_.purchaseForm.totalAmount = new BigNumber(0),
|
||||
this_.purchaseForm.quantityPurchased = new BigNumber(0),
|
||||
this_.purchaseForm.productQuantity = data.length,
|
||||
this_.purchaseForm.totalAmount = new BigNumber(0),
|
||||
this_.purchaseForm.quantityPurchased = new BigNumber(0),
|
||||
|
||||
data.forEach(da => {
|
||||
if (da.unitPrice != null) {
|
||||
this_.purchaseForm.quantityPurchased= this_.purchaseForm.quantityPurchased.plus(da.quantityPurchased)
|
||||
}
|
||||
if (da.subtotalAmount != null) {
|
||||
this_.purchaseForm.totalAmount= this_.purchaseForm.totalAmount.plus(da.subtotalAmount)
|
||||
}
|
||||
})
|
||||
data.forEach(da => {
|
||||
if (da.unitPrice != null) {
|
||||
this_.purchaseForm.quantityPurchased = this_.purchaseForm.quantityPurchased.plus(da.quantityPurchased)
|
||||
}
|
||||
if (da.subtotalAmount != null) {
|
||||
this_.purchaseForm.totalAmount = this_.purchaseForm.totalAmount.plus(da.subtotalAmount)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
addCommodity () {
|
||||
addCommodity() {
|
||||
let this_ = this
|
||||
let sum = 0;
|
||||
this.multipleSelection.forEach(mul=>{
|
||||
this.multipleSelection.forEach(mul => {
|
||||
let flag = true;
|
||||
this_.detailsList.forEach(det=>{
|
||||
this_.detailsList.forEach(det => {
|
||||
if (mul.id == det.goodsId) {
|
||||
flag = false
|
||||
sum++
|
||||
}
|
||||
})
|
||||
if(flag) {
|
||||
if (flag) {
|
||||
let now = {
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
supplierId: mul.supplierId,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit:mul.unit,
|
||||
stock:mul.stock,
|
||||
quantityPurchased: 1,
|
||||
unitPrice: 0,
|
||||
subtotalAmount: 0
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
supplierId: mul.supplierId,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit: mul.unit,
|
||||
stock: mul.stock,
|
||||
quantityPurchased: 1,
|
||||
unitPrice: 0,
|
||||
subtotalAmount: 0
|
||||
}
|
||||
this_.detailsList.push(now)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
if(sum>0) {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
if (sum > 0) {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了" + sum + "件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
this.multipleSelection = []
|
||||
@ -507,7 +518,7 @@ export default {
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
isRecovery: 0,
|
||||
}
|
||||
this.commodityList = []
|
||||
|
||||
@ -515,7 +526,7 @@ export default {
|
||||
},
|
||||
|
||||
// 查询搜索列表信息
|
||||
getQueryList(){
|
||||
getQueryList() {
|
||||
selectTree().then(response => {
|
||||
this.cvsGoodList = response.data.records
|
||||
});
|
||||
@ -536,41 +547,40 @@ export default {
|
||||
let min = 100; // 最小的四位数是 100
|
||||
let max = 999; // 最大的四位数是 999
|
||||
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("进货审核");
|
||||
if (judgmentPermissions1 > 0){
|
||||
this.auditFlag=false
|
||||
if (judgmentPermissions1 > 0) {
|
||||
this.auditFlag = false
|
||||
// this.voidFlag=false
|
||||
} else {
|
||||
this.auditFlag=true
|
||||
this.auditFlag = true
|
||||
}
|
||||
let judgmentPermissions2 = await this.judgmentPermissions("进货入库");
|
||||
console.log("judgmentPermissions2",judgmentPermissions2)
|
||||
if (judgmentPermissions2 > 0){
|
||||
console.log("judgmentPermissions2", judgmentPermissions2)
|
||||
if (judgmentPermissions2 > 0) {
|
||||
this.storageFlag = false
|
||||
}else {
|
||||
} else {
|
||||
this.storageFlag = true
|
||||
}
|
||||
|
||||
let judgmentPermissions3 = await this.judgmentPermissions("进货废止");
|
||||
if (judgmentPermissions3 > 0){
|
||||
this.voidFlag=false
|
||||
}else {
|
||||
this.voidFlag=true
|
||||
if (judgmentPermissions3 > 0) {
|
||||
this.voidFlag = false
|
||||
} else {
|
||||
this.voidFlag = true
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
// 判断权限
|
||||
async judgmentPermissions(data) {
|
||||
let fil ={
|
||||
auditPrem:data
|
||||
let fil = {
|
||||
auditPrem: data
|
||||
}
|
||||
return await getAuditPremApi(fil).then(res => {
|
||||
return res.data
|
||||
@ -578,86 +588,83 @@ export default {
|
||||
},
|
||||
|
||||
|
||||
|
||||
async save(flag){
|
||||
async save(flag) {
|
||||
let this_ = this
|
||||
let con = true
|
||||
// 保存之前进行判断
|
||||
if (this_.purchaseForm.orderNumber == null) {
|
||||
this.$modal.msgError("进货单号不能为空");
|
||||
return -1;
|
||||
}else if (this_.purchaseForm.orderDate == null) {
|
||||
} else if (this_.purchaseForm.orderDate == null) {
|
||||
this.$modal.msgError("进货时间不能为空");
|
||||
return -1;
|
||||
}else if(this_.detailsList.length<=0) {
|
||||
} else if (this_.detailsList.length <= 0) {
|
||||
this.$modal.msgError("进货单不能为空");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (this_.purchaseId == null) {
|
||||
// 新增
|
||||
await addPurchaseApi(this_.purchaseForm).then(res=>{
|
||||
await addPurchaseApi(this_.purchaseForm).then(res => {
|
||||
if (res.code === 200) {
|
||||
this_.purchaseId = res.data.id
|
||||
this.queryParams.purchaseId = res.data.id
|
||||
}else {
|
||||
} else {
|
||||
this.$modal.msgError("保存失败");
|
||||
con=false
|
||||
con = false
|
||||
return -1;
|
||||
}
|
||||
}).catch(res=>{
|
||||
}).catch(res => {
|
||||
this.$modal.msgError("保存失败");
|
||||
con=false
|
||||
con = false
|
||||
return -1;
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
// 修改
|
||||
this_.purchaseForm.id = this_.purchaseId
|
||||
this.queryParams.purchaseId = this_.purchaseId
|
||||
await editPurchaseApi(this_.purchaseForm).then(res=> {
|
||||
if (res.code !== 200){
|
||||
await editPurchaseApi(this_.purchaseForm).then(res => {
|
||||
if (res.code !== 200) {
|
||||
this.$modal.msgError("保存失败");
|
||||
con=false
|
||||
con = false
|
||||
return -1;
|
||||
}
|
||||
}).catch(res=>{
|
||||
}).catch(res => {
|
||||
this.$modal.msgError("保存失败");
|
||||
con=false
|
||||
con = false
|
||||
return -1;
|
||||
})
|
||||
}
|
||||
|
||||
if (con) {
|
||||
// 批量保存订单
|
||||
this_.detailsList.forEach(data=>{
|
||||
this_.detailsList.forEach(data => {
|
||||
data.purchaseId = this_.purchaseId
|
||||
})
|
||||
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
await batchProcessingApi(this_.detailsList).then(res => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag == -1) {
|
||||
this.goToAbout();
|
||||
|
||||
}
|
||||
}).catch(res=>{
|
||||
}).catch(res => {
|
||||
// this.$modal.msgError("保存失败");
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 保存并审核
|
||||
async audit(){
|
||||
async audit() {
|
||||
// 保存
|
||||
let number = await this.save(-1);
|
||||
if (number != -1) {
|
||||
// 审核
|
||||
let fil ={
|
||||
let fil = {
|
||||
id: this.purchaseId
|
||||
}
|
||||
console.log(" id: this.purchaseId1",fil)
|
||||
console.log(" id: this.purchaseId1", fil)
|
||||
await auditPurchaseApi(fil).then(res => {
|
||||
|
||||
if (res.data) {
|
||||
@ -679,10 +686,10 @@ export default {
|
||||
if (this_.purchaseForm.orderNumber == null) {
|
||||
this.$modal.msgError("进货单号不能为空");
|
||||
return -1;
|
||||
}else if (this_.purchaseForm.orderDate == null) {
|
||||
} else if (this_.purchaseForm.orderDate == null) {
|
||||
this.$modal.msgError("进货时间不能为空");
|
||||
return -1;
|
||||
}else if(this_.detailsList.length<=0) {
|
||||
} else if (this_.detailsList.length <= 0) {
|
||||
this.$modal.msgError("进货单不能为空");
|
||||
return -1;
|
||||
}
|
||||
@ -693,10 +700,10 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 审核
|
||||
let fil ={
|
||||
let fil = {
|
||||
id: this.purchaseId
|
||||
}
|
||||
console.log("fil",fil)
|
||||
console.log("fil", fil)
|
||||
storagePurchaseApi(fil).then(res => {
|
||||
this.state = 'qrts'
|
||||
this.$modal.msgWarning("入库成功");
|
||||
@ -710,7 +717,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 作废
|
||||
abolition(){
|
||||
abolition() {
|
||||
if (this.PurchaseId < 0) {
|
||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||
return;
|
||||
@ -720,7 +727,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let fil ={
|
||||
let fil = {
|
||||
id: this.purchaseId
|
||||
}
|
||||
abolitionPurchaseApi(fil).then(res => {
|
||||
@ -740,19 +747,19 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
// 导出
|
||||
// 导出
|
||||
async exportExcel() {
|
||||
|
||||
let fil ={
|
||||
purchaseId: this.purchaseId
|
||||
}
|
||||
let fil = {
|
||||
purchaseId: this.purchaseId
|
||||
}
|
||||
|
||||
exportExcelApi(fil).then(res=>{
|
||||
console.log("res",res)
|
||||
exportExcelApi(fil).then(res => {
|
||||
console.log("res", 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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container{
|
||||
.app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
|
||||
.box {
|
||||
height: 100%;
|
||||
height: 80%;
|
||||
width: 212px;
|
||||
margin-right: 10px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
border: 1px solid #EEEEEE;
|
||||
border: 1px solid #FF9655;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -1,30 +1,32 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<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>
|
||||
</div>
|
||||
<div class="card-change-1-search">
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <i class="el-icon-back" @click="goToAbout">返回 | </i>-->
|
||||
<!-- <span> 退货详情</span>-->
|
||||
<!-- </div>-->
|
||||
<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%; 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">
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
<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">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
@ -32,15 +34,15 @@
|
||||
<el-form ref="myForm" label-width="100px">
|
||||
<el-form-item label="退货单号">
|
||||
|
||||
<el-input v-model="returnsForm.orderNumber"
|
||||
:disabled="numberInput"
|
||||
style="width: 220Px">
|
||||
<el-input v-model="returnsForm.orderNumber"
|
||||
:disabled="numberInput"
|
||||
style="width: 220Px">
|
||||
<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"
|
||||
:disabled="numberInput"
|
||||
style="width: 220Px"
|
||||
v-model="returnsForm.orderDate"
|
||||
type="date"
|
||||
@ -51,82 +53,96 @@
|
||||
</div>
|
||||
</div>
|
||||
<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="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>
|
||||
<el-button type="primary" @click="cancelPurchase" v-if="state=='qrts'">关闭</el-button>
|
||||
<el-button @click="cancelPurchase" v-else>取消</el-button>
|
||||
<el-button type="success" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
|
||||
<el-button type="primary" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</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>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
<div class="card-change-1-1">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5" style="text-align: right; float: right">
|
||||
<el-button
|
||||
v-if="!numberInput"
|
||||
v-if="!numberInput"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="commodityAdd"
|
||||
>添加退货</el-button>
|
||||
>添加退货商品
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
</el-row>
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="detailsList"
|
||||
:default-sort="defaultSort">
|
||||
<div style="height: 68vh;overflow: auto">
|
||||
<el-table ref="tables" border
|
||||
v-loading="loading"
|
||||
:data="detailsList"
|
||||
:default-sort="defaultSort">
|
||||
|
||||
<el-table-column label="商品名称" align="center" prop="commodityName"/>
|
||||
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" prop="commodityName"/>
|
||||
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="供应商" prop="supplierId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="unit">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.unit == null?"-":scope.row.unit}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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)" :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)" :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)" :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="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="commodityDel(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
<!-- v-hasPermi="['']"-->
|
||||
<el-table-column label="供应商" prop="supplierId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="unit">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.unit == null ? "-" : scope.row.unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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)"
|
||||
: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)"
|
||||
: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)"
|
||||
: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="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="commodityDel(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- v-hasPermi="['']"-->
|
||||
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="total>0"-->
|
||||
@ -135,45 +151,37 @@
|
||||
<!-- :limit.sync="queryParams.pageSize"-->
|
||||
<!-- @pagination="getList"-->
|
||||
<!-- />-->
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
|
||||
<el-container>
|
||||
<el-header style="">
|
||||
<el-form ref="tankForm" :model="commodityForm" label-width="80px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="商品分类">
|
||||
<el-select
|
||||
v-model="commodityForm.cvsGoodId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select
|
||||
v-model="commodityForm.supplierId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<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 ref="tankForm" :model="commodityForm" label-width="20px" :inline="true">
|
||||
<el-form-item label="">
|
||||
<el-select
|
||||
v-model="commodityForm.cvsGoodId"
|
||||
placeholder="请选择商品分类"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="supplierId">
|
||||
<el-select
|
||||
v-model="commodityForm.supplierId"
|
||||
placeholder="请选择供应商名称"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-input v-model="commodityForm.remark" placeholder="请输入商品名称,拼音码,条形码等信息"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="" style="float: right;margin-right: 0px">
|
||||
<el-button type="primary" icon="el-icon-search" @click="inquire()">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-header>
|
||||
<el-main>
|
||||
@ -183,14 +191,11 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column align="center" type="selection" width="55"></el-table-column>
|
||||
|
||||
<el-table-column label="商品名称" align="center" prop="name"/>
|
||||
<el-table-column label="商品编码" align="center" prop="goodsNo"/>
|
||||
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
|
||||
<!-- <el-table-column label="商品编码" align="center" prop="goodsNo"/>-->
|
||||
<el-table-column label="品类名称" prop="cvsGoodId" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
@ -201,14 +206,19 @@
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</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>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="addCommodity">确 定</el-button>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="addCommodity">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@ -219,7 +229,7 @@
|
||||
import {getAuditPremApi} from "@/api/oilConfig/staff";
|
||||
import {BigNumber} from "bignumber.js";
|
||||
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 {listSupplier} from "@/api/convenienceStore/supplier";
|
||||
import {
|
||||
@ -237,7 +247,7 @@ import {
|
||||
|
||||
export default {
|
||||
name: "details",
|
||||
props:[
|
||||
props: [
|
||||
'PreturnsId',
|
||||
'PorderNumber',
|
||||
'PorderDate',
|
||||
@ -247,8 +257,8 @@ export default {
|
||||
return {
|
||||
detailsList: [],
|
||||
commodityList: [],
|
||||
ReturnsId:null,
|
||||
commodityForm:{
|
||||
ReturnsId: null,
|
||||
commodityForm: {
|
||||
cvsGoodId: "",
|
||||
cvsGood: "",
|
||||
supplierId: "",
|
||||
@ -257,8 +267,8 @@ export default {
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
isRecovery:0,
|
||||
total:0,
|
||||
isRecovery: 0,
|
||||
total: 0,
|
||||
},
|
||||
returnsForm: {
|
||||
orderNumber: null,
|
||||
@ -267,23 +277,23 @@ export default {
|
||||
totalAmount: 0, //总金额
|
||||
productQuantity: 0, //商品数量
|
||||
returnQuantity: 0 //进货数量
|
||||
} ,
|
||||
},
|
||||
|
||||
// 商品分类列表
|
||||
cvsGoodList:[],
|
||||
cvsGoodList: [],
|
||||
// 供应商列表
|
||||
supplierList:[],
|
||||
supplierList: [],
|
||||
|
||||
state:'await',
|
||||
state: 'await',
|
||||
|
||||
saveFlag:false,
|
||||
auditFlag:true,
|
||||
voidFlag:true,
|
||||
storageFlag:true,
|
||||
multipleSelection:[], // 表格
|
||||
saveFlag: false,
|
||||
auditFlag: true,
|
||||
voidFlag: true,
|
||||
storageFlag: true,
|
||||
multipleSelection: [], // 表格
|
||||
|
||||
// 弹出框标题
|
||||
title:'选择商品',
|
||||
title: '选择商品',
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
disableInput: false, // 默认不禁用
|
||||
@ -296,9 +306,10 @@ export default {
|
||||
queryParams: {
|
||||
// supplierId: '',
|
||||
returnsId: null,
|
||||
page:null,
|
||||
pageSize:null
|
||||
page: null,
|
||||
pageSize: null
|
||||
},
|
||||
numberInput: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 默认排序
|
||||
@ -306,7 +317,7 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
supplierName: [
|
||||
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
|
||||
{required: true, message: "供应商名称不能为空", trigger: "blur"},
|
||||
],
|
||||
},
|
||||
}
|
||||
@ -322,23 +333,23 @@ export default {
|
||||
this.returnsForm.approvalStatus = this.$props.PapprovalStatus
|
||||
this.state = this.$props.PapprovalStatus
|
||||
|
||||
if ( this.state == null) {
|
||||
if (this.state == null) {
|
||||
this.state = 'await'
|
||||
}
|
||||
|
||||
if (this.state=='await') {
|
||||
if (this.state == 'await') {
|
||||
this.numberInput = false
|
||||
}else {
|
||||
} else {
|
||||
this.numberInput = true
|
||||
}
|
||||
|
||||
|
||||
console.log("this.returnsForm",this.returnsForm)
|
||||
console.log("this.returnsForm", this.returnsForm)
|
||||
if (this.returnsForm.orderNumber == null) {
|
||||
this.refresh();
|
||||
}
|
||||
if (this.returnsForm.orderDate == null) {
|
||||
this.returnsForm.orderDate =new Date()
|
||||
this.returnsForm.orderDate = new Date()
|
||||
}
|
||||
|
||||
this.getDetailsList();
|
||||
@ -346,9 +357,13 @@ export default {
|
||||
this.JudgmentButton();
|
||||
},
|
||||
methods: {
|
||||
// 返回页面
|
||||
cancelPurchase() {
|
||||
this.$router.back()
|
||||
},
|
||||
getDetailsList() {
|
||||
let this_ = this
|
||||
getReturnsDetailsPageApi(this.queryParams).then(res=>{
|
||||
getReturnsDetailsPageApi(this.queryParams).then(res => {
|
||||
this_.detailsList = res.data.records;
|
||||
this.total = res.data.total;
|
||||
this.sumMethod(res.data.records);
|
||||
@ -356,7 +371,7 @@ export default {
|
||||
},
|
||||
getCommodityList() {
|
||||
let this_ = this
|
||||
listLJGoods(this_.commodityForm).then(res=>{
|
||||
listLJGoods(this_.commodityForm).then(res => {
|
||||
this_.commodityList = res.data.records;
|
||||
this.commodityForm.total = response.data.total;
|
||||
// this_.sumMethod(res.data.records);
|
||||
@ -364,37 +379,35 @@ export default {
|
||||
},
|
||||
// 页面跳转
|
||||
goToAbout() {
|
||||
this.$router.push('/convenienceStore/returns/index');
|
||||
this.$router.push('/convenienceStore/purchase/index');
|
||||
},
|
||||
commodityAdd() {
|
||||
this.open = true;
|
||||
},
|
||||
commodityDel(data) {
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (data.id != null) {
|
||||
delDetailsApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
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.sumMethod(this.detailsList);
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
this.sumMethod(this.detailsList);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
@ -404,10 +417,10 @@ export default {
|
||||
},
|
||||
|
||||
// 改变数字时
|
||||
change(data,flag) {
|
||||
change(data, flag) {
|
||||
|
||||
let returnQuantity = new BigNumber( data.returnQuantity);
|
||||
let returnPrice = new BigNumber( data.returnPrice);
|
||||
let returnQuantity = new BigNumber(data.returnQuantity);
|
||||
let returnPrice = new BigNumber(data.returnPrice);
|
||||
let subtotalAmount = new BigNumber(data.subtotalAmount);
|
||||
|
||||
if (flag == 1) {
|
||||
@ -423,7 +436,7 @@ export default {
|
||||
}
|
||||
|
||||
this.sumMethod(this.detailsList);
|
||||
console.log("this.detailsList",this.detailsList)
|
||||
console.log("this.detailsList", this.detailsList)
|
||||
// 进行保存
|
||||
// this.detailsList = data
|
||||
// this.edit()
|
||||
@ -433,45 +446,45 @@ export default {
|
||||
sumMethod(data) {
|
||||
let this_ = this
|
||||
|
||||
if (data.length>0) {
|
||||
if (data.length > 0) {
|
||||
this_.returnsForm.totalAmount = data.length
|
||||
} else {
|
||||
this_.returnsForm.totalAmount = 0
|
||||
}
|
||||
|
||||
this_.returnsForm.productQuantity = data.length,
|
||||
this_.returnsForm.totalAmount = new BigNumber(0),
|
||||
this_.returnsForm.returnQuantity = new BigNumber(0),
|
||||
this_.returnsForm.productQuantity = data.length,
|
||||
this_.returnsForm.totalAmount = new BigNumber(0),
|
||||
this_.returnsForm.returnQuantity = new BigNumber(0),
|
||||
|
||||
data.forEach(da => {
|
||||
if (da.returnPrice != null) {
|
||||
this_.returnsForm.returnQuantity= this_.returnsForm.returnQuantity.plus(da.returnQuantity)
|
||||
}
|
||||
if (da.subtotalAmount != null) {
|
||||
this_.returnsForm.totalAmount= this_.returnsForm.totalAmount.plus(da.subtotalAmount)
|
||||
}
|
||||
})
|
||||
data.forEach(da => {
|
||||
if (da.returnPrice != null) {
|
||||
this_.returnsForm.returnQuantity = this_.returnsForm.returnQuantity.plus(da.returnQuantity)
|
||||
}
|
||||
if (da.subtotalAmount != null) {
|
||||
this_.returnsForm.totalAmount = this_.returnsForm.totalAmount.plus(da.subtotalAmount)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
addCommodity () {
|
||||
addCommodity() {
|
||||
let this_ = this
|
||||
let sum = 0;
|
||||
this.multipleSelection.forEach(mul=>{
|
||||
this.multipleSelection.forEach(mul => {
|
||||
let flag = true;
|
||||
this_.detailsList.forEach(det=>{
|
||||
this_.detailsList.forEach(det => {
|
||||
if (mul.id == det.goodsId) {
|
||||
flag = false
|
||||
sum++
|
||||
}
|
||||
})
|
||||
if(flag) {
|
||||
if (flag) {
|
||||
let now = {
|
||||
goodsId: mul.id,
|
||||
commodityName: mul.name,
|
||||
supplierId: mul.supplierId,
|
||||
cvsGoodId: mul.cvsGoodId,
|
||||
unit:mul.unit,
|
||||
preInboundInventory:mul.stock,
|
||||
unit: mul.unit,
|
||||
preInboundInventory: mul.stock,
|
||||
returnQuantity: 0,
|
||||
returnPrice: 0,
|
||||
subtotalAmount: 0
|
||||
@ -480,8 +493,8 @@ export default {
|
||||
}
|
||||
|
||||
})
|
||||
if(sum>0) {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
if (sum > 0) {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了" + sum + "件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
this.multipleSelection = []
|
||||
@ -495,14 +508,14 @@ export default {
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
isRecovery: 0,
|
||||
}
|
||||
this.commodityList = []
|
||||
this_.sumMethod(this_.detailsList);
|
||||
},
|
||||
|
||||
// 查询搜索列表信息
|
||||
getQueryList(){
|
||||
getQueryList() {
|
||||
selectTree().then(response => {
|
||||
this.cvsGoodList = response.data.records
|
||||
});
|
||||
@ -523,53 +536,52 @@ export default {
|
||||
let min = 100; // 最小的四位数是 1000
|
||||
let max = 999; // 最大的四位数是 9999
|
||||
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("退货审核");
|
||||
if (judgmentPermissions1 > 0){
|
||||
this.auditFlag=false,
|
||||
this.voidFlag=false
|
||||
if (judgmentPermissions1 > 0) {
|
||||
this.auditFlag = false,
|
||||
this.voidFlag = false
|
||||
}
|
||||
let judgmentPermissions2 = await this.judgmentPermissions("退货出库");
|
||||
if (judgmentPermissions2 > 0){
|
||||
if (judgmentPermissions2 > 0) {
|
||||
this.storageFlag = false
|
||||
}
|
||||
|
||||
let judgmentPermissions3 = await this.judgmentPermissions("退货废止");
|
||||
if (judgmentPermissions3 > 0){
|
||||
this.voidFlag=false
|
||||
}else {
|
||||
this.voidFlag=true
|
||||
if (judgmentPermissions3 > 0) {
|
||||
this.voidFlag = false
|
||||
} else {
|
||||
this.voidFlag = true
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
// 判断权限
|
||||
async judgmentPermissions(data) {
|
||||
let fil ={
|
||||
auditPrem:data
|
||||
let fil = {
|
||||
auditPrem: data
|
||||
}
|
||||
return await getAuditPremApi(fil).then(res => {
|
||||
return res.data
|
||||
});
|
||||
},
|
||||
|
||||
async save(flag){
|
||||
async save(flag) {
|
||||
let this_ = this
|
||||
let con = true
|
||||
// 保存之前进行判断
|
||||
if (this_.returnsForm.orderNumber == null) {
|
||||
this.$modal.msgError("退货单号不能为空");
|
||||
return -1;
|
||||
}else if (this_.returnsForm.orderDate == null) {
|
||||
} else if (this_.returnsForm.orderDate == null) {
|
||||
this.$modal.msgError("退货时间不能为空");
|
||||
return -1;
|
||||
}else if(this_.detailsList.length<=0) {
|
||||
} else if (this_.detailsList.length <= 0) {
|
||||
this.$modal.msgError("退货单不能为空");
|
||||
return -1;
|
||||
}
|
||||
@ -577,21 +589,21 @@ export default {
|
||||
if (this_.returnsId == null) {
|
||||
// 新增
|
||||
this_.returnsForm.approvalStatus = 'await'
|
||||
await addReturnsApi(this_.returnsForm).then(res=>{
|
||||
await addReturnsApi(this_.returnsForm).then(res => {
|
||||
this_.returnsId = res.data.id
|
||||
this.queryParams.returnsId = res.data.id
|
||||
}).catch(res=>{
|
||||
}).catch(res => {
|
||||
this.$modal.msgError("保存失败");
|
||||
con = false
|
||||
return;
|
||||
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
// 修改
|
||||
this_.returnsForm.id = this_.returnsId
|
||||
this.queryParams.returnsId = this_.returnsId
|
||||
await editReturnsApi(this_.returnsForm).then(res=> {
|
||||
}).catch(res=>{
|
||||
await editReturnsApi(this_.returnsForm).then(res => {
|
||||
}).catch(res => {
|
||||
this.$modal.msgError("保存失败");
|
||||
con = false
|
||||
|
||||
@ -600,16 +612,16 @@ export default {
|
||||
}
|
||||
// 批量保存订单
|
||||
if (con) {
|
||||
this_.detailsList.forEach(data=>{
|
||||
this_.detailsList.forEach(data => {
|
||||
data.returnsId = this_.returnsId
|
||||
})
|
||||
|
||||
await batchProcessingApi(this_.detailsList).then(res=>{
|
||||
await batchProcessingApi(this_.detailsList).then(res => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
if (flag != -1) {
|
||||
this.goToAbout();
|
||||
}
|
||||
}).catch(res=>{
|
||||
}).catch(res => {
|
||||
this.$modal.msgError("保存失败");
|
||||
})
|
||||
}
|
||||
@ -617,20 +629,20 @@ export default {
|
||||
|
||||
},
|
||||
// 保存并审核
|
||||
async audit(){
|
||||
async audit() {
|
||||
// 保存
|
||||
let number = await this.save(-1);
|
||||
if (number != -1) {
|
||||
// 审核
|
||||
let fil ={
|
||||
let fil = {
|
||||
id: this.returnsId
|
||||
}
|
||||
console.log(" id: this.ReturnsId",fil)
|
||||
console.log(" id: this.ReturnsId", fil)
|
||||
await auditReturnsApi(fil).then(res => {
|
||||
if (res.data) {
|
||||
this.state = 'ysh'
|
||||
this.$modal.msgWarning("审核成功");
|
||||
}else {
|
||||
} else {
|
||||
this.$modal.msgWarning("暂无审核权限");
|
||||
}
|
||||
this.goToAbout()
|
||||
@ -641,14 +653,14 @@ export default {
|
||||
// 入库
|
||||
storage() {
|
||||
let this_ = this;
|
||||
// 保存之前进行判断
|
||||
if (this_.returnsForm.orderNumber == null) {
|
||||
// 保存之前进行判断
|
||||
if (this_.returnsForm.orderNumber == null) {
|
||||
this.$modal.msgError("退货单号不能为空");
|
||||
return -1;
|
||||
}else if (this_.returnsForm.orderDate == null) {
|
||||
} else if (this_.returnsForm.orderDate == null) {
|
||||
this.$modal.msgError("退货时间不能为空");
|
||||
return -1;
|
||||
}else if(this_.detailsList.length<=0) {
|
||||
} else if (this_.detailsList.length <= 0) {
|
||||
this.$modal.msgError("退货单不能为空");
|
||||
return -1;
|
||||
}
|
||||
@ -659,7 +671,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 审核
|
||||
let fil ={
|
||||
let fil = {
|
||||
id: this.returnsId
|
||||
}
|
||||
storageReturnsApi(fil).then(res => {
|
||||
@ -676,7 +688,7 @@ export default {
|
||||
|
||||
|
||||
// 作废
|
||||
abolition(){
|
||||
abolition() {
|
||||
if (this.returnsId < 0) {
|
||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||
return;
|
||||
@ -686,7 +698,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let fil ={
|
||||
let fil = {
|
||||
id: this.returnsId
|
||||
}
|
||||
abolitionReturnsApi(fil).then(res => {
|
||||
@ -706,19 +718,19 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
// 导出
|
||||
// 导出
|
||||
async exportExcel() {
|
||||
|
||||
let fil ={
|
||||
let fil = {
|
||||
returnsId: this.returnsId
|
||||
}
|
||||
|
||||
exportExcelApi(fil).then(res=>{
|
||||
console.log("res",res)
|
||||
exportExcelApi(fil).then(res => {
|
||||
console.log("res", 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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container{
|
||||
.app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
|
||||
.box {
|
||||
height: 100%;
|
||||
height: 80%;
|
||||
width: 212px;
|
||||
margin-right: 10px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
border: 1px solid #EEEEEE;
|
||||
border: 1px solid #FF9655;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<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-item label="" prop="orderNumber">
|
||||
<el-input v-model="queryParams.orderNumber" placeholder="业务单号" />
|
||||
<el-input v-model="queryParams.orderNumber" placeholder="请输入退货单号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="" v-model="queryParams.supplierId" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.supplierId"
|
||||
placeholder="供应商"
|
||||
placeholder="请选择供应商"
|
||||
clearable
|
||||
style="width: 230px"
|
||||
>
|
||||
@ -16,7 +16,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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
|
||||
v-for="dict in dict.type.oilPurchasedStatus"
|
||||
:key="dict.value"
|
||||
@ -25,75 +25,102 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="日期选择" prop="status">
|
||||
<el-date-picker
|
||||
v-model="queryParams.dateRange"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="">
|
||||
<el-date-picker
|
||||
v-model="beginTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="开始日期">
|
||||
</el-date-picker>
|
||||
至
|
||||
<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-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</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 type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="detailsAdd"
|
||||
v-hasPermi="['convenienceStore:returns:index']"
|
||||
>新增退货订单</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
</el-row>
|
||||
>新增退货订单
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="returnsList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="业务单号" align="center" prop="orderNumber"/>
|
||||
<el-table-column label="供应商" align="center" prop="supplierName"/>
|
||||
<el-table-column label="退货数量" align="center" prop="returnQuantity"/>
|
||||
<el-table-column label="单据金额" align="center" prop="totalAmount"/>
|
||||
<div style="height: 71vh;overflow: auto">
|
||||
<el-table ref="tables" border
|
||||
v-loading="loading"
|
||||
:data="returnsList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="序号" align="center" type="index" width="60"/>
|
||||
<el-table-column label="退货单号" align="center" prop="orderNumber"/>
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
|
||||
<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="danger" size="medium">已审核</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="制单人" align="center" prop="createByName"/>
|
||||
<el-table-column label="制单日期" align="center" prop="orderDate" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderDate) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核人" align="center" prop="approverName"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<div style="color: #FF9655" v-if="scope.row.approvalStatus == 'await'">待审核</div>
|
||||
<div style="color: #0DC291" v-if="scope.row.approvalStatus == 'qrts'" >已审核入库</div>
|
||||
<div style="color: #F44522" v-if="scope.row.approvalStatus == 'yzf'" >已作废</div>
|
||||
<div style="color: #409EFF" v-if="scope.row.approvalStatus == 'ysh'" >已审核</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="制单人" align="center" prop="createByName"/>
|
||||
<el-table-column label="审核人" align="center" prop="approverName"/>
|
||||
<el-table-column label="入库人" align="center" prop="storageName"/>
|
||||
<el-table-column label="制单时间" align="center" prop="orderDate" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderDate) }}</span>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="dispose(scope.row)"
|
||||
>处理单据</el-button>
|
||||
</template>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
v-if="scope.row.approvalStatus == 'await'"
|
||||
@click="dispose(scope.row)"
|
||||
>退货审核
|
||||
</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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
@ -102,7 +129,7 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@ -118,11 +145,11 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
returnsList:[],
|
||||
returnsList: [],
|
||||
// 供应商列表
|
||||
supplierList:[],
|
||||
supplierList: [],
|
||||
// 弹出框标题
|
||||
title:'',
|
||||
title: '',
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
disableInput: false, // 默认不禁用
|
||||
@ -141,6 +168,8 @@ export default {
|
||||
page: null,
|
||||
pageSize: null,
|
||||
},
|
||||
beginTime: "",
|
||||
endTime: "",
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 默认排序
|
||||
@ -156,16 +185,21 @@ export default {
|
||||
methods: {
|
||||
|
||||
// 获取列表
|
||||
getList(){
|
||||
getList() {
|
||||
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.total = response.data.total;
|
||||
})
|
||||
this.loading = false;
|
||||
},
|
||||
// 查询搜索列表信息
|
||||
getQueryList(){
|
||||
getQueryList() {
|
||||
listSupplier().then(response => {
|
||||
this.supplierList = response.data.records
|
||||
})
|
||||
@ -194,6 +228,8 @@ export default {
|
||||
// 重置
|
||||
resetQuery() {
|
||||
this.queryParams = {}
|
||||
this.beginTime = ''
|
||||
this.endTime = ''
|
||||
this.handleQuery()
|
||||
},
|
||||
// 删除
|
||||
@ -215,7 +251,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container{
|
||||
.app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
|
@ -37,6 +37,10 @@ public class MtReturns extends BaseEntity {
|
||||
* 审核人
|
||||
*/
|
||||
private String approver;
|
||||
/**
|
||||
* 入库人
|
||||
*/
|
||||
private String storage;
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
@ -53,7 +57,16 @@ public class MtReturns extends BaseEntity {
|
||||
* 店铺ID
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
|
@ -129,8 +129,11 @@
|
||||
mp.return_quantity returnQuantity,
|
||||
mp.approval_status approvalStatus,
|
||||
mp.order_date orderDate,
|
||||
mp.examine_time examineTime,
|
||||
mp.storage_time storageTime,
|
||||
ms1.real_name createByName,
|
||||
ms2.real_name approverName,
|
||||
ms3.real_name storageName,
|
||||
mp.create_time createTime
|
||||
FROM
|
||||
mt_returns mp
|
||||
@ -138,6 +141,7 @@
|
||||
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.storage = ms3.id
|
||||
<where>
|
||||
mp.store_id = #{mtReturns.storeId}
|
||||
|
||||
@ -150,6 +154,12 @@
|
||||
<if test="mtReturns.supplierId != null">
|
||||
and mg.supplier_id = #{mtReturns.supplierId}
|
||||
</if>
|
||||
<if test="mtReturns.params.beginTime != null and mtReturns.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(mp.order_date,'%y%m%d') >= 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') <= date_format(#{mtReturns.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
mp.id
|
||||
@ -208,6 +218,9 @@
|
||||
<if test="approver != null and approver != ''">
|
||||
approver = #{approver},
|
||||
</if>
|
||||
<if test="storage != null and storage != ''">
|
||||
storage = #{storage},
|
||||
</if>
|
||||
<if test="totalAmount != null">
|
||||
total_amount = #{totalAmount},
|
||||
</if>
|
||||
@ -220,6 +233,12 @@
|
||||
<if test="storeId != null">
|
||||
store_id = #{storeId},
|
||||
</if>
|
||||
<if test="examineTime != null">
|
||||
examine_time = #{examineTime},
|
||||
</if>
|
||||
<if test="storageTime != null">
|
||||
storage_time = #{storageTime},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
|
@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -201,7 +202,7 @@ public class MtReturnsServiceImpl implements MtReturnsService {
|
||||
}
|
||||
String status = "qrts";
|
||||
|
||||
boolean edit = edit(id);
|
||||
boolean edit = edit1(id);
|
||||
int i = mtReturnsDao.editStateById(id, status);
|
||||
return true;
|
||||
}
|
||||
@ -215,6 +216,18 @@ public class MtReturnsServiceImpl implements MtReturnsService {
|
||||
|
||||
MtReturns mtReturns = new MtReturns();
|
||||
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);
|
||||
int update = mtReturnsDao.update(mtReturns);
|
||||
return update>0;
|
||||
|
@ -7,6 +7,7 @@ import lombok.Data;
|
||||
public class MtReturnsVO extends MtReturns {
|
||||
private String createByName;
|
||||
private String approverName;
|
||||
private String storageName;
|
||||
private String supplierName;
|
||||
private Integer detailsId;
|
||||
private Integer supplierId;
|
||||
|
Loading…
Reference in New Issue
Block a user