lzq 2026-02-25 17:42:56 +08:00
parent 9d90a7682e
commit d29a165423
38 changed files with 257 additions and 139 deletions

View File

@ -17,6 +17,9 @@ export const useAppUserStore = defineStore('AppUser', () => {
const tenantName = ref<string | null>(null) const tenantName = ref<string | null>(null)
const isAuthenticated = computed(() => !Strings.isEmpty(token.value)) const isAuthenticated = computed(() => !Strings.isEmpty(token.value))
const isXiaoNa = computed(() => { const isXiaoNa = computed(() => {
return false
})
const isAdmin = computed(() => {
return true return true
}) })
@ -44,6 +47,7 @@ export const useAppUserStore = defineStore('AppUser', () => {
isAuthenticated, isAuthenticated,
roles, roles,
isXiaoNa, isXiaoNa,
isAdmin,
$reset, $reset,
} }
}, { }, {

View File

@ -15,6 +15,7 @@ import {
getRoutes, getRoutes,
} from '@/common/router/route-config.ts' } from '@/common/router/route-config.ts'
import { SpecialPage } from '@/common/router/constants.ts' import { SpecialPage } from '@/common/router/constants.ts'
import { reloadUserInfo } from '@/common/app'
function addRoutes(routNames: string[]) { function addRoutes(routNames: string[]) {
if (Colls.isEmpty(routNames)) return if (Colls.isEmpty(routNames)) return
@ -64,26 +65,48 @@ router.beforeEach((to, from) => {
// 已登录 // 已登录
if (appUserStore.isAuthenticated) { if (appUserStore.isAuthenticated) {
if (from.path === '/' && router.getRoutes().length <= 4) {// 浏览器刷新 if (from.path === '/' && router.getRoutes().length <= 4) {// 浏览器刷新
const succ = reloadRouter() return reloadRouter()
if (!succ .then(succ => {
&& SpecialPage.Login !== name if (!succ
&& SpecialPage.Home !== name && SpecialPage.Login !== name
&& SpecialPage.Main !== name && SpecialPage.Home !== name
&& SpecialPage.NotFound !== name) { && SpecialPage.Main !== name
return { && SpecialPage.NotFound !== name) {
replace: true, return {
name: SpecialPage.Home, replace: true,
} name: SpecialPage.Home,
} else { }
let routeName = router.getRoutes().find((it) => it.path === to.path)?.name as string } else {
if (Strings.isBlank(routeName)) { let routeName = router.getRoutes().find((it) => it.path === to.path)?.name as string
routeName = SpecialPage.Home if (Strings.isBlank(routeName)) {
} routeName = SpecialPage.Home
setTimeout(() => { }
Evt.emit('browserReflash', routeName) setTimeout(() => {
Evt.emit('browserReflash', routeName)
})
return false
}
}) })
return false /* const succ = reloadRouter()
} if (!succ
&& SpecialPage.Login !== name
&& SpecialPage.Home !== name
&& SpecialPage.Main !== name
&& SpecialPage.NotFound !== name) {
return {
replace: true,
name: SpecialPage.Home,
}
} else {
let routeName = router.getRoutes().find((it) => it.path === to.path)?.name as string
if (Strings.isBlank(routeName)) {
routeName = SpecialPage.Home
}
setTimeout(() => {
Evt.emit('browserReflash', routeName)
})
return false
} */
} }
return true return true
} }
@ -107,14 +130,17 @@ export function reloadRouter() {
.filter((it) => it.name !== SpecialPage.Main && it.name !== SpecialPage.Login && it.name !== SpecialPage.NotFound && it.name !== SpecialPage.Home) .filter((it) => it.name !== SpecialPage.Main && it.name !== SpecialPage.Login && it.name !== SpecialPage.NotFound && it.name !== SpecialPage.Home)
.map((it) => it.name as string) .map((it) => it.name as string)
removeRoutes(routes) removeRoutes(routes)
const routNames = useAppSettingStore() return reloadUserInfo()
.menus.filter((it) => it.menuCategory === MenuCategory.Page || it.menuCategory === MenuCategory.SubPage) .then(() => {
.map((it) => it.routeName) const routNames = useAppSettingStore()
if (Colls.isEmpty(routNames)) { .menus.filter((it) => it.menuCategory === MenuCategory.Page || it.menuCategory === MenuCategory.SubPage)
return false .map((it) => it.routeName)
} if (Colls.isEmpty(routNames)) {
addRoutes(routNames) return false
return true }
addRoutes(routNames)
return true
})
} }
export default router export default router

View File

@ -5,7 +5,6 @@ import router, {
import Evt from '@/common/utils/evt.ts' import Evt from '@/common/utils/evt.ts'
import { useAppSettingStore } from '@/common/app/app-setting-store.ts' import { useAppSettingStore } from '@/common/app/app-setting-store.ts'
import { useAppPageStore } from '@/common/app/app-page-store.ts' import { useAppPageStore } from '@/common/app/app-page-store.ts'
import { reloadUserInfo } from '@/common/app'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import type { App } from 'vue' import type { App } from 'vue'
import { SpecialPage } from '@/common/router/constants.ts' import { SpecialPage } from '@/common/router/constants.ts'
@ -26,8 +25,7 @@ function checkRoute(option: string | Option) {
if (menu == null if (menu == null
|| !router.hasRoute(opt.routeName)) { || !router.hasRoute(opt.routeName)) {
return reloadUserInfo() return reloadRouter()
.then(reloadRouter)
.then(() => { .then(() => {
const menu_ = appSettingStore.menus.find(it => it.routeName === opt.routeName) const menu_ = appSettingStore.menus.find(it => it.routeName === opt.routeName)
if (menu_ == null || !router.hasRoute(opt.routeName)) { if (menu_ == null || !router.hasRoute(opt.routeName)) {

View File

@ -5,8 +5,10 @@ const props = withDefaults(
defineProps<{ defineProps<{
changeHandler?: () => void changeHandler?: () => void
modelValue: [ string | undefined, string | undefined ] | undefined | null modelValue: [ string | undefined, string | undefined ] | undefined | null
type?: 'year' | 'years' | 'month' | 'months' | 'date' | 'dates' | 'week' | 'datetime' | 'datetimerange' | 'daterange' | 'monthrange' | 'yearrange'
}>(), }>(),
{ {
type: 'datetimerange',
changeHandler: () => { changeHandler: () => {
}, },
}, },
@ -66,7 +68,7 @@ const shortcuts = [
clearable clearable
end-placeholder="结束时间" end-placeholder="结束时间"
start-placeholder="开始时间" start-placeholder="开始时间"
type="datetimerange" :type="type"
@change="changeHandler" @change="changeHandler"
/> />
</template> </template>

View File

@ -21,6 +21,7 @@ const key = '3TGBZ-ZK7K5-CMNIK-ICIGZ-K6TYQ-HTBTZ'
interface AMapPropsType { interface AMapPropsType {
width?: string width?: string
height?: string
mapConfig: { mapConfig: {
lat: number lat: number
lng: number lng: number
@ -43,6 +44,7 @@ const props = withDefaults(
defineProps<AMapPropsType>(), defineProps<AMapPropsType>(),
{ {
width: '500px', width: '500px',
height: '100%',
}, },
) )
@ -207,7 +209,7 @@ defineExpose({init, destroy})
<style lang="stylus" scoped> <style lang="stylus" scoped>
.a-map { .a-map {
width v-bind('props.width'); width v-bind('props.width');
height 100%; height v-bind('props.height');
display flex; display flex;
flex-direction column; flex-direction column;
gap 10px gap 10px

View File

@ -17,6 +17,7 @@ const props = withDefaults(defineProps<{
height?: string height?: string
width?: string width?: string
limit?: number limit?: number
disabled?: boolean
uploadProps?: Partial<Omit<UploadProps, 'httpRequest' | 'crossorigin' | 'multiple' uploadProps?: Partial<Omit<UploadProps, 'httpRequest' | 'crossorigin' | 'multiple'
| 'data' | 'action' | 'headers' | 'limit' | 'onError' | 'data' | 'action' | 'headers' | 'limit' | 'onError'
| 'onRemove' | 'onSuccess' | 'onPreview' | 'fileList' | 'beforeUpload' | 'beforeRemove' | 'onChange' | 'onProgress' | 'name' | 'drag'>> | 'onRemove' | 'onSuccess' | 'onPreview' | 'fileList' | 'beforeUpload' | 'beforeRemove' | 'onChange' | 'onProgress' | 'name' | 'drag'>>
@ -24,6 +25,7 @@ const props = withDefaults(defineProps<{
limit: 1, limit: 1,
height: '100px', height: '100px',
width: '100px', width: '100px',
disabled: false,
// @ts-ignore // @ts-ignore
uploadProps: { uploadProps: {
// @ts-ignore // @ts-ignore
@ -113,6 +115,7 @@ defineExpose({
:on-success="uploadSuccHandler" :on-success="uploadSuccHandler"
class="a-uploader" class="a-uploader"
drag drag
:disabled="disabled"
v-bind="uploadProps"> v-bind="uploadProps">
<slot> <slot>
<ElIcon class="default-icon"> <ElIcon class="default-icon">
@ -133,8 +136,8 @@ defineExpose({
<style lang="stylus" scoped> <style lang="stylus" scoped>
.a-uploader { .a-uploader {
width: v-bind(height); width: v-bind(width);
height: v-bind(width); height: v-bind(height);
:deep(.el-upload) { :deep(.el-upload) {
background-color white background-color white

View File

@ -135,6 +135,7 @@ const actionColumn = reactive<ActionColumnType<CustomerTypes.TableData>>({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
customerFormIns.value?.open(row) customerFormIns.value?.open(row)
}, },

View File

@ -2,6 +2,9 @@
import ADropTable from '@/components/a-drop-table/ADropTable.vue' import ADropTable from '@/components/a-drop-table/ADropTable.vue'
import CustomerApi from '@/pages/cst/customer/customer-api.ts' import CustomerApi from '@/pages/cst/customer/customer-api.ts'
const props = defineProps<{
identityCategory?: string,
}>()
const model = defineModel<string | undefined | null>() const model = defineModel<string | undefined | null>()
const dropTableColumns = [ const dropTableColumns = [
{ {
@ -22,7 +25,10 @@ const dropTableColumns = [
}, },
] ]
const dropTableLoader = (param: CustomerTypes.SearchCustomerParam) => { const dropTableLoader = (param: CustomerTypes.SearchCustomerParam) => {
return CustomerApi.paging(param).then(res => res.data) return CustomerApi.paging({
...param,
identityCategory: props.identityCategory,
}).then(res => res.data)
} }
</script> </script>

View File

@ -131,6 +131,7 @@ const tablePageProps = buildTablePageProps<CustomerTypes.SearchCustomerParam, Cu
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
customerFormIns.value?.open(row) customerFormIns.value?.open(row)
}, },

View File

@ -131,6 +131,7 @@ const tablePageProps = buildTablePageProps<CustomerTypes.SearchCustomerParam, Cu
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
customerFormIns.value?.open(row) customerFormIns.value?.open(row)
}, },

View File

@ -131,6 +131,7 @@ const tablePageProps = buildTablePageProps<CustomerTypes.SearchCustomerParam, Cu
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
customerFormIns.value?.open(row) customerFormIns.value?.open(row)
}, },

View File

@ -26,9 +26,9 @@
<ElFormItem> <ElFormItem>
<ElInput v-model="formData.driverName" placeholder="司机姓名"/> <ElInput v-model="formData.driverName" placeholder="司机姓名"/>
</ElFormItem> </ElFormItem>
<ElFormItem> <!-- <ElFormItem>
<ElInput v-model="formData.phone" placeholder="手机号"/> <ElInput v-model="formData.phone" placeholder="手机号"/>
</ElFormItem> </ElFormItem> -->
</template> </template>
<template #columns> <template #columns>
<ElTableColumn label="司机名称" prop="driverName"/> <ElTableColumn label="司机名称" prop="driverName"/>
@ -37,7 +37,7 @@
<ElTableColumn label="手机号" prop="phone"/> <ElTableColumn label="手机号" prop="phone"/>
<ElTableColumn label="驾驶证有效期" prop="licenceStartTime"> <ElTableColumn label="驾驶证有效期" prop="licenceStartTime">
<template #default="{ row }"> <template #default="{ row }">
{{ row.licenceStartTime + ' 至 ' + (row.licenceEndTime ?? '永久') }} {{ Strings.isBlank(row.licenceStartTime) ? '' : row.licenceStartTime + ' 至 ' + (row.licenceEndTime ?? '永久') }}
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn label="状态" prop="busy" width="100"> <ElTableColumn label="状态" prop="busy" width="100">
@ -57,6 +57,7 @@ import ATablePage, {
type ATablePageInstance, type ATablePageInstance,
buildTablePageProps, buildTablePageProps,
} from '@/components/a-page/a-table-page/ATablePage.tsx' } from '@/components/a-page/a-table-page/ATablePage.tsx'
import Strings from '@/common/utils/strings.ts'
const driverFormIns = useTemplateRef<InstanceType<typeof DriverForm>>('driverForm') const driverFormIns = useTemplateRef<InstanceType<typeof DriverForm>>('driverForm')
@ -74,14 +75,14 @@ const tablePageProps = buildTablePageProps<CustomerTypes.SearchCustomerParam, Cu
table: { table: {
actionColumn: { actionColumn: {
tableActions: [ tableActions: [
{ /* {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'primary', type: 'success',
action({row}) { action({row}) {
driverFormIns.value?.open(row) driverFormIns.value?.open(row)
}, },
}, }, */
], ],
}, },
}, },

View File

@ -31,41 +31,40 @@
v-model="formData.projectName" v-model="formData.projectName"
placeholder="项目名称"/> placeholder="项目名称"/>
</ElFormItem> </ElFormItem>
<ElFormItem> <!-- <ElFormItem>
<ElInput <ElInput
v-model="formData.fringeName" v-model="formData.fringeName"
placeholder="客户"/> placeholder="客户名"/>
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElInput <ElInput
v-model="formData.transName" v-model="formData.transName"
placeholder="运输方名称"/> placeholder="运输方名称"/>
</ElFormItem> </ElFormItem> -->
</template> </template>
<template #columns> <template #columns>
<ElTableColumn label="项目名称" prop="projectName"/> <ElTableColumn label="项目名称" prop="projectName"/>
<ElTableColumn label="运输方联系人" prop="transCustomerName" width="140px"/> <ElTableColumn label="运输方联系人" prop="transCustomerInfo.customerName" width="140px"/>
<ElTableColumn label="运输方联系电话" prop="transCustomerPhone" width="140px"/> <ElTableColumn label="运输方联系电话" prop="transCustomerInfo.phone" width="140px"/>
<ElTableColumn label="运输企业名称" prop="transOrgName" width="140px"/> <ElTableColumn label="运输企业名称" prop="transOrgInfo.orgName" width="140px"/>
<ElTableColumn label="客户" prop="fringeCustomerName" width="140px"/> <ElTableColumn label="客户名" prop="fringeCustomerInfo.customerName" width="140px"/>
<ElTableColumn label="客户联系电话" prop="fringeCustomerPhone" width="140px"/> <ElTableColumn label="客户联系电话" prop="fringeCustomerInfo.phone" width="140px"/>
<ElTableColumn label="客户企业名称" prop="fringeOrgName" width="140px"/> <ElTableColumn label="客户企业名称" prop="fringeOrgInfo.orgName" width="140px"/>
<!-- <ElTableColumn label="详细地址" prop="address" width="240" show-overflow-tooltip/> --> <!-- <ElTableColumn label="详细地址" prop="address" width="240" show-overflow-tooltip/> -->
<ElTableColumn label="合同有效期" prop="contractStartDate" width="210"> <ElTableColumn label="合同有效期" prop="contractStartDate" width="220">
<template #default="{ row }"> <template #default="{ row }">
{{ row.contractStartDate + ' 至 ' + (row.contractEndDate ?? '--') }} {{ row.contractStartDate + ' 至 ' + (row.contractEndDate ?? '--') }}
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn label="创建时间" prop="createTime" width="170"/> <ElTableColumn label="创建时间" prop="createTime" width="190"/>
</template> </template>
<ProjectForm ref="projectForm" :research="research"/> <ProjectForm ref="projectForm" :research="research"/>
<ProjectDetail ref="projectDetail" @edit-succ="research"/> <!-- <ProjectDetail ref="projectDetail" @edit-succ="research"/> -->
</ATablePage> </ATablePage>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import ProjectApi from '@/pages/cst/project/project-api.ts' import ProjectApi from '@/pages/cst/project/project-api.ts'
import ProjectDetail from '@/pages/cst/project/ProjectDetail.vue'
import ProjectForm from '@/pages/cst/project/ProjectForm.vue' import ProjectForm from '@/pages/cst/project/ProjectForm.vue'
import ADtPicker from '@/components/a-dt-picker/ADtPicker.vue' import ADtPicker from '@/components/a-dt-picker/ADtPicker.vue'
import ATablePage, { import ATablePage, {
@ -74,7 +73,7 @@ import ATablePage, {
} from '@/components/a-page/a-table-page/ATablePage.tsx' } from '@/components/a-page/a-table-page/ATablePage.tsx'
const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage') const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage')
const projectDetailIns = useTemplateRef<InstanceType<typeof ProjectDetail>>('projectDetail') // const projectDetailIns = useTemplateRef<InstanceType<typeof ProjectDetail>>('projectDetail')
const projectFormIns = useTemplateRef<InstanceType<typeof ProjectForm>>('projectForm') const projectFormIns = useTemplateRef<InstanceType<typeof ProjectForm>>('projectForm')
function research() { function research() {
@ -84,6 +83,7 @@ function research() {
const tablePageProps = buildTablePageProps<ProjectTypes.SearchProjectParam, ProjectTypes.SearchProjectResult>({ const tablePageProps = buildTablePageProps<ProjectTypes.SearchProjectParam, ProjectTypes.SearchProjectResult>({
pageLayout: { pageLayout: {
dataListHeight: 3, dataListHeight: 3,
enableHighForm: false,
}, },
toolBar: { toolBar: {
leftTools: [ leftTools: [
@ -99,15 +99,15 @@ const tablePageProps = buildTablePageProps<ProjectTypes.SearchProjectParam, Proj
table: { table: {
actionColumn: { actionColumn: {
tableActions: [ tableActions: [
/* {
tooltip: '详情',
icon: 'Postcard',
action({row}) {
projectDetailIns.value?.open(row)
},
}, */
{ {
tooltip: '详情', tooltip: '编辑',
icon: 'Postcard',
action({row}) {
projectDetailIns.value?.open(row)
},
},
{
tooltip: '修改',
icon: 'Edit', icon: 'Edit',
type: 'success', type: 'success',
action({row}) { action({row}) {

View File

@ -9,52 +9,39 @@
v-model="formData.projectName" v-model="formData.projectName"
placeholder="项目名称"/> placeholder="项目名称"/>
</ElFormItem> </ElFormItem>
<ElFormItem label="合同图片" prop="contractPicture">
<ElInput
v-model="formData.contractPicture"
placeholder="合同图片"/>
</ElFormItem>
<ElFormItem label="运输方" prop="transCustomerId"> <ElFormItem label="运输方" prop="transCustomerId">
<ElInput <CustomerDropTable
v-model="formData.transCustomerId" v-model="formData.transCustomerId"
placeholder="运输方"/> :placeholder="formData.transCustomerInfo?.customerName" identity-category="YunShu"/>
</ElFormItem> </ElFormItem>
<ElFormItem label="客户" prop="fringeCustomerId">
<ElFormItem label="产废方/购买方" prop="fringeCustomerId"> <CustomerDropTable
<ElInput
v-model="formData.fringeCustomerId" v-model="formData.fringeCustomerId"
placeholder="产废方/购买方"/> :placeholder="formData.fringeCustomerInfo?.customerName" identity-category="ChanFei"/>
</ElFormItem>
<ElFormItem label="合同图片" prop="picture">
<Uploader
ref="uploader"
v-model:file="formData.contractPicture"
/>
</ElFormItem>
<ElFormItem label="有效期">
<ADtPicker v-model="formData.contractDate" type="daterange"/>
</ElFormItem> </ElFormItem>
<ElFormItem label="区/县;名称" prop="areaName"> <ElFormItem label="地址" prop="address">
<ElInput <AMap
v-model="formData.areaName" ref="amap"
placeholder="区县;名称"/> v-model:address="formData.address"
</ElFormItem> v-model:area="formData.area"
<ElFormItem label="详细地址" prop="address"> v-model:areaName="formData.areaName"
<ElInput v-model:lat="formData.lat"
v-model="formData.address" v-model:lng="formData.lng"
placeholder="详细地址"/> :map-config="{
</ElFormItem> lat:appSettingStore.defaultAddress.lat,
<ElFormItem label="经度" prop="lng"> lng:appSettingStore.defaultAddress.lng,
<ElInput }"
v-model="formData.lng" class="amap" height="250px" width="547px"/>
placeholder="经度"/>
</ElFormItem>
<ElFormItem label="纬度" prop="lat">
<ElInput
v-model="formData.lat"
placeholder="纬度"/>
</ElFormItem>
<ElFormItem label="合同有效期" prop="contractStartDate">
<ElInput
v-model="formData.contractStartDate"
placeholder="合同有效期"/>
</ElFormItem>
<ElFormItem label="合同有效期" prop="contractEndDate">
<ElInput
v-model="formData.contractEndDate"
placeholder="合同有效期"/>
</ElFormItem> </ElFormItem>
</div> </div>
</template> </template>
@ -68,6 +55,12 @@ import AFormPanel, {
type AFormPanelInstance, type AFormPanelInstance,
buildFormPanelProps, buildFormPanelProps,
} from '@/components/a-form-panel/AFormPanel.tsx' } from '@/components/a-form-panel/AFormPanel.tsx'
import Uploader from '@/components/uploader/Uploader.vue'
import ADtPicker from '@/components/a-dt-picker/ADtPicker.vue'
import AMap from '@/components/a-map/AMap.vue'
import { useAppSettingStore } from '@/common/app/app-setting-store.ts'
import CustomerDropTable from '@/pages/cst/customer/CustomerDropTable.vue'
import Times, { FMT } from '@/common/utils/times.ts'
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
research?: () => void research?: () => void
@ -75,11 +68,13 @@ const props = withDefaults(defineProps<{
research: () => { research: () => {
}, },
}) })
const appSettingStore = useAppSettingStore()
const uploaderIns = useTemplateRef<InstanceType<typeof Uploader>>('uploader')
const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel') const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel')
const status = ref<'add' | 'modify'>('add') const status = ref<'add' | 'modify'>('add')
const formPanelProps = buildFormPanelProps<ProjectTypes.SearchProjectResult>({ const formPanelProps = buildFormPanelProps<ProjectTypes.SearchProjectResult>({
title: status.value === 'add' ? '新建项目' : '修改项目', title: '',
detailsLoader(id?: string) { detailsLoader(id?: string) {
if (Strings.isBlank(id)) { if (Strings.isBlank(id)) {
status.value = 'add' status.value = 'add'
@ -88,7 +83,14 @@ const formPanelProps = buildFormPanelProps<ProjectTypes.SearchProjectResult>({
status.value = 'modify' status.value = 'modify'
return ProjectApi return ProjectApi
.detail(id!) .detail(id!)
.then(res => res.data) .then(res => {
console.log(res.data.contractStartDate, res.data.contractEndDate, [ Times.toDate(Times.parse(res.data.contractStartDate ?? '', FMT.date)), Times.toDate(Times.parse(res.data.contractEndDate ?? '', FMT.date)) ])
if (res.data.contractPicture != null) uploaderIns.value?.setDefaultFiles([ res.data.contractPicture ])
return {
...res.data,
contractDate: [ Times.toDate(Times.parse(res.data.contractStartDate ?? '', FMT.date)), Times.toDate(Times.parse(res.data.contractEndDate ?? '', FMT.date)) ],
}
})
} }
}, },
doSubmit(data) { doSubmit(data) {
@ -118,7 +120,9 @@ const formPanelProps = buildFormPanelProps<ProjectTypes.SearchProjectResult>({
contractEndDate: [ {required: true, message: '请填写合同有效期', trigger: 'blur'} ], contractEndDate: [ {required: true, message: '请填写合同有效期', trigger: 'blur'} ],
}, },
}) })
watchEffect(() => {
formPanelProps.title = status.value === 'add' ? '新建项目' : '修改项目'
})
defineExpose({ defineExpose({
open(data?: ProjectTypes.SearchProjectResult) { open(data?: ProjectTypes.SearchProjectResult) {
formPanelIns.value?.open(data?.id) formPanelIns.value?.open(data?.id)
@ -128,9 +132,37 @@ defineExpose({
<style lang="stylus" scoped> <style lang="stylus" scoped>
.form-items { .form-items {
grid-template-columns: 1fr 1fr; grid-template-areas: "a2 a1" \
"a2 a3" \
"a4 a5" \
"a6 a6";
:deep(.el-form-item) { :deep(.el-form-item) {
&:nth-child(1) {
grid-area a5
}
&:nth-child(2) {
grid-area a3
}
&:nth-child(3) {
grid-area a1
}
&:nth-child(4) {
grid-area a2
}
&:nth-child(5) {
grid-area a4
width 340px;
}
&:nth-child(6) {
grid-area a6
}
} }
} }
</style> </style>

View File

@ -26,11 +26,17 @@ declare global {
transCustomerId?: string transCustomerId?: string
transCustomerName?: string transCustomerName?: string
transCustomerPhone?: string transCustomerPhone?: string
transCustomerInfo?: {
customerName?: string
}
// 运输方企业 Id // 运输方企业 Id
transOrgId?: string transOrgId?: string
transOrgName?: string transOrgName?: string
// 产废方/购买方客户 Id // 产废方/购买方客户 Id
fringeCustomerId?: string fringeCustomerId?: string
fringeCustomerInfo?: {
customerName?: string
}
fringeCustomerName?: string fringeCustomerName?: string
fringeCustomerPhone?: string fringeCustomerPhone?: string
// 产废方/购买方企业 Id // 产废方/购买方企业 Id
@ -62,6 +68,7 @@ declare global {
contractStartDate?: string contractStartDate?: string
// 合同有效期 // 合同有效期
contractEndDate?: string contractEndDate?: string
contractDate?: Date[]
// 创建时间 // 创建时间
createTime?: string createTime?: string
} }

View File

@ -58,6 +58,7 @@ const tablePageProps = buildTablePageProps<StationTypes.SearchStationParam, Stat
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
stationFormIns.value?.open(row) stationFormIns.value?.open(row)
}, },

View File

@ -101,7 +101,6 @@ interface StationFormType {
const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel') const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel')
const status = ref<'add' | 'modify'>('add') const status = ref<'add' | 'modify'>('add')
const formPanelProps = buildFormPanelProps<StationFormType>({ const formPanelProps = buildFormPanelProps<StationFormType>({
title: status.value === 'add' ? '新建站点' : '修改站点',
labelWidth: '100px', labelWidth: '100px',
detailsLoader(id?: string) { detailsLoader(id?: string) {
if (Strings.isBlank(id)) { if (Strings.isBlank(id)) {
@ -185,7 +184,9 @@ const formPanelProps = buildFormPanelProps<StationFormType>({
}, },
}) })
watchEffect(() => {
formPanelProps.title = status.value === 'add' ? '新建站点' : '修改站点'
})
defineExpose({ defineExpose({
open(data?: ProjectTypes.SearchProjectResult) { open(data?: ProjectTypes.SearchProjectResult) {
formPanelIns.value?.open(data?.id) formPanelIns.value?.open(data?.id)

View File

@ -75,14 +75,14 @@ const tablePageProps = buildTablePageProps<CustomerTypes.SearchCustomerParam, Cu
table: { table: {
actionColumn: { actionColumn: {
tableActions: [ tableActions: [
{ /* {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'primary', type: 'success',
action({row}) { action({row}) {
truckFormIns.value?.open(row) truckFormIns.value?.open(row)
}, },
}, }, */
], ],
}, },
}, },

View File

@ -75,7 +75,6 @@ const tablePageProps = buildTablePageProps<ExpenseItemTypes.SearchExpenseItemPar
{ {
tooltip: '详情', tooltip: '详情',
icon: 'Postcard', icon: 'Postcard',
type: 'info',
action({row}) { action({row}) {
expenseItemDetailIns.value?.open(row) expenseItemDetailIns.value?.open(row)
}, },
@ -83,7 +82,7 @@ const tablePageProps = buildTablePageProps<ExpenseItemTypes.SearchExpenseItemPar
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'primary', type: 'success',
action({row}) { action({row}) {
expenseItemFormIns.value?.open(row) expenseItemFormIns.value?.open(row)
}, },

View File

@ -77,6 +77,7 @@ const tablePageProps = buildTablePageProps<GoodsCategoryTypes.SearchGoodsCategor
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
goodsCategoryFormIns.value?.open(row) goodsCategoryFormIns.value?.open(row)
}, },

View File

@ -54,13 +54,11 @@ const formPanelProps = buildFormPanelProps<GoodsCategoryTypes.SearchGoodsCategor
detailsLoader(id?: string) { detailsLoader(id?: string) {
if (Strings.isBlank(id)) { if (Strings.isBlank(id)) {
status.value = 'add' status.value = 'add'
formPanelProps.title = '新建产品分类'
return Promise.resolve({ return Promise.resolve({
bizType: props.defaultBizType, bizType: props.defaultBizType,
sort: 0, sort: 0,
} as GoodsCategoryTypes.SearchGoodsCategoryResult) } as GoodsCategoryTypes.SearchGoodsCategoryResult)
} else { } else {
formPanelProps.title = '修改产品分类'
status.value = 'modify' status.value = 'modify'
return GoodsCategoryApi.detail(id!) return GoodsCategoryApi.detail(id!)
.then((res) => { .then((res) => {
@ -101,7 +99,9 @@ const formPanelProps = buildFormPanelProps<GoodsCategoryTypes.SearchGoodsCategor
} }
}, },
}) })
watchEffect(() => {
formPanelProps.title = status.value === 'add' ? '新建产品分类' : '修改产品分类'
})
defineExpose({ defineExpose({
open(data?: GoodsCategoryTypes.SearchGoodsCategoryResult) { open(data?: GoodsCategoryTypes.SearchGoodsCategoryResult) {
formPanelIns.value?.open(data?.id) formPanelIns.value?.open(data?.id)

View File

@ -4,13 +4,19 @@ import GoodsCategoryApi from '@/pages/gds/goods-category/goods-category-api.ts'
import { bizType } from '@/pages/gds/goods-category/constants.ts' import { bizType } from '@/pages/gds/goods-category/constants.ts'
import Strings from '@/common/utils/strings.ts' import Strings from '@/common/utils/strings.ts'
const props = defineProps<{ const props = withDefaults(
defaultBizType: typeof bizType[number]['val'] defineProps<{
defaultValue: { defaultBizType: typeof bizType[number]['val']
id?: string disabled?: boolean
categoryName?: string defaultValue: {
} id?: string
}>() categoryName?: string
}
}>(),
{
disabled: false,
},
)
const dataList = Utils.resetAble(reactive<GoodsCategoryTypes.SearchGoodsCategoryResult[]>([])) const dataList = Utils.resetAble(reactive<GoodsCategoryTypes.SearchGoodsCategoryResult[]>([]))
const loading = ref(false) const loading = ref(false)
const model = defineModel<string>() const model = defineModel<string>()
@ -59,6 +65,7 @@ function changeHandle(value: string) {
placeholder="请输入文字搜索" placeholder="请输入文字搜索"
remote remote
remote-show-suffix remote-show-suffix
:disabled="disabled"
@change="changeHandle" @change="changeHandle"
> >
<ElOption v-for="it in dataList" :key="it.id" :label="it.categoryName" :value="it.id"/> <ElOption v-for="it in dataList" :key="it.id" :label="it.categoryName" :value="it.id"/>

View File

@ -32,6 +32,7 @@ declare global {
bizType?: string bizType?: string
// 分类名称 // 分类名称
categoryName?: string categoryName?: string
sn?: string
// 图片 // 图片
picture?: string picture?: string
// 排序 // 排序

View File

@ -19,7 +19,7 @@
<ElTableColumn label="是否可用" prop="canuse" width="100"> <ElTableColumn label="是否可用" prop="canuse" width="100">
<template #default="{row}"> <template #default="{row}">
<ElSwitch v-model="row.canuse" @change="enableGoodsHandler($event as boolean,row.id)"/> <ElSwitch v-model="row.canuse" :disabled="appUserStore.isXiaoNa" @change="enableGoodsHandler($event as boolean,row.id)"/>
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn label="备注" prop="memo" show-overflow-tooltip width="180"/> <ElTableColumn label="备注" prop="memo" show-overflow-tooltip width="180"/>
@ -38,10 +38,12 @@ import ATablePage, {
buildTablePageProps, buildTablePageProps,
} from '@/components/a-page/a-table-page/ATablePage.tsx' } from '@/components/a-page/a-table-page/ATablePage.tsx'
import { bizType } from '@/pages/gds/goods-category/constants.ts' import { bizType } from '@/pages/gds/goods-category/constants.ts'
import { useAppUserStore } from '@/common/app/app-user-store.ts'
const props = defineProps<{ const props = defineProps<{
defaultBizType: typeof bizType[number]['val'] defaultBizType: typeof bizType[number]['val']
}>() }>()
const appUserStore = useAppUserStore()
const goodsFormIns = useTemplateRef<InstanceType<typeof GoodsForm>>('goodsForm') const goodsFormIns = useTemplateRef<InstanceType<typeof GoodsForm>>('goodsForm')
@ -81,11 +83,15 @@ const tablePageProps = buildTablePageProps({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
goodsFormIns.value?.open(row) goodsFormIns.value?.open(row)
}, },
}, },
{ {
show() {
return !appUserStore.isXiaoNa
},
icon: 'Delete', icon: 'Delete',
loading: false, loading: false,
type: 'danger', type: 'danger',

View File

@ -7,13 +7,15 @@
<ElFormItem label="图片" prop="picture"> <ElFormItem label="图片" prop="picture">
<Uploader <Uploader
ref="uploader" ref="uploader"
:disabled="appUserStore.isXiaoNa"
v-model:file="formData.picture"/> v-model:file="formData.picture"/>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="status === 'modify'" label="产品编码" prop="sn"> <ElFormItem v-if="status === 'modify'" label="产品编码" prop="sn">
<ElInput v-model="formData.sn" placeholder="产品编码" readonly/> <ElInput v-model="formData.sn" :disabled="appUserStore.isXiaoNa" placeholder="产品编码" readonly/>
</ElFormItem> </ElFormItem>
<ElFormItem label="产品分类" prop="goodsCategoryId"> <ElFormItem label="产品分类" prop="goodsCategoryId">
<GoodsCategorySelect <GoodsCategorySelect
:disabled="appUserStore.isXiaoNa"
v-model="formData.goodsCategoryId" v-model="formData.goodsCategoryId"
:default-biz-type="defaultBizType" :default-biz-type="defaultBizType"
:default-value="{ :default-value="{
@ -22,7 +24,7 @@
}"/> }"/>
</ElFormItem> </ElFormItem>
<ElFormItem label="产品名称" prop="goodsName"> <ElFormItem label="产品名称" prop="goodsName">
<ElInput v-model="formData.goodsName" placeholder="产品名称"/> <ElInput v-model="formData.goodsName" :disabled="appUserStore.isXiaoNa" placeholder="产品名称"/>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="appUserStore.isXiaoNa" label="计费策略" prop="expenseStrategy"> <ElFormItem v-if="appUserStore.isXiaoNa" label="计费策略" prop="expenseStrategy">
<ElRadioGroup v-model="formData.expenseStrategy"> <ElRadioGroup v-model="formData.expenseStrategy">
@ -31,10 +33,10 @@
</ElFormItem> </ElFormItem>
<ElFormItem label="规格" prop="specParams"> <ElFormItem label="规格" prop="specParams">
<ElInput v-model="formData.specParams" placeholder="规格"/> <ElInput v-model="formData.specParams" :disabled="appUserStore.isXiaoNa" placeholder="规格"/>
</ElFormItem> </ElFormItem>
<ElFormItem label="计量单位" prop="unit"> <ElFormItem label="计量单位" prop="unit">
<ElSelect v-model="formData.unit"> <ElSelect v-model="formData.unit" :disabled="appUserStore.isXiaoNa">
<ElOption <ElOption
v-for="item in unit" v-for="item in unit"
:key="'unit'+item.val" :key="'unit'+item.val"
@ -72,13 +74,13 @@
</ElInputNumber> </ElInputNumber>
</ElFormItem> </ElFormItem>
<ElFormItem label="排序" prop="sort"> <ElFormItem label="排序" prop="sort">
<ElInputNumber v-model="formData.sort" controls-position="right" placeholder="请输入排序"/> <ElInputNumber v-model="formData.sort" :disabled="appUserStore.isXiaoNa" controls-position="right" placeholder="请输入排序"/>
</ElFormItem> </ElFormItem>
<ElFormItem label="是否可用" prop="canuse"> <ElFormItem label="是否可用" prop="canuse">
<el-switch v-model="formData.canuse"/> <el-switch v-model="formData.canuse" :disabled="appUserStore.isXiaoNa"/>
</ElFormItem> </ElFormItem>
<ElFormItem label="备注" prop="memo"> <ElFormItem label="备注" prop="memo">
<ElInput v-model="formData.memo" placeholder="请输入备注"/> <ElInput v-model="formData.memo" :disabled="appUserStore.isXiaoNa" placeholder="请输入备注"/>
</ElFormItem> </ElFormItem>
</div> </div>
</template> </template>
@ -113,7 +115,7 @@ const formPanelIns = useTemplateRef<AFormPanelInstance>('formPanel')
const uploaderIns = useTemplateRef<InstanceType<typeof Uploader>>('uploader') const uploaderIns = useTemplateRef<InstanceType<typeof Uploader>>('uploader')
const status = ref<'add' | 'modify'>('add') const status = ref<'add' | 'modify'>('add')
const formPanelProps = buildFormPanelProps<GoodsTypes.GoodsForm>({ const formPanelProps = buildFormPanelProps<GoodsTypes.GoodsForm>({
title: status.value === 'add' ? '新建产品' : '修改产品', // title: status.value === 'add' ? '' : '',
detailsLoader(id?: string) { detailsLoader(id?: string) {
if (Strings.isBlank(id)) { if (Strings.isBlank(id)) {
status.value = 'add' status.value = 'add'
@ -237,7 +239,9 @@ const formPanelProps = buildFormPanelProps<GoodsTypes.GoodsForm>({
} }
}, },
}) })
watchEffect(() => {
formPanelProps.title = status.value === 'add' ? '新建产品' : '修改产品'
})
defineExpose({ defineExpose({
open(data?: GoodsTypes.SearchGoodsResult) { open(data?: GoodsTypes.SearchGoodsResult) {
formPanelIns.value?.open(data?.id) formPanelIns.value?.open(data?.id)

View File

@ -53,6 +53,7 @@ const actionColumn = reactive<ActionColumnType<EndpointTypes.SearchEndpointResul
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
endpointFormIns.value?.open(row) endpointFormIns.value?.open(row)
}, },

View File

@ -74,6 +74,7 @@ const actionColumn = reactive<ActionColumnType<TplTypes.SearchTplResult>>({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
tplFormIns.value?.open(row) tplFormIns.value?.open(row)
}, },

View File

@ -76,6 +76,7 @@ const actionColumn = reactive<ActionColumnType<MenuTypes.SysMenu>>({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
menuFormIns.value?.open(row as MenuTypes.MenuForm) menuFormIns.value?.open(row as MenuTypes.MenuForm)
}, },

View File

@ -58,6 +58,7 @@ const actionColumn = reactive<ActionColumnType<RoleTypes.SearchRoleResult>>({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
show({row}) { show({row}) {
return row.id != '1' return row.id != '1'
}, },

View File

@ -54,6 +54,7 @@ const actionColumn = reactive<ActionColumnType<SnConfigTypes.SnConfigDetail>>({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
snConfigFormIns.value?.open(row) snConfigFormIns.value?.open(row)
}, },

View File

@ -100,6 +100,7 @@ const actionColumn = reactive<ActionColumnType<TaskTypes.SearchTaskResult>>({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
show({row}) { show({row}) {
return !row.builtin return !row.builtin
}, },

View File

@ -103,6 +103,7 @@ const actionColumn = reactive<ActionColumnType<UserTypes.SearchUserResult>>({
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
userFormIns.value?.open(row) userFormIns.value?.open(row)
}, },

View File

@ -86,6 +86,7 @@ const actionColumn = reactive<ActionColumnType<InOrderTypes.SearchInOrderResult>
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
inOrderFormIns.value?.open(row) inOrderFormIns.value?.open(row)
}, },

View File

@ -96,6 +96,7 @@ const actionColumn = reactive<ActionColumnType<InventoryTypes.SearchInventoryRes
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
inventoryFormIns.value?.open(row) inventoryFormIns.value?.open(row)
}, },

View File

@ -114,6 +114,7 @@ const actionColumn = reactive<ActionColumnType<OutOrderTypes.SearchOutOrderResul
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
outOrderFormIns.value?.open(row) outOrderFormIns.value?.open(row)
}, },

View File

@ -83,6 +83,7 @@ const actionColumn = reactive<ActionColumnType<PurchaseOrderTypes.SearchPurchase
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) { action({row}: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) {
purchaseOrderFormIns.value?.open(row) purchaseOrderFormIns.value?.open(row)
}, },

View File

@ -120,6 +120,7 @@ const actionColumn = reactive<ActionColumnType<SalesOrderTypes.SearchSalesOrderR
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
salesOrderFormIns.value?.open(row) salesOrderFormIns.value?.open(row)
}, },

View File

@ -80,6 +80,7 @@ const actionColumn = reactive<ActionColumnType<WarehouseTypes.SearchWarehouseRes
{ {
tooltip: '编辑', tooltip: '编辑',
icon: 'Edit', icon: 'Edit',
type: 'success',
action({row}) { action({row}) {
warehouseFormIns.value?.open(row) warehouseFormIns.value?.open(row)
}, },