hldy_app_mini/pages/NursingNew/component/pleasetake/component/takehomep.vue

169 lines
4.2 KiB
Vue

<template>
<view>
<view class="buttons-father">
<view class="boxtwo">
<view class="ipt">
<input type="text" placeholder="物料名称/物料简拼" />
</view>
<view class="scr">
检索
</view>
<view class="shx" @click="ification = true">
<image src="/static/index/requestform/shaixuan.png" mode="aspectFill"></image>
<view class="shx-font">
筛选
</view>
</view>
<view class="shx" @click="chongzhi"
v-if="form.categoryId!=''||form.wlParamInfo!='' " >
<image src="/static/index/requestform/chongzhi.png" mode="aspectFill"></image>
<view class="shx-font">
重置
</view>
</view>
</view>
<view class="boxtwo flexend">
<view class="qlthbtn">
<image src="/static/index/requestform/ql0.png" mode="aspectFill"></image>
<view class="shx-font">
请领单
</view>
</view>
<view class="qlthbtn">
<image src="/static/index/requestform/ql1.png" mode="aspectFill"></image>
<view class="shx-font">
回退单
</view>
</view>
<view class="qlthbtn">
<image src="/static/index/requestform/ql2.png" mode="aspectFill"></image>
<view class="shx-font">
退货
</view>
</view>
</view>
</view>
<addwl></addwl>
<carditem :InvoicingList="listarr" @scrolltolower="scrolltolower" :status="status" @comfig="comfig"></carditem>
<takeing :show="takeshow" :objtake="objtake" @fill="takeshow = false"></takeing>
<cgdclass @confirm="confirm" :show="ification" :typenum="0" ref="classication" @fill="ification = false"></cgdclass>
<medetails :show="detaishow" @fill="detaishow = false" @confirm="confirm" :objtake="objtake"></medetails>
</view>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed, nextTick, defineProps, watch, reactive } from 'vue';
import { queryInvoicingList,wlzd } from '../api/api.js'
import addwl from '../common/addwl.vue';
import carditem from '../common/carditem.vue';
import takeing from '../common/takeing.vue';
import cgdclass from '../common/cgdclass.vue';
import medetails from '../common/medetails.vue';
const form = reactive({
pageNo:1,
pageSize:10,
nuId:uni.getStorageSync('nuId'),
elderId:uni.getStorageSync('NUall').id,
wlParamInfo:'',
categoryId:'',
typeId:'',
medicationId:''
})
const takeshow = ref(false)
const ification = ref(false)
const detaishow = ref(false)
const classication = ref<InstanceType<typeof ChildComponent>>()
onMounted(()=>{
config()
})
const listarr = ref([])
const status = ref('loadmore')
const config = ()=>{
console.log(form)
queryInvoicingList(form).then(res=>{
res.result.records.forEach(item=>{
item.zk = false;
item.scrollleft = 0;
})
listarr.value.push(...res.result.records)
status.value = (res.result.total == listarr.value.length ? 'nomore' : 'loadmore')
console.log(res,status.value,listarr.value.length)
})
}
const scrolltolower = ( ) => {
if (status.value=='loading') { return }
status.value = 'loading';
form.pageNo++;
config()
}
const objtake = ref({})
const comfig=(v,i,t)=>{
console.log(v,i,t)
switch (t){
case 0:
objtake.value = v;
takeshow.value = true;
break;
case 1:
break;
case 2:
objtake.value = v;
detaishow.value = true;
break;
case 3:
let obj = {
nuId:form.nuId,
elderId:form.elderId,
wlId:v.wlId,
izZd:v.zhiDingId?false:true
}
wlzd(obj).then(res=>{
console.log(obj,res)
if(res.success){
listarr.value = [];
form.pageNo = 1;
config()
}else{
uni.showToast({
icon:'none',
title:res.message
})
}
})
break;
default:
break;
}
}
const confirm = (e)=>{
form.categoryId = e.categoryId;
form.typeId = e.typeId;
form.medicationId = e.medicationId;
form.pageNo=1;
listarr.value = [];
config();
ification.value = false;
console.log(e)
}
const chongzhi=()=>{
form.categoryId = '';
form.typeId = '';
form.medicationId = '';
form.pageNo=1;
form.wlParamInfo= '',
listarr.value = [];
classication.value.typescroll(1,-1,{});
classication.value.qingkong();
classication.value.config();
}
</script>
<style lang="less" scoped>
@import "../css/take.less";
</style>