212 lines
4.4 KiB
Vue
212 lines
4.4 KiB
Vue
<template>
|
|
<view class="topTitle">
|
|
耗材信息
|
|
</view>
|
|
<view class="addConsumables">
|
|
<view>
|
|
<view>
|
|
<view>
|
|
单位
|
|
</view>
|
|
<view>
|
|
<input type="text" placeholder="请输入单位" v-model="datas.form.conUnit" name="" id="">
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
耗材名称
|
|
</view>
|
|
<view>
|
|
<input type="text" placeholder="请输入耗材名称" v-model="datas.form.conName" name="" id="">
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
耗材价格
|
|
</view>
|
|
<view>
|
|
<input class="uni-input" placeholder="请输入耗材价格" type="number" v-model="datas.form.price">
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
预警值
|
|
</view>
|
|
<view>
|
|
<input type="number" placeholder="请输入预警值" v-model="datas.form.conWarning" name="" id="">
|
|
</view>
|
|
</view>
|
|
<!-- <li style="justify-content: space-between;">
|
|
<view>
|
|
耗材类型
|
|
</view>
|
|
<view style="width: 54%;" @tap="datas.showStatus = !datas.showStatus">
|
|
{{datas.typelist[datas.nowStatusIndex]}}
|
|
</view>
|
|
<uni-icons type="bottom" size="16"></uni-icons>
|
|
</li> -->
|
|
</view>
|
|
</view>
|
|
<!-- <view :style="{height:datas.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.typelist" :key="index">
|
|
<view :class="{'color-main':datas.nowStatusIndex===index}">{{item}}</view>
|
|
<uni-icons v-if="datas.nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
|
</view>
|
|
<view :style="{height: '14px'}"></view>
|
|
</view> -->
|
|
<view class="bottombutton">
|
|
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
|
|
text="保存"></up-button>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {
|
|
reactive,
|
|
computed,
|
|
onMounted
|
|
} from 'vue';
|
|
import {
|
|
tbConsTypeList,
|
|
tbConsTypeput
|
|
} from '@/http/yskApi/requestAll.js';
|
|
import color from '@/commons/color.js';
|
|
import go from '@/commons/utils/go.js';
|
|
let datas = reactive({
|
|
form: {
|
|
conWarning: 999
|
|
},
|
|
showStatus: false,
|
|
list: [],
|
|
typelist: [],
|
|
nowStatusIndex: 0
|
|
})
|
|
const props = defineProps({
|
|
item: {
|
|
type: String
|
|
}
|
|
})
|
|
onMounted(() => {
|
|
let obj = JSON.parse(props.item)
|
|
datas.form = obj
|
|
|
|
gettbConsTypeList()
|
|
})
|
|
|
|
let gettbConsTypeList = () => {
|
|
datas.typelist = []
|
|
tbConsTypeList({
|
|
page: 0,
|
|
size: 30,
|
|
shopId: uni.getStorageSync("shopId"),
|
|
}).then(res => {
|
|
datas.list = res.content
|
|
res.content.forEach(ele => {
|
|
datas.typelist.push(ele.conTypeName)
|
|
})
|
|
})
|
|
}
|
|
let sumbit = () => {
|
|
tbConsTypeput([{
|
|
...datas.form,
|
|
status: datas.form.status * 1,
|
|
isCheck: datas.form.isCheck * 1,
|
|
conWarning: datas.form.conWarning * 1,
|
|
shopId: uni.getStorageSync("shopId"),
|
|
conTypeId: datas.list[datas.nowStatusIndex].id,
|
|
id: datas.form.id
|
|
}]).then(res => {
|
|
go.back()
|
|
})
|
|
}
|
|
const statusHeight = computed(() => {
|
|
return 30 * datas.typelist.length + 14 + 'px'
|
|
})
|
|
|
|
function changeNowStatusIndex(i) {
|
|
datas.nowStatusIndex = i
|
|
datas.showStatus = false
|
|
}
|
|
</script>
|
|
<style>
|
|
page {
|
|
background-color: #f9f9f9;
|
|
}
|
|
</style>
|
|
<style scoped lang="less">
|
|
ul,
|
|
li {
|
|
list-style: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.topTitle {
|
|
font-weight: 400;
|
|
font-size: 32rpx;
|
|
color: #333333;
|
|
margin: 32rpx 28rpx;
|
|
}
|
|
|
|
.addConsumables {
|
|
width: 694rpx;
|
|
height: 540rpx;
|
|
background: #FFFFFF;
|
|
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
|
margin: 32rpx;
|
|
padding: 1rpx 24rpx;
|
|
box-sizing: border-box;
|
|
|
|
>view {
|
|
>view {
|
|
width: 646rpx;
|
|
height: 84rpx;
|
|
background: #fcfcfc;
|
|
border: 2rpx solid #F9F9F9;
|
|
margin-top: 32rpx;
|
|
.df;
|
|
|
|
>view:first-child {
|
|
width: 190rpx;
|
|
height: 84rpx;
|
|
line-height: 84rpx;
|
|
// text-align: left;
|
|
padding-left: 24rpx;
|
|
background: #F9F9F9;
|
|
border-radius: 8rpx 0rpx 0rpx 8rpx;
|
|
border: 2rpx solid #F9F9F9;
|
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
|
font-weight: 400;
|
|
font-size: 32rpx;
|
|
color: #333333;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.bottombutton {
|
|
margin-top: 84rpx;
|
|
padding: 0 24rpx;
|
|
|
|
>button {
|
|
width: 530rpx;
|
|
height: 80rpx;
|
|
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
|
}
|
|
}
|
|
|
|
.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> |