master
parent
13884e323c
commit
aec179db0d
|
|
@ -66,4 +66,7 @@ export default {
|
||||||
return getFileUrl('/oss/download/' + filename)
|
return getFileUrl('/oss/download/' + filename)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
changeIdentity(id: string) {
|
||||||
|
return get<LoginTypes.UserDetail>('/customer/change_identity', {targetCustomerId: id})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,156 @@ import {
|
||||||
import Strings from '@/common/utils/strings.ts'
|
import Strings from '@/common/utils/strings.ts'
|
||||||
import Evt from '@/common/utils/evt.ts'
|
import Evt from '@/common/utils/evt.ts'
|
||||||
|
|
||||||
|
interface IdentityInfo {
|
||||||
|
identityCategory: string
|
||||||
|
|
||||||
|
customerId: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织信息 Id;cst_org.id
|
||||||
|
*/
|
||||||
|
orgId: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户姓名
|
||||||
|
*/
|
||||||
|
customerName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户联系电话
|
||||||
|
*/
|
||||||
|
phone: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算方式,YueJie-->月结、YuE-->余额、XianFu-->现付
|
||||||
|
*/
|
||||||
|
settlementWay: string
|
||||||
|
|
||||||
|
settlementWayTxt: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否管理员;是否为当前的组织管理员,0-->否、1-->是
|
||||||
|
*/
|
||||||
|
manager: boolean
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主体类型,GeTiHu-->个体户、QiYe-->企业
|
||||||
|
*/
|
||||||
|
orgCategory: string
|
||||||
|
orgCategoryTxt: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一社会信用代码
|
||||||
|
*/
|
||||||
|
uscc: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织名称
|
||||||
|
*/
|
||||||
|
orgName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照
|
||||||
|
*/
|
||||||
|
businessLicense: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照有效期
|
||||||
|
*/
|
||||||
|
licenseStartTime: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照有效期
|
||||||
|
*/
|
||||||
|
licenseEndTime: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人名称
|
||||||
|
*/
|
||||||
|
legalRepresentative: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证号
|
||||||
|
*/
|
||||||
|
idcard: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证有效期
|
||||||
|
*/
|
||||||
|
idcardStartTime: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证有效期
|
||||||
|
*/
|
||||||
|
idcardEndTime: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证正面
|
||||||
|
*/
|
||||||
|
idcardFront: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证反面
|
||||||
|
*/
|
||||||
|
idcardBack: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;代码
|
||||||
|
*/
|
||||||
|
province: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;代码
|
||||||
|
*/
|
||||||
|
city: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;代码
|
||||||
|
*/
|
||||||
|
area: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;代码
|
||||||
|
*/
|
||||||
|
town: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;名称
|
||||||
|
*/
|
||||||
|
provinceName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;名称
|
||||||
|
*/
|
||||||
|
cityName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;名称
|
||||||
|
*/
|
||||||
|
areaName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;名称
|
||||||
|
*/
|
||||||
|
townName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
address: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
lng: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
lat: string
|
||||||
|
}
|
||||||
|
|
||||||
export const useAppUserStore = defineStore('AppUser', () => {
|
export const useAppUserStore = defineStore('AppUser', () => {
|
||||||
const userId = ref<string | null>(null)
|
const userId = ref<string | null>(null)
|
||||||
const roles = ref<string[]>([])
|
const roles = ref<string[]>([])
|
||||||
|
|
@ -15,12 +165,16 @@ export const useAppUserStore = defineStore('AppUser', () => {
|
||||||
const token = ref<string | null>(null)
|
const token = ref<string | null>(null)
|
||||||
const tenantId = ref<string | null>(null)
|
const tenantId = ref<string | null>(null)
|
||||||
const tenantName = ref<string | null>(null)
|
const tenantName = ref<string | null>(null)
|
||||||
|
const currentIdentity = ref<IdentityInfo | null>(null)
|
||||||
|
const identities = ref<IdentityInfo[]>([])
|
||||||
const isAuthenticated = computed(() => !Strings.isEmpty(token.value))
|
const isAuthenticated = computed(() => !Strings.isEmpty(token.value))
|
||||||
|
|
||||||
const isXiaoNa = computed(() => {
|
const isXiaoNa = computed(() => {
|
||||||
return false
|
return roles.value.includes('ROLE_XiaoNa')
|
||||||
})
|
})
|
||||||
|
|
||||||
const isAdmin = computed(() => {
|
const isAdmin = computed(() => {
|
||||||
return true
|
return roles.value.includes('ROLE_ADMIN')
|
||||||
})
|
})
|
||||||
|
|
||||||
function $reset() {
|
function $reset() {
|
||||||
|
|
@ -48,6 +202,8 @@ export const useAppUserStore = defineStore('AppUser', () => {
|
||||||
roles,
|
roles,
|
||||||
isXiaoNa,
|
isXiaoNa,
|
||||||
isAdmin,
|
isAdmin,
|
||||||
|
identities,
|
||||||
|
currentIdentity,
|
||||||
$reset,
|
$reset,
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { useAppUserStore } from '@/common/app/app-user-store.ts'
|
||||||
import Utils from '@/common/utils'
|
import Utils from '@/common/utils'
|
||||||
import type { R } from '@/common/utils/http-util.ts'
|
import type { R } from '@/common/utils/http-util.ts'
|
||||||
import { MenuCategory } from '@/common/app/constants.ts'
|
import { MenuCategory } from '@/common/app/constants.ts'
|
||||||
|
import AppApi from '@/common/app/app-api.ts'
|
||||||
|
|
||||||
const home = {
|
const home = {
|
||||||
'id': '-1',
|
'id': '-1',
|
||||||
|
|
@ -56,9 +57,11 @@ export function hasPermission(resSn?: string) {
|
||||||
return res != null
|
return res != null
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAdmin() {
|
export function changeIdentity(id: string) {
|
||||||
const appUserStore = useAppUserStore()
|
return AppApi.changeIdentity(id)
|
||||||
return appUserStore.roles != null && appUserStore.roles.includes('ROLE_ADMIN')
|
.then(() => {
|
||||||
|
return reloadUserInfo()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function saveFile(r: Promise<R<{ content: Blob, filename: string }>>, defaultName: string = '下载的文件') {
|
export function saveFile(r: Promise<R<{ content: Blob, filename: string }>>, defaultName: string = '下载的文件') {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
// ------
|
// ------
|
||||||
// Generated by unplugin-vue-components
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
|
import { GlobalComponents } from 'vue'
|
||||||
|
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ declare global {
|
||||||
menus: AppTypes.Menu[]
|
menus: AppTypes.Menu[]
|
||||||
token: string
|
token: string
|
||||||
setting: UserSetting
|
setting: UserSetting
|
||||||
|
currentCustomerId: string
|
||||||
|
currentOrgId: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<FormPage
|
<ATablePage
|
||||||
ref="formPage"
|
ref="tablePage"
|
||||||
:action-column="actionColumn"
|
v-bind="tablePageProps">
|
||||||
:left-tools="leftTools"
|
<template #simpleFormItem="formData">
|
||||||
:paging="paging">
|
<ElFormItem label="仓库名称">
|
||||||
<template #searchFormItem="{ searchForm }">
|
<ElInput
|
||||||
<ElForm inline @submit.prevent="paging">
|
v-model="formData.warehouseName"
|
||||||
<ElFormItem label="仓库名称">
|
placeholder="仓库名称"/>
|
||||||
<ElInput
|
</ElFormItem>
|
||||||
v-model="searchForm.warehouseName"
|
<ElFormItem label="位置">
|
||||||
placeholder="仓库名称"/>
|
<ElInput
|
||||||
</ElFormItem>
|
v-model="formData.location"
|
||||||
<ElFormItem label="位置">
|
placeholder="位置"/>
|
||||||
<ElInput
|
</ElFormItem>
|
||||||
v-model="searchForm.location"
|
|
||||||
placeholder="位置"/>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="创建人 Id; sys_user.id">
|
|
||||||
<ElInput
|
|
||||||
v-model="searchForm.creatorId"
|
|
||||||
placeholder="创建人 Id; sys_user.id"/>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="修改人 Id;sys_user.id">
|
|
||||||
<ElInput
|
|
||||||
v-model="searchForm.modifierId"
|
|
||||||
placeholder="修改人 Id;sys_user.id"/>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="创建时间">
|
|
||||||
<ElInput
|
|
||||||
v-model="searchForm.createTime"
|
|
||||||
placeholder="创建时间"/>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="修改时间">
|
|
||||||
<ElInput
|
|
||||||
v-model="searchForm.modifyTime"
|
|
||||||
placeholder="修改时间"/>
|
|
||||||
</ElFormItem>
|
|
||||||
</ElForm>
|
|
||||||
</template>
|
|
||||||
<template #simpleSearchFormItem="{ searchForm }">
|
|
||||||
<ElForm inline @submit.prevent="paging">
|
|
||||||
<ElFormItem label="仓库名称">
|
|
||||||
<ElInput
|
|
||||||
v-model="searchForm.warehouseName"
|
|
||||||
placeholder="仓库名称"/>
|
|
||||||
</ElFormItem>
|
|
||||||
</ElForm>
|
|
||||||
</template>
|
</template>
|
||||||
<template #columns>
|
<template #columns>
|
||||||
<ElTableColumn label="Id" prop="id"/>
|
<ElTableColumn label="Id" prop="id"/>
|
||||||
|
|
@ -58,67 +25,71 @@
|
||||||
<!-- <ElTableColumn label="是否删除; 0-->未删除、1-->已删除" prop="deleted"/> -->
|
<!-- <ElTableColumn label="是否删除; 0-->未删除、1-->已删除" prop="deleted"/> -->
|
||||||
</template>
|
</template>
|
||||||
<WarehouseForm ref="warehouseForm" :research="research"/>
|
<WarehouseForm ref="warehouseForm" :research="research"/>
|
||||||
</FormPage>
|
</ATablePage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
||||||
import WarehouseForm from '@/pages/wh/warehouse/WarehouseForm.vue'
|
import WarehouseForm from '@/pages/wh/warehouse/WarehouseForm.vue'
|
||||||
import FormPage from '@/components/page/FormPage.vue'
|
import ATablePage, {
|
||||||
import type {
|
type ATablePageInstance,
|
||||||
ActionColumnType,
|
buildTablePageProps,
|
||||||
ToolType,
|
} from '@/components/a-page/a-table-page/ATablePage.tsx'
|
||||||
} from '@/components/page/a-page-type.ts'
|
|
||||||
import type { ComponentExposed } from 'vue-component-type-helpers'
|
|
||||||
|
|
||||||
const warehouseFormIns = useTemplateRef<InstanceType<typeof WarehouseForm>>('warehouseForm')
|
const warehouseFormIns = useTemplateRef<InstanceType<typeof WarehouseForm>>('warehouseForm')
|
||||||
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
|
const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage')
|
||||||
|
const tablePageProps = buildTablePageProps<WarehouseTypes.SearchWarehouseParam, WarehouseTypes.SearchWarehouseResult>({
|
||||||
|
pageLayout: {
|
||||||
const actionColumn = reactive<ActionColumnType<WarehouseTypes.SearchWarehouseResult>>({
|
enableHighForm: false,
|
||||||
tableActions: [
|
},
|
||||||
{
|
searchForm: {
|
||||||
tooltip: '编辑',
|
paging: WarehouseApi.paging,
|
||||||
icon: 'Edit',
|
},
|
||||||
type: 'success',
|
toolBar: {
|
||||||
action({row}) {
|
leftTools: [
|
||||||
warehouseFormIns.value?.open(row)
|
{
|
||||||
|
icon: 'Plus',
|
||||||
|
label: '新建',
|
||||||
|
action() {
|
||||||
|
warehouseFormIns.value?.open()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
{
|
},
|
||||||
icon: 'Delete',
|
table: {
|
||||||
loading: false,
|
actionColumn: {
|
||||||
type: 'danger',
|
tableActions: [
|
||||||
tooltip: '删除',
|
{
|
||||||
confirm: {
|
tooltip: '编辑',
|
||||||
title: '是否删除当前数据',
|
icon: 'Edit',
|
||||||
},
|
type: 'success',
|
||||||
action({row}) {
|
action({row}) {
|
||||||
return WarehouseApi.del([ row.id! ])
|
warehouseFormIns.value?.open(row)
|
||||||
.then(() => {
|
},
|
||||||
ElMessage.success('删除成功')
|
},
|
||||||
return true
|
{
|
||||||
})
|
icon: 'Delete',
|
||||||
},
|
loading: false,
|
||||||
},
|
type: 'danger',
|
||||||
],
|
tooltip: '删除',
|
||||||
})
|
confirm: {
|
||||||
const leftTools: ToolType[] = [
|
title: '是否删除当前数据',
|
||||||
{
|
},
|
||||||
icon: 'Plus',
|
action({row}) {
|
||||||
label: '新建',
|
return WarehouseApi.del([ row.id! ])
|
||||||
action() {
|
.then(() => {
|
||||||
warehouseFormIns.value?.open()
|
ElMessage.success('删除成功')
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
})
|
||||||
|
|
||||||
function research() {
|
function research() {
|
||||||
formPageIns.value?.doSearch()
|
tablePageIns.value?.doSearch()
|
||||||
}
|
|
||||||
|
|
||||||
function paging(param: WarehouseTypes.SearchWarehouseParam) {
|
|
||||||
return WarehouseApi.paging(param)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,45 @@
|
||||||
<template>
|
<template>
|
||||||
<AFormPanel
|
<AFormPanel
|
||||||
ref="formPanel"
|
ref="formPanel"
|
||||||
:details-loader="detailsLoader"
|
v-bind="formPanelProps">
|
||||||
:do-submit="doSubmit"
|
<template #default="formData">
|
||||||
:rules="rules"
|
|
||||||
:title="status === 'add' ? '新建项目' : '修改项目'"
|
|
||||||
>
|
|
||||||
<template #default="{formData}">
|
|
||||||
<div class="form-items">
|
<div class="form-items">
|
||||||
|
<ElFormItem label="Id" prop="id">
|
||||||
|
<ElInput v-model="formData.id" placeholder="Id"/>
|
||||||
|
</ElFormItem>
|
||||||
<ElFormItem label="仓库名称" prop="warehouseName">
|
<ElFormItem label="仓库名称" prop="warehouseName">
|
||||||
<ElInput
|
<ElInput v-model="formData.warehouseName" placeholder="仓库名称"/>
|
||||||
v-model="formData.warehouseName"
|
</ElFormItem>
|
||||||
|
<ElFormItem label="仓库类型;raw_material-原料库,finished_product-成品库" prop="type">
|
||||||
placeholder="仓库名称"/>
|
<ElInput v-model="formData.type" placeholder="仓库类型;raw_material-原料库,finished_product-成品库"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="所属站点 Id;关联站点表主键" prop="stationId">
|
||||||
|
<ElInput v-model="formData.stationId" placeholder="所属站点 Id;关联站点表主键"/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElFormItem label="位置" prop="location">
|
<ElFormItem label="位置" prop="location">
|
||||||
<ElInput
|
<ElInput v-model="formData.location" placeholder="位置"/>
|
||||||
v-model="formData.location"
|
</ElFormItem>
|
||||||
|
<ElFormItem label="最大容量,单位:m³" prop="maxCapacity">
|
||||||
placeholder="位置"/>
|
<ElInput v-model="formData.maxCapacity" placeholder="最大容量,单位:m³"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="备注" prop="remark">
|
||||||
|
<ElInput v-model="formData.remark" placeholder="备注"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="创建人 Id; sys_user.id" prop="creatorId">
|
||||||
|
<ElInput v-model="formData.creatorId" placeholder="创建人 Id; sys_user.id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="修改人 Id;sys_user.id" prop="modifierId">
|
||||||
|
<ElInput v-model="formData.modifierId" placeholder="修改人 Id;sys_user.id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="创建时间" prop="createTime">
|
||||||
|
<ElInput v-model="formData.createTime" placeholder="创建时间"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="修改时间" prop="modifyTime">
|
||||||
|
<ElInput v-model="formData.modifyTime" placeholder="修改时间"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="是否删除; 0-->未删除、1-->已删除" prop="deleted">
|
||||||
|
<ElInput v-model="formData.deleted" placeholder="是否删除; 0-->未删除、1-->已删除"/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</AFormPanel>
|
</AFormPanel>
|
||||||
|
|
@ -28,10 +47,11 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
||||||
|
import AFormPanel, {
|
||||||
|
type AFormPanelInstance,
|
||||||
|
buildFormPanelProps,
|
||||||
|
} from '@/components/a-form-panel/AFormPanel.tsx'
|
||||||
import Strings from '@/common/utils/strings.ts'
|
import Strings from '@/common/utils/strings.ts'
|
||||||
import { type FormRules } from 'element-plus'
|
|
||||||
import type { ComponentExposed } from 'vue-component-type-helpers'
|
|
||||||
import AFormPanel from '@/components/a-form-panel/AFormPanel.tsx'
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
research?: () => void
|
research?: () => void
|
||||||
|
|
@ -39,54 +59,59 @@ const props = withDefaults(defineProps<{
|
||||||
research: () => {
|
research: () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const rules = reactive<FormRules<WarehouseTypes.SearchWarehouseResult>>({
|
const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel')
|
||||||
id: [ {required: true, message: '请填写Id', trigger: 'blur'} ],
|
|
||||||
warehouseName: [ {required: true, message: '请填写仓库名称', trigger: 'blur'} ],
|
|
||||||
location: [ {required: true, message: '请填写位置', trigger: 'blur'} ],
|
|
||||||
creatorId: [ {required: true, message: '请填写创建人 Id; sys_user.id', trigger: 'blur'} ],
|
|
||||||
modifierId: [ {required: true, message: '请填写修改人 Id;sys_user.id', trigger: 'blur'} ],
|
|
||||||
createTime: [ {required: true, message: '请填写创建时间', trigger: 'blur'} ],
|
|
||||||
modifyTime: [ {required: true, message: '请填写修改时间', trigger: 'blur'} ],
|
|
||||||
deleted: [ {required: true, message: '请填写是否删除; 0-->未删除、1-->已删除', trigger: 'blur'} ],
|
|
||||||
})
|
|
||||||
|
|
||||||
const formPanelIns = useTemplateRef<ComponentExposed<typeof AFormPanel>>('formPanel')
|
|
||||||
const status = ref<'add' | 'modify'>('add')
|
const status = ref<'add' | 'modify'>('add')
|
||||||
|
const formPanelProps = buildFormPanelProps<WarehouseTypes.SearchWarehouseResult>({
|
||||||
function detailsLoader(id?: string) {
|
detailsLoader(id?: string) {
|
||||||
if (Strings.isBlank(id)) {
|
if (Strings.isBlank(id)) {
|
||||||
status.value = 'add'
|
status.value = 'add'
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
} else {
|
} else {
|
||||||
status.value = 'modify'
|
status.value = 'modify'
|
||||||
return WarehouseApi
|
return WarehouseApi
|
||||||
.detail(id!)
|
.detail(id!)
|
||||||
.then(res => res.data)
|
.then(res => res.data)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
doSubmit(data) {
|
||||||
function doSubmit(data: WarehouseTypes.SearchWarehouseResult) {
|
if (status.value === 'add') {
|
||||||
if (status.value === 'add') {
|
return WarehouseApi
|
||||||
return WarehouseApi.add(data)
|
.add(data)
|
||||||
.then(props.research)
|
.then(props.research)
|
||||||
} else {
|
} else {
|
||||||
return WarehouseApi.modify(data)
|
return WarehouseApi
|
||||||
.then(props.research)
|
.modify(data)
|
||||||
}
|
.then(props.research)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
id: [ {required: true, message: '请填写Id', trigger: 'blur'} ],
|
||||||
|
warehouseName: [ {required: true, message: '请填写仓库名称', trigger: 'blur'} ],
|
||||||
|
type: [ {required: true, message: '请填写仓库类型;raw_material-原料库,finished_product-成品库', trigger: 'blur'} ],
|
||||||
|
stationId: [ {required: true, message: '请填写所属站点 Id;关联站点表主键', trigger: 'blur'} ],
|
||||||
|
location: [ {required: true, message: '请填写位置', trigger: 'blur'} ],
|
||||||
|
maxCapacity: [ {required: true, message: '请填写最大容量,单位:m³', trigger: 'blur'} ],
|
||||||
|
remark: [ {required: true, message: '请填写备注', trigger: 'blur'} ],
|
||||||
|
creatorId: [ {required: true, message: '请填写创建人 Id; sys_user.id', trigger: 'blur'} ],
|
||||||
|
modifierId: [ {required: true, message: '请填写修改人 Id;sys_user.id', trigger: 'blur'} ],
|
||||||
|
createTime: [ {required: true, message: '请填写创建时间', trigger: 'blur'} ],
|
||||||
|
modifyTime: [ {required: true, message: '请填写修改时间', trigger: 'blur'} ],
|
||||||
|
deleted: [ {required: true, message: '请填写是否删除; 0-->未删除、1-->已删除', trigger: 'blur'} ],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
watchEffect(() => {
|
||||||
|
formPanelProps.title = status.value === 'add' ? '新建仓库信息' : '修改仓库信息信息'
|
||||||
|
})
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open(data?: WarehouseTypes.SearchWarehouseResult) {
|
open(data?: WarehouseTypes.SearchWarehouseResult) {
|
||||||
formPanelIns.value?.open(data?.id)
|
formPanelIns.value?.open(data?.id)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
.form-items {
|
.form-items {
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
|
|
||||||
:deep(.el-form-item) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue