4月10号
This commit is contained in:
parent
69e6a26f03
commit
59474b0394
BIN
dist.tar.gz
BIN
dist.tar.gz
Binary file not shown.
@ -70,6 +70,7 @@ export function batchCancelReceiving(data: any): Promise<any> {
|
|||||||
|
|
||||||
// 发送打印任务
|
// 发送打印任务
|
||||||
// data: { stationId, printerName, templateId, businessType, businessId, printData }
|
// data: { stationId, printerName, templateId, businessType, businessId, printData }
|
||||||
|
// 未使用
|
||||||
export function sendPrint(data: any) {
|
export function sendPrint(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system',
|
url: '/system',
|
||||||
@ -112,110 +113,105 @@ export function createReceiving(data: any): Promise<any> {
|
|||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// PDA项目使用,本项目不使用
|
||||||
|
// export function addItem(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.addItem',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// export function removeItem(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.removeItem',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// export function saveReceiving(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.saveReceiving',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// export function getReceiving(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.get',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// export function addDetail(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.addDetail',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// export function deleteDetail(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.deleteDetail',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// export function detailChange(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.detailChange',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// export function cancelReceivingDetail(data: any): Promise<any> {
|
||||||
|
// return request({
|
||||||
|
// url: '/system',
|
||||||
|
// method: 'post',
|
||||||
|
// params: {
|
||||||
|
// method: 'storage.receiving.cancel',
|
||||||
|
// v,
|
||||||
|
// timestamp: new Date().getTime()
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// ------
|
||||||
|
|
||||||
export function addItem(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.addItem',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function removeItem(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.removeItem',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function saveReceiving(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.saveReceiving',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getReceiving(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.get',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function addDetail(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.addDetail',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function deleteDetail(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.deleteDetail',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function detailChange(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.detailChange',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function cancelReceivingDetail(data: any): Promise<any> {
|
|
||||||
return request({
|
|
||||||
url: '/system',
|
|
||||||
method: 'post',
|
|
||||||
params: {
|
|
||||||
method: 'storage.receiving.cancel',
|
|
||||||
v,
|
|
||||||
timestamp: new Date().getTime()
|
|
||||||
},
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function completeReceiving(data: any): Promise<any> {
|
export function completeReceiving(data: any): Promise<any> {
|
||||||
return request({
|
return request({
|
||||||
@ -243,7 +239,6 @@ export function bindReceivingStore(data: any): Promise<any> {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function bindDetailProduct(data: any): Promise<any> {
|
export function bindDetailProduct(data: any): Promise<any> {
|
||||||
return request({
|
return request({
|
||||||
url: '/system',
|
url: '/system',
|
||||||
|
|||||||
@ -55,5 +55,6 @@ const handleSetLanguage = (lang: string) => {
|
|||||||
}
|
}
|
||||||
.lang-text {
|
.lang-text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
color: aliceblue;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -223,7 +223,7 @@
|
|||||||
v-for="option in field.options"
|
v-for="option in field.options"
|
||||||
:key="option.value"
|
:key="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value == null ? '' : option.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@ -249,7 +249,7 @@
|
|||||||
v-for="option in field.options"
|
v-for="option in field.options"
|
||||||
:key="option.value"
|
:key="option.value"
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
:value="option.value"
|
:value="option.value == null ? '' : option.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@ -271,7 +271,7 @@
|
|||||||
>
|
>
|
||||||
<el-option label="是" :value="true" />
|
<el-option label="是" :value="true" />
|
||||||
<el-option label="否" :value="false" />
|
<el-option label="否" :value="false" />
|
||||||
<el-option label="全部" :value="null" />
|
<el-option label="全部" :value="''" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -593,7 +593,7 @@ function normalizeTextValue(field: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initCustomConditions(fields: any[]) {
|
function initCustomConditions(fields: any[], isSilent = false) {
|
||||||
fields.forEach(field => {
|
fields.forEach(field => {
|
||||||
let defaultValue: any = undefined
|
let defaultValue: any = undefined
|
||||||
let defaultOperator = ''
|
let defaultOperator = ''
|
||||||
@ -604,7 +604,7 @@ function initCustomConditions(fields: any[]) {
|
|||||||
defaultValue = field.multiple ? [] : undefined
|
defaultValue = field.multiple ? [] : undefined
|
||||||
break
|
break
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
defaultValue = null
|
defaultValue = ''
|
||||||
break
|
break
|
||||||
case 'daterange':
|
case 'daterange':
|
||||||
defaultValue = []
|
defaultValue = []
|
||||||
@ -640,6 +640,12 @@ function initCustomConditions(fields: any[]) {
|
|||||||
customConditions[field.value].valueMax = undefined
|
customConditions[field.value].valueMax = undefined
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (isSilent) return
|
||||||
|
|
||||||
|
if (props.autoSubmit) {
|
||||||
|
handleCustomChange()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadInitialConditions(conditions: any) {
|
function loadInitialConditions(conditions: any) {
|
||||||
@ -788,14 +794,11 @@ function filterNode(value: string, data: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
initCustomConditions(props.availableFields)
|
initCustomConditions(props.availableFields, true)
|
||||||
activeCondition.value = null
|
activeCondition.value = null
|
||||||
presetSearchText.value = ''
|
presetSearchText.value = ''
|
||||||
filterPresetTree('')
|
filterPresetTree('')
|
||||||
emit('reset')
|
emit('reset')
|
||||||
if (props.autoSubmit) {
|
|
||||||
buildAndEmitCustomCondition()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
|
|||||||
@ -125,7 +125,7 @@
|
|||||||
:total="total"
|
:total="total"
|
||||||
:layout="paginationLayout"
|
:layout="paginationLayout"
|
||||||
:background="paginationBackground"
|
:background="paginationBackground"
|
||||||
:small="tableSize === 'small'"
|
:size="tableSize"
|
||||||
@size-change="handlePageSizeChange"
|
@size-change="handlePageSizeChange"
|
||||||
@current-change="handlePageChange"
|
@current-change="handlePageChange"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -278,6 +278,11 @@ onMounted(() => {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background .3s;
|
transition: background .3s;
|
||||||
|
|
||||||
|
.day-text,
|
||||||
|
.validity-text {
|
||||||
|
color: aliceblue;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(0, 0, 0, .025)
|
background: rgba(0, 0, 0, .025)
|
||||||
}
|
}
|
||||||
@ -304,6 +309,7 @@ onMounted(() => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.menu-text {
|
.menu-text {
|
||||||
|
color: aliceblue;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,6 +322,7 @@ onMounted(() => {
|
|||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.user-name {
|
.user-name {
|
||||||
|
color: aliceblue;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, onBeforeUnmount, watch } from 'vue'
|
import { ref, computed, onMounted, onBeforeUnmount, watch, markRaw } from 'vue'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
import WelcomCard from './components/WelcomCard.vue'
|
import WelcomCard from './components/WelcomCard.vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
@ -138,7 +138,7 @@ const initModules = async () => {
|
|||||||
if (moduleComponents[config.component]) {
|
if (moduleComponents[config.component]) {
|
||||||
modules.push({
|
modules.push({
|
||||||
...config,
|
...config,
|
||||||
component: moduleComponents[config.component]
|
component: markRaw(moduleComponents[config.component])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -161,12 +161,14 @@
|
|||||||
|
|
||||||
<div class="detail-container">
|
<div class="detail-container">
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
|
<div class="detail-component-wrapper">
|
||||||
<component
|
<component
|
||||||
:is="activeComponent"
|
:is="activeComponent"
|
||||||
:id="currentStockId"
|
:id="currentStockId"
|
||||||
type="stock"
|
type="stock"
|
||||||
@refresh="handleRefresh"
|
@refresh="handleRefresh"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -178,7 +180,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 抽屉:添加 -->
|
<!-- 抽屉:添加 -->
|
||||||
<el-drawer v-model="drawer" :with-header="false" direction="rtl" size="800px">
|
<el-drawer v-model="drawer" :with-header="false" direction="rtl" size="800px">
|
||||||
@ -195,6 +196,7 @@
|
|||||||
<el-drawer v-model="showRecycle" :with-header="false" direction="rtl" size="800px">
|
<el-drawer v-model="showRecycle" :with-header="false" direction="rtl" size="800px">
|
||||||
<Recycle :drawer-visible="showRecycle" />
|
<Recycle :drawer-visible="showRecycle" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
width="320px"
|
width="320px"
|
||||||
:tree-props="{ children: 'children', label: 'label' }"
|
:tree-props="{ children: 'children', label: 'label' }"
|
||||||
:auto-submit="false"
|
:auto-submit="false"
|
||||||
|
:initial-conditions="initialConditions"
|
||||||
:preset-tree="presetTree"
|
:preset-tree="presetTree"
|
||||||
:available-fields="availableFieldsRef"
|
:available-fields="availableFieldsRef"
|
||||||
@condition-change="handleConditionChange"
|
@condition-change="handleConditionChange"
|
||||||
@ -141,6 +142,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
@ -161,6 +163,15 @@ import entryoperate from './component/entryoperate.vue'
|
|||||||
const scanBox = ref<any>(null)
|
const scanBox = ref<any>(null)
|
||||||
const upperTable = ref<any>(null)
|
const upperTable = ref<any>(null)
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
// 用于将初始条件传入 ScanBox(用于根据 URL 参数填充)
|
||||||
|
const initialConditions = ref<any>(null)
|
||||||
|
|
||||||
|
// 当前已规范化的 where 条件(优先使用)
|
||||||
|
const currentCondition = ref<any>(null)
|
||||||
|
const currentConditionRaw = ref<any>(null)
|
||||||
|
|
||||||
const presetTree = ref<any[]>([])
|
const presetTree = ref<any[]>([])
|
||||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
|
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
|
||||||
const addEntryFieldsRef = reactive(JSON.parse(JSON.stringify(addEntryFields)))
|
const addEntryFieldsRef = reactive(JSON.parse(JSON.stringify(addEntryFields)))
|
||||||
@ -223,33 +234,70 @@ function formatTime(val: any) {
|
|||||||
* - 是简单值(string/number/array):包装为 { operator: 'eq', value: val }
|
* - 是简单值(string/number/array):包装为 { operator: 'eq', value: val }
|
||||||
* - 空或 undefined:忽略该字段
|
* - 空或 undefined:忽略该字段
|
||||||
*/
|
*/
|
||||||
function normalizeWhere(conds: any) {
|
// 将 scan-box 返回的条件标准化为后端推荐结构:{ operator, value, type }
|
||||||
if (!conds || typeof conds !== 'object') return {}
|
function normalizeToWhere(condition: any) {
|
||||||
const where: any = {}
|
if (!condition) return {}
|
||||||
Object.keys(conds).forEach(key => {
|
|
||||||
const c = conds[key]
|
|
||||||
if (c === undefined) return
|
|
||||||
|
|
||||||
// 已经是标准对象
|
// 如果是字符串或简单值,默认映射为单号模糊查询
|
||||||
if (c && typeof c === 'object' && ('operator' in c || 'value' in c || 'type' in c)) {
|
if (typeof condition === 'string' || typeof condition === 'number') {
|
||||||
// 保持 operator/value/type 字段,若缺失则做适度默认
|
return { entry_order_code: { operator: 'like', value: condition, type: 'text' } }
|
||||||
where[key] = {
|
}
|
||||||
operator: c.operator || (Array.isArray(c.value) ? 'in' : 'eq'),
|
|
||||||
|
const getFieldConfig = (key: string) => {
|
||||||
|
return availableFields.find((f: any) => f.value === key)
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapType = (type: string, value: any) => {
|
||||||
|
if (type === 'daterange' || Array.isArray(value)) return 'daterange'
|
||||||
|
if (type === 'number' || typeof value === 'number') return 'number'
|
||||||
|
if (type === 'boolean' || typeof value === 'boolean') return 'boolean'
|
||||||
|
return 'text'
|
||||||
|
}
|
||||||
|
|
||||||
|
const processConditionValue = (k: string, c: any) => {
|
||||||
|
const config = getFieldConfig(k)
|
||||||
|
const fieldType = config?.type || 'text'
|
||||||
|
|
||||||
|
if (c && typeof c === 'object' && !Array.isArray(c)) {
|
||||||
|
if ('operator' in c || 'value' in c || 'type' in c) {
|
||||||
|
return {
|
||||||
|
operator: c.operator || (Array.isArray(c.value) ? 'in' : (fieldType === 'daterange' ? 'between' : 'eq')),
|
||||||
value: c.value,
|
value: c.value,
|
||||||
type: c.type || undefined
|
type: c.type || mapType(fieldType, c.value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 简单类型,直接包装为 eq(数组则为 in)
|
if (c === null || c === undefined || c === '' || (Array.isArray(c) && c.length === 0)) return null
|
||||||
where[key] = {
|
|
||||||
operator: Array.isArray(c) ? 'in' : 'eq',
|
const simpleOp = fieldType === 'daterange' ? 'between' : 'eq'
|
||||||
value: c
|
const simpleType = mapType(fieldType, c)
|
||||||
|
return { operator: simpleOp, value: c, type: simpleType }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果来自 ScanBox 的 preset(包含 conditions)
|
||||||
|
if (condition.conditions && typeof condition.conditions === 'object') {
|
||||||
|
const where: any = {}
|
||||||
|
Object.keys(condition.conditions).forEach(k => {
|
||||||
|
const result = processConditionValue(k, condition.conditions[k])
|
||||||
|
if (result) where[k] = result
|
||||||
})
|
})
|
||||||
return where
|
return where
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 普通自定义条件对象
|
||||||
|
if (typeof condition === 'object') {
|
||||||
|
const where: any = {}
|
||||||
|
Object.keys(condition).forEach(k => {
|
||||||
|
const result = processConditionValue(k, condition[k])
|
||||||
|
if (result) where[k] = result
|
||||||
|
})
|
||||||
|
return where
|
||||||
|
}
|
||||||
|
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
function getStatusType(status: string) {
|
function getStatusType(status: string) {
|
||||||
const map: Record<string, string> = {
|
const map: Record<string, string> = {
|
||||||
'CREATED': 'info',
|
'CREATED': 'info',
|
||||||
@ -259,7 +307,7 @@ function getStatusType(status: string) {
|
|||||||
'COMPLETED': 'success',
|
'COMPLETED': 'success',
|
||||||
'CANCELLED': 'danger'
|
'CANCELLED': 'danger'
|
||||||
}
|
}
|
||||||
return map[status] || ''
|
return map[status] || undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSyncStatusType(status: string) {
|
function getSyncStatusType(status: string) {
|
||||||
@ -269,12 +317,26 @@ function getSyncStatusType(status: string) {
|
|||||||
'SUCCESS': 'success',
|
'SUCCESS': 'success',
|
||||||
'FAIL': 'danger'
|
'FAIL': 'danger'
|
||||||
}
|
}
|
||||||
return map[status] || ''
|
return map[status] || undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadData()
|
// 先加载筛选相关数据(例如 store options、presetTree),保证 ScanBox options 可用
|
||||||
loadFilterData()
|
loadFilterData()
|
||||||
|
|
||||||
|
// 如果 URL 带有 id 参数,则构建初始筛选条件并应用
|
||||||
|
const idParam = route.query.id || route.query.entry_order_code || route.query.q
|
||||||
|
const id = Array.isArray(idParam) ? idParam[0] : idParam
|
||||||
|
if (id) {
|
||||||
|
// 设置 ScanBox 的初始条件以在 UI 中显示
|
||||||
|
initialConditions.value = { conditions: { entry_order_code: { operator: 'like', value: id, type: 'text' } } }
|
||||||
|
|
||||||
|
// 直接使用包含 operator 的完整条件触发搜索(避免丢失 operator)
|
||||||
|
handleConditionChange(initialConditions.value)
|
||||||
|
} else {
|
||||||
|
// 无 URL 参数时正常加载列表
|
||||||
|
loadData()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
@ -282,8 +344,8 @@ async function loadData() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
const start = Date.now()
|
const start = Date.now()
|
||||||
try {
|
try {
|
||||||
const conditions = scanBox.value?.getConditions() || {}
|
// 优先使用由 ScanBox 提交并经过规范化的条件(包含 operator 等信息)
|
||||||
const where = normalizeWhere(conditions)
|
const where = currentCondition.value || normalizeToWhere(scanBox.value?.getConditions?.() || {})
|
||||||
const params = {
|
const params = {
|
||||||
pagination: {
|
pagination: {
|
||||||
page: pagination.currentPage,
|
page: pagination.currentPage,
|
||||||
@ -442,6 +504,12 @@ async function loadFilterData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleConditionChange(condition: any) {
|
function handleConditionChange(condition: any) {
|
||||||
|
// 保留原始条件供调试或后续使用
|
||||||
|
currentConditionRaw.value = condition
|
||||||
|
|
||||||
|
// 将条件规范化为后端期望的 where 结构
|
||||||
|
currentCondition.value = normalizeToWhere(condition)
|
||||||
|
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
@ -454,14 +522,18 @@ function handleSortChange({ prop, order }: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleConditionClear = () => {
|
const handleConditionClear = () => {
|
||||||
|
currentCondition.value = null
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleConditionReset() {
|
function handleConditionReset() {
|
||||||
|
currentCondition.value = null // 清空已保存的条件
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
if (scanBox.value?.reset) {
|
if (scanBox.value?.reset) {
|
||||||
scanBox.value.reset()
|
scanBox.value.reset()
|
||||||
|
} else if (scanBox.value?.clear) {
|
||||||
|
scanBox.value.clear()
|
||||||
}
|
}
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,7 @@
|
|||||||
<!-- 底部操作按钮 -->
|
<!-- 底部操作按钮 -->
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<el-button-group class="toolbar-btn-group">
|
<el-button-group class="toolbar-btn-group">
|
||||||
<el-button type="primary" icon="Check" @click="handleSave" :loading="saveLoading">
|
<el-button type="primary" icon="Check" disabled :loading="saveLoading">
|
||||||
保存
|
保存
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="danger" icon="Refresh" @click="handleReset">
|
<el-button type="danger" icon="Refresh" @click="handleReset">
|
||||||
|
|||||||
@ -739,7 +739,7 @@ onUnmounted(() => {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid #ebeef5;
|
border: 1px solid #ebeef5;
|
||||||
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 4px;
|
/* border-radius: 4px; */
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,11 +9,11 @@
|
|||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||||
<el-button size="small" @click="handleCreateReceiving">新建收货单</el-button>
|
<!-- <el-button size="small" @click="handleCreateReceiving">新建收货单</el-button> -->
|
||||||
<el-button type="success" size="small" icon="el-icon-delete" @click="confirmcomplete" title="入库单入库"
|
<!-- <el-button type="success" size="small" icon="el-icon-delete" @click="confirmcomplete" title="入库单入库"
|
||||||
:disabled="!hasSelection" class="toolbar-btn">
|
:disabled="!hasSelection" class="toolbar-btn">
|
||||||
入库单入库
|
入库单入库
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button type="primary" size="small" icon="el-icon-delete" @click="confirmcomplete" title="一键入库"
|
<el-button type="primary" size="small" icon="el-icon-delete" @click="confirmcomplete" title="一键入库"
|
||||||
:disabled="!hasSelection" class="toolbar-btn">
|
:disabled="!hasSelection" class="toolbar-btn">
|
||||||
一键入库
|
一键入库
|
||||||
@ -215,7 +215,11 @@
|
|||||||
<el-form :model="createForm" label-width="100px" size="small">
|
<el-form :model="createForm" label-width="100px" size="small">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col v-for="field in addReceivingFieldsRef" :key="field.prop" :span="field.type === 'textarea' ? 24 : 12">
|
<el-col v-for="field in addReceivingFieldsRef" :key="field.prop" :span="field.type === 'textarea' ? 24 : 12">
|
||||||
<el-form-item :label="field.label">
|
<el-form-item>
|
||||||
|
<template #label>
|
||||||
|
<span>{{ field.label }}</span>
|
||||||
|
<span v-if="['delivery_method','loading_method'].includes(field.prop)" style="color: #f56c6c; margin-left:6px">*</span>
|
||||||
|
</template>
|
||||||
<el-select v-if="field.type === 'select'" v-model="createForm[field.prop]"
|
<el-select v-if="field.type === 'select'" v-model="createForm[field.prop]"
|
||||||
:placeholder="'请选择' + field.label" style="width: 100%" :filterable="field.filterable">
|
:placeholder="'请选择' + field.label" style="width: 100%" :filterable="field.filterable">
|
||||||
<el-option v-for="opt in field.options" :key="opt.value" :label="opt.label" :value="opt.value" />
|
<el-option v-for="opt in field.options" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||||
@ -631,6 +635,8 @@ const createForm = reactive<any>({
|
|||||||
loading_method: '',
|
loading_method: '',
|
||||||
license_plate: '',
|
license_plate: '',
|
||||||
tracking_number: '',
|
tracking_number: '',
|
||||||
|
total_boxes: '',
|
||||||
|
total_pallets: '',
|
||||||
remark: ''
|
remark: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -639,11 +645,14 @@ function handleCreateDialogClosed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function submitCreateReceiving() {
|
async function submitCreateReceiving() {
|
||||||
// 表单校验:除备注外必须填写
|
// 仅校验指定的必填字段:到货方式与装卸方式
|
||||||
const requiredFields = addReceivingFieldsRef.filter((f: { prop: string }) => f.prop !== 'remark')
|
const requiredProps = ['delivery_method', 'loading_method']
|
||||||
for (const field of requiredFields) {
|
for (const prop of requiredProps) {
|
||||||
if (!createForm[field.prop]) {
|
const val = createForm[prop]
|
||||||
ElMessage.warning(`请填写${field.label}`)
|
const field = addReceivingFieldsRef.find((f: any) => f.prop === prop)
|
||||||
|
const label = field ? field.label : prop
|
||||||
|
if (val === null || val === undefined || val === '') {
|
||||||
|
ElMessage.warning(`请填写${label}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,24 @@ export const loadingMethodConfig: any = {
|
|||||||
without_pallet: { text: '不带托盘', tagType: 'info' }
|
without_pallet: { text: '不带托盘', tagType: 'info' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 收货单号的枚举配置(类似 statusConfig),用于在筛选中加载对应选项
|
||||||
|
export const receivingConfig: any = {
|
||||||
|
eq: { text: '等于' },
|
||||||
|
ne: { text: '不等于' },
|
||||||
|
contains: { text: '包含' },
|
||||||
|
starts_with: { text: '开头为' },
|
||||||
|
like: { text: '模糊匹配' },
|
||||||
|
// 保留全部项定义以便未来扩展,但 availableFields 只会启用上面五个
|
||||||
|
ends_with: { text: '结尾为' },
|
||||||
|
// regex: { text: '正则匹配' }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数值字段通用配置,只开启常用的比较/范围操作
|
||||||
|
export const numberConfig: any = {
|
||||||
|
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le'],
|
||||||
|
defaultOperator: 'ge'
|
||||||
|
}
|
||||||
|
|
||||||
// 时间格式化函数
|
// 时间格式化函数
|
||||||
export function formatDateTime(dateStr: string): string {
|
export function formatDateTime(dateStr: string): string {
|
||||||
if (!dateStr) return '--'
|
if (!dateStr) return '--'
|
||||||
@ -82,6 +100,7 @@ export const receivingColumns = [
|
|||||||
{ prop: 'total_pallets', label: '总托盘数', width: '90', align: 'right', sortable: true },
|
{ prop: 'total_pallets', label: '总托盘数', width: '90', align: 'right', sortable: true },
|
||||||
{ prop: 'license_plate', label: '车牌号', width: '100' },
|
{ prop: 'license_plate', label: '车牌号', width: '100' },
|
||||||
{ prop: 'tracking_number', label: '物流单号', width: '120' },
|
{ prop: 'tracking_number', label: '物流单号', width: '120' },
|
||||||
|
{ prop: 'video_device_id', label: '录像设备ID', width: '140' },
|
||||||
{ prop: 'delivery_method', label: '来货方式', width: '90', align: 'center' },
|
{ prop: 'delivery_method', label: '来货方式', width: '90', align: 'center' },
|
||||||
{ prop: 'loading_method', label: '装卸方式', width: '100', align: 'center' },
|
{ prop: 'loading_method', label: '装卸方式', width: '100', align: 'center' },
|
||||||
{ prop: 'creator_name', label: '创建人', width: '100' },
|
{ prop: 'creator_name', label: '创建人', width: '100' },
|
||||||
@ -95,7 +114,15 @@ export const receivingColumns = [
|
|||||||
|
|
||||||
// receiving配置
|
// receiving配置
|
||||||
export const availableFields = [
|
export const availableFields = [
|
||||||
{ value: 'receiving_number', label: '收货单号', type: 'text' },
|
{
|
||||||
|
value: 'receiving_number',
|
||||||
|
label: '收货单号',
|
||||||
|
type: 'text',
|
||||||
|
placeholder: '请输入收货单号',
|
||||||
|
// 可用操作符(后端 operator 名称):等于、不等于、包含、开头为、模糊匹配
|
||||||
|
operators: ['eq', 'ne', 'contains', 'starts_with', 'like'],
|
||||||
|
defaultOperator: 'contains'
|
||||||
|
},
|
||||||
{ value: 'status', label: '收货状态', type: 'select', options: Object.entries(statusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
|
{ value: 'status', label: '收货状态', type: 'select', options: Object.entries(statusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
|
||||||
{ value: 'detail_status', label: '匹配状态', type: 'select', options: Object.entries(detailStatusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
|
{ value: 'detail_status', label: '匹配状态', type: 'select', options: Object.entries(detailStatusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
|
||||||
{ value: 'storage_status', label: '入库状态', type: 'select', options: Object.entries(storageStatusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
|
{ value: 'storage_status', label: '入库状态', type: 'select', options: Object.entries(storageStatusConfig).map(([v, c]) => ({ value: v, label: c.text })) },
|
||||||
@ -131,32 +158,32 @@ export const availableFields = [
|
|||||||
label: '商品种类',
|
label: '商品种类',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
placeholder: '请输入商品种类数',
|
placeholder: '请输入商品种类数',
|
||||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
|
operators: numberConfig.operators,
|
||||||
defaultOperator: 'ge'
|
defaultOperator: numberConfig.defaultOperator
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'total_quantity',
|
value: 'total_quantity',
|
||||||
label: '总数量',
|
label: '总数量',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
placeholder: '请输入总数量',
|
placeholder: '请输入总数量',
|
||||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
|
operators: numberConfig.operators,
|
||||||
defaultOperator: 'ge'
|
defaultOperator: numberConfig.defaultOperator
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'total_boxes',
|
value: 'total_boxes',
|
||||||
label: '总箱数',
|
label: '总箱数',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
placeholder: '请输入总箱数',
|
placeholder: '请输入总箱数',
|
||||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
|
operators: numberConfig.operators,
|
||||||
defaultOperator: 'ge'
|
defaultOperator: numberConfig.defaultOperator
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'total_pallets',
|
value: 'total_pallets',
|
||||||
label: '总托盘数',
|
label: '总托盘数',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
placeholder: '请输入总托盘数',
|
placeholder: '请输入总托盘数',
|
||||||
operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between', 'notbetween', 'in', 'notin', 'isnull', 'isnotnull'],
|
operators: numberConfig.operators,
|
||||||
defaultOperator: 'ge'
|
defaultOperator: numberConfig.defaultOperator
|
||||||
},
|
},
|
||||||
// 时间筛选
|
// 时间筛选
|
||||||
{
|
{
|
||||||
@ -353,6 +380,9 @@ export const addReceivingFields = [
|
|||||||
{ prop: 'store_id', label: '货主', type: 'select', filterable: true, options: [] },
|
{ prop: 'store_id', label: '货主', type: 'select', filterable: true, options: [] },
|
||||||
{ prop: 'delivery_method', label: '来货方式', type: 'select', options: Object.entries(deliveryMethodConfig).map(([v, c]: [string, any]) => ({ value: v, label: c.text })) },
|
{ prop: 'delivery_method', label: '来货方式', type: 'select', options: Object.entries(deliveryMethodConfig).map(([v, c]: [string, any]) => ({ value: v, label: c.text })) },
|
||||||
{ prop: 'loading_method', label: '装卸方式', type: 'select', options: Object.entries(loadingMethodConfig).map(([v, c]: [string, any]) => ({ value: v, label: c.text })) },
|
{ prop: 'loading_method', label: '装卸方式', type: 'select', options: Object.entries(loadingMethodConfig).map(([v, c]: [string, any]) => ({ value: v, label: c.text })) },
|
||||||
|
// 新增可选的总箱数与总托盘数字段
|
||||||
|
{ prop: 'total_boxes', label: '总箱数', type: 'input', placeholder: '请输入总箱数', optional: true },
|
||||||
|
{ prop: 'total_pallets', label: '总托盘数', type: 'input', placeholder: '请输入总托盘数', optional: true },
|
||||||
{ prop: 'license_plate', label: '车牌号', type: 'input' },
|
{ prop: 'license_plate', label: '车牌号', type: 'input' },
|
||||||
{ prop: 'tracking_number', label: '物流单号', type: 'input' },
|
{ prop: 'tracking_number', label: '物流单号', type: 'input' },
|
||||||
{ prop: 'remark', label: '备注', type: 'textarea' }
|
{ prop: 'remark', label: '备注', type: 'textarea' }
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
width="320px"
|
width="320px"
|
||||||
:tree-props="{ children: 'children', label: 'label' }"
|
:tree-props="{ children: 'children', label: 'label' }"
|
||||||
:auto-submit="false"
|
:auto-submit="false"
|
||||||
|
:initial-conditions="initialConditions"
|
||||||
:preset-tree="presetTree"
|
:preset-tree="presetTree"
|
||||||
:available-fields="availableFieldsRef"
|
:available-fields="availableFieldsRef"
|
||||||
@condition-change="handleConditionChange"
|
@condition-change="handleConditionChange"
|
||||||
@ -98,6 +99,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
@ -119,6 +121,14 @@ import log from './component/log.vue'
|
|||||||
const scanBox = ref<any>(null)
|
const scanBox = ref<any>(null)
|
||||||
const upperTable = ref<any>(null)
|
const upperTable = ref<any>(null)
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
// 初始条件(用于 URL 预设)
|
||||||
|
const initialConditions = ref<any>(null)
|
||||||
|
|
||||||
|
// 保存原始条件(可能包含 operator 等信息)
|
||||||
|
const currentConditionRaw = ref<any>(null)
|
||||||
|
|
||||||
const presetTree = ref<any[]>([])
|
const presetTree = ref<any[]>([])
|
||||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
|
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(availableFields)))
|
||||||
|
|
||||||
@ -154,8 +164,26 @@ const selectedRow = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadData()
|
// 先加载筛选相关数据,保证 ScanBox 的选项可用
|
||||||
loadFilterData()
|
loadFilterData()
|
||||||
|
|
||||||
|
// 支持从 URL 预设筛选(例如 ?id=xxx 或 ?delivery_order_code=xxx 或 ?q=xxx)
|
||||||
|
const idParam = route.query.id || route.query.delivery_order_code || route.query.q
|
||||||
|
const id = Array.isArray(idParam) ? idParam[0] : idParam
|
||||||
|
if (id) {
|
||||||
|
// 与 receiving 页面一致,设置 ScanBox 的初始条件用于在 UI 中显示
|
||||||
|
initialConditions.value = {
|
||||||
|
type: 'custom',
|
||||||
|
conditions: {
|
||||||
|
delivery_order_code: { value: String(id), operator: 'eq', field: 'delivery_order_code', type: 'text' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用包含 operator 的完整条件触发搜索,避免丢失操作符
|
||||||
|
handleConditionChange(initialConditions.value)
|
||||||
|
} else {
|
||||||
|
loadData()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
@ -163,6 +191,7 @@ async function loadData() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
const start = Date.now()
|
const start = Date.now()
|
||||||
try {
|
try {
|
||||||
|
// 优先使用由 ScanBox 提交并经过规范化的条件(包含 operator 等信息)
|
||||||
const where = currentCondition.value || {}
|
const where = currentCondition.value || {}
|
||||||
const params: any = {
|
const params: any = {
|
||||||
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
|
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
|
||||||
@ -194,9 +223,10 @@ async function loadData() {
|
|||||||
|
|
||||||
async function loadFilterData() {
|
async function loadFilterData() {
|
||||||
try {
|
try {
|
||||||
|
// 与 receiving 页面一致,按业务类型加载 store 列表和 presetTree,避免 ScanBox options 不匹配
|
||||||
const [storesRes, presetRes]: any = await Promise.all([
|
const [storesRes, presetRes]: any = await Promise.all([
|
||||||
indexApi.loadStores({ type: 'entry' }),
|
indexApi.loadStores({ type: 'stockout' }),
|
||||||
indexApi.fastWhereTree('entry')
|
indexApi.fastWhereTree('stockout')
|
||||||
])
|
])
|
||||||
if (storesRes && storesRes.code === 200) {
|
if (storesRes && storesRes.code === 200) {
|
||||||
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
|
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
|
||||||
@ -211,7 +241,12 @@ async function loadFilterData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleConditionChange(condition: any) {
|
function handleConditionChange(condition: any) {
|
||||||
currentCondition.value = condition
|
// 保存原始条件
|
||||||
|
currentConditionRaw.value = condition
|
||||||
|
|
||||||
|
// 将条件规范化为后端期望结构:{ operator, value, type }
|
||||||
|
currentCondition.value = normalizeToWhere(condition)
|
||||||
|
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
@ -229,16 +264,20 @@ function handleSubmit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleConditionClear = () => {
|
const handleConditionClear = () => {
|
||||||
|
currentConditionRaw.value = null
|
||||||
currentCondition.value = null
|
currentCondition.value = null
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleConditionReset() {
|
function handleConditionReset() {
|
||||||
|
currentConditionRaw.value = null
|
||||||
currentCondition.value = null
|
currentCondition.value = null
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
if (scanBox.value?.reset) {
|
if (scanBox.value?.reset) {
|
||||||
scanBox.value.reset()
|
scanBox.value.reset()
|
||||||
|
} else if (scanBox.value?.clear) {
|
||||||
|
scanBox.value.clear()
|
||||||
}
|
}
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
@ -248,6 +287,68 @@ function onSelectionChange(rows: any[]) {
|
|||||||
hasSelection.value = selectionRows.value.length > 0
|
hasSelection.value = selectionRows.value.length > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 将 scan-box 返回的条件标准化为后端推荐结构:{ operator, value, type }
|
||||||
|
function normalizeToWhere(condition: any) {
|
||||||
|
if (!condition) return {}
|
||||||
|
|
||||||
|
// 如果是字符串或简单值,默认映射为单号模糊查询(出库单号为 delivery_order_code)
|
||||||
|
if (typeof condition === 'string' || typeof condition === 'number') {
|
||||||
|
return { delivery_order_code: { operator: 'like', value: condition, type: 'text' } }
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFieldConfig = (key: string) => {
|
||||||
|
return availableFields.find((f: any) => f.value === key)
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapType = (type: string, value: any) => {
|
||||||
|
if (type === 'daterange' || Array.isArray(value)) return 'daterange'
|
||||||
|
if (type === 'number' || typeof value === 'number') return 'number'
|
||||||
|
if (type === 'boolean' || typeof value === 'boolean') return 'boolean'
|
||||||
|
return 'text'
|
||||||
|
}
|
||||||
|
|
||||||
|
const processConditionValue = (k: string, c: any) => {
|
||||||
|
const config = getFieldConfig(k)
|
||||||
|
const fieldType = config?.type || 'text'
|
||||||
|
|
||||||
|
if (c && typeof c === 'object' && !Array.isArray(c)) {
|
||||||
|
if ('operator' in c || 'value' in c || 'type' in c) {
|
||||||
|
return {
|
||||||
|
operator: c.operator || (Array.isArray(c.value) ? 'in' : (fieldType === 'daterange' ? 'between' : 'eq')),
|
||||||
|
value: c.value,
|
||||||
|
type: c.type || mapType(fieldType, c.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c === null || c === undefined || c === '' || (Array.isArray(c) && c.length === 0)) return null
|
||||||
|
|
||||||
|
const simpleOp = fieldType === 'daterange' ? 'between' : 'eq'
|
||||||
|
const simpleType = mapType(fieldType, c)
|
||||||
|
return { operator: simpleOp, value: c, type: simpleType }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (condition.conditions && typeof condition.conditions === 'object') {
|
||||||
|
const where: any = {}
|
||||||
|
Object.keys(condition.conditions).forEach(k => {
|
||||||
|
const result = processConditionValue(k, condition.conditions[k])
|
||||||
|
if (result) where[k] = result
|
||||||
|
})
|
||||||
|
return where
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof condition === 'object') {
|
||||||
|
const where: any = {}
|
||||||
|
Object.keys(condition).forEach(k => {
|
||||||
|
const result = processConditionValue(k, condition[k])
|
||||||
|
if (result) where[k] = result
|
||||||
|
})
|
||||||
|
return where
|
||||||
|
}
|
||||||
|
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleRowClick(row: any) {
|
async function handleRowClick(row: any) {
|
||||||
selectedStockoutId.value = row?.id || null
|
selectedStockoutId.value = row?.id || null
|
||||||
}
|
}
|
||||||
|
|||||||
@ -828,10 +828,14 @@ function handleSearch() {
|
|||||||
function handleReset() {
|
function handleReset() {
|
||||||
queryForm.keyword = ''
|
queryForm.keyword = ''
|
||||||
currentCondition.value = {}
|
currentCondition.value = {}
|
||||||
if (scanBox.value?.reset) scanBox.value.reset()
|
if (scanBox.value?.reset) {
|
||||||
|
scanBox.value.reset()
|
||||||
|
} else {
|
||||||
|
// 降级处理:如果没有 scanBox 实例也应该能正常重置并加载
|
||||||
pagination.currentPage = 1
|
pagination.currentPage = 1
|
||||||
loadList()
|
loadList()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handlePageChange(page: number) {
|
function handlePageChange(page: number) {
|
||||||
pagination.currentPage = page
|
pagination.currentPage = page
|
||||||
|
|||||||
@ -130,26 +130,26 @@
|
|||||||
<el-button
|
<el-button
|
||||||
v-if="row.editing"
|
v-if="row.editing"
|
||||||
type="success"
|
type="success"
|
||||||
size="mini"
|
size="small"
|
||||||
@click="saveProperty(row)"
|
@click="saveProperty(row)"
|
||||||
>保存</el-button>
|
>保存</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-else
|
v-else
|
||||||
type="primary"
|
type="primary"
|
||||||
size="mini"
|
size="small"
|
||||||
@click="editProperty(row)"
|
@click="editProperty(row)"
|
||||||
>编辑</el-button>
|
>编辑</el-button>
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!row.editing"
|
v-if="!row.editing"
|
||||||
type="danger"
|
type="danger"
|
||||||
size="mini"
|
size="small"
|
||||||
@click="deleteProperty(row)"
|
@click="deleteProperty(row)"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-else
|
v-else
|
||||||
type="warning"
|
type="warning"
|
||||||
size="mini"
|
size="small"
|
||||||
@click="cancelEdit(row)"
|
@click="cancelEdit(row)"
|
||||||
>取消</el-button>
|
>取消</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -239,13 +239,13 @@
|
|||||||
/>
|
/>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="addForm.options.length > 1"
|
v-if="addForm.options.length > 1"
|
||||||
type="text"
|
type="link"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="removeOption(Number(index))"
|
@click="removeOption(Number(index))"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="link"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="addOption"
|
@click="addOption"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -8,19 +8,19 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>仓位管理(货架{{ props.rack.name }})</span>
|
<span>仓位管理(货架{{ props.rack.name }})</span>
|
||||||
<span>
|
<span>
|
||||||
<el-button type="text" size="small" @click="handleAddSpace">
|
<el-button type="link" size="small" @click="handleAddSpace">
|
||||||
一键排列拣货路径
|
一键排列拣货路径
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" size="small" @click="handleAddSpace">
|
<el-button type="link" size="small" @click="handleAddSpace">
|
||||||
打印
|
打印
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" size="small" @click="handleAddSpace">
|
<el-button type="link" size="small" @click="handleAddSpace">
|
||||||
修复货架
|
修复货架
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" size="small" @click="handleAddSpace">
|
<el-button type="link" size="small" @click="handleAddSpace">
|
||||||
导出
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" size="small" @click="handleAddSpace">
|
<el-button type="link" size="small" @click="handleAddSpace">
|
||||||
导入批量修改
|
导入批量修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="编辑仓位"
|
title="编辑仓位"
|
||||||
:visible="props.visible"
|
v-model="internalVisible"
|
||||||
width="500px"
|
width="500px"
|
||||||
@close="handleClose"
|
@close="handleClose"
|
||||||
>
|
>
|
||||||
@ -91,6 +91,11 @@ const props = defineProps({
|
|||||||
|
|
||||||
const emit = defineEmits(['close', 'saved'])
|
const emit = defineEmits(['close', 'saved'])
|
||||||
|
|
||||||
|
const internalVisible = ref(props.visible)
|
||||||
|
|
||||||
|
watch(() => props.visible, (nv) => { internalVisible.value = nv }, { immediate: true })
|
||||||
|
watch(internalVisible, (v) => { if (!v) emit('close') })
|
||||||
|
|
||||||
const formRef = ref(null)
|
const formRef = ref(null)
|
||||||
const saving = ref(false)
|
const saving = ref(false)
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="mini"
|
size="small"
|
||||||
@click="loadSpaces"
|
@click="loadSpaces"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
>
|
>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
size="mini"
|
size="small"
|
||||||
@click="generateSpaces"
|
@click="generateSpaces"
|
||||||
:loading="generating"
|
:loading="generating"
|
||||||
v-if="!spaces.length"
|
v-if="!spaces.length"
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<div class="grid-cell">{{ space.space_code }}</div>
|
<div class="grid-cell">{{ space.space_code }}</div>
|
||||||
<div class="grid-cell">
|
<div class="grid-cell">
|
||||||
<el-tag
|
<el-tag
|
||||||
size="mini"
|
size="small"
|
||||||
:type="getStatusTag(space.space_status)"
|
:type="getStatusTag(space.space_status)"
|
||||||
>
|
>
|
||||||
{{ getStatusText(space.space_status) }}
|
{{ getStatusText(space.space_status) }}
|
||||||
@ -59,8 +59,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid-cell">
|
<div class="grid-cell">
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="link"
|
||||||
size="mini"
|
size="small"
|
||||||
@click.stop="editSpace(space)"
|
@click.stop="editSpace(space)"
|
||||||
>
|
>
|
||||||
<i class="el-icon-edit"></i>
|
<i class="el-icon-edit"></i>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="dialogTitle" v-model="props.visible" width="900px" align-center :before-close="handleClose" :close-on-click-modal="false">
|
<el-dialog :title="dialogTitle" v-model="internalVisible" width="900px" align-center :before-close="handleClose" :close-on-click-modal="false">
|
||||||
<el-form ref="zoneFormRef" :model="formData" :rules="formRules" label-width="100px" label-position="left">
|
<el-form ref="zoneFormRef" :model="formData" :rules="formRules" label-width="100px" label-position="left">
|
||||||
<!-- 分区类型改为下拉选择 -->
|
<!-- 分区类型改为下拉选择 -->
|
||||||
<el-form-item label="分区类型" prop="zone_type">
|
<el-form-item label="分区类型" prop="zone_type">
|
||||||
@ -210,6 +210,7 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(['close', 'success'])
|
const emit = defineEmits(['close', 'success'])
|
||||||
|
|
||||||
const zoneFormRef = ref<any>(null)
|
const zoneFormRef = ref<any>(null)
|
||||||
|
const internalVisible = ref(props.visible)
|
||||||
const aislesInput = ref('')
|
const aislesInput = ref('')
|
||||||
const submitting = ref(false)
|
const submitting = ref(false)
|
||||||
|
|
||||||
@ -326,7 +327,8 @@ const parentDisplayName = computed(() => {
|
|||||||
return ''
|
return ''
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => props.visible, (newVal) => { if (newVal) initFormData(); else resetForm() }, { immediate: true })
|
watch(() => props.visible, (newVal) => { internalVisible.value = newVal; if (newVal) initFormData(); else resetForm() }, { immediate: true })
|
||||||
|
watch(internalVisible, (val) => { if (!val && !submitting.value) emit('close') })
|
||||||
watch(() => props.zoneData, () => initFormData(), { deep: true })
|
watch(() => props.zoneData, () => initFormData(), { deep: true })
|
||||||
watch(() => props.parentType, (nv) => { if (nv && props.mode === 'add') autoSetZoneType(nv) }, { immediate: true })
|
watch(() => props.parentType, (nv) => { if (nv && props.mode === 'add') autoSetZoneType(nv) }, { immediate: true })
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<template v-slot="{ node, data }">
|
<template v-slot="{ node, data }">
|
||||||
<span class="tree-node">
|
<span class="tree-node">
|
||||||
<span class="node-content">
|
<span class="node-content">
|
||||||
<el-tag size="mini" :type="getZoneTypeTag(data.type)">
|
<el-tag size="small" :type="getZoneTypeTag(data.type)">
|
||||||
{{ getZoneTypeText(data.type) }}
|
{{ getZoneTypeText(data.type) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span class="node-label">{{ data.name }}</span>
|
<span class="node-label">{{ data.name }}</span>
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<el-card class="warehouse-card">
|
<el-card class="warehouse-card">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>仓库列表</span>
|
<span>仓库列表</span>
|
||||||
<el-button style="float: right; padding: 3px 0" type="text" @click="showAddWarehouseDialog">
|
<el-button style="float: right; padding: 3px 0" type="link" @click="showAddWarehouseDialog">
|
||||||
添加仓库
|
添加仓库
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -38,9 +38,9 @@
|
|||||||
<span>{{ data.name }}</span>
|
<span>{{ data.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="tree-node-actions">
|
<span class="tree-node-actions">
|
||||||
<el-button type="text" size="mini" @click.stop="addChildElement(data)">添加</el-button>
|
<el-button type="link" size="small" @click.stop="addChildElement(data)">添加</el-button>
|
||||||
<el-button type="text" size="mini" @click.stop="editElement(data)">编辑</el-button>
|
<el-button type="link" size="small" @click.stop="editElement(data)">编辑</el-button>
|
||||||
<el-button type="text" size="mini" @click.stop="deleteElement(data)">删除</el-button>
|
<el-button type="link" size="small" @click.stop="deleteElement(data)">删除</el-button>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@ -59,13 +59,13 @@
|
|||||||
<span>仓库平面图</span>
|
<span>仓库平面图</span>
|
||||||
<div class="view-controls">
|
<div class="view-controls">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button size="mini" @click="zoomOut" :disabled="scale <= minScale">
|
<el-button size="small" @click="zoomOut" :disabled="scale <= minScale">
|
||||||
<i class="el-icon-zoom-out"></i>
|
<i class="el-icon-zoom-out"></i>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" @click="zoomIn" :disabled="scale >= maxScale">
|
<el-button size="small" @click="zoomIn" :disabled="scale >= maxScale">
|
||||||
<i class="el-icon-zoom-in"></i>
|
<i class="el-icon-zoom-in"></i>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" @click="resetView">
|
<el-button size="small" @click="resetView">
|
||||||
<i class="el-icon-refresh"></i> 重置
|
<i class="el-icon-refresh"></i> 重置
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
@ -134,8 +134,8 @@
|
|||||||
<div v-else>原因: {{ connectivityResult.reason }}</div>
|
<div v-else>原因: {{ connectivityResult.reason }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="connectivityResult.success" class="result-actions">
|
<div v-if="connectivityResult.success" class="result-actions">
|
||||||
<el-button size="mini" @click="visualizePath">可视化路径</el-button>
|
<el-button size="small" @click="visualizePath">可视化路径</el-button>
|
||||||
<el-button size="mini" @click="showPathDetails">查看详情</el-button>
|
<el-button size="small" @click="showPathDetails">查看详情</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -143,7 +143,7 @@
|
|||||||
<div v-if="detectionHistory.length > 0" class="history-container">
|
<div v-if="detectionHistory.length > 0" class="history-container">
|
||||||
<div class="history-header">
|
<div class="history-header">
|
||||||
<span>检测历史</span>
|
<span>检测历史</span>
|
||||||
<el-button type="text" size="mini" @click="clearHistory">清空</el-button>
|
<el-button type="link" size="small" @click="clearHistory">清空</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="history-list">
|
<div class="history-list">
|
||||||
<div v-for="record in detectionHistory" :key="record.id" class="history-item" @click="showHistoryRecord(record)">
|
<div v-for="record in detectionHistory" :key="record.id" class="history-item" @click="showHistoryRecord(record)">
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<el-card v-if="props.warehouse && props.warehouse.id" class="warehouse-info-card">
|
<el-card v-if="props.warehouse && props.warehouse.id" class="warehouse-info-card">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>仓库信息</span>
|
<span>仓库信息</span>
|
||||||
<el-button type="text" size="small" @click="handleEditWarehouse" v-if="props.warehouse.editable">编辑</el-button>
|
<el-button type="link" size="small" @click="handleEditWarehouse" v-if="props.warehouse.editable">编辑</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="warehouse-info-content">
|
<div class="warehouse-info-content">
|
||||||
@ -86,7 +86,7 @@
|
|||||||
<el-card v-else-if="props.zone && props.zone.type === 'area'" class="zone-info-card">
|
<el-card v-else-if="props.zone && props.zone.type === 'area'" class="zone-info-card">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>库区信息</span>
|
<span>库区信息</span>
|
||||||
<el-button type="text" size="small" @click="handleEditZone" v-if="props.zone.editable">编辑</el-button>
|
<el-button type="link" size="small" @click="handleEditZone" v-if="props.zone.editable">编辑</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="zone-info-content">
|
<div class="zone-info-content">
|
||||||
|
|||||||
334
src/接口文档1.txt
334
src/接口文档1.txt
@ -1,287 +1,77 @@
|
|||||||
storage.receiving.getReceivingList
|
storage.receiving.bindStore
|
||||||
|
收货单绑定货主
|
||||||
|
|
||||||
Params (2)
|
Params (2)
|
||||||
名称 类型 必填 说明
|
名称 类型 必填 说明
|
||||||
pagination object 否 分页参数,支持 page/pageSize
|
id number 是 收货单ID
|
||||||
where object 否 统一 where 条件对象;推荐使用 { operator, value, type } 标准结构,历史简写会在 main 中自动标准化;支持 quickWhere、status、store_id、日期区间等字段。示例:where.status={operator:eq,value:finished}; where.store_id={operator:eq,value:1001}; where.create_time_start={value:2026-03-01}。
|
store_id number 是 货主ID(必须与当前仓库存在有效签约关系)
|
||||||
|
|
||||||
-----
|
Response (4)
|
||||||
storage.inventory.quickPutaway接口
|
|
||||||
|
|
||||||
收货单快捷入库上架。从收货单直接生成入库单并写入库存表,要求收货单已完成且所有明细已匹配系统商品
|
|
||||||
|
|
||||||
Params (1)
|
|
||||||
名称 类型 必填 说明
|
名称 类型 必填 说明
|
||||||
receiving_id number 是 收货单ID,兼容 id
|
data.id number 是 收货单ID
|
||||||
|
data.store_id number 是 已绑定的货主ID
|
||||||
|
data.store_name string 否 货主名称/签约备注名
|
||||||
|
data.status string 是 当前收货单状态
|
||||||
|
|
||||||
|
请求携带参数:
|
||||||
|
{
|
||||||
|
"id": 471,
|
||||||
|
"receiving_number": "R20552055",
|
||||||
|
"store_id": 1000016
|
||||||
|
}
|
||||||
|
|
||||||
-----
|
接口响应:
|
||||||
storage.entry.list
|
|
||||||
入库单列表查询
|
|
||||||
|
|
||||||
Params (3)
|
|
||||||
名称 类型 必填 说明
|
|
||||||
pagination object 否 分页参数,支持 page/pageSize
|
|
||||||
where object 否 统一 where 条件对象;推荐使用 { operator, value, type } 标准结构,历史简写会在 main 中自动标准化;支持 quickWhere、order_status、store_id、order_type、日期区间等字段。示例:where.order_status={operator:eq,value:waiting}; where.order_type={operator:eq,value:purchase}; where.create_time_start={value:2026-03-01}。
|
|
||||||
sort object 否 排序参数,支持 sortField/sortOrder
|
|
||||||
|
|
||||||
Response (3)
|
|
||||||
名称 类型 必填 说明
|
|
||||||
list array 是 入库单列表
|
|
||||||
pagination object 是 分页信息(page、pageSize、total、totalPages、hasPrevious、hasNext)
|
|
||||||
summary object 是 状态汇总(total、pending、creating、created、completed、cancelled)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"flag": "success",
|
"flag": "success",
|
||||||
"code": 200,
|
"code": 200,
|
||||||
"message": "查询成功",
|
"message": "绑定货主成功",
|
||||||
"data": {
|
"data": {
|
||||||
"list": [
|
"id": 471,
|
||||||
|
"store_id": 1000016,
|
||||||
|
"store_name": "测试1112",
|
||||||
|
"status": "receiving"
|
||||||
|
},
|
||||||
|
"timestamp": 1775792333
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-----
|
||||||
|
storage.receiving.create 接口:
|
||||||
|
|
||||||
|
Params (8)
|
||||||
|
名称 类型 必填 说明
|
||||||
|
delivery_method string 是 到货方式:truck/express/air_freight/sea_freight/other
|
||||||
|
loading_method string 是 装卸方式:with_pallet/without_pallet
|
||||||
|
license_plate string 否 车牌号(delivery_method=truck 时建议传)
|
||||||
|
tracking_number string 否 物流单号(非 truck/other 场景建议传)
|
||||||
|
store_id number 否 货主ID
|
||||||
|
total_boxes number 否 总箱数
|
||||||
|
total_pallets number 否 总托盘数
|
||||||
|
remark string 否 备注
|
||||||
|
|
||||||
|
Response (2)
|
||||||
|
名称 类型 必填 说明
|
||||||
|
id number 是 新建收货单ID
|
||||||
|
receiving_number string 是 收货单号
|
||||||
|
|
||||||
|
当前项目请求数据结构:
|
||||||
{
|
{
|
||||||
"id": 103,
|
"store_id": 1000016,
|
||||||
"entry_order_code": "33134",
|
"delivery_method": "truck",
|
||||||
"order_type": "SCRK",
|
"loading_method": "with_pallet",
|
||||||
"purchase_order_code": "36151",
|
"license_plate": "粤AX2201",
|
||||||
"total_order_lines": 0,
|
"tracking_number": "T202604401114",
|
||||||
"order_create_time": "2026-03-27T07:43:19.000Z",
|
"remark": "[测试新建收货单2]"
|
||||||
"expect_start_time": null,
|
|
||||||
"expect_end_time": null,
|
|
||||||
"logistics_code": "",
|
|
||||||
"logistics_name": "",
|
|
||||||
"express_code": "",
|
|
||||||
"supplier_code": "",
|
|
||||||
"supplier_name": "",
|
|
||||||
"source_type": "API",
|
|
||||||
"order_status": "CREATED",
|
|
||||||
"sync_status": "PENDING",
|
|
||||||
"sync_message": "",
|
|
||||||
"is_enabled": 1,
|
|
||||||
"created_at": "2026-03-27T07:43:19.000Z",
|
|
||||||
"updated_at": "2026-03-27T07:43:19.000Z",
|
|
||||||
"warehouse_id": 1000028,
|
|
||||||
"store_id": 1000147,
|
|
||||||
"remark": "新增入库单2",
|
|
||||||
"store_name": null,
|
|
||||||
"warehouse_name": null,
|
|
||||||
"deleted_at": null,
|
|
||||||
"qimen_owner_code": null,
|
|
||||||
"qimen_warehouse_code": null,
|
|
||||||
"warehouse": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
},
|
|
||||||
"store": {
|
|
||||||
"id": 1000147,
|
|
||||||
"company_name": "广州天豹云仓"
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
返回数据:
|
||||||
{
|
{
|
||||||
"id": 102,
|
"flag": "success",
|
||||||
"entry_order_code": "1919810",
|
"code": 200,
|
||||||
"order_type": "SCRK",
|
"message": "收货任务创建成功",
|
||||||
"purchase_order_code": "114514",
|
"id": 484,
|
||||||
"total_order_lines": 0,
|
"receiving_number": "R20553006",
|
||||||
"order_create_time": "2026-03-27T07:42:17.000Z",
|
"timestamp": 1775790877
|
||||||
"expect_start_time": null,
|
|
||||||
"expect_end_time": null,
|
|
||||||
"logistics_code": "",
|
|
||||||
"logistics_name": "",
|
|
||||||
"express_code": "",
|
|
||||||
"supplier_code": "",
|
|
||||||
"supplier_name": "",
|
|
||||||
"source_type": "API",
|
|
||||||
"order_status": "CREATED",
|
|
||||||
"sync_status": "PENDING",
|
|
||||||
"sync_message": "",
|
|
||||||
"is_enabled": 1,
|
|
||||||
"created_at": "2026-03-27T07:42:17.000Z",
|
|
||||||
"updated_at": "2026-03-27T07:42:17.000Z",
|
|
||||||
"warehouse_id": 1000028,
|
|
||||||
"store_id": 1000147,
|
|
||||||
"remark": "新建入库单测试",
|
|
||||||
"store_name": null,
|
|
||||||
"warehouse_name": null,
|
|
||||||
"deleted_at": null,
|
|
||||||
"qimen_owner_code": null,
|
|
||||||
"qimen_warehouse_code": null,
|
|
||||||
"warehouse": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
},
|
|
||||||
"store": {
|
|
||||||
"id": 1000147,
|
|
||||||
"company_name": "广州天豹云仓"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 101,
|
|
||||||
"entry_order_code": "ENT1774445767744174",
|
|
||||||
"order_type": "QTRK",
|
|
||||||
"purchase_order_code": "PO-COMP-1774445767714",
|
|
||||||
"total_order_lines": 1,
|
|
||||||
"order_create_time": "2026-03-25T13:36:07.000Z",
|
|
||||||
"expect_start_time": null,
|
|
||||||
"expect_end_time": null,
|
|
||||||
"logistics_code": "",
|
|
||||||
"logistics_name": "",
|
|
||||||
"express_code": "",
|
|
||||||
"supplier_code": "",
|
|
||||||
"supplier_name": "",
|
|
||||||
"source_type": "API",
|
|
||||||
"order_status": "COMPLETED",
|
|
||||||
"sync_status": "PENDING",
|
|
||||||
"sync_message": "",
|
|
||||||
"is_enabled": 1,
|
|
||||||
"created_at": "2026-03-25T13:36:07.000Z",
|
|
||||||
"updated_at": "2026-03-25T13:36:08.000Z",
|
|
||||||
"warehouse_id": 1000028,
|
|
||||||
"store_id": 1000028,
|
|
||||||
"remark": "integration-test-complete",
|
|
||||||
"store_name": null,
|
|
||||||
"warehouse_name": null,
|
|
||||||
"deleted_at": null,
|
|
||||||
"qimen_owner_code": null,
|
|
||||||
"qimen_warehouse_code": null,
|
|
||||||
"warehouse": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
},
|
|
||||||
"store": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 100,
|
|
||||||
"entry_order_code": "ENT1774445765920918",
|
|
||||||
"order_type": "QTRK",
|
|
||||||
"purchase_order_code": "PO-1774445765881",
|
|
||||||
"total_order_lines": 0,
|
|
||||||
"order_create_time": "2026-03-25T13:36:05.000Z",
|
|
||||||
"expect_start_time": null,
|
|
||||||
"expect_end_time": null,
|
|
||||||
"logistics_code": "",
|
|
||||||
"logistics_name": "",
|
|
||||||
"express_code": "",
|
|
||||||
"supplier_code": "",
|
|
||||||
"supplier_name": "",
|
|
||||||
"source_type": "API",
|
|
||||||
"order_status": "CANCELLED",
|
|
||||||
"sync_status": "PENDING",
|
|
||||||
"sync_message": "",
|
|
||||||
"is_enabled": 1,
|
|
||||||
"created_at": "2026-03-25T13:36:05.000Z",
|
|
||||||
"updated_at": "2026-03-25T13:36:06.000Z",
|
|
||||||
"warehouse_id": 1000028,
|
|
||||||
"store_id": 1000028,
|
|
||||||
"remark": "integration-test-cancel",
|
|
||||||
"store_name": null,
|
|
||||||
"warehouse_name": null,
|
|
||||||
"deleted_at": null,
|
|
||||||
"qimen_owner_code": null,
|
|
||||||
"qimen_warehouse_code": null,
|
|
||||||
"warehouse": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
},
|
|
||||||
"store": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 99,
|
|
||||||
"entry_order_code": "ENT1774435697353684",
|
|
||||||
"order_type": "QTRK",
|
|
||||||
"purchase_order_code": "PO-COMP-1774435697311",
|
|
||||||
"total_order_lines": 1,
|
|
||||||
"order_create_time": "2026-03-25T10:48:17.000Z",
|
|
||||||
"expect_start_time": null,
|
|
||||||
"expect_end_time": null,
|
|
||||||
"logistics_code": "",
|
|
||||||
"logistics_name": "",
|
|
||||||
"express_code": "",
|
|
||||||
"supplier_code": "",
|
|
||||||
"supplier_name": "",
|
|
||||||
"source_type": "API",
|
|
||||||
"order_status": "COMPLETED",
|
|
||||||
"sync_status": "PENDING",
|
|
||||||
"sync_message": "",
|
|
||||||
"is_enabled": 1,
|
|
||||||
"created_at": "2026-03-25T10:48:17.000Z",
|
|
||||||
"updated_at": "2026-03-25T10:48:17.000Z",
|
|
||||||
"warehouse_id": 1000028,
|
|
||||||
"store_id": 1000028,
|
|
||||||
"remark": "integration-test-complete",
|
|
||||||
"store_name": null,
|
|
||||||
"warehouse_name": null,
|
|
||||||
"deleted_at": null,
|
|
||||||
"qimen_owner_code": null,
|
|
||||||
"qimen_warehouse_code": null,
|
|
||||||
"warehouse": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
},
|
|
||||||
"store": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 98,
|
|
||||||
"entry_order_code": "ENT1774435695468552",
|
|
||||||
"order_type": "QTRK",
|
|
||||||
"purchase_order_code": "PO-1774435695428",
|
|
||||||
"total_order_lines": 0,
|
|
||||||
"order_create_time": "2026-03-25T10:48:15.000Z",
|
|
||||||
"expect_start_time": null,
|
|
||||||
"expect_end_time": null,
|
|
||||||
"logistics_code": "",
|
|
||||||
"logistics_name": "",
|
|
||||||
"express_code": "",
|
|
||||||
"supplier_code": "",
|
|
||||||
"supplier_name": "",
|
|
||||||
"source_type": "API",
|
|
||||||
"order_status": "CANCELLED",
|
|
||||||
"sync_status": "PENDING",
|
|
||||||
"sync_message": "",
|
|
||||||
"is_enabled": 1,
|
|
||||||
"created_at": "2026-03-25T10:48:15.000Z",
|
|
||||||
"updated_at": "2026-03-25T10:48:16.000Z",
|
|
||||||
"warehouse_id": 1000028,
|
|
||||||
"store_id": 1000028,
|
|
||||||
"remark": "integration-test-cancel",
|
|
||||||
"store_name": null,
|
|
||||||
"warehouse_name": null,
|
|
||||||
"deleted_at": null,
|
|
||||||
"qimen_owner_code": null,
|
|
||||||
"qimen_warehouse_code": null,
|
|
||||||
"warehouse": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
},
|
|
||||||
"store": {
|
|
||||||
"id": 1000028,
|
|
||||||
"company_name": "天豹云仓"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"pagination": {
|
|
||||||
"page": 1,
|
|
||||||
"pageSize": 20,
|
|
||||||
"total": 6,
|
|
||||||
"totalPages": 1,
|
|
||||||
"hasPrevious": false,
|
|
||||||
"hasNext": false
|
|
||||||
},
|
|
||||||
"summary": {
|
|
||||||
"total": 6,
|
|
||||||
"pending": 0,
|
|
||||||
"creating": 0,
|
|
||||||
"created": 2,
|
|
||||||
"completed": 2,
|
|
||||||
"cancelled": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"timestamp": 1775725099
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user