耗材列表增加编辑功能
This commit is contained in:
parent
2ae72a8ae6
commit
1f06dffae3
|
|
@ -63,7 +63,7 @@ export function posttbConsInfostockIn(data) {
|
||||||
export function postapitbConsInfo(data) {
|
export function postapitbConsInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/tbConsInfo',
|
url: '/api/tbConsInfo',
|
||||||
method: "post",
|
method: "put",
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,61 @@
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-input v-model="query.conTypeId" size="small" clearable placeholder="请输入类型id" style="width: 100%;"
|
<el-input
|
||||||
class="filter-item" @keyup.enter.native="getTableData" />
|
v-model="query.conTypeId"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入类型id"
|
||||||
|
style="width: 100%;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="getTableData"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入类型名称" style="width: 100%;"
|
<el-input
|
||||||
class="filter-item" @keyup.enter.native="getTableData" />
|
v-model="query.conTypeName"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入类型名称"
|
||||||
|
style="width: 100%;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="getTableData"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 100%;"
|
<el-input
|
||||||
class="filter-item" @keyup.enter.native="getTableData" />
|
v-model="query.conCode"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入耗材代码"
|
||||||
|
style="width: 100%;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="getTableData"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 100%;"
|
<el-input
|
||||||
class="filter-item" @keyup.enter.native="getTableData" />
|
v-model="query.conName"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入耗材名称"
|
||||||
|
style="width: 100%;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="getTableData"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%;">
|
<el-select
|
||||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
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-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
|
|
@ -33,12 +70,22 @@
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<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-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container" id="table_drag">
|
<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 prop="id" label="ID" width="50px" />
|
||||||
<el-table-column label="耗材名称" prop="conName" />
|
<el-table-column label="耗材名称" prop="conName" />
|
||||||
<el-table-column label="耗材代码" prop="conCode" />
|
<el-table-column label="耗材代码" prop="conCode" />
|
||||||
|
|
@ -47,7 +94,7 @@
|
||||||
<el-table-column label="单位" prop="conUnit" />
|
<el-table-column label="单位" prop="conUnit" />
|
||||||
<el-table-column label="创建时间" prop="createTime" width="200">
|
<el-table-column label="创建时间" prop="createTime" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="最近入库量" prop="lasterInStock" /> -->
|
<!-- <el-table-column label="最近入库量" prop="lasterInStock" /> -->
|
||||||
|
|
@ -65,11 +112,24 @@
|
||||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</template> -->
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="160" fixed="right">
|
<el-table-column label="操作" width="180" fixed="right">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="text" @click="clicksee(scope.row)">耗材记录</el-button>
|
<el-button type="text" @click="editorHandle(scope.row)"
|
||||||
<el-button type="text" size="mini" style="margin-left: 10px !important;"
|
>编辑</el-button
|
||||||
@click="$refs.AddConsTakin.show(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" icon="el-icon-rank">排序</el-button> -->
|
||||||
<!-- <el-button type="text" @click="clickdialogfadd(scope.row)"
|
<!-- <el-button type="text" @click="clickdialogfadd(scope.row)"
|
||||||
style="margin-left: 10px !important;">入库</el-button> -->
|
style="margin-left: 10px !important;">入库</el-button> -->
|
||||||
|
|
@ -83,70 +143,160 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
<el-pagination
|
||||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange"
|
:total="tableData.total"
|
||||||
@size-change="e => { tableData.size = e; tableData.page = 0; getTableData() }" />
|
: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>
|
</div>
|
||||||
<!-- 耗材入库 -->
|
<!-- 耗材入库 -->
|
||||||
<el-dialog title="耗材入库" :visible.sync="libraryshow">
|
<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-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>
|
||||||
<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 @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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 修改和增加 -->
|
<!-- 修改和增加 -->
|
||||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="70%">
|
<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
|
||||||
|
:inline="true"
|
||||||
|
ref="refruleForm"
|
||||||
|
:model="ruleForm"
|
||||||
|
:rules="rules"
|
||||||
|
class="demo-form-inline"
|
||||||
|
>
|
||||||
<el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'">
|
<el-form-item label="单位" prop="conUnit" v-if="dialogtitle == '添加'">
|
||||||
<el-input v-model="ruleForm.conUnit" placeholder="请输入单位"></el-input>
|
<el-input
|
||||||
|
v-model="ruleForm.conUnit"
|
||||||
|
placeholder="请输入单位"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="耗材类型" prop="conNames" v-if="dialogtitle == '添加'">
|
<el-form-item
|
||||||
<el-input v-model="ruleForm.conNames" placeholder="请输耗材信息名称" disabled></el-input>
|
label="耗材类型"
|
||||||
|
prop="conNames"
|
||||||
|
v-if="dialogtitle == '添加'"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="ruleForm.conNames"
|
||||||
|
placeholder="请输耗材信息名称"
|
||||||
|
disabled
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</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-button type="primary" @click="typedialogshow = true"
|
||||||
|
>去选择</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="耗材信息名称" prop="conName">
|
<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>
|
||||||
<el-form-item label="耗材信息代码" prop="conCode">
|
<el-form-item label="耗材信息代码" prop="conCode">
|
||||||
<el-input v-model="ruleForm.conCode" placeholder="请输入耗材信息代码"></el-input>
|
<el-input
|
||||||
|
v-model="ruleForm.conCode"
|
||||||
|
placeholder="请输入耗材信息代码"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="耗材价格" prop="price">
|
<el-form-item label="耗材价格" prop="price">
|
||||||
<el-input v-model="ruleForm.price" placeholder="请输入耗材价格"></el-input>
|
<el-input
|
||||||
|
v-model="ruleForm.price"
|
||||||
|
placeholder="请输入耗材价格"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预警值" prop="conWarning">
|
<el-form-item label="预警值" prop="conWarning">
|
||||||
<el-input v-model="ruleForm.conWarning" placeholder="请输入耗材预警值"></el-input>
|
<el-input
|
||||||
|
v-model="ruleForm.conWarning"
|
||||||
|
placeholder="请输入耗材预警值"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
|
<!-- <el-form-item label="单位耗材值" prop="surplusStock">
|
||||||
<el-input v-model="ruleForm.surplusStock" placeholder="请输入单位耗材值"></el-input>
|
<el-input v-model="ruleForm.surplusStock" placeholder="请输入单位耗材值"></el-input>
|
||||||
</el-form-item> -->
|
</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="dialogshow = false">取 消</el-button>
|
<el-button @click="dialogshow = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="submitForm('refruleForm')">确 定</el-button>
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:loading="ruleFormLoading"
|
||||||
|
@click="submitForm('refruleForm')"
|
||||||
|
>
|
||||||
|
确 定
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog title="选择类型" :visible.sync="typedialogshow">
|
<el-dialog title="选择类型" :visible.sync="typedialogshow">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-input v-model="querytypedialogshowquery.conTypeName" size="small" clearable placeholder="请输入耗材类型名称"
|
<el-input
|
||||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
v-model="querytypedialogshowquery.conTypeName"
|
||||||
<el-input v-model="querytypedialogshowquery.conTypeCode" size="small" clearable placeholder="请输入耗材类型代码"
|
size="small"
|
||||||
style="width: 100%;" class="filter-item" @keyup.enter.native="getTableDatatype" />
|
clearable
|
||||||
<el-select v-model="querytypedialogshowquery.status" placeholder="请选择商品规格" style="width: 100%;">
|
placeholder="请输入耗材类型名称"
|
||||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
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>
|
</el-select>
|
||||||
<div style="margin-top: 10px;">
|
<div style="margin-top: 10px;">
|
||||||
<el-button type="primary" @click="getTableDatatype">查询</el-button>
|
<el-button type="primary" @click="getTableDatatype">查询</el-button>
|
||||||
<el-button @click="resetHandletype">重置</el-button>
|
<el-button @click="resetHandletype">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</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="conTypeName" />
|
||||||
<el-table-column label="耗材类型代码" prop="conTypeCode" />
|
<el-table-column label="耗材类型代码" prop="conTypeCode" />
|
||||||
<el-table-column label="店铺ID" prop="shopId" />
|
<el-table-column label="店铺ID" prop="shopId" />
|
||||||
|
|
@ -163,19 +313,30 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-pagination :total="tableDatatype.total" :current-page="tableDatatype.page + 1"
|
<el-pagination
|
||||||
:page-size="tableDatatype.size" layout="total, sizes, prev, pager, next, jumper"
|
:total="tableDatatype.total"
|
||||||
@current-change="paginationChangetype" />
|
:current-page="tableDatatype.page + 1"
|
||||||
|
:page-size="tableDatatype.size"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@current-change="paginationChangetype"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog title="耗材信息" :visible.sync="clickseetypedialogshow">
|
<el-dialog title="耗材信息" :visible.sync="clickseetypedialogshow">
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id"
|
<el-table
|
||||||
height="450">
|
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="conName" />
|
||||||
<el-table-column label="变动库存" prop="amount">
|
<el-table-column label="变动库存" prop="amount">
|
||||||
<template v-slot="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="现有库存" prop="balance" />
|
<el-table-column label="现有库存" prop="balance" />
|
||||||
|
|
@ -183,7 +344,10 @@
|
||||||
<el-table-column label="业务说明" prop="bizName" />
|
<el-table-column label="业务说明" prop="bizName" />
|
||||||
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
||||||
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
<!-- <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="createTime"></el-table-column>
|
||||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
@ -193,9 +357,13 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
<el-pagination
|
||||||
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
:total="clickseetableData.total"
|
||||||
@current-change="paginationChangetype" />
|
:current-page="clickseetableData.page + 1"
|
||||||
|
:page-size="clickseetableData.size"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@current-change="paginationChangetype"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 耗材盘点 -->
|
<!-- 耗材盘点 -->
|
||||||
|
|
@ -204,43 +372,53 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Sortable from 'sortablejs'
|
import Sortable from "sortablejs";
|
||||||
import dayjs from 'dayjs'
|
import dayjs from "dayjs";
|
||||||
import settings from '@/settings'
|
import settings from "@/settings";
|
||||||
import { upProSort } from '@/api/shop'
|
import { upProSort } from "@/api/shop";
|
||||||
import { gettbConsType, gettbConsInfo, posttbConsInfo, gettbConsInfoFlow, posttbConsInfostockIn, postapitbConsInfo } from '@/api/consumable'
|
import {
|
||||||
import AddConsTakin from '../components/addConsTakin'
|
gettbConsType,
|
||||||
|
gettbConsInfo,
|
||||||
|
posttbConsInfo,
|
||||||
|
gettbConsInfoFlow,
|
||||||
|
posttbConsInfostockIn,
|
||||||
|
postapitbConsInfo
|
||||||
|
} from "@/api/consumable";
|
||||||
|
import AddConsTakin from "../components/addConsTakin";
|
||||||
export default {
|
export default {
|
||||||
components: { AddConsTakin },
|
components: { AddConsTakin },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dayjs,
|
dayjs,
|
||||||
query: {
|
query: {
|
||||||
conTypeId: '',
|
conTypeId: "",
|
||||||
conTypeName: '',
|
conTypeName: "",
|
||||||
conCode: '',
|
conCode: "",
|
||||||
conName: ''
|
conName: ""
|
||||||
},
|
},
|
||||||
libraryshow: false,//耗材入库显示
|
libraryshow: false, //耗材入库显示
|
||||||
libraryshowdata: {
|
libraryshowdata: {
|
||||||
id: '',
|
id: "",
|
||||||
stockNumber: ''
|
stockNumber: ""
|
||||||
},
|
},
|
||||||
ruleslibrary: {
|
ruleslibrary: {
|
||||||
stockNumber: [
|
stockNumber: [
|
||||||
{ required: true, message: '请输入入库数量', trigger: 'blur' }
|
{ required: true, message: "请输入入库数量", trigger: "blur" }
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
categorys: [],
|
categorys: [],
|
||||||
typeEnums: [{
|
typeEnums: [
|
||||||
label: '正常',
|
{
|
||||||
value: '1'
|
label: "正常",
|
||||||
}, {
|
value: "1"
|
||||||
label: '禁用',
|
},
|
||||||
value: '0'
|
{
|
||||||
}],
|
label: "禁用",
|
||||||
|
value: "0"
|
||||||
|
}
|
||||||
|
],
|
||||||
dialogshow: false, //弹框显示
|
dialogshow: false, //弹框显示
|
||||||
dialogtitle: '', //文字显示
|
dialogtitle: "", //文字显示
|
||||||
typedialogshow: false,
|
typedialogshow: false,
|
||||||
tableData: {
|
tableData: {
|
||||||
data: [],
|
data: [],
|
||||||
|
|
@ -250,9 +428,9 @@ export default {
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
querytypedialogshowquery: {
|
querytypedialogshowquery: {
|
||||||
conTypeCode: '',
|
conTypeCode: "",
|
||||||
conTypeName: '',
|
conTypeName: "",
|
||||||
status: ''
|
status: ""
|
||||||
},
|
},
|
||||||
tableDatatype: {
|
tableDatatype: {
|
||||||
data: [],
|
data: [],
|
||||||
|
|
@ -269,71 +447,81 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
|
ruleFormLoading: false,
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
conCode: '',
|
conCode: "",
|
||||||
conName: '',
|
conName: "",
|
||||||
conTypeId: '',
|
conTypeId: "",
|
||||||
price: "",
|
price: "",
|
||||||
conNames: "",
|
conNames: "",
|
||||||
// surplusStock: '',
|
// surplusStock: '',
|
||||||
conUnit: '',
|
conUnit: "",
|
||||||
conWarning: '',
|
conWarning: "",
|
||||||
shopId: localStorage.getItem('shopId'),
|
shopId: localStorage.getItem("shopId")
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
conCode: [
|
conCode: [
|
||||||
{ required: true, message: '请输入耗材信息代码', trigger: 'blur' }
|
{ required: true, message: "请输入耗材信息代码", trigger: "blur" }
|
||||||
],
|
],
|
||||||
conName: [
|
conName: [
|
||||||
{ required: true, message: '请输入耗材信息名称', trigger: 'blur' }
|
{ required: true, message: "请输入耗材信息名称", trigger: "blur" }
|
||||||
],
|
],
|
||||||
conNames: [
|
conNames: [
|
||||||
{ required: true, message: '请选择耗材类型', trigger: 'blur' }
|
{ required: true, message: "请选择耗材类型", trigger: "blur" }
|
||||||
],
|
|
||||||
price: [
|
|
||||||
{ required: true, message: '请输入耗材价格', trigger: 'blur' }
|
|
||||||
],
|
],
|
||||||
|
price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }],
|
||||||
conWarning: [
|
conWarning: [
|
||||||
{ required: true, message: '请输入耗材预警值', trigger: 'blur' }
|
{ required: true, message: "请输入耗材预警值", trigger: "blur" }
|
||||||
],
|
],
|
||||||
conTypeId: [
|
conTypeId: [
|
||||||
{ required: true, message: '请输入耗材类型id', trigger: 'blur' }
|
{ required: true, message: "请输入耗材类型id", trigger: "blur" }
|
||||||
],
|
],
|
||||||
conUnit: [
|
conUnit: [{ required: true, message: "请输入单位", trigger: "blur" }],
|
||||||
{ required: true, message: '请输入单位', trigger: 'blur' }
|
conWarning: [
|
||||||
],
|
{
|
||||||
conWarning: [{
|
required: true,
|
||||||
required: true, message: '请输入单位', trigger: 'blur'
|
message: "请输入单位",
|
||||||
}]
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getTableData()
|
this.getTableData();
|
||||||
this.getTableDatatype()
|
this.getTableDatatype();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 编辑
|
||||||
|
editorHandle(row) {
|
||||||
|
this.dialogtitle = "编辑";
|
||||||
|
for (let key in this.ruleForm) {
|
||||||
|
this.ruleForm[key] = row[key];
|
||||||
|
}
|
||||||
|
this.ruleForm.id = row.id;
|
||||||
|
this.dialogshow = true;
|
||||||
|
},
|
||||||
// 重置查询
|
// 重置查询
|
||||||
resetHandle() {
|
resetHandle() {
|
||||||
this.query.conTypeId = ''
|
this.query.conTypeId = "";
|
||||||
this.query.conTypeName = ''
|
this.query.conTypeName = "";
|
||||||
this.query.conCode = ''
|
this.query.conCode = "";
|
||||||
this.query.conName = ''
|
this.query.conName = "";
|
||||||
this.tableData.page = 0
|
this.tableData.page = 0;
|
||||||
this.getTableData()
|
this.getTableData();
|
||||||
},
|
},
|
||||||
// 分页回调
|
// 分页回调
|
||||||
paginationChange(e) {
|
paginationChange(e) {
|
||||||
this.tableData.page = e - 1
|
this.tableData.page = e - 1;
|
||||||
this.getTableData()
|
this.getTableData();
|
||||||
},
|
},
|
||||||
paginationChangetype(e) {
|
paginationChangetype(e) {
|
||||||
this.tableDatatype.page = e - 1
|
this.tableDatatype.page = e - 1;
|
||||||
this.getTableDatatype()
|
this.getTableDatatype();
|
||||||
},
|
},
|
||||||
// 获取信息
|
// 获取信息
|
||||||
async getTableData() {
|
async getTableData() {
|
||||||
this.tableData.loading = true
|
this.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await gettbConsInfo({
|
const res = await gettbConsInfo({
|
||||||
page: this.tableData.page,
|
page: this.tableData.page,
|
||||||
|
|
@ -342,18 +530,18 @@ export default {
|
||||||
conTypeName: this.query.conTypeName,
|
conTypeName: this.query.conTypeName,
|
||||||
conCode: this.query.conCode,
|
conCode: this.query.conCode,
|
||||||
conName: this.query.conName,
|
conName: this.query.conName,
|
||||||
shopId: localStorage.getItem('shopId')
|
shopId: localStorage.getItem("shopId")
|
||||||
})
|
});
|
||||||
this.tableData.loading = false
|
this.tableData.loading = false;
|
||||||
this.tableData.data = res.content
|
this.tableData.data = res.content;
|
||||||
this.tableData.total = res.totalElements
|
this.tableData.total = res.totalElements;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取类型
|
// 获取类型
|
||||||
async getTableDatatype() {
|
async getTableDatatype() {
|
||||||
this.tableDatatype.loading = true
|
this.tableDatatype.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await gettbConsType({
|
const res = await gettbConsType({
|
||||||
page: this.tableDatatype.page,
|
page: this.tableDatatype.page,
|
||||||
|
|
@ -361,136 +549,130 @@ export default {
|
||||||
conTypeCode: this.querytypedialogshowquery.conTypeCode,
|
conTypeCode: this.querytypedialogshowquery.conTypeCode,
|
||||||
conTypeName: this.querytypedialogshowquery.conTypeName,
|
conTypeName: this.querytypedialogshowquery.conTypeName,
|
||||||
status: this.querytypedialogshowquery.status,
|
status: this.querytypedialogshowquery.status,
|
||||||
shopId: localStorage.getItem('shopId')
|
shopId: localStorage.getItem("shopId")
|
||||||
})
|
});
|
||||||
this.tableDatatype.loading = false
|
this.tableDatatype.loading = false;
|
||||||
this.tableDatatype.data = res.content
|
this.tableDatatype.data = res.content;
|
||||||
this.tableDatatype.total = res.totalElements
|
this.tableDatatype.total = res.totalElements;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 重置查询
|
// 重置查询
|
||||||
resetHandletype() {
|
resetHandletype() {
|
||||||
this.querytypedialogshowquery.conTypeName = ''
|
this.querytypedialogshowquery.conTypeName = "";
|
||||||
this.querytypedialogshowquery.conTypeCode = ''
|
this.querytypedialogshowquery.conTypeCode = "";
|
||||||
this.querytypedialogshowquery.status = ''
|
this.querytypedialogshowquery.status = "";
|
||||||
this.tableData.page = 0
|
this.tableData.page = 0;
|
||||||
this.getTableDatatype()
|
this.getTableDatatype();
|
||||||
},
|
},
|
||||||
// 选择的类型
|
// 选择的类型
|
||||||
tableDatatypetable(item) {
|
tableDatatypetable(item) {
|
||||||
// this.ruleForm.conCode = item.conTypeCode
|
// this.ruleForm.conCode = item.conTypeCode
|
||||||
this.ruleForm.conNames = item.conTypeName
|
this.ruleForm.conNames = item.conTypeName;
|
||||||
this.ruleForm.conTypeId = item.id
|
this.ruleForm.conTypeId = item.id;
|
||||||
this.typedialogshow = false
|
this.typedialogshow = false;
|
||||||
},
|
},
|
||||||
async clickdialogfadd(item) {
|
async clickdialogfadd(item) {
|
||||||
this.libraryshow = true
|
this.libraryshow = true;
|
||||||
this.libraryshowdata.id = item.id
|
this.libraryshowdata.id = item.id;
|
||||||
},
|
},
|
||||||
async clickdialoglibraryshow(formName) {
|
async clickdialoglibraryshow(formName) {
|
||||||
this.$refs[formName].validate(async (valid) => {
|
this.$refs[formName].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
await posttbConsInfostockIn({
|
await posttbConsInfostockIn({
|
||||||
id: this.libraryshowdata.id,
|
id: this.libraryshowdata.id,
|
||||||
stockNumber: this.libraryshowdata.stockNumber
|
stockNumber: this.libraryshowdata.stockNumber
|
||||||
})
|
});
|
||||||
this.libraryshow = false
|
this.libraryshow = false;
|
||||||
this.$refs[formName].resetFields()
|
this.$refs[formName].resetFields();
|
||||||
this.getTableData()
|
this.getTableData();
|
||||||
} else {
|
} else {
|
||||||
console.log('error submit!!')
|
console.log("error submit!!");
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
// 弹框修改值 添加 编辑
|
// 弹框修改值 添加 编辑
|
||||||
clickdialogframe(type, item) {
|
clickdialogframe(type, item) {
|
||||||
if (type == 'add') { // 添加
|
if (type == "add") {
|
||||||
this.dialogtitle = '添加'
|
// 添加
|
||||||
|
this.dialogtitle = "添加";
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.refruleForm.resetFields()
|
this.$refs.refruleForm.resetFields();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.dialogtitle = '编辑'
|
this.dialogtitle = "编辑";
|
||||||
this.ruleForm.id = item.id
|
this.ruleForm.id = item.id;
|
||||||
this.ruleForm.conTypeId = item.conTypeId
|
this.ruleForm.conTypeId = item.conTypeId;
|
||||||
this.ruleForm.conCode = item.conCode
|
this.ruleForm.conCode = item.conCode;
|
||||||
this.ruleForm.conName = item.conName
|
this.ruleForm.conName = item.conName;
|
||||||
// this.ruleForm.surplusStock = item.surplusStock
|
// this.ruleForm.surplusStock = item.surplusStock
|
||||||
this.ruleForm.conWarning = item.conWarning
|
this.ruleForm.conWarning = item.conWarning;
|
||||||
this.ruleForm.conUnit = item.conUnit
|
this.ruleForm.conUnit = item.conUnit;
|
||||||
console.log(this.ruleForm, item)
|
console.log(this.ruleForm, item);
|
||||||
}
|
}
|
||||||
this.dialogshow = true
|
this.dialogshow = true;
|
||||||
},
|
},
|
||||||
submitForm(formName) {
|
submitForm(formName) {
|
||||||
this.$refs[formName].validate(async (valid) => {
|
this.$refs[formName].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.dialogtitle == '编辑') {
|
this.ruleFormLoading = true;
|
||||||
|
if (this.dialogtitle == "编辑") {
|
||||||
await postapitbConsInfo({
|
await postapitbConsInfo(this.ruleForm);
|
||||||
id: this.ruleForm.id,
|
this.$message({ type: "success", message: "编辑成功" });
|
||||||
conCode: this.ruleForm.conCode,
|
this.dialogshow = false;
|
||||||
conName: this.ruleForm.conName,
|
} else {
|
||||||
conTypeId: this.ruleForm.conTypeId,
|
//添加
|
||||||
// surplusStock: this.ruleForm.surplusStock,
|
|
||||||
conUnit: this.ruleForm.conUnit,
|
|
||||||
conWarning: item.conWarning,
|
|
||||||
shopId: this.ruleForm.shopId
|
|
||||||
})
|
|
||||||
this.dialogshow = false
|
|
||||||
} else {//添加
|
|
||||||
await posttbConsInfo({
|
await posttbConsInfo({
|
||||||
...this.ruleForm
|
...this.ruleForm
|
||||||
})
|
});
|
||||||
this.$message({ type: 'success', message: '添加成功' })
|
this.$message({ type: "success", message: "添加成功" });
|
||||||
}
|
}
|
||||||
this.dialogshow = false
|
this.dialogshow = false;
|
||||||
this.$refs[formName].resetFields()
|
this.$refs[formName].resetFields();
|
||||||
this.getTableData()
|
this.ruleFormLoading = false;
|
||||||
|
this.getTableData();
|
||||||
} else {
|
} else {
|
||||||
console.log('error submit!!')
|
console.log("error submit!!");
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
resetForm(formName) {
|
resetForm(formName) {
|
||||||
this.$refs[formName].resetFields()
|
this.$refs[formName].resetFields();
|
||||||
},
|
},
|
||||||
// 删除商品
|
// 删除商品
|
||||||
async delTableHandle(ids) {
|
async delTableHandle(ids) {
|
||||||
try {
|
try {
|
||||||
await tbProductDelete(ids)
|
await tbProductDelete(ids);
|
||||||
this.getTableData()
|
this.getTableData();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//查看查询耗材流水信息
|
//查看查询耗材流水信息
|
||||||
async clicksee(item) {
|
async clicksee(item) {
|
||||||
console.log(item)
|
console.log(item);
|
||||||
this.clickseetypedialogshow = true
|
this.clickseetypedialogshow = true;
|
||||||
this.clickseetableData.loading = true
|
this.clickseetableData.loading = true;
|
||||||
try {
|
try {
|
||||||
const res = await gettbConsInfoFlow({
|
const res = await gettbConsInfoFlow({
|
||||||
page: this.clickseetableData.page,
|
page: this.clickseetableData.page,
|
||||||
size: this.clickseetableData.size,
|
size: this.clickseetableData.size,
|
||||||
consId: item.id,
|
consId: item.id,
|
||||||
conName: item.conName,
|
conName: item.conName,
|
||||||
shopId: localStorage.getItem('shopId')
|
shopId: localStorage.getItem("shopId")
|
||||||
})
|
});
|
||||||
this.clickseetableData.loading = false
|
this.clickseetableData.loading = false;
|
||||||
this.clickseetableData.data = res.content
|
this.clickseetableData.data = res.content;
|
||||||
this.clickseetableData.total = res.totalElements
|
this.clickseetableData.total = res.totalElements;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
@ -521,4 +703,4 @@ export default {
|
||||||
.red {
|
.red {
|
||||||
color: rgb(219, 32, 32);
|
color: rgb(219, 32, 32);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue