style:样式调整

This commit is contained in:
houjunxiang
2025-10-11 16:25:24 +08:00
parent c8b2d8683e
commit b5aed8573a
15 changed files with 405 additions and 721 deletions

View File

@@ -31,5 +31,5 @@ export function getUpgradeBaseUrl() {
} }
export function getWebSocketUrl() { export function getWebSocketUrl() {
// return uni.getStorageSync('base_url').replace('/api', '') + '/ws' // return uni.getStorageSync('base_url').replace('/api', '') + '/ws'
return 'ws://localhost:8330' return 'ws://192.168.26.178:8330'
} }

View File

@@ -1,9 +1,9 @@
{ {
"name": "凉山矿业设备管理系统", "name": "凉山矿业设备管理系统",
"appid" : "__UNI__EF98982", "appid": "__UNI__460BC4C",
"description": "凉山矿业设备管理系统", "description": "凉山矿业设备管理系统",
"versionName" : "1.0.8", "versionName": "1.0.0",
"versionCode" : "108", "versionCode": "100",
"transformPx": false, "transformPx": false,
"app-plus": { "app-plus": {
"usingComponents": true, "usingComponents": true,

View File

@@ -165,7 +165,7 @@ export default {
}, },
//发送消息 //发送消息
send(data) { send(data) {
console.log('发送消息。。。') console.log('发送消息。。。', data)
if (!this.isOpen) { if (!this.isOpen) {
//关闭则打开 //关闭则打开
this.open() this.open()

View File

@@ -131,7 +131,6 @@ http.interceptors.response.use(
// } // }
const userStore = $store('user') const userStore = $store('user')
const isLogin = userStore.isLogin
response.config.custom.showLoading && closeLoading() response.config.custom.showLoading && closeLoading()
console.log('response', JSON.parse(JSON.stringify(response.data))) console.log('response', JSON.parse(JSON.stringify(response.data)))

View File

@@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<navbar-back title="天平状态"></navbar-back> <navbar-back title="天平状态"></navbar-back>
<up-grid border :col="3"> <up-grid border :col="4">
<up-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index"> <up-grid-item v-for="(auncel, index) in auncelList" :index="index" :key="index">
<view class="auncel-item" :style="{ backgroundImage: `url(${balanceBackground})` }"> <view class="auncel-item" :style="{ backgroundImage: `url(${balanceBackground})` }">
<view class="auncel-header"> <view class="auncel-header">
@@ -25,7 +25,7 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
import { onUnload, onHide } from '@dcloudio/uni-app' import { onUnload, onHide } from '@dcloudio/uni-app'
import { getTenantId } from '@/defaultBaseUrl' import { getTenantId } from '@/defaultBaseUrl'
import nx from '@/nx' import nx from '@/nx'
const balanceBackground = new URL('/static/images/auncel.png', import.meta.url).href const balanceBackground = '/static/images/auncel.png'
// refs // refs
const auncelList = ref([]) const auncelList = ref([])
@@ -36,7 +36,7 @@ const userInfo = computed(() => nx.$store('user').userInfo)
// 页面加载 // 页面加载
onMounted(() => { onMounted(() => {
getPageData() getPageData()
// #ifdef H5
const regData = { const regData = {
msgId: nx.$helper.uuid(), msgId: nx.$helper.uuid(),
cmd: 'register', cmd: 'register',
@@ -48,8 +48,7 @@ onMounted(() => {
} }
} }
nx.$measure.setRegData(JSON.stringify(regData)) nx.$measure.setRegData(JSON.stringify(regData))
nx.$measure.reOpen() nx.$measure.open()
// #endif
// 监听 WebSocket 数据 // 监听 WebSocket 数据
uni.$on('deviceData', handleDeviceData) uni.$on('deviceData', handleDeviceData)

View File

@@ -0,0 +1,5 @@
export const getDataSourceTypeShow = val => {
if (val === 2) return '【筛上】'
if (val === 3) return '【筛下】'
return ''
}

View File

@@ -0,0 +1,79 @@
<!-- components/TaskItem.vue -->
<template>
<view class="u-tab-item" :class="{ 'u-tab-item-active': active }" @tap.stop="handleClick">
<u-row class="full-width">
<u-col span="2" class="text-center" style="position: relative">
<u-icon :color="taskStyle(task)" name="tags-fill" size="34"></u-icon>
<text class="seq">{{ seq }}</text>
</u-col>
<u-col span="10">
<view class="fs18">{{ task.taskNo }}</view>
<view class="mt3 mb3">{{ task.taskName }}{{ task.assayOper }}</view>
<view class="x-f">
<u-icon name="clock"></u-icon>
<text class="ml5">{{ task.taskOperTime }}</text>
</view>
</u-col>
</u-row>
</view>
</template>
<script setup>
import { computed } from 'vue'
const props = defineProps({
task: {
type: Object,
required: true
},
active: {
type: Boolean,
default: false
},
seq: {
type: Number,
required: true
}
})
const emit = defineEmits(['click'])
const handleClick = () => {
emit('click')
}
// 与原逻辑一致的 taskStyle 方法
const taskStyle = task => {
if ((task.weightTaskStatus === 0 || task.weightTaskStatus === 1) && task.reviewCount > 0) return 'red'
if (task.weightTaskStatus === 2 && task.reviewCount > 0) return 'green'
return ''
}
</script>
<style lang="scss" scoped>
.u-tab-item {
padding: 3px;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #444;
border-bottom: 2px dotted;
}
.u-tab-item-active {
position: relative;
color: #0055a2;
font-weight: 600;
background: #fff;
}
.seq {
position: absolute;
top: 9px;
left: 12px;
color: #fff;
font-size: 11px;
}
</style>

View File

@@ -2,28 +2,17 @@
<view> <view>
<navbar-back :autoBack="false" title="单据补打" @leftClick="customBack"></navbar-back> <navbar-back :autoBack="false" title="单据补打" @leftClick="customBack"></navbar-back>
<u-row class="content-title" gutter="16"> <u-row gutter="16">
<u-col span="4"> <u-col span="4">
<view class="content-title-name"> <view class="content-title-name">
<text>任务列表</text> <text>任务列表</text>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
</u-col>
<u-col span="8">
<view class="content-title-name">
<text>样品列表</text>
</view>
<u-gap height="5" bg-color="#0055A2"></u-gap>
</u-col>
</u-row>
<u-row class="content-main-height" gutter="16" align="top">
<!-- 左侧任务列表 -->
<u-col span="4">
<scroll-view <scroll-view
style="height: 75vh"
scroll-y scroll-y
scroll-with-animation scroll-with-animation
class="content-main-height content-main-left" class="content-main-left"
:scroll-top="scrollTop" :scroll-top="scrollTop"
ref="menuScrollView" ref="menuScrollView"
> >
@@ -54,29 +43,31 @@
</view> </view>
</scroll-view> </scroll-view>
</u-col> </u-col>
<!-- 右侧样品列表 -->
<u-col span="8"> <u-col span="8">
<view class="content-main-height"> <view class="content-title-name">
<scroll-view scroll-y scroll-with-animation class="content-main-right"> <text>样品列表</text>
</view>
<u-gap height="5" bg-color="#0055A2"></u-gap>
<view>
<scroll-view scroll-y scroll-with-animation style="height: calc(75vh - 60px)">
<block v-for="(sample, index) in sampleList" :key="index"> <block v-for="(sample, index) in sampleList" :key="index">
<view style="padding: 5px; font-size: 16px"> <view class="p5 fs16">
<u-row> <u-row>
<u-col span="2" style="text-align: center"> <u-col span="2" class="text-center">
<view> <view>
<text>{{ sample.sort }}</text> <text>{{ sample.sort }}</text>
</view> </view>
</u-col> </u-col>
<u-col span="5"> <u-col span="5">
<view> <view>
<text style="padding-left: 10px">{{ sample.sampleCode }}</text> <text class="pl10">{{ sample.sampleCode }}</text>
</view> </view>
<view> <view>
<text style="padding-left: 10px">{{ sample.sampleName }}</text> <text class="pl10">{{ sample.sampleName }}</text>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-line style="padding: 10rpx" color="#bbb" /> <u-line class="p5" color="#bbb" />
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
@@ -100,6 +91,14 @@
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-row class="content-main-height" gutter="16" align="top">
<!-- 左侧任务列表 -->
<u-col span="4"> </u-col>
<!-- 右侧样品列表 -->
<u-col span="8"> </u-col>
</u-row>
</view> </view>
</template> </template>
@@ -252,22 +251,15 @@ function checkPrintConfig() {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content-title { .content-title-name {
height: 50px; height: 50px;
width: 100%; box-sizing: border-box;
font-size: 20px; font-size: 20px;
font-weight: 300; font-weight: 300;
}
.content-title-name {
padding: 10px; padding: 10px;
text-align: center; text-align: center;
} }
.content-main-height {
height: calc(100vh - 125px);
}
.content-main-left { .content-main-left {
background-color: #f6f6f6; background-color: #f6f6f6;
} }
@@ -302,17 +294,14 @@ function checkPrintConfig() {
top: 20px; top: 20px;
} }
.content-main-right {
height: calc(100vh - 205px);
}
.content-main-right-operation { .content-main-right-operation {
height: 80px; height: 50px;
padding-top: 15px; padding-top: 10px;
padding-right: 15px; padding-right: 10px;
} }
.btn-operation { .btn-operation {
font-size: 18px;
width: 95%; width: 95%;
} }
</style> </style>

View File

@@ -2,62 +2,41 @@
<view> <view>
<navbar-back :autoBack="false" title="样品分析-收样" @leftClick="customBack"></navbar-back> <navbar-back :autoBack="false" title="样品分析-收样" @leftClick="customBack"></navbar-back>
<u-row class="content-title" gutter="16"> <u-row gutter="16">
<u-col span="4"> <u-col span="4">
<view class="content-title-name"> <view class="content-title-name">
<text>任务列表</text> <text>任务列表</text>
<up-badge v-if="taskList.length > 0" class="ml5" :value="taskList.length" type="warning"></up-badge>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
<scroll-view
style="height: 75vh"
scroll-y
scroll-with-animation
class="content-main-left"
:scroll-top="scrollTop"
>
<TaskItem
v-for="(task, index) in taskList"
:key="index"
:task="task"
:seq="index + 1"
:active="current === index"
@click="switchTask(index)"
/>
</scroll-view>
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<view class="content-title-name"> <view class="content-title-name">
<text>样品列表</text> <text>样品列表</text>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
</u-col> <view>
</u-row> <scroll-view scroll-y scroll-with-animation style="height: calc(75vh - 60px)">
<u-row class="content-main-height" gutter="16" align="top">
<!-- 任务列表 -->
<u-col span="4">
<scroll-view
scroll-y
scroll-with-animation
class="content-main-height content-main-left"
:scroll-top="scrollTop"
>
<view
v-for="(task, index) in taskList"
:key="index"
class="u-tab-item"
:class="[current === index ? 'u-tab-item-active' : '']"
@tap.stop="switchTask(index)"
>
<u-row style="width: 100%">
<u-col span="2" style="text-align: center">
<u-icon :color="taskStyle(task)" name="tags-fill" size="34"></u-icon>
</u-col>
<u-col span="10">
<view class="fs18">{{ task.taskNo }}</view>
<view style="margin-top: 10px">{{ task.taskName }}</view>
<view class="x-f" style="margin-top: 10px">
<u-icon name="clock"></u-icon>
<text style="margin-left: 5px">{{ task.taskOperTime }}</text>
</view>
</u-col>
</u-row>
</view>
</scroll-view>
</u-col>
<!-- 样品列表 -->
<u-col span="8">
<view class="content-main-height">
<scroll-view scroll-y scroll-with-animation class="content-main-right">
<block v-for="(sample, index) in sampleList" :key="index"> <block v-for="(sample, index) in sampleList" :key="index">
<view style="padding: 5px; font-size: 16px"> <view sclass="p5 fs16">
<u-row> <u-row>
<u-col span="3" style="text-align: center"> <u-col span="3" class="text-center">
<u-row> <u-row>
<u-col span="6" style="text-align: center"> <u-col span="6" style="text-align: center">
<u-checkbox <u-checkbox
@@ -74,10 +53,10 @@
<u-col span="9" class="sample_desc"> <u-col span="9" class="sample_desc">
<view> <view>
<view <view
><text style="padding-left: 10px">{{ sample.sampleCode }}</text></view ><text class="pl10">{{ sample.sampleCode }}</text></view
> >
<view> <view>
<text style="padding-left: 10px"> <text class="pl10">
{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }} {{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
</text> </text>
</view> </view>
@@ -87,7 +66,7 @@
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-line style="padding: 5px" color="#bbb" /> <u-line class="p5" color="#bbb" />
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
@@ -112,13 +91,27 @@
import { ref, computed, onMounted } from 'vue' import { ref, computed, onMounted } from 'vue'
import nx from '@/nx' import nx from '@/nx'
import { onLoad, onBackPress } from '@dcloudio/uni-app' import { onLoad, onBackPress } from '@dcloudio/uni-app'
import TaskItem from './components/task-item.vue'
import { getDataSourceTypeShow } from '../common'
// 响应式数据 // 响应式数据
const currentNode = ref('F30') const currentNode = ref('F30')
const scrollTop = ref(0) const scrollTop = ref(0)
const current = ref(0) const current = ref(0)
const taskList = ref([]) const taskList = ref([
const sampleList = ref([]) { id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' },
{ id: 1, taskNo: 'TASK-1', taskName: '任务1', taskOperTime: '2022-03-01 10:00:00' }
])
const sampleList = ref([
{ id: 1, sampleCode: 'SAMPLE-1', sampleName: '样品1', sort: 1, checked: false, sampleProcessNo: 'F30' }
])
const dicSampleProcessCodeList = ref([]) const dicSampleProcessCodeList = ref([])
// 计算属性 // 计算属性
@@ -133,16 +126,6 @@ const selectSample = sample => {
sample.checked = !sample.checked sample.checked = !sample.checked
} }
const taskStyle = task => {
if ((task.weightTaskStatus === 0 || task.weightTaskStatus === 1) && task.reviewCount > 0) {
return 'red'
}
if (task.weightTaskStatus === 2 && task.reviewCount > 0) {
return 'green'
}
return ''
}
const confirmReceipt = () => { const confirmReceipt = () => {
const errNodeList = sampleList.value.filter(item => item.sampleProcessNo !== currentNode.value) const errNodeList = sampleList.value.filter(item => item.sampleProcessNo !== currentNode.value)
if (errNodeList.length > 0) { if (errNodeList.length > 0) {
@@ -250,16 +233,10 @@ const getProcessNameShow = val => {
return item ? item.processName : val return item ? item.processName : val
} }
const getDataSourceTypeShow = val => {
if (val === 2) return '【筛上】'
if (val === 3) return '【筛下】'
return ''
}
// 生命周期 // 生命周期
onLoad(() => { onLoad(() => {
getDicSampleProcessCodeList() getDicSampleProcessCodeList()
getAssayTask() // getAssayTask()
}) })
onBackPress(() => { onBackPress(() => {
@@ -269,59 +246,29 @@ onBackPress(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content-title { .content-title-name {
height: 50px; height: 50px;
width: 100%; box-sizing: border-box;
font-size: 20px; font-size: 20px;
font-weight: 300; font-weight: 300;
}
.content-title-name {
padding: 10px; padding: 10px;
text-align: center; text-align: center;
} display: flex;
justify-content: center;
.content-main-height { align-items: center;
height: calc(100vh - 125px);
} }
.content-main-left { .content-main-left {
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.u-tab-item {
padding: 5px;
height: 100px;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #444;
line-height: 1;
border-bottom: 2px dotted;
}
.u-tab-item-active {
position: relative;
color: #0055a2;
font-weight: 600;
background: #fff;
}
.content-main-right {
height: calc(100vh - 205px);
}
.content-main-right-operation { .content-main-right-operation {
height: 80px; height: 50px;
padding-top: 15px; padding-top: 10px;
padding-right: 15px; padding-right: 10px;
} }
.btn-operation { .btn-operation {
height: 50px;
font-size: 18px; font-size: 18px;
} }

View File

@@ -1,80 +1,59 @@
<template> <template>
<view> <view>
<navbar-back :autoBack="false" title="审核查询" @leftClick="customBack"></navbar-back> <navbar-back :autoBack="false" title="审核查询" @leftClick="customBack"></navbar-back>
<u-row class="content-title" gutter="16"> <u-row gutter="16">
<u-col span="4"> <u-col span="4">
<view class="content-title-name"> <view class="content-title-name">
<text>任务列表</text> <text>任务列表</text>
<up-badge v-if="taskList.length > 0" class="ml5" :value="taskList.length" type="warning"></up-badge>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
<scroll-view
style="height: 75vh"
scroll-y
scroll-with-animation
class="content-main-left"
:scroll-top="scrollTop"
>
<TaskItem
v-for="(task, index) in taskList"
:key="index"
:task="task"
:seq="index + 1"
:active="current === index"
@click="switchTask(index)"
/>
</scroll-view>
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<view class="content-title-name"> <view class="content-title-name">
<text>样品列表</text> <text>样品列表</text>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
</u-col>
</u-row>
<u-row class="content-main-height" gutter="16" align="top">
<u-col span="4">
<scroll-view
scroll-y
scroll-with-animation
class="content-main-height content-main-left"
:scroll-top="scrollTop"
>
<view
v-for="(task, index) in taskList"
:key="index"
class="u-tab-item"
:class="[current.value === index ? 'u-tab-item-active' : '']"
@tap.stop="swichTask(index)"
>
<u-row style="width: 100%">
<u-col span="2" style="text-align: center">
<u-icon :color="taskStyle(task)" name="tags-fill" size="34"></u-icon>
</u-col>
<u-col span="10">
<view> <view>
<text style="font-size: 18px">{{ task.taskNo }}</text> <scroll-view scroll-y scroll-with-animation style="height: calc(75vh - 60px)">
</view>
<view style="margin-top: 10px">
<text>{{ task.taskName }} {{ task.assayOper }}</text>
</view>
<view class="x-f" style="margin-top: 10px">
<u-icon color="" name="clock"></u-icon>
<text style="margin-left: 5px">{{ task.reportTime }}</text>
</view>
</u-col>
</u-row>
</view>
</scroll-view>
</u-col>
<u-col span="8">
<view class="content-main-height">
<scroll-view scroll-y scroll-with-animation class="content-main-right">
<block v-for="(sample, index) in sampleList" :key="index"> <block v-for="(sample, index) in sampleList" :key="index">
<view style="padding: 5px; font-size: 16px"> <view class="p5 fs16">
<u-row <u-row
@click="showSampleDetail(sample.id, index)" @click="showSampleDetail(sample.id, index)"
:class="selectedIndex.value === index ? 'selected_Sample' : ''" :class="selectedIndex.value === index ? 'selected_Sample' : ''"
> >
<u-col span="2" style="text-align: center" :style="sampleStyle(sample)"> <u-col span="2" class="text-center" :style="sampleStyle(sample)">
<view> <view>
<text>{{ sample.sort }}</text> <text>{{ sample.sort }}</text>
</view> </view>
</u-col> </u-col>
<u-col span="5"> <u-col span="5">
<view> <view>
<text style="padding-left: 10px">{{ sample.sampleCode }}</text> <text class="pl5">{{ sample.sampleCode }}</text>
</view> </view>
<view> <view>
<text style="padding-left: 10px"> <text class="pl5">
{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }} {{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
</text> </text>
</view> </view>
<view v-if="sample.sampleWeight"> <view v-if="sample.sampleWeight">
<text style="padding-left: 10px">{{ sample.sampleWeight }} g</text> <text class="pl5">{{ sample.sampleWeight }} g</text>
</view> </view>
</u-col> </u-col>
<u-col span="5"> <u-col span="5">
@@ -83,7 +62,7 @@
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-line style="padding: 5px" color="#bbb" /> <u-line class="p5" color="#bbb" />
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
@@ -104,7 +83,7 @@
<sample-detail-popup <sample-detail-popup
ref="sampleDetailPopup" ref="sampleDetailPopup"
:showPopup="showDetailPopup" v-model:showPopup="showDetailPopup"
:detailPopupParam="detailPopupParam" :detailPopupParam="detailPopupParam"
></sample-detail-popup> ></sample-detail-popup>
</view> </view>
@@ -114,7 +93,9 @@
import { ref, computed, onMounted } from 'vue' import { ref, computed, onMounted } from 'vue'
import { onLoad, onBackPress } from '@dcloudio/uni-app' import { onLoad, onBackPress } from '@dcloudio/uni-app'
import SampleDetailPopup from '@/components/sample/sample-detail-popup.vue' import SampleDetailPopup from '@/components/sample/sample-detail-popup.vue'
import TaskItem from './components/task-item.vue'
import nx from '@/nx' import nx from '@/nx'
import { getDataSourceTypeShow } from '../common'
// 响应式数据 // 响应式数据
const scrollTop = ref(0) const scrollTop = ref(0)
@@ -138,12 +119,6 @@ const customBack = () => {
uni.reLaunch({ url: '/pages/analysis/index/index' }) uni.reLaunch({ url: '/pages/analysis/index/index' })
} }
const taskStyle = task => {
if ((task.weightTaskStatus === 0 || task.weightTaskStatus === 1) && task.reviewCount > 0) return 'red'
if (task.weightTaskStatus === 2 && task.reviewCount > 0) return 'green'
return ''
}
const sampleStyle = sample => { const sampleStyle = sample => {
if ((sample.weightSubmitStatus === 0 || sample.weightSubmitStatus === 1) && sample.reviewCount > 0) { if ((sample.weightSubmitStatus === 0 || sample.weightSubmitStatus === 1) && sample.reviewCount > 0) {
return 'color: red' return 'color: red'
@@ -154,7 +129,7 @@ const sampleStyle = sample => {
return '' return ''
} }
const swichTask = async index => { const switchTask = async index => {
if (index === current.value) return if (index === current.value) return
current.value = index current.value = index
selectedIndex.value = -1 selectedIndex.value = -1
@@ -217,18 +192,9 @@ const previewPDF = () => {
uni.navigateTo({ url }) uni.navigateTo({ url })
} }
const getDataSourceTypeShow = val => {
if (val === 2) return '【筛上】'
if (val === 3) return '【筛下】'
return ''
}
// 生命周期 // 生命周期
onMounted(() => { onMounted(() => {
getAssayTask() // getAssayTask()
uni.$on('sample-detail-popup_close', () => {
showDetailPopup.value = false
})
}) })
onBackPress(() => { onBackPress(() => {
@@ -238,59 +204,28 @@ onBackPress(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/* 样式部分保持不变 */ .content-title-name {
.content-title {
height: 50px; height: 50px;
width: 100%; box-sizing: border-box;
font-size: 20px; font-size: 20px;
font-weight: 300; font-weight: 300;
}
.content-title-name {
padding: 10px; padding: 10px;
text-align: center; text-align: center;
display: flex;
justify-content: center;
align-items: center;
} }
.content-main-height {
height: calc(100vh - 125px);
}
.content-main-left { .content-main-left {
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.u-tab-item {
padding: 5px;
height: 100px;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #444;
line-height: 1;
border-width: 2px;
border-bottom: dotted;
}
.u-tab-item-active {
position: relative;
color: #0055a2;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: '';
position: absolute;
height: 16px;
left: 0;
top: 20px;
}
.content-main-right {
height: calc(100vh - 205px);
}
.content-main-right-operation { .content-main-right-operation {
height: 80px; height: 50px;
padding-top: 15px; padding-top: 10px;
padding-right: 15px; padding-right: 10px;
} }
.btn-operation { .btn-operation {
font-size: 18px;
width: 95%; width: 95%;
} }
.selected_Sample { .selected_Sample {

View File

@@ -1,75 +1,53 @@
<template> <template>
<view> <view>
<navbar-back :autoBack="false" title="数据上报" @leftClick="customBack"></navbar-back> <navbar-back :autoBack="false" title="数据上报" @leftClick="customBack"></navbar-back>
<u-row class="content-title" gutter="16"> <u-row gutter="16">
<u-col span="4"> <u-col span="4">
<view class="content-title-name"> <view class="content-title-name">
<text>任务列表</text> <text>任务列表</text>
<up-badge v-if="taskList.length > 0" class="ml5" :value="taskList.length" type="warning"></up-badge>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
<scroll-view
style="height: 75vh"
scroll-y
scroll-with-animation
class="content-main-left"
:scroll-top="scrollTop"
>
<TaskItem
v-for="(task, index) in taskList"
:key="index"
:task="task"
:active="current === index"
@click="switchTask(index)"
/>
</scroll-view>
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<view class="content-title-name"> <view class="content-title-name">
<text>样品列表</text> <text>样品列表</text>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
</u-col>
</u-row>
<u-row class="content-main-height" gutter="16" align="top">
<u-col span="4">
<scroll-view
scroll-y
scroll-with-animation
class="content-main-height content-main-left"
:scroll-top="scrollTop"
>
<view
v-for="(task, index) in taskList"
:key="index"
class="u-tab-item"
:class="current === index ? 'u-tab-item-active' : ''"
@tap.stop="swichTask(index)"
>
<u-row style="width: 100%">
<u-col span="2" style="text-align: center">
<u-icon :color="taskStyle(task)" name="tags-fill" size="34"></u-icon>
</u-col>
<u-col span="10">
<view> <view>
<text style="font-size: 18px">{{ task.taskNo }}</text> <scroll-view scroll-y scroll-with-animation style="height: calc(75vh - 60px)">
</view>
<view style="margin-top: 10px">
<text>{{ task.taskName }} {{ task.assayOper }}</text>
</view>
<view class="x-f" style="margin-top: 10px">
<u-icon color="" name="clock"></u-icon>
<text style="margin-left: 5px">{{ task.taskOperTime }}</text>
</view>
</u-col>
</u-row>
</view>
</scroll-view>
</u-col>
<u-col span="8">
<view class="content-main-height">
<scroll-view scroll-y scroll-with-animation class="content-main-right">
<block v-for="(sample, index) in sampleList" :key="index"> <block v-for="(sample, index) in sampleList" :key="index">
<view style="padding: 5px; font-size: 16px"> <view class="p5 fs16">
<u-row <u-row
@click="showSampleDetail(sample.id, index)" @click="showSampleDetail(sample.id, index)"
:class="selectedIndex === index ? 'selected_Sample' : ''" :class="selectedIndex === index ? 'selected_Sample' : ''"
> >
<u-col span="2" style="text-align: center" :style="sampleStyle(sample)"> <u-col span="2" class="text-center" :style="sampleStyle(sample)">
<view> <view>
<text>{{ sample.sort }}</text> <text>{{ sample.sort }}</text>
</view> </view>
</u-col> </u-col>
<u-col span="5"> <u-col span="5">
<view> <view>
<text style="padding-left: 10px">{{ sample.sampleCode }}</text> <text class="pl10">{{ sample.sampleCode }}</text>
</view> </view>
<view> <view>
<text style="padding-left: 10px" <text class="pl10"
>{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}</text >{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}</text
> >
</view> </view>
@@ -80,19 +58,18 @@
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-line style="padding: 5px" color="#bbb" /> <u-line class="p5" color="#bbb" />
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
<view class="content-main-right-operation"> <view class="content-main-right-operation">
<u-row> <u-row :gutter="16">
<u-col span="3"></u-col> <u-col span="4">
<u-col span="3">
<u-button class="btn-operation" type="primary" @click="previewPDF" v-if="currentTaskId"> <u-button class="btn-operation" type="primary" @click="previewPDF" v-if="currentTaskId">
任务单预览 任务单预览
</u-button> </u-button>
</u-col> </u-col>
<u-col span="3"> <u-col span="4">
<u-button <u-button
class="btn-operation" class="btn-operation"
v-if="currentTaskId" v-if="currentTaskId"
@@ -103,7 +80,7 @@
撤回任务单 撤回任务单
</u-button> </u-button>
</u-col> </u-col>
<u-col span="3"> <u-col span="4">
<u-button class="btn-operation" :disabled="dataReportDisabled" type="success" @click="dataReport"> <u-button class="btn-operation" :disabled="dataReportDisabled" type="success" @click="dataReport">
数据上报 数据上报
</u-button> </u-button>
@@ -113,7 +90,6 @@
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<!-- 样品详情 --> <!-- 样品详情 -->
<sample-detail-popup <sample-detail-popup
ref="sampleDetailPopup" ref="sampleDetailPopup"
@@ -127,6 +103,8 @@
import { ref, computed, onMounted } from 'vue' import { ref, computed, onMounted } from 'vue'
import { onLoad, onBackPress } from '@dcloudio/uni-app' import { onLoad, onBackPress } from '@dcloudio/uni-app'
import SampleDetailPopup from '@/components/sample/sample-detail-popup.vue' import SampleDetailPopup from '@/components/sample/sample-detail-popup.vue'
import TaskItem from './components/task-item.vue'
import { getDataSourceTypeShow } from '../common'
import nx from '@/nx' import nx from '@/nx'
// 响应式数据 // 响应式数据
@@ -155,12 +133,6 @@ const customBack = () => {
uni.reLaunch({ url: '/pages/analysis/index/index' }) uni.reLaunch({ url: '/pages/analysis/index/index' })
} }
const taskStyle = task => {
if ((task.weightTaskStatus === 0 || task.weightTaskStatus === 1) && task.reviewCount > 0) return 'red'
if (task.weightTaskStatus === 2 && task.reviewCount > 0) return 'green'
return ''
}
const sampleStyle = sample => { const sampleStyle = sample => {
if ((sample.weightSubmitStatus === 0 || sample.weightSubmitStatus === 1) && sample.reviewCount > 0) { if ((sample.weightSubmitStatus === 0 || sample.weightSubmitStatus === 1) && sample.reviewCount > 0) {
return 'color: red' return 'color: red'
@@ -171,7 +143,7 @@ const sampleStyle = sample => {
return '' return ''
} }
const swichTask = async index => { const switchTask = async index => {
if (index === current.value) return if (index === current.value) return
current.value = index current.value = index
const task = taskList.value[index] const task = taskList.value[index]
@@ -300,12 +272,6 @@ const getProcessNameShow = val => {
return item ? item.processName : val return item ? item.processName : val
} }
const getDataSourceTypeShow = val => {
if (val === 2) return '【筛上】'
if (val === 3) return '【筛下】'
return ''
}
const printTask = () => { const printTask = () => {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
@@ -333,68 +299,30 @@ onBackPress(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/* 样式保持不变 */ .content-title-name {
.content-title {
height: 50px; height: 50px;
width: 100%; box-sizing: border-box;
font-size: 20px; font-size: 20px;
font-weight: 300; font-weight: 300;
}
.content-title-name {
padding: 10px; padding: 10px;
text-align: center; text-align: center;
} display: flex;
justify-content: center;
.content-main-height { align-items: center;
height: calc(100vh - 125px);
} }
.content-main-left { .content-main-left {
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.u-tab-item {
padding: 5px;
height: 100px;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #444;
line-height: 1;
border-width: 2px;
border-bottom: dotted;
}
.u-tab-item-active {
position: relative;
color: #0055a2;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: '';
position: absolute;
height: 16px;
left: 0;
top: 20px;
}
.content-main-right {
height: calc(100vh - 205px);
}
.content-main-right-operation { .content-main-right-operation {
height: 80px; height: 50px;
padding-top: 15px; padding-top: 10px;
padding-right: 15px; padding-right: 10px;
} }
.btn-operation { .btn-operation {
font-size: 18px;
width: 95%; width: 95%;
} }

View File

@@ -1013,7 +1013,7 @@ const loadDevice = () => {
} }
} }
nx.$measure.setRegData(JSON.stringify(regData)) nx.$measure.setRegData(JSON.stringify(regData))
nx.$measure.reOpen() nx.$measure.open()
} }
// 键盘监听 // 键盘监听

View File

@@ -574,32 +574,12 @@ function reviver(key, value) {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.navbar-right {
font-size: 16px;
color: #fff;
margin-right: 20px;
}
.content-title { .content-title {
width: 100%; width: 100%;
font-size: 20px; font-size: 20px;
font-weight: 300; font-weight: 300;
} }
.content-title-name {
padding: 10px;
text-align: center;
}
.content-main-height {
height: calc(100vh - 125px);
}
.content-main-left {
height: calc(100vh - 205px);
background-color: #f6f6f6;
}
.form-item-my { .form-item-my {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -628,121 +608,4 @@ function reviver(key, value) {
border-radius: 5px; border-radius: 5px;
} }
} }
.u-tab-item {
height: 80px;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: #444;
font-weight: 400;
line-height: 1;
border-width: 2px;
border-bottom: dotted;
}
.u-tab-item-active {
position: relative;
color: #0055a2;
font-size: 18px;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: '';
position: absolute;
height: 16px;
left: 0;
top: 20px;
}
.content-main-left-operation {
height: 80px;
padding-top: 15px;
}
.content-main-right {
height: calc(100vh - 205px);
}
.content-main-right-operation {
height: 80px;
padding-top: 15px;
}
.auncel-container {
display: flex;
justify-content: center;
align-items: center;
}
.auncel {
width: 400px;
height: 400px;
background-image: url(/static/images/auncel.png);
background-repeat: no-repeat;
background-size: 100%;
}
.auncel-title {
width: 100%;
height: 210px;
}
.auncel-weight {
padding: 20px;
}
.weight {
width: 100%;
min-width: 200px;
height: 100px;
padding: 0 15px;
display: flex;
flex-direction: row;
//background-color: #2c405a;
}
.weight-data {
flex-grow: 1;
height: 100%;
color: #4cd964;
text-align: right;
line-height: 100px;
letter-spacing: 2px;
font-size: 75px;
font-family: zzjc-lcd;
}
.weight-data-yellow {
flex-grow: 1;
height: 100%;
color: #ffff00;
text-align: right;
line-height: 100px;
letter-spacing: 2px;
font-size: 75px;
font-family: zzjc-lcd;
}
.weight-data-warning {
flex-grow: 1;
height: 100%;
color: #ff3333;
text-align: right;
line-height: 100px;
font-size: 75px;
font-family: zzjc-lcd;
}
.weight-unit {
color: #ffffff;
font-size: 65px;
line-height: 100px;
padding-left: 10px;
}
</style> </style>

View File

@@ -5,56 +5,38 @@
<u-col span="4"> <u-col span="4">
<view class="content-title-name"> <view class="content-title-name">
<text>任务列表</text> <text>任务列表</text>
<up-badge v-if="taskList.length > 0" class="ml5" :value="taskList.length" type="warning"></up-badge>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
<scroll-view
style="height: 75vh"
scroll-y
scroll-with-animation
class="content-main-left"
:scroll-top="scrollTop"
>
<TaskItem
v-for="(task, index) in taskList"
:key="index"
:task="task"
:active="current === index"
@click="switchTask(index)"
/>
</scroll-view>
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<view class="content-title-name"> <view class="content-title-name">
<text>样品列表</text> <text>样品列表</text>
</view> </view>
<u-gap height="5" bg-color="#0055A2"></u-gap> <u-gap height="5" bg-color="#0055A2"></u-gap>
</u-col> <view>
</u-row> <scroll-view scroll-y scroll-with-animation style="height: calc(75vh - 60px)">
<u-row class="content-main-height" gutter="16" align="top">
<u-col span="4">
<scroll-view
scroll-y
scroll-with-animation
class="content-main-height content-main-left"
:scroll-top="scrollTop"
>
<view
v-for="(task, index) in taskList"
:key="index"
class="u-tab-item"
:class="[current === index ? 'u-tab-item-active' : '']"
@tap.stop="swichTask(index)"
>
<u-row style="width: 100%">
<u-col span="2" style="text-align: center">
<u-icon :color="taskStyle(task)" name="tags-fill" size="34"></u-icon>
</u-col>
<u-col span="10">
<view class="fs18">{{ task.taskNo }}</view>
<view style="margin-top: 10px">{{ task.taskName }}</view>
<view class="x-f" style="margin-top: 10px">
<u-icon color="" name="clock"></u-icon>
<text style="margin-left: 5px">{{ task.taskOperTime }}</text>
</view>
</u-col>
</u-row>
</view>
</scroll-view>
</u-col>
<u-col span="8">
<view class="content-main-height">
<scroll-view scroll-y scroll-with-animation class="content-main-right">
<block v-for="(sample, index) in sampleList" :key="index"> <block v-for="(sample, index) in sampleList" :key="index">
<view v-if="currentTask.reviewCount === sample.reviewCount" style="padding: 5px; font-size: 16px"> <view v-if="currentTask.reviewCount === sample.reviewCount" class="p5 fs16">
<u-row> <u-row>
<u-col span="3" style="text-align: center"> <u-col span="3" class="text-center">
<u-row> <u-row>
<u-col span="6" style="text-align: center"> <u-col span="6" class="text-center">
<u-checkbox <u-checkbox
v-model="sample.checked" v-model="sample.checked"
v-if=" v-if="
@@ -65,7 +47,7 @@
@change="() => selectSample(sample)" @change="() => selectSample(sample)"
></u-checkbox> ></u-checkbox>
</u-col> </u-col>
<u-col span="6" style="text-align: center"> <u-col span="6" class="text-center">
<view <view
><text>【{{ sample.sort }}】</text></view ><text>【{{ sample.sort }}】</text></view
> >
@@ -76,10 +58,10 @@
<view class="sample_desc"> <view class="sample_desc">
<view> <view>
<view <view
><text style="padding-left: 10px">{{ sample.sampleCode }}</text></view ><text class="pl10">{{ sample.sampleCode }}</text></view
> >
<view> <view>
<text style="padding-left: 10px"> <text class="pl10">
{{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }} {{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
</text> </text>
</view> </view>
@@ -96,13 +78,13 @@
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
<u-line style="padding: 5px" color="#bbb" /> <u-line class="p5" color="#bbb" />
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
<view class="content-main-right-operation"> <view class="content-main-right-operation">
<u-row> <u-row>
<u-col span="3.5"></u-col> <u-col span="4"></u-col>
<u-col span="4"> <u-col span="4">
<u-button class="btn-operation" type="warning" @click="showRollbackModal">申请退回样品</u-button> <u-button class="btn-operation" type="warning" @click="showRollbackModal">申请退回样品</u-button>
</u-col> </u-col>
@@ -136,6 +118,8 @@ import { ref, computed, onMounted } from 'vue'
import { onLoad, onBackPress } from '@dcloudio/uni-app' import { onLoad, onBackPress } from '@dcloudio/uni-app'
import nx from '@/nx' import nx from '@/nx'
import { useScreenOrientation } from '@/nx/hooks/useScreenOrientation' import { useScreenOrientation } from '@/nx/hooks/useScreenOrientation'
import { getDataSourceTypeShow } from '../common'
import TaskItem from './components/task-item.vue'
// 响应式数据 // 响应式数据
const currentNode = ref('F31') const currentNode = ref('F31')
@@ -162,12 +146,6 @@ const selectSample = sample => {
sample.checked = !sample.checked sample.checked = !sample.checked
} }
const taskStyle = task => {
if ((task.weightTaskStatus === 0 || task.weightTaskStatus === 1) && task.reviewCount > 0) return 'red'
if (task.weightTaskStatus === 2 && task.reviewCount > 0) return 'green'
return ''
}
const showRollbackModal = () => { const showRollbackModal = () => {
const checkedSampleList = sampleList.value.filter(item => item.checked) const checkedSampleList = sampleList.value.filter(item => item.checked)
if (checkedSampleList.length === 0) { if (checkedSampleList.length === 0) {
@@ -228,7 +206,7 @@ const startWork = () => {
}) })
} }
const swichTask = async index => { const switchTask = async index => {
if (index === current.value) return if (index === current.value) return
current.value = index current.value = index
rollbackContent.value = '' rollbackContent.value = ''
@@ -280,18 +258,12 @@ const getProcessNameShow = val => {
return item ? item.processName : val return item ? item.processName : val
} }
const getDataSourceTypeShow = val => {
if (val === 2) return '【筛上】'
if (val === 3) return '【筛下】'
return ''
}
// 生命周期 // 生命周期
onLoad(() => { onLoad(() => {
const { lockOrientation } = useScreenOrientation() const { lockOrientation } = useScreenOrientation()
lockOrientation('landscape') lockOrientation('landscape')
getDicSampleProcessCodeList() getDicSampleProcessCodeList()
getAssayTask() // getAssayTask()
}) })
onBackPress(() => { onBackPress(() => {
@@ -301,60 +273,27 @@ onBackPress(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/* 样式保持不变 */ .content-title-name {
.content-title {
height: 50px; height: 50px;
width: 100%; box-sizing: border-box;
font-size: 20px; font-size: 20px;
font-weight: 300; font-weight: 300;
}
.content-title-name {
padding: 10px; padding: 10px;
text-align: center; text-align: center;
} display: flex;
.content-main-height { justify-content: center;
height: calc(100vh - 125px); align-items: center;
} }
.content-main-left { .content-main-left {
background-color: #f6f6f6; background-color: #f6f6f6;
} }
.u-tab-item {
padding: 5px;
height: 100px;
background: #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #444;
line-height: 1;
border-width: 2px;
border-bottom: dotted;
}
.u-tab-item-active {
position: relative;
color: #0055a2;
font-weight: 600;
background: #fff;
}
.u-tab-item-active::before {
content: '';
position: absolute;
height: 16px;
left: 0;
top: 20px;
}
.content-main-right {
height: calc(100vh - 205px);
}
.content-main-right-operation { .content-main-right-operation {
height: 80px; height: 50px;
padding-top: 15px; padding-top: 10px;
padding-right: 15px; padding-right: 10px;
} }
.btn-operation { .btn-operation {
height: 50px;
font-size: 18px; font-size: 18px;
width: 95%; width: 95%;
} }

View File

@@ -52,8 +52,8 @@ import callCheckUpdate from '@/nx/utils/check-update'
const loading = ref(false) const loading = ref(false)
const captchaEnable = true const captchaEnable = true
let loginInfo = reactive({ let loginInfo = reactive({
username: '', username: 'admin',
password: '', password: 'P@ssword25',
captchaVerification: '' captchaVerification: ''
}) })
onShow(() => { onShow(() => {
@@ -117,6 +117,7 @@ function onCaptchaError(error) {
icon: 'none', icon: 'none',
title: error?.message || '验证码验证失败' title: error?.message || '验证码验证失败'
}) })
loading.value = false
} }
</script> </script>