Browse Source

新增和详情

master
zhangli 1 year ago
parent
commit
b65f830447
  1. 6
      src/utils/disposition/defaultButtons.ts
  2. 124
      src/views/wms/itembasic/ItembasicDetail.vue
  3. 87
      src/views/wms/itembasic/ItembasicForm.vue
  4. 2
      src/views/wms/itempackaging/index.vue

6
src/utils/disposition/defaultButtons.ts

@ -119,7 +119,8 @@ export function formSaveBtn(option:any) {
hide: false,
type: 'primary',
icon: 'ep:select',
color: ''
color: '',
float:'right'
})
}
@ -130,7 +131,8 @@ export function formCloseBtn(option:any) {
name: 'close',
hide: false,
icon: 'ep:closeBold',
color: ''
color: '',
float:'right'
})
}

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

@ -1,37 +1,37 @@
<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>
<div class="font-size-18px">
{{ detailData.code }} <span class="ml-20px font-size-16px">{{ detailData.name }}</span>
</div>
</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>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="详情" name="Detail">
<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>
</el-tab-pane>
<el-tab-pane :label="item.value" :name="item.label" v-for="(item,index) in tabs" :key="index">
<ContentWrap>
<Table :columns="ItemBasic.allSchemas.tableColumns" :data="tableObject.tableList" :loading="tableObject.loading"
:pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" />
</ContentWrap>
</el-tab-pane>
</el-tabs>
</template>
<script lang="ts" setup>
@ -42,11 +42,13 @@ 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'
const { query } = useRoute() //
import * as ItembasicApi from '@/api/wms/itembasic'
import * as UserApi from '@/api/system/user'
const activeName = ref('Detail')
//
const queryParams = reactive({
title: '',
@ -107,6 +109,11 @@ const changeRecordData = reactive({
}]
}]
})
const detailData = ref("")//
onMounted(async () => {
//
detailData.value = await getItembasic(query.id)
})
//
const importTemplateData = reactive({
templateUrl: UserApi.importUserTemplate(),
@ -138,13 +145,52 @@ const deleteAnnexSuccess = async () => {
}
//
const remarksSubmitSucss = () => {
console.log('提交陈工');
console.log('提交成功');
}
const detailData = ref()
const { query } = useRoute() //
console.log(query);
onMounted(async () => {
//
detailData.value =await getItembasic(query.id)
//
// const supplierItems = reactive({
// supplierItemsList: [{
// code: '646456',
// name: '978978'
// }],
// total: 20,
// pageSize: 1,
// currentPage: 2
// })
// tabs
const tabs = ref([{
value:'供应商物品',
label:'SupplierItems'
}, {
value: '客户物品',
label: 'CustomerItems'
}, {
value: '采购订单',
label: 'PurchaseOrder'
}, {
value: '要货计划',
label: 'PurchasingPlan'
}, {
value: '库存余额',
label: 'InventoryBalance'
}, {
value: '库存事务',
label: 'InventoryTransactions'
}, {
value: '预计入库存',
label: 'ExpectedIn'
}, {
value: '预计出库存',
label: 'ExpectedOut'
}])
//
const { tableObject, tableMethods } = useTable({
getListApi: ItembasicApi.getItembasicPage //
})
console.log(tableObject);
//
const { getList, setSearchParams } = tableMethods
getList()
</script>

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

@ -5,8 +5,13 @@
</div>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
<!-- <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> -->
<!-- 列表头部 -->
<TableHead
:HeadButttondata="Butttondata"
@buttonBaseClick="buttonBaseClick"
/>
</template>
</Dialog>
@ -15,6 +20,7 @@
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import * as ItembasicApi from '@/api/wms/itembasic'
import { ItemBasic, ItemBasicRules } from '@/utils/disposition/tableColumns.ts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
const { t } = useI18n() //
const message = useMessage() //
@ -23,49 +29,6 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
code: undefined,
name: undefined,
desc1: undefined,
desc2: undefined,
status: undefined,
uom: undefined,
altUom: undefined,
isStdPack: undefined,
enableBuy: undefined,
enableMake: undefined,
enableOutsourcing: undefined,
isRecycled: undefined,
isPhantom: undefined,
abcClass: undefined,
type: undefined,
category: undefined,
itemGroup: undefined,
color: undefined,
configuration: undefined,
project: undefined,
eqLevel: undefined,
validityDays: undefined,
available: undefined,
activeTime: undefined,
expireTime: undefined,
remark: undefined
})
const formRules = reactive({
code: [{ required: true, message: '代码不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }],
uom: [{ 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' }],
validityDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
available: [{ required: true, message: '是否可用不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
@ -75,14 +38,14 @@ const open = async (type: string, id?: number) => {
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await ItembasicApi.getItembasic(id)
} finally {
formLoading.value = false
}
}
// if (id) {
// formLoading.value = true
// try {
// formData.value = await ItembasicApi.getItembasic(id)
// } finally {
// formLoading.value = false
// }
// }
}
defineExpose({ open }) // open
@ -144,6 +107,24 @@ const resetForm = () => {
}
formRef.value?.resetFields()
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
console.log(417, item)
}
//
else if (val == 'close') {
dialogVisible.value = false
}
}
</script>
<style scoped>

2
src/views/wms/itempackaging/index.vue

@ -173,6 +173,8 @@ const HeadButttondata = [
// color: ''
// },
]
console.log(HeadButttondata);
//
const buttonBaseClick = (val, item) => {

Loading…
Cancel
Save