Mon May 22 12:28:00 UTC 2023 inscode

上级 d637c110
<script setup>
import {ref} from 'vue';
const getVal = [
{
drugname: "精氨酸注射液", //药品名称
remaining_quantity: 8, //药品数量
stationNo: 2, //药匣站号
low_alarm: true, //存量低报警
},
{
drugname: "头孢唑林钠(国家集采)", //药品名称
remaining_quantity: 28, //药品数量
stationNo: 8, //药匣站号
low_alarm: false, //存量低报警
},
{
drugname: "帕洛诺司琼注射液(国家集采)", //药品名称
remaining_quantity: 30, //药品数量
stationNo: 11, //药匣站号
low_alarm: false, //存量低报警
},
{
drugname: "亚砷酸", //药品名称
remaining_quantity: 33, //药品数量
stationNo: 43, //药匣站号
low_alarm: false, //存量低报警
},
{
drugname: "二羟丙茶碱注射液", //药品名称
remaining_quantity: 118, //药品数量
stationNo: 51, //药匣站号
low_alarm: false, //存量低报警
},
];
const sortResult = ref();
sortResult.value=getVal
console.log(sortResult.value[0].stationNo);
for (let index = 1; index <= 40; index++) {
if(sortResult.value.filter(item=>item.stationNo==index).length==0){
//如果没有这个id编号的值,就增加一个对象
sortResult.value.push({drugname:'',remaining_quantity:0,stationNo:(index),low_alarm:true});
}
}
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册