tada: 🎉 新增盘点抽屉样式调整,待完善
All checks were successful
Release / lint (push) Successful in 52s
Release / Release (push) Successful in 2m9s

This commit is contained in:
my_ong 2025-03-05 23:45:19 +08:00
parent 056672e443
commit fd0e324bc9
4 changed files with 70 additions and 26 deletions

View File

@ -146,6 +146,9 @@ declare namespace material {
/** 物料ids */
ids?: Array<string>
/** 物料类型 */
types?: Array<string>
/** 审核意见 */
reviewRemark?: string

View File

@ -1,4 +1,5 @@
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
export const config: FormConfig = {
layout: 'horizontal',
@ -17,6 +18,7 @@ export const formItems = (
materialOptions: Array<{ value: string | undefined; label: string | undefined }>,
required: boolean,
persons: Array<{ value: string | undefined; label: string | undefined }>,
types: Array<TreeDataNode>,
): FormItem[] => [
{
group: 'form',
@ -32,14 +34,30 @@ export const formItems = (
size: 'default',
optionType: 'button',
buttonStyle: 'solid',
defaultValue: 'ALL',
defaultValue: 'SCAN',
options: [
{ value: 'ALL', label: '全部盘点' },
{ value: 'PARTIAL', label: '部分盘点' },
{ value: 'SCAN', label: '扫码盘点' },
{ value: 'PARTIAL', label: '人工盘点' },
],
},
rules: [],
},
{
type: 'tree-select',
group: 'form',
config: {
label: '物料类型选择',
name: 'types',
required: true,
},
properties: {
size: 'default',
placeholder: '请选择物料类型',
multiple: true,
treeData: types,
},
rules: [],
},
{
group: 'form',
type: 'select',
@ -49,6 +67,7 @@ export const formItems = (
hasFeedback: false,
label: '物料选择',
name: 'ids',
required: true,
},
properties: {
size: 'default',

View File

@ -78,7 +78,6 @@
v-model="applyForm"
:form-items="items"
:config="formConfig"
:disabled-fields="disabledFields"
title="扫码盘点"
@ok="doSave"
/>
@ -121,6 +120,7 @@
import { useUserStore } from '@/stores/user'
import scanForm from '../component/scan-form.vue'
import resultForm from './result-form.vue'
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
const searchKey = ref('')
const userStore = useUserStore()
@ -135,6 +135,7 @@
applyDate: dayjs() + '',
confirm: false,
reviewResult: 'WAIT_SCAN',
types: [],
})
const msg = ref()
const totalValue = ref(0) //
@ -147,14 +148,6 @@
const materialList = ref<Array<{ value: string | undefined; label: string | undefined }>>([])
const personList = ref<Array<{ value: string | undefined; label: string | undefined }>>([])
const required = ref(true)
api.materialApi.material.all({}, (data) => {
materialList.value = data.map((item) => {
return {
value: item?.id + '',
label: item?.name,
}
})
})
api.aclApi.user.all((data) => {
personList.value = data.map((item) => {
return {
@ -164,19 +157,48 @@
})
})
//
const disabledFields = computed(() => {
return applyForm.value?.auditType === 'ALL' ? ['ids'] : []
})
// //
// const disabledFields = computed(() => {
// return applyForm.value?.auditType === 'ALL' ? ['ids'] : []
// })
//
watch(applyForm, () => {
if (applyForm.value && applyForm.value.auditType === 'ALL') {
required.value = false
} else {
required.value = true
}
//
watch(
applyForm,
() => {
if (applyForm.value && applyForm.value.types && applyForm.value.types.length > 0) {
getMaterialList()
}
},
{
immediate: true,
deep: true,
},
)
//
const types = ref<Array<TreeDataNode>>([])
api.materialApi.type.trees((data) => {
types.value = children(data)
})
const children = (res: Array<material.TypeTree>): Array<TreeDataNode> => {
return res.map((areaTree) => ({
label: areaTree.label,
value: areaTree.value,
children: areaTree.children ? children(areaTree.children) : [],
key: areaTree.value,
}))
}
const getMaterialList = async () => {
await api.materialApi.material.all({ type: '' }, (data) => {
materialList.value = data.map((item) => {
return {
value: item?.id + '',
label: item?.name,
}
})
})
}
//
const formDrawer = ref<typeof FormDrawer>()
@ -186,7 +208,7 @@
//
const items = computed(() => {
//required
return formItems(materialList.value, required.value, personList.value)
return formItems(materialList.value, required.value, personList.value, types.value)
})
//
const loadData = async (page = 1, size = 10) => {

View File

@ -59,8 +59,8 @@ export default defineConfig(({ mode }) => {
open: true,
proxy: {
'/api': {
// target: 'https://ims.riemann.tech/api/',
target: 'http://127.0.0.1:8888',
target: 'https://ims.riemann.tech/api/',
// target: 'http://127.0.0.1:8888',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},