陈薪名 1 year ago
parent
commit
f9f8c357f6
  1. 8
      src/components/Annex/src/Annex.vue
  2. 6
      src/components/BasicForm/src/BasicForm.vue
  3. 20
      src/components/ChangeRecord/src/ChangeRecord.vue
  4. 6
      src/components/Detail/src/Detail.vue
  5. 6
      src/components/ImportForm/src/ImportForm.vue
  6. 7
      src/components/Search/src/Search.vue
  7. 3
      src/components/UploadFile/src/UploadFile.vue
  8. 3
      src/components/UploadFile/src/UploadImg.vue
  9. 3
      src/components/UploadFile/src/UploadImgs.vue
  10. 14
      src/store/modules/user.ts
  11. 92
      src/utils/disposition/tableColumns.ts
  12. 7
      src/views/system/oauth2/client/ClientForm.vue

8
src/components/Annex/src/Annex.vue

@ -3,7 +3,7 @@
<div class="annex"> <div class="annex">
<div class="title flex items-center"> <div class="title flex items-center">
<div class="title-txt">附件</div> <div class="title-txt">附件</div>
<UploadFile :isShowFile="false" :isShowTip="false" title="添加附件"/> <UploadFile :isShowFile="false" :isShowTip="false" title="添加附件" :upData="upData"/>
</div> </div>
<div class="list"> <div class="list">
<div class="item flex items-start" v-for="(item, index) in data.annexList" :key="index"> <div class="item flex items-start" v-for="(item, index) in data.annexList" :key="index">
@ -36,7 +36,11 @@ const props = defineProps({
data: { data: {
type: Object, type: Object,
required: true required: true
} },
upData: {
type: Object,
required: true
},
}) })
// emit // emit
const emit = defineEmits(['handleImport','deleteAnnexSuccess']) const emit = defineEmits(['handleImport','deleteAnnexSuccess'])

6
src/components/BasicForm/src/BasicForm.vue

@ -338,20 +338,14 @@ const handleTableSelect = (row, column, event) => {
// //
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
console.log(row);
console.log(index);
emit('handleDeleteTable', row) emit('handleDeleteTable', row)
} }
// //
const handleAddTable = () => { const handleAddTable = () => {
console.log(2);
emit('handleAddTable') emit('handleAddTable')
} }
// //
const inpuFocus = (headerItem) => { const inpuFocus = (headerItem) => {
console.log(11);
opensearchTable() opensearchTable()
} }
</script> </script>

20
src/components/ChangeRecord/src/ChangeRecord.vue

