feat:样品分析

This commit is contained in:
houjunxiang
2025-10-14 18:16:51 +08:00
parent b5aed8573a
commit 5916b8c833
14 changed files with 574 additions and 671 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,43 @@
import request from '@/nx/request'
const taskDetailPrefix = '/qms/bus/qmsBusAssayTaskDetail'
const taskPrefix = '/qms/bus/qmsBusAssayTask'
// 获取任务
const getAssayTaskList = params => {
return request({
url: '/qms/business-assay-task/page',
method: 'GET',
params: {
pageSize: 999,
pageNo: 1,
...params
}
})
}
// 获取样品列表
const getAssayTaskDataList = params => {
return request({
url: `/qms/business-assay-task-data/list`,
params,
method: 'GET'
})
}
// 获取样品分析配置数据
const getSampleAnalysisByTaskId = businessAssayTaskId => {
return request({
url: '/qms/bus/sample/analysis/batchSampleAnalysisByTaskId',
method: 'GET',
params: { businessAssayTaskId }
})
}
// 获取指派单动态配置项
const getDynamicBaseFormSchema = params => {
return request({
url: '/qms/common/data/data-collection-field/queryEffectiveFields',
method: 'GET',
params
})
}
// 获取任务明细
const getAssayTaskDetailListByTaskNo = params => {
return request({
@@ -114,11 +151,11 @@ const saveHeadValue = params => {
}
// 保存任务明细
const saveDetailValue = params => {
const saveDetailValue = data => {
return request({
url: '/qms/bus/qmsBusAssayTask/saveTaskDetail',
url: '/qms/bus/sample/analysis/saveBatchSampleAnalysis',
method: 'POST',
data: params,
data,
custom: {
showSuccess: true
}
@@ -138,11 +175,9 @@ const submitTaskDetail = params => {
const submitTask = params => {
return request({
url: '/qms/bus/qmsBusAssayTask/submitTaskByTaskNo',
url: '/qms/bus/sample/analysis/submitSampleAnalysisByTaskId',
method: 'POST',
params: {
...params
},
params,
custom: {
showSuccess: true
}
@@ -218,6 +253,10 @@ const queryQmsDicSampleProcessCodeList = () => {
}
export default {
getAssayTaskList,
getAssayTaskDataList,
getSampleAnalysisByTaskId,
getDynamicBaseFormSchema,
getAssayTaskDetailListByTaskNo,
getAssayTaskDetailById,
queryFieldsByTaskDetail,

View File

@@ -1,13 +1,5 @@
import request from '@/nx/request'
const taskPrefix = '/qms/bus/qmsBusAssayTask'
// 获取任务
const getAssayTaskList = params => {
return request({
url: taskPrefix + '/listTaskForPAD',
method: 'GET',
params
})
}
export const getConAssayTaskWithReportTemplateContent = id => {
return request({
@@ -27,7 +19,6 @@ export const queryTaskDetailListByAssayTaskId = params => {
}
export default {
getAssayTaskList,
getConAssayTaskWithReportTemplateContent,
queryTaskDetailListByAssayTaskId
}

View File

@@ -713,6 +713,24 @@ const uuid = () => {
return uuid
}
// 自定义 replacer将函数转换为字符串。json序列化和反序列化时避免函数丢失
function replacer(key, value) {
if (typeof value === 'function') {
return value.toString()
}
return value
}
// 自定义 reviver将字符串转换回函数.json序列化和反序列化时避免函数丢失
const functionKeys = ['change', 'dicFormatter']
function reviver(key, value) {
if (functionKeys.includes(key)) {
// 将字符串转换为函数
return new Function('return ' + value)()
}
return value
}
export default {
range,
getPx,
@@ -745,5 +763,7 @@ export default {
getRootUrl,
copyText,
showToast,
uuid
uuid,
replacer,
reviver
}

View File

@@ -87,32 +87,43 @@ http.interceptors.request.use(
const token = getAccessToken()
if (token) config.header['Authorization'] = token
if (token) config.header['Authorization'] = 'Bearer ' + token
config.header['Accept'] = '*/*'
config.header['tenant-id'] = getTenantId()
const method = config.method?.toUpperCase()
// 防止 GET 请求缓存
if (method === 'GET') {
config.header['Cache-Control'] = 'no-cache'
config.header['Pragma'] = 'no-cache'
}
let params = config.params || {}
let data = config.data || false
if (process.env.NODE_ENV == 'development') console.log('development--params', params)
if (process.env.NODE_ENV == 'development') console.log('development--data', data)
// if (process.env.NODE_ENV == 'development') console.log('development--params', params)
// if (process.env.NODE_ENV == 'development') console.log('development--data', data)
const visitCompanyId = getVisitCompanyId()
// const visitCompanyId = getVisitCompanyId()
const visitCompanyId = '101'
if (visitCompanyId !== undefined && visitCompanyId !== null && visitCompanyId !== '') {
config.header['visit-company-id'] = visitCompanyId
const visitCompanyName = getVisitCompanyName()
// const visitCompanyName = getVisitCompanyName()
const visitCompanyName = '"深圳总公司'
if (visitCompanyName !== undefined && visitCompanyName !== null) {
config.header['visit-company-name'] = encodeURIComponent(visitCompanyName || '')
}
}
const visitDeptId = getVisitDeptId()
// const visitDeptId = getVisitDeptId()
const visitDeptId = '103'
if (visitDeptId !== undefined && visitDeptId !== null && visitDeptId !== '') {
config.header['visit-dept-id'] = visitDeptId
const visitDeptName = getVisitDeptName()
// const visitDeptName = getVisitDeptName()
const visitDeptName = '研发部门'
if (visitDeptName !== undefined && visitDeptName !== null) {
config.header['visit-dept-name'] = encodeURIComponent(visitDeptName || '')
}
}
config.header['__companyDeptRetried'] = '1'
return config
},
error => {
@@ -133,7 +144,6 @@ http.interceptors.response.use(
const userStore = $store('user')
response.config.custom.showLoading && closeLoading()
console.log('response', JSON.parse(JSON.stringify(response.data)))
if (!response.config.custom.isTransformResponse) {
return Promise.resolve(response.data)
}

View File

@@ -26,7 +26,7 @@ const popupShow = ref(false)
const isAllowAgainPrint = ref(false)
const menuItemList = ref([
{ url: '/pages/analysis/sample/sample-receive', otherConf: { icon: 'arrow-downward' }, name: '收样' },
// { url: '/pages/analysis/sample/sample-receive', otherConf: { icon: 'arrow-downward' }, name: '收样' },
{ url: '/pages/analysis/sample/sample-work-list', otherConf: { icon: 'edit-pen-fill' }, name: '样品分析' },
{ url: '/pages/analysis/sample/sample-report', otherConf: { icon: 'arrow-upward' }, name: '数据上报' },
{ url: '/pages/analysis/sample/sample-report-search', otherConf: { icon: 'search' }, name: '待审数据' },

View File

@@ -11,7 +11,7 @@
<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>
<text class="ml5">{{ taskOperatorTime }}</text>
</view>
</u-col>
</u-row>
@@ -19,7 +19,7 @@
</template>
<script setup>
import { computed } from 'vue'
import nx from '@/nx'
const props = defineProps({
task: {
@@ -36,6 +36,7 @@ const props = defineProps({
}
})
const taskOperatorTime = nx.$dayjs(props.task.taskOperatorTime).format('YYYY-MM-DD HH:mm:ss')
const emit = defineEmits(['click'])
const handleClick = () => {

View File

@@ -189,7 +189,7 @@ function getAssayTask() {
finishStatus: 'submited,finished'
}
nx.$api.auncel.getAssayTaskList(param).then(res => {
nx.$api.assayTask.getAssayTaskList(param).then(res => {
taskList.value = res || []
if (taskList.value.length > 0) {
const first = taskList.value[0]

View File

@@ -98,20 +98,8 @@ import { getDataSourceTypeShow } from '../common'
const currentNode = ref('F30')
const scrollTop = ref(0)
const current = ref(0)
const taskList = 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 taskList = ref([])
const sampleList = ref([])
const dicSampleProcessCodeList = ref([])
// 计算属性
@@ -188,7 +176,7 @@ const getAssayTask = () => {
assayOper: userInfo.value.nickname
}
nx.$api.auncel
nx.$api.assayTask
.getAssayTaskList(param)
.then(res => {
taskList.value = res || []

View File

@@ -155,7 +155,7 @@ const getAssayTask = () => {
wfStatus: 'running',
assayOper: userInfo.value.realname
}
nx.$api.auncel.getAssayTaskList(param).then(res => {
nx.$api.assayTask.getAssayTaskList(param).then(res => {
taskList.value = res
if (taskList.value.length > 0) {
current.value = 0

Some files were not shown because too many files have changed in this diff Show More