Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
a77faa345c
  1. 65
      src/api/eam/item/itemOrderDetail/index.ts
  2. 42
      src/views/eam/item/itemApplyMain/index.vue
  3. 19
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  4. 453
      src/views/eam/item/itemOrderMain/index.vue
  5. 268
      src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

65
src/api/eam/item/itemOrderDetail/index.ts

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface ItemOrderDetailVO {
number: string
date: string
phone: string
fax: string
purchaser: string
supplierNumber: string
supplierName: string
supplierAddress: string
shipTo: string
invoiceTo: string
contacts: string
contactsPhone: string
paymentType: string
registLocation: string
bank: string
account: string
dutyParagraph: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件采购订单主列表
export const getItemOrderDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-order-detail/senior', data })
} else {
return await request.get({ url: `/eam/item-order-detail/page`, params })
}
}
// 查询备件采购订单主详情
export const getItemOrderDetail = async (id: number) => {
return await request.get({ url: `/eam/item-order-detail/get?id=` + id })
}
// 新增备件采购订单主
export const createItemOrderDetail = async (data: ItemOrderDetailVO) => {
return await request.post({ url: `/eam/item-order-detail/create`, data })
}
// 修改备件采购订单主
export const updateItemOrderDetail = async (data: ItemOrderDetailVO) => {
return await request.put({ url: `/eam/item-order-detail/update`, data })
}
// 删除备件采购订单主
export const deleteItemOrderDetail = async (id: number) => {
return await request.delete({ url: `/eam/item-order-detail/delete?id=` + id })
}
// 导出备件采购订单主 Excel
export const exportItemOrderDetail = async (params) => {
return await request.download({ url: `/eam/item-order-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-order-detail/get-import-template' })
}

42
src/views/eam/item/itemApplyMain/index.vue

@ -29,15 +29,15 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" :rules="ItemApplyMainRules" :formAllSchemas="ItemApplyMain.allSchemas" <BasicForm ref="formRef" @success="getList" :rules="ItemApplyMainRules" :formAllSchemas="ItemApplyMain.allSchemas"
:tableAllSchemas="ItemApplyDetail.allSchemas" :tableFormRules="ItemApplyDetailRules" :tableData="tableData" :tableAllSchemas="ItemApplyDetail.allSchemas" :tableFormRules="ItemApplyDetailRules" :tableData="tableData"
:apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain" :isBusiness="true" :apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" :isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@submitForm="submitForm" /> @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="ItemApplyMain.allSchemas" <Detail ref="detailRef" :isBasic="false" :allSchemas="ItemApplyMain.allSchemas"
:detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules" :detailAllSchemas="ItemApplyDetail.allSchemas" :detailAllSchemasRules="ItemApplyDetailRules"
:apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail" :apiCreate="ItemApplyDetailApi.createItemApplyDetail" :apiUpdate="ItemApplyDetailApi.updateItemApplyDetail"
:apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail" :Echo="Echo" :apiPage="ItemApplyDetailApi.getItemApplyDetailPage" :apiDelete="ItemApplyDetailApi.deleteItemApplyDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" /> @searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 --> <!-- 导入 -->
@ -47,7 +47,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import {ItemApplyMain, ItemApplyMainRules, ItemApplyDetail, ItemApplyDetailRules} from './itemApplyMain.data' import { ItemApplyMain, ItemApplyMainRules, ItemApplyDetail, ItemApplyDetailRules } from './itemApplyMain.data'
import * as ItemApplyMainApi from '@/api/eam/item/itemApplyMain' import * as ItemApplyMainApi from '@/api/eam/item/itemApplyMain'
import * as ItemApplyDetailApi from '@/api/eam/item/itemApplyDetail' import * as ItemApplyDetailApi from '@/api/eam/item/itemApplyDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -71,14 +71,14 @@
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async() => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number'] row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn'] row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available'] row['available'] = val[0]['available']
}else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
@ -87,7 +87,7 @@
} }
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async() => { nextTick(async () => {
const setV = {} const setV = {}
// if(formField == 'itemCode'){ // if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({ // await ItembasicApi.getItembasicPage({
@ -169,7 +169,7 @@
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -179,11 +179,11 @@
formRef.value.open(type, row) formRef.value.open(type, row)
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => { const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicItemApplyMain')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id : number) => { const handleDelete = async (id : number) => {
@ -282,4 +282,4 @@
getList() getList()
importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate() importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate()
}) })
</script> </script>

19
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -71,15 +71,16 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isDetail: false,
table: { isForm: false,
width: 150, table: {
fixed: 'right' width: 200,
} fixed: 'right'
} }
}
])) ]))
//表单校验 //表单校验

453
src/views/eam/item/itemOrderMain/index.vue

@ -4,219 +4,282 @@
<Search :schema="ItemOrderMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="ItemOrderMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
:HeadButttondata="HeadButttondata" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
@button-base-click="buttonBaseClick" :allSchemas="ItemOrderMain.allSchemas" />
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemOrderMain.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table <Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total total: tableObject.total
}" }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:pageSize="tableObject.pageSize" v-model:sort="tableObject.sort">
v-model:currentPage="tableObject.currentPage" <template #number="{row}">
v-model:sort="tableObject.sort" <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
> <span>{{ row.number }}</span>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm ref="formRef" @success="getList" :rules="ItemOrderMainRules" :formAllSchemas="ItemOrderMain.allSchemas"
ref="basicFormRef" :tableAllSchemas="ItemOrderDetail.allSchemas" :tableFormRules="ItemOrderDetailRules" :tableData="tableData"
@success="formsSuccess" :apiUpdate="ItemOrderMainApi.updateItemOrderMain" :apiCreate="ItemOrderMainApi.createItemOrderMain"
:rules="ItemOrderMainRules" :isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
:formAllSchemas="ItemOrderMain.allSchemas" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
:apiUpdate="ItemOrderMainApi.updateItemOrderMain"
:apiCreate="ItemOrderMainApi.createItemOrderMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemOrderMain.allSchemas" /> <Detail ref="detailRef" :isBasic="false" :allSchemas="ItemOrderMain.allSchemas"
:detailAllSchemas="ItemOrderDetail.allSchemas" :detailAllSchemasRules="ItemOrderDetailRules"
:apiCreate="ItemOrderDetailApi.createItemOrderDetail" :apiUpdate="ItemOrderDetailApi.updateItemOrderDetail"
:apiPage="ItemOrderDetailApi.getItemOrderDetailPage" :apiDelete="ItemOrderDetailApi.deleteItemOrderDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ItemOrderMain,ItemOrderMainRules } from './itemOrderMain.data' import { ItemOrderMain, ItemOrderMainRules, ItemOrderDetail, ItemOrderDetailRules } from './itemOrderMain.data'
import * as ItemOrderMainApi from '@/api/eam/item/itemOrderMain' import * as ItemOrderMainApi from '@/api/eam/item/itemOrderMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as ItemOrderDetailApi from '@/api/eam/item/itemOrderDetail'
import TableHead from '@/components/TableHead/src/TableHead.vue' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import Detail from '@/components/Detail/src/Detail.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
defineOptions({ name: 'ItemOrderMain' })
//
const message = useMessage() // defineOptions({ name: 'ItemOrderMain' })
const { t } = useI18n() //
const message = useMessage() //
const route = useRoute() // const { t } = useI18n() //
const routeName = ref() const route = useRoute() //
routeName.value = route.name const routeName = ref()
const tableColumns = ref(ItemOrderMain.allSchemas.tableColumns) routeName.value = route.name
const tableColumns = ref(ItemOrderMain.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => { //
nextTick(() => { const updataTableColumns = (val) => {
const setV = {} tableColumns.value = val
setV[formField] = val[0][searchField] }
formRef.setValues(setV)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: ItemOrderMainApi.getItemOrderMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemOrderMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ItemOrderMainApi.deleteItemOrderMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ItemOrderMainApi.exportItemOrderMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
ItemOrderDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
}) })
} const tableData = ref([])
// //
const updataTableColumns = (val) => { const handleAddTable = () => {
tableColumns.value = val tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
} }
//
const { tableObject, tableMethods } = useTable({ const handleDeleteTable = (item, index) => {
getListApi: ItemOrderMainApi.getItemOrderMainPage // tableData.value.splice(index, 1)
}) }
// //
const { getList, setSearchParams } = tableMethods const submitForm = async (formType, data) => {
data.subList = tableData.value //
// try {
const HeadButttondata = [ if (formType === 'create') {
defaultButtons.defaultAddBtn(null), // await ItemOrderMainApi.createItemOrderMain(data)
defaultButtons.defaultExportBtn(null), // message.success(t('common.createSuccess'))
defaultButtons.defaultFreshBtn(null), // } else {
defaultButtons.defaultFilterBtn(null), // await ItemOrderMainApi.updateItemOrderMain(data)
defaultButtons.defaultSetBtn(null), // message.success(t('common.updateSuccess'))
// { }
// label: '', formRef.value.dialogVisible = false
// name: 'zdy', //
// hide: false, getList()
// type: 'primary', } finally {
// icon: 'Select', formRef.value.formLoading = false
// color: '' }
// }, }
]
/** 导入 */
// const importFormRef = ref()
const buttonBaseClick = (val, item) => { const handleImport = () => {
if (val == 'add') { // importFormRef.value.open()
openForm('create') }
} else if (val == 'export') { //
handleExport() //
} else if (val == 'refresh') { // const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList() getList()
} else if (val == 'filtrate') { // }
} else { //
console.log('其他按钮', item) //
} const searchFormClick = (searchData) => {
} tableObject.params = {
isSearch: true,
// - filters: searchData.filters
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ItemOrderMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
} }
getList() //
} }
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; /** 初始化 **/
if (formType === 'create') { onMounted(async () => {
await ItemOrderMainApi.createItemOrderMain(data) getList()
message.success(t('common.createSuccess')) importTemplateData.templateUrl = await ItemOrderMainApi.importTemplate()
} else { })
await ItemOrderMainApi.updateItemOrderMain(data) </script>
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicItemOrderMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemOrderMainApi.deleteItemOrderMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ItemOrderMainApi.exportItemOrderMain(tableObject.params)
download.excel(data, '备件采购订单主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

268
src/views/eam/item/itemOrderMain/itemOrderMain.data.ts

@ -1,77 +1,49 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化
import * as SupplierApi from '@/api/eam/basic/supplier' /**
import { Supplier } from '@/views/eam/basic/supplier/supplier.data' * @returns {Array}
*/
// 表单校验
export const ItemOrderMainRules = reactive({
number: [required],
date: [required],
concurrencyStamp: [required],
})
export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '订单号', label: '申请编号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isForm: false,
isSearch: true, isSearch: true,
}, table: {
{ width: 180,
label: '日期', fixed: 'left'
field: 'date',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}, },
}, },
{ {
label: '采购员', label: '申领人',
field: 'purchaser', field: 'applyId',
sort: 'custom',
},
{
label: '供应商编号',
field: 'supplierNumber',
sort: 'custom', sort: 'custom',
isForm: false,
isSearch: true, isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区编号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '库区信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: "TRUE",
isMainValue: false
}]
}
}
}, },
{ {
label: '供应商名称', label: '审批人',
field: 'supplierName', field: 'approveId',
sort: 'custom', sort: 'custom',
isForm: false,
isSearch: true,
}, },
{ {
label: '联系人', label: '出库人',
field: 'contacts', field: 'outId',
sort: 'custom', sort: 'custom',
isForm: false,
isSearch: true,
}, },
{ {
label: '联系电话', label: '描述',
field: 'contactsPhone', field: 'name',
sort: 'custom', sort: 'custom',
}, },
{ {
@ -99,13 +71,199 @@ export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const ItemOrderMainRules = reactive({
name: [
{ required: true, message: '请填写描述', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
})
/**
* @returns {Array}
*/
export const ItemOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '库区信息',
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '是否以旧换新',
field: 'isRadeIn',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '备注',
field: 'remark',
table: {
width: 150
},
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false,
isForm: false, isForm: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} },
isTableForm: false,
} }
])) ]))
//表单校验
export const ItemOrderDetailRules = reactive({
lineNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
stdPackQty: [
{ required: true, message: '请输入标包数量', trigger: 'blur' }
],
stdPackUnit: [
{ required: true, message: '请选择标包单位', trigger: 'change' }
],
convertRate: [
{ required: true, message: '请输入转换率', trigger: 'blur' }
],
taxRate: [
{ required: true, message: '请输入税率', trigger: 'blur' }
],
shippedQty: [
{ required: true, message: '请输入已发货数量', trigger: 'blur' }
],
receivedQty: [
{ required: true, message: '请输入已收货数量', trigger: 'blur' }
],
returnedQty: [
{ required: true, message: '请输入已退货数量', trigger: 'blur' }
],
putawayQty: [
{ required: true, message: '请输入已上架数量', trigger: 'blur' }
],
overReceivingPercent: [
{ required: true, message: '请输入超收百分比', trigger: 'blur' }
],
orderQty: [
{ required: true, message: '请输入订单数量', trigger: 'blur' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
nuumber: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})

Loading…
Cancel
Save