Merge branch 'dev' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq

This commit is contained in:
gyq 2024-07-19 18:21:03 +08:00
commit fcae02fe4a
16 changed files with 3368 additions and 671 deletions

View File

@ -163,4 +163,58 @@ export function gettbConsInfoFlow(params) {
method: "get",
params
});
}
/**
* 分组查询获取耗材流水信息
*/
export function viewConInfoFlow(data) {
return request({
url: "/api/viewConInfoFlow",
method: "get",
params: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
/**
* 查询耗材单位列表
*/
export function queryTbConUnitInfo(data) {
return request({
url: "/api/tbConUnit/queryTbConUnitInfo",
method: "get",
params: {
shopId: localStorage.getItem("shopId"),
...data
}
});
}
/**
* 新增耗材单位
*/
export function addtbConUnit(data) {
return request({
url: '/api/tbConUnit',
method: "post",
data:{
shopId: localStorage.getItem("shopId"),
...data
}
});
}
/**
* 修改耗材单位
*/
export function edittbConUnit(data) {
return request({
url: '/api/tbConUnit',
method: "put",
data:{
shopId: localStorage.getItem("shopId"),
...data
}
});
}

View File

@ -241,6 +241,16 @@ export function stockStateChange(params) {
}
});
}
// 下架
export function stockStateChangess(params) {
return request({
url: `/api/stock/grounding`,
method: "put",
params: {
...params
}
});
}
// 警戒设置
export function stockStatewarnLine(params) {
return request({

View File

@ -0,0 +1,174 @@
<template>
<div>
<el-dialog width="60%" :visible.sync="dialogVisible" :title="query.conName">
<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 @click="resetHandle">重置</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="50vh"
>
<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="订单编号" >
<template v-slot="scope">
<a class="cursor-pointer" @click="toOrderList(scope.row)">{{ scope.row.orderNo||'' }}</a>
</template>
</el-table-column>
<!-- <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>
</el-dialog>
<order-detail ref="orderDetail"></order-detail>
</div>
</template>
<script>
import { gettbConsInfoFlow } from "@/api/consumable";
import orderDetail from "@/views/order_manage/components/orderDetail";
export default {
components:{
orderDetail
},
data() {
return {
query: {
conName: "",
consId:''
},
dialogVisible:false,
clickseetableData: {
data: [],
page: 0,
size: 10,
loading: false,
total: 0,
},
};
},
mounted() {
},
methods: {
toOrderList(data){
console.log(data)
// if(data.orderId){
// this.$refs.orderDetail.show({id:data.orderId})
// }
this.$router.push({
path:'/order_manage/order_list',
query:{
orderNo: data.orderNo||'WX20240717165941120'
}
})
},
open(query){
this.dialogVisible = true;
this.query=query
console.log(query)
this.getTableData();
},
close(){
this.dialogVisible = false;
},
lookDetail(row) {
console.log(row);
},
resetHandle() {
this.clickseetableData.page = 0;
this.clickseetableData.size = 30;
this.query.conName = "";
this.query.consId = "";
this.getTableData();
},
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,
...this.query,
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">
.cursor-pointer{
cursor: pointer;
color: #1890ff;
font-size: 12px;
transition: all 0.3s;
}
.cursor-pointer:hover{
opacity: .7;
}
</style>

View File

@ -43,6 +43,13 @@
{{ scope.row.leftNumber + scope.row.stockNumber }} {{ scope.row.unitName }}
</template>
</el-table-column>
<el-table-column label="订单号">
<template v-slot="scope">
<span @click="goUrl(scope.row.orderNo)" style="color: blue;cursor: pointer">
{{ scope.row.orderNo }}
</span>
</template>
</el-table-column>
<el-table-column label="操作时间" prop="updatedAt">
<template v-slot="scope">
{{ dayjs(scope.row.updatedAt).format('YYYY-MM-DD HH:mm:ss') }}
@ -112,6 +119,9 @@ export default {
this.tableData.page = e - 1
this.getTableData()
},
goUrl(orderNo) {
this.$router.push({ path: '/order_manage/order_list', query: { orderNo } })
},
//
resetHandle() {
this.query.blurry = ''

View File

@ -0,0 +1,250 @@
<template>
<div>
<el-dialog width="60vw" 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" height="70vh" :data="tableData.list"
row-key="id" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" lazy :load="load"
@select="firstSelectChange" v-loading="tableData.loading">
<!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
<el-table-column width="30">
<template v-slot="scope">
<i class="" v-if="scope.row.hasChildren == false"></i>
</template>
</el-table-column>
<el-table-column label="商品信息">
<template v-slot="scope">
<div class="shop_info">
<el-image :src="scope.row.coverImg" 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 v-if="scope.row.iskaiguans != 1">
<el-tag type="primary">{{ scope.row.typeEnum }}</el-tag>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="规格">
<template v-slot="scope">
<div v-if="scope.row.iskaiguans">
{{ scope.row.specSnap }}
</div>
</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-column label="绑定耗材" >
<template v-slot="scope">
<div v-if="scope.row.iskaiguans">
<el-button type="text" size="mini" @click="showHaocai">绑定耗材</el-button>
</div>
</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>
<choose-haocai ref="chooseHaocai"></choose-haocai>
</div>
</template>
<script>
import { tbShopCategoryGet, tbProductlist,stocks } from "@/api/invoicing";
import chooseHaocai from "../consumable/components/choose_haocai";
export default {
components:{chooseHaocai},
data() {
return {
dialogVisible: false,
searhForm: {
name: '',
category: ''
},
categoryList: [],
tableData: {
page: 0,
size: 30,
total: 0,
loading: false,
list: []
},
goods: [],
//
isselect: false
}
},
methods: {
showHaocai(){
this.$refs.chooseHaocai.open()
},
async load(tree, treeNode, resolve) {
const res = await stocks({
productId: tree.id,
})
res.forEach(ele => ele.iskaiguans = 1)
setTimeout(() => {
resolve(res)
}, 50);
},
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 = 30
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.map(v=>{
// const hasChildren=v.typeEnum == '' && v.isDistribute == 0
const hasChildren=true
return{...v,hasChildren}
})
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>

View File

@ -80,7 +80,7 @@ export default {
categoryList: [],
tableData: {
page: 0,
size: 10,
size: 30,
total: 0,
loading: false,
list: []
@ -114,7 +114,7 @@ export default {
this.searhForm.name = ''
this.searhForm.category = ''
this.tableData.page = 0
this.tableData.size = 10
this.tableData.size = 30
this.tableData.list = []
this.getTableData()
},

View File

@ -0,0 +1,621 @@
<!-- eslint-disable no-empty -->
<template>
<div class="">
<el-dialog title="耗材信息" width="60vw" :visible.sync="informationdialogshow" @close="resetHaocaiTable">
<div class="head-container flex">
<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;margin-left: 10px">
<el-button
style="margin-right: 10px"
type="primary"
@click="getTableDatainformation"
>查询</el-button
>
<el-button @click="resetHandleinformation">重置</el-button>
</div>
</div>
<el-table
ref="haocaiTable"
:data="tableDatainformation.data"
v-loading="tableDatainformation.loading"
@selection-change="haocaiSelectedChange"
row-key="id"
>
<el-table-column
type="selection"
width="55"
align="center"
></el-table-column>
<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 style="display: flex; justify-content: flex-end">
<el-button
style="margin-right: 20px"
@click="haocaiCancel"
>取消</el-button
>
<el-button type="primary" @click="haocaiConfirm">确定</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import Sortable from "sortablejs";
import dayjs from "dayjs";
import { upProSort, tbProduct } from "@/api/shop";
import {
getviewConSku,
gettbProductSpec,
gettbConsInfo,
posttbProskuCons,
puttbProskuCon,
deletetbProskuCon,
} from "@/api/consumable";
//
let haocaiSelectedMap = {};
export default {
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: 10,
loading: false,
total: 0,
},
tableDataskudialogshow: false,
querytableDatasku: {
specSnap: "",
name: "",
shopName: "",
},
tableDatasku: {
data: [],
page: 0,
size: 30,
loading: false,
total: 0,
},
rules: {},
// -
addSelect: [],
//
commodityArr: [],
// index
ALLisDistribute: null,
};
},
mounted() {
this.getTableDatainformation();
},
methods: {
open(){
this.informationdialogshow=true
},
close(){
this.informationdialogshow=false
},
resetCommodityArr(){
this.commodityArr=[]
this.$refs.addSelect.resetFields();
},
resetHaocaiTable(){
console.log('close')
haocaiSelectedMap={}
console.log(haocaiSelectedMap)
this.$refs.haocaiTable.clearSelection()
},
delGoodsHaocai(haocais,haocaiIndex){
if(haocais.length===1){
return
}
haocais.splice(haocaiIndex,1)
},
//
initTableSelected(){
for(let i in haocaiSelectedMap){
const index=this.tableDatainformation.data.findIndex(v=>v.id==i)
if(index!=-1&&haocaiSelectedMap[i]){
//id
delete haocaiSelectedMap[i]
requestAnimationFrame(()=>{
this.$refs.haocaiTable.toggleRowSelection(this.tableDatainformation.data[index],haocaiSelectedMap[i])
})
}
}
},
haocaiCancel(){
this.informationdialogshow = false
},
haocaiConfirm(){
console.log(haocaiSelectedMap)
this.$emit('confirm',haocaiSelectedMap)
this.informationdialogshow = false;
return
this.commodityArr.forEach((ele) => {
if (ele.id == this.ALLisDistribute.id) {
ele.haocais=[]
let index=-1;
for(let key in haocaiSelectedMap){
const item=haocaiSelectedMap[key]
console.log(item)
index++
this.$set(ele.haocais,index,{
consInfoId:item.id,
conInfoId:item.id,
conName:item.conName,
skuId:ele.id,
shopId:ele.shopId,
})
}
}
});
this.informationdialogshow = false;
},
haocaiSelectedChange(e) {
const arr = e.filter((v) => v);
console.log(arr);
for(let item of this.tableDatainformation.data){
//id
const hasCacheIncludes=haocaiSelectedMap.hasOwnProperty(item.id)
//id
const hasSelectedIncludes=arr.find(v=>v.id==item.id)
if(hasSelectedIncludes){
haocaiSelectedMap[item.id] = hasSelectedIncludes;
}
if(hasCacheIncludes&&!hasSelectedIncludes){
delete haocaiSelectedMap[item.id];
}
}
console.log(haocaiSelectedMap);
},
limitInput(value, name) {
this.surplusStocks.surplusStock =
("" + value) //
// .replace(/[^\d^\.]+/g, '') //
.replace(/^0+(\d)/, "$1") // 00
.replace(/^\./, "0.") // 0.
.match(/^\d*(\.?\d{0,2})/g)[0] || "";
},
handleKeyUp(value, index) {
console.log(value, index, "体哦傲视1");
if (value < 0) {
this.commodityArr[index].surplusStock = value * -1;
}
},
selectShop(res) {
console.log(res)
this.$refs.bindHaocai.open(res)
return
this.commodityArr = [];
const haocais= {conName:'',surplusStock:""};
const arr=res.map(v=>{
return{...v,haocais:v.skuList.map(sku=>{
return{...sku,conName:sku.conName||'',surplusStock:sku.surplusStock||''}
})}
})
this.addSelect = res.map(v=>{
return {...v,haocais:[{...haocais}]}
})
this.commodityArr=arr
this.clickdialogframe("add");
return
res.forEach((ele, i) => {
// isDistribute1-0
//
let sname = ele.name;
if (ele.isDistribute == 1) {
console.log('单规格')
ele.specSnap = ele.name;
ele.conName = ele.conName;
this.commodityArr.push({...ele,haocais:[{...haocais}]});
ele.names = sname;
} else {
//
console.log('多规格')
ele.skuList.forEach((element, indexs) => {
if (indexs == 0) {
element.names = sname;
}
element.conInfoId = element.id;
element.conName = element.conName;
if (element.specSnap == null) {
element.specSnap = sname;
}
this.commodityArr.push({...element,haocais:[{...haocais}]});
});
}
});
this.clickdialogframe("add");
},
//
selecthaocai(item) {
this.ALLisDistribute = item;
this.commodityArr.forEach((ele) => {
if (ele.id == this.ALLisDistribute.id) {
console.log(ele.haocais)
ele.haocais.map(v=>{
if(v.conInfoId){
haocaiSelectedMap[v.conInfoId]=v
}
})
}
});
this.initTableSelected()
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;
this.initTableSelected()
} catch (error) {
console.log(error);
}
},
//
tableDatainformationtable(item) {
this.commodityArr.forEach((ele) => {
if (ele.id == this.ALLisDistribute.id) {
console.log(ele.haocais)
ele.haocais[0].consInfoId = item.id;
ele.haocais[0].conInfoId = item.id;
ele.haocais[0].conName = item.conName;
ele.haocais[0].skuId = ele.id;
ele.haocais[0].shopId = ele.shopId;
}
});
this.informationdialogshow = 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 {
// isDistribute1-0
let isgongx = false;
this.commodityArr.forEach((ele) => {
ele.haocais.forEach(v=>{
if (!v.skuId || !v.surplusStock) {
isgongx = true;
}
})
});
if (isgongx) {
this.$message.error("请选择耗材信息与输入耗材值");
isgongx = false;
return;
}
this.commodityArr.forEach((ele) => {
// ele.skuInfos = ele.skuList;
console.log(ele)
ele.skuInfos = ele.haocais;
ele.productId = ele.id; //id
});
await posttbProskuCons(this.commodityArr);
// this.addSelect.forEach((ele) => {
// // ele.skuInfos = ele.skuList;
// console.log(ele)
// ele.skuInfos = ele.haocais;
// ele.productId = ele.id; //id
// });
// await posttbProskuCons(this.addSelect);
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">
.flex{
display: flex;
align-content: center;
}
.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;
}
}
}
.head-container .filter-item{
margin: 0 5px 0 0;;
}
</style>

View File

@ -0,0 +1,105 @@
<template>
<div>
<el-dialog width="60%" :visible.sync="dialogVisible" :title="query.conName">
<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 @click="resetHandle">重置</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="50vh"
>
<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="bizName" />
<el-table-column label="商品名称" prop="productName" />
<el-table-column label="订单编号" >
<template v-slot="scope">
<a class="cursor-pointer" @click="toOrderList(scope.row)">{{ scope.row.orderNo||'' }}</a>
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="createTime"
></el-table-column>
</el-table>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
query: {
conName: "",
consId:''
},
dialogVisible:false,
clickseetableData: {
data: [],
page: 0,
size: 10,
loading: false,
total: 0,
},
};
},
mounted() {
},
methods: {
open(data){
console.log(data)
this.dialogVisible = true;
this.clickseetableData=data
},
close(){
this.dialogVisible = false;
},
lookDetail(row) {
console.log(row);
},
resetHandle() {
},
pageSizeChange(e) {
},
paginationChangetype(e) {
}
}
};
</script>
<style scoped>
.cursor-pointer{
cursor: pointer;
color: #1890ff;
transition: all 0.3s;
}
.cursor-pointer:hover{
opacity: .7;
}
</style>

View File

@ -0,0 +1,239 @@
<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 @click="resetHandle">重置</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="consId"
:expand-row-keys="expands"
@expand-change="expandChange"
height="66vh"
>
<el-table-column type="expand">
<template slot-scope="props">
<el-table
ref="recodersTable"
:data="props.row.recoders" 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="bizName" />
<el-table-column label="商品名称" prop="productName">
<template v-slot="scope">
{{ scope.row.productName }}
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="createTime"
></el-table-column>
</el-table>
<div class="head-container">
<el-pagination
:total="props.row.total"
:current-page="props.row.page + 1"
:page-size="props.row.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="recodersPageChange($event, props.row)"
@size-change="recodersSizeChange($event, props.row)"
/>
</div>
</template>
</el-table-column>
<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="pageSizeChange "
/>
</div>
</div>
</template>
<script>
import { gettbConsInfoFlow, viewConInfoFlow } from "@/api/consumable";
export default {
data() {
return {
expands:[],
query: {
conName: "",
},
clickseetableData: {
data: [],
page: 0,
size: 30,
loading: false,
total: 0,
},
};
},
mounted() {
this.getTableData();
},
methods: {
resetRecodetsTable(){
this.expands=[];
},
recodersPageChange(page,row) {
// this.clickseetableData.page = e - 1;
row.page=page-1;
this.getGroupConInfoFlow(row);
},
recodersSizeChange(size,row){
const index = this.clickseetableData.data.findIndex(
(v) => v.consId == row.consId
);
if(index!=-1){
row.size=size;
row.page=0;
}
this.getGroupConInfoFlow(row);
},
//
async getGroupConInfoFlow(row) {
try {
row.loading = true;
const res = await gettbConsInfoFlow({
page: row.page,
size: row.size,
consId: row.consId,
conName: row.conName,
shopId: localStorage.getItem("shopId"),
});
row.loading = false;
const index = this.clickseetableData.data.findIndex(
(v) => v.consId == row.consId
);
if (index != -1) {
this.$set(this.clickseetableData.data, index, {
...this.clickseetableData.data[index],
recoders: res.content,
total: res.totalElements,
});
}
// const res = await gettbConsInfoFlow({
// page: this.clickseetableData.page,
// size: this.clickseetableData.size,
// consId: "",
// conName: this.query.conName,
// shopId: localStorage.getItem("shopId")
// });
console.log(res);
this.clickseetableData.loading = false;
} catch (error) {
console.log(error);
}
},
expandChange(row, expandedRows) {
//
if (expandedRows.length) {
this.expands=[];
if(row){
this.expands.push(row.consId);
}
this.getGroupConInfoFlow(row);
} else {
this.expands=[];
}
},
resetHandle() {
this.clickseetableData.page = 0;
this.clickseetableData.size = 30;
this.query.conName = "";
this.getTableData();
this.resetRecodetsTable()
},
pageSizeChange(e) {
this.clickseetableData.size = e;
this.clickseetableData.page = 0;
this.resetRecodetsTable()
this.getTableData();
},
paginationChangetype(e) {
this.clickseetableData.page = e - 1;
this.resetRecodetsTable()
this.getTableData();
},
//
async getTableData() {
try {
this.clickseetableData.loading = true;
const res = await viewConInfoFlow({
page: this.clickseetableData.page,
size: this.clickseetableData.size,
consId: "",
conName: this.query.conName,
shopId: localStorage.getItem("shopId"),
});
// const res = await gettbConsInfoFlow({
// page: this.clickseetableData.page,
// size: this.clickseetableData.size,
// consId: "",
// conName: this.query.conName,
// shopId: localStorage.getItem("shopId")
// });
console.log(res);
this.clickseetableData.loading = false;
this.clickseetableData.data = res.content.map((v) => {
return { ...v, recoders: [], total: 0,
page: 0,
size: 30,
loading: false
};
});
this.clickseetableData.total = res.totalElements;
} catch (error) {
console.log(error);
}
},
},
};
</script>

View File

@ -20,20 +20,31 @@
height="66vh"
>
<el-table-column label="耗材名称" prop="conName" />
<el-table-column label="变动库存" prop="amount">
<el-table-column label="现有库存" >
<template v-slot="scope">
<span :class="{ red: scope.row.bizType == '-' }"
>{{ scope.row.bizType }}{{ scope.row.amount }}</span
<span :class="[computedClass(scope.row.balance)]"> {{scope.row.balance }}</span>
</template>
</el-table-column>
<el-table-column label="耗材消耗" prop="conConsume" />
<el-table-column label="耗材入库" prop="conIn" />
<el-table-column label="耗材出库" prop="conOut" />
<el-table-column label="耗材反还" prop="conReturn" />
<!-- <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="操作" >
<template v-slot="scope">
<el-button
type="text"
@click="lookDetail(scope.row)"
>查看详情</el-button
>
</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') }}
@ -57,12 +68,19 @@
"
/>
</div>
<cons-record-detail ref="recodeDetail"></cons-record-detail>
</div>
</template>
<script>
import { gettbConsInfoFlow } from "@/api/consumable";
import { gettbConsInfoFlow,viewConInfoFlow } from "@/api/consumable";
import consRecordDetail from "../components/cons_record_detail";
export default {
components:{
consRecordDetail
},
data() {
return {
query: {
@ -81,6 +99,17 @@ export default {
this.getTableData();
},
methods: {
computedClass(num){
if(num>0){
return 'green'
}else{
return 'red'
}
},
lookDetail(row){
console.log(row)
this.$refs.recodeDetail.open(row)
},
resetHandle() {
this.clickseetableData.page = 0;
this.clickseetableData.size = 30;
@ -99,11 +128,10 @@ export default {
async getTableData() {
try {
this.clickseetableData.loading = true;
const res = await gettbConsInfoFlow({
const res = await viewConInfoFlow({
page: this.clickseetableData.page,
size: this.clickseetableData.size,
consId: "",
conName: this.query.conName,
...this.query,
shopId: localStorage.getItem("shopId")
});
this.clickseetableData.loading = false;
@ -116,3 +144,14 @@ export default {
}
};
</script>
<style lang="scss" scoped>
.green{
color: #13ce66;
font-weight: bold;
}
.red{
color: #ff4949;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,362 @@
<!-- 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.name"
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="name" />
<el-table-column label="耗材单位值" prop="value" />
<!-- <el-table-column label="是否按照当前单位消耗" prop="isconsume">
<template v-slot="scope">
<el-switch v-model="scope.row.isConsume" @change="isConsumeChange(scope.row)" />
</template>
</el-table-column> -->
<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="操作" 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"
@close="resetRuleForm"
>
<el-form ref="refruleForm" :model="ruleForm" :rules="rules" value-key="">
<el-form-item label="父单位" prop="parentId">
<el-select v-model="ruleForm.parentId" placeholder="请选择父单位">
<el-option
v-for="item in unitLists"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="耗材单位名称" prop="name">
<el-input v-model="ruleForm.name" />
</el-form-item>
<el-form-item label="耗材单位值" prop="value">
<el-input v-model="ruleForm.value" type="number" />
</el-form-item>
<el-form-item label="是否按照当前单位消耗" prop="isConsume">
<el-switch v-model="ruleForm.isConsume" />
</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 {
queryTbConUnitInfo,
addtbConUnit,
edittbConUnit,
} from "@/api/consumable";
export default {
data() {
return {
unitLists: [
{
label: "无",
value: null,
},
],
dayjs,
query: {
name: "",
parentId: "",
status: "",
},
categorys: [],
typeEnums: [
{
label: "正常",
value: "1",
},
{
label: "禁用",
value: "0",
},
],
dialogshow: false, //
dialogtitle: "", //
tableData: {
data: [],
page: 0,
size: 30,
loading: false,
total: 0,
},
ruleForm: {
parentId: "",
name: "",
value: "",
shopId: localStorage.getItem("shopId"),
isConsume: false,
},
rules: {
name: [
{ required: true, message: "请输入耗材单位名称", trigger: "blur" },
],
value: [
{ required: true, message: "请输入耗材单位值", trigger: "blur" },
],
},
};
},
mounted() {
this.getTableData();
this.getAllUnit();
this.$nextTick(() => {
// this.tableDrag()
});
},
methods: {
async isConsumeChange(row){
await edittbConUnit({...row,isConsume:row.isConsume?1:0})
this.$notify.success("修改成功");
},
//
getAllUnit() {
queryTbConUnitInfo({ size: 100, page: 0 }).then((res) => {
const arr = res.content.map((item) => {
return {
label: item.name,
value: item.id,
};
});
this.unitLists.push(...arr);
});
},
resetRuleForm() {
this.ruleForm.name=''
this.ruleForm.value=''
this.ruleForm.parentId=''
this.ruleForm.isConsume=false
this.$refs.refruleForm.resetFields();
},
//
resetHandle() {
this.query.name = "";
this.query.parentId = "";
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 queryTbConUnitInfo({
page: this.tableData.page,
size: this.tableData.size,
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);
}
},
//
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.name = item.name;
this.ruleForm.value = item.value;
this.ruleForm.isConsume = item.isConsume == 1 ? true : false;
}
this.dialogshow = true;
},
submitForm(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
if (this.dialogtitle == "编辑") {
await edittbConUnit(this.ruleForm);
this.dialogshow = false;
this.$notify.success("修改成功");
this.getTableData();
} else {
console.log(this.ruleForm);
const { name, value, parentId, isConsume } = this.ruleForm;
await addtbConUnit({
name,
value,
parentId,
isConsume: isConsume ? "1" : "0",
});
this.$notify.success("添加成功");
}
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>

View File

@ -4,37 +4,104 @@
<div class="head-container">
<div class="row_wrap">
<div class="row">
<el-input v-model="query.conTypeId" size="small" clearable placeholder="请输入类型id" style="width: 150px;"
@keyup.enter.native="getTableData" />
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入类型名称" style="width: 150px;"
@keyup.enter.native="getTableData" />
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 150px;"
@keyup.enter.native="getTableData" />
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 150px;"
@keyup.enter.native="getTableData" />
<div style="width: 150px;">
<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-input
v-model="query.conTypeId"
size="small"
clearable
placeholder="请输入类型id"
style="width: 150px"
@keyup.enter.native="getTableData"
/> -->
<div style="width: 150px">
<el-select
v-model="query.conTypeId"
placeholder="请选择耗材分类"
style="width: 100%"
>
<el-option
:label="item.conTypeName"
:value="item.id"
v-for="item in consTypeList"
:key="item.conTypeId"
/>
</el-select>
</div>
<el-input
v-model="query.conTypeName"
size="small"
clearable
placeholder="请输入类型名称"
style="width: 150px"
@keyup.enter.native="getTableData"
/>
<el-input
v-model="query.conCode"
size="small"
clearable
placeholder="请输入耗材代码"
style="width: 150px"
@keyup.enter.native="getTableData"
/>
<el-input
v-model="query.conName"
size="small"
clearable
placeholder="请输入耗材名称"
style="width: 150px"
@keyup.enter.native="getTableData"
/>
<div style="width: 150px">
<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>
</div>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
</div>
<div class="row">
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出耗材</el-button>
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button>
<el-button
icon="el-icon-download"
:loading="downloadLoading"
@click="protHandle"
>导出耗材</el-button
>
<el-button
icon="el-icon-upload2"
:loading="uploadLoading"
@click="dialogVisible = true"
>导入耗材</el-button
>
</div>
</div>
</div>
<div class="head-container">
<el-row>
<el-col>
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
<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
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" />
@ -63,10 +130,22 @@
</el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template v-slot="scope">
<el-button type="text" @click="editorHandle(scope.row)">编辑</el-button>
<el-button type="text" @click="clicksee(scope.row)" style="margin-left: 10px !important;">耗材记录</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" @click="editorHandle(scope.row)"
>编辑</el-button
>
<el-button
type="text"
@click="clicksee(scope.row)"
style="margin-left: 10px !important"
>耗材记录</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> -->
@ -80,39 +159,83 @@
</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();
}
" />
<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
: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-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-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-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="conTypeId" v-if="dialogtitle == '添加'">
<el-select v-model="ruleForm.conTypeId" placeholder="请选择">
<el-option v-for="item in consTypeList" :key="item.conTypeId" :label="item.conTypeName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="80%">
<template v-if="dialogtitle != '编辑'">
<div v-for="(item, index) in ruleForms" :key="index">
<el-form
:inline="true"
:ref="'refruleForm'+index"
:model="item"
:rules="rules"
class="demo-form-inline"
>
<el-form-item label=" ">
<i
class="el-icon-remove-outline color-danger"
@click="ruleFormsReduce(index)"
></i>
</el-form-item>
<el-form-item label="单位" prop="conUnit">
<el-input
v-model="item.conUnit"
placeholder="请输入单位"
></el-input>
</el-form-item>
<el-form-item label="耗材类型" prop="conTypeId">
<el-select v-model="item.conTypeId" placeholder="请选择" @change="selectChange($event,'refruleForm'+index,'conTypeId')" >
<el-option
v-for="option in consTypeList"
:key="option.conTypeId"
:label="option.conTypeName"
:value="option.id"
>
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item
label="耗材类型"
prop="conNames"
v-if="dialogtitle == '添加'"
@ -123,55 +246,176 @@
disabled
></el-input>
</el-form-item>-->
<!-- <el-form-item v-if="dialogtitle == '添加'">
<!-- <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-form-item label="耗材信息名称" prop="conName">
<el-input
v-model="item.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="耗材价格">
<el-input v-model="ruleForm.price" placeholder="请输入耗材价格"></el-input>
</el-form-item>
<el-form-item label="预警值">
<el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input>
</el-form-item>
<el-form-item label="状态" v-if="dialogtitle == '编辑'">
<el-switch v-model="ruleForm.status" active-value="1" inactive-value="0"></el-switch>
</el-form-item>
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
<el-form-item label="耗材价格">
<el-input
v-model="item.price"
placeholder="请输入耗材价格"
></el-input>
</el-form-item>
<el-form-item label="预警值">
<el-input
v-model="item.conWarning"
placeholder="请输入耗材预警值"
></el-input>
</el-form-item>
<el-form-item label=" ">
<i
class="el-icon-circle-plus-outline color-success"
@click="ruleFormsAdd(index)"
></i>
</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-form>
</div>
<div style="display: flex; justify-content: flex-end">
<el-button @click="dialogshow = false"> </el-button>
<el-button type="primary" @click="submitForm('refruleForm')">
<el-button type="primary" @click="submitForms()">
</el-button>
</div>
</template>
<template v-else>
<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>
<el-form-item label="耗材类型" prop="conTypeId" v-if="dialogtitle == '添加'">
<el-select v-model="ruleForm.conTypeId" placeholder="请选择">
<el-option v-for="item in consTypeList" :key="item.conTypeId" :label="item.conTypeName" :value="item.id">
</el-option>
</el-select>
</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="耗材价格">
<el-input
v-model="ruleForm.price"
placeholder="请输入耗材价格"
></el-input>
</el-form-item>
<el-form-item label="预警值">
<el-input
v-model="ruleForm.conWarning"
placeholder="请输入耗材预警值"
></el-input>
</el-form-item>
<el-form-item label="状态" v-if="dialogtitle == '编辑'">
<el-switch
v-model="ruleForm.status"
active-value="1"
inactive-value="0"
></el-switch>
</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>
</template>
</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-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;">
<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
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" />
@ -188,19 +432,30 @@
</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" />
<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
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>
<span :class="{ red: scope.row.bizType == '-' }"
>{{ scope.row.bizType }}{{ scope.row.amount }}</span
>
</template>
</el-table-column>
<el-table-column label="现有库存" prop="balance" />
@ -208,7 +463,10 @@
<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="productName"
></el-table-column>
<el-table-column label="创建时间" prop="createTime"></el-table-column>
<!-- <el-table-column label="更新时间" prop="updateTime">
<template v-slot="scope">
@ -218,10 +476,20 @@
</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"
<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; getConsRecord() }" />
@size-change="
(e) => {
clickseetableData.size = e;
clickseetableData.page = 0;
getConsRecord();
}
"
/>
</div>
</el-dialog>
<!-- 耗材盘点 -->
@ -238,6 +506,18 @@ import Sortable from "sortablejs";
import dayjs from "dayjs";
import settings from "@/settings";
import { upProSort } from "@/api/shop";
function returnPromise(index,prosise){
return new Promise((resolve,reject)=>{
prosise.then(res=>{
console.log(res);
resolve({sucees:true})
}).catch(err=>{
console.log(err);
resolve({sucees:false})
})
})
}
import {
gettbConsType,
gettbConsInfo,
@ -316,6 +596,7 @@ export default {
total: 0
},
ruleFormLoading: false,
ruleForms:[],
ruleForm: {
conCode: "",
conName: "",
@ -336,7 +617,7 @@ export default {
{ required: true, message: "请输入耗材信息名称", trigger: "blur" }
],
conTypeId: [
{ required: true, message: "请选择耗材类型", trigger: "blur" }
{ required: true, message: "请选择耗材类型", trigger: "change" }
],
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
conWarning: [
@ -362,10 +643,34 @@ export default {
},
mounted() {
this.resetQuery = { ...this.query }
this.resetRuleForms()
this.getTableData();
this.getTableDatatype();
this.gettbConsType()
},
methods: {
//selectc
selectChange($event,ref,type){
this.$refs[ref][0].validateField(type)
},
//
resetRuleForms(){
this.ruleForms=[{...this.ruleForm}]
this.$refs['refruleForm0']&&this.$refs['refruleForm0'][0].resetFields()
},
//
ruleFormsReduce(index){
if(this.ruleForms.length>1){
this.ruleForms.splice(index,1)
}else{
this.$message({ type: "error", message: "至少保留一种耗材" });
}
},
//
ruleFormsAdd(){
console.log('add')
this.ruleForms.push({...this.ruleForm})
},
//
async excelSuccessUpload(file) {
try {
@ -509,7 +814,8 @@ export default {
this.dialogtitle = "添加";
this.gettbConsType()
this.$nextTick(() => {
this.$refs.refruleForm.resetFields();
// this.$refs.refruleForm.resetFields();
this.resetRuleForms()
});
} else {
this.dialogtitle = "编辑";
@ -523,7 +829,32 @@ export default {
}
this.dialogshow = true;
},
//
async submitForms() {
let isAllPassForm=0
for(let i in this.ruleForms){
const res=await returnPromise(i,this.$refs['refruleForm'+i][0].validate())
console.log(res)
isAllPassForm+=res.sucees?1:0
}
//
if(isAllPassForm===this.ruleForms.length){
await posttbConsInfo( this.ruleForms)
this.$message({ type: "success", message: "添加成功" });
// for(let i of this.ruleForms){
// const res=await posttbConsInfo(i)
// this.$message({ type: "success", message: "" });
// }
this.dialogshow = false;
this.resetRuleForms()
this.ruleFormLoading = false;
this.getTableData();
}
},
//
submitForm(formName) {
this.$refs[formName].validate(async valid => {
if (valid) {
this.ruleFormLoading = true;
@ -532,12 +863,17 @@ export default {
this.$message({ type: "success", message: "编辑成功" });
this.dialogshow = false;
} else {
//
console.log(this.ruleForm, '调试')
await posttbConsInfo({
...this.ruleForm
});
this.$message({ type: "success", message: "添加成功" });
// //
// console.log(this.ruleForm, '')
// for(let i of this.ruleForms){
// console.log(i)
// await posttbConsInfo({
// ...i
// });
// this.$message({ type: "success", message: "" });
// }
}
this.dialogshow = false;
this.$refs[formName].resetFields();
@ -590,6 +926,16 @@ export default {
</script>
<style scoped lang="scss">
.color-success {
color: #67c23a;
cursor: pointer;
font-weight: 700;
}
.color-danger {
color: #f56c6c;
font-weight: 700;
cursor: pointer;
}
.row_wrap {
display: flex;
justify-content: space-between;

File diff suppressed because it is too large Load Diff

View File

@ -82,12 +82,19 @@
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="">
</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="下架">
<template v-slot="scope">
<el-switch v-model="scope.row.isGrounding" :active-value="true" :inactive-value="false"
@change="showChangesss($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"
@ -128,7 +135,7 @@
</template>
<script>
import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks } from '@/api/invoicing'
import { stock, stockdownload, stockdoImport, stockStatewarnLine, stockStateChanges, stocks, stockStateChangess } from '@/api/invoicing'
import { tbShopCategoryGet } from '@/api/shop'
import settings from '@/settings'
import invoicingDetail from './components/invoicingDetail'
@ -280,6 +287,18 @@ export default {
}
},
//
async showChangesss(e, row) {
await stockStateChangess({
"isGrounding": row.isGrounding,
skuId: row.skuId,
shopId: localStorage.getItem('shopId')
})
this.$message({
type: "success",
message: "修改成功"
})
},
async getTableData() {
this.tableData.loading = true
try {

View File

@ -10,11 +10,7 @@
<el-form-item label="订单状态">
<el-radio-group v-model="query.status">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button
:label="item.key"
v-for="item in orderEnum.status"
:key="item.key"
>
<el-radio-button :label="item.key" v-for="item in orderEnum.status" :key="item.key">
{{ item.label }}
</el-radio-button>
</el-radio-group>
@ -22,11 +18,7 @@
<el-form-item label="支付方式">
<el-radio-group v-model="query.payType">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button
:label="item.payType"
v-for="item in payTypes"
:key="item.payType"
>
<el-radio-button :label="item.payType" v-for="item in payTypes" :key="item.payType">
{{ item.payName }}
</el-radio-button>
</el-radio-group>
@ -42,35 +34,35 @@
<el-radio-button label="month">本月</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group>
<el-date-picker
v-model="query.createdAt"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
v-if="timeValue == 'custom'"
>
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
v-if="timeValue == 'custom'">
</el-date-picker>
</el-form-item>
<el-form-item label="订单号">
<el-input
v-model="query.orderNo"
placeholder="请输入订单号"
style="width: 300px;"
></el-input>
</el-form-item>
<el-form-item label="商品名称">
<el-input
v-model="query.productName"
placeholder="请输入商品名称"
style="width: 300px;"
></el-input>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
<el-button
icon="el-icon-download"
v-loading="downloadLoading"
@click="downloadHandle"
>
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
<span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span>
</el-button>
</el-form-item>
</el-form>
</div>
<div class="head-container">
@ -112,20 +104,12 @@
<el-table-column label="商品信息">
<template v-slot="scope">
<div class="goods_info">
<div
class="row"
v-for="item in scope.row.detailList"
:key="item.id"
>
<div class="row" v-for="item in scope.row.detailList" :key="item.id">
<el-image :src="item.productImg" class="cover" lazy></el-image>
<div class="info">
<div class="name">
{{ item.productName }}
<span
class="refund"
v-if="item.refundNumber"
>(退 - {{ item.refundNumber }})</span
>
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
</div>
<div class="sku">{{ item.productSkuName }}</div>
</div>
@ -134,15 +118,12 @@
</template>
</el-table-column>
<el-table-column label="台桌号" prop="tableName"></el-table-column>
<el-table-column label="订单金额">
<el-table-column label="订单金额">
<template v-slot="scope">
<div>{{ scope.row.orderType | orderTypeFilter }}</div>
<div
class="refund"
v-if="
scope.row.orderType == 'return'
"
>
<div class="refund" v-if="
scope.row.orderType == 'return'
">
退款-{{ scope.row.orderAmount }}
</div>
<div v-else>{{ scope.row.orderAmount }}</div>
@ -150,11 +131,9 @@
</el-table-column>
<el-table-column label="状态">
<template v-slot="scope">
<template
v-if="
scope.row.status == 'refund' && scope.row.orderType != 'return'
"
>
<template v-if="
scope.row.status == 'refund' && scope.row.orderType != 'return'
">
<el-tag type="primary">已完成</el-tag>
</template>
<template v-else>
@ -174,22 +153,15 @@
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="scope">
<el-button type="text" @click="$refs.orderDetail.show(scope.row)"
>详情</el-button
>
<el-button type="text" @click="$refs.orderDetail.show(scope.row)">详情</el-button>
</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"
@current-change="paginationChange"
@size-change="sizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<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>
</div>
<orderDetail ref="orderDetail" />
</div>
@ -218,7 +190,8 @@ export default {
status: "",
payType: "",
orderNo: "",
createdAt: []
createdAt: [],
productName:''
},
tableData: {
data: [],
@ -232,6 +205,7 @@ export default {
payCountTotal: 0
};
},
filters: {
orderTypeFilter(t) {
if (t) {
@ -259,12 +233,22 @@ export default {
}
},
mounted() {
if(this.$route.query.tableName){
if (this.$route.query.tableName) {
this.query.tableName = this.$route.query.tableName
}
if(this.$route.query.orderNo){
this.query.orderNo = this.$route.query.orderNo
}
this.resetQuery = { ...this.query };
this.tbShopPayTypeGet();
this.getTableData();
// --
if (this.$route.query.orderNo) {
this.query.orderNo = this.$route.query.orderNo
setTimeout(() => {
this.getTableData();
}, 200);
}
},
methods: {
//
@ -320,11 +304,13 @@ export default {
this.tableData.loading = true;
try {
this.payCount();
const productName=this.query.productName.replace(/\s+/g,'')
const res = await tbOrderInfoData({
page: this.tableData.page,
pageSize: this.tableData.size,
orderType: this.orderType,
...this.query
...this.query,
productName
});
this.tableData.loading = false;
this.tableData.data = res.content;

View File

@ -49,7 +49,16 @@ export default {
code: this.form.prepareAmount,
pwd: md5(this.form.password),
}
if (!this.form.prepareAmount) {
this.$message({
message: "请输入验证码或密码"
})
return
}
const res = await modfiyUserInfo(data);
this.form.prepareAmount = ''
this.form.password = "******"
this.disabled = true
this.$message({
message: '修改成功',
type: 'success'