陈薪名 1 year ago
parent
commit
69e33b143e
  1. 6
      src/components/Annex/src/Annex.vue
  2. 3
      src/components/ChangeRecord/src/ChangeRecord.vue
  3. 6
      src/components/Descriptions/src/Descriptions.vue
  4. 2
      src/components/Form/src/Form.vue
  5. 16
      src/components/Remarks/src/Remarks.vue
  6. 22
      src/router/modules/remaining.ts
  7. 84
      src/utils/disposition/tableColumns.ts
  8. 47
      src/views/detail/detail/index.vue
  9. 150
      src/views/wms/itembasic/ItembasicDetail.vue
  10. 191
      src/views/wms/itembasic/ItembasicForm.vue
  11. 27
      src/views/wms/itembasic/index.vue

6
src/components/Annex/src/Annex.vue

@ -10,7 +10,7 @@
</div> </div>
<div class="list"> <div class="list">
<div class="item flex items-start" v-for="(item, index) in data.annexList" :key="index"> <div class="item flex items-start" v-for="(item, index) in data.annexList" :key="index">
<Icon icon="fa:file-text-o" color="#409eff" size="40" class="mt-4px" /> <Icon icon="fa:file-text-o" color="#409eff" size="30" class="mt-4px" />
<div class="item-center"> <div class="item-center">
<div class="item-title">{{ item.title}}</div> <div class="item-title">{{ item.title}}</div>
<div class="info mt-6px"> <div class="info mt-6px">
@ -18,7 +18,7 @@
<div>{{ item.size }}</div> <div>{{ item.size }}</div>
<div>来自 {{ item.people }}</div> <div>来自 {{ item.people }}</div>
</div> </div>
<Icon icon="ep:delete" class="cursor-pointer" size="20" @click="deleteAnnex(item)"/> <Icon icon="ep:delete" class="cursor-pointer" size="18" @click="deleteAnnex(item)"/>
</div> </div>
<div class="time mt-6px ">{{ item.time }}</div> <div class="time mt-6px ">{{ item.time }}</div>
</div> </div>
@ -86,7 +86,7 @@ const deleteAnnex =async (item) => {
overflow: hidden; overflow: hidden;
.item-title { .item-title {
font-size: 18px; font-size: 16px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;

3
src/components/ChangeRecord/src/ChangeRecord.vue

@ -84,7 +84,6 @@ const downFile = (cur)=>{
.time { .time {
font-weight: normal !important; font-weight: normal !important;
;
} }
.dic { .dic {
@ -96,7 +95,7 @@ const downFile = (cur)=>{
} }
.tips { .tips {
font-size: 16px; font-size: 14px;
margin-top: 6px; margin-top: 6px;
} }
.file{ .file{

6
src/components/Descriptions/src/Descriptions.vue

@ -21,6 +21,7 @@ const props = defineProps({
message: propTypes.string.def(''), message: propTypes.string.def(''),
collapse: propTypes.bool.def(true), collapse: propTypes.bool.def(true),
columns: propTypes.number.def(1), columns: propTypes.number.def(1),
width: propTypes.string.def('5 0px'),
schema: { schema: {
type: Array as PropType<DescriptionsSchema[]>, type: Array as PropType<DescriptionsSchema[]>,
default: () => [] default: () => []
@ -94,7 +95,7 @@ const toggleClick = () => {
</div> </div>
<ElCollapseTransition> <ElCollapseTransition>
<div v-show="show" :class="[`${prefixCls}-content`, 'p-10px']"> <div v-show="show" :class="[`${prefixCls}-content`]">
<ElDescriptions <ElDescriptions
:column="props.columns" :column="props.columns"
:direction="mobile ? 'vertical' : 'horizontal'" :direction="mobile ? 'vertical' : 'horizontal'"
@ -107,8 +108,9 @@ const toggleClick = () => {
<ElDescriptionsItem <ElDescriptionsItem
v-for="item in schema" v-for="item in schema"
:key="item.field" :key="item.field"
min-width="80"
v-bind="getBindItemValue(item)" v-bind="getBindItemValue(item)"
label-align="right"
:width="width"
> >
<template #label> <template #label>
<slot <slot

2
src/components/Form/src/Form.vue

@ -166,7 +166,7 @@ export default defineComponent({
<Com {...{ contentPosition: 'left', ...item.componentProps }}>{item?.label}</Com> <Com {...{ contentPosition: 'left', ...item.componentProps }}>{item?.label}</Com>
) : isCol ? ( ) : isCol ? (
// ElCol // ElCol
<ElCol {...setGridProp(item.colProps)}>{renderFormItem(item)}</ElCol> <ElCol {...setGridProp(item.colProps)}>{renderFormItem(item)}</ElCol>
) : ( ) : (
renderFormItem(item) renderFormItem(item)
) )

16
src/components/Remarks/src/Remarks.vue

@ -7,20 +7,20 @@
<div class="list"> <div class="list">
<div class="item flex items-start" v-for="(item, index) in data.remarksList" :key="index"> <div class="item flex items-start" v-for="(item, index) in data.remarksList" :key="index">
<div class="user-icon mt-4px"> <div class="user-icon mt-4px">
<Icon icon="fa-solid:user" color="#fff" size="20" /> <Icon icon="fa-solid:user" color="#fff" size="16" />
</div> </div>
<div class="item-center"> <div class="item-center">
<div class="item-title"> <div class="item-title">
<div class="item-title-txt">{{ item.name }}</div> <div class="item-title-txt">{{ item.name }}</div>
<div class="time">{{ item.time }}</div> <div class="time">{{ item.time }}</div>
</div> </div>
<div class="mt-8px color-#303133 font-size-16px">{{ item.text }}</div> <div class="mt-8px color-#303133 font-size-14px">{{ item.text }}</div>
</div> </div>
</div> </div>
</div> </div>
<div class="add-remarks flex items-center mt-20px"> <div class="add-remarks flex items-center mt-20px">
<el-input v-model="remark" placeholder="请输入备注" :input-style="{height:'40px'}"/> <el-input v-model="remark" placeholder="请输入备注" />
<el-button class="ml-16px" type="primary" @click="handleSubmit" size="large"> <el-button class="ml-16px" type="primary" @click="handleSubmit" >
确定 确定
</el-button> </el-button>
</div> </div>
@ -75,8 +75,8 @@ const handleSubmit = ()=>{
padding: 20px 0px 10px; padding: 20px 0px 10px;
.user-icon { .user-icon {
width: 40px; width: 34px;
height: 40px; height: 34px;
background: #dedfe0; background: #dedfe0;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
@ -94,8 +94,8 @@ const handleSubmit = ()=>{
align-items: flex-end; align-items: flex-end;
.item-title-txt { .item-title-txt {
font-size: 20px; font-size: 16px;
color: #9e9e9e; color: #333;
} }
.time { .time {

22
src/router/modules/remaining.ts

@ -329,6 +329,28 @@ const remainingRouter: AppRouteRecordRaw[] = [
} }
} }
] ]
},
{
path: '/wms',
component: Layout,
name: 'wms',
meta: {
hidden: true
},
children: [
{
path: '/wms/itembasic-manage/itembasic-detail',
component: () => import('@/views/wms/itembasic/ItembasicDetail.vue'),
name: 'ItembasicDetail',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '物品详情',
activeMenu: '/wms/itembasic-manage/itembasic'
}
}
]
} }
] ]

84
src/utils/disposition/tableColumns.ts

@ -193,16 +193,18 @@ export const ItemBasic = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime', field: 'createTime',
isTable: true, isTable: true,
formatter: dateFormatter, formatter: dateFormatter,
isForm: false,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
} }
}, },
{ label: '备注', field: 'remark', isTable: false }, { label: '备注', field: 'remark', isTable: false },
{ label: '创建者ID', field: 'creator', isTable: false }, { label: '创建者ID', field: 'creator', isTable: false, isForm: false },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false, isDetail: false,
isForm: false ,
table: { table: {
width: 150 width: 150
} }
@ -211,19 +213,75 @@ export const ItemBasic = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验 // 表单校验
export const ItemBasicRules = reactive({ export const ItemBasicRules = reactive({
mail: [ code: [
{ required: true, message: 'profile.rules.mail', trigger: 'blur' }, { required: true, message: '请输入代码', trigger: 'blur' }
{ ],
type: 'email', name: [
message: 'profile.rules.truemail', { required: true, message: '请输入名称', trigger: 'blur' }
trigger: ['blur', 'change'] ],
} status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
altUom: [
{ required: true, message: '请选择替代计量单位', trigger: 'change' }
],
isStdPack: [
{ required: true, message: '请选择是否标包', trigger: 'change' }
],
enableBuy: [
{ required: true, message: '请选择是否可采购', trigger: 'change' }
],
enableMake: [
{ required: true, message: '请选择是否可制造', trigger: 'change' }
],
enableOutsourcing: [
{ required: true, message: '请选择是否可委外加工', trigger: 'change' }
],
isRecycled: [
{ required: true, message: '请选择回收件', trigger: 'change' }
],
isPhantom: [
{ required: true, message: '请选择虚零件', trigger: 'change' }
],
abcClass: [
{ required: true, message: '请选择ABC类', trigger: 'change' }
],
type: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
category: [
{ required: true, message: '请选择种类', trigger: 'change' }
],
itemGroup: [
{ required: true, message: '请选择分组', trigger: 'change' }
],
color: [
{ required: true, message: '请选择颜色', trigger: 'change' }
],
configuration: [
{ required: true, message: '请选择配置', trigger: 'change' }
],
project: [
{ required: true, message: '请输入项目', trigger: 'blur' }
],
eqLevel: [
{ required: true, message: '请选择质量等级', trigger: 'change' }
],
validityDays: [
{ required: true, message: '请输入有效天数', trigger: 'change' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
activeTime: [
{ required: true, message: '请输入生效时间', trigger: 'change' }
],
expireTime: [
{ required: true, message: '请输入失效时间', trigger: 'change' }
], ],
username: [required],
password: [required],
host: [required],
port: [required],
sslEnable: [required]
}) })
/** /**

47
src/views/detail/detail/index.vue

@ -18,7 +18,7 @@
<div class="flex"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[73%]"> <ContentWrap class="w-[73%]">
1 <Form ref="formRef" v-loading="formLoading" :rules="rules" :schema="ItemBasic.allSchemas.formSchema" :is-col="true"/>
</ContentWrap> </ContentWrap>
<ContentWrap class="w-[27%] ml-16px"> <ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 --> <!-- 附件组件 -->
@ -39,7 +39,11 @@ import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue' import Remarks from '@/components/Remarks/src/Remarks.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue' import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import { ItemBasic } from '@/utils/disposition/tableColumns.ts'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
// //
const queryParams = reactive({ const queryParams = reactive({
title: '', title: '',
@ -49,7 +53,7 @@ const queryParams = reactive({
pageSize: 100 pageSize: 100
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
// const formLabel = ref(ItemBasic)//formlabel
// //
const annexData = reactive({ const annexData = reactive({
annexList: [{ annexList: [{
@ -133,4 +137,43 @@ const deleteAnnexSuccess = async () => {
const remarksSubmitSucss=()=>{ const remarksSubmitSucss=()=>{
console.log('提交陈工'); console.log('提交陈工');
} }
import * as MailAccountApi from '@/api/system/mail/account'
import { allSchemas, rules } from '@/views/system/mail/account/account.data'
const { t } = useI18n() //
const message = useMessage() //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formRef = ref() // Ref
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.getElFormRef().validate()
if (!valid) return
//
formLoading.value = true
try {
const data = formRef.value.formModel as MailAccountApi.MailAccountVO
if (formType.value === 'create') {
await MailAccountApi.createMailAccount(data)
message.success(t('common.createSuccess'))
} else {
await MailAccountApi.updateMailAccount(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
</script> </script>

150
src/views/wms/itembasic/ItembasicDetail.vue

@ -0,0 +1,150 @@
<template>
<!-- 搜索工作栏 -->
<ContentWrap>
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="部门名称" prop="title">
<el-input v-model="queryParams.name" placeholder="请输入部门名称" clearable class="!w-240px" />
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 搜索
</el-button>
<el-button type="info" plain @click="resetQuery">
<Icon icon="ep:refresh" class="mr-5px" /> 重置
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<div class="flex">
<!-- 详情 -->
<ContentWrap class="w-[73%]">
<Descriptions :data="detailData" :schema="ItemBasic.allSchemas.detailSchema" :columns="2"/>
</ContentWrap>
<ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 -->
<Annex :data="annexData" @handleImport="handleImport" @deleteAnnex="deleteAnnexSuccess" />
<!-- 备注组件 -->
<Remarks :data="remarksData" class="mt-20px" @submitSucss="remarksSubmitSucss" />
<!-- 变更记录组件 -->
<ChangeRecord :data="changeRecordData" class="mt-20px" />
</ContentWrap>
<!-- 用户导入对话框 -->
<ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" />
</div>
</template>
<script lang="ts" setup>
defineOptions({ name: 'Detail' })
import Annex from '@/components/Annex/src/Annex.vue'
import Remarks from '@/components/Remarks/src/Remarks.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import { ItemBasic } from '@/utils/disposition/tableColumns.ts'
import { getItembasic } from '@/api/wms/itembasic'
import * as UserApi from '@/api/system/user'
//
const queryParams = reactive({
title: '',
name: undefined,
status: undefined,
pageNo: 1,
pageSize: 100
})
const queryFormRef = ref() //
// const formLabel = ref(ItemBasic)//formlabel
//
const annexData = reactive({
annexList: [{
title: '文件名文件名2023-12-12.docx',
size: '150.02KB',
people: '贾先生',
time: '2023年5月6日 17:16:00',
}, {
title: '文件名文件名2023-12-15.docx',
size: '242KB',
people: '张张',
time: '2022年12月12日 17:16:00',
}]
})
//
const remarksData = reactive({
remarksList: [{
name: '诸葛亮',
text: '转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆?人有悲欢离合,月有阴晴圆缺,此事古难全。但愿人长久,千里共婵娟。',
time: '2023年5月6日 17:16:00',
}, {
name: '刘备',
text: '转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆?人有悲欢离合,月有阴晴圆缺,此事古难全。但愿人长久,千里共婵娟。',
time: '2022年12月12日 17:16:00',
}]
})
//
const changeRecordData = reactive({
changeRecordList: [{
name: '诸葛亮',
type: 1,
time: '2023年5月6日 17:16:00',
}, {
name: '刘备',
type: 2,
time: '2023年5月6日 17:16:00',
}, {
name: '曹操',
type: 3,
time: '2023年5月6日 17:16:00',
file: [{
name: '这是个附件的名字.docx',
url: 'http://localhost:12080/admin-api/system/user/get-import-template'
}, {
name: '这是个附件的名字.docx',
url: 'http://localhost:12080/admin-api/system/user/get-import-template'
}]
}]
})
//
const importTemplateData = reactive({
templateUrl: UserApi.importUserTemplate(),
templateTitle: '导入模版99.xls'
})
//
const importSuccess = () => {
}
/** 搜索按钮操作 */
const handleQuery = () => {
}
/** 重置按钮操作 */
const resetQuery = () => {
queryParams.pageNo = 1
queryFormRef.value.resetFields()
}
/** 用户导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const deleteAnnexSuccess = async () => {
console.log('删除成功');
}
//
const remarksSubmitSucss = () => {
console.log('提交陈工');
}
const detailData = ref()
const { query } = useRoute() //
console.log(query);
onMounted(async () => {
//
detailData.value =await getItembasic(query.id)
})
</script>

191
src/views/wms/itembasic/ItembasicForm.vue

@ -1,192 +1,8 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 600px;overflow-y: auto;"> <div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading" <Form ref="formRef" v-loading="formLoading" :rules="ItemBasicRules" :schema="ItemBasic.allSchemas.formSchema" :is-col="true"/>
>
<el-row>
<el-col :span="12">
<el-form-item label="代码" prop="code">
<el-input v-model="formData.code" placeholder="请输入代码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述1" prop="desc1">
<el-input v-model="formData.desc1" placeholder="请输入描述1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述2" prop="desc2">
<el-input v-model="formData.desc2" placeholder="请输入描述2" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择状态">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_STATUS)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计量单位" prop="uom">
<el-select v-model="formData.uom" placeholder="请选择计量单位">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="替代计量单位" prop="altUom">
<el-select v-model="formData.altUom" placeholder="请选择替代计量单位">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否标包" prop="isStdPack">
<el-select v-model="formData.isStdPack" placeholder="请选择是否标包">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可采购" prop="enableBuy">
<el-select v-model="formData.enableBuy" placeholder="请选择可采购">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可制造" prop="enableMake">
<el-select v-model="formData.enableMake" placeholder="请选择可制造">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可委外加工" prop="enableOutsourcing">
<el-select v-model="formData.enableOutsourcing" placeholder="请选择可委外加工">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="回收件" prop="isRecycled">
<el-select v-model="formData.isRecycled" placeholder="请选择回收件">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="虚零件" prop="isPhantom">
<el-select v-model="formData.isPhantom" placeholder="请选择虚零件">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="ABC类" prop="abcClass">
<el-select v-model="formData.abcClass" placeholder="请选择ABC类">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择类型">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="种类" prop="category">
<el-select v-model="formData.category" placeholder="请选择种类">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CATEGORY)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="分组" prop="itemGroup">
<el-select v-model="formData.itemGroup" placeholder="请选择分组">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_GROUP)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="颜色" prop="color">
<el-select v-model="formData.color" placeholder="请选择颜色">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_COLOR)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="配置" prop="configuration">
<el-select v-model="formData.configuration" placeholder="请选择配置">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.ITEM_CONFIGURATION)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目" prop="project">
<el-input v-model="formData.project" placeholder="请输入项目" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="质量等级" prop="eqLevel">
<el-select v-model="formData.eqLevel" placeholder="请选择质量等级">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.EQ_LEVEL)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效天数" prop="validityDays">
<el-input v-model="formData.validityDays" placeholder="请输入有效天数" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-input v-model="formData.available" placeholder="请输入是否可用" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效时间" prop="activeTime">
<el-date-picker style="width: 100%;" v-model="formData.activeTime" type="date" value-format="x"
placeholder="选择生效时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="失效时间" prop="expireTime">
<el-date-picker style="width: 100%;" v-model="formData.expireTime" type="date" value-format="x"
placeholder="选择失效时间" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div> </div>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
@ -198,6 +14,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import { ItemBasic, ItemBasicRules } from '@/utils/disposition/tableColumns.ts'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //

27
src/views/wms/itembasic/index.vue

@ -2,6 +2,10 @@
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="ItemBasic.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="ItemBasic.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  <el-button type="primary" @click="openForm('create')">
      <Icon icon="ep:plus" class="mr-5px" /> 新增
    </el-button>
<!-- <el-form <!-- <el-form
class="-mb-15px" class="-mb-15px"
:model="queryParams" :model="queryParams"
@ -388,6 +392,14 @@
> >
编辑 编辑
</el-button> </el-button>
<el-button
link
type="primary"
@click="openDetail(row.id)"
v-hasPermi="['wms:itembasic:update']"
>
详情
</el-button>
<el-button <el-button
link link
type="danger" type="danger"
@ -400,15 +412,17 @@
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<ItembasicForm ref="formRef" @success="getList" /> <ItembasicForm ref="formRef" @success="getList" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import ItembasicForm from './ItembasicForm.vue' import ItembasicForm from './ItembasicForm.vue'
import ItembasicDetail from './ItembasicDetail.vue'
import { ItemBasic } from '@/utils/disposition/tableColumns' import { ItemBasic } from '@/utils/disposition/tableColumns'
const router = useRouter() //
// tableObject // tableObject
// tableMethods // tableMethods
@ -465,6 +479,15 @@ const formRef = ref()
const openForm = (type: string, id?: number) => { const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
const openDetail = (id?: number) => {
// detailRef.value.open(id)
router.push({
path: '/wms/itembasic-manage/itembasic-detail',
query:{
id
}
})
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {

Loading…
Cancel
Save