修改bug

This commit is contained in:
wangyilin 2024-09-14 15:55:16 +08:00
parent e5fa6ae335
commit e9f6f61b21
4 changed files with 53 additions and 42 deletions

View File

@ -10,25 +10,25 @@ const pinia = createPinia()
// pinia.use(piniaPluginPersistedstate) // pinia.use(piniaPluginPersistedstate)
const App = createApp({ const App = createApp({
onShow(options) { onShow(options) {
try { // try {
const store = useCounterStore() // const store = useCounterStore()
const token = Taro.getStorageSync('token') // const token = Taro.getStorageSync('token')
console.log(token) // console.log(token)
if (token) { // if (token) {
Taro.switchTab({ // Taro.switchTab({
url: '/pages/mine/mine' // url: '/pages/mine/mine'
// url: '/pages/projectManager/index/index' // // url: '/pages/projectManager/index/index'
//
}) // })
store.setSelected(2) // store.setSelected(2)
} else { // } else {
console.log(2222) // console.log(2222)
} // }
console.log('App onShow.') // console.log('App onShow.')
} catch (err) { // } catch (err) {
console.log(err) // console.log(err)
//
} // }
}, },
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖 // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖

View File

@ -1,6 +1,5 @@
<template> <template>
<view class="form"> <view class="form">
{{ formData }}
<nut-form ref="formRef" :model-value="formData" :rules="rules"> <nut-form ref="formRef" :model-value="formData" :rules="rules">
<nut-form-item label="姓名" prop="name"> <nut-form-item label="姓名" prop="name">
<nut-input v-model="formData.name" placeholder="请输入姓名" type="text"/> <nut-input v-model="formData.name" placeholder="请输入姓名" type="text"/>

View File

@ -1,5 +1,6 @@
<template> <template>
<view class="myProject"> <view class="myProject">
<view v-if="myProjectList">
<view class="myProjectItem" v-for="(item,index) in myProjectList" :key="index"> <view class="myProjectItem" v-for="(item,index) in myProjectList" :key="index">
<view style="display: flex;justify-content: space-between"> <view style="display: flex;justify-content: space-between">
<text>{{ item?.name }}</text> <text>{{ item?.name }}</text>
@ -19,6 +20,13 @@
</view> </view>
</view> </view>
</view> </view>
<view v-else class="myProject" >
<nut-empty image="empty" description="暂无项目">
<div style="margin-top: 10px">
</div>
</nut-empty>
</view>
</view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -31,6 +39,7 @@ const myProjectList = ref<MyProjectList[]>()
const getMyServiceProject = async () => { const getMyServiceProject = async () => {
const resp = await api.get<MyProjectList[]>(`/projectManageIndex/getMyServiceProject`) const resp = await api.get<MyProjectList[]>(`/projectManageIndex/getMyServiceProject`)
myProjectList.value = resp.data myProjectList.value = resp.data
console.log(myProjectList.value.length)
} }
const projectClick = (items: ServiceProjectList, name: string) => { const projectClick = (items: ServiceProjectList, name: string) => {

View File

@ -113,7 +113,8 @@ const columns: TableProps['columns'] = [
dataIndex: 'enterprisesUnitName', dataIndex: 'enterprisesUnitName',
title: '企事业单位名称', title: '企事业单位名称',
width: 150, width: 150,
ellipsis: true ellipsis: true,
}, },
{ {
dataIndex:'type', dataIndex:'type',
@ -192,7 +193,7 @@ const columns: TableProps['columns'] = [
<a-button type="primary" danger>删除</a-button> <a-button type="primary" danger>删除</a-button>
</a-popconfirm> </a-popconfirm>
<a-button type="primary" onClick={ async ()=>{ <a-button type="primary" onClick={ async ()=>{
console.log(record) // console.log(record)
visible.value = true visible.value = true
serviceTitle.value = '编辑服务项目' serviceTitle.value = '编辑服务项目'
if(record.isRecruitSecurity === null ){ if(record.isRecruitSecurity === null ){
@ -207,7 +208,7 @@ const columns: TableProps['columns'] = [
idNumberDisabled.value = true idNumberDisabled.value = true
} }
} }
formParams.value.projectManagerMiniProgramUserId = record.projectManagerMiniProgramUserName formParams.value.projectManagerMiniProgramUserId = record.projectManagerMiniProgramUserId
formParams.value.snowFlakeId = record.snowFlakeId formParams.value.snowFlakeId = record.snowFlakeId
formParams.value.name = record.name formParams.value.name = record.name
formParams.value.type = record.type.value formParams.value.type = record.type.value
@ -218,9 +219,7 @@ const columns: TableProps['columns'] = [
formParams.value.houseTotal = record.houseTotal formParams.value.houseTotal = record.houseTotal
formParams.value.staffTotal = record.staffTotal formParams.value.staffTotal = record.staffTotal
formParams.value. securityUserTotal = record.securityUserTotal formParams.value. securityUserTotal = record.securityUserTotal
formParams.value.enterprisesUnitId = record.enterprisesUnitName formParams.value.enterprisesUnitId = record.enterprisesUnitName
enterprisesUnitId.value = record.enterprisesUnitId
formParams.value.administrativeDivisionCodes = record.enterprisesUnitAdministrativeDivisionCodes formParams.value.administrativeDivisionCodes = record.enterprisesUnitAdministrativeDivisionCodes
}}>编辑</a-button> }}>编辑</a-button>
</a-space> </a-space>
@ -278,7 +277,11 @@ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdatePara
label:'企事业单位', label:'企事业单位',
options:enterprisesUnitIdList, options:enterprisesUnitIdList,
componentsProps:{ componentsProps:{
allowClear:true allowClear:true,
onChange:async (value:string)=>{
console.log(value)
enterprisesUnitId.value = value
}
} }
}, },
type: { type: {
@ -368,10 +371,10 @@ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdatePara
label: '备注', label: '备注',
} }
}) })
const UnitId = ref('')
const submit = async()=>{ const submit = async()=>{
await formRef.value.validate() await formRef.value.validate()
const snowFlakeId = ref('') const snowFlakeId = ref('')
const UnitId = ref('')
if (serviceTitle.value === '新增服务项目') { if (serviceTitle.value === '新增服务项目') {
snowFlakeId.value = '' snowFlakeId.value = ''
UnitId.value = formParams.value.enterprisesUnitId UnitId.value = formParams.value.enterprisesUnitId