diff --git a/App.vue b/App.vue
index e63c163..9f6acd7 100644
--- a/App.vue
+++ b/App.vue
@@ -4,7 +4,7 @@ import { onLaunch, onShow, onError } from '@dcloudio/uni-app'
import { NxInit } from './nx'
import $store from '@/nx/store'
// #ifdef APP-PLUS
-import * as urovo from '@/uni_modules/zzjc-urovo'
+import * as urovo from './uni_modules/zzjc-urovo'
// #endif
onLaunch(async () => {
// 加载nx底层依赖
diff --git a/defaultBaseUrl.js b/defaultBaseUrl.js
index 283777f..537b5ee 100644
--- a/defaultBaseUrl.js
+++ b/defaultBaseUrl.js
@@ -1,7 +1,7 @@
// 在此不用配置接口前缀
const isDev = process.env.NODE_ENV === 'development'
-const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
-// const BaseUrl = isDev ? 'http://192.168.26.163:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
+// const BaseUrl = isDev ? 'http://192.168.26.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
+const BaseUrl = isDev ? 'http://192.168.26.163:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
//
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
const upgradeBaseUrl = 'http://192.168.26.116:888'
diff --git a/nx/api/auncel.js b/nx/api/auncel.js
deleted file mode 100644
index fe4a6dd..0000000
--- a/nx/api/auncel.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import request from '@/nx/request'
-const taskPrefix = '/qms/bus/qmsBusAssayTask'
-
-export const getConAssayTaskWithReportTemplateContent = id => {
- return request({
- url: '/qms/config/assay-task/getConTaskWithReportTemplateDataContent',
- method: 'get',
- params: {
- id
- }
- })
-}
-export const queryTaskDetailListByAssayTaskId = params => {
- return request({
- url: taskPrefix + '/getAssayTaskDataWithDetailData',
- method: 'get',
- params: params
- })
-}
-
-export default {
- getConAssayTaskWithReportTemplateContent,
- queryTaskDetailListByAssayTaskId
-}
diff --git a/nx/api/report.js b/nx/api/report.js
new file mode 100644
index 0000000..fa05cdf
--- /dev/null
+++ b/nx/api/report.js
@@ -0,0 +1,23 @@
+import request from '@/nx/request'
+
+export const getBusinessSubSample = id => {
+ return request({
+ url: '/qms/business-sub-sample/get',
+ method: 'get',
+ params: {
+ id
+ }
+ })
+}
+export const getConfigReportTemplateByKey = params => {
+ return request({
+ url: '/qms/config-report-template/getByKey',
+ method: 'GET',
+ params: params
+ })
+}
+
+export default {
+ getBusinessSubSample,
+ getConfigReportTemplateByKey
+}
diff --git a/nx/api/sampleWarehouse.js b/nx/api/sampleWarehouse.js
index eec7398..5ca4fde 100644
--- a/nx/api/sampleWarehouse.js
+++ b/nx/api/sampleWarehouse.js
@@ -52,7 +52,7 @@ export default {
// 按样品添加内部调拨数据
addDispatchSample: data =>
request({
- url: '/qms/business-sample-dispatch/addBySampleCode',
+ url: '/qms/business-sample-dispatch/addBySampleReturnCode',
method: 'POST',
data
}),
diff --git a/nx/helper/print.js b/nx/helper/print.js
index cbb7eb9..a209c85 100644
--- a/nx/helper/print.js
+++ b/nx/helper/print.js
@@ -1,4 +1,4 @@
-import { getConAssayTaskWithReportTemplateContent, queryTaskDetailListByAssayTaskId } from '@/nx/api/auncel'
+import { getConfigReportTemplateByKey, getBusinessSubSample } from '@/nx/api/report'
export default {
//打印机Map对象
printMap: new Map(),
@@ -178,36 +178,33 @@ export default {
//不存在则打开
this.open(printServerIp)
}
- if (printer.socketTask) {
+ if (printer?.socketTask) {
printer.socketTask.send({
data: data
})
}
},
//获取打印模板并执行打印
- getPrintTemplateAndPrint(currentTask) {
- const id = currentTask.taskTypeId
- getConAssayTaskWithReportTemplateContent(id)
+ getPrintTemplateAndPrint(businessSubId) {
+ getBusinessSubSample(businessSubId)
.then(res => {
- this.print(currentTask, res)
+ this.print(res)
})
.catch(err => {
console.log(err)
})
},
//调用send方法执行打印
- print(currentTask, conAssayTask) {
+ print(businessSubData) {
+ const { printTemplate } = businessSubData
const me = this
- let id = currentTask.id
- const reportTemplate = conAssayTask.reportTemplateDataContent
- me.getReportData(id, function (res) {
- const data = res.data || []
+ me.getReportData(printTemplate, function (res) {
const reportData = {
- data: data
+ data: [businessSubData]
}
let printData = {
- type: 'print',
- reportTemplate: reportTemplate,
+ type: 'preview',
+ reportTemplate: res.content,
reportData: JSON.stringify(reportData)
}
//连接打印服务
@@ -220,12 +217,11 @@ export default {
})
},
//获取打印模板
- getReportData(id, onComplete) {
+ getReportData(templateKey, onComplete) {
const param = {
- taskId: id,
- hideResultFlag: 'true'
+ key: templateKey
}
- queryTaskDetailListByAssayTaskId(param).then(res => {
+ getConfigReportTemplateByKey(param).then(res => {
onComplete(res)
})
}
diff --git a/nx/request/index.js b/nx/request/index.js
index 6eb2d1c..474cf7c 100644
--- a/nx/request/index.js
+++ b/nx/request/index.js
@@ -204,7 +204,8 @@ http.interceptors.response.use(
if (code !== 0) {
uni.showToast({
title: msg || response.config.custom.errorMsg,
- icon: 'none'
+ icon: 'none',
+ duration: 3000
})
if (code === 401) {
userStore.logout(true)
diff --git a/pages.json b/pages.json
index c2b657e..4f8bcda 100644
--- a/pages.json
+++ b/pages.json
@@ -160,13 +160,6 @@
"navigationStyle": "custom"
}
},
- {
- "path": "pages/analysis/sample/sample-receive",
- "style": {
- "navigationBarTitleText": "样品分析-收样",
- "navigationStyle": "custom"
- }
- },
{
"path": "pages/analysis/sample/sample-work-list",
"style": {
@@ -196,13 +189,6 @@
"navigationStyle": "custom"
}
},
- {
- "path": "pages/analysis/sample/sample-report",
- "style": {
- "navigationBarTitleText": "数据上报",
- "navigationStyle": "custom"
- }
- },
{
"path": "pages/analysis/sample/sample-report-search",
"style": {
diff --git a/pages/analysis/sample/sample-print.vue b/pages/analysis/sample/sample-print.vue
index c29762a..1f99823 100644
--- a/pages/analysis/sample/sample-print.vue
+++ b/pages/analysis/sample/sample-print.vue
@@ -226,7 +226,7 @@ function printTask() {
confirmColor: '#0055A2',
success: res => {
if (res.confirm) {
- nx.$print.getPrintTemplateAndPrint(currentTask.value)
+ // nx.$print.getPrintTemplateAndPrint(currentTask.value)
}
}
})
diff --git a/pages/analysis/sample/sample-receive.vue b/pages/analysis/sample/sample-receive.vue
deleted file mode 100644
index ba9ee84..0000000
--- a/pages/analysis/sample/sample-receive.vue
+++ /dev/null
@@ -1,274 +0,0 @@
-
-
-
-
-
-
-
- 任务列表
-
-
-
-
-
-
-
-
-
- 样品列表
-
-
-
-
-
-
-
-
-
-
-
-
-
- 【{{ sample.sort }}】
-
-
-
-
-
- {{ sample.sampleCode }}
-
-
- {{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
-
-
-
-
- 当前节点:{{ getProcessNameShow(sample.sampleProcessNo) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- 确认收样
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/analysis/sample/sample-report.vue b/pages/analysis/sample/sample-report.vue
deleted file mode 100644
index 1339da9..0000000
--- a/pages/analysis/sample/sample-report.vue
+++ /dev/null
@@ -1,337 +0,0 @@
-
-
-
-
-
-
- 任务列表
-
-
-
-
-
-
-
-
-
- 样品列表
-
-
-
-
-
-
-
-
-
- 【{{ sample.sort }}】
-
-
-
-
- {{ sample.sampleCode }}
-
-
- {{ getDataSourceTypeShow(sample.dataSourceType) }}{{ sample.sampleName }}
-
-
-
-
- 当前节点:{{ getProcessNameShow(sample.sampleProcessNo) }}
-
-
-
-
-
-
-
-
-
-
-
- 任务单预览
-
-
-
-
- 撤回任务单
-
-
-
-
- 数据上报
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/sampleWarehouse/execChangeLocation/index.vue b/pages/sampleWarehouse/execChangeLocation/index.vue
index afe5d61..7751225 100644
--- a/pages/sampleWarehouse/execChangeLocation/index.vue
+++ b/pages/sampleWarehouse/execChangeLocation/index.vue
@@ -37,19 +37,19 @@
样品名称:{{ item.sampleName }}样品名称:{{ item.sampleName }}
归库编码:{{ item.sampleReturnCode }}归库编码:{{ item.sampleReturnCode }}
归库时间:{{ nx.$dayjs(item.returnTime).format('YYYY-MM-DD HH:mm:ss') }}归库时间:{{ nx.$dayjs(item.returnTime).format('YYYY-MM-DD HH:mm:ss') }}
样品库名称:{{ item.warehouseName }}样品库名称:{{ item.warehouseName }}
(原)库位码:{{ item.warehouseLocationCode }}(原)库位码:{{ item.warehouseLocationCode }}
@@ -120,6 +120,7 @@ async function handleSubmit() {
if (changeType.value === 'sample') {
params.sampleReturnCode = changeCode.value
} else {
+ if (changeCode.value === targetLocation.value) return uni.showToast({ title: '库位码相同', icon: 'none' })
params.warehouseLocationCode = changeCode.value
}
btnLoading.value = true
diff --git a/pages/sampleWarehouse/index/index.vue b/pages/sampleWarehouse/index/index.vue
index c44fd8a..7eab388 100644
--- a/pages/sampleWarehouse/index/index.vue
+++ b/pages/sampleWarehouse/index/index.vue
@@ -76,26 +76,26 @@ const userInfo = computed(() => nx.$store('user').userInfo)
const goTo = url => {
nx.$router.go(url)
}
-// onShow(() => {
-// //连接打印服务
-// let printList = uni.getStorageSync('KEY_PRINT_LIST')
-// if (printList && printList.length > 0) {
-// for (let print of printList) {
-// nx.$print.open(print.printIp, print.printPort)
-// }
-// } else {
-// uni.showModal({
-// title: '提示',
-// showCancel: false,
-// content: '打印服务未配置,请在系统设置中配置打印服务',
-// success: function (res) {
-// uni.navigateTo({
-// url: '/pages/setting/print'
-// })
-// }
-// })
-// }
-// })
+onShow(() => {
+ //连接打印服务
+ let printList = uni.getStorageSync('KEY_PRINT_LIST')
+ if (printList && printList.length > 0) {
+ for (let print of printList) {
+ nx.$print.open(print.printIp, print.printPort)
+ }
+ } else {
+ uni.showModal({
+ title: '提示',
+ showCancel: false,
+ content: '打印服务未配置,请在系统设置中配置打印服务',
+ success: function (res) {
+ uni.navigateTo({
+ url: '/pages/setting/print'
+ })
+ }
+ })
+ }
+})
// 生命周期
onMounted(() => {})
// 动态设置 grid 列数
diff --git a/pages/sampleWarehouse/returnToStock/index.vue b/pages/sampleWarehouse/returnToStock/index.vue
index e0a786c..174a612 100644
--- a/pages/sampleWarehouse/returnToStock/index.vue
+++ b/pages/sampleWarehouse/returnToStock/index.vue
@@ -17,6 +17,7 @@
prefixIcon="scan"
fontSize="16"
prefixIconStyle="font-size: 30px;"
+ @confirm="handleReturnToStock"
>
{{ successCount }}
@@ -83,13 +84,14 @@ function handleReturnToStock() {
})
.then(res => {
successCount.value++
- if (res.isPrint) {
- uni.showToast({
- title: `归库成功,归库码为【${res.code}】`,
- duration: 3000,
- icon: 'none'
- })
+ uni.showToast({
+ title: `归库成功`,
+ duration: 3000,
+ icon: 'none'
+ })
+ if (res.isPrint == 1) {
// 执行打印
+ nx.$print.print(res)
}
})
}
diff --git a/pages/sampleWarehouse/sampleDispatchExternal/detail.vue b/pages/sampleWarehouse/sampleDispatchExternal/detail.vue
index 791f1e1..9a3b081 100644
--- a/pages/sampleWarehouse/sampleDispatchExternal/detail.vue
+++ b/pages/sampleWarehouse/sampleDispatchExternal/detail.vue
@@ -19,6 +19,7 @@
prefixIcon="scan"
fontSize="16"
prefixIconStyle="font-size: 30px;"
+ @confirm="debouncedHandleScan(sampleCode)"
>
diff --git a/pages/sampleWarehouse/sampleDispatchInternal/index.vue b/pages/sampleWarehouse/sampleDispatchInternal/index.vue
index 1ccbd49..8b6697f 100644
--- a/pages/sampleWarehouse/sampleDispatchInternal/index.vue
+++ b/pages/sampleWarehouse/sampleDispatchInternal/index.vue
@@ -47,6 +47,7 @@
import { computed, ref, toRefs, watch, onMounted } from 'vue'
import nx from '@/nx'
import { onLoad, onShow } from '@dcloudio/uni-app'
+import { debounce } from 'lodash'
const btnLoading = ref(false)
let sampleCode = ref('')
@@ -103,22 +104,28 @@ async function handleSubmit() {
})
}
btnLoading.value = true
- const receiver = range.value.find(item => item.value === receiverId.value)?.nickname
+ const receiver = range.value.find(item => item.value === receiverId.value)?.text
await nx.$api.sampleWarehouse
.execSampleDispatch({
id: dispatchTempId.value,
applyUserId: receiverId.value,
- applyUser: receiver
+ applyUser: receiver,
+ warehouseUser: userInfo.value.nickname,
+ warehouseUserId: userInfo.value.id
})
.finally(() => {
btnLoading.value = false
})
- uni.showToast({
- title: '调拨成功',
- icon: 'none'
- })
+ handleReset()
+ setTimeout(() => {
+ uni.showToast({
+ title: '调拨成功',
+ icon: 'none'
+ })
+ }, 200)
}
function handleReset() {
+ receiverId.value = ''
sampleCode.value = ''
sampleList.value = []
createDispatchTempData()
diff --git a/pages/sampleWarehouse/sampleSearch/index.vue b/pages/sampleWarehouse/sampleSearch/index.vue
index db5b61d..c26757b 100644
--- a/pages/sampleWarehouse/sampleSearch/index.vue
+++ b/pages/sampleWarehouse/sampleSearch/index.vue
@@ -47,6 +47,7 @@