This commit is contained in:
魏啾 2024-09-20 15:03:50 +08:00
commit a979d390a3
6 changed files with 330 additions and 123 deletions

View File

@ -80,6 +80,9 @@ export default {
this.resetSearchForm = { ...this.searchForm }
},
methods: {
reset(){
this.$refs.table.clearSelection()
},
onInput: _.debounce(function (event) { //
this.getTableData()
}, 500),

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<div class="head-container">
<div>
<el-form :model="query" inline>
<el-form-item>
<el-input v-model="query.conName" placeholder="耗材信息名称" />
@ -11,24 +11,83 @@
</el-form-item>
</el-form>
</div>
<template>
<div class="box">
<div class="boxitem">
<img src="@/assets/images/data_home_item1_icon.png" />
<div class="boxitem_s">
<div class="boxitem_ses">
<div class="es">
<div class="e">现有数量</div>
<div class="s" style="color: #333333;">3,333</div>
</div>
</div>
</div>
</div>
<div class="boxitem">
<img src="@/assets/images/data_home_item1_icon.png" />
<div class="boxitem_s">
<div class="boxitem_ses">
<div class="es">
<div class="e">增加数量:</div>
<div class="s">3,333</div>
</div>
</div>
<div class="boxitem_ses">
<div class="es">
<div class="e">手动增加:</div>
<div class="s">23</div>
</div>
<div class="es">
<div class="e">入库:</div>
<div class="s">1111</div>
</div>
</div>
</div>
</div>
<div class="boxitem">
<img src="@/assets/images/data_home_item1_icon.png" />
<div class="boxitem_s">
<div class="boxitem_ses">
<div class="es">
<div class="e">减少数量:</div>
<div class="s">1111</div>
</div>
</div>
<div class="boxitem_ses">
<div class="es">
<div class="e">手动减少:</div>
<div class="s">1111</div>
</div>
<div class="es">
<div class="e">消耗:</div>
<div class="s">1111</div>
</div>
<div class="es">
<div class="e">报损:</div>
<div class="s">1111</div>
</div>
<div class="es">
<div class="e">出库:</div>
<div class="s">1111</div>
</div>
</div>
</div>
</div>
</div>
</template>
<div class="head-container">
<el-table
ref="table"
:data="clickseetableData.data"
v-loading="clickseetableData.loading"
row-key="id"
height="66vh"
>
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id">
<el-table-column label="耗材名称" prop="conName" />
<el-table-column label="现有库存" >
<el-table-column label="现有库存">
<template v-slot="scope">
<span :class="[computedClass(scope.row.balance)]"> {{scope.row.balance }}</span>
<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="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="bizCode" /> -->
<!-- <el-table-column label="业务说明" prop="bizName" /> -->
@ -36,25 +95,16 @@
<!-- <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">
<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
>
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId"
type="text">{{ item.productName }}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<el-table-column label="操作" align="center">
<template v-slot="scope">
<el-button
type="text"
@click="lookDetail(scope.row)"
>查看详情</el-button
>
<el-button type="text" @click="lookDetail(scope.row)">查看详情</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="更新时间" prop="updateTime">
@ -65,20 +115,14 @@
</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 => {
<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>
<cons-record-detail ref="recodeDetail"></cons-record-detail>
@ -86,11 +130,11 @@
</template>
<script>
import { gettbConsInfoFlow,viewConInfoFlow } from "@/api/consumable";
import { gettbConsInfoFlow, viewConInfoFlow } from "@/api/consumable";
import consRecordDetail from "../components/cons_record_detail";
export default {
components:{
components: {
consRecordDetail
},
data() {
@ -111,26 +155,26 @@ export default {
this.getTableData();
},
methods: {
toGoods(data){
toGoods(data) {
this.$router.push({
path:'/product/product',
query:{
productId: data.productId
path: '/product/product',
query: {
productId: data.productId
}
})
})
},
computedClass(num){
if(num>0){
computedClass(num) {
if (num > 0) {
return 'green'
}else{
} else {
return 'red'
}
},
lookDetail(row){
lookDetail(row) {
this.$refs.recodeDetail.open({
"consId": row.consId,
"conName": row.conName
})
"consId": row.consId,
"conName": row.conName
})
},
resetHandle() {
this.clickseetableData.page = 0;
@ -157,17 +201,17 @@ export default {
shopId: localStorage.getItem("shopId")
});
this.clickseetableData.loading = false;
this.clickseetableData.data = res.content.map(v=>{
const productIds=v.productId?v.productId.split(','):[]
return{
this.clickseetableData.data = res.content.map(v => {
const productIds = v.productId ? v.productId.split(',') : []
return {
...v,
product:productIds.map((str,index)=>{
const startIndex=str.indexOf('_')
const productId=str.slice(0,startIndex)
const productName=str.slice(startIndex+1,str.length)
product: productIds.map((str, index) => {
const startIndex = str.indexOf('_')
const productId = str.slice(0, startIndex)
const productName = str.slice(startIndex + 1, str.length)
return {
productId,
productName:productName+`${(index==productIds.length-1)?'':','}`
productName: productName + `${(index == productIds.length - 1) ? '' : ','}`
}
})
}
@ -182,22 +226,88 @@ export default {
};
</script>
<style lang="scss" scoped>
.green{
.green {
color: #13ce66;
font-weight: bold;
}
.red{
.red {
color: #ff4949;
font-weight: bold;
}
::v-deep .el-table .cell{
::v-deep .el-table .cell {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
::v-deep .el-table th.el-table__cell>.cell{
::v-deep .el-table th.el-table__cell>.cell {
text-align: center;
}
.box {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 90px 20px 90px;
.boxitem {
min-width: max-content;
display: flex;
justify-content: center;
align-items: center;
padding: 10px 24px;
background: rgba(244, 249, 255, 0.5);
border-radius: 10px;
.boxitem_s {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.boxitem_ses {
margin-top: 10px;
display: flex;
justify-content: flex-start;
align-items: center;
.es {
border-left: 2px solid #DDDFE6;
padding: 0 10px;
display: flex;
justify-content: flex-start;
align-items: center;
.e {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 12px;
color: #666666;
}
.s {
margin-left: 10px;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 15px;
color: #3F9EFF;
}
}
.es:nth-child(1) {
margin-top: 0;
border-left: none;
}
}
.boxitem_ses:nth-child(1) {
margin-top: 0;
}
}
}
}
</style>

View File

@ -12,7 +12,7 @@
style="width: 150px"
@keyup.enter.native="getTableData"
/> -->
<div style="width: 150px">
<!-- <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" />
@ -21,7 +21,7 @@
<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" />
@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">
@ -38,6 +38,11 @@
<el-button @click="resetHandle">重置</el-button>
</div>
<div class="row">
<el-button @click="$router.push({ name: 'operation_in' })">入库</el-button>
<el-button @click="$router.push({ name: 'operation_out' })">出库</el-button>
<el-button @click="$router.push({ name: 'cons_record' })">库存记录</el-button>
<el-button @click="$router.push({ name: 'type' })">分类管理</el-button>
<el-button @click="$router.push({ name: 'supplier_manage' })">供应商管理</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>
@ -63,9 +68,8 @@
<i class="el-icon-edit" @click="scope.row.editNYD = 1"></i>
</template>
</el-table-column>
<el-table-column label="分类名称" prop="conTypeName"></el-table-column>
<!-- <el-table-column label="分类名称" prop="conTypeName"></el-table-column> -->
<el-table-column label="单位" prop="conUnit">
<template v-slot="scope">
<div v-if="scope.row.editNYD == 2">
<el-input v-model="scope.row.conUnit" placeholder="请输入内容" @blur="conNameClick(scope.row)"></el-input>
@ -77,12 +81,12 @@
</template>
</el-table-column>
<el-table-column label="现有库存">
<!-- <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" />
<el-table-column label="耗材消耗" prop="conConsume" />
<el-table-column label="耗材入库" prop="conIn" />
<el-table-column label="耗材出库" prop="conOut" />
<el-table-column label="耗材反还" prop="conReturn" />
@ -91,12 +95,12 @@
<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="所属商品" width="220">
</el-table-column> -->
<el-table-column label="所属商品">
<template v-slot="scope">
<div class="goods-list">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
item.productName }}</el-button>
item.productName }}</el-button>
</div>
</template>
@ -118,19 +122,20 @@
<i class="el-icon-edit" @click="scope.row.editNYD = 3"></i>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" width="200">
<!-- <template v-slot="scope">
{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
</template> -->
<el-table-column label="状态" prop="status">
<template v-slot="scope">
<el-switch v-model="scope.row.status" active-value="1" inactive-value="0"
@change="changeswitchstatus(scope.row)"></el-switch>
</template>
</el-table-column>
<!-- <el-table-column label="创建时间" prop="createTime" width="200"> </el-table-column> -->
<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 style="margin-left: 10px !important" type="text" @click="lookDetail(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> -->
@ -586,6 +591,14 @@ export default {
row.editNYD = 0
this.$message.success('修改成功')
},
async changeswitchstatus(row) {
await postapitbConsInfo([{
id: row.consId,
...row,
shopId: localStorage.getItem('shopId')
}])
this.$message.success('修改成功')
},
computedClass(num) {
if (num > 0) {
return 'green'
@ -861,13 +874,15 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .goods-list .el-button--text span{
::v-deep .goods-list .el-button--text span {
display: block;
text-align: left;
}
::v-deep .goods-list .el-button--text{
::v-deep .goods-list .el-button--text {
white-space: break-spaces;
}
.color-success {
color: #67c23a;
cursor: pointer;

View File

@ -1,7 +1,7 @@
<!-- eslint-disable no-empty -->
<template>
<div class="app-container">
<div class="head-container">
<!-- <div class="head-container">
<el-row :gutter="20">
<el-col :span="3">
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入耗材类型名称" style="width: 100%;"
@ -21,7 +21,7 @@
<el-button @click="resetHandle">重置</el-button>
</el-col>
</el-row>
</div>
</div> -->
<div class="head-container">
<el-row>
<el-col>
@ -31,32 +31,34 @@
</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 prop="id" label="ID" />
<el-table-column label="耗材类型名称" prop="conTypeName" />
<el-table-column label="耗材类型代码" prop="conTypeCode" />
<!-- <el-table-column label="耗材类型代码" prop="conTypeCode" />
<el-table-column label="创建时间" prop="createTime">
<template v-slot="scope">
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="店铺ID" prop="shopId">
<template v-slot="scope">
{{ scope.row.shopId }}
<!-- <el-link type="primary" @click="$router.push({ name: 'information' })">{{ scope.row.shopId }}</el-link> -->
</template>
</el-table-column>
</el-table-column>
<el-table-column label="店铺ID" prop="shopId">
<template v-slot="scope">
<el-link type="primary" @click="$router.push({ name: 'information' })">{{ scope.row.shopId }}</el-link>
</template>
</el-table-column> -->
<el-table-column label="状态" prop="status">
<template v-slot="scope">
<el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
<!-- <el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag> -->
<el-switch active-value="0" inactive-value="1"
v-model="scope.row.status" @change="changeswitch(scope.row)" />
</template>
</el-table-column>
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
<!-- <el-table-column label="排序" prop="sort" sortable />
<el-table-column label="更新时间" prop="updateTime">
<template v-slot="scope">
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table-column>-->
<el-table-column label="操作" width="200">
<template v-slot="scope">
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
@ -77,7 +79,7 @@
<el-dialog :title="dialogtitle" :visible.sync="dialogshow">
<el-form ref="refruleForm" :model="ruleForm" :rules="rules">
<el-form-item label="耗材类型名称" prop="conTypeName">
<el-input v-model="ruleForm.conTypeName" @input="trimInput($event,'conTypeName')"/>
<el-input v-model="ruleForm.conTypeName" @input="trimInput($event, 'conTypeName')" />
</el-form-item>
<!-- <el-form-item label="耗材类型代码" prop="conTypeCode">
<el-input v-model="ruleForm.conTypeCode" />
@ -153,7 +155,7 @@ export default {
})
},
methods: {
trimInput(val,key){
trimInput(val, key) {
console.log(val)
this.ruleForm[key] = val.replace(/\s+/g, '')
},
@ -230,6 +232,17 @@ export default {
}
this.dialogshow = true
},
async changeswitch(item) {
console.log(item)
await puttbConsType({
id: item.id,
conTypeCode: item.conTypeCode,
conTypeName: item.conTypeName,
shopId: item.shopId,
status: item.status
})
this.getTableData()
},
submitForm(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {

View File

@ -118,3 +118,67 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.box {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 90px 20px 90px;
.boxitem {
display: flex;
justify-content: center;
align-items: center;
padding: 10px 24px;
background: rgba(244, 249, 255, 0.5);
border-radius: 10px;
.boxitem_s {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.boxitem_ses {
margin-top: 10px;
display: flex;
justify-content: flex-start;
align-items: center;
.es {
border-left: 2px solid #DDDFE6;
padding: 0 10px;
display: flex;
justify-content: flex-start;
align-items: center;
.e {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 12px;
color: #666666;
}
.s {
margin-left: 10px;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 15px;
color: #3F9EFF;
}
}
.es:nth-child(1) {
margin-top: 0;
border-left: none;
}
}
.boxitem_ses:nth-child(1) {
margin-top: 0;
}
}
}
}
</style>

View File

@ -385,8 +385,25 @@ export default {
this.shopTypesActive = type == 'in' ? 0 : 1
this.inTabValue = value
this.resetHandle()
this.$refs.shopList.clearSelection()//
this.$refs.ConsumableList.clearSelection()//
this.$refs.shopList.reset()//
this.$refs.ConsumableList.reset()//
},
//
changeTypeEnum(index) {
this.inTabs.forEach((i) => {
if (i.value == this.inTabValue) {
this.queryForm.type = i.type
}
})
if (this.inTabValue == 'consumable') {
return false
}
//
if (this.queryForm.purveyorId) {
this.shopTypesActive = 0
} else {
this.shopTypesActive = 1
}
},
//
consCountTotal(cvalue, row, key1, key2 = undefined) {
@ -470,8 +487,8 @@ export default {
}
this.queryFormLoading = false
this.showResult = true
this.$refs.shopList.clearSelection()//
this.$refs.ConsumableList.clearSelection()//
this.$refs.shopList.reset()//
this.$refs.ConsumableList.reset()//
} catch (error) {
console.log(error)
this.queryFormLoading = false
@ -496,7 +513,7 @@ export default {
this.showResult = false
this.queryForm = { ...this.resetForm }
if (this.inTabValue == 'goods') {
this.queryForm.type = this.shopTypes[this.shopTypesActive].value
this.queryForm.type = 'purveyor'
} else {
this.queryForm.type = this.inTabs.find(item => item.value == this.inTabValue).type
}
@ -504,22 +521,7 @@ export default {
this.$refs.queryForm.resetFields()
this.$refs.queryForm.resetFields()
},
//
changeTypeEnum(index) {
console.log(this.inTabValue)
if (this.inTabValue == 'consumable') {
return false
}
if (this.queryForm.purveyorId) {
this.shopTypesActive = 0
} else {
this.shopTypesActive = 1
}
this.queryForm.type = this.shopTypes[this.shopTypesActive].value
// console.log(index)
// this.shopTypesActive = index
// this.queryForm.type = this.shopTypes[index].value
},
//
async tbShopPurveyorGet() {
try {