查看耗材记录

This commit is contained in:
duan 2024-10-23 17:26:33 +08:00
parent 51d273314e
commit 9f3ef067df
3 changed files with 227 additions and 16 deletions

View File

@ -10,6 +10,13 @@ export function summaryTrade(data) {
} }
}) })
} }
export function tbConsInfoFlowcount(data) {
return request({
url: '/api/tbConsInfoFlow/count',
method: 'post',
data
})
}
// 供应商列表 // 供应商列表
export function tbShopPurveyorTransact(params) { export function tbShopPurveyorTransact(params) {
return request({ return request({
@ -250,6 +257,12 @@ export function getroles() {
method: "get" method: "get"
}); });
} }
export function tbConsTypes() {
return request({
url: `/api/tbConsType`,
method: "get"
});
}
export function tbPlussShopStaff(data) { export function tbPlussShopStaff(data) {
return request({ return request({
url: `/api/tbPlussShopStaff`, url: `/api/tbPlussShopStaff`,
@ -264,4 +277,12 @@ export function viewConInfoFlowget(data) {
method: 'post', method: 'post',
data data
}); });
}
// 耗材记录
export function tbConsInfoFlowstock(data) {
return request({
url: `/api/tbConsInfoFlow/stock`,
method: 'post',
data
});
} }

View File

@ -328,7 +328,8 @@
.df; .df;
>view { >view {
width: 90rpx; // width: 90rpx;
padding: 2rpx 10rpx;
height: 36rpx; height: 36rpx;
line-height: 36rpx; line-height: 36rpx;
background: #EBF4FC; background: #EBF4FC;

View File

@ -1,21 +1,97 @@
<template> <template>
<view class="viewrecordsType">
<view style="display: flex;align-items: center;" @tap="popPu">
筛选时间<up-icon style="transform: rotate(90deg);" name="play-right-fill" size="12"></up-icon>
</view>
<view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
{{datas.statusTitle}} <up-icon style="transform: rotate(90deg);" name="play-right-fill" size="12"></up-icon>
</view>
</view>
<view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
v-for="(item,index) in datas.status" :key="index">
<view :class="{'color-main':nowStatusIndex===index}">{{item.conTypeName}}</view>
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
</view>
<view :style="{height: '14px'}"></view>
</view>
<view class="viewrecordsTop">
<view style="padding:32rpx 16rpx;">
<view class="">
增加数量 <text
style="color: #76ACF0;font-weight: bold;">{{datas.countList?datas.countList.addCountNumber:''}}</text>
</view>
<view class="df viewdf">
<view style="font-size: 24rpx;border-right: 1px solid #999; width: 142rpx;text-align: center;">
<view style="color: #999999;">
入库
</view>
<view class="">
{{datas.countList?datas.countList.stockInNumber:''}}
</view>
</view>
<view style="font-size: 24rpx;width: 178rpx;text-align: center;">
<view style="color: #999999;">
手动增加
</view>
<view class="">
{{datas.countList?datas.countList.addNumber:''}}
</view>
</view>
</view>
</view>
<view style="padding:32rpx 16rpx;">
<view class="">
减少数量 <text
style="color: #52BDA4;font-weight: bold;">{{datas.countList?datas.countList.subCountNumber:0}}</text>
</view>
<view class="df viewdf">
<view style="font-size: 24rpx;border-right: 1px solid #999; width: 112rpx;text-align: center;">
<view style="color: #999999;">
手动减少
</view>
<view class="">
{{datas.countList?datas.countList.subNumber:0}}
</view>
</view>
<view style="font-size: 24rpx;border-right: 1px solid #999; width: 82rpx;text-align: center;">
<view style="color: #999999;">
出库
</view>
<view class="">
{{datas.countList?datas.countList.stockOutNumber:0}}
</view>
</view>
<view style="font-size: 24rpx;width: 112rpx;text-align: center;">
<view style="color: #999999;">
商品消耗
</view>
<view class="">
{{datas.countList?datas.countList.saleNumber:0}}
</view>
</view>
</view>
</view>
</view>
<ul class="viewrecords"> <ul class="viewrecords">
<li v-for="item in datas.list" :key="item.id"> <li v-for="item in datas.list" :key="item.id">
<view class=""> <view class="">
<view class=""> <view class="">
{{item.conName}} {{item.createTime}}
</view> </view>
<view class=""> <view class="">
{{item.createTime}} {{item.operator}} {{item.bizName}}
</view> </view>
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<view class=""> <view style="font-size: 24rpx;color: #666666;">
{{item.balance}} 库存 {{ inventory(item.balance,item.bizType,item.amount)}} <text
:style="{color:item.bizType=='+'?'#1bca72':'red'}"> - {{ item.amount|0 }}</text>
</view> </view>
<view style="font-size: 24rpx;color: #666666;"> <view style="font-size: 24rpx;color: #666666;">
现有库存 剩余库存 {{item.balance}}
</view> </view>
</view> </view>
<view class=""> <view class="">
@ -29,55 +105,153 @@
</view> </view>
</li> </li>
</ul> </ul>
<datePickerview @confirm="datePickerConfirm" ref="datePicker"></datePickerview>
</template> </template>
<script setup> <script setup>
import { import {
onMounted, onMounted,
reactive reactive,
ref,
computed,
getCurrentInstance
} from 'vue'; } from 'vue';
import datePickerview from './components/my-date-pickerview.vue'
import color from '@/commons/color.js';
import { import {
viewConInfoFlowget tbConsInfoFlowstock,
tbConsInfoFlowcount,
tbConsTypes
} from '@/http/yskApi/requestAll.js'; } from '@/http/yskApi/requestAll.js';
let props = defineProps({ let props = defineProps({
item: { item: {
type: String type: String
} }
}) })
let datas = reactive({ let datas = reactive({
list: [] list: [],
countList: null,
//
status: [],
statusTitle: "类型"
}) })
let showStatus = ref(false)
onMounted(() => { onMounted(() => {
let items = JSON.parse(props.item) let items = JSON.parse(props.item)
console.log(items,'调试1') // console.log(items, '1')
getlist() getlist()
}) })
let getlist = () => { const refs = getCurrentInstance()
viewConInfoFlowget({ let popPu = () => {
refs.ctx.$refs.datePicker.toggle()
}
function datePickerConfirm(e) {
getlist("", e.start, e.end)
}
function inventory(a, b, c) {
let data = 0
if (b == '-') {
data = a + c
} else {
data = a - c
}
return data
}
let nowStatusIndex = ref(0)
function changeNowStatusIndex(i) {
nowStatusIndex.value = i
showStatus.value = false
datas.statusTitle = datas.status[i].conTypeName
getlist(datas.status[i].id)
}
const statusHeight = computed(() => {
return 30 * datas.status.length + 14 + 'px'
})
let getlist = (conTypeId = "", start, end) => {
//
tbConsInfoFlowstock({
page: 0,
shopId: uni.getStorageSync("shopId"),
size: 30,
consId: JSON.parse(props.item).conTypeId,
column: "addCountNumber",
conTypeId,
}).then(res => {
datas.list = res.content
})
//
tbConsInfoFlowcount({
page: 0, page: 0,
shopId: uni.getStorageSync("shopId"), shopId: uni.getStorageSync("shopId"),
size: 30, size: 30,
sort: "createTime,desc", sort: "createTime,desc",
conTypeId:JSON.parse(props.item).conTypeId conTypeId,
startTime: start,
endTime: end,
}).then(res => { }).then(res => {
datas.list = res.content datas.countList = res
}) })
// /
tbConsTypes({
page: 0,
shopId: uni.getStorageSync("shopId"),
size: 100,
}).then(res => {
datas.status = res.content
})
} }
</script> </script>
<style> <style>
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style> </style>
<style scoped lang="less"> <style scoped lang="less">
ul, ul,
li { li {
list-style: none; list-style: none;
padding: 0; padding: 0;
} }
.viewrecordsType {
height: 100rpx;
background-color: #fff;
display: flex;
align-items: center;
justify-content: space-around;
}
.viewrecordsTop {
display: flex;
align-items: center;
// justify-content: space-between;
margin-top: 32rpx;
margin-left: 32rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
.viewdf {
margin-top: 40rpx;
}
>view {
background-color: #fff;
width: 336rpx;
height: 220rpx;
}
>view:last-child {
margin-left: 26rpx;
}
}
.viewrecords { .viewrecords {
padding: 0 28rpx; padding: 0 28rpx;
@ -113,4 +287,19 @@
} }
} }
} }
.status {
margin: 0 32rpx;
position: absolute;
// top: 100%;
left: 0;
right: 0;
z-index: 10;
background-color: #fff;
}
.df {
display: flex;
align-items: center;
}
</style> </style>