@ -6,7 +6,7 @@
</div> </div>
<div class="list"> <div class="list">
<el-steps direction="vertical" class="mt-16px" :space="90"> <el-steps direction="vertical" class="mt-16px" :space="90">
<el-step v-for="(item, index) in data.changeRecordList" :key="index"> <el-step v-for="(item, index) in changeRecordData.changeRecordList" :key="index">
<template #icon> <template #icon>
<slot> <slot>
<Icon color="#9e9e9e" <Icon color="#9e9e9e"
@ -16,21 +16,24 @@
</template> </template>
<template #title> <template #title>
<slot> <slot>
<span class="color-#9e9e9e font-size-16px time">{{ item.time }}</span> <span class="color-#9e9e9e font-size-16px time">{{ formatDate(item.createTime) }}</span>
</slot> </slot>
</template> </template>
<template #description> <template #description>
<slot> <slot>
<div class="dic color-#303133" v-if="item.type == 1"> <div class="dic color-#303133" v-if="item.type == 1">
{{ item.name }} <span>创建了</span> 记录 {{ item.nickname }} {{ item.content }}
<!-- {{ item.nickname }} <span>创建了</span> 记录 -->
</div> </div>
<div class="dic color-#303133" v-else-if="item.type == 2"> <div class="dic color-#303133" v-else-if="item.type == 2">
{{ item.name }} <span>修改了</span> 状态 {{ item.nickname }} {{ item.content }}
<!-- {{ item.nickname }} <span>修改了</span> 状态 -->
</div> </div>
<div class="dic color-#303133" v-else-if="item.type == 3"> <div class="dic color-#303133" v-else-if="item.type == 3">
{{ item.name }} <span>添加了</span> 附件 {{ item.nickname }} {{ item.content }}
<!-- <span>添加了</span> 附件 -->
</div> </div>
<div class="tips" v-if="item.type == 2"> <!-- <div class="tips" v-if="item.type == 2">
<span class="color-#f56c6c" style="text-decoration:line-through">原值</span>><span <span class="color-#f56c6c" style="text-decoration:line-through">原值</span>><span
class="color-#67c23a">新值</span> class="color-#67c23a">新值</span>
</div> </div>
@ -39,7 +42,7 @@
<Icon color="#70b6ff" icon="ep:document" size="20" style="display:bloc"/> <Icon color="#70b6ff" icon="ep:document" size="20" style="display:bloc"/>
<div class="file-text" type="primary">{{cur.name}}</div> <div class="file-text" type="primary">{{cur.name}}</div>
</div> </div>
</div> </div> -->
</slot> </slot>
</template> </template>
@ -51,12 +54,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import download from '@/utils/download' import download from '@/utils/download'
import { formatDate } from '@/utils/formatTime'
defineComponent({ defineComponent({
name: 'ChangeRecord' name: 'ChangeRecord'
}) })
// //
const props = defineProps({ const props = defineProps({
data: { changeRecordData: {
type: Object, type: Object,
required: true required: true
} }

6
src/components/Detail/src/Detail.vue

@ -17,12 +17,12 @@
</ContentWrap> </ContentWrap>
<ContentWrap class="w-[27%] ml-16px"> <ContentWrap class="w-[27%] ml-16px">
<!-- 附件组件 --> <!-- 附件组件 -->
<Annex :data="annexData" @handleImport="handleImport" @deleteAnnex="deleteAnnexSuccess" /> <Annex :data="annexData" @handleImport="handleImport" @deleteAnnex="deleteAnnexSuccess" :upData="remarksData.data"/>
<!-- 备注组件 --> <!-- 备注组件 -->
<Remarks :remarksData="remarksData" class="mt-20px" <Remarks :remarksData="remarksData" class="mt-20px"
@remarksSubmitScuess="remarksSubmitScuess" /> @remarksSubmitScuess="remarksSubmitScuess" />
<!-- 变更记录组件 --> <!-- 变更记录组件 -->
<ChangeRecord :data="changeRecordData" class="mt-20px" /> <ChangeRecord :changeRecordData="changeRecordData" class="mt-20px" />
</ContentWrap> </ContentWrap>
</div> </div>
<ContentWrap v-else> <ContentWrap v-else>
@ -175,7 +175,6 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
detailLoading.value = true detailLoading.value = true
try { try {
detailData.value = row detailData.value = row
console.log(detailData.value);
getRemarkList() getRemarkList()
getChangeRecordList() getChangeRecordList()
@ -205,6 +204,7 @@ const remarksSubmitScuess = async (remark) => {
const getChangeRecordList = async () => { const getChangeRecordList = async () => {
// remarksData.data.tableId = '1679654720693248010' // remarksData.data.tableId = '1679654720693248010'
changeRecordData.changeRecordList = await DetailApi.getChangeRecordPage(remarksData.data) changeRecordData.changeRecordList = await DetailApi.getChangeRecordPage(remarksData.data)
} }
</script> </script>
<style lang="scss"> <style lang="scss">

6
src/components/ImportForm/src/ImportForm.vue

@ -132,7 +132,6 @@ const updatePart = ref(props.updatePart)//是否部门保存
const importUrl = const importUrl =
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url
console.log(135, importUrl)
/** 打开弹窗 */ /** 打开弹窗 */
const open = () => { const open = () => {
dialogVisible.value = true dialogVisible.value = true
@ -231,11 +230,6 @@ const handleExceed = (): void => {
/** 下载模板操作 */ /** 下载模板操作 */
const importTemplate = () => { const importTemplate = () => {
const res = importTemplateData.value.templateUrl const res = importTemplateData.value.templateUrl
console.log(266,importTemplateData.value.templateUrl)
console.log(1);
console.log(res);
console.log(1);
download.excel(res, importTemplateData.value.templateTitle) download.excel(res, importTemplateData.value.templateTitle)
} }
</script> </script>

7
src/components/Search/src/Search.vue

@ -102,13 +102,6 @@ const setVisible = () => {
} }
const Search = ref() const Search = ref()
onMounted(() => { onMounted(() => {
// nextTick(() => {
// console.log(4)
// console.log(Search.value.offsetHeight)
// wsCache.set('SearchoffsetHeight', Search.value.offsetHeight)
// console.log(wsCache.get('SearchoffsetHeight'))
// console.log(4)
// })
}) })
</script> </script>

3
src/components/UploadFile/src/UploadFile.vue

@ -8,7 +8,7 @@
v-model:file-list="fileList" v-model:file-list="fileList"
:show-file-list="true" :show-file-list="true"
:auto-upload="autoUpload" :auto-upload="autoUpload"
:action="updateUrl" :action="updateUrl+'?tableId='+upData?.tableId+'&tableName='+ upData?.tableName"
:headers="uploadHeaders" :headers="uploadHeaders"
:limit="props.limit" :limit="props.limit"
:drag="drag" :drag="drag"
@ -55,6 +55,7 @@ const props = defineProps({
}, },
title: propTypes.string.def('文件上传'), title: propTypes.string.def('文件上传'),
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL), updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
upData: propTypes.object.def(),
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // , ['png', 'jpg', 'jpeg'] fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // , ['png', 'jpg', 'jpeg']
fileSize: propTypes.number.def(5), // (MB) fileSize: propTypes.number.def(5), // (MB)
limit: propTypes.number.def(5), // limit: propTypes.number.def(5), //

3
src/components/UploadFile/src/UploadImg.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="upload-box"> <div class="upload-box">
<el-upload <el-upload
:action="updateUrl" :action="updateUrl + '?tableId=' + upData?.tableId + '&tableName=' + upData?.tableName"
:id="uuid" :id="uuid"
:class="['upload', drag ? 'no-border' : '']" :class="['upload', drag ? 'no-border' : '']"
:multiple="false" :multiple="false"
@ -75,6 +75,7 @@ type FileTypes =
const props = defineProps({ const props = defineProps({
modelValue: propTypes.string.def(''), modelValue: propTypes.string.def(''),
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL), updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
upData: propTypes.object.def(),
drag: propTypes.bool.def(true), // ==> true drag: propTypes.bool.def(true), // ==> true
disabled: propTypes.bool.def(false), // ==> false disabled: propTypes.bool.def(false), // ==> false
fileSize: propTypes.number.def(5), // ==> 5M fileSize: propTypes.number.def(5), // ==> 5M

3
src/components/UploadFile/src/UploadImgs.vue

@ -3,7 +3,7 @@
<el-upload <el-upload
v-model:file-list="fileList" v-model:file-list="fileList"
:accept="fileType.join(',')" :accept="fileType.join(',')"
:action="updateUrl" :action="updateUrl + '?tableId=' + upData?.tableId + '&tableName=' + upData?.tableName"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:class="['upload', drag ? 'no-border' : '']" :class="['upload', drag ? 'no-border' : '']"
:drag="drag" :drag="drag"
@ -75,6 +75,7 @@ const props = defineProps({
required: true required: true
}, },
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL), updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
upData: propTypes.object.def(),
drag: propTypes.bool.def(true), // ==> true drag: propTypes.bool.def(true), // ==> true
disabled: propTypes.bool.def(false), // ==> false disabled: propTypes.bool.def(false), // ==> false
limit: propTypes.number.def(5), // ==> 5 limit: propTypes.number.def(5), // ==> 5

14
src/store/modules/user.ts

@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
import { getAccessToken, removeToken } from '@/utils/auth' import { getAccessToken, removeToken } from '@/utils/auth'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getInfo, loginOut } from '@/api/login' import { getInfo, loginOut } from '@/api/login'
import { getUserProfile } from '@/api/system/user/profile'
const { wsCache } = useCache() const { wsCache } = useCache()
@ -16,6 +17,7 @@ interface UserInfoVO {
roles: string[] roles: string[]
isSetUser: boolean isSetUser: boolean
user: UserVO user: UserVO
userSelfInfo:object
} }
export const useUserStore = defineStore('admin-user', { export const useUserStore = defineStore('admin-user', {
@ -27,7 +29,8 @@ export const useUserStore = defineStore('admin-user', {
id: 0, id: 0,
avatar: '', avatar: '',
nickname: '' nickname: ''
} },
userSelfInfo:{}
}), }),
getters: { getters: {
getPermissions(): string[] { getPermissions(): string[] {
@ -41,6 +44,9 @@ export const useUserStore = defineStore('admin-user', {
}, },
getUser(): UserVO { getUser(): UserVO {
return this.user return this.user
},
getUserSelfInfo(): UserVO {
return this.userSelfInfo
} }
}, },
actions: { actions: {
@ -53,6 +59,12 @@ export const useUserStore = defineStore('admin-user', {
if (!userInfo) { if (!userInfo) {
userInfo = await getInfo() userInfo = await getInfo()
} }
this.userSelfInfo = await getUserProfile()
// userInfo = await getInfo()
console.log(4);
console.log(this.userSelfInfo);
console.log(4);
this.permissions = userInfo.permissions this.permissions = userInfo.permissions
this.roles = userInfo.roles this.roles = userInfo.roles
this.user = userInfo.user this.user = userInfo.user

92
src/utils/disposition/tableColumns.ts

@ -1,5 +1,20 @@
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 * as getRequestsettingApi from '@/api/wms/requestsetting/index.ts'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'PurchaseClaimRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsetting = data[0]
/** /**
* @returns {Array} * @returns {Array}
*/ */
@ -10556,16 +10571,30 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '单据号', label: '单据号',
field: 'number' field: 'number',
isForm:false,
}, },
{ {
label: '业务类型', label: '业务类型',
field: 'businessType' field: 'businessType',
form:{
value:'PurchaseClaim',
componentProps:{
disabled:true,
}
}
}, },
{ {
label: '申请时间', label: '申请时间',
field: 'requestTime', field: 'requestTime',
formatter: dateFormatter, formatter: dateFormatter,
form: {
value: new Date(),
component: 'DatePicker',
componentProps: {
type: 'datetime',
}
},
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
} }
@ -10574,13 +10603,25 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '截止时间', label: '截止时间',
field: 'dueTime', field: 'dueTime',
formatter: dateFormatter, formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
}
},
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
} }
}, },
{ {
label: '部门', label: '部门',
field: 'departmentCode' field: 'departmentCode',
form: {
value:userDept.name,
componentProps:{
disabled:true,
}
},
}, },
{ {
label: '状态', label: '状态',
@ -10588,7 +10629,13 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.REQUEST_STATUS, dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true isTable: true,
form: {
value:'NEW',
componentProps:{
disabled:true,
}
},
}, },
{ {
label: '备注', label: '备注',
@ -10597,12 +10644,14 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',
isForm:false
}, },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
isTable: true, isTable: true,
formatter: dateFormatter, formatter: dateFormatter,
isForm:false,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
} }
@ -10610,12 +10659,14 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '最后更新者', label: '最后更新者',
field: 'updater', field: 'updater',
isForm:false
}, },
{ {
label: '最后更新时间', label: '最后更新时间',
field: 'updateTime', field: 'updateTime',
isTable: true, isTable: true,
formatter: dateFormatter, formatter: dateFormatter,
isForm:false,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
} }
@ -10626,7 +10677,11 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true isTable: true,
form:{
component:'Switch',
value:true,
}
}, },
{ {
label: '自动通过', label: '自动通过',
@ -10649,13 +10704,36 @@ export const PurchaseclaimRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'directCreateRecord', field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: false,
isTable: true isTable: true
} }
])) ]))
// 表单校验 // 表单校验
export const PurchaseclaimRequestMainRules = reactive({ export const PurchaseclaimRequestMainRules = reactive({
asnNumber: [
{ required: true, message: '请输入发货单号', trigger: 'blur' }
],
ppNumber: [
{ required: true, message: '请输入要货计划单号', trigger: 'blur' }
],
supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'change' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'change' }
],
requestTime: [
{ required: true, message: '请选择申请时间', trigger: 'change' }
],
dueTime: [
{ required: true, message: '请选择截止时间', trigger: 'change' }
],
departmentCode: [
{ required: true, message: '请选择部门', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
}) })
/** /**

7
src/views/system/oauth2/client/ClientForm.vue

@ -17,7 +17,7 @@
<el-input v-model="formData.name" placeholder="请输入应用名" /> <el-input v-model="formData.name" placeholder="请输入应用名" />
</el-form-item> </el-form-item>
<el-form-item label="应用图标"> <el-form-item label="应用图标">
<UploadImg v-model="formData.logo" :limit="1" /> <UploadImg v-model="formData.logo" :limit="1" :upData="upData"/>
</el-form-item> </el-form-item>
<el-form-item label="应用描述"> <el-form-item label="应用描述">
<el-input v-model="formData.description" placeholder="请输入应用名" type="textarea" /> <el-input v-model="formData.description" placeholder="请输入应用名" type="textarea" />
@ -193,6 +193,7 @@ const formRules = reactive({
const formRef = ref() // Ref const formRef = ref() // Ref
/** 打开弹窗 */ /** 打开弹窗 */
const upData = ref()
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
@ -201,6 +202,10 @@ const open = async (type: string, id?: number) => {
// //
if (id) { if (id) {
formLoading.value = true formLoading.value = true
upData.value = {
tableId : id,
tableName:'systemOauth2Client'
}
try { try {
formData.value = await ClientApi.getOAuth2Client(id) formData.value = await ClientApi.getOAuth2Client(id)
} finally { } finally {

Loading…
Cancel
Save