耗材列表
This commit is contained in:
@@ -1,24 +1,35 @@
|
||||
<template>
|
||||
<view class="ConsumablesTop">
|
||||
<view>
|
||||
货品类别
|
||||
<view @tap="showStatus = !showStatus">
|
||||
{{datas.title}}
|
||||
</view>
|
||||
<view>
|
||||
搜索货品ID/货品编码
|
||||
<input v-model="datas.conName" @input="inputEvent" type="text" placeholder="搜索货品ID/货品编码" />
|
||||
</view>
|
||||
<view>
|
||||
<view @tap="toUrl('PAGES_ADD_TYPE') ">
|
||||
新增类别
|
||||
</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.typeLists" :key="index">
|
||||
<view :class="{'color-main':nowStatusIndex===index}">{{item}}</view>
|
||||
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||
</view>
|
||||
<view :style="{height: '14px'}"></view>
|
||||
</view>
|
||||
|
||||
<ul class="ConsumablesConent">
|
||||
<li>
|
||||
<li v-for="(item,index) in datas.list" :key="index">
|
||||
<view>
|
||||
吸管 <view> 分类 </view>
|
||||
{{item.conName}}
|
||||
<view> {{item.conTypeName}} </view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
<view style="color: #333333;">
|
||||
根
|
||||
{{item.conUnit}}
|
||||
</view>
|
||||
<view>
|
||||
耗材单位
|
||||
@@ -26,71 +37,193 @@
|
||||
</view>
|
||||
<view>
|
||||
<view style="color: #318AFE;">
|
||||
根
|
||||
{{item.balance}}
|
||||
</view>
|
||||
<view>
|
||||
耗材单位
|
||||
剩余库存
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="">
|
||||
已绑定商品(10)
|
||||
所属商品: {{ filtersSproductId(item.productId)}}
|
||||
</view>
|
||||
<view class="">
|
||||
<up-button type="primary" color="#999" :plain="true" text="查看记录"></up-button>
|
||||
<up-button type="primary" @click="toggle" :plain="true" text="更多操作"></up-button>
|
||||
<up-button type="primary" color="#999" @tap="toUrl('PAGES_VIEWRECORDS',{item:JSON.stringify(item)})" :plain="true" text="查看记录"></up-button>
|
||||
<up-button type="primary" @click="toggle(item)" :plain="true" text="更多操作"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
</li>
|
||||
</ul>
|
||||
<view class="ConsumablesBottom">
|
||||
<view class="">
|
||||
<view @tap="toUrl('PAGES_ADD_CONSUMABLES')">
|
||||
新增耗材
|
||||
</view>
|
||||
<view class="">
|
||||
<view @tap="toUrl">
|
||||
供应商管理
|
||||
</view>
|
||||
</view>
|
||||
<my-action-sheet @itemClick="sheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||
<my-reportDamage ref="reportDamage" title="耗材报损" :item="report.data" @affirm="affirm"></my-reportDamage>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import myActionSheet from '@/components/my-components/my-action-sheet';
|
||||
import myActionSheet from './components/my-action-sheet';
|
||||
import myReportDamage from './components/my-reportDamage';
|
||||
import color from '@/commons/color.js';
|
||||
import {
|
||||
ref,
|
||||
reactive
|
||||
reactive,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
viewConInfoFlowget,
|
||||
tbConsType,
|
||||
tbConsTypeList
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
let reportDamage = ref(null)
|
||||
let refMoreSheet = ref(null)
|
||||
const actionSheet = reactive({
|
||||
list: ['报损', '编辑', '清点', '入库', '出库']
|
||||
const report = reactive({
|
||||
data: {
|
||||
// thumbnail: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240918/a17a62b7b55a4b65a2a2542050672b34.png',
|
||||
name: "美式咖啡",
|
||||
// title: "商品报损",
|
||||
unit: "杯",
|
||||
},
|
||||
})
|
||||
let datas = reactive({
|
||||
list: [],
|
||||
conName: "",
|
||||
showtwo: false,
|
||||
status: '0',
|
||||
// 类型列表
|
||||
typeList: [],
|
||||
// 类型列表渲染数组
|
||||
typeLists: ['全部'],
|
||||
title: '耗材类型'
|
||||
})
|
||||
const statusHeight = computed(() => {
|
||||
return 30 * datas.typeLists.length + 14 + 'px'
|
||||
})
|
||||
let toggle = () => {
|
||||
refMoreSheet.value.open()
|
||||
}
|
||||
let sheetClick = (index) => {
|
||||
console.log(index)
|
||||
if (index == 0) {} else if (index == 1) {
|
||||
|
||||
const actionSheet = reactive({
|
||||
list: ['报损', '编辑', '清点', '入库', '出库', ],
|
||||
activeId: null,
|
||||
active: ""
|
||||
})
|
||||
let showStatus = ref(false)
|
||||
let nowStatusIndex = ref(0)
|
||||
onMounted(() => {
|
||||
getList()
|
||||
// 获取分类列表
|
||||
gettbConsTypeList()
|
||||
})
|
||||
|
||||
function changeNowStatusIndex(i) {
|
||||
nowStatusIndex.value = i
|
||||
showStatus.value = false
|
||||
if (i == 0) {
|
||||
datas.title = '全部'
|
||||
getList()
|
||||
} else {
|
||||
datas.title = datas.typeList[i - 1].conTypeName
|
||||
getList(datas.typeList[i - 1].id)
|
||||
}
|
||||
}
|
||||
let gettbConsTypeList = () => {
|
||||
datas.typeLists = ['全部']
|
||||
tbConsTypeList({
|
||||
page: 0,
|
||||
size: 30,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
}).then(res => {
|
||||
datas.typeList = res.content
|
||||
res.content.forEach(ele => {
|
||||
datas.typeLists.push(ele.conTypeName)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 报损确认
|
||||
*/
|
||||
function affirm() {
|
||||
console.log(2)
|
||||
}
|
||||
|
||||
let toggle = (d) => {
|
||||
refMoreSheet.value.open()
|
||||
actionSheet.activeId = d.consId
|
||||
report.data.consId = d.consId
|
||||
actionSheet.active = d
|
||||
}
|
||||
|
||||
let sheetClick = (index) => {
|
||||
if (index == 0) {
|
||||
//打开报损弹窗
|
||||
reportDamage.value.open();
|
||||
report.data.name = actionSheet.active.conName
|
||||
report.data.unit = actionSheet.active.conUnit
|
||||
} else if (index == 1) {
|
||||
toUrl('PAGES_EDIT_CONSUMABLES', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
} else if (index == 2) {
|
||||
toUrl('PAGES_SALES_INVENTORYCHECK')
|
||||
toUrl('PAGES_SALES_INVENTORYCHECK', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
} else if (index == 3) {
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY')
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId
|
||||
})
|
||||
} else if (index == 4) {
|
||||
toUrl('PAGES_SALES_OUTBOUND')
|
||||
toUrl('PAGES_SALES_OUTBOUND', {
|
||||
consId: actionSheet.activeId
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
let toUrl = (url) => {
|
||||
go.to(url)
|
||||
async function getList(d = "") {
|
||||
viewConInfoFlowget({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
conName: datas.conName,
|
||||
conTypeId: d
|
||||
}).then(res => {
|
||||
datas.list = res.content
|
||||
})
|
||||
}
|
||||
|
||||
function inputEvent(d) {
|
||||
datas.conName = d.detail.value
|
||||
getList()
|
||||
}
|
||||
|
||||
function filtersSproductId(d) {
|
||||
if (!d) return ''
|
||||
const dataArr = d.split(',')
|
||||
let str = ''
|
||||
dataArr.forEach(ele => {
|
||||
const startIndex = ele.indexOf('_')
|
||||
// const productId = ele.slice(0, startIndex)
|
||||
const productName = ele.slice(startIndex + 1, ele.length)
|
||||
str = productName + ',' + str
|
||||
})
|
||||
|
||||
return str
|
||||
}
|
||||
let toUrl = (url, d) => {
|
||||
go.to(url, d)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
page{
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
@@ -102,6 +235,7 @@
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
padding-bottom: 22rpx;
|
||||
background-color: #fff;
|
||||
|
||||
>view:first-child,
|
||||
>view:last-child {
|
||||
@@ -119,6 +253,9 @@
|
||||
width: 414rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
background: #F9F9F9;
|
||||
border-radius: 32rpx 32rpx 32rpx 32rpx;
|
||||
|
||||
@@ -262,6 +399,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
position: absolute;
|
||||
// top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user