1
This commit is contained in:
102
pages/lims/borrow/detail.vue
Normal file
102
pages/lims/borrow/detail.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<up-popup :show="visible" mode="right" closeable @close="handleClose" @open="handleOpen">
|
||||
<uni-section titleFontSize="20px" type="line" title="设备借用单"> </uni-section>
|
||||
<scroll-view scroll-y="true" class="content">
|
||||
<up-row class="flex-wrap">
|
||||
<up-col :span="gridCol"
|
||||
>借用人:
|
||||
<text class="value">{{ detailInfo.borrowOper }}</text>
|
||||
</up-col>
|
||||
<up-col :span="gridCol"
|
||||
>借用部门:
|
||||
<text class="value">{{ detailInfo.borrowDept }}</text>
|
||||
</up-col>
|
||||
<up-col :span="gridCol"
|
||||
>借用日期:
|
||||
<text class="value">{{ detailInfo.borrowDate }}</text>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<up-row>
|
||||
<up-col span="6"
|
||||
>计划归还日期:
|
||||
<text class="value">{{ detailInfo.planGivebackDate }}</text>
|
||||
</up-col>
|
||||
<up-col span="6"
|
||||
>借用原因:
|
||||
<text class="value">{{ detailInfo.borrowReason }}</text>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<up-row>
|
||||
<up-col span="12"
|
||||
>备注:
|
||||
<text class="value">{{ detailInfo.remark }}</text>
|
||||
</up-col>
|
||||
</up-row>
|
||||
<wf-comment :commentWf="commentWf" />
|
||||
</scroll-view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch, computed } from 'vue'
|
||||
import { useGridCol } from '@/nx/hooks/useGridCol'
|
||||
const { gridCol } = useGridCol([700], [6, 4])
|
||||
const props = defineProps({
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
checkInfo: {
|
||||
type: Object
|
||||
}
|
||||
})
|
||||
const visible = ref(props.show)
|
||||
// 监听外部传入的show属性变化
|
||||
watch(
|
||||
() => props.show,
|
||||
newVal => {
|
||||
visible.value = newVal
|
||||
}
|
||||
)
|
||||
let detailInfo = ref({})
|
||||
|
||||
const emit = defineEmits(['close', 'open'])
|
||||
function handleClose() {
|
||||
emit('close')
|
||||
}
|
||||
let commentWf = ref([])
|
||||
function handleOpen() {
|
||||
detailInfo.value = props.checkInfo
|
||||
if (props.checkInfo.commentJson) {
|
||||
try {
|
||||
commentWf.value = JSON.parse(props.checkInfo.commentJson)
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '解析数据错误',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
font-size: 18px;
|
||||
height: 80vh;
|
||||
width: 80vw;
|
||||
padding: 20px;
|
||||
.u-row {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #666;
|
||||
font-size: 16;
|
||||
}
|
||||
}
|
||||
:deep(.uicon-close) {
|
||||
font-size: 22px !important;
|
||||
}
|
||||
</style>
|
||||
109
pages/lims/borrow/list.vue
Normal file
109
pages/lims/borrow/list.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-card spacing="0">
|
||||
<view style="height: 72vh">
|
||||
<zb-table
|
||||
ref="zbTableRef"
|
||||
isShowLoadMore
|
||||
stripe
|
||||
:fit="false"
|
||||
:columns="column"
|
||||
:cellStyle="setCellStyle"
|
||||
:cellHeaderStyle="setCellHeaderStyle"
|
||||
:data="listData"
|
||||
@detail="handleDetail"
|
||||
@pullUpLoading="pullUpLoadingAction"
|
||||
></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
<borrow-detail-popup :show="detailShow" :checkInfo="checkInfo" @close="detailShow = false" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch, computed } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { setCellHeaderStyle, setCellStyle } from '@/nx/config/zbTable'
|
||||
import BorrowDetailPopup from './detail.vue'
|
||||
import { borrowList } from '@/nx/api/deviceInfo'
|
||||
import { useListData } from '@/nx/hooks/usePageListData'
|
||||
import nx from '@/nx'
|
||||
|
||||
const column = reactive([
|
||||
{
|
||||
label: '借用人',
|
||||
name: 'borrowOper',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
label: '借用部门',
|
||||
name: 'borrowDept',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
label: '借用日期',
|
||||
name: 'borrowDate',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
label: '借用原因',
|
||||
name: 'borrowReason',
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
label: '计划归还日期',
|
||||
name: 'planGivebackDate',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
name: 'remark',
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
name: 'operation',
|
||||
type: 'operation',
|
||||
label: '操作',
|
||||
renders: [{ name: '详情', func: 'detail' }]
|
||||
}
|
||||
])
|
||||
const deviceId = ref('')
|
||||
const deviceText = ref('')
|
||||
|
||||
onMounted(() => {
|
||||
const { id, deviceName } = nx.$store('biz').deviceInfo
|
||||
deviceId.value = id
|
||||
deviceText.value = deviceName
|
||||
getInitData()
|
||||
})
|
||||
const searchParams = computed(() => ({
|
||||
deviceBusInfoId: deviceId.value,
|
||||
borrowStatus: '已借出'
|
||||
}))
|
||||
const { listData, loadingData, scrollToLower, loadStatus, getInitData } = useListData({
|
||||
searchParams,
|
||||
api: borrowList
|
||||
})
|
||||
const zbTableRef = ref()
|
||||
function pullUpLoadingAction() {
|
||||
if (loadingData.value) return
|
||||
if (loadStatus.value === 'nomore') {
|
||||
zbTableRef.value.pullUpCompleteLoading('ok')
|
||||
} else {
|
||||
scrollToLower()
|
||||
}
|
||||
}
|
||||
|
||||
const detailShow = ref(false)
|
||||
const checkInfo = ref({})
|
||||
function handleDetail(row) {
|
||||
checkInfo.value = row
|
||||
detailShow.value = true
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.zb-table uni-button[type='primary']) {
|
||||
background-color: $uni-color-primary !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user