Browse Source

新增和详情

master
zhangli 1 year ago
parent
commit
b65f830447
  1. 6
      src/utils/disposition/defaultButtons.ts
  2. 92
      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, hide: false,
type: 'primary', type: 'primary',
icon: 'ep:select', icon: 'ep:select',
color: '' color: '',
float:'right'
}) })
} }
@ -130,7 +131,8 @@ export function formCloseBtn(option:any) {
name: 'close', name: 'close',
hide: false, hide: false,
icon: 'ep:closeBold', icon: 'ep:closeBold',
color: '' color: '',
float:'right'
}) })
} }

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

@ -1,24 +1,14 @@
<template> <template>
<!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px"> <div class="font-size-18px">
<el-form-item label="部门名称" prop="title"> {{ detailData.code }} <span class="ml-20px font-size-16px">{{ detailData.name }}</span>
<el-input v-model="queryParams.name" placeholder="请输入部门名称" clearable class="!w-240px" /> </div>
</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> </ContentWrap>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="详情" name="Detail">
<div class="flex"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[73%]"> <ContentWrap class="w-[73%]">
<Descriptions :data="detailData" :schema="ItemBasic.allSchemas.detailSchema" :columns="2" /> <Descriptions :data="detailData" :schema="ItemBasic.allSchemas.detailSchema" :columns="2" />
</ContentWrap> </ContentWrap>
<ContentWrap class="w-[27%] ml-16px"> <ContentWrap class="w-[27%] ml-16px">
@ -32,6 +22,16 @@
<!-- 用户导入对话框 --> <!-- 用户导入对话框 -->
<ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" />
</div> </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> </template>
<script lang="ts" setup> <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 ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import { ItemBasic } from '@/utils/disposition/tableColumns.ts' import { ItemBasic } from '@/utils/disposition/tableColumns.ts'
import { getItembasic } from '@/api/wms/itembasic' import { getItembasic } from '@/api/wms/itembasic'
const { query } = useRoute() //
import * as ItembasicApi from '@/api/wms/itembasic'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
const activeName = ref('Detail')
// //
const queryParams = reactive({ const queryParams = reactive({
title: '', title: '',
@ -107,6 +109,11 @@ const changeRecordData = reactive({
}] }]
}] }]
}) })
const detailData = ref("")//
onMounted(async () => {
//
detailData.value = await getItembasic(query.id)
})
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: UserApi.importUserTemplate(), templateUrl: UserApi.importUserTemplate(),
@ -138,13 +145,52 @@ const deleteAnnexSuccess = async () => {
} }
// //
const remarksSubmitSucss = () => { const remarksSubmitSucss = () => {
console.log('提交陈工'); console.log('提交成功');
} }
const detailData = ref() //
const { query } = useRoute() // // const supplierItems = reactive({
console.log(query); // supplierItemsList: [{
onMounted(async () => { // code: '646456',
// // name: '978978'
detailData.value =await getItembasic(query.id) // }],
// 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> </script>

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

@ -5,8 +5,13 @@
</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>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button> -->
<!-- 列表头部 -->
<TableHead
:HeadButttondata="Butttondata"
@buttonBaseClick="buttonBaseClick"
/>
</template> </template>
</Dialog> </Dialog>
@ -15,6 +20,7 @@
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' import { ItemBasic, ItemBasicRules } from '@/utils/disposition/tableColumns.ts'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -23,49 +29,6 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - 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 const formRef = ref() // Ref
/** 打开弹窗 */ /** 打开弹窗 */
@ -75,14 +38,14 @@ const open = async (type: string, id?: number) => {
formType.value = type formType.value = type
resetForm() resetForm()
// //
if (id) { // if (id) {
formLoading.value = true // formLoading.value = true
try { // try {
formData.value = await ItembasicApi.getItembasic(id) // formData.value = await ItembasicApi.getItembasic(id)
} finally { // } finally {
formLoading.value = false // formLoading.value = false
} // }
} // }
} }
defineExpose({ open }) // open defineExpose({ open }) // open
@ -144,6 +107,24 @@ const resetForm = () => {
} }
formRef.value?.resetFields() 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> </script>
<style scoped> <style scoped>

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

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

Loading…
Cancel
Save