Merge branch 'dev' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into ymf
This commit is contained in:
commit
aff6bd0998
|
|
@ -1,14 +1,16 @@
|
|||
ENV = 'development'
|
||||
|
||||
# 接口地址
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.17:8000'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.202:8000'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
|
||||
# 测试
|
||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
# 线上
|
||||
# 生产
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.96:8000'
|
||||
# 张松
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.147:8000/'
|
||||
VUE_APP_WS_API = 'ws://192.168.2.128:8000'
|
||||
|
||||
# 是否启用 babel-plugin-dynamic-import-node插
|
||||
|
|
@ -2,8 +2,10 @@ ENV = 'production'
|
|||
|
||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
# 测试
|
||||
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||
# 生产
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||
# 如果接口是 http 形式, wss 需要改为 ws
|
||||
VUE_APP_WS_API = 'wss://123.56.110.252
|
||||
|
|
|
|||
|
|
@ -43,9 +43,12 @@
|
|||
"normalize.css": "7.0.0",
|
||||
"nprogress": "0.2.0",
|
||||
"path-to-regexp": "2.4.0",
|
||||
"qrcode": "^1.5.3",
|
||||
"qs": "^6.10.1",
|
||||
"reconnecting-websocket": "^4.4.0",
|
||||
"screenfull": "4.2.0",
|
||||
"sortablejs": "^1.15.2",
|
||||
"terser-webpack-plugin": "^4.2.3",
|
||||
"vue": "^2.6.14",
|
||||
"vue-amap": "^0.5.10",
|
||||
"vue-clipboard2": "^0.3.3",
|
||||
|
|
@ -78,6 +81,7 @@
|
|||
"babel-jest": "23.6.0",
|
||||
"babel-plugin-dynamic-import-node": "2.3.0",
|
||||
"babel-plugin-transform-remove-console": "^6.9.4",
|
||||
"cache-loader": "^4.1.0",
|
||||
"chalk": "2.4.2",
|
||||
"chokidar": "2.1.5",
|
||||
"compression-webpack-plugin": "5.0.2",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<meta http-equiv="pragram" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= webpackConfig.name %></title>
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
|
|
@ -15,12 +15,13 @@ export default {
|
|||
高宽分别对应横竖滚动条的尺寸*/
|
||||
::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
/*定义滚动条轨道
|
||||
内阴影+圆角*/
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #F5F5F5;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/*定义滑块
|
||||
|
|
|
|||
|
|
@ -0,0 +1,166 @@
|
|||
import request from "@/utils/request";
|
||||
|
||||
/**
|
||||
* 查询耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsType(params) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function puttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfo(params) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 耗材入库
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfostockIn(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo/stockIn',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改单位耗材值耗材
|
||||
* @returns
|
||||
*/
|
||||
export function postapitbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询查询耗材规格信息
|
||||
* @returns
|
||||
*/
|
||||
export function getviewConSku(params) {
|
||||
return request({
|
||||
url: '/api/viewConSku',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询查询商品规格
|
||||
* @returns
|
||||
*/
|
||||
export function gettbProductSpec(params) {
|
||||
return request({
|
||||
url: '/api/viewProductSkuShop',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息-修改后
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCons(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改商品规格耗材信息状态
|
||||
* @returns
|
||||
*/
|
||||
export function puttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑单位耗材值
|
||||
// export function puttbProskuCon(data) {
|
||||
// return request({
|
||||
// url: '/api/tbProskuCon',
|
||||
// method: "put",
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
/**
|
||||
* 删除商品规格耗材信息状态
|
||||
* @returns
|
||||
*/
|
||||
export function deletetbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材流水信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfoFlow(params) {
|
||||
return request({
|
||||
url: '/api/tbConsInfoFlow',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
@ -11,7 +11,24 @@ export function tbProductGet(params) {
|
|||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function tbProductlist(params) {
|
||||
return request({
|
||||
url: "/api/tbProduct/list",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 商品分类列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCategoryGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 进销存类型字典
|
||||
* @returns
|
||||
|
|
@ -59,7 +76,14 @@ export function tbShopPurveyorGet(params) {
|
|||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 供应商列表1
|
||||
export function tbShopPurveyorGets(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 增加供应商
|
||||
* @returns
|
||||
|
|
@ -95,7 +119,14 @@ export function tbShopPurveyorTransactInfo(data) {
|
|||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 付款
|
||||
export function paidAmount(data) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/payTransact`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 进货账目汇总(单一供应商)
|
||||
* @returns
|
||||
|
|
@ -149,19 +180,26 @@ export function tbProductStockOperateOutAndOn(data) {
|
|||
*/
|
||||
export function stock(params) {
|
||||
return request({
|
||||
url: `/api/stock`,
|
||||
url: `/api/stock/v2`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 库存列表子集列表
|
||||
export function stocks(params) {
|
||||
return request({
|
||||
url: `/api/stock/sku`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @returns
|
||||
*/
|
||||
export function stockdownload(data) {
|
||||
return request({
|
||||
url: "/api/stock/download",
|
||||
url: "/api/stock/download/v2",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
|
|
@ -180,7 +218,7 @@ export function stockdoImport(file) {
|
|||
formData.append("file", file);
|
||||
formData.append("shopId", localStorage.getItem("shopId"));
|
||||
return request({
|
||||
url: "/api/stock/doImport",
|
||||
url: "/api/stock/doImport/v2",
|
||||
method: "post",
|
||||
data: formData,
|
||||
Headers: {
|
||||
|
|
@ -203,3 +241,122 @@ export function stockStateChange(params) {
|
|||
}
|
||||
});
|
||||
}
|
||||
// 警戒设置
|
||||
export function stockStatewarnLine(params) {
|
||||
return request({
|
||||
url: `/api/stock/warnLine`,
|
||||
method: "put",
|
||||
data: {
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
// 共享库存
|
||||
export function stockStateChanges(params) {
|
||||
return request({
|
||||
url: `/api/stock/productStatus`,
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增盘点
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductStocktakin(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStocktakin`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 盘点记录查询
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductStocktakinGet(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStocktakin`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 账单付款记录
|
||||
export function tbShopPurveyorTransacttransactPayInfos(params) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyorTransact/transactPayInfos`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function tbConsInfoGet(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfo`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 耗材出入库
|
||||
* @returns
|
||||
*/
|
||||
export function stockInOut(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfo/stockInOut`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增盘点耗材
|
||||
* @returns
|
||||
*/
|
||||
export function tbConCheck(data) {
|
||||
return request({
|
||||
url: `/api/tbConCheck`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询盘点耗材
|
||||
* @returns
|
||||
*/
|
||||
export function tbConCheckGet(data) {
|
||||
return request({
|
||||
url: `/api/tbConCheck`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,19 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.typeEnum }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否售罄">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isPauseSale == 1?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否分销">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isDistribute == 1?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.lowPrice }}
|
||||
|
|
@ -40,7 +53,7 @@
|
|||
{{ scope.row.realSalesNumber }}/{{ scope.row.stockNumber }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类" prop="categoryName"></el-table-column>
|
||||
<el-table-column label="分类名称" prop="categoryName"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
|
|
|
|||
|
|
@ -416,3 +416,25 @@ export function isPcBowser() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保留小数n位,不进行四舍五入
|
||||
* num你传递过来的数字,
|
||||
* decimal你保留的几位,默认保留小数后两位
|
||||
* isInt 是否保留0
|
||||
*/
|
||||
export function formatDecimal(num, decimal = 2, isInt = false) {
|
||||
num = num.toFixed(3).toString();
|
||||
const index = num.indexOf(".");
|
||||
if (index !== -1) {
|
||||
num = num.substring(0, decimal + index + 1);
|
||||
} else {
|
||||
num = num.substring(0);
|
||||
}
|
||||
//截取后保留两位小数
|
||||
if (isInt) {
|
||||
return parseFloat(num);
|
||||
} else {
|
||||
return parseFloat(num).toFixed(decimal);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,11 +61,16 @@
|
|||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
|
||||
<el-table-column label="日期" prop="tradeDay"></el-table-column>
|
||||
<el-table-column label="总金额" prop="total">
|
||||
<el-table-column label="营业额" prop="total">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.total }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售额" prop="total">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.total | totalfilter(scope.row.refund) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="微信小程序支付" prop="wxLite">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.wxLite }}
|
||||
|
|
@ -91,6 +96,12 @@
|
|||
¥{{ scope.row.deposit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="充值金额" prop="cash">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.recharge }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="退款金额" prop="cash">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.refund }}
|
||||
|
|
@ -101,6 +112,7 @@
|
|||
<el-table-column label="商品名称" prop="productName"></el-table-column>
|
||||
<el-table-column label="商品分类" prop="cateName"></el-table-column>
|
||||
<el-table-column label="商品描述" prop="productSkuName"></el-table-column>
|
||||
<el-table-column label="单价" prop="price"></el-table-column>
|
||||
<el-table-column label="销量" prop="salesNum"></el-table-column>
|
||||
<el-table-column label="退单量" prop="refNum"></el-table-column>
|
||||
<el-table-column label="销售金额" prop="salesAmount">
|
||||
|
|
@ -156,6 +168,10 @@ export default {
|
|||
filters: {
|
||||
timeFilter(time) {
|
||||
return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
totalfilter(item,d) {
|
||||
let num = item + d
|
||||
return num.toFixed(2)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,210 @@
|
|||
<!-- 新增耗材盘点 -->
|
||||
<template>
|
||||
<el-dialog title="耗材盘点" :visible.sync="dialogVisible" width="80%" @open="form.note = ''">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
|
||||
<el-form-item label="账存数量">
|
||||
<el-input :value="detail.num" readonly style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际数量">
|
||||
<el-input-number v-model="form.lpNum" :min="0" :step="1" step-strictly
|
||||
style="width: 180px;"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏数量">
|
||||
<el-input :value="profitNumber" readonly :class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价">
|
||||
<el-input v-model="detail.price" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏金额">
|
||||
<el-input :value="profitPrice" readonly :class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="备注">
|
||||
<el-input v-model="form.note" placeholder="请输入备注" style="width: 300px;"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading" border stripe>
|
||||
<!-- <el-table-column label="商品信息" width="150px">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg" style="width: 30px;height: 30px;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="售价" prop="price">
|
||||
<template v-slot="scope">
|
||||
¥{{ formatDecimal(scope.row.price) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="帐存库存" prop="stockNumber"></el-table-column>
|
||||
<el-table-column label="盈亏数量" prop="lpNum"></el-table-column>
|
||||
<el-table-column label="盈亏金额" prop="lpAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ formatDecimal(scope.row.lpAmount) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际库存" prop="acStockNumber"></el-table-column>
|
||||
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
|
||||
<!-- <el-table-column label="盘点备注" prop="note"></el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-sizes="[5, 10, 30, 50]"
|
||||
:page-size="tableData.size" @current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDecimal } from '@/utils'
|
||||
import { tbConCheck, tbConCheckGet } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
detail: '',
|
||||
form: {
|
||||
conInfoId: '',
|
||||
lpNum: 0
|
||||
},
|
||||
rules: {
|
||||
stocktakinNum: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入盘点数量',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
resetForm: '',
|
||||
searhForm: {
|
||||
name: '',
|
||||
skuId: '',
|
||||
productId: ''
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 5,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
},
|
||||
computed: {
|
||||
profitNumber() {
|
||||
return this.form.lpNum - this.detail.num
|
||||
},
|
||||
profitPrice() {
|
||||
return formatDecimal((this.form.lpNum - this.detail.num) * this.detail.price)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
let res = await tbConCheck({
|
||||
conInfoId: this.form.conInfoId,
|
||||
lpNum: this.profitNumber
|
||||
})
|
||||
this.detail.num = this.form.lpNum
|
||||
this.form.lpNum = 0
|
||||
this.form.lpNum = this.detail.num
|
||||
|
||||
this.$emit('success', res)
|
||||
this.loading = false
|
||||
this.$message({
|
||||
title: '注意',
|
||||
message: `添加成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
show(obj) {
|
||||
// console.log(obj);
|
||||
this.detail = { ...obj }
|
||||
this.detail.num = formatDecimal(obj.stockNumber - obj.stockConsume, 2, false)
|
||||
this.dialogVisible = true
|
||||
this.form.conInfoId = obj.id
|
||||
this.form.lpNum = this.detail.num
|
||||
|
||||
this.searhForm.skuId = obj.productId
|
||||
this.searhForm.productId = obj.proId
|
||||
|
||||
this.tableData.page = 0
|
||||
this.tableData.total = 0
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 商品列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await tbConCheckGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conInfoId: this.form.conInfoId,
|
||||
sort: 'id,desc',
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.lose {
|
||||
&::v-deep .el-input__inner {
|
||||
color: rgb(238, 29, 29);
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
<!-- 新增库存盘点 -->
|
||||
<template>
|
||||
<el-dialog title="库存盘点" :visible.sync="dialogVisible" width="80%" @open="form.note = ''">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
|
||||
<el-form-item label="账存数量">
|
||||
<el-input v-model="detail.stockNumber" readonly style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际数量">
|
||||
<el-input-number v-model="form.stocktakinNum" :min="0" :step="1" step-strictly
|
||||
style="width: 180px;"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏数量">
|
||||
<el-input v-model="profitNumber" readonly :class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单价">
|
||||
<el-input v-model="detail.salePrice" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="盈亏金额">
|
||||
<el-input v-model="profitPrice" readonly :class="{ lose: profitNumber < 0 }"
|
||||
style="width: 180px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.note" placeholder="请输入备注" style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading" border stripe>
|
||||
<el-table-column label="商品信息" width="150px">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg" style="width: 30px;height: 30px;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价" prop="price">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.price }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="帐存库存" prop="stock"></el-table-column>
|
||||
<el-table-column label="盈亏数量" prop="phaseNum"></el-table-column>
|
||||
<el-table-column label="盈亏金额" prop="phasePrice">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.phasePrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际库存" prop="inventoryStock"></el-table-column>
|
||||
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
|
||||
<el-table-column label="盘点备注" prop="note"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-sizes="[5, 10, 30, 50]"
|
||||
:page-size="tableData.size" @current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDecimal } from '@/utils'
|
||||
import { tbProductStocktakin, tbProductStocktakinGet } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
detail: '',
|
||||
form: {
|
||||
skuId: '', // sku商品必传
|
||||
productId: '', // 必传
|
||||
stocktakinNum: '', // 必传
|
||||
price: '', // 商品价格 非必传 为空盘点价格为商品价格
|
||||
note: "" // 盘点备注 非必传
|
||||
},
|
||||
rules: {
|
||||
stocktakinNum: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入盘点数量',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
resetForm: '',
|
||||
searhForm: {
|
||||
name: '',
|
||||
skuId: '',
|
||||
productId: ''
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 5,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetForm = { ...this.form }
|
||||
},
|
||||
computed: {
|
||||
profitNumber() {
|
||||
return this.form.stocktakinNum - this.detail.stockNumber
|
||||
},
|
||||
profitPrice() {
|
||||
return formatDecimal((this.form.stocktakinNum - this.detail.stockNumber) * this.detail.salePrice)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmitHandle() {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.loading = true
|
||||
let res = await tbProductStocktakin(this.form)
|
||||
this.detail.stockNumber = this.form.stocktakinNum
|
||||
this.$emit('success', res)
|
||||
// this.dialogVisible = false
|
||||
this.loading = false
|
||||
this.$notify({
|
||||
title: '注意',
|
||||
message: `添加成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
show(obj) {
|
||||
console.log(obj);
|
||||
this.detail = { ...obj }
|
||||
this.dialogVisible = true
|
||||
this.form.skuId = obj.skuId
|
||||
this.form.productId = obj.proId
|
||||
this.form.stocktakinNum = obj.stockNumber
|
||||
|
||||
this.searhForm.skuId = obj.productId
|
||||
this.searhForm.productId = obj.proId
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 商品列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const res = await tbProductStocktakinGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.searhForm.name,
|
||||
skuId: this.searhForm.category,
|
||||
productId: this.searhForm.productId,
|
||||
sort: 'id,desc',
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.lose {
|
||||
&::v-deep .el-input__inner {
|
||||
color: rgb(238, 29, 29);
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -10,9 +10,9 @@
|
|||
<el-form-item label="地址">
|
||||
<el-input type="textarea" v-model="form.address" placeholder="请输入地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签">
|
||||
<!-- <el-form-item label="标签">
|
||||
<el-input v-model="form.tip" placeholder="请输入标签"></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -35,7 +35,7 @@ export default {
|
|||
purveyorName: '',
|
||||
purveyorTelephone: '',
|
||||
address: '',
|
||||
tip: '',
|
||||
// tip: '',
|
||||
remark: '',
|
||||
},
|
||||
rules: {
|
||||
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.form.purveyorName = ''
|
||||
this.form.purveyorTelephone = ''
|
||||
this.form.address = ''
|
||||
this.form.tip = ''
|
||||
// this.form.tip = ''
|
||||
this.form.remark = ''
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,170 @@
|
|||
<!-- 耗材列表 -->
|
||||
<template>
|
||||
<el-dialog title="选择耗材" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||
<el-form :model="searchForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.conTypeName" placeholder="耗材类型名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.conCode" placeholder="耗材代码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.conName" placeholder="耗材名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading" @select="firstSelectChange">
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column label="耗材名称" prop="conName"></el-table-column>
|
||||
<el-table-column label="价格" prop="price"></el-table-column>
|
||||
<el-table-column label="耗材代码" prop="conCode"></el-table-column>
|
||||
<el-table-column label="耗材类型名称" prop="conTypeName"></el-table-column>
|
||||
<el-table-column label="单位" prop="conUnit"></el-table-column>
|
||||
<el-table-column label="最近入库量" prop="lasterInStock"></el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
{{ formatDecimal(scope.row.stockNumber - scope.row.stockConsume, 2, true) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="primary" size="mini" @click="confirmHandle(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDecimal } from '@/utils'
|
||||
import { tbConsInfoGet } from "@/api/invoicing";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
dialogVisible: false,
|
||||
searchForm: {
|
||||
conTypeId: '',
|
||||
conTypeName: '',
|
||||
conCode: '',
|
||||
conName: ''
|
||||
},
|
||||
resetSearchForm: '',
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
},
|
||||
goods: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetSearchForm = { ...this.searchForm }
|
||||
},
|
||||
methods: {
|
||||
firstSelectChange() {
|
||||
// console.log(selection)
|
||||
let selection = this.$refs.table.selection
|
||||
if (selection.length > 1 && this.isselect) {
|
||||
const del_row = selection.shift();
|
||||
this.$refs.table.toggleRowSelection(del_row, false);
|
||||
}
|
||||
},
|
||||
// 确定选商品
|
||||
confirmHandle() {
|
||||
let res = this.$refs.table.selection
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.searchForm = { ...this.resetSearchForm }
|
||||
this.tableData.page = 0
|
||||
this.tableData.size = 10
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 耗材列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbConsInfoGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
...this.searchForm
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
|
||||
if (this.goods.length) {
|
||||
this.$nextTick(() => {
|
||||
this.selection()
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
show(goods) {
|
||||
this.dialogVisible = true
|
||||
if (goods && goods.length) {
|
||||
this.goods = goods
|
||||
} else {
|
||||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.getTableData()
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
selection() {
|
||||
this.goods.forEach(row => {
|
||||
this.tableData.list.forEach((item, index) => {
|
||||
if (row.id == item.id) {
|
||||
this.$refs.table.toggleRowSelection(this.tableData.list[index]);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -29,6 +29,8 @@
|
|||
<el-tag type="info">{{ scope.row.type }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原有库存" prop="leftNumber">
|
||||
</el-table-column>
|
||||
<el-table-column label="变动数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
<span class="num" :class="{ active: scope.row.stockNumber > 0 }">
|
||||
|
|
@ -81,7 +83,6 @@ export default {
|
|||
methods: {
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
console.log(this.query.createdAt, '调试111')
|
||||
let arr = []
|
||||
if (this.query.createdAt.length) {
|
||||
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-dialog title="详情" width="80%" :visible.sync="dialogVisible" @close="dialogVisible = false">
|
||||
<div class="head-container">
|
||||
<span>【{{ tableData.detail.type == 'reject' ? '退货出库' : '供应商入库' }}】</span>
|
||||
<span>【{{ tableData.detail.subType == '-1' ? '退货出库' : '供应商入库' }}】</span>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.detail.stockSnap" v-loading="tableData.loading" height="400px">
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<el-table-column label="原库存" prop="stockNumber"></el-table-column>
|
||||
<el-table-column label="变动数量" prop="number">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.number }} {{ scope.row.unitName }}
|
||||
<span v-if="tableData.detail.subType==-1">-</span> {{ scope.row.number }} {{ scope.row.unitName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现有库存" prop="number">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,208 @@
|
|||
<template>
|
||||
<el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||
<el-form :model="searhForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searhForm.name" placeholder="商品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searhForm.category" placeholder="商品分类">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in categoryList"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="tableData.list" @select="firstSelectChange" v-loading="tableData.loading">
|
||||
<el-table-column type="selection" width="55" align="center"></el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.coverImg" style="width: 30px;height: 30px;">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span>{{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.typeEnum }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否售罄">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isPauseSale == 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="是否分销">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isDistribute == 1 ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.lowPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销量/库存">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.realSalesNumber }}/{{ scope.row.stockNumber }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类名称" prop="categoryName"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmHandle">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbShopCategoryGet, tbProductlist } from "@/api/invoicing";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
searhForm: {
|
||||
name: '',
|
||||
category: ''
|
||||
},
|
||||
categoryList: [],
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
},
|
||||
goods: [],
|
||||
// 是否单选
|
||||
isselect: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
firstSelectChange() {
|
||||
// console.log(selection)
|
||||
let selection = this.$refs.table.selection
|
||||
if (selection.length > 1 && this.isselect) {
|
||||
const del_row = selection.shift();
|
||||
this.$refs.table.toggleRowSelection(del_row, false);
|
||||
}
|
||||
},
|
||||
// 确定选商品
|
||||
confirmHandle() {
|
||||
let res = this.$refs.table.selection
|
||||
this.$emit('success', res)
|
||||
this.close()
|
||||
},
|
||||
// 是否单选
|
||||
isselectEvent() {
|
||||
this.isselect = true
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.searhForm.name = ''
|
||||
this.searhForm.category = ''
|
||||
this.tableData.page = 0
|
||||
this.tableData.size = 10
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbProductlist({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.searhForm.name,
|
||||
categoryId: this.searhForm.category,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
sort: 'id',
|
||||
})
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
|
||||
if (this.goods.length) {
|
||||
this.$nextTick(() => {
|
||||
this.selection()
|
||||
})
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.tableData.loading = false
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 商品分类
|
||||
async tbShopCategoryGet() {
|
||||
try {
|
||||
const res = await tbShopCategoryGet({
|
||||
page: 0,
|
||||
size: 100,
|
||||
sort: 'id',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.categoryList = res.content
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
show(goods) {
|
||||
this.dialogVisible = true
|
||||
if (goods && goods.length) {
|
||||
this.goods = goods
|
||||
} else {
|
||||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.tbShopCategoryGet()
|
||||
this.getTableData()
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
selection() {
|
||||
this.goods.forEach(row => {
|
||||
this.tableData.list.forEach((item, index) => {
|
||||
if (row.id == item.id) {
|
||||
this.$refs.table.toggleRowSelection(this.tableData.list[index]);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="query.conName" placeholder="耗材信息名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button>重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id"
|
||||
height="66vh">
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="变动库存" prop="amount">
|
||||
<template v-slot="scope">
|
||||
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现有库存" prop="balance" />
|
||||
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
|
||||
<el-table-column label="业务说明" prop="bizName" />
|
||||
<el-table-column label="商品名称" prop="productName" />
|
||||
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
||||
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
||||
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangetype"
|
||||
@size-change="e => { clickseetableData.size = e; clickseetableData.page = 0; getTableData() }" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { gettbConsInfoFlow } from '@/api/consumable'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
conName: ''
|
||||
},
|
||||
clickseetableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
pageSizeChange(e) {
|
||||
this.clickseetableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
paginationChangetype(e) {
|
||||
this.clickseetableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 查看查询耗材流水信息
|
||||
async getTableData() {
|
||||
try {
|
||||
this.clickseetableData.loading = true
|
||||
const res = await gettbConsInfoFlow({
|
||||
page: this.clickseetableData.page,
|
||||
size: this.clickseetableData.size,
|
||||
consId: '',
|
||||
conName: this.query.conName,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.clickseetableData.loading = false
|
||||
this.clickseetableData.data = res.content
|
||||
this.clickseetableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,524 @@
|
|||
<!-- eslint-disable no-empty -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conTypeId" size="small" clearable placeholder="请输入类型id" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入类型名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="耗材代码" prop="conCode" />
|
||||
<!-- <el-table-column label="类型id" prop="conTypeId" /> -->
|
||||
<el-table-column label="分类名称" prop="conTypeName" />
|
||||
<el-table-column label="单位" prop="conUnit" />
|
||||
<el-table-column label="创建时间" prop="createTime" width="200">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="最近入库量" prop="lasterInStock" /> -->
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
{{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="预警值" prop="conWarning" />
|
||||
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
|
||||
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
||||
<el-table-column label="更新时间" prop="updateTime" width="200">
|
||||
<!-- <template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="clicksee(scope.row)">耗材记录</el-button>
|
||||
<el-button type="text" size="mini" style="margin-left: 10px !important;"
|
||||
@click="$refs.AddConsTakin.show(scope.row)">耗材盘点</el-button>
|
||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||
<!-- <el-button type="text" @click="clickdialogfadd(scope.row)"
|
||||
style="margin-left: 10px !important;">入库</el-button> -->
|
||||
<!-- <el-button type="text" icon="el-icon-edit" @click="clickdialogframe('edit', scope.row)">编辑</el-button> -->
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
|
||||
@size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }" />
|
||||
</div>
|
||||
<!-- 耗材入库 -->
|
||||
<el-dialog title="耗材入库" :visible.sync="libraryshow">
|
||||
<el-form :inline="true" ref="reflibrary" :model="libraryshowdata" :rules="ruleslibrary" class="demo-form-inline">
|
||||
<el-form-item label="耗材入库数量" prop="stockNumber">
|
||||
<el-input v-model.number="libraryshowdata.stockNumber" type="number" placeholder="请输入单位"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="libraryshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="clickdialoglibraryshow('reflibrary')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<!-- 修改和增加 -->
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="70%">
|
||||
<el-form :inline="true" ref="refruleForm" :model="ruleForm" :rules="rules" class="demo-form-inline">
|
||||
<el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'">
|
||||
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材类型" prop="conNames" v-if="dialogtitle == '添加'">
|
||||
<el-input v-model="ruleForm.conNames" placeholder="请输耗材信息名称" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="dialogtitle == '添加'">
|
||||
<el-button type="primary" @click="typedialogshow = true">去选择</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材信息名称" prop="conName">
|
||||
<el-input v-model="ruleForm.conName" placeholder="请输入耗材信息名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材信息代码" prop="conCode">
|
||||
<el-input v-model="ruleForm.conCode" placeholder="请输入耗材信息代码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材价格" prop="price">
|
||||
<el-input v-model="ruleForm.price" placeholder="请输入耗材价格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警值" prop="conWarning">
|
||||
<el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
|
||||
<el-input v-model="ruleForm.surplusStock" placeholder="请输入单位耗材值"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('refruleForm')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<el-dialog title="选择类型" :visible.sync="typedialogshow">
|
||||
<div class="head-container">
|
||||
<el-input v-model="querytypedialogshowquery.conTypeName" size="small" clearable placeholder="请输入耗材类型名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
||||
<el-input v-model="querytypedialogshowquery.conTypeCode" size="small" clearable placeholder="请输入耗材类型代码"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
||||
<el-select v-model="querytypedialogshowquery.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>
|
||||
<div style="margin-top: 10px;">
|
||||
<el-button type="primary" @click="getTableDatatype">查询</el-button>
|
||||
<el-button @click="resetHandletype">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="table" :data="tableDatatype.data" v-loading="tableDatatype.loading" row-key="id">
|
||||
<el-table-column label="耗材类型名称" prop="conTypeName" />
|
||||
<el-table-column label="耗材类型代码" prop="conTypeCode" />
|
||||
<el-table-column label="店铺ID" prop="shopId" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="tableDatatypetable(scope.row)">确定</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableDatatype.total" :current-page="tableDatatype.page + 1"
|
||||
:page-size="tableDatatype.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangetype" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="耗材信息" :visible.sync="clickseetypedialogshow">
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id"
|
||||
height="450">
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="变动库存" prop="amount">
|
||||
<template v-slot="scope">
|
||||
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现有库存" prop="balance" />
|
||||
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
|
||||
<el-table-column label="业务说明" prop="bizName" />
|
||||
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
||||
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
||||
<el-table-column label="商品信息" prop="productName"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
||||
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangetype" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 耗材盘点 -->
|
||||
<AddConsTakin ref="AddConsTakin" @success="resetHandle" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import dayjs from 'dayjs'
|
||||
import settings from '@/settings'
|
||||
import { upProSort } from '@/api/shop'
|
||||
import { gettbConsType, gettbConsInfo, posttbConsInfo, gettbConsInfoFlow, posttbConsInfostockIn, postapitbConsInfo } from '@/api/consumable'
|
||||
import AddConsTakin from '../components/addConsTakin'
|
||||
export default {
|
||||
components: { AddConsTakin },
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
conTypeId: '',
|
||||
conTypeName: '',
|
||||
conCode: '',
|
||||
conName: ''
|
||||
},
|
||||
libraryshow: false,//耗材入库显示
|
||||
libraryshowdata: {
|
||||
id: '',
|
||||
stockNumber: ''
|
||||
},
|
||||
ruleslibrary: {
|
||||
stockNumber: [
|
||||
{ required: true, message: '请输入入库数量', trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
categorys: [],
|
||||
typeEnums: [{
|
||||
label: '正常',
|
||||
value: '1'
|
||||
}, {
|
||||
label: '禁用',
|
||||
value: '0'
|
||||
}],
|
||||
dialogshow: false, //弹框显示
|
||||
dialogtitle: '', //文字显示
|
||||
typedialogshow: false,
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
querytypedialogshowquery: {
|
||||
conTypeCode: '',
|
||||
conTypeName: '',
|
||||
status: ''
|
||||
},
|
||||
tableDatatype: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
clickseetypedialogshow: false,
|
||||
clickseetableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
ruleForm: {
|
||||
conCode: '',
|
||||
conName: '',
|
||||
conTypeId: '',
|
||||
price: "",
|
||||
conNames: "",
|
||||
// surplusStock: '',
|
||||
conUnit: '',
|
||||
conWarning: '',
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
},
|
||||
rules: {
|
||||
conCode: [
|
||||
{ required: true, message: '请输入耗材信息代码', trigger: 'blur' }
|
||||
],
|
||||
conName: [
|
||||
{ required: true, message: '请输入耗材信息名称', trigger: 'blur' }
|
||||
],
|
||||
conNames: [
|
||||
{ required: true, message: '请选择耗材类型', trigger: 'blur' }
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: '请输入耗材价格', trigger: 'blur' }
|
||||
],
|
||||
conWarning: [
|
||||
{ required: true, message: '请输入耗材预警值', trigger: 'blur' }
|
||||
],
|
||||
conTypeId: [
|
||||
{ required: true, message: '请输入耗材类型id', trigger: 'blur' }
|
||||
],
|
||||
conUnit: [
|
||||
{ required: true, message: '请输入单位', trigger: 'blur' }
|
||||
],
|
||||
conWarning: [{
|
||||
required: true, message: '请输入单位', trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.getTableDatatype()
|
||||
},
|
||||
methods: {
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.conTypeId = ''
|
||||
this.query.conTypeName = ''
|
||||
this.query.conCode = ''
|
||||
this.query.conName = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
paginationChangetype(e) {
|
||||
this.tableDatatype.page = e - 1
|
||||
this.getTableDatatype()
|
||||
},
|
||||
// 获取信息
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await gettbConsInfo({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conTypeId: this.query.conTypeId,
|
||||
conTypeName: this.query.conTypeName,
|
||||
conCode: this.query.conCode,
|
||||
conName: this.query.conName,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 获取类型
|
||||
async getTableDatatype() {
|
||||
this.tableDatatype.loading = true
|
||||
try {
|
||||
const res = await gettbConsType({
|
||||
page: this.tableDatatype.page,
|
||||
size: this.tableDatatype.size,
|
||||
conTypeCode: this.querytypedialogshowquery.conTypeCode,
|
||||
conTypeName: this.querytypedialogshowquery.conTypeName,
|
||||
status: this.querytypedialogshowquery.status,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableDatatype.loading = false
|
||||
this.tableDatatype.data = res.content
|
||||
this.tableDatatype.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandletype() {
|
||||
this.querytypedialogshowquery.conTypeName = ''
|
||||
this.querytypedialogshowquery.conTypeCode = ''
|
||||
this.querytypedialogshowquery.status = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableDatatype()
|
||||
},
|
||||
// 选择的类型
|
||||
tableDatatypetable(item) {
|
||||
// this.ruleForm.conCode = item.conTypeCode
|
||||
this.ruleForm.conNames = item.conTypeName
|
||||
this.ruleForm.conTypeId = item.id
|
||||
this.typedialogshow = false
|
||||
},
|
||||
async clickdialogfadd(item) {
|
||||
this.libraryshow = true
|
||||
this.libraryshowdata.id = item.id
|
||||
},
|
||||
async clickdialoglibraryshow(formName) {
|
||||
this.$refs[formName].validate(async (valid) => {
|
||||
if (valid) {
|
||||
await posttbConsInfostockIn({
|
||||
id: this.libraryshowdata.id,
|
||||
stockNumber: this.libraryshowdata.stockNumber
|
||||
})
|
||||
this.libraryshow = false
|
||||
this.$refs[formName].resetFields()
|
||||
this.getTableData()
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
// 弹框修改值 添加 编辑
|
||||
clickdialogframe(type, item) {
|
||||
if (type == 'add') { // 添加
|
||||
this.dialogtitle = '添加'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refruleForm.resetFields()
|
||||
})
|
||||
} else {
|
||||
this.dialogtitle = '编辑'
|
||||
this.ruleForm.id = item.id
|
||||
this.ruleForm.conTypeId = item.conTypeId
|
||||
this.ruleForm.conCode = item.conCode
|
||||
this.ruleForm.conName = item.conName
|
||||
// this.ruleForm.surplusStock = item.surplusStock
|
||||
this.ruleForm.conWarning = item.conWarning
|
||||
this.ruleForm.conUnit = item.conUnit
|
||||
console.log(this.ruleForm, item)
|
||||
}
|
||||
this.dialogshow = true
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (this.dialogtitle == '编辑') {
|
||||
|
||||
await postapitbConsInfo({
|
||||
id: this.ruleForm.id,
|
||||
conCode: this.ruleForm.conCode,
|
||||
conName: this.ruleForm.conName,
|
||||
conTypeId: this.ruleForm.conTypeId,
|
||||
// surplusStock: this.ruleForm.surplusStock,
|
||||
conUnit: this.ruleForm.conUnit,
|
||||
conWarning: item.conWarning,
|
||||
shopId: this.ruleForm.shopId
|
||||
})
|
||||
this.dialogshow = false
|
||||
} else {//添加
|
||||
await posttbConsInfo({
|
||||
...this.ruleForm
|
||||
})
|
||||
this.$message({ type: 'success', message: '添加成功' })
|
||||
}
|
||||
this.dialogshow = false
|
||||
this.$refs[formName].resetFields()
|
||||
this.getTableData()
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
try {
|
||||
await tbProductDelete(ids)
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
//查看查询耗材流水信息
|
||||
async clicksee(item) {
|
||||
console.log(item)
|
||||
this.clickseetypedialogshow = true
|
||||
this.clickseetableData.loading = true
|
||||
try {
|
||||
const res = await gettbConsInfoFlow({
|
||||
page: this.clickseetableData.page,
|
||||
size: this.clickseetableData.size,
|
||||
consId: item.id,
|
||||
conName: item.conName,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.clickseetableData.loading = false
|
||||
this.clickseetableData.data = res.content
|
||||
this.clickseetableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.red {
|
||||
color: rgb(219, 32, 32);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,581 @@
|
|||
<!-- eslint-disable no-empty -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材信息名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.specSnap" size="small" clearable placeholder="请输入规格名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="请输入商品名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums"
|
||||
:key="item.label" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button type="primary" icon="el-icon-plus"
|
||||
@click="$refs.shopList.show(tableData.list)">选择商品规格</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<!-- <el-table-column label="耗材信息ID" prop="conInfoId" /> -->
|
||||
<el-table-column label="耗材信息" prop="conName" />
|
||||
<el-table-column label="商品" prop="name" />
|
||||
<el-table-column label="规格" prop="specSnap" />
|
||||
<el-table-column label="单笔消耗数" prop="surplusStock" />
|
||||
<!-- <el-table-column label="价格" prop="conName" /> -->
|
||||
<el-table-column label="耗材信息代码" prop="conCode" />
|
||||
<el-table-column label="耗材信息单位" prop="conUnit" />
|
||||
<el-table-column label="库存" prop="stockNumber" />
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<!-- <template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == '1'">启用</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||
<el-button type="text" icon="el-icon-edit"
|
||||
@click="clickdialogframe('edit', scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
|
||||
@size-change="e => { tableData.size = e; getTableData() }" />
|
||||
</div>
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="1000px">
|
||||
<el-form ref="addSelect" :inline="true">
|
||||
<el-form-item label="商品名称">
|
||||
{{ addSelect.length ? addSelect[0].name : '' }}
|
||||
</el-form-item><br />
|
||||
<template v-if="addSelect.length">
|
||||
<!--
|
||||
isDistribute为1是共享库存,展示商品
|
||||
为0是展示规格
|
||||
-->
|
||||
<template v-if="addSelect[0].isDistribute == 1">
|
||||
<el-form-item label="商品规格">
|
||||
<el-input v-model="addSelect[0].specSnap" style="width: 130px;" placeholder="请选择商品规格"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材信息" prop="conName">
|
||||
<el-input v-model="addSelect[0].conName" style="width: 130px;" placeholder="请选择耗材信息"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="informationdialogshow = true">去选择耗材信息</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位耗材值">
|
||||
<el-input v-model="addSelect[0].surplusStock" type=number placeholder="请输入单位耗材值"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="addSelect[0]">
|
||||
<template v-for="(item, i) in addSelect[0].skuList">
|
||||
<el-form-item label="商品规格">
|
||||
<el-input v-if="addSelect[0].typeEnum == '单规格'" v-model="addSelect[0].specSnap"
|
||||
style="width: 130px;" placeholder="请选择商品规格" disabled></el-input>
|
||||
<el-input v-else v-model="item.specSnap" style="width: 130px;" placeholder="请选择商品规格"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材信息" prop="conName">
|
||||
<el-input v-model="item.conName" style="width: 130px;" placeholder="请选择耗材信息"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="selecthaocai(i)">去选择耗材信息</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位耗材值">
|
||||
<el-input v-model="item.surplusStock" type=number placeholder="请输入单位耗材值"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('addSelect')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="耗材信息" :visible.sync="informationdialogshow">
|
||||
<div class="head-container">
|
||||
<el-input v-model="queryinformation.conTypeId" size="small" clearable placeholder="请输入类型id"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<el-input v-model="queryinformation.conTypeName" size="small" clearable placeholder="请输入类型名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<el-input v-model="queryinformation.conCode" size="small" clearable placeholder="请输入耗材代码"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<el-input v-model="queryinformation.conName" size="small" clearable placeholder="请输入耗材名称"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatainformation" />
|
||||
<div style="display: flex; justify-content: flex-end;">
|
||||
<el-button style="margin-right: 20px;" type="primary"
|
||||
@click="getTableDatainformation">查询</el-button>
|
||||
<el-button @click="resetHandleinformation">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="table" :data="tableDatainformation.data" v-loading="tableDatainformation.loading"
|
||||
row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="耗材代码" prop="conCode" />
|
||||
<el-table-column label="类型名称" prop="conTypeName" />
|
||||
<el-table-column label="单位" prop="conUnit" />
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
{{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="单位耗材值" prop="surplusStock" />
|
||||
<el-table-column label="" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="tableDatainformationtable(scope.row)">确定</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableDatainformation.total" :current-page="tableDatainformation.page + 1"
|
||||
:page-size="tableDatainformation.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangeinformation"
|
||||
@size-change="e => { tableDatainformation.size = e; tableDatainformation.page = 0; getTableDatainformation() }" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="编辑" :visible.sync="informationdialogshowedit" width="20%">
|
||||
<el-form ref="addSelect" :inline="true">
|
||||
<el-form-item label="单位耗材值">
|
||||
<el-input v-model="surplusStocks.surplusStock" type=number
|
||||
@input="limitInput($event, 'monthOutputValue')" placeholder="请输入单位耗材值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="informationdialogshowedit = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('addSelect')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<shopList ref="shopList" @success="selectShop" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import dayjs from 'dayjs'
|
||||
import shopList from '../components/shopList'
|
||||
import { upProSort, tbProduct } from '@/api/shop'
|
||||
import { getviewConSku, gettbProductSpec, gettbConsInfo, posttbProskuCons, puttbProskuCon, deletetbProskuCon } from '@/api/consumable'
|
||||
export default {
|
||||
components: { shopList },
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
conName: '',
|
||||
specSnap: '',
|
||||
name: '',
|
||||
status: ''
|
||||
},
|
||||
surplusStocks: '',
|
||||
typeEnums: [{
|
||||
label: '正常',
|
||||
value: '1'
|
||||
}, {
|
||||
label: '禁用',
|
||||
value: '0'
|
||||
}],
|
||||
dialogshow: false, //弹框显示
|
||||
dialogtitle: '', //文字显示
|
||||
informationdialogshow: false,
|
||||
informationdialogshowedit: false,
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
queryinformation: {
|
||||
conTypeId: '',
|
||||
conTypeName: '',
|
||||
conCode: '',
|
||||
conName: ''
|
||||
},
|
||||
tableDatainformation: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
tableDataskudialogshow: false,
|
||||
querytableDatasku: {
|
||||
specSnap: '',
|
||||
name: '',
|
||||
shopName: ''
|
||||
},
|
||||
tableDatasku: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
ruleForm: {
|
||||
conInfoId: "",
|
||||
conInfoIdname: "",
|
||||
productSkuId: "",
|
||||
productSkuIdname: "",
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
surplusStock: '',
|
||||
status: false
|
||||
},
|
||||
rules: {
|
||||
conNameS: [
|
||||
{ required: true, message: '请输入耗材信息', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请选择商品规格', trigger: 'blur' }
|
||||
],
|
||||
surplusStock: [
|
||||
{ required: true, message: '请输入单位耗材值', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '选择状态', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
// 动态新增选择框
|
||||
addSelect: [],
|
||||
// 选择耗材的index
|
||||
ALLisDistribute: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.getTableDatasku()
|
||||
this.getTableDatainformation()
|
||||
this.$nextTick(() => {
|
||||
// this.tableDrag()
|
||||
// this.$refs.shopList.isselectEvent()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
limitInput(value, name) {
|
||||
this.surplusStocks.surplusStock = ('' + value) // 第一步:转成字符串
|
||||
// .replace(/[^\d^\.]+/g, '') // 第二步:把不是数字,不是小数点的过滤掉
|
||||
|
||||
.replace(/^0+(\d)/, '$1') // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字
|
||||
|
||||
.replace(/^\./, '0.') // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
|
||||
|
||||
.match(/^\d*(\.?\d{0,2})/g)[0] || ''
|
||||
},
|
||||
selectShop(res) {
|
||||
// console.log(res, '调试1')
|
||||
this.addSelect = res
|
||||
res[0]['specSnap'] = res[0].name
|
||||
this.clickdialogframe('add')
|
||||
},
|
||||
// 选择耗材
|
||||
selecthaocai(i) {
|
||||
this.ALLisDistribute = i
|
||||
this.informationdialogshow = true
|
||||
},
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.data[e.oldIndex].id
|
||||
let nid = this.tableData.data[e.newIndex].id
|
||||
let ids = this.tableData.data.map(item => item.id)
|
||||
try {
|
||||
await upProSort({
|
||||
strId: oid,
|
||||
endId: nid,
|
||||
ids: ids
|
||||
})
|
||||
await this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.conName = ''
|
||||
this.query.specSnap = ''
|
||||
this.query.name = ''
|
||||
this.query.status = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
resetHandlesku() {
|
||||
this.querytableDatasku.specSnap = ''
|
||||
this.querytableDatasku.name = ''
|
||||
this.querytableDatasku.shopName = ''
|
||||
this.tableDatasku.page = 0
|
||||
this.getTableDatasku()
|
||||
},
|
||||
resetHandleinformation() {
|
||||
this.queryinformation.conTypeId = ''
|
||||
this.queryinformation.conTypeName = ''
|
||||
this.queryinformation.conCode = ''
|
||||
this.queryinformation.conName = ''
|
||||
this.tableDatainformation.page = 0
|
||||
this.getTableDatainformation()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await getviewConSku({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conName: this.query.conName,
|
||||
specSnap: this.query.specSnap,
|
||||
name: this.query.name,
|
||||
status: this.query.status,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
paginationChangeinformation(e) {
|
||||
this.tableDatainformation.page = e - 1
|
||||
this.getTableDatainformation()
|
||||
},
|
||||
// 获取信息管理
|
||||
async getTableDatainformation() {
|
||||
this.tableDatainformation.loading = true
|
||||
try {
|
||||
const res = await gettbConsInfo({
|
||||
page: this.tableDatainformation.page,
|
||||
size: this.tableDatainformation.size,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
conTypeId: this.queryinformation.conTypeId,
|
||||
conTypeName: this.queryinformation.conTypeName,
|
||||
conCode: this.queryinformation.conCode,
|
||||
conName: this.queryinformation.conName,
|
||||
})
|
||||
this.tableDatainformation.loading = false
|
||||
this.tableDatainformation.data = res.content
|
||||
this.tableDatainformation.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 耗材信息的信息
|
||||
tableDatainformationtable(item) {
|
||||
|
||||
this.addSelect.forEach((ele, i) => {
|
||||
ele.consInfoId = item.id
|
||||
ele.conName = item.conName
|
||||
if (this.ALLisDistribute != null) {
|
||||
// this.addSelect.forEach((ele, i) => {
|
||||
ele.skuList[this.ALLisDistribute].conInfoId = item.id
|
||||
ele.skuList[this.ALLisDistribute].conName = item.conName
|
||||
// })
|
||||
console.log(ele.skuList[this.ALLisDistribute], "打印");
|
||||
}
|
||||
})
|
||||
// this.ruleForm.skuInfos = item
|
||||
// this.ruleForm.conInfoId = item.id
|
||||
// this.ruleForm.conInfoIdname = item.conName
|
||||
this.informationdialogshow = false
|
||||
},
|
||||
// tableDatatablesku(item) {///规格
|
||||
// this.ruleForm = item
|
||||
// this.tableDataskudialogshow = false
|
||||
// },
|
||||
// 获取商品规格
|
||||
async getTableDatasku() {
|
||||
this.tableDatasku.loading = true
|
||||
try {
|
||||
const res = await tbProduct({
|
||||
page: this.tableDatasku.page,
|
||||
size: this.tableDatasku.size,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
specSnap: this.querytableDatasku.specSnap,
|
||||
name: this.querytableDatasku.name,
|
||||
sort: 'id.desc',
|
||||
shopName: this.querytableDatasku.shopName
|
||||
})
|
||||
this.tableDatasku.loading = false
|
||||
this.tableDatasku.data = res.content
|
||||
this.tableDatasku.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
Changeinformationsku(e) {
|
||||
this.tableDatasku.page = e - 1
|
||||
this.getTableDatasku()
|
||||
},
|
||||
// 弹框修改值 添加 编辑
|
||||
clickdialogframe(type, item) {
|
||||
if (type == 'add') { // 添加
|
||||
this.dialogtitle = '添加'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addSelect.resetFields()
|
||||
})
|
||||
this.dialogshow = true
|
||||
} else {
|
||||
this.informationdialogshowedit = true
|
||||
this.dialogtitle = '编辑'
|
||||
this.surplusStocks = item
|
||||
}
|
||||
},
|
||||
async submitForm(formName) {
|
||||
if (this.dialogtitle == '编辑') {
|
||||
let { id, surplusStock } = this.surplusStocks
|
||||
await puttbProskuCon({
|
||||
id,
|
||||
surplusStock
|
||||
})
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.informationdialogshowedit = false
|
||||
} else {
|
||||
let { id, consInfoId, surplusStock, isDistribute } = this.addSelect[0]
|
||||
// isDistribute1为共享库存-商品,0不共享是多规格
|
||||
// 如果isDistribute为0 是多规格的时候
|
||||
if (isDistribute != 1) {
|
||||
surplusStock = this.addSelect[0].skuList[0].surplusStock
|
||||
}
|
||||
let obj = {
|
||||
productId: id,
|
||||
consInfoId: consInfoId,
|
||||
skuInfos: null,
|
||||
surplusStock: surplusStock
|
||||
}
|
||||
let isgongx = false
|
||||
this.addSelect[0].skuList.forEach(ele => {
|
||||
console.log(ele, "jiancha");
|
||||
ele.skuId = ele.id
|
||||
// ele.surplusStock = surplusStock
|
||||
if (isDistribute == 1) {
|
||||
ele.surplusStock = surplusStock
|
||||
ele.conInfoId = consInfoId
|
||||
}
|
||||
if (!ele.skuId || !ele.surplusStock) {
|
||||
isgongx = true
|
||||
} else {
|
||||
isgongx = false
|
||||
}
|
||||
})
|
||||
if (isgongx) {
|
||||
this.$message.error('请选择耗材信息与输入耗材值')
|
||||
return
|
||||
}
|
||||
|
||||
obj.skuInfos = this.addSelect[0].skuList
|
||||
|
||||
await posttbProskuCons(obj)
|
||||
this.$message({
|
||||
message: '新增成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.ALLisDistribute = null
|
||||
this.dialogshow = false
|
||||
}
|
||||
this.$refs[formName].resetFields()
|
||||
this.getTableData()
|
||||
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
try {
|
||||
await deletetbProskuCon(ids)
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,295 @@
|
|||
<!-- eslint-disable no-empty -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入耗材类型名称" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-input v-model="query.conTypeCode" size="small" clearable placeholder="请输入耗材类型代码" style="width: 100%;"
|
||||
class="filter-item" @keyup.enter.native="getTableData" />
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column prop="id" label="ID" width="50px" />
|
||||
<el-table-column label="耗材类型名称" prop="conTypeName" />
|
||||
<el-table-column label="耗材类型代码" prop="conTypeCode" />
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="店铺ID" prop="shopId" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
||||
<el-table-column label="更新时间" prop="updateTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||
<el-button type="text" icon="el-icon-edit" @click="clickdialogframe('edit', scope.row)">编辑</el-button>
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
|
||||
@size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }" />
|
||||
</div>
|
||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow">
|
||||
<el-form ref="refruleForm" :model="ruleForm" :rules="rules">
|
||||
<el-form-item label="耗材类型名称" prop="conTypeName">
|
||||
<el-input v-model="ruleForm.conTypeName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="耗材类型代码" prop="conTypeCode">
|
||||
<el-input v-model="ruleForm.conTypeCode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否禁用" prop="status">
|
||||
<el-switch v-model="ruleForm.status" />
|
||||
</el-form-item>
|
||||
<el-form-item style="display: flex;justify-content: flex-end;">
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('refruleForm')">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import dayjs from 'dayjs'
|
||||
import settings from '@/settings'
|
||||
import { upProSort } from '@/api/shop'
|
||||
import { gettbConsType, posttbConsType, puttbConsType } from '@/api/consumable'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
conTypeCode: '',
|
||||
conTypeName: '',
|
||||
status: ''
|
||||
},
|
||||
categorys: [],
|
||||
typeEnums: [{
|
||||
label: '正常',
|
||||
value: '1'
|
||||
}, {
|
||||
label: '禁用',
|
||||
value: '0'
|
||||
}],
|
||||
dialogshow: false, //弹框显示
|
||||
dialogtitle: '', //文字显示
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
ruleForm: {
|
||||
conTypeCode: '',
|
||||
conTypeName: '',
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
status: false
|
||||
},
|
||||
rules: {
|
||||
conTypeName: [
|
||||
{ required: true, message: '请输入耗材类型名称', trigger: 'blur' }
|
||||
],
|
||||
conTypeCode: [
|
||||
{ required: true, message: '请输入耗材类型代码', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '选择状态', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.$nextTick(() => {
|
||||
// this.tableDrag()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//表格拖拽
|
||||
tableDrag() {
|
||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
||||
new Sortable(el, {
|
||||
animation: 150,
|
||||
onEnd: async e => {
|
||||
// console.log('拖拽结束===', e);
|
||||
if (e.oldIndex == e.newIndex) return
|
||||
let oid = this.tableData.data[e.oldIndex].id
|
||||
let nid = this.tableData.data[e.newIndex].id
|
||||
let ids = this.tableData.data.map(item => item.id)
|
||||
try {
|
||||
await upProSort({
|
||||
strId: oid,
|
||||
endId: nid,
|
||||
ids: ids
|
||||
})
|
||||
await this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.conTypeCode = ''
|
||||
this.query.conTypeName = ''
|
||||
this.query.status = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await gettbConsType({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
conTypeCode: this.query.conTypeCode,
|
||||
conTypeName: this.query.conTypeName,
|
||||
status: this.query.status,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 弹框修改值 添加 编辑
|
||||
clickdialogframe(type, item) {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (type == 'add') { // 添加
|
||||
this.dialogtitle = '添加'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refruleForm.resetFields()
|
||||
})
|
||||
} else {
|
||||
this.dialogtitle = '编辑'
|
||||
this.ruleForm.id = item.id
|
||||
this.ruleForm.conTypeCode = item.conTypeCode
|
||||
this.ruleForm.conTypeName = item.conTypeName
|
||||
this.ruleForm.status = item.status == 0 ? true : false
|
||||
}
|
||||
this.dialogshow = true
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (this.dialogtitle == '编辑') {
|
||||
await puttbConsType({
|
||||
id: this.ruleForm.id,
|
||||
conTypeCode: this.ruleForm.conTypeCode,
|
||||
conTypeName: this.ruleForm.conTypeName,
|
||||
shopId: this.ruleForm.shopId,
|
||||
status: this.ruleForm.status ? '0' : '1'
|
||||
})
|
||||
this.dialogshow = false
|
||||
|
||||
this.getTableData()
|
||||
} else {
|
||||
await posttbConsType({
|
||||
conTypeCode: this.ruleForm.conTypeCode,
|
||||
conTypeName: this.ruleForm.conTypeName,
|
||||
shopId: this.ruleForm.shopId,
|
||||
status: this.ruleForm.status ? '0' : '1'
|
||||
})
|
||||
}
|
||||
this.dialogshow = false
|
||||
this.$refs[formName].resetFields()
|
||||
this.getTableData()
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
try {
|
||||
await tbProductDelete(ids)
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -5,7 +5,12 @@
|
|||
<div class="row">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="商品名称"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<el-input v-model="query.num" placeholder="库存数量:少于多少xx" />
|
||||
<!-- <el-input v-model="query.num" placeholder="库存数量:少于多少xx" /> -->
|
||||
<div style="width: 300px;">
|
||||
<el-select v-model="query.categoryId" placeholder="商品分类" style="width: 100%;">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in categorys" :key="item.id" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="width: 300px;">
|
||||
<el-select v-model="query.isStock" placeholder="库存开关" style="width: 100%;">
|
||||
<el-option label="开" :value="1">开</el-option>
|
||||
|
|
@ -14,6 +19,7 @@
|
|||
</div>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button @click="Uppop()">库存预警:{{ warnLine }}</el-button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出库存</el-button>
|
||||
|
|
@ -23,18 +29,25 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="商品信息">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id" lazy :load="load"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column width="30">
|
||||
<template v-slot="scope">
|
||||
<i class="" v-if="scope.row.hasChildren == false"></i>
|
||||
<!-- <div v-if="scope.row.iskaiguans == 1" style="padding-left: 20px;"></div> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品信息" width="200px">
|
||||
<template v-slot="scope">
|
||||
<div class="shop_info">
|
||||
<el-image :src="scope.row.img" class="cover">
|
||||
<el-image :src="scope.row.img" class="cover" v-if="scope.row.iskaiguans != 1">
|
||||
<div class="img_error" slot="error">
|
||||
<i class="icon el-icon-document-delete"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<div class="info">
|
||||
<span>{{ scope.row.name }}</span>
|
||||
<div>
|
||||
<div v-if="scope.row.iskaiguans != 1">
|
||||
<el-tag type="primary">{{ scope.row.type }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -43,62 +56,106 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="规格" prop="number">
|
||||
<template v-slot="scope">
|
||||
{{scope.row.specSnap }}
|
||||
<div v-if="scope.row.iskaiguans">
|
||||
{{ scope.row.specSnap }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" prop="number">
|
||||
<template v-slot="scope">
|
||||
{{ `${scope.row.number} ${scope.row.unitName}` }}
|
||||
<span :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="库存开关">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isStock" :active-value="1" :inactive-value="0"
|
||||
v-if="scope.row.hasChildren || scope.row.hasChildren == false"
|
||||
@change="showChange($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<el-table-column label="共享库存">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isDistribute" :active-value="1" :inactive-value="0"
|
||||
v-if="scope.row.hasChildren || scope.row.hasChildren == false"
|
||||
@change="showChanges($event, scope.row, 'proId', 'distribute')"></el-switch>
|
||||
</template>
|
||||
</el-table-column> <el-table-column label="售罄">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.isPauseSale" :active-value="1" :inactive-value="0"
|
||||
@change="showChangess($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini"
|
||||
@click="$refs.invoicingDetail.show(scope.row)">库存记录</el-button>
|
||||
<template v-if="!scope.row.hasChildren">
|
||||
<el-button type="text" size="mini" style="margin-left: 10px !important;"
|
||||
@click="$refs.AddStockTakin.show(scope.row)">库存盘点</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination @size-change="paginationSizeChange" :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<el-pagination @size-change="paginationSizeChange" :total="tableData.total"
|
||||
:current-page="tableData.page + 1" :page-size="tableData.size" @current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper" ></el-pagination>
|
||||
</div>
|
||||
<invoicingDetail ref="invoicingDetail" />
|
||||
<!-- 导入库存弹窗 -->
|
||||
<el-dialog title="导入库存" :visible.sync="dialogVisible">
|
||||
<UploadExcel :beforeUpload="excelSuccessUpload" />
|
||||
</el-dialog>
|
||||
<!-- 预存弹窗组件 -->
|
||||
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
|
||||
<el-form>
|
||||
<el-form-item label="库存预存设置" label-width="120px">
|
||||
<el-input v-model="montey" type="number" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogTableVisible = false; montey = ''">取 消</el-button>
|
||||
<el-button type="primary" @click="sumbit()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 新增库存盘点 -->
|
||||
<AddStockTakin ref="AddStockTakin" @success="resetHandle" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { stock, stockdownload, stockdoImport, stockStateChange } from '@/api/invoicing'
|
||||
import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks } from '@/api/invoicing'
|
||||
import { tbShopCategoryGet } from '@/api/shop'
|
||||
import settings from '@/settings'
|
||||
import invoicingDetail from './components/invoicingDetail'
|
||||
import AddStockTakin from './components/addStockTakin'
|
||||
import UploadExcel from '@/components/UploadExcel/'
|
||||
import { downloadFile } from "@/utils/index";
|
||||
export default {
|
||||
components: {
|
||||
invoicingDetail,
|
||||
UploadExcel
|
||||
UploadExcel,
|
||||
AddStockTakin
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dialogTableVisible: false,
|
||||
montey: "",
|
||||
categorys: [],
|
||||
query: {
|
||||
name: '',
|
||||
isStock: '',
|
||||
num: ''
|
||||
num: '',
|
||||
categoryId: ''
|
||||
},
|
||||
downloadLoading: false,
|
||||
uploadLoading: false,
|
||||
warnLine: null, // 警戒线
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
|
|
@ -110,9 +167,40 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
this.tbShopCategoryGet()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
Uppop() {
|
||||
this.dialogTableVisible = true
|
||||
},
|
||||
async sumbit() {
|
||||
try {
|
||||
const res = await stockStatewarnLine({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
warnLine: this.montey
|
||||
})
|
||||
|
||||
this.$message({ type: 'success', message: '修改成功!' });
|
||||
setTimeout(() => {
|
||||
this.dialogTableVisible = false
|
||||
this.montey = ''
|
||||
this.getTableData()
|
||||
}, 500);
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async load(tree, treeNode, resolve) {
|
||||
const res = await stocks({
|
||||
productId: tree.proId,
|
||||
})
|
||||
res.forEach(ele => ele.iskaiguans = 1)
|
||||
setTimeout(() => {
|
||||
resolve(res)
|
||||
}, 50);
|
||||
},
|
||||
async excelSuccessUpload(file) {
|
||||
console.log(file);
|
||||
try {
|
||||
|
|
@ -121,6 +209,7 @@ export default {
|
|||
const res = await stockdoImport(file)
|
||||
this.uploadLoading = false
|
||||
this.$notify.success('导入成功')
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
this.dialogVisible = false
|
||||
|
|
@ -146,15 +235,48 @@ export default {
|
|||
},
|
||||
// 状态切换
|
||||
async showChange(e, row) {
|
||||
try {
|
||||
await stockStateChange({
|
||||
proId: row.proId,
|
||||
isStock: row.isStock
|
||||
await stockStateChanges({
|
||||
"updateKey": 'stock',
|
||||
"updateValue": row.isStock,
|
||||
"targetId": row.proId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
// 共享库存
|
||||
async showChanges(e, row, name, value) {
|
||||
await stockStateChanges({
|
||||
"updateKey": value,
|
||||
"updateValue": row.isDistribute,
|
||||
"targetId": row[name],
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
|
||||
},
|
||||
// 售罄
|
||||
async showChangess(e, row) {
|
||||
if (row.hasChildren || row.hasChildren == false) {
|
||||
await stockStateChanges({
|
||||
"updateKey": 'pauseSale',
|
||||
"updateValue": row.isPauseSale,
|
||||
"targetId": row.proId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
} else {
|
||||
await stockStateChanges({
|
||||
"updateKey": 'pauseSaleSku',
|
||||
"updateValue": row.isPauseSale,
|
||||
"targetId": row.skuId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
|
||||
})
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
|
|
@ -165,24 +287,67 @@ export default {
|
|||
name: this.query.name,
|
||||
isStock: this.query.isStock,
|
||||
num: this.query.num,
|
||||
categoryId: this.query.categoryId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
// 多规格数据处理
|
||||
res.content.forEach(element => {
|
||||
if (element.type == '多规格' && element.isDistribute == 0) {
|
||||
element.hasChildren = true
|
||||
} else {
|
||||
element.hasChildren = false
|
||||
}
|
||||
});
|
||||
this.warnLine = res.warnLine
|
||||
this.tableData.list = res.content
|
||||
console.log(this.tableData.list);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 获取商品分类列表
|
||||
async tbShopCategoryGet() {
|
||||
try {
|
||||
const res = await tbShopCategoryGet({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
page: 0,
|
||||
size: 100,
|
||||
sort: 'id'
|
||||
})
|
||||
let categorys = []
|
||||
for (let item of res.content) {
|
||||
categorys.push({
|
||||
name: `|----${item.name}`,
|
||||
id: item.id
|
||||
})
|
||||
if (item.childrenList.length) {
|
||||
for (let val of item.childrenList) {
|
||||
categorys.push({
|
||||
name: `|----|----${val.name}`,
|
||||
id: val.id
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.categorys = categorys
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 每页条数改变是回调
|
||||
paginationSizeChange(e){
|
||||
paginationSizeChange(e) {
|
||||
console.log(e);
|
||||
this.tableData.size = e
|
||||
this.tableData.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
console.log(e)
|
||||
this.tableData.page = e - 1
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 重置查询
|
||||
|
|
@ -191,6 +356,7 @@ export default {
|
|||
this.query.num = ''
|
||||
this.query.isStock = ''
|
||||
this.tableData.page = 0;
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
|
|
@ -228,4 +394,16 @@ export default {
|
|||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.colorStyle {
|
||||
color: rgb(231, 42, 42);
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* flex-direction: row-reverse; */
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="head-container">
|
||||
<div class="filter_wrap">
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" @change="getTableData">
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="getTableData">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
@current-change="paginationChange" @size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<operatingDetail ref="operatingDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -81,12 +81,19 @@ export default {
|
|||
methods: {
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
let arr = []
|
||||
console.log(this.query,'tiaoshi1')
|
||||
if (this.query.createdAt.length) {
|
||||
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
} else {
|
||||
arr = []
|
||||
}
|
||||
try {
|
||||
const res = await tbProductStockOperateList({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
createdAt: this.query.createdAt
|
||||
createdAt: arr
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
|
|
|
|||
|
|
@ -2,7 +2,18 @@
|
|||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
||||
<el-form-item label="出库类型">
|
||||
<el-form-item label="入库内容">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="item in inTabs" :key="item.value"
|
||||
:class="{ active: inTabValue == item.value }" @click="tabChange(item.value, item.type)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型" v-if="inTabValue == 'goods'">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
|
|
@ -13,6 +24,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型" v-else>
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes2" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8" v-if="shopTypes[shopTypesActive].value == 'purveyor'">
|
||||
<el-form-item label="供应商" prop="purveyorId">
|
||||
|
|
@ -32,13 +54,13 @@
|
|||
</el-row>
|
||||
<el-row v-if="shopTypes[shopTypesActive].value == 'purveyor'">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应收金额">
|
||||
<el-form-item label="应付金额">
|
||||
<el-input v-model="queryForm.totalAmount" placeholder="请输入应收金额"
|
||||
style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实收金额">
|
||||
<el-form-item label="实付金额">
|
||||
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额"
|
||||
style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -67,37 +89,82 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)">选择商品</el-button>
|
||||
<el-button type="primary" @click="$refs.ConsumableList.show(tableData.list)"
|
||||
v-if="inTabValue == 'consumable'">选择耗材</el-button>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" plain>
|
||||
<el-button type="primary" plain v-if="inTabValue == 'consumable'">
|
||||
共{{ tableData.list.length }}种耗材,金额合计<span style="color: red;">¥{{ queryForm.totalAmount }}</span>
|
||||
</el-button>
|
||||
<el-button type="primary" plain v-else>
|
||||
共{{ tableData.list.length }}种商品,金额合计<span style="color: red;">¥{{ queryForm.totalAmount }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list">
|
||||
<el-table :data="tableData.list" v-if="inTabValue == 'consumable'">
|
||||
<el-table-column label="耗材名称" prop="conName">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.conName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">原价¥{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">入库前:{{ scope.row.number }}{{ scope.row.conUnit }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number> -->
|
||||
<el-input :value="formatDecimal(scope.row.price * scope.row.stockNumber)" readonly
|
||||
style="width: 100px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="变动后剩余库存">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.stockNumber + scope.row.number }}{{ scope.row.conUnit }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table :data="tableData.list" v-else>
|
||||
<el-table-column type="index" width="50"></el-table-column>
|
||||
<el-table-column label="商品名称" prop="name">
|
||||
<template v-slot="scope">
|
||||
<div class="name_wrap">
|
||||
<span class="name">{{ scope.row.name }}</span>
|
||||
<el-tag type="info" v-if="scope.row.specSnap" size="mini">{{ scope.row.specSnap }}</el-tag>
|
||||
<!-- <el-tag type="info" v-if="scope.row.specSnap" size="mini">{{ scope.row.specSnap }}</el-tag> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number> -->
|
||||
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
|
||||
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
|
||||
<div class="tips">成本价¥{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.guidePrice"></el-input-number>
|
||||
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
|
||||
<div class="tips">入库前:{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -123,7 +190,10 @@
|
|||
<div>
|
||||
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
||||
</div>
|
||||
<!-- 选择商品 -->
|
||||
<shopList ref="shopList" @success="selectShop" />
|
||||
<!-- 选择耗材 -->
|
||||
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
||||
:close-on-click-modal="false">
|
||||
<el-result icon="success" title="入库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
||||
|
|
@ -140,14 +210,31 @@
|
|||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import shopList from '@/components/shopList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn } from '@/api/invoicing'
|
||||
import shopList from './components/shopList'
|
||||
import ConsumableList from './components/consumableList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
|
||||
import { formatDecimal } from '@/utils'
|
||||
export default {
|
||||
components: {
|
||||
shopList
|
||||
shopList,
|
||||
ConsumableList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
inTabValue: 'goods',
|
||||
inTabs: [
|
||||
{
|
||||
label: '商品入库',
|
||||
value: 'goods',
|
||||
type: 'purveyor'
|
||||
},
|
||||
{
|
||||
label: '耗材入库',
|
||||
value: 'consumable',
|
||||
type: 'in'
|
||||
}
|
||||
],
|
||||
shopTypesActive: 0,
|
||||
shopTypes: [
|
||||
{
|
||||
|
|
@ -159,6 +246,12 @@ export default {
|
|||
value: 'purchase'
|
||||
}
|
||||
],
|
||||
shopTypes2: [
|
||||
{
|
||||
label: '供应商入库',
|
||||
value: 'purveyor'
|
||||
},
|
||||
],
|
||||
resetForm: '',
|
||||
queryFormLoading: false,
|
||||
queryForm: {
|
||||
|
|
@ -178,7 +271,7 @@ export default {
|
|||
purveyorId: [
|
||||
{
|
||||
required: true,
|
||||
message: ' ',
|
||||
message: '请选择供应商',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
|
|
@ -202,14 +295,51 @@ export default {
|
|||
this.tbShopPurveyorGet()
|
||||
},
|
||||
methods: {
|
||||
// 切换入库内容
|
||||
tabChange(value, type) {
|
||||
this.inTabValue = value
|
||||
this.shopTypesActive = 0
|
||||
this.queryForm.type = type
|
||||
this.resetHandle()
|
||||
},
|
||||
// 计算耗材总价
|
||||
consCountTotal() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.price * ele.stockNumber
|
||||
})
|
||||
this.queryForm.totalAmount = formatDecimal(zong)
|
||||
},
|
||||
// 计算商品总价
|
||||
modifyPrice() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.costPrice * ele.number
|
||||
})
|
||||
this.queryForm.totalAmount = formatDecimal(zong)
|
||||
},
|
||||
// 提交
|
||||
submitHandle() {
|
||||
this.$refs.queryForm.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.queryFormLoading = true
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
switch (this.inTabValue) {
|
||||
case 'goods':
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
break;
|
||||
case 'consumable':
|
||||
this.queryForm.accountsPayable = this.queryForm.totalAmount
|
||||
this.queryForm.actualPayment = this.queryForm.paidAmount
|
||||
this.queryForm.paymentTime = this.queryForm.paidAt
|
||||
this.queryForm.supplierId = this.queryForm.purveyorId
|
||||
this.queryForm.list = this.tableData.list
|
||||
await stockInOut(this.queryForm)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.queryFormLoading = false
|
||||
this.showResult = true
|
||||
} catch (error) {
|
||||
|
|
@ -219,6 +349,16 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
// 选择耗材
|
||||
selectConsumable(res) {
|
||||
this.tableData.list = res.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfold = item.id
|
||||
return item
|
||||
})
|
||||
},
|
||||
// 选择商品
|
||||
selectShop(res) {
|
||||
let arr = []
|
||||
|
|
@ -242,6 +382,7 @@ export default {
|
|||
this.showResult = false
|
||||
this.queryForm = { ...this.resetForm }
|
||||
this.tableData.list = []
|
||||
this.$refs.queryForm.resetFields()
|
||||
},
|
||||
// 切换类型
|
||||
changeTypeEnum(index) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,18 @@
|
|||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form ref="queryForm" :model="queryForm" :rules="queryRules" label-position="left" label-width="80px">
|
||||
<el-form-item label="出库类型">
|
||||
<el-form-item label="出库内容">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="item in inTabs" :key="item.value"
|
||||
:class="{ active: inTabValue == item.value }" @click="tabChange(item.value, item.type)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库类型" v-if="inTabValue == 'goods'">
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
|
|
@ -13,6 +24,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库类型" v-else>
|
||||
<div class="shop_type_box">
|
||||
<div class="item" v-for="(item, index) in shopTypes2" :key="index"
|
||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||
<div class="s_title">{{ item.label }}</div>
|
||||
<div class="active_dot">
|
||||
<i class="el-icon-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8" v-if="shopTypes[shopTypesActive].value == 'reject'">
|
||||
<el-form-item label="供应商" prop="purveyorId">
|
||||
|
|
@ -67,7 +89,9 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)">选择商品</el-button>
|
||||
<el-button type="primary" @click="$refs.ConsumableList.show(tableData.list)"
|
||||
v-if="inTabValue == 'consumable'">选择耗材</el-button>
|
||||
<el-button type="primary" @click="$refs.shopList.show(tableData.list)" v-else>选择商品</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -77,7 +101,46 @@
|
|||
</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list">
|
||||
<el-table :data="tableData.list" v-if="inTabValue == 'consumable'">
|
||||
<el-table-column label="耗材名称" prop="conName">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.conName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">原价¥{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.stockNumber" :min="0" controls-position="right"
|
||||
@change="consCountTotal()"></el-input-number>
|
||||
<div class="tips">出库前:{{ scope.row.number }}{{ scope.row.conUnit }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
|
||||
controls-position="right"></el-input-number> -->
|
||||
<el-input :value="formatDecimal(scope.row.price * scope.row.stockNumber)" readonly
|
||||
style="width: 100px;" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="变动后剩余库存">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.stockNumber - scope.row.number }}{{ scope.row.conUnit }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table :data="tableData.list" v-else>
|
||||
<el-table-column type="index" width="50"></el-table-column>
|
||||
<el-table-column label="商品名称" prop="name">
|
||||
<template v-slot="scope">
|
||||
|
|
@ -89,15 +152,15 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<template v-slot="scope">
|
||||
<!-- <el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number> -->
|
||||
<el-input-number v-model="scope.row.costPrice" :min="0" controls-position="right"
|
||||
@change="e => { modifyPrice(); scope.row.costPrice = e }"></el-input-number>
|
||||
<div class="tips">成本价¥{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.number" :min="0" controls-position="right"
|
||||
@change="e => scope.row.totalAmount = e * scope.row.guidePrice"></el-input-number>
|
||||
@change="e => { modifyPrice(); scope.row.totalAmount = e }"></el-input-number>
|
||||
<div class="tips">出库前:{{ scope.row.stockNumber }}{{ scope.row.unitName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -123,7 +186,10 @@
|
|||
<div>
|
||||
<el-button type="primary" @click="submitHandle" :loading="queryFormLoading">确定</el-button>
|
||||
</div>
|
||||
<!-- 选择商品 -->
|
||||
<shopList ref="shopList" @success="selectShop" />
|
||||
<!-- 选择耗材 -->
|
||||
<ConsumableList ref="ConsumableList" @success="selectConsumable" />
|
||||
<el-dialog :visible.sync="showResult" :show-close="false" :close-on-press-escape="false"
|
||||
:close-on-click-modal="false">
|
||||
<el-result icon="success" title="出库提交成功" :subTitle="`共操作${tableData.list.length}件商品`">
|
||||
|
|
@ -140,14 +206,31 @@
|
|||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import shopList from '@/components/shopList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn } from '@/api/invoicing'
|
||||
import shopList from './components/shopList'
|
||||
import ConsumableList from './components/consumableList'
|
||||
import { tbShopPurveyorGet, tbProductStockOperateOutAndOn, stockInOut } from '@/api/invoicing'
|
||||
import { formatDecimal } from '@/utils'
|
||||
export default {
|
||||
components: {
|
||||
shopList
|
||||
shopList,
|
||||
ConsumableList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formatDecimal,
|
||||
inTabValue: 'goods',
|
||||
inTabs: [
|
||||
{
|
||||
label: '商品出库',
|
||||
value: 'goods',
|
||||
type: 'reject'
|
||||
},
|
||||
{
|
||||
label: '耗材出库',
|
||||
value: 'consumable',
|
||||
type: 'out'
|
||||
}
|
||||
],
|
||||
shopTypesActive: 0,
|
||||
shopTypes: [
|
||||
{
|
||||
|
|
@ -159,6 +242,12 @@ export default {
|
|||
value: 'other-out'
|
||||
}
|
||||
],
|
||||
shopTypes2: [
|
||||
{
|
||||
label: '供应商退货',
|
||||
value: 'reject'
|
||||
}
|
||||
],
|
||||
resetForm: '',
|
||||
queryFormLoading: false,
|
||||
queryForm: {
|
||||
|
|
@ -172,7 +261,7 @@ export default {
|
|||
time: dayjs().format('YYYY-MM-DD'),
|
||||
totalAmount: 0,
|
||||
type: 'reject',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
},
|
||||
queryRules: {
|
||||
purveyorId: [
|
||||
|
|
@ -202,14 +291,52 @@ export default {
|
|||
this.tbShopPurveyorGet()
|
||||
},
|
||||
methods: {
|
||||
// 切换入库内容
|
||||
tabChange(value, type) {
|
||||
this.inTabValue = value
|
||||
this.shopTypesActive = 0
|
||||
this.queryForm.type = type
|
||||
this.resetHandle()
|
||||
},
|
||||
// 计算耗材总价
|
||||
consCountTotal() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.price * ele.stockNumber
|
||||
})
|
||||
this.queryForm.totalAmount = formatDecimal(zong)
|
||||
},
|
||||
// 计算商品总价
|
||||
modifyPrice() {
|
||||
let zong = 0
|
||||
this.tableData.list.forEach(ele => {
|
||||
zong += ele.costPrice * ele.number
|
||||
})
|
||||
this.queryForm.totalAmount = zong
|
||||
},
|
||||
// 提交
|
||||
submitHandle() {
|
||||
this.$refs.queryForm.validate(async valid => {
|
||||
if (valid) {
|
||||
try {
|
||||
this.queryFormLoading = true
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
switch (this.inTabValue) {
|
||||
case 'goods':
|
||||
this.queryForm.list = this.tableData.list
|
||||
await tbProductStockOperateOutAndOn(this.queryForm)
|
||||
break;
|
||||
case 'consumable':
|
||||
this.queryForm.accountsPayable = this.queryForm.totalAmount
|
||||
this.queryForm.actualPayment = this.queryForm.paidAmount
|
||||
this.queryForm.paymentTime = this.queryForm.paidAt
|
||||
this.queryForm.supplierId = this.queryForm.purveyorId
|
||||
this.queryForm.list = this.tableData.list
|
||||
this.queryForm.type = 'out'
|
||||
await stockInOut(this.queryForm)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.queryFormLoading = false
|
||||
this.showResult = true
|
||||
} catch (error) {
|
||||
|
|
@ -219,6 +346,16 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
// 选择耗材
|
||||
selectConsumable(res) {
|
||||
this.tableData.list = res.map(item => {
|
||||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfold = item.id
|
||||
return item
|
||||
})
|
||||
},
|
||||
// 选择商品
|
||||
selectShop(res) {
|
||||
let arr = []
|
||||
|
|
@ -242,6 +379,7 @@ export default {
|
|||
this.showResult = false
|
||||
this.queryForm = { ...this.resetForm }
|
||||
this.tableData.list = []
|
||||
this.$refs.queryForm.resetFields()
|
||||
},
|
||||
// 切换类型
|
||||
changeTypeEnum(index) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,165 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div class="filter_wrap">
|
||||
<el-input v-model="query.name" size="small" clearable placeholder="供应商"
|
||||
@keyup.enter.native="getTableData" style="width: 200px;" />
|
||||
<el-select v-model="query.type" placeholder="选择类型">
|
||||
<el-option label="进货" value="purveyor"></el-option>
|
||||
<el-option label="退货" value="reject"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addSupplier.show()">添加供应商</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading">
|
||||
<el-table-column label="供应商" prop="purveyorName"></el-table-column>
|
||||
<el-table-column label="联系电话" prop="purveyorTelephone"></el-table-column>
|
||||
<el-table-column label="地址" prop="address"></el-table-column>
|
||||
<!-- <el-table-column label="标签" prop="tip"></el-table-column> -->
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
<el-table-column label="剩余付款金额" prop="waitAmount">
|
||||
<template v-slot="scope">
|
||||
<span class="num">
|
||||
¥{{ scope.row.waitAmount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="待付款笔数" prop="waitCount">
|
||||
<template v-slot="scope">
|
||||
<template v-if="scope.row.waitCount > 0">
|
||||
有<span class="count">{{ scope.row.waitCount }}笔</span>未付
|
||||
</template>
|
||||
<template v-else>-</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="type">
|
||||
<template v-slot="scope">
|
||||
<el-tag :type="scope.row.type == 0 ? 'warning' : 'success'">
|
||||
{{ scope.row.type == 0 ? '待支付' : '已完结' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上笔进货日期" prop="lastTransactAt">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
||||
@click="$refs.addSupplier.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
<router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.id } }">
|
||||
<el-button type="text" size="mini">结款记录</el-button>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="pagesizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<addSupplier ref="addSupplier" @success="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import { tbShopPurveyorGets, tbShopPurveyor } from '@/api/invoicing'
|
||||
import addSupplier from './components/addSupplier'
|
||||
export default {
|
||||
components: {
|
||||
addSupplier
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
name: '',
|
||||
type: ""
|
||||
},
|
||||
tableData: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
sort: 'id',
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 删除
|
||||
async delHandle(ids) {
|
||||
try {
|
||||
await tbShopPurveyor(ids, 'delete')
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: `删除成功`,
|
||||
type: 'success'
|
||||
});
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbShopPurveyorGets({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
sort: this.tableData.sort,
|
||||
purveyorName: this.query.name,
|
||||
type: this.query.type,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = ''
|
||||
this.query.type = ''
|
||||
this.tableData.page = 0;
|
||||
this.getTableData()
|
||||
},
|
||||
pagesizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.tableData.page = 0;
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.num {
|
||||
color: #F56C6C;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: #409EFF;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -13,9 +13,13 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<div class="filter_wrap">
|
||||
<el-select v-model="query.type" placeholder="付款状态">
|
||||
<el-select v-model="query.status" placeholder="付款状态">
|
||||
<el-option label="待支付" value="0"></el-option>
|
||||
<el-option label="已完结" value="1"></el-option>
|
||||
<el-option label="已付款" value="1"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="query.type" placeholder="选择类型">
|
||||
<el-option label="进货" value="purveyor"></el-option>
|
||||
<el-option label="退货" value="reject"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
|
|
@ -61,7 +65,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<!-- <div class="head-container">
|
||||
<div class="select_count_wrap">
|
||||
<div class="select_count">
|
||||
<i class="icon el-icon-warning"></i>
|
||||
|
|
@ -71,7 +75,7 @@
|
|||
</div>
|
||||
<el-button>批量付款</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" @select="selectHandle"
|
||||
@select-all="selectHandle">
|
||||
|
|
@ -83,18 +87,24 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="类型" prop="type">
|
||||
<template v-slot="scope">
|
||||
进货单
|
||||
{{ scope.row.type | typeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" prop="totalAmount">
|
||||
<el-table-column label="应付金额" prop="totalAmount">
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.totalAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已付款金额" prop="totalAmount">
|
||||
<template v-slot="scope">
|
||||
<span style="color: #47B505;">
|
||||
¥{{ scope.row.paidAmount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="待付款金额" prop="waitAmount">
|
||||
<template v-slot="scope">
|
||||
<span class="num" v-if="scope.row.waitAmount > 0">¥{{ scope.row.waitAmount }}</span>
|
||||
<span v-else>-</span>
|
||||
<span class="num"> ¥{{ scope.row.waitAmount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
|
|
@ -104,33 +114,77 @@
|
|||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="付款方式" prop="payType"></el-table-column>
|
||||
<el-table-column label="备注" prop="remark"></el-table-column>
|
||||
<el-table-column label="付款时间" prop="updatedAt">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.paidAt && dayjs(scope.row.paidAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" width="80">
|
||||
<el-table-column label="操作" align="center">
|
||||
<template v-slot="scope">
|
||||
<router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.purveyorId } }">
|
||||
<el-button type="text" size="mini">查看详情</el-button>
|
||||
</router-link>
|
||||
<el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button>
|
||||
<el-button type="text" size="mini"
|
||||
@click="typedialogshowsumbit(scope.row.id)">账单付款记录</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<!-- 付款弹窗组件 -->
|
||||
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
|
||||
<el-form :rules="rules" ref="ruleForm" :model="ruleForm">
|
||||
<el-form-item label="付款金额" label-width="80px" prop="montey">
|
||||
<el-input v-model="ruleForm.montey" placeholder="请输入金额" type="number" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款方式" label-width="80px">
|
||||
<el-input v-model="ruleForm.payType" placeholder="请输入付款方式" type="text"
|
||||
autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" label-width="80px">
|
||||
<el-input v-model="ruleForm.remark" placeholder="请输备注" type="text" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogTableVisible = false; ruleForm.montey = ''; ruleForm.payType = ''">取
|
||||
消</el-button>
|
||||
<el-button type="primary" @click="sumbit('ruleForm')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="账单付款记录" :visible.sync="typedialogshow">
|
||||
<div class="head-container">
|
||||
<el-input v-model="querytypedialogshow.type" size="small" clearable placeholder="支付方式"
|
||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
||||
<div style="margin-top: 10px;">
|
||||
<el-button type="primary" @click="getTableDatatype">查询</el-button>
|
||||
<el-button @click="resetHandletype">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table ref="table" :data="tableDatatype.data" v-loading="tableDatatype.loading" row-key="id">
|
||||
<el-table-column label="支付方式" prop="payType" />
|
||||
<el-table-column label="支付金额" prop="paidAmount" />
|
||||
<el-table-column label="备注" prop="remark" />
|
||||
<el-table-column label="创建时间" prop="createTime">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from 'dayjs'
|
||||
import { tbShopPurveyorTransactInfo, dictDetail, tbShopPurveyorTransactSum } from '@/api/invoicing'
|
||||
import { tbShopPurveyorTransactInfo, paidAmount, dictDetail, tbShopPurveyorTransactSum, tbShopPurveyorTransacttransactPayInfos } from '@/api/invoicing'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 付款当前的id
|
||||
idinfo: "",
|
||||
dayjs,
|
||||
dialogTableVisible: false,
|
||||
timeList: [
|
||||
{
|
||||
label: '全部',
|
||||
|
|
@ -179,9 +233,15 @@ export default {
|
|||
label: '作废'
|
||||
}
|
||||
],
|
||||
ruleForm: {
|
||||
montey: null,
|
||||
payType: null,
|
||||
remark: ""
|
||||
},
|
||||
selectCount: 0,
|
||||
query: {
|
||||
type: '',
|
||||
status: '',
|
||||
time: 'all',
|
||||
createdAt: []
|
||||
},
|
||||
|
|
@ -193,14 +253,65 @@ export default {
|
|||
loading: false,
|
||||
list: []
|
||||
},
|
||||
info: ''
|
||||
info: '',
|
||||
rules: {
|
||||
montey: [
|
||||
{ required: true, message: '请输入金额', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
typedialogshow: false,//查看详情
|
||||
querytypedialogshow: {
|
||||
type: '',
|
||||
id: ''
|
||||
},
|
||||
tableDatatype: {
|
||||
page: 0,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
typeFilter(t) {
|
||||
const m = {
|
||||
purveyor: '进货单',
|
||||
reject: '退货单',
|
||||
cons_in: '耗材入库',
|
||||
cons_out: '耗材出库'
|
||||
}
|
||||
return m[t]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.tbShopPurveyorTransactSum()
|
||||
},
|
||||
methods: {
|
||||
Uppop(id) {
|
||||
this.dialogTableVisible = true
|
||||
this.idinfo = id
|
||||
},
|
||||
sumbit(formName) {
|
||||
this.$refs[formName].validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.dialogTableVisible = false
|
||||
const res = await paidAmount({
|
||||
id: this.idinfo,
|
||||
paidAmount: this.ruleForm.montey,
|
||||
payType: this.ruleForm.payType,
|
||||
remark: this.ruleForm.remark
|
||||
})
|
||||
this.$message({ type: 'success', message: '付款成功!' });
|
||||
this.ruleForm.montey = ''
|
||||
this.ruleForm.payType = ''
|
||||
this.getTableData()
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
|
|
@ -209,13 +320,14 @@ export default {
|
|||
size: this.tableData.size,
|
||||
sort: this.tableData.sort,
|
||||
purveyorId: this.$route.query.purveyorId,
|
||||
status: this.query.type,
|
||||
type: 'purveyor',
|
||||
createdAt: this.query.createdAt
|
||||
status: this.query.status,
|
||||
type: this.query.type,
|
||||
createdAt: this.query.createdAt,
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.list = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
this.tbShopPurveyorTransactSum()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -225,6 +337,8 @@ export default {
|
|||
this.query.time = 'all'
|
||||
this.query.createdAt = []
|
||||
this.tableData.page = 0;
|
||||
this.query.type = ''
|
||||
this.query.status = ''
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
|
|
@ -266,8 +380,41 @@ export default {
|
|||
this.selectCount = selection.length
|
||||
},
|
||||
async tbShopPurveyorTransactSum() {
|
||||
this.info = await tbShopPurveyorTransactSum({ purveyorId: this.$route.query.purveyorId, type: 'purveyor' })
|
||||
}
|
||||
this.info = await tbShopPurveyorTransactSum({ purveyorId: this.$route.query.purveyorId, type: this.query.type })
|
||||
},
|
||||
//记录分页
|
||||
paginationChangetype(e) {
|
||||
this.tableDatatype.page = e - 1
|
||||
this.getTableDatatype()
|
||||
},
|
||||
// 记录重置查询
|
||||
resetHandletype() {
|
||||
this.querytypedialogshow.type = ''
|
||||
this.tableData.page = 0
|
||||
this.getTableDatatype()
|
||||
},
|
||||
typedialogshowsumbit(ID) {
|
||||
this.querytypedialogshow.id = ID
|
||||
this.getTableDatatype()
|
||||
},
|
||||
//记录列表
|
||||
async getTableDatatype() {
|
||||
this.tableDatatype.loading = true
|
||||
try {
|
||||
const res = await tbShopPurveyorTransacttransactPayInfos({
|
||||
// page: this.tableDatatype.page,
|
||||
// size: this.tableDatatype.size,
|
||||
type: this.querytypedialogshow.type,
|
||||
id: this.querytypedialogshow.id
|
||||
})
|
||||
this.typedialogshow = true
|
||||
this.tableDatatype.loading = false
|
||||
this.tableDatatype.data = res
|
||||
this.tableDatatype.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -354,4 +501,9 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
<!-- <style>
|
||||
/deep/ .el-dialog__body{
|
||||
padding-right: 20px!important;
|
||||
}
|
||||
</style> -->
|
||||
|
|
@ -142,7 +142,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">退款:¥-{{ item.refundAmount }}</div>
|
||||
<div class="foot">退款:¥-{{ item.orderAmount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<div class="collect_wrap">
|
||||
<div class="item">
|
||||
<!-- <div class="item">
|
||||
<div class="icon_wrap" style="--bg-color:#C978EE">
|
||||
<i class="icon el-icon-s-goods"></i>
|
||||
</div>
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
<div class="m">¥{{ payCountTotal }}</div>
|
||||
<div class="t">总金额</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="item" v-for="item in payCountList" :key="item.payType">
|
||||
<div class="icon_wrap" style="--bg-color:#fff">
|
||||
<el-image class="img" :src="item.icon"></el-image>
|
||||
|
|
@ -123,10 +123,8 @@
|
|||
{{ item.productName }}
|
||||
<span
|
||||
class="refund"
|
||||
v-if="
|
||||
item.status == 'refunding' || item.status == 'refund'
|
||||
"
|
||||
>(退 - {{ item.num }})</span
|
||||
v-if="item.refundNumber"
|
||||
>(退 - {{ item.refundNumber }})</span
|
||||
>
|
||||
</div>
|
||||
<div class="sku">{{ item.productSkuName }}</div>
|
||||
|
|
@ -140,13 +138,13 @@
|
|||
<div>{{ scope.row.orderType | orderTypeFilter }}</div>
|
||||
<div
|
||||
class="refund"
|
||||
v-if="
|
||||
scope.row.status == 'refunding' || scope.row.status == 'refund'
|
||||
v-if="
|
||||
scope.row.orderType == 'return'
|
||||
"
|
||||
>
|
||||
退款:-¥{{ scope.row.refundAmount }}
|
||||
退款:-¥{{ scope.row.orderAmount }}
|
||||
</div>
|
||||
<div>¥{{ scope.row.orderAmount }}</div>
|
||||
<div v-else>¥{{ scope.row.orderAmount }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
|
|
|
|||
|
|
@ -3,19 +3,24 @@
|
|||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="店铺信息" name="1"></el-tab-pane>
|
||||
<el-tab-pane label="基础配置" name="2"></el-tab-pane>
|
||||
<!-- <el-tab-pane label="通知配置" name="3"></el-tab-pane> -->
|
||||
</el-tabs>
|
||||
<shopInfo v-if="activeName == 1" />
|
||||
<shopSetting v-if="activeName == 2" />
|
||||
<notice v-if="activeName == 3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import shopInfo from './components/shopInfo'
|
||||
import shopSetting from './components/shopSetting'
|
||||
import notice from './components/notice'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
shopInfo,
|
||||
shopSetting
|
||||
shopSetting,
|
||||
notice
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<el-table-column label="用户" prop="headImg" width="200px">
|
||||
<template v-slot="scope">
|
||||
<div class="user_info">
|
||||
<el-image :src="scope.row.headImg" style="width: 40px;height: 40px;">
|
||||
<el-image :src="scope.row.headImg" style="width: 40px;height: 40px;flex-shrink: 0;">
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-user"></i>
|
||||
</div>
|
||||
|
|
@ -68,34 +68,33 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="会员" prop="isVip">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="warning" v-if="scope.row.isVip">{{ scope.row.isVip }}</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.isVip">会员等级{{ scope.row.isVip }}</el-tag>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="余额" prop="amount"></el-table-column>
|
||||
<el-table-column label="积分" prop="totalScore"></el-table-column>
|
||||
<el-table-column label="手机号" prop="telephone"></el-table-column>
|
||||
<el-table-column label="生日" prop="birthDay"></el-table-column>
|
||||
<el-table-column label="注册时间" prop="createAt">
|
||||
<el-table-column label="手机号" prop="telephone" width="160"></el-table-column>
|
||||
<el-table-column label="生日" prop="birthDay" width="200"></el-table-column>
|
||||
<el-table-column label="注册时间" prop="createAt" width="200">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.createAt | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最近登录时间" prop="lastLoginAt">
|
||||
<el-table-column label="最近登录时间" prop="lastLoginAt" width="200">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.lastLoginAt | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120">
|
||||
<!-- <el-table-column label="操作" width="90" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" icon="el-icon-edit"
|
||||
@click="$refs.addActive.show(scope.row)">编辑</el-button>
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" @click="$refs.addActive.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm> -->
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
|
|
@ -113,7 +112,7 @@ export default {
|
|||
return {
|
||||
query: {
|
||||
name: '',
|
||||
isVip: ''
|
||||
isVip: 1
|
||||
},
|
||||
shopInfo:{
|
||||
userTotal:0,
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ module.exports = {
|
|||
configureWebpack: {
|
||||
// provide the app's title in webpack's name field, so that
|
||||
// it can be accessed in index.html to inject the correct title.
|
||||
// 关闭 webpack 的性能提示
|
||||
performance: {
|
||||
hints: false
|
||||
},
|
||||
name: name,
|
||||
resolve: {
|
||||
alias: {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
|
||||
module.exports = {
|
||||
// 其他配置项...
|
||||
optimization: {
|
||||
minimize: true, // 必须开启,否则配置不失效
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue