Browse Source

增加时间必输校验

master_hella_20240701
zhaoxuebing 8 months ago
parent
commit
34fc48450e
  1. 65
      src/api/wms/supplierinvoiceInvoiced/index.ts
  2. 6
      src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/sparepartsrequisitionRequestMain.data.ts
  3. 6
      src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts
  4. 84
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts
  5. 274
      src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue
  6. 149
      src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts

65
src/api/wms/supplierinvoiceInvoiced/index.ts

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface SupplierinvoiceInvoicedVO {
id: number
tax: number
projectCode: string
billType: string
recvBillNum: string
asnBillNum: string
supplierCode: string
poNumber: string
poLine: string
purchasePrice: number
invoicableQuantity: number
itemCode: string
uom: string
currency: string
remark: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询待开票列表
export const getSupplierinvoiceInvoicedPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/supplierinvoice-invoiced/senior', data })
} else {
return await request.get({ url: `/wms/supplierinvoice-invoiced/page`, params })
}
}
// 查询待开票详情
export const getSupplierinvoiceInvoiced = async (id: number) => {
return await request.get({ url: `/wms/supplierinvoice-invoiced/get?id=` + id })
}
// 新增待开票
export const createSupplierinvoiceInvoiced = async (data: SupplierinvoiceInvoicedVO) => {
return await request.post({ url: `/wms/supplierinvoice-invoiced/create`, data })
}
// 修改待开票
export const updateSupplierinvoiceInvoiced = async (data: SupplierinvoiceInvoicedVO) => {
return await request.put({ url: `/wms/supplierinvoice-invoiced/update`, data })
}
// 删除待开票
export const deleteSupplierinvoiceInvoiced = async (id: number) => {
return await request.delete({ url: `/wms/supplierinvoice-invoiced/delete?id=` + id })
}
// 导出待开票 Excel
export const exportSupplierinvoiceInvoiced = async (params) => {
return await request.download({ url: `/wms/supplierinvoice-invoiced/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/supplierinvoice-invoiced/get-import-template' })
}

6
src/views/wms/inventoryjobManage/sparepartsrequisition/sparepartsrequisitionRequestMain/sparepartsrequisitionRequestMain.data.ts

@ -341,6 +341,12 @@ export const UnplannedissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const UnplannedissueRequestMainRules = reactive({
requestTime: [
{ required: true, message: '请输入申请时间', trigger: 'blur' }
],
dueTime: [
{ required: true, message: '请输入截止时间', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],

6
src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts

@ -341,6 +341,12 @@ export const UnplannedissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const UnplannedissueRequestMainRules = reactive({
requestTime: [
{ required: true, message: '请输入申请时间', trigger: 'blur' }
],
dueTime: [
{ required: true, message: '请输入截止时间', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],

84
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

@ -1027,6 +1027,90 @@ export const UnplannedreceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSc
}
}
},
{
label: '到货日期',
field: 'arriveDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
{
label: '生产日期',
field: 'produceDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
{
label: '过期日期',
field: 'expireDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled:true
}
},
{
label: '来源生产线代码',
field: 'productionLineCode',

274
src/views/wms/supplierManage/supplierinvoiceInvoiced/index.vue

@ -0,0 +1,274 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierinvoiceInvoiced.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierinvoiceInvoiced.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="SupplierinvoiceInvoicedRules"
:formAllSchemas="SupplierinvoiceInvoiced.allSchemas"
:apiUpdate="SupplierinvoiceInvoicedApi.updateSupplierinvoiceInvoiced"
:apiCreate="SupplierinvoiceInvoicedApi.createSupplierinvoiceInvoiced"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="SupplierinvoiceInvoiced.allSchemas" />
<!-- 导入 -->
<!-- <ImportForm ref="importFormRef" url="/wms/supplierinvoice-invoiced/import" :importTemplateData="importTemplateData" @success="importSuccess" /> -->
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SupplierinvoiceInvoiced,SupplierinvoiceInvoicedRules } from './supplierinvoiceInvoiced.data'
import * as SupplierinvoiceInvoicedApi from '@/api/wms/supplierinvoiceInvoiced'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'SupplierinvoiceInvoiced' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierinvoiceInvoiced.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplierinvoiceInvoicedApi.getSupplierinvoiceInvoicedPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:supplierinvoice-invoiced:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:supplierinvoice-invoiced:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:supplierinvoice-invoiced:export'}), //
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 butttondata = (row) =>{
return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierinvoice-invoiced:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'wms:supplierinvoice-invoiced:update'}),
{
label: '审核通过',
name: 'agree',
hide: isShowMainButton(row, ['1']),
type: 'danger',
color: '',
link: true, //
hasPermi: ''
},
{
label: '审核拒绝',
name: 'refuse',
hide: isShowMainButton(row, ['1']),
type: 'danger',
color: '',
link: true, //
hasPermi: ''
}
]
}
// -
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 =SupplierinvoiceInvoiced.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;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await SupplierinvoiceInvoicedApi.createSupplierinvoiceInvoiced(data)
message.success(t('common.createSuccess'))
} else {
await SupplierinvoiceInvoicedApi.updateSupplierinvoiceInvoiced(data)
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, 'basicSupplierinvoiceInvoiced')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierinvoiceInvoicedApi.deleteSupplierinvoiceInvoiced(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 SupplierinvoiceInvoicedApi.exportSupplierinvoiceInvoiced(tableObject.params)
download.excel(data, '待开票.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '待开票导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
// importTemplateData.templateUrl = await SupplierinvoiceInvoicedApi.importTemplate()
})
</script>

149
src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts

@ -0,0 +1,149 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SupplierinvoiceInvoicedRules = reactive({
supplierCode: [required],
poNumber: [required],
currency: [required],
concurrencyStamp: [required],
})
export const SupplierinvoiceInvoiced = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '项目编码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '单据类型',
field: 'billType',
sort: 'custom',
form: {
component: 'SelectV2'
},
table: {
width: 150
},
},
{
label: '单据号',
field: 'recvBillNum',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '发货单号',
field: 'asnBillNum',
sort: 'custom',
table: {
width: 150
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
},
{
label: '采购价格',
field: 'purchasePrice',
sort: 'custom',
table: {
width: 150
},
},
{
label: '可开票数量',
field: 'invoicableQuantity',
sort: 'custom',
table: {
width: 150
},
},
{
label: '零件号',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
table: {
width: 150
},
},
{
label: '货币',
field: 'currency',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 150
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
Loading…
Cancel
Save