Merge branch 'gyq' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into dwb
This commit is contained in:
commit
a9dd2d2374
|
|
@ -15,12 +15,13 @@ export default {
|
||||||
高宽分别对应横竖滚动条的尺寸*/
|
高宽分别对应横竖滚动条的尺寸*/
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 4px;
|
width: 4px;
|
||||||
|
height: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*定义滚动条轨道
|
/*定义滚动条轨道
|
||||||
内阴影+圆角*/
|
内阴影+圆角*/
|
||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
background-color: #F5F5F5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*定义滑块
|
/*定义滑块
|
||||||
|
|
|
||||||
|
|
@ -330,3 +330,33 @@ export function stockInOut(data) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增盘点耗材
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function tbConCheck(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/tbConCheck`,
|
||||||
|
method: "post",
|
||||||
|
data: {
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询盘点耗材
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function tbConCheckGet(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/tbConCheck`,
|
||||||
|
method: "get",
|
||||||
|
params: {
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,210 @@
|
||||||
|
<!-- 新增耗材盘点 -->
|
||||||
|
<template>
|
||||||
|
<el-dialog title="耗材盘点" :visible.sync="dialogVisible" width="80%" @open="form.note = ''">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-position="left" inline>
|
||||||
|
<el-form-item label="账存数量">
|
||||||
|
<el-input :value="detail.num" readonly style="width: 180px;"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="实际数量">
|
||||||
|
<el-input-number v-model="form.lpNum" :min="0" :step="1" step-strictly
|
||||||
|
style="width: 180px;"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="盈亏数量">
|
||||||
|
<el-input :value="profitNumber" readonly :class="{ lose: profitNumber < 0 }"
|
||||||
|
style="width: 180px;"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单价">
|
||||||
|
<el-input v-model="detail.price" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="盈亏金额">
|
||||||
|
<el-input :value="profitPrice" readonly :class="{ lose: profitNumber < 0 }"
|
||||||
|
style="width: 180px;"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="备注">
|
||||||
|
<el-input v-model="form.note" placeholder="请输入备注" style="width: 300px;"></el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" :loading="loading" @click="onSubmitHandle">确 定</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading" border stripe>
|
||||||
|
<!-- <el-table-column label="商品信息" width="150px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div class="shop_info">
|
||||||
|
<el-image :src="scope.row.coverImg" style="width: 30px;height: 30px;">
|
||||||
|
<div class="img_error" slot="error">
|
||||||
|
<i class="icon el-icon-document-delete"></i>
|
||||||
|
</div>
|
||||||
|
</el-image>
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="售价" prop="price">
|
||||||
|
<template v-slot="scope">
|
||||||
|
¥{{ formatDecimal(scope.row.price) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="帐存库存" prop="stockNumber"></el-table-column>
|
||||||
|
<el-table-column label="盈亏数量" prop="lpNum"></el-table-column>
|
||||||
|
<el-table-column label="盈亏金额" prop="lpAmount">
|
||||||
|
<template v-slot="scope">
|
||||||
|
¥{{ formatDecimal(scope.row.lpAmount) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="实际库存" prop="acStockNumber"></el-table-column>
|
||||||
|
<el-table-column label="盘点时间" prop="createTime"></el-table-column>
|
||||||
|
<!-- <el-table-column label="盘点备注" prop="note"></el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-sizes="[5, 10, 30, 50]"
|
||||||
|
:page-size="tableData.size" @current-change="paginationChange" @size-change="sizeChange"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { formatDecimal } from '@/utils'
|
||||||
|
import { tbConCheck, tbConCheckGet } from '@/api/invoicing'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formatDecimal,
|
||||||
|
dialogVisible: false,
|
||||||
|
loading: false,
|
||||||
|
detail: '',
|
||||||
|
form: {
|
||||||
|
conInfoId: '',
|
||||||
|
lpNum: 0
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
stocktakinNum: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入盘点数量',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
resetForm: '',
|
||||||
|
searhForm: {
|
||||||
|
name: '',
|
||||||
|
skuId: '',
|
||||||
|
productId: ''
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
page: 0,
|
||||||
|
size: 5,
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
list: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.resetForm = { ...this.form }
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
profitNumber() {
|
||||||
|
return this.form.lpNum - this.detail.num
|
||||||
|
},
|
||||||
|
profitPrice() {
|
||||||
|
return formatDecimal((this.form.lpNum - this.detail.num) * this.detail.price)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmitHandle() {
|
||||||
|
this.$refs.form.validate(async valid => {
|
||||||
|
if (valid) {
|
||||||
|
try {
|
||||||
|
this.loading = true
|
||||||
|
let res = await tbConCheck({
|
||||||
|
conInfoId: this.form.conInfoId,
|
||||||
|
lpNum: this.profitNumber
|
||||||
|
})
|
||||||
|
this.detail.num = this.form.lpNum
|
||||||
|
this.form.lpNum = 0
|
||||||
|
this.form.lpNum = this.detail.num
|
||||||
|
|
||||||
|
this.$emit('success', res)
|
||||||
|
this.loading = false
|
||||||
|
this.$message({
|
||||||
|
title: '注意',
|
||||||
|
message: `添加成功`,
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
this.getTableData()
|
||||||
|
} catch (error) {
|
||||||
|
this.loading = false
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
show(obj) {
|
||||||
|
// console.log(obj);
|
||||||
|
this.detail = { ...obj }
|
||||||
|
this.detail.num = formatDecimal(obj.stockNumber - obj.stockConsume, 2, false)
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.form.conInfoId = obj.id
|
||||||
|
this.form.lpNum = this.detail.num
|
||||||
|
|
||||||
|
this.searhForm.skuId = obj.productId
|
||||||
|
this.searhForm.productId = obj.proId
|
||||||
|
|
||||||
|
this.tableData.page = 0
|
||||||
|
this.tableData.total = 0
|
||||||
|
this.tableData.list = []
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
// 分页大小改变
|
||||||
|
sizeChange(e) {
|
||||||
|
this.tableData.size = e
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
// 分页回调
|
||||||
|
paginationChange(e) {
|
||||||
|
this.tableData.page = e - 1
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
|
// 商品列表
|
||||||
|
async getTableData() {
|
||||||
|
try {
|
||||||
|
this.tableData.loading = true
|
||||||
|
const res = await tbConCheckGet({
|
||||||
|
page: this.tableData.page,
|
||||||
|
size: this.tableData.size,
|
||||||
|
conInfoId: this.form.conInfoId,
|
||||||
|
sort: 'id,desc',
|
||||||
|
})
|
||||||
|
this.tableData.list = res.content
|
||||||
|
this.tableData.total = res.totalElements
|
||||||
|
setTimeout(() => {
|
||||||
|
this.tableData.loading = false
|
||||||
|
}, 500);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.lose {
|
||||||
|
&::v-deep .el-input__inner {
|
||||||
|
color: rgb(238, 29, 29);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop_info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
<!-- <el-table-column label="类型id" prop="conTypeId" /> -->
|
<!-- <el-table-column label="类型id" prop="conTypeId" /> -->
|
||||||
<el-table-column label="分类名称" prop="conTypeName" />
|
<el-table-column label="分类名称" prop="conTypeName" />
|
||||||
<el-table-column label="单位" prop="conUnit" />
|
<el-table-column label="单位" prop="conUnit" />
|
||||||
<el-table-column label="创建时间" prop="createTime">
|
<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>
|
||||||
|
|
@ -60,14 +60,16 @@
|
||||||
<el-table-column label="预警值" prop="conWarning" />
|
<el-table-column label="预警值" prop="conWarning" />
|
||||||
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
|
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
|
||||||
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
||||||
<el-table-column label="更新时间" prop="updateTime">
|
<el-table-column label="更新时间" prop="updateTime" width="200">
|
||||||
<!-- <template v-slot="scope">
|
<!-- <template v-slot="scope">
|
||||||
{{ 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="操作">
|
<el-table-column label="操作" width="160" 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="clicksee(scope.row)">耗材记录</el-button>
|
||||||
|
<el-button type="text" size="mini" style="margin-left: 10px !important;"
|
||||||
|
@click="$refs.AddConsTakin.show(scope.row)">耗材盘点</el-button>
|
||||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
<!-- <el-button type="text" 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> -->
|
||||||
|
|
@ -196,6 +198,8 @@
|
||||||
@current-change="paginationChangetype" />
|
@current-change="paginationChangetype" />
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 耗材盘点 -->
|
||||||
|
<AddConsTakin ref="AddConsTakin" @success="resetHandle" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -205,7 +209,9 @@ 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 { gettbConsType, gettbConsInfo, posttbConsInfo, gettbConsInfoFlow, posttbConsInfostockIn, postapitbConsInfo } from '@/api/consumable'
|
||||||
|
import AddConsTakin from '../components/addConsTakin'
|
||||||
export default {
|
export default {
|
||||||
|
components: { AddConsTakin },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dayjs,
|
dayjs,
|
||||||
|
|
@ -305,34 +311,8 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
this.getTableDatatype()
|
this.getTableDatatype()
|
||||||
this.$nextTick(() => {
|
|
||||||
// this.tableDrag()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//表格拖拽
|
|
||||||
tableDrag() {
|
|
||||||
const el = document.querySelector('#table_drag .el-table__body-wrapper tbody')
|
|
||||||
new Sortable(el, {
|
|
||||||
animation: 150,
|
|
||||||
onEnd: async 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() {
|
resetHandle() {
|
||||||
this.query.conTypeId = ''
|
this.query.conTypeId = ''
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
<el-table-column label="用户" prop="headImg" width="200px">
|
<el-table-column label="用户" prop="headImg" width="200px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="user_info">
|
<div class="user_info">
|
||||||
<el-image :src="scope.row.headImg" style="width: 40px;height: 40px;">
|
<el-image :src="scope.row.headImg" style="width: 40px;height: 40px;flex-shrink: 0;">
|
||||||
<div slot="error" class="image-slot">
|
<div slot="error" class="image-slot">
|
||||||
<i class="el-icon-user"></i>
|
<i class="el-icon-user"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -68,34 +68,33 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="会员" prop="isVip">
|
<el-table-column label="会员" prop="isVip">
|
||||||
<template v-slot="scope">
|
<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>
|
<span v-else>否</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="余额" prop="amount"></el-table-column>
|
<el-table-column label="余额" prop="amount"></el-table-column>
|
||||||
<el-table-column label="积分" prop="totalScore"></el-table-column>
|
<el-table-column label="积分" prop="totalScore"></el-table-column>
|
||||||
<el-table-column label="手机号" prop="telephone"></el-table-column>
|
<el-table-column label="手机号" prop="telephone" width="160"></el-table-column>
|
||||||
<el-table-column label="生日" prop="birthDay"></el-table-column>
|
<el-table-column label="生日" prop="birthDay" width="200"></el-table-column>
|
||||||
<el-table-column label="注册时间" prop="createAt">
|
<el-table-column label="注册时间" prop="createAt" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.createAt | timeFilter }}
|
{{ scope.row.createAt | timeFilter }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="最近登录时间" prop="lastLoginAt">
|
<el-table-column label="最近登录时间" prop="lastLoginAt" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.lastLoginAt | timeFilter }}
|
{{ scope.row.lastLoginAt | timeFilter }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="120">
|
<!-- <el-table-column label="操作" width="90" fixed="right">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="text" icon="el-icon-edit"
|
<el-button type="text" @click="$refs.addActive.show(scope.row)">编辑</el-button>
|
||||||
@click="$refs.addActive.show(scope.row)">编辑</el-button>
|
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
|
||||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||||
slot="reference">删除</el-button>
|
slot="reference">删除</el-button>
|
||||||
</el-popconfirm> -->
|
</el-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
|
|
@ -113,7 +112,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
query: {
|
query: {
|
||||||
name: '',
|
name: '',
|
||||||
isVip: ''
|
isVip: 1
|
||||||
},
|
},
|
||||||
tableData: {
|
tableData: {
|
||||||
data: [],
|
data: [],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue