将耗材记录加入到耗材列表里

This commit is contained in:
duan 2024-08-14 16:02:52 +08:00
parent 1e52030f5e
commit 3b7dbe50a2
6 changed files with 240 additions and 337 deletions

View File

@ -39,12 +39,19 @@ export function puttbConsType(data) {
* @returns
*/
export function gettbConsInfo(params) {
// return request({
// url: '/api/tbConsInfo',
// method: "get",
// params
// });
return request({
url: '/api/tbConsInfo',
url: "/api/viewConInfoFlow",
method: "get",
params
});
});
}
/**
* 耗材入库
* @returns

View File

@ -13,99 +13,43 @@
@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 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"
/>
<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 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-column prop="id" label="ID" width="50px" />
<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">
@ -113,10 +57,42 @@
{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template>
</el-table-column>
<el-table-column label="现有库存">
<template v-slot="scope">
<span :class="[computedClass(scope.row.balance)]"> {{ scope.row.balance }}</span>
</template>
</el-table-column>
<el-table-column label="耗材消耗" prop="conConsume" align="center" />
<el-table-column label="耗材入库" prop="conIn" align="center" />
<el-table-column label="耗材出库" prop="conOut" align="center" />
<el-table-column label="耗材反还" prop="conReturn" align="center" />
<el-table-column label="库存开关" prop="conReturn" align="center">
<template v-slot="scope">
<el-switch v-model="scope.row.isCheck" active-value="1" inactive-value="0"
@change="showChange($event, scope.row)"></el-switch>
</template>
</el-table-column>
<!-- <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="所属商品" width="320" align="center">
<template v-slot="scope">
<!-- <el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
item.productName }}</el-button> -->
{{ scope.row.productName }}
</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) }}
{{ (scope.row.balance).toFixed(2) }}
<!-- {{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }} -->
</template>
</el-table-column>
@ -128,24 +104,13 @@
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
</template> -->
</el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<el-table-column label="操作" width="250" 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 style="margin-left: 10px !important" type="text" @click="lookDetail(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> -->
@ -159,44 +124,23 @@
</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-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>
@ -205,33 +149,18 @@
<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 :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>
<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-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-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>
@ -252,10 +181,7 @@
>
</el-form-item> -->
<el-form-item label="耗材信息名称" prop="conName">
<el-input
v-model="item.conName"
placeholder="请输入耗材信息名称"
></el-input>
<el-input v-model="item.conName" placeholder="请输入耗材信息名称"></el-input>
</el-form-item>
<!-- <el-form-item label="耗材信息代码" prop="conCode">
<el-input
@ -264,23 +190,14 @@
></el-input>
</el-form-item> -->
<el-form-item label="耗材价格">
<el-input
v-model="item.price"
placeholder="请输入耗材价格"
></el-input>
<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-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>
<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>
@ -297,16 +214,10 @@
</template>
<template v-else>
<el-form
:inline="true"
ref="refruleForm"
:model="ruleForm"
:rules="rules"
class="demo-form-inline"
>
<el-form-item label="单位" prop="conUnit" >
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
</el-form-item>
<el-form :inline="true" ref="refruleForm" :model="ruleForm" :rules="rules" class="demo-form-inline">
<el-form-item label="单位" prop="conUnit">
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
</el-form-item>
<!-- <el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'">
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
</el-form-item>
@ -333,10 +244,7 @@
>
</el-form-item> -->
<el-form-item label="耗材信息名称" prop="conName">
<el-input
v-model="ruleForm.conName"
placeholder="请输入耗材信息名称"
></el-input>
<el-input v-model="ruleForm.conName" placeholder="请输入耗材信息名称"></el-input>
</el-form-item>
<!-- <el-form-item label="耗材信息代码" prop="conCode">
<el-input
@ -345,23 +253,13 @@
></el-input>
</el-form-item> -->
<el-form-item label="耗材价格">
<el-input
v-model="ruleForm.price"
placeholder="请输入耗材价格"
></el-input>
<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-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-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>
@ -378,47 +276,19 @@
<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">
<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" />
@ -435,30 +305,19 @@
</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" />
@ -466,10 +325,7 @@
<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">
@ -479,24 +335,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"
@current-change="paginationChangetype"
@size-change="
(e) => {
clickseetableData.size = e;
clickseetableData.page = 0;
getConsRecord();
}
"
/>
<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();
}
" />
</div>
</el-dialog>
<!-- 耗材盘点 -->
<AddConsTakin ref="AddConsTakin" @success="resetHandle" />
<!-- 查看详情 -->
<cons-record-detail ref="recodeDetail"></cons-record-detail>
<!-- 导入耗材 -->
<el-dialog title="导入库存" :visible.sync="dialogVisible">
<UploadExcel :beforeUpload="excelSuccessUpload" />
@ -508,19 +360,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})
})
})
}
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,
@ -533,8 +384,10 @@ import AddConsTakin from "../components/addConsTakin";
import { tbConsInfodownload, tbConsInfoinputStock } from '@/api/invoicing'
import { downloadFile } from "@/utils";
import UploadExcel from '@/components/UploadExcel'
import consRecordDetail from "../components/cons_record_detail";
export default {
components: { AddConsTakin, UploadExcel },
components: { AddConsTakin, UploadExcel, consRecordDetail },
data() {
return {
dayjs,
@ -599,7 +452,7 @@ export default {
total: 0
},
ruleFormLoading: false,
ruleForms:[],
ruleForms: [],
ruleForm: {
conCode: "",
conName: "",
@ -652,27 +505,33 @@ export default {
this.gettbConsType()
},
methods: {
lookDetail(row) {
this.$refs.recodeDetail.open({
"consId": row.consId,
"conName": row.conName
})
},
//selectc
selectChange($event,ref,type){
selectChange($event, ref, type) {
this.$refs[ref][0].validateField(type)
},
//
resetRuleForms(){
this.ruleForms=[{...this.ruleForm}]
this.$refs['refruleForm0']&&this.$refs['refruleForm0'][0].resetFields()
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{
ruleFormsReduce(index) {
if (this.ruleForms.length > 1) {
this.ruleForms.splice(index, 1)
} else {
this.$message({ type: "error", message: "至少保留一种耗材" });
}
},
//
ruleFormsAdd(){
ruleFormsAdd() {
console.log('add')
this.ruleForms.push({...this.ruleForm})
this.ruleForms.push({ ...this.ruleForm })
},
//
async excelSuccessUpload(file) {
@ -689,6 +548,22 @@ export default {
console.log(error);
}
},
computedClass(num) {
if (num > 0) {
return 'green'
} else {
return 'red'
}
},
//
async showChange(e, row) {
await postapitbConsInfo([{
id: row.consId,
"isCheck": row.isCheck,
shopId: localStorage.getItem('shopId')
}])
this.$message.success('修改成功')
},
//
async protHandle() {
try {
@ -707,7 +582,8 @@ export default {
for (let key in this.ruleForm) {
this.ruleForm[key] = row[key];
}
this.ruleForm.id = row.id;
console.log(row, '调试1')
this.ruleForm.id = row.consId;
this.dialogshow = true;
},
//
@ -822,7 +698,7 @@ export default {
});
} else {
this.dialogtitle = "编辑";
this.ruleForm.id = item.id;
this.ruleForm.id = item.consId;
this.ruleForm.conTypeId = item.conTypeId;
this.ruleForm.conCode = item.conCode;
this.ruleForm.conName = item.conName;
@ -832,17 +708,17 @@ 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())
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
isAllPassForm += res.sucees ? 1 : 0
}
//
if(isAllPassForm===this.ruleForms.length){
await posttbConsInfo( this.ruleForms)
if (isAllPassForm === this.ruleForms.length) {
await posttbConsInfo(this.ruleForms)
this.$message({ type: "success", message: "添加成功" });
// for(let i of this.ruleForms){
@ -850,9 +726,9 @@ export default {
// this.$message({ type: "success", message: "" });
// }
this.dialogshow = false;
this.resetRuleForms()
this.ruleFormLoading = false;
this.getTableData();
this.resetRuleForms()
this.ruleFormLoading = false;
this.getTableData();
}
},
//
@ -862,6 +738,7 @@ export default {
if (valid) {
this.ruleFormLoading = true;
if (this.dialogtitle == "编辑") {
console.log(this.ruleForm, '调试 ')
await postapitbConsInfo([this.ruleForm]);
this.$message({ type: "success", message: "编辑成功" });
this.dialogshow = false;
@ -934,11 +811,13 @@ export default {
cursor: pointer;
font-weight: 700;
}
.color-danger {
color: #f56c6c;
font-weight: 700;
cursor: pointer;
}
.row_wrap {
display: flex;
justify-content: space-between;

View File

@ -17,6 +17,11 @@
<el-option label="关" :value="0"></el-option>
</el-select>
</div>
<div style="width: 300px;">
<el-select clearable v-model="query.sort" placeholder="排序">
<el-option label="按数量排序" value="1" />
</el-select>
</div>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
<el-button @click="Uppop()">库存预警:{{ warnLine }}</el-button>
@ -155,6 +160,7 @@ export default {
montey: "",
categorys: [],
query: {
sort: "", //
name: '',
isStock: '',
num: '',
@ -233,7 +239,7 @@ export default {
const file = await stockdownload({
name: this.query.name,
isStock: this.query.isStock,
num: this.query.num
num: this.query.num,
})
downloadFile(file, "商品库存", "xlsx");
this.downloadLoading = false;
@ -309,6 +315,7 @@ export default {
isStock: this.query.isStock,
num: this.query.num,
categoryId: this.query.categoryId,
sort:this.query.sort,
shopId: localStorage.getItem('shopId')
})
this.tableData.loading = false

View File

@ -27,9 +27,21 @@
<el-radio :label="0">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="售卖时间管控" v-if="form.id">
<el-radio-group v-model="form.useTime">
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="" v-if="form.useTime == 1" prop="saleTime">
<el-time-picker is-range v-model="form.saleTime" value-format="HH:mm" format="HH:mm"
range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围">
</el-time-picker>
</el-form-item>
<el-form-item label="分组排序" v-if="form.id">
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
@ -57,6 +69,7 @@ export default {
isShow: 1,
sort: 0,
productIds: [],
useTime: 0,
shopId: localStorage.getItem('shopId')
},
rules: {
@ -66,7 +79,14 @@ export default {
message: ' ',
trigger: 'blur'
}
]
],
saleTime: [
{
required: true,
message: '请选择',
trigger: 'blur'
}
],
},
productIds: []
}
@ -94,11 +114,14 @@ export default {
return falg
},
onSubmitHandle() {
this.$refs.form.validate(async valid => {
if (valid) {
this.loading = true
try {
this.form.productIds = this.productIds.map(item => item.id);
this.form.saleStartTime = this.form.saleTime[0]
this.form.saleEndTime = this.form.saleTime[1]
let res = null
if (!this.form.id) {
await tbProductGroupPost(this.form)

View File

@ -10,6 +10,11 @@
<el-table :data="tableData.list" v-loading="tableData.loading" row-key="id">
<el-table-column label="排序" sortable prop="sort"></el-table-column>
<el-table-column label="分组名称" prop="name"></el-table-column>
<el-table-column label="售卖时间管控" prop="useTime">
<template v-slot="scope">
{{ scope.row.useTime==1? scope.row.saleStartTime +'-'+scope.row.saleEndTime:'' }}
</template>
</el-table-column>
<el-table-column label="状态">
<template v-slot="scope">
<el-switch v-model="scope.row.isShow" :active-value="1" :inactive-value="0"

View File

@ -3,10 +3,7 @@
<div class="head-container">
<el-form :model="query" inline>
<el-form-item label="搜索">
<el-input
v-model="query.name"
placeholder="请输入昵称或手机号"
></el-input>
<el-input v-model="query.name" placeholder="请输入昵称或手机号"></el-input>
</el-form-item>
<el-form-item label="是否为会员">
<el-select v-model="query.isVip" placeholder="是否是会员">
@ -43,9 +40,7 @@
<div class="n">{{ shopInfo.chageTotal || 0 }}</div>
</div>
<div class="item">
<el-button type="success" @click="toPage('charge')"
>充值记录</el-button
>
<el-button type="success" @click="toPage('charge')">充值记录</el-button>
<!-- <el-button type="danger" @click="toPage('cost')">消费记录</el-button> -->
</div>
</div>
@ -57,10 +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;flex-shrink: 0;"
>
<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>
@ -76,24 +68,16 @@
</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="inMoney"></el-table-column>
<el-table-column label="订单数量" prop="orderNumber"></el-table-column>
<el-table-column label="积分" prop="totalScore"></el-table-column>
<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="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 }}
@ -104,26 +88,24 @@
{{ scope.row.lastLoginAt | timeFilter }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="90" fixed="right">
<template v-slot="scope">
<el-button type="text" @click="$refs.addActive.show(scope.row)">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
<!-- <el-table-column label="操作" width="200"> -->
<!-- <template v-slot="scope">
<el-button type="text" @click="">历史订单</el-button>
<el-button type="text" @click="">充值记录</el-button>
<el-button type="text" @click="">余额</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-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"
@size-change="sizeChange"
@current-change="paginationChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@size-change="sizeChange" @current-change="paginationChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</div>
</template>