feat:样品库管理
@@ -1,9 +1,9 @@
|
|||||||
// 在此不用配置接口前缀
|
// 在此不用配置接口前缀
|
||||||
const isDev = process.env.NODE_ENV === 'development'
|
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.116:888/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||||
// const BaseUrl = isDev ? 'http://192.168.26.190:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
const BaseUrl = isDev ? 'http://192.168.26.190:48080/admin-api' : 'http://192.168.26.116:888/admin-api'
|
||||||
|
|
||||||
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
// const BaseUrl = isDev ? 'http://localhost:9999' : ''
|
||||||
const upgradeBaseUrl = 'http://192.168.26.116:888'
|
const upgradeBaseUrl = 'http://192.168.26.116:888'
|
||||||
|
|
||||||
const tenantId = '1'
|
const tenantId = '1'
|
||||||
|
|||||||
@@ -1,9 +1,66 @@
|
|||||||
import request from '@/nx/request'
|
import request from '@/nx/request'
|
||||||
export default {
|
export default {
|
||||||
|
// 查询归库样品
|
||||||
|
queryReturnToStockSample: params =>
|
||||||
|
request({
|
||||||
|
url: '/qms/business-sub-sample/page-stock',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
|
// 样品归库
|
||||||
execReturnToStock: data =>
|
execReturnToStock: data =>
|
||||||
request({
|
request({
|
||||||
url: '/qms/business-sub-sample/execReturnToStock',
|
url: '/qms/business-sub-sample/execReturnToStock',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data
|
data
|
||||||
|
}),
|
||||||
|
// 库位变更
|
||||||
|
execChangeLocation: data =>
|
||||||
|
request({
|
||||||
|
url: '/qms/business-sub-sample/execChangeLocation',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
}),
|
||||||
|
// 样品调拨申请列表
|
||||||
|
querySampleDispatchApply: params =>
|
||||||
|
request({
|
||||||
|
url: '/qms/business-sample-dispatch/page',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
|
// 调拨申请明细列表
|
||||||
|
querySampleDispatchApplyDetail: params =>
|
||||||
|
request({
|
||||||
|
url: '/qms/business-sample-dispatch-detail/page',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
|
// 调拨执行
|
||||||
|
execSampleDispatch: data =>
|
||||||
|
request({
|
||||||
|
url: '/qms/business-sample-dispatch/execDispatch',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
}),
|
||||||
|
// 查询待归还样品
|
||||||
|
searchBySampleCode: params =>
|
||||||
|
request({
|
||||||
|
url: 'qms/business-sample-dispatch-detail/searchBySampleCode',
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}),
|
||||||
|
//调拨归还执行
|
||||||
|
execGiveback: data =>
|
||||||
|
request({
|
||||||
|
url: '/qms/business-sample-dispatch/execGiveback',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
}),
|
||||||
|
// 样品下架
|
||||||
|
execTakeOff: data =>
|
||||||
|
request({
|
||||||
|
url: 'qms/business-sub-sample/execTakeOff',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,50 +8,55 @@ export { math }
|
|||||||
/*
|
/*
|
||||||
* 计算当前样品分析值*/
|
* 计算当前样品分析值*/
|
||||||
export function calcAnalysisValue(group) {
|
export function calcAnalysisValue(group) {
|
||||||
try {
|
const MAX_ITERATIONS = 5 // 防止无限循环
|
||||||
for (const g of group) {
|
let iterations = 0
|
||||||
for (const ele of g.fields) {
|
let changed = true
|
||||||
if (!ele.formula || ele.formula == '' || ele.formula.startsWith('From')) continue
|
while (changed && iterations < MAX_ITERATIONS) {
|
||||||
let formula = ele.formula
|
changed = false
|
||||||
let formulas = formula.split('|')
|
iterations++
|
||||||
let formulaVal = ''
|
try {
|
||||||
let hasNullVal = false
|
for (const g of group) {
|
||||||
formulas.forEach(f => {
|
for (const ele of g.fields) {
|
||||||
let value = ''
|
if (!ele.formula || ele.formula == '' || ele.formula.startsWith('From')) continue
|
||||||
if (f.charAt(0) === 'p') {
|
let formula = ele.formula
|
||||||
let o = findFieldInGroup(f, group, 'p')
|
let formulas = formula.split('|')
|
||||||
value = o.value
|
let formulaVal = ''
|
||||||
} else if (f.charAt(0) === 'e') {
|
console.log(formulas)
|
||||||
let o = findFieldInGroup(f, group, 'e')
|
formulas.forEach(f => {
|
||||||
value = o.value
|
let value = ''
|
||||||
} else if (f.charAt(0) === '<' || f.charAt(0) === '>') {
|
if (f.charAt(0) === 'p') {
|
||||||
value = "'" + f + "'"
|
let o = findFieldInGroup(f, group, 'p')
|
||||||
|
value = o.value || 0
|
||||||
|
} else if (f.charAt(0) === 'e') {
|
||||||
|
let o = findFieldInGroup(f, group, 'e')
|
||||||
|
value = o.value || 0
|
||||||
|
} else if (f.charAt(0) === '<' || f.charAt(0) === '>') {
|
||||||
|
value = "'" + f + "'"
|
||||||
|
} else {
|
||||||
|
value = f
|
||||||
|
}
|
||||||
|
|
||||||
|
formulaVal += value
|
||||||
|
})
|
||||||
|
console.log(formulaVal)
|
||||||
|
|
||||||
|
let v
|
||||||
|
if (formulaVal.startsWith('Get')) {
|
||||||
|
//计算公式为Get开头的,都是执行方法
|
||||||
|
v = eval(formulaVal)
|
||||||
} else {
|
} else {
|
||||||
value = f
|
v = math.evaluate(formulaVal).toString()
|
||||||
|
v = isFinite(v) ? v.toString() : 0
|
||||||
}
|
}
|
||||||
if (typeof value == 'undefined' || value == null) {
|
console.log(v)
|
||||||
hasNullVal = true
|
|
||||||
return true
|
ele.value = handleRoundFiveNumber(v, ele.decimalPosition)
|
||||||
}
|
changed = true
|
||||||
formulaVal += value
|
|
||||||
})
|
|
||||||
if (hasNullVal) {
|
|
||||||
ele.value = null
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
let v
|
|
||||||
if (formulaVal.startsWith('Get')) {
|
|
||||||
//计算公式为Get开头的,都是执行方法
|
|
||||||
v = eval(formulaVal)
|
|
||||||
} else {
|
|
||||||
v = math.evaluate(formulaVal).toString()
|
|
||||||
v = isFinite(v) ? v.toString() : 0
|
|
||||||
}
|
|
||||||
ele.value = handleRoundFiveNumber(v, ele.decimalPosition)
|
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +74,7 @@ export function calcRowAnalysisValue(row, columnObj, dynamicsColumns) {
|
|||||||
let formulaVal = ''
|
let formulaVal = ''
|
||||||
formulas.forEach(f => {
|
formulas.forEach(f => {
|
||||||
if (f.charAt(0) === 'p') {
|
if (f.charAt(0) === 'p') {
|
||||||
let o = dynamicsColumns.find(i => 'p' + i.paramNo === f)
|
let o = dynamicsColumns.find(i => 'p' + i.paramNo === f && i.type !== 'project')
|
||||||
formulaVal += row[o.fieldIndex]?.value ? row[o.fieldIndex].value : 0
|
formulaVal += row[o.fieldIndex]?.value ? row[o.fieldIndex].value : 0
|
||||||
} else if (f.charAt(0) === 'e') {
|
} else if (f.charAt(0) === 'e') {
|
||||||
let o = dynamicsColumns.find(i => 'e' + i.paramNo === f)
|
let o = dynamicsColumns.find(i => 'e' + i.paramNo === f)
|
||||||
@@ -95,6 +100,7 @@ export function calcRowAnalysisValue(row, columnObj, dynamicsColumns) {
|
|||||||
const findFieldInGroup = function (paramNo, group, p) {
|
const findFieldInGroup = function (paramNo, group, p) {
|
||||||
for (const g of group) {
|
for (const g of group) {
|
||||||
for (const f of g.fields) {
|
for (const f of g.fields) {
|
||||||
|
if (p === 'p' && f.type == 'project') continue
|
||||||
if (p + f.paramNo === paramNo) {
|
if (p + f.paramNo === paramNo) {
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -731,6 +731,17 @@ function reviver(key, value) {
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isJsonString(str) {
|
||||||
|
if (typeof str !== 'string') return false
|
||||||
|
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(str)
|
||||||
|
return typeof parsed === 'object' && parsed !== null
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
range,
|
range,
|
||||||
getPx,
|
getPx,
|
||||||
@@ -765,5 +776,6 @@ export default {
|
|||||||
showToast,
|
showToast,
|
||||||
uuid,
|
uuid,
|
||||||
replacer,
|
replacer,
|
||||||
reviver
|
reviver,
|
||||||
|
isJsonString
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ page {
|
|||||||
.white{
|
.white{
|
||||||
color:#fff ;
|
color:#fff ;
|
||||||
}
|
}
|
||||||
|
.black{
|
||||||
|
color:#000 ;
|
||||||
|
}
|
||||||
.bg-w{
|
.bg-w{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
@@ -173,5 +176,5 @@ page {
|
|||||||
font-weight:bold
|
font-weight:bold
|
||||||
}
|
}
|
||||||
.border-b{
|
.border-b{
|
||||||
border-bottom: 2px solid rgba(#707070,0.11);
|
border-bottom: 1px solid #dadbde;
|
||||||
}
|
}
|
||||||
@@ -6,12 +6,10 @@ const biz = defineStore({
|
|||||||
state: () => ({
|
state: () => ({
|
||||||
deviceInfo: {},
|
deviceInfo: {},
|
||||||
scanQRInfo: null,
|
scanQRInfo: null,
|
||||||
|
flagInfo: {}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
actions: {
|
actions: {}
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export default biz
|
export default biz
|
||||||
|
|||||||
35
pages.json
@@ -260,6 +260,41 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/sampleWarehouse/sampleDispatchExternal/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "外部调拨",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/sampleWarehouse/sampleDispatchExternal/detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "调拨详情",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/sampleWarehouse/sampleDispatchInternal/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "内部调拨",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/sampleWarehouse/dispatchGiveBack/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "调拨归还",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/sampleWarehouse/sampleTakeOff/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "样品下架",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/setting/SelectBaseData",
|
"path": "pages/setting/SelectBaseData",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -33,17 +33,17 @@ const popupShow = ref(false)
|
|||||||
const menuItemList = ref([
|
const menuItemList = ref([
|
||||||
{
|
{
|
||||||
url: '/pages/analysis/sample/sample-work-list',
|
url: '/pages/analysis/sample/sample-work-list',
|
||||||
otherConf: { icon: '/static/images/menus/sampleAnalysis.png' },
|
otherConf: { icon: '/static/images/menus/样品分析.png' },
|
||||||
name: '样品分析'
|
name: '样品分析'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: '/pages/analysis/sample/sample-report-search',
|
url: '/pages/analysis/sample/sample-report-search',
|
||||||
otherConf: { icon: '/static/images/menus/records.png' },
|
otherConf: { icon: '/static/images/menus/记录.png' },
|
||||||
name: '分析记录'
|
name: '分析记录'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: '/pages/analysis/auncel/auncel-status',
|
url: '/pages/analysis/auncel/auncel-status',
|
||||||
otherConf: { icon: '/static/images/menus/balance.png' },
|
otherConf: { icon: '/static/images/menus/天平查看.png' },
|
||||||
name: '天平查看'
|
name: '天平查看'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -366,6 +366,7 @@ const parameterClassifyChange = v => {
|
|||||||
|
|
||||||
const fieldClick = (field, key) => {
|
const fieldClick = (field, key) => {
|
||||||
if (!field.isEdit) return
|
if (!field.isEdit) return
|
||||||
|
currentFillingIndex.value = 0
|
||||||
if (currentFillingWay.value === 'input') {
|
if (currentFillingWay.value === 'input') {
|
||||||
inputValue.value = field.value
|
inputValue.value = field.value
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import { reactive, ref, computed, onMounted } from 'vue'
|
|||||||
import nx from '@/nx'
|
import nx from '@/nx'
|
||||||
import { useGridCol } from '@/nx/hooks/useGridCol'
|
import { useGridCol } from '@/nx/hooks/useGridCol'
|
||||||
let list = reactive([
|
let list = reactive([
|
||||||
{ url: '/pages/lims/index/index', name: '设备管理', icon: 'device' },
|
{ url: '/pages/lims/index/index', name: '设备管理', icon: '设备管理' },
|
||||||
{ url: '/pages/analysis/index/index', name: '分析管理', icon: 'analyse' },
|
{ url: '/pages/analysis/index/index', name: '分析管理', icon: '分析管理' },
|
||||||
{ url: '/pages/sampleWarehouse/index/index', name: '样品库管理', icon: 'sampleWarehouse' }
|
{ url: '/pages/sampleWarehouse/index/index', name: '样品库管理', icon: '样品库管理' }
|
||||||
])
|
])
|
||||||
|
|
||||||
// const sysMenus = computed(() => nx.$store('user').sysMenus)
|
// const sysMenus = computed(() => nx.$store('user').sysMenus)
|
||||||
|
|||||||
7
pages/sampleWarehouse/dispatchGiveBack/index.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<view> </view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup></script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -1,19 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="p8">
|
<view class="p8">
|
||||||
<navbar-back title="库位变更"></navbar-back>
|
<navbar-back title="库位变更"></navbar-back>
|
||||||
<uni-section type="line" title="库位信息修改"> </uni-section>
|
<uni-section type="line" title="库位信息修改" titleFontSize="15px"> </uni-section>
|
||||||
<up-input
|
<up-radio-group v-model="changeType" size="20px" @change="handleChangeType">
|
||||||
v-model="locationCode"
|
|
||||||
placeholder="请扫描库位编码"
|
|
||||||
prefixIcon="scan"
|
|
||||||
fontSize="16"
|
|
||||||
prefixIconStyle="font-size: 30px;"
|
|
||||||
>
|
|
||||||
</up-input>
|
|
||||||
|
|
||||||
<up-radio-group v-model="changeType">
|
|
||||||
<up-radio
|
<up-radio
|
||||||
:customStyle="{ marginBottom: '8px' }"
|
:customStyle="{ marginLeft: '8px' }"
|
||||||
v-for="(item, index) in changeTypeOptions"
|
v-for="(item, index) in changeTypeOptions"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
@@ -22,30 +13,56 @@
|
|||||||
</up-radio>
|
</up-radio>
|
||||||
</up-radio-group>
|
</up-radio-group>
|
||||||
<up-input
|
<up-input
|
||||||
v-model="sampleCode"
|
v-model="changeCode"
|
||||||
:placeholder="`请扫描${changeType == 'sample' ? '样品编号' : '库位编码'}`"
|
:placeholder="`请扫描${changeType == 'sample' ? '样品编号' : '(原)库位码'}`"
|
||||||
|
prefixIcon="scan"
|
||||||
|
fontSize="16"
|
||||||
|
prefixIconStyle="font-size: 30px;"
|
||||||
|
@confirm="getSampleList()"
|
||||||
|
>
|
||||||
|
</up-input>
|
||||||
|
<up-input
|
||||||
|
v-if="changeCode !== '' && sampleList.length > 0"
|
||||||
|
class="mt20"
|
||||||
|
v-model="targetLocation"
|
||||||
|
placeholder="请扫描变更后库位码"
|
||||||
prefixIcon="scan"
|
prefixIcon="scan"
|
||||||
fontSize="16"
|
fontSize="16"
|
||||||
prefixIconStyle="font-size: 30px;"
|
prefixIconStyle="font-size: 30px;"
|
||||||
>
|
>
|
||||||
</up-input>
|
</up-input>
|
||||||
<uni-section type="line" title="样品及当前归库信息">
|
|
||||||
<uni-card>
|
<uni-section v-if="sampleList.length > 0" type="line" title="样品及当前归库信息" titleFontSize="15px">
|
||||||
<view
|
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
|
||||||
>样品名称:<text>{{ sampleData.sampleName }}</text></view
|
<scroll-view style="height: 43vh" scroll-y scroll-with-animation>
|
||||||
>
|
<uni-card v-for="item in sampleList">
|
||||||
<view class="mt4"
|
<view
|
||||||
>样品库名称:<text>{{ sampleData.sampleCode }}</text></view
|
>样品名称:<text>{{ item.sampleName }}</text></view
|
||||||
>
|
>
|
||||||
<view class="mt4"
|
<view class="mt4"
|
||||||
>归库编码:<text>{{ sampleData.sampleCode }}</text></view
|
>归库编码:<text>{{ item.sampleReturnCode }}</text></view
|
||||||
>
|
>
|
||||||
<view class="mt4"
|
<view class="mt4"
|
||||||
>(原)库位编码:<text>{{ sampleData.sampleCode }}</text></view
|
>归库时间:<text>{{ nx.$dayjs(item.returnTime).format('YYYY-MM-DD HH:mm:ss') }}</text></view
|
||||||
>
|
>
|
||||||
</uni-card>
|
<view class="mt4"
|
||||||
|
>样品库名称:<text>{{ item.warehouseName }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>(原)库位码:<text>{{ item.warehouseLocationCode }}</text></view
|
||||||
|
>
|
||||||
|
</uni-card>
|
||||||
|
</scroll-view>
|
||||||
</uni-section>
|
</uni-section>
|
||||||
<up-button class="mt20" type="primary" style="width: 50%" text="提交" @click="handleReset"></up-button>
|
<up-button
|
||||||
|
v-if="targetLocation"
|
||||||
|
:loading="btnLoading"
|
||||||
|
class="mt20"
|
||||||
|
type="primary"
|
||||||
|
style="width: 50%"
|
||||||
|
text="提交"
|
||||||
|
@click="handleSubmit"
|
||||||
|
></up-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -61,87 +78,122 @@ const changeTypeOptions = reactive([
|
|||||||
label: '按样品变更'
|
label: '按样品变更'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'location',
|
name: 'warehouseLocation',
|
||||||
label: '按库位变更'
|
label: '按库位变更'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
function isJsonString(str) {
|
let targetLocation = ref('')
|
||||||
if (typeof str !== 'string') return false
|
let changeCode = ref('')
|
||||||
|
let sampleList = ref([])
|
||||||
|
|
||||||
try {
|
watch(changeCode, newVal => {
|
||||||
const parsed = JSON.parse(str)
|
if (newVal === '') {
|
||||||
return typeof parsed === 'object' && parsed !== null
|
sampleList.value = []
|
||||||
} catch (e) {
|
targetLocation.value = ''
|
||||||
return false
|
isFirstInput.value = true
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
|
||||||
watch(scanQRInfo, newVal => {
|
|
||||||
if (newVal && nx.$router.getCurrentPage().route == 'pages/sampleWarehouse/returnToStock/index') {
|
|
||||||
try {
|
|
||||||
if (!isJsonString(newVal)) {
|
|
||||||
if (!locationCode.value) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请先扫描库位码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
scanQRInfo.value = ''
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
if (changeType.value == 'sample') {
|
|
||||||
sampleCode.value = newVal
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
// 执行
|
|
||||||
// handleReturnToStock()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const codeObj = JSON.parse(newVal)
|
|
||||||
locationCode.value = codeObj.code
|
|
||||||
}
|
|
||||||
scanQRInfo.value = ''
|
|
||||||
} catch (error) {
|
|
||||||
scanQRInfo.value = ''
|
|
||||||
uni.showToast({
|
|
||||||
title: '请扫描样品编码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
async function getSampleList() {
|
||||||
|
if (changeCode.value === '') return
|
||||||
|
let params = { pageSize: 999, pageNo: 1, returnStatus: 'completed' }
|
||||||
|
if (changeType.value === 'sample') {
|
||||||
|
params.sampleReturnCode = changeCode.value
|
||||||
|
} else {
|
||||||
|
params.warehouseLocationCode = changeCode.value
|
||||||
|
}
|
||||||
|
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample(params)
|
||||||
|
sampleList.value = list
|
||||||
|
if (list.length === 0) {
|
||||||
|
uni.showToast({ title: '未查询到该样品信息', icon: 'none' })
|
||||||
|
isFirstInput.value = true
|
||||||
|
} else {
|
||||||
|
isFirstInput.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const btnLoading = ref(false)
|
||||||
|
async function handleSubmit() {
|
||||||
|
let params = {
|
||||||
|
actionWay: changeType.value,
|
||||||
|
targetLocation: targetLocation.value
|
||||||
|
}
|
||||||
|
if (changeType.value === 'sample') {
|
||||||
|
params.sampleReturnCode = changeCode.value
|
||||||
|
} else {
|
||||||
|
params.warehouseLocationCode = changeCode.value
|
||||||
|
}
|
||||||
|
btnLoading.value = true
|
||||||
|
await nx.$api.sampleWarehouse.execChangeLocation(params).finally(() => {
|
||||||
|
btnLoading.value = false
|
||||||
|
})
|
||||||
|
uni.showToast({ title: '变更成功', icon: 'none' })
|
||||||
|
handleReset()
|
||||||
|
}
|
||||||
|
function handleChangeType(e) {
|
||||||
|
handleReset()
|
||||||
|
}
|
||||||
|
let isFirstInput = ref(true)
|
||||||
|
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||||
|
watch(scanQRInfo, newVal => {
|
||||||
|
if (!newVal) return
|
||||||
|
scanQRInfo.value = ''
|
||||||
|
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/execChangeLocation/index') return
|
||||||
|
try {
|
||||||
|
console.log(newVal)
|
||||||
|
|
||||||
|
const isJson = nx.$helper.isJsonString(newVal)
|
||||||
|
console.log(isJson)
|
||||||
|
|
||||||
|
if (isFirstInput.value) {
|
||||||
|
handleFirstScan(newVal, isJson)
|
||||||
|
} else {
|
||||||
|
handleSecondScan(newVal, isJson)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({ title: '扫码内容解析失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
function handleFirstScan(rawValue, isJson) {
|
||||||
|
if (changeType.value === 'sample') {
|
||||||
|
// 按样品变更:首扫应为纯字符串(样品编号)
|
||||||
|
if (isJson) {
|
||||||
|
isFirstInput.value = true
|
||||||
|
uni.showToast({ title: '请先扫描样品编号', icon: 'none' })
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
changeCode.value = rawValue
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 按库位变更:首扫应为 JSON(原库位码)
|
||||||
|
if (!isJson) {
|
||||||
|
isFirstInput.value = true
|
||||||
|
uni.showToast({ title: '请先扫描(原)库位码', icon: 'none' })
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
const codeObj = JSON.parse(rawValue)
|
||||||
|
changeCode.value = codeObj.code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getSampleList()
|
||||||
|
}
|
||||||
|
function handleSecondScan(rawValue, isJson) {
|
||||||
|
// 第二次扫描必须是 JSON(目标库位码)
|
||||||
|
if (!isJson) {
|
||||||
|
uni.showToast({ title: '请扫描变更后库位码', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const codeObj = JSON.parse(rawValue)
|
||||||
|
targetLocation.value = codeObj.code
|
||||||
|
}
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
scanQRInfo.value = ''
|
scanQRInfo.value = ''
|
||||||
})
|
})
|
||||||
let needPrint = ref(false)
|
|
||||||
|
|
||||||
let locationCode = ref('')
|
|
||||||
let sampleCode = ref('')
|
|
||||||
|
|
||||||
function handleReturnToStock() {
|
|
||||||
nx.$api.sampleWarehouse
|
|
||||||
.execReturnToStock({
|
|
||||||
warehouseLocationCode: locationCode.value,
|
|
||||||
sampleCode: sampleCode.value
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
successCount.value++
|
|
||||||
if (res.print) {
|
|
||||||
uni.showToast({
|
|
||||||
title: `归库成功,归库码为【${res.code}】`,
|
|
||||||
duration: 3000,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
// 执行打印
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const successCount = ref(2)
|
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
locationCode.value = ''
|
targetLocation.value = ''
|
||||||
sampleCode.value = ''
|
changeCode.value = ''
|
||||||
successCount.value = 0
|
sampleList.value = []
|
||||||
|
btnLoading.value = false
|
||||||
|
isFirstInput.value = true
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -34,18 +34,38 @@ const popupShow = ref(false)
|
|||||||
const menuItemList = ref([
|
const menuItemList = ref([
|
||||||
{
|
{
|
||||||
url: '/pages/sampleWarehouse/sampleSearch/index',
|
url: '/pages/sampleWarehouse/sampleSearch/index',
|
||||||
otherConf: { icon: '/static/images/menus/records.png' },
|
otherConf: { icon: '/static/images/menus/记录.png' },
|
||||||
name: '样品查询'
|
name: '样品查询'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: '/pages/sampleWarehouse/returnToStock/index',
|
url: '/pages/sampleWarehouse/returnToStock/index',
|
||||||
otherConf: { icon: '/static/images/menus/returnToStock.png' },
|
otherConf: { icon: '/static/images/menus/样品归库.png' },
|
||||||
name: '样品归库'
|
name: '样品归库'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: '/pages/sampleWarehouse/execChangeLocation/index',
|
url: '/pages/sampleWarehouse/execChangeLocation/index',
|
||||||
otherConf: { icon: '/static/images/menus/execChangeLocation.png' },
|
otherConf: { icon: '/static/images/menus/库位变更.png' },
|
||||||
name: '库位变更'
|
name: '库位变更'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: '/pages/sampleWarehouse/sampleDispatchInternal/index',
|
||||||
|
otherConf: { icon: '/static/images/menus/内部调拨.png' },
|
||||||
|
name: '内部调拨'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: '/pages/sampleWarehouse/sampleDispatchExternal/index',
|
||||||
|
otherConf: { icon: '/static/images/menus/外部调拨.png' },
|
||||||
|
name: '外部调拨'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: '/pages/sampleWarehouse/dispatchGiveBack/index',
|
||||||
|
otherConf: { icon: '/static/images/menus/调拨归还.png' },
|
||||||
|
name: '调拨归还'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: '/pages/sampleWarehouse/sampleTakeOff/index',
|
||||||
|
otherConf: { icon: '/static/images/menus/样品下架.png' },
|
||||||
|
name: '样品下架'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -56,26 +76,26 @@ const userInfo = computed(() => nx.$store('user').userInfo)
|
|||||||
const goTo = url => {
|
const goTo = url => {
|
||||||
nx.$router.go(url)
|
nx.$router.go(url)
|
||||||
}
|
}
|
||||||
onShow(() => {
|
// onShow(() => {
|
||||||
//连接打印服务
|
// //连接打印服务
|
||||||
let printList = uni.getStorageSync('KEY_PRINT_LIST')
|
// let printList = uni.getStorageSync('KEY_PRINT_LIST')
|
||||||
if (printList && printList.length > 0) {
|
// if (printList && printList.length > 0) {
|
||||||
for (let print of printList) {
|
// for (let print of printList) {
|
||||||
nx.$print.open(print.printIp, print.printPort)
|
// nx.$print.open(print.printIp, print.printPort)
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
title: '提示',
|
// title: '提示',
|
||||||
showCancel: false,
|
// showCancel: false,
|
||||||
content: '打印服务未配置,请在系统设置中配置打印服务',
|
// content: '打印服务未配置,请在系统设置中配置打印服务',
|
||||||
success: function (res) {
|
// success: function (res) {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: '/pages/setting/print'
|
// url: '/pages/setting/print'
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
// 生命周期
|
// 生命周期
|
||||||
onMounted(() => {})
|
onMounted(() => {})
|
||||||
// 动态设置 grid 列数
|
// 动态设置 grid 列数
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="p8">
|
<view class="p8">
|
||||||
<navbar-back title="样品归库"></navbar-back>
|
<navbar-back title="样品归库"></navbar-back>
|
||||||
<uni-section type="line" title="库位编码"> </uni-section>
|
<uni-section type="line" title="库位编码" titleFontSize="15px"> </uni-section>
|
||||||
<up-input
|
<up-input
|
||||||
v-model="locationCode"
|
v-model="locationCode"
|
||||||
placeholder="请扫描库位编码"
|
placeholder="请扫描库位编码"
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
prefixIconStyle="font-size: 30px;"
|
prefixIconStyle="font-size: 30px;"
|
||||||
>
|
>
|
||||||
</up-input>
|
</up-input>
|
||||||
<uni-section type="line" title="样品编号"> </uni-section>
|
<uni-section type="line" title="样品编号" titleFontSize="15px"> </uni-section>
|
||||||
<up-input
|
<up-input
|
||||||
v-model="sampleCode"
|
v-model="sampleCode"
|
||||||
placeholder="请扫描样品编号"
|
placeholder="请扫描样品编号"
|
||||||
@@ -31,46 +31,30 @@ import { ref, reactive, computed, onMounted, toRefs, watch } from 'vue'
|
|||||||
import { onShow } from '@dcloudio/uni-app'
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
import nx from '@/nx'
|
import nx from '@/nx'
|
||||||
|
|
||||||
function isJsonString(str) {
|
|
||||||
if (typeof str !== 'string') return false
|
|
||||||
|
|
||||||
try {
|
|
||||||
const parsed = JSON.parse(str)
|
|
||||||
return typeof parsed === 'object' && parsed !== null
|
|
||||||
} catch (e) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||||
watch(scanQRInfo, newVal => {
|
watch(scanQRInfo, newVal => {
|
||||||
if (newVal && nx.$router.getCurrentPage().route == 'pages/sampleWarehouse/returnToStock/index') {
|
if (!newVal) return
|
||||||
try {
|
scanQRInfo.value = ''
|
||||||
if (!isJsonString(newVal)) {
|
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/returnToStock/index') return
|
||||||
if (!locationCode.value) {
|
try {
|
||||||
uni.showToast({
|
if (nx.$helper.isJsonString(newVal)) {
|
||||||
title: '请先扫描库位码',
|
const codeObj = JSON.parse(newVal)
|
||||||
icon: 'none'
|
locationCode.value = codeObj.code
|
||||||
})
|
} else {
|
||||||
scanQRInfo.value = ''
|
if (!locationCode.value) {
|
||||||
return
|
uni.showToast({
|
||||||
} else {
|
title: '请先扫描库位码',
|
||||||
sampleCode.value = newVal
|
icon: 'none'
|
||||||
// 执行归库
|
})
|
||||||
handleReturnToStock()
|
return
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
const codeObj = JSON.parse(newVal)
|
sampleCode.value = newVal
|
||||||
locationCode.value = codeObj.code
|
// 执行归库
|
||||||
|
handleReturnToStock()
|
||||||
}
|
}
|
||||||
scanQRInfo.value = ''
|
|
||||||
} catch (error) {
|
|
||||||
scanQRInfo.value = ''
|
|
||||||
uni.showToast({
|
|
||||||
title: '请扫描样品编码',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({ title: '扫码内容解析失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@@ -100,7 +84,7 @@ function handleReturnToStock() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const successCount = ref(2)
|
const successCount = ref(0)
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
locationCode.value = ''
|
locationCode.value = ''
|
||||||
sampleCode.value = ''
|
sampleCode.value = ''
|
||||||
|
|||||||
131
pages/sampleWarehouse/sampleDispatchExternal/detail.vue
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
<template>
|
||||||
|
<navbar-back title="样品调拨"></navbar-back>
|
||||||
|
<view class="pl8 pr8">
|
||||||
|
<view class="border-b p6 x-f"
|
||||||
|
><view class="pr16">申请人:</view><text>{{ applyData.applyUser }}</text></view
|
||||||
|
>
|
||||||
|
<view class="border-b p6"
|
||||||
|
><text>申请时间:</text><text>{{ nx.$dayjs(applyData.applyTime).format('YYYY-MM-DD HH:mm:ss') }}</text></view
|
||||||
|
>
|
||||||
|
<view class="border-b p6"
|
||||||
|
><text>申请事由:</text><text>{{ applyData.applyContent }}</text></view
|
||||||
|
>
|
||||||
|
<up-input
|
||||||
|
style="padding-top: 20px"
|
||||||
|
border="bottom"
|
||||||
|
v-model="sampleCode"
|
||||||
|
placeholder="请扫描样品编号来确认样品"
|
||||||
|
prefixIcon="scan"
|
||||||
|
fontSize="16"
|
||||||
|
prefixIconStyle="font-size: 30px;"
|
||||||
|
>
|
||||||
|
</up-input>
|
||||||
|
|
||||||
|
<uni-section type="line" title="申请调拨样品明细" titleFontSize="15px">
|
||||||
|
<scroll-view style="height: 49vh" scroll-y scroll-with-animation>
|
||||||
|
<up-checkbox-group v-model="checkedSampleCodes" placement="column">
|
||||||
|
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">
|
||||||
|
<view
|
||||||
|
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>归库编码:<text class="black">{{ item.sampleReturnCode }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>样品库名称:<text class="black">{{ item.warehouseName }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>库位码:<text class="black">{{ item.warehouseLocationCode }}</text></view
|
||||||
|
>
|
||||||
|
<up-checkbox class="item-checkbox" :name="item.sampleReturnCode"> </up-checkbox>
|
||||||
|
</uni-card>
|
||||||
|
</up-checkbox-group>
|
||||||
|
</scroll-view>
|
||||||
|
<up-button
|
||||||
|
type="primary"
|
||||||
|
:disabled="checkedSampleCodes.length !== sampleList.length"
|
||||||
|
style="width: 50%"
|
||||||
|
text="提交"
|
||||||
|
@click="handleSubmit"
|
||||||
|
></up-button>
|
||||||
|
</uni-section>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref, toRefs, watch } from 'vue'
|
||||||
|
import nx from '@/nx'
|
||||||
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
|
let sampleCode = ref('')
|
||||||
|
let applyData = ref({ applyUser: '张三', applyTime: '2021-01-01 10:10:10', applyContent: '测试' })
|
||||||
|
let sampleList = ref([])
|
||||||
|
async function getDetailList() {
|
||||||
|
const { list } = await nx.$api.sampleWarehouse.querySampleDispatchApplyDetail({
|
||||||
|
parentId: applyData.value.id,
|
||||||
|
pageSize: 999
|
||||||
|
})
|
||||||
|
sampleList.value = list
|
||||||
|
}
|
||||||
|
let checkedSampleCodes = ref([])
|
||||||
|
|
||||||
|
const { flagInfo, scanQRInfo } = toRefs(nx.$store('biz'))
|
||||||
|
onLoad(async options => {
|
||||||
|
applyData.value = flagInfo
|
||||||
|
getDetailList()
|
||||||
|
})
|
||||||
|
watch(scanQRInfo, newVal => {
|
||||||
|
if (!newVal) return
|
||||||
|
scanQRInfo.value = ''
|
||||||
|
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/sampleDispatchExternal/detail') return
|
||||||
|
try {
|
||||||
|
sampleCode.value = newVal
|
||||||
|
if (
|
||||||
|
sampleCode.value === sampleList.value.find(item => item.sampleReturnCode === sampleCode.value)?.sampleReturnCode
|
||||||
|
) {
|
||||||
|
if (!checkedSampleCodes.value.includes(sampleCode.value)) {
|
||||||
|
checkedSampleCodes.value.push(sampleCode.value)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请勿重复扫描',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '该样品不在申请范围内',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请扫描正确的样品编码',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
onShow(() => {
|
||||||
|
scanQRInfo.value = ''
|
||||||
|
})
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
await nx.$api.sampleWarehouse.execSampleDispatch({ id: applyData.value.id })
|
||||||
|
uni.showToast({
|
||||||
|
title: '调拨成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.sample-item {
|
||||||
|
position: relative;
|
||||||
|
pointer-events: none;
|
||||||
|
.item-checkbox {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
80
pages/sampleWarehouse/sampleDispatchExternal/index.vue
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<navbar-back title="样品调拨"></navbar-back>
|
||||||
|
<view class="p8">
|
||||||
|
<up-subsection
|
||||||
|
activeColor="#0055A2"
|
||||||
|
mode="subsection"
|
||||||
|
:list="list"
|
||||||
|
:current="current"
|
||||||
|
@change="changeTab"
|
||||||
|
></up-subsection>
|
||||||
|
<scroll-view style="height: 82vh" scroll-y scroll-with-animation @scrolltolower="handleScrolltolower">
|
||||||
|
<view class="data-item" v-for="(item, index) in listData" @click="handleDetail(item)">
|
||||||
|
<view
|
||||||
|
>申请人:<text>{{ item.applyUser }}</text></view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
>申请时间:<text>{{ nx.$dayjs(item.applyTime).format('YYYY-MM-DD HH:mm:ss') }}</text></view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
>申请事由:<text>{{ item.applyContent }}</text></view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<up-loadmore v-if="listData.length > 0" :status="loadStatus" />
|
||||||
|
<up-empty v-else mode="data" text="暂无数据" marginTop="50"> </up-empty>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
import { useListData } from '@/nx/hooks/usePageListData'
|
||||||
|
import nx from '@/nx'
|
||||||
|
|
||||||
|
const list = ref(['待处理', '已处理'])
|
||||||
|
|
||||||
|
let dataList = ref([])
|
||||||
|
const current = ref(0)
|
||||||
|
|
||||||
|
function changeTab(index) {
|
||||||
|
current.value = index
|
||||||
|
getInitData()
|
||||||
|
}
|
||||||
|
const searchParams = computed(() => {
|
||||||
|
if (current.value === 0) {
|
||||||
|
return {
|
||||||
|
finishStatus: 'pending'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
finishStatus: 'completed'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const { listData, scrollToLower, loadStatus, getInitData } = useListData({
|
||||||
|
searchParams,
|
||||||
|
api: nx.$api.sampleWarehouse.querySampleDispatchApply,
|
||||||
|
needInitListData: true
|
||||||
|
})
|
||||||
|
|
||||||
|
function handleScrolltolower() {
|
||||||
|
scrollToLower()
|
||||||
|
}
|
||||||
|
function handleDetail(item) {
|
||||||
|
nx.$store('biz').flagInfo = item
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/sampleWarehouse/sampleDispatchExternal/detail'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.data-item {
|
||||||
|
padding: 8px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
color: #909399;
|
||||||
|
text {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
90
pages/sampleWarehouse/sampleDispatchInternal/index.vue
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<template>
|
||||||
|
<navbar-back title="样品调拨"></navbar-back>
|
||||||
|
<view class="pl8 pr8">
|
||||||
|
<view class="border-b p6 x-f"
|
||||||
|
><view class="pr16">库管员:</view><text>{{ userInfo.nickname }}</text></view
|
||||||
|
>
|
||||||
|
<up-input
|
||||||
|
style="padding-top: 20px"
|
||||||
|
border="bottom"
|
||||||
|
v-model="sampleCode"
|
||||||
|
placeholder="请扫描需要调拨的样品编号"
|
||||||
|
prefixIcon="scan"
|
||||||
|
fontSize="16"
|
||||||
|
prefixIconStyle="font-size: 30px;"
|
||||||
|
>
|
||||||
|
</up-input>
|
||||||
|
|
||||||
|
<uni-section v-if="sampleList.length > 0" type="line" title="调拨样品明细" titleFontSize="15px">
|
||||||
|
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
|
||||||
|
<scroll-view style="height: 49vh" scroll-y scroll-with-animation>
|
||||||
|
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">
|
||||||
|
<view
|
||||||
|
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>归库编码:<text class="black">{{ item.sampleReturnCode }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>样品库名称:<text class="black">{{ item.warehouseName }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>库位码:<text class="black">{{ item.warehouseLocationCode }}</text></view
|
||||||
|
>
|
||||||
|
</uni-card>
|
||||||
|
</scroll-view>
|
||||||
|
<up-button :disabled="!receiver" type="primary" style="width: 50%" text="提交" @click="handleSubmit"></up-button>
|
||||||
|
</uni-section>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref, toRefs, watch } from 'vue'
|
||||||
|
import nx from '@/nx'
|
||||||
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
|
let sampleCode = ref('')
|
||||||
|
let sampleList = ref([])
|
||||||
|
let receiver = ref('')
|
||||||
|
|
||||||
|
const userInfo = computed(() => nx.$store('user').userInfo)
|
||||||
|
|
||||||
|
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||||
|
watch(scanQRInfo, newVal => {
|
||||||
|
if (!newVal) return
|
||||||
|
scanQRInfo.value = ''
|
||||||
|
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/sampleDispatchExternal/detail') return
|
||||||
|
try {
|
||||||
|
sampleCode.value = newVal
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请扫描正确的样品编码',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
onShow(() => {
|
||||||
|
scanQRInfo.value = ''
|
||||||
|
})
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
await nx.$api.sampleWarehouse.execSampleDispatch({})
|
||||||
|
uni.showToast({
|
||||||
|
title: '调拨成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.sample-item {
|
||||||
|
position: relative;
|
||||||
|
pointer-events: none;
|
||||||
|
.item-checkbox {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
prefixIcon="scan"
|
prefixIcon="scan"
|
||||||
fontSize="16"
|
fontSize="16"
|
||||||
prefixIconStyle="font-size: 30px;"
|
prefixIconStyle="font-size: 30px;"
|
||||||
|
@confirm="handleSearch"
|
||||||
>
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<!-- <up-button type="primary" text="查询" icon="search"></up-button> -->
|
<!-- <up-button type="primary" text="查询" icon="search"></up-button> -->
|
||||||
@@ -14,31 +15,43 @@
|
|||||||
</template>
|
</template>
|
||||||
</up-input>
|
</up-input>
|
||||||
|
|
||||||
<uni-section type="line" title="样品详情">
|
<uni-section v-if="sampleData.id" type="line" title="样品详情" titleFontSize="15px">
|
||||||
<uni-card>
|
<uni-card>
|
||||||
<view>
|
<view>
|
||||||
<view class="x-bc">
|
<view class="x-bc">
|
||||||
<view
|
<view
|
||||||
>样品名称:<text>{{ sampleData.sampleName }}</text></view
|
>样品名称:<text>{{ sampleData.sampleName }}</text></view
|
||||||
>
|
>
|
||||||
<up-tag :text="sampleData.returnStatus_dictText"></up-tag>
|
<up-tag
|
||||||
|
plain
|
||||||
|
plainFill
|
||||||
|
size="mini"
|
||||||
|
:type="sampleData.returnStatus === 'completed' ? 'success' : 'info '"
|
||||||
|
:text="sampleData.returnStatus_dictText"
|
||||||
|
></up-tag>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
>样品编号:<text>{{ sampleData.sampleCode }}</text></view
|
>样品编号:<text>{{ sampleData.sampleCode }}</text></view
|
||||||
>
|
>
|
||||||
<view class="mt4"
|
<view class="mt4"
|
||||||
>归库编码:<text>{{ sampleData.sampleCode }}</text></view
|
>归库编码:<text>{{ sampleData.sampleReturnCode }}</text></view
|
||||||
>
|
>
|
||||||
<view class="mt4"
|
<view class="mt4"
|
||||||
>样品库名称:<text>{{ sampleData.sampleCode }}</text></view
|
>样品库名称:<text>{{ sampleData.warehouseName }}</text></view
|
||||||
>
|
>
|
||||||
<view class="mt4"
|
<view class="mt4"
|
||||||
>库位信息:<text>{{ sampleData.sampleCode }}</text></view
|
>库位信息:<text>{{ sampleData.warehouseLocationCode }}</text></view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
</uni-section>
|
</uni-section>
|
||||||
<up-button type="primary" style="width: 90%" text="打印归库标签" @click="handlePrint"></up-button>
|
<up-button
|
||||||
|
v-if="sampleData.id"
|
||||||
|
type="primary"
|
||||||
|
style="width: 90%"
|
||||||
|
text="打印归库标签"
|
||||||
|
@click="handlePrint"
|
||||||
|
></up-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -49,18 +62,17 @@ import nx from '@/nx'
|
|||||||
|
|
||||||
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||||
watch(scanQRInfo, newVal => {
|
watch(scanQRInfo, newVal => {
|
||||||
if (newVal && nx.$router.getCurrentPage().route == 'pages/sampleWarehouse/sampleSearch/index') {
|
if (!newVal) return
|
||||||
try {
|
scanQRInfo.value = ''
|
||||||
sampleCode.value = newVal
|
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/sampleSearch/index') return
|
||||||
handleSearch()
|
try {
|
||||||
scanQRInfo.value = ''
|
sampleCode.value = newVal
|
||||||
} catch (error) {
|
handleSearch()
|
||||||
scanQRInfo.value = ''
|
} catch (error) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请扫描样品编码',
|
title: '请扫描正确的样品编码',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@@ -73,7 +85,25 @@ function handleSearch() {
|
|||||||
|
|
||||||
let sampleData = ref({})
|
let sampleData = ref({})
|
||||||
async function getSampleDetail() {
|
async function getSampleDetail() {
|
||||||
sampleData.value = await nx.$api.sample.getSampleDetail({ sampleReturnCode: sampleCode.value })
|
sampleData.value = {}
|
||||||
|
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample({
|
||||||
|
sampleReturnCode: sampleCode.value,
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1
|
||||||
|
})
|
||||||
|
if (list.length == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未查询到该样品信息',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} else if (list.length > 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '查询出重复的样品编号,请联系管理员',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
sampleData.value = list[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function handlePrint() {}
|
function handlePrint() {}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
169
pages/sampleWarehouse/sampleTakeOff/index.vue
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<template>
|
||||||
|
<navbar-back title="样品下架"></navbar-back>
|
||||||
|
<view class="pl8 pr8">
|
||||||
|
<view class="border-b p8 x-f"
|
||||||
|
><view class="pr16">下架人:</view><text>{{ userInfo.nickname }}</text></view
|
||||||
|
>
|
||||||
|
<up-radio-group class="mt10" v-model="takeOffType" size="20px" @change="handleTakeOffType">
|
||||||
|
<up-radio
|
||||||
|
:customStyle="{ marginLeft: '8px' }"
|
||||||
|
v-for="(item, index) in takeOffTypeOptions"
|
||||||
|
:key="index"
|
||||||
|
:label="item.label"
|
||||||
|
:name="item.name"
|
||||||
|
>
|
||||||
|
</up-radio>
|
||||||
|
</up-radio-group>
|
||||||
|
<up-input
|
||||||
|
class="mt10"
|
||||||
|
v-model="targetCode"
|
||||||
|
placeholder="请扫描需要调拨的样品编号"
|
||||||
|
prefixIcon="scan"
|
||||||
|
fontSize="16"
|
||||||
|
prefixIconStyle="font-size: 30px;"
|
||||||
|
@confirm="getSampleList"
|
||||||
|
>
|
||||||
|
</up-input>
|
||||||
|
|
||||||
|
<uni-section v-if="sampleList.length > 0" type="line" title="调拨样品明细" titleFontSize="15px">
|
||||||
|
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
|
||||||
|
<scroll-view style="height: 49vh" scroll-y scroll-with-animation>
|
||||||
|
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">
|
||||||
|
<view
|
||||||
|
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>归库编码:<text class="black">{{ item.sampleReturnCode }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>样品库名称:<text class="black">{{ item.warehouseName }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt4"
|
||||||
|
>库位码:<text class="black">{{ item.warehouseLocationCode }}</text></view
|
||||||
|
>
|
||||||
|
</uni-card>
|
||||||
|
</scroll-view>
|
||||||
|
<up-button :loading="btnLoading" type="primary" style="width: 50%" text="提交" @click="handleSubmit"></up-button>
|
||||||
|
</uni-section>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref, toRefs, watch, reactive } from 'vue'
|
||||||
|
import nx from '@/nx'
|
||||||
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
|
const takeOffType = ref('sample')
|
||||||
|
const takeOffTypeOptions = reactive([
|
||||||
|
{
|
||||||
|
name: 'sample',
|
||||||
|
label: '按样品下架'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'warehouseLocation',
|
||||||
|
label: '按库位下架'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
function handleTakeOffType() {
|
||||||
|
handleReset()
|
||||||
|
}
|
||||||
|
let targetCode = ref('')
|
||||||
|
let sampleList = ref([])
|
||||||
|
const btnLoading = ref(false)
|
||||||
|
|
||||||
|
const userInfo = computed(() => nx.$store('user').userInfo)
|
||||||
|
|
||||||
|
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||||
|
watch(scanQRInfo, newVal => {
|
||||||
|
if (!newVal) return
|
||||||
|
scanQRInfo.value = ''
|
||||||
|
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/sampleTakeOff/index') return
|
||||||
|
try {
|
||||||
|
const isJson = nx.$helper.isJsonString(newVal)
|
||||||
|
const isSample = takeOffType.value === 'sample'
|
||||||
|
if (isJson) {
|
||||||
|
if (isSample) {
|
||||||
|
return uni.showToast({
|
||||||
|
title: '请扫描正确的样品编号',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const codeObj = JSON.parse(newVal)
|
||||||
|
targetCode.value = codeObj.code
|
||||||
|
} else {
|
||||||
|
if (isSample) {
|
||||||
|
targetCode.value = newVal
|
||||||
|
} else {
|
||||||
|
return uni.showToast({
|
||||||
|
title: '请扫描正确库位码',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getSampleList()
|
||||||
|
} catch (error) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '扫码内容解析失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
onShow(() => {
|
||||||
|
scanQRInfo.value = ''
|
||||||
|
})
|
||||||
|
|
||||||
|
async function getSampleList() {
|
||||||
|
if (targetCode.value === '') return
|
||||||
|
let params = { pageSize: 999, pageNo: 1, returnStatus: 'completed', dispatchStatus: '0' }
|
||||||
|
if (takeOffType.value === 'sample') {
|
||||||
|
params.sampleReturnCode = targetCode.value
|
||||||
|
} else {
|
||||||
|
params.warehouseLocationCode = targetCode.value
|
||||||
|
}
|
||||||
|
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample(params)
|
||||||
|
if (list.length === 0) {
|
||||||
|
return uni.showToast({ title: '未查询到该样品信息', icon: 'none' })
|
||||||
|
}
|
||||||
|
const existingCodes = new Set(sampleList.value.map(item => item.id)) // 假设唯一标识是 `code`
|
||||||
|
const newItems = list.filter(item => !existingCodes.has(item.id))
|
||||||
|
|
||||||
|
if (newItems.length === 0) {
|
||||||
|
return uni.showToast({ title: '该样品已存在,无需重复添加', icon: 'none' })
|
||||||
|
}
|
||||||
|
|
||||||
|
sampleList.value.push(...newItems)
|
||||||
|
}
|
||||||
|
async function handleSubmit() {
|
||||||
|
let params = { actionWay: takeOffType.value }
|
||||||
|
if (takeOffType.value === 'warehouseLocation') {
|
||||||
|
params.locationCode = targetCode.value
|
||||||
|
} else {
|
||||||
|
params.sampleCode = targetCode.value
|
||||||
|
}
|
||||||
|
btnLoading.value = true
|
||||||
|
await nx.$api.sampleWarehouse.execTakeOff(params).finally(() => {
|
||||||
|
btnLoading.value = false
|
||||||
|
})
|
||||||
|
uni.showToast({
|
||||||
|
title: '下架成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
handleReset()
|
||||||
|
}
|
||||||
|
function handleReset() {
|
||||||
|
targetCode.value = ''
|
||||||
|
sampleList.value = []
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.sample-item {
|
||||||
|
position: relative;
|
||||||
|
pointer-events: none;
|
||||||
|
.item-checkbox {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Before Width: | Height: | Size: 6.3 KiB |
BIN
static/images/menus/内部调拨.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
BIN
static/images/menus/外部调拨.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
BIN
static/images/menus/样品下架.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
BIN
static/images/menus/记录.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
BIN
static/images/menus/调拨归还.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |