fix
Showing
2 changed files
with
229 additions
and
226 deletions
| ... | @@ -46,24 +46,24 @@ watch( | ... | @@ -46,24 +46,24 @@ watch( |
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | // isExist.length == 0 && list.push(newRouter); | 48 | // isExist.length == 0 && list.push(newRouter); |
| 49 | list.map(item => { | 49 | // list.map(item => { |
| 50 | if (combPath == 'app-scenes') { | 50 | // if (combPath == 'app-scenes') { |
| 51 | item.visible = item.fullPath == '/' | 51 | // item.visible = item.fullPath == '/' |
| 52 | } else { | 52 | // } else { |
| 53 | if (item.fullPath.split('/')?.[1] != combPath) { | 53 | // if (item.fullPath.split('/')?.[1] != combPath) { |
| 54 | item.visible = false | 54 | // item.visible = false |
| 55 | } else { | 55 | // } else { |
| 56 | item.visible = true | 56 | // item.visible = true |
| 57 | } | 57 | // } |
| 58 | } | 58 | // } |
| 59 | }) | 59 | // }) |
| 60 | tabbarList.value = list; | 60 | tabbarList.value = list; |
| 61 | tabbarActive.value = newRouter.fullPath; | 61 | tabbarActive.value = newRouter.fullPath; |
| 62 | userStore.setTabbar(tabbarList.value); | 62 | userStore.setTabbar(tabbarList.value); |
| 63 | userStore.setActiveTabbar(combPath, newRouter.fullPath); | 63 | userStore.setActiveTabbar(combPath, newRouter.fullPath); |
| 64 | nextTick(() => { | 64 | // nextTick(() => { |
| 65 | setTabVisible() | 65 | // setTabVisible() |
| 66 | }) | 66 | // }) |
| 67 | }, | 67 | }, |
| 68 | { immediate: true } | 68 | { immediate: true } |
| 69 | ); | 69 | ); |
| ... | @@ -78,7 +78,9 @@ const changeTab = (pane: any, ev: any) => { | ... | @@ -78,7 +78,9 @@ const changeTab = (pane: any, ev: any) => { |
| 78 | userStore.setActiveTabbar(combPath, paneData.fullPath); | 78 | userStore.setActiveTabbar(combPath, paneData.fullPath); |
| 79 | }; | 79 | }; |
| 80 | const removeTab = (targetName) => { | 80 | const removeTab = (targetName) => { |
| 81 | const tabs = tabbarList.value.filter(item => item.visible ?? true); | 81 | // const tabs = tabbarList.value.filter(item => item.visible ?? true); |
| 82 | const tabs = tabbarList.value; | ||
| 83 | let activeName = tabbarActive.value, nextTab: any = {}; | ||
| 82 | const setTabs = (activeTab) => { | 84 | const setTabs = (activeTab) => { |
| 83 | tabbarActive.value = activeName; | 85 | tabbarActive.value = activeName; |
| 84 | tabbarList.value = tabbarList.value.filter((tab) => tab.fullPath !== targetName); | 86 | tabbarList.value = tabbarList.value.filter((tab) => tab.fullPath !== targetName); |
| ... | @@ -94,12 +96,12 @@ const removeTab = (targetName) => { | ... | @@ -94,12 +96,12 @@ const removeTab = (targetName) => { |
| 94 | } | 96 | } |
| 95 | nextTick(() => { | 97 | nextTick(() => { |
| 96 | nextTab.name && router.push({ name: nextTab.name, query: nextTab.query }); | 98 | nextTab.name && router.push({ name: nextTab.name, query: nextTab.query }); |
| 97 | setTabVisible() | 99 | // setTabVisible() |
| 98 | }); | 100 | }); |
| 99 | } | 101 | } |
| 100 | 102 | ||
| 101 | let activeName = tabbarActive.value; | 103 | // let activeName = tabbarActive.value; |
| 102 | let nextTab: any = {}; | 104 | // let nextTab: any = {}; |
| 103 | if (tabbarActive.value === targetName) { | 105 | if (tabbarActive.value === targetName) { |
| 104 | tabs.forEach((tab, index) => { | 106 | tabs.forEach((tab, index) => { |
| 105 | if (tab.fullPath === targetName) { | 107 | if (tab.fullPath === targetName) { |
| ... | @@ -112,7 +114,7 @@ const removeTab = (targetName) => { | ... | @@ -112,7 +114,7 @@ const removeTab = (targetName) => { |
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | let activeTab: any = tabs.find(t => t.fullPath === targetName); | 116 | let activeTab: any = tabs.find(t => t.fullPath === targetName); |
| 115 | if (activeTab.meta.editPage) { | 117 | if (activeTab && activeTab.meta.editPage) { |
| 116 | ElMessageBox.confirm( | 118 | ElMessageBox.confirm( |
| 117 | "当前页面尚未保存,确定关闭吗?", | 119 | "当前页面尚未保存,确定关闭吗?", |
| 118 | "提示", | 120 | "提示", |
| ... | @@ -140,13 +142,14 @@ const setTabVisible = () => { | ... | @@ -140,13 +142,14 @@ const setTabVisible = () => { |
| 140 | const tabpanes: any = document.querySelectorAll('.tabbar-container .el-tabs__item') | 142 | const tabpanes: any = document.querySelectorAll('.tabbar-container .el-tabs__item') |
| 141 | let list: any = [] | 143 | let list: any = [] |
| 142 | tabpanes.forEach((tab, i) => { | 144 | tabpanes.forEach((tab, i) => { |
| 143 | const visible = tabbarList.value[i].visible ?? true | 145 | // const visible = tabbarList.value[i].visible ?? true |
| 144 | if (!visible) { | 146 | // if (!visible) { |
| 145 | tab.style.display = 'none' | 147 | // tab.style.display = 'none' |
| 146 | } else { | 148 | // } else { |
| 147 | tab.style.display = 'inherit' | 149 | // tab.style.display = 'inherit' |
| 150 | // list.push(tabbarList.value[i].fullPath) | ||
| 151 | // } | ||
| 148 | list.push(tabbarList.value[i].fullPath) | 152 | list.push(tabbarList.value[i].fullPath) |
| 149 | } | ||
| 150 | }) | 153 | }) |
| 151 | visibleTabs.value = list | 154 | visibleTabs.value = list |
| 152 | } | 155 | } |
| ... | @@ -159,7 +162,7 @@ onMounted(() => { | ... | @@ -159,7 +162,7 @@ onMounted(() => { |
| 159 | <div class="tabbar-container"> | 162 | <div class="tabbar-container"> |
| 160 | <el-tabs v-model="tabbarActive" type="card" @tab-click="changeTab" @tab-remove="removeTab"> | 163 | <el-tabs v-model="tabbarActive" type="card" @tab-click="changeTab" @tab-remove="removeTab"> |
| 161 | <el-tab-pane v-for="(item, index) in tabbarList" :key="item.fullPath + '_' + index" :name="item.fullPath" | 164 | <el-tab-pane v-for="(item, index) in tabbarList" :key="item.fullPath + '_' + index" :name="item.fullPath" |
| 162 | :closable="visibleTabs.length > 1"> | 165 | :closable="tabbarList.length > 1"> |
| 163 | <template #label v-if="item.isHomePage"> | 166 | <template #label v-if="item.isHomePage"> |
| 164 | <span class="custom-tabs-label"> | 167 | <span class="custom-tabs-label"> |
| 165 | <el-icon> | 168 | <el-icon> | ... | ... |
| 1 | 1 | <script lang="ts" setup name="entryManagement"> | |
| 2 | 2 | import { ref, onBeforeMount } from 'vue'; | |
| 3 | <script lang="ts" setup name="entryManagement" > | ||
| 4 | import { ref,onBeforeMount } from 'vue'; | ||
| 5 | import { useRoute } from "vue-router" | 3 | import { useRoute } from "vue-router" |
| 6 | import { ElMessage, ElMessageBox } from "element-plus" | 4 | import { ElMessage, ElMessageBox } from "element-plus" |
| 7 | import dayjs from 'dayjs'; | 5 | import dayjs from 'dayjs'; |
| ... | @@ -15,6 +13,7 @@ import { | ... | @@ -15,6 +13,7 @@ import { |
| 15 | intableUpdate, | 13 | intableUpdate, |
| 16 | getDocumentList | 14 | getDocumentList |
| 17 | } from "@/api/modules/dataTransaction"; | 15 | } from "@/api/modules/dataTransaction"; |
| 16 | import { getDamCatalogTable } from '@/api/modules/dataAsset'; | ||
| 18 | const route = useRoute() | 17 | const route = useRoute() |
| 19 | const userStore = useUserStore(); | 18 | const userStore = useUserStore(); |
| 20 | const searchItemList = ref([ | 19 | const searchItemList = ref([ |
| ... | @@ -29,7 +28,7 @@ const searchItemList = ref([ | ... | @@ -29,7 +28,7 @@ const searchItemList = ref([ |
| 29 | ]); | 28 | ]); |
| 30 | const page = ref({ | 29 | const page = ref({ |
| 31 | limit: 50, | 30 | limit: 50, |
| 32 | rows:0, | 31 | rows: 0, |
| 33 | curr: 1, | 32 | curr: 1, |
| 34 | sizes: [ | 33 | sizes: [ |
| 35 | { label: "10", value: 10 }, | 34 | { label: "10", value: 10 }, |
| ... | @@ -45,123 +44,130 @@ const { proxy } = getCurrentInstance() as any; | ... | @@ -45,123 +44,130 @@ const { proxy } = getCurrentInstance() as any; |
| 45 | const tableRef = ref() | 44 | const tableRef = ref() |
| 46 | const tableInfo = ref({ | 45 | const tableInfo = ref({ |
| 47 | id: 'entry-asset-table', | 46 | id: 'entry-asset-table', |
| 48 | loading:false, | 47 | loading: false, |
| 49 | isEdit:false, | 48 | isEdit: false, |
| 50 | currentId:"0", | 49 | currentId: "0", |
| 51 | flag:"create", | 50 | flag: "create", |
| 52 | data:[] as any, | 51 | data: [] as any, |
| 53 | }) | 52 | }) |
| 54 | 53 | ||
| 55 | const tableSelectInfo = ref({ | 54 | const tableSelectInfo = ref({ |
| 56 | selectValue:"", | 55 | selectValue: "", |
| 57 | daName:"", | 56 | daName: "", |
| 58 | companyGuid:"" | 57 | companyGuid: "" |
| 59 | }) | 58 | }) |
| 60 | const columnInfo = ref({ | 59 | const columnInfo = ref({ |
| 61 | guid:"", | 60 | guid: "", |
| 62 | companyName:"", | 61 | companyName: "", |
| 63 | daName:"", | 62 | daName: "", |
| 64 | registerTime:"", | 63 | registerTime: "", |
| 65 | daCode:"", | 64 | daCode: "", |
| 66 | effectiveDate:"", | 65 | effectiveDate: "", |
| 67 | intableTime:"", | 66 | intableTime: "", |
| 68 | intableMoney:0, | 67 | intableMoney: 0, |
| 69 | issuingEntityName:"", | 68 | issuingEntityName: "", |
| 70 | issuingEntityGuid:"", | 69 | issuingEntityGuid: "", |
| 71 | companyGuid:"", | 70 | companyGuid: "", |
| 72 | registerGuid:"" | 71 | registerGuid: "" |
| 73 | }) | 72 | }) |
| 74 | const companyOption = ref<any>([]) | 73 | const companyOption = ref<any>([ |
| 74 | { | ||
| 75 | tenantGuid: JSON.parse(userStore.userData).tenantGuid, | ||
| 76 | tenantName: JSON.parse(userStore.userData).tenantName | ||
| 77 | } | ||
| 78 | ]) | ||
| 75 | const assetsOption = ref<any>([]) | 79 | const assetsOption = ref<any>([]) |
| 76 | 80 | ||
| 77 | const colums = [ | 81 | const colums = [ |
| 78 | { | 82 | { |
| 79 | type:"index", | 83 | type: "index", |
| 80 | label:"序号", | 84 | label: "序号", |
| 81 | align:"center", | 85 | align: "center", |
| 82 | width:"56" | 86 | width: "56" |
| 83 | }, | 87 | }, |
| 84 | { | 88 | { |
| 85 | prop:"companyName", | 89 | prop: "companyName", |
| 86 | label:"公司名称", | 90 | label: "公司名称", |
| 87 | width:"220", | 91 | width: "220", |
| 88 | componentType:"select", | 92 | componentType: "select", |
| 89 | // editDisabled:()=> tableInfo.value.flag==="edit" ? true :false, | 93 | // editDisabled:()=> tableInfo.value.flag==="edit" ? true :false, |
| 90 | selectKey:"tenantName", | 94 | selectKey: "tenantName", |
| 91 | selectOption:() => companyOption.value | 95 | selectOption: () => companyOption.value |
| 92 | }, | 96 | }, |
| 93 | { | 97 | { |
| 94 | prop:"daName", | 98 | prop: "intableTime", |
| 95 | label:"资产名称", | 99 | label: "入表时间", |
| 96 | width:"180", | 100 | width: "130", |
| 97 | componentType:"select", | 101 | componentType: "dateTime", |
| 98 | componentDisabled:false, | 102 | componentDisabled: false |
| 99 | //editDisabled:()=> tableInfo.value.flag==="edit" ? true :false, | ||
| 100 | selectOption:() => assetsOption.value , | ||
| 101 | selectKey:"daName", | ||
| 102 | }, | 103 | }, |
| 103 | { | 104 | { |
| 104 | prop:"daCode", | 105 | prop: "intableMoney", |
| 105 | label:"资产编号", | 106 | label: "入表金额(万元)", |
| 106 | width:"180" | 107 | width: "200", |
| 108 | componentType: "number", | ||
| 109 | toFixed: true, | ||
| 110 | placeholder: "0.00", | ||
| 111 | align: "right", | ||
| 112 | config: { | ||
| 113 | controls: false, | ||
| 114 | precision: 0 | ||
| 107 | }, | 115 | }, |
| 108 | { | 116 | componentDisabled: false, |
| 109 | prop:"registerTime", | 117 | input: (value, key, info) => { |
| 110 | label:"登记时间", | 118 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/[^\d.]/g, "") |
| 111 | width:"130", | 119 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/\.{2,}/g, ".") |
| 112 | componentType:"dateTime", | 120 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(".", "$#$").replace(/\./g, "").replace("$#$", ".") |
| 121 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3") | ||
| 122 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/^\D*(\d{0,12}(?:\.\d{0,6})?).*$/g, "$1") | ||
| 123 | }, | ||
| 124 | change: (value, key, info) => { | ||
| 125 | let strArr = value.split(".") | ||
| 126 | if (strArr.length > 1) { | ||
| 127 | let right = strArr[1] | ||
| 128 | if (right === '' || right.length < 2) { | ||
| 129 | tableRef.value.columnInfo[key] = parseFloat(tableRef.value.columnInfo[key] || 0).toFixed(2) | ||
| 130 | } | ||
| 131 | } else { | ||
| 132 | tableRef.value.columnInfo[key] = parseFloat(tableRef.value.columnInfo[key] || 0).toFixed(2) | ||
| 133 | } | ||
| 134 | |||
| 135 | } | ||
| 113 | }, | 136 | }, |
| 114 | { | 137 | { |
| 115 | prop:"effectiveDate", | 138 | prop: "daName", |
| 116 | label:"有效期", | 139 | label: "资产名称", |
| 117 | width:"130", | 140 | width: "180", |
| 118 | componentType:"dateTime", | 141 | componentType: "select", |
| 142 | componentDisabled: false, | ||
| 143 | //editDisabled:()=> tableInfo.value.flag==="edit" ? true :false, | ||
| 144 | selectOption: () => assetsOption.value, | ||
| 145 | selectKey: "damName", | ||
| 119 | }, | 146 | }, |
| 120 | { | 147 | { |
| 121 | prop:"issuingEntityName", | 148 | prop: "daCode", |
| 122 | label:"发证主体", | 149 | label: "资产编号", |
| 123 | width:"250" | 150 | width: "180" |
| 124 | }, | 151 | }, |
| 152 | |||
| 125 | { | 153 | { |
| 126 | prop:"intableTime", | 154 | prop: "registerTime", |
| 127 | label:"入表时间", | 155 | label: "登记时间", |
| 128 | width:"130", | 156 | width: "130", |
| 129 | componentType:"dateTime", | 157 | componentType: "dateTime", |
| 130 | componentDisabled:false | ||
| 131 | }, | 158 | }, |
| 132 | { | 159 | { |
| 133 | prop:"intableMoney", | 160 | prop: "effectiveDate", |
| 134 | label:"入表金额(万元)", | 161 | label: "有效期", |
| 135 | width:"200", | 162 | width: "130", |
| 136 | componentType:"number", | 163 | componentType: "dateTime", |
| 137 | toFixed:true, | ||
| 138 | placeholder:"0.00", | ||
| 139 | align:"right", | ||
| 140 | config:{ | ||
| 141 | controls:false, | ||
| 142 | precision:0 | ||
| 143 | }, | 164 | }, |
| 144 | componentDisabled:false, | 165 | { |
| 145 | input:(value,key,info)=>{ | 166 | prop: "issuingEntityName", |
| 146 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/[^\d.]/g,"") | 167 | label: "发证主体", |
| 147 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/\.{2,}/g,".") | 168 | width: "250" |
| 148 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(".","$#$").replace(/\./g,"").replace("$#$",".") | ||
| 149 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/,"$1$2.$3") | ||
| 150 | tableRef.value.columnInfo[key] = tableRef.value.columnInfo[key].toString().replace(/^\D*(\d{0,12}(?:\.\d{0,6})?).*$/g,"$1") | ||
| 151 | }, | 169 | }, |
| 152 | change:(value,key,info) => { | ||
| 153 | let strArr = value.split(".") | ||
| 154 | if(strArr.length>1) { | ||
| 155 | let right = strArr[1] | ||
| 156 | if(right==='' || right.length<2) { | ||
| 157 | tableRef.value.columnInfo[key] = parseFloat(tableRef.value.columnInfo[key]||0).toFixed(2) | ||
| 158 | } | ||
| 159 | } else { | ||
| 160 | tableRef.value.columnInfo[key] = parseFloat(tableRef.value.columnInfo[key]||0).toFixed(2) | ||
| 161 | } | ||
| 162 | 170 | ||
| 163 | } | ||
| 164 | }, | ||
| 165 | ] | 171 | ] |
| 166 | const toSearch = (val: any, clear: boolean = false) => { | 172 | const toSearch = (val: any, clear: boolean = false) => { |
| 167 | page.value.curr = 1; | 173 | page.value.curr = 1; |
| ... | @@ -176,23 +182,25 @@ const toSearch = (val: any, clear: boolean = false) => { | ... | @@ -176,23 +182,25 @@ const toSearch = (val: any, clear: boolean = false) => { |
| 176 | // 查公司 | 182 | // 查公司 |
| 177 | const documentList = async () => { | 183 | const documentList = async () => { |
| 178 | const res = await getDocumentList({ | 184 | const res = await getDocumentList({ |
| 179 | daName:tableSelectInfo.value.selectValue, | 185 | daName: tableSelectInfo.value.selectValue, |
| 180 | isCompany: true, | 186 | isCompany: true, |
| 181 | type:1}) | 187 | type: 1 |
| 182 | companyOption.value =res.data || [] | 188 | }) |
| 189 | companyOption.value = res.data || [] | ||
| 183 | 190 | ||
| 184 | return Promise.resolve() | 191 | return Promise.resolve() |
| 185 | } | 192 | } |
| 186 | // 查资产 | 193 | // 查资产 |
| 187 | const getAssetsList = async () => { | 194 | const getAssetsList = async () => { |
| 188 | const res = await getDocumentList({ | 195 | const res = await getDamCatalogTable({ |
| 189 | daName:tableSelectInfo.value.selectValue, | 196 | pageSize: -1, |
| 190 | companyGuid:tableSelectInfo.value.companyGuid, | 197 | pageIndex: 1, |
| 191 | type:1}) | 198 | }) |
| 192 | assetsOption.value =res.data || [] | 199 | assetsOption.value = res.data.records || [] |
| 200 | console.log(assetsOption.value, '---') | ||
| 193 | return Promise.resolve() | 201 | return Promise.resolve() |
| 194 | } | 202 | } |
| 195 | // | 203 | // getDamCatalogTable |
| 196 | const getTableData = () => { | 204 | const getTableData = () => { |
| 197 | tableInfo.value.loading = true; | 205 | tableInfo.value.loading = true; |
| 198 | getEntryList({ | 206 | getEntryList({ |
| ... | @@ -211,36 +219,37 @@ const getTableData = () => { | ... | @@ -211,36 +219,37 @@ const getTableData = () => { |
| 211 | } | 219 | } |
| 212 | 220 | ||
| 213 | const createOneData = () => { | 221 | const createOneData = () => { |
| 214 | if(companyOption.value.length>0) { | 222 | if (companyOption.value.length > 0) { |
| 215 | findTab(true) | 223 | findTab(true) |
| 216 | assetsOption.value = [] | 224 | assetsOption.value = [] |
| 217 | const currentDate = dayjs().format('YYYY-MM-DD'); | 225 | const currentDate = dayjs().format('YYYY-MM-DD'); |
| 218 | tableInfo.value.flag = "create" | 226 | tableInfo.value.flag = "create" |
| 219 | //const arr:any = [] | 227 | //const arr:any = [] |
| 220 | tableInfo.value.data.unshift({ | 228 | tableInfo.value.data.unshift({ |
| 221 | guid:BASE_ID, | 229 | guid: BASE_ID, |
| 222 | companyName:"", | 230 | companyName: "", |
| 223 | daName:"", | 231 | daName: "", |
| 224 | registerTime:"", | 232 | registerTime: "", |
| 225 | daCode:"", | 233 | daCode: "", |
| 226 | effectiveDate:"", | 234 | effectiveDate: "", |
| 227 | intableTime:currentDate, | 235 | intableTime: currentDate, |
| 228 | intableMoney:0, | 236 | intableMoney: 0, |
| 229 | issuingEntityName:"", | 237 | issuingEntityName: "", |
| 230 | companyGuid:"", | 238 | companyGuid: "", |
| 231 | registerGuid:"" | 239 | registerGuid: "" |
| 232 | }) | 240 | }) |
| 233 | //tableInfo.value.data = arr | 241 | //tableInfo.value.data = arr |
| 234 | tableInfo.value.currentId = BASE_ID | 242 | tableInfo.value.currentId = BASE_ID |
| 235 | tableInfo.value.isEdit = true | 243 | tableInfo.value.isEdit = true |
| 236 | tableRef.value.columnInfo.intableTime = currentDate | 244 | tableRef.value.columnInfo.intableTime = currentDate |
| 245 | // tableRef.value.columnInfo.companyName = JSON.parse(userStore.userData).tenantName | ||
| 237 | } else { | 246 | } else { |
| 238 | ElMessage.warning("没有可添加的数据!") | 247 | ElMessage.warning("没有可添加的数据!") |
| 239 | } | 248 | } |
| 240 | 249 | ||
| 241 | } | 250 | } |
| 242 | 251 | ||
| 243 | const columnDel =(row) => { | 252 | const columnDel = (row) => { |
| 244 | 253 | ||
| 245 | ElMessageBox.confirm( | 254 | ElMessageBox.confirm( |
| 246 | '是否确定删除所选数据?', | 255 | '是否确定删除所选数据?', |
| ... | @@ -252,8 +261,8 @@ const columnDel =(row) => { | ... | @@ -252,8 +261,8 @@ const columnDel =(row) => { |
| 252 | } | 261 | } |
| 253 | ) | 262 | ) |
| 254 | .then(() => { | 263 | .then(() => { |
| 255 | deleteEntryAll(row.guid).then((res:any)=>{ | 264 | deleteEntryAll(row.guid).then((res: any) => { |
| 256 | if(res?.code===proxy.$passCode){ | 265 | if (res?.code === proxy.$passCode) { |
| 257 | ElMessage.success("删除成功") | 266 | ElMessage.success("删除成功") |
| 258 | getTableData() | 267 | getTableData() |
| 259 | documentList() | 268 | documentList() |
| ... | @@ -265,38 +274,38 @@ const columnDel =(row) => { | ... | @@ -265,38 +274,38 @@ const columnDel =(row) => { |
| 265 | } | 274 | } |
| 266 | 275 | ||
| 267 | }) | 276 | }) |
| 268 | }).catch(()=>{ | 277 | }).catch(() => { |
| 269 | tableRef.value.columnInfo = {} | 278 | tableRef.value.columnInfo = {} |
| 270 | }) | 279 | }) |
| 271 | } | 280 | } |
| 272 | 281 | ||
| 273 | const columnSave = async (row) => { | 282 | const columnSave = async (row) => { |
| 274 | if(!row.companyName) { | 283 | if (!row.companyName) { |
| 275 | ElMessage.warning("公司名称不能为空") | 284 | ElMessage.warning("公司名称不能为空") |
| 276 | return | 285 | return |
| 277 | } else if(!row.daName) { | 286 | } else if (!row.daName) { |
| 278 | ElMessage.warning("资产名称不能为空") | 287 | ElMessage.warning("资产名称不能为空") |
| 279 | return | 288 | return |
| 280 | } else if(!row.intableTime) { | 289 | } else if (!row.intableTime) { |
| 281 | ElMessage.warning("入表时间不能为空") | 290 | ElMessage.warning("入表时间不能为空") |
| 282 | return | 291 | return |
| 283 | } else if(!row.intableMoney || row.intableMoney<=0) { | 292 | } else if (!row.intableMoney || row.intableMoney <= 0) { |
| 284 | ElMessage.warning("入表金额必须大于0") | 293 | ElMessage.warning("入表金额必须大于0") |
| 285 | return | 294 | return |
| 286 | } | 295 | } |
| 287 | let res:any | 296 | let res: any |
| 288 | switch(tableInfo.value.flag) { | 297 | switch (tableInfo.value.flag) { |
| 289 | case "create":res = await createEntry(row);break | 298 | case "create": res = await createEntry(row); break |
| 290 | case "edit":res = await intableUpdate(row);break | 299 | case "edit": res = await intableUpdate(row); break |
| 291 | } | 300 | } |
| 292 | if(res?.code===proxy.$passCode) { | 301 | if (res?.code === proxy.$passCode) { |
| 293 | ElMessage.success(`${tableInfo.value.flag==='create' ? '新增' : '修改'}成功`); | 302 | ElMessage.success(`${tableInfo.value.flag === 'create' ? '新增' : '修改'}成功`); |
| 294 | getTableData() | 303 | getTableData() |
| 295 | columnInfoReset() | 304 | columnInfoReset() |
| 296 | documentList() | 305 | documentList() |
| 297 | findTab(false) | 306 | findTab(false) |
| 298 | tableRef.value.columnInfo = {} | 307 | tableRef.value.columnInfo = {} |
| 299 | }else { | 308 | } else { |
| 300 | ElMessage.error(res.msg); | 309 | ElMessage.error(res.msg); |
| 301 | //columnCancel() | 310 | //columnCancel() |
| 302 | } | 311 | } |
| ... | @@ -306,18 +315,18 @@ const columnInfoReset = () => { | ... | @@ -306,18 +315,18 @@ const columnInfoReset = () => { |
| 306 | tableInfo.value.currentId = "0" | 315 | tableInfo.value.currentId = "0" |
| 307 | tableInfo.value.isEdit = false | 316 | tableInfo.value.isEdit = false |
| 308 | columnInfo.value = { | 317 | columnInfo.value = { |
| 309 | guid:"", | 318 | guid: "", |
| 310 | companyName:"", | 319 | companyName: "", |
| 311 | daName:"", | 320 | daName: "", |
| 312 | registerTime:"", | 321 | registerTime: "", |
| 313 | daCode:"", | 322 | daCode: "", |
| 314 | effectiveDate:"", | 323 | effectiveDate: "", |
| 315 | intableTime:"", | 324 | intableTime: "", |
| 316 | intableMoney:0, | 325 | intableMoney: 0, |
| 317 | issuingEntityName:"", | 326 | issuingEntityName: "", |
| 318 | issuingEntityGuid:"", | 327 | issuingEntityGuid: "", |
| 319 | companyGuid:"", | 328 | companyGuid: "", |
| 320 | registerGuid:"" | 329 | registerGuid: "" |
| 321 | } | 330 | } |
| 322 | } | 331 | } |
| 323 | const columnEdit = (row) => { | 332 | const columnEdit = (row) => { |
| ... | @@ -325,18 +334,18 @@ const columnEdit = (row) => { | ... | @@ -325,18 +334,18 @@ const columnEdit = (row) => { |
| 325 | findTab(true) | 334 | findTab(true) |
| 326 | tableSelectInfo.value.companyGuid = row.companyGuid | 335 | tableSelectInfo.value.companyGuid = row.companyGuid |
| 327 | assetsOption.value = [] | 336 | assetsOption.value = [] |
| 328 | addAssetsOption(null,row,true) | 337 | addAssetsOption(null, row, true) |
| 329 | addCompanyOption(row) | 338 | addCompanyOption(row) |
| 330 | //getAssetsList() | 339 | //getAssetsList() |
| 331 | const info = {...row} | 340 | const info = { ...row } |
| 332 | tableInfo.value.currentId = info.guid | 341 | tableInfo.value.currentId = info.guid |
| 333 | tableInfo.value.isEdit = true | 342 | tableInfo.value.isEdit = true |
| 334 | tableRef.value.columnInfo.intableMoney = tableRef.value.columnInfo.intableMoney.toFixed(2) | 343 | tableRef.value.columnInfo.intableMoney = tableRef.value.columnInfo.intableMoney.toFixed(2) |
| 335 | columnInfo.value = {...info} | 344 | columnInfo.value = { ...info } |
| 336 | } | 345 | } |
| 337 | const columnCancel = () => { | 346 | const columnCancel = () => { |
| 338 | tableInfo.value.isEdit = false | 347 | tableInfo.value.isEdit = false |
| 339 | if(tableInfo.value.flag==="edit") { | 348 | if (tableInfo.value.flag === "edit") { |
| 340 | tableInfo.value.currentId = "0" | 349 | tableInfo.value.currentId = "0" |
| 341 | } else { | 350 | } else { |
| 342 | tableInfo.value.data.shift() | 351 | tableInfo.value.data.shift() |
| ... | @@ -351,10 +360,10 @@ const pageChange = (info) => { | ... | @@ -351,10 +360,10 @@ const pageChange = (info) => { |
| 351 | getTableData() | 360 | getTableData() |
| 352 | } | 361 | } |
| 353 | // 选择后赋值 | 362 | // 选择后赋值 |
| 354 | const handelSelect = (row,key,row1) => { | 363 | const handelSelect = (row, key, row1) => { |
| 355 | if(key==="companyName") { | 364 | if (key === "companyName") { |
| 356 | tableSelectInfo.value.companyGuid = row.tenantGuid | 365 | tableSelectInfo.value.companyGuid = row.tenantGuid |
| 357 | addAssetsOption(row,row1) | 366 | addAssetsOption(row, row1) |
| 358 | columnInfo.value.companyName = row.tenantName | 367 | columnInfo.value.companyName = row.tenantName |
| 359 | tableRef.value.columnInfo.companyName = row.tenantName | 368 | tableRef.value.columnInfo.companyName = row.tenantName |
| 360 | tableRef.value.columnInfo.companyGuid = row.tenantGuid | 369 | tableRef.value.columnInfo.companyGuid = row.tenantGuid |
| ... | @@ -366,23 +375,24 @@ const handelSelect = (row,key,row1) => { | ... | @@ -366,23 +375,24 @@ const handelSelect = (row,key,row1) => { |
| 366 | tableRef.value.columnInfo.registerTime = "" | 375 | tableRef.value.columnInfo.registerTime = "" |
| 367 | tableRef.value.columnInfo.effectiveDate = "" | 376 | tableRef.value.columnInfo.effectiveDate = "" |
| 368 | } else { | 377 | } else { |
| 369 | if(tableInfo.value.flag==="create") { | 378 | if (tableInfo.value.flag === "create") { |
| 379 | console.log(row, '-----') | ||
| 370 | const currentDate = dayjs().format('YYYY-MM-DD'); | 380 | const currentDate = dayjs().format('YYYY-MM-DD'); |
| 371 | columnInfo.value = { | 381 | columnInfo.value = { |
| 372 | guid:row.guid, | 382 | guid: row.guid, |
| 373 | companyName:row.tenantName, | 383 | companyName: row.rightMainName, |
| 374 | daName:row.daName, | 384 | daName: row.damName, |
| 375 | registerTime:row.registerTime, | 385 | registerTime: row.registerTime, |
| 376 | daCode:row.daCode, | 386 | daCode: row.daCode, |
| 377 | effectiveDate:row.effectiveDate, | 387 | effectiveDate: row.effectiveDate, |
| 378 | intableTime:currentDate, | 388 | intableTime: currentDate, |
| 379 | intableMoney:0, | 389 | intableMoney: 0, |
| 380 | issuingEntityName:row.issuingEntityName, | 390 | issuingEntityName: row.issuingEntityName, |
| 381 | issuingEntityGuid:row.issuingEntityGuid, | 391 | issuingEntityGuid: row.issuingEntityGuid, |
| 382 | companyGuid:row.tenantGuid, | 392 | companyGuid: row.tenantGuid, |
| 383 | registerGuid:row.registerGuid | 393 | registerGuid: row.registerGuid |
| 384 | } | 394 | } |
| 385 | const {guid,...obj} = columnInfo.value | 395 | const { guid, ...obj } = columnInfo.value |
| 386 | tableRef.value.columnInfo = obj | 396 | tableRef.value.columnInfo = obj |
| 387 | } else { | 397 | } else { |
| 388 | columnInfo.value.daName = row.daName | 398 | columnInfo.value.daName = row.daName |
| ... | @@ -391,43 +401,43 @@ const handelSelect = (row,key,row1) => { | ... | @@ -391,43 +401,43 @@ const handelSelect = (row,key,row1) => { |
| 391 | columnInfo.value.effectiveDate = row.effectiveDate | 401 | columnInfo.value.effectiveDate = row.effectiveDate |
| 392 | columnInfo.value.issuingEntityName = row.issuingEntityName | 402 | columnInfo.value.issuingEntityName = row.issuingEntityName |
| 393 | columnInfo.value.registerGuid = row.registerGuid; | 403 | columnInfo.value.registerGuid = row.registerGuid; |
| 394 | tableRef.value.columnInfo = {...columnInfo.value} | 404 | tableRef.value.columnInfo = { ...columnInfo.value } |
| 395 | } | 405 | } |
| 396 | 406 | ||
| 397 | // 新增不用传guid 所以删掉,但是往输入框添加数据 通过guid判断 | 407 | // 新增不用传guid 所以删掉,但是往输入框添加数据 通过guid判断 |
| 398 | 408 | ||
| 399 | //console.log(columnInfo.value) | 409 | //console.log(columnInfo.value) |
| 400 | } | 410 | } |
| 401 | 411 | ||
| 402 | } | 412 | } |
| 403 | const findTab = (flag) => { | 413 | const findTab = (flag) => { |
| 404 | const tab:any = userStore.tabbar.find((tab:any)=>tab.fullPath===route.path) | 414 | const tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === route.path) |
| 405 | tab.meta.editPage = flag | 415 | tab.meta.editPage = flag |
| 406 | } | 416 | } |
| 407 | const addAssetsOption = (values,row,flag=false) => { | 417 | const addAssetsOption = (values, row, flag = false) => { |
| 408 | getAssetsList().then(()=>{ | 418 | getAssetsList().then(() => { |
| 409 | const obj = { | 419 | const obj = { |
| 410 | costAccessmentGuid:null, | 420 | costAccessmentGuid: null, |
| 411 | daCode:row.daCode, | 421 | daCode: row.daCode, |
| 412 | daName: row.daName, | 422 | daName: row.daName, |
| 413 | documentFile: null, | 423 | documentFile: null, |
| 414 | documentType: 1, | 424 | documentType: 1, |
| 415 | effectiveDate: row.effectiveDate, | 425 | effectiveDate: row.effectiveDate, |
| 416 | guid:row.guid, | 426 | guid: row.guid, |
| 417 | issuingEntityGuid:row.issuingEntityGuid , | 427 | issuingEntityGuid: row.issuingEntityGuid, |
| 418 | issuingEntityName:row.issuingEntityName, | 428 | issuingEntityName: row.issuingEntityName, |
| 419 | qualityEvaluationGuid: null, | 429 | qualityEvaluationGuid: null, |
| 420 | registerGuid:row.registerGuid, | 430 | registerGuid: row.registerGuid, |
| 421 | registerTime:row.registerTime, | 431 | registerTime: row.registerTime, |
| 422 | state: row.state, | 432 | state: row.state, |
| 423 | tenantGuid: row.companyGuid, | 433 | tenantGuid: row.companyGuid, |
| 424 | tenantName:row.companyName, | 434 | tenantName: row.companyName, |
| 425 | } | 435 | } |
| 426 | const arr = assetsOption.value | 436 | const arr = assetsOption.value |
| 427 | if(values&&values.tenantGuid===row.companyGuid) { | 437 | if (values && values.tenantGuid === row.companyGuid) { |
| 428 | arr.unshift(obj) | 438 | arr.unshift(obj) |
| 429 | assetsOption.value = arr | 439 | assetsOption.value = arr |
| 430 | }else if(flag) { | 440 | } else if (flag) { |
| 431 | arr.unshift(obj) | 441 | arr.unshift(obj) |
| 432 | assetsOption.value = arr | 442 | assetsOption.value = arr |
| 433 | } | 443 | } |
| ... | @@ -436,26 +446,27 @@ const addAssetsOption = (values,row,flag=false) => { | ... | @@ -436,26 +446,27 @@ const addAssetsOption = (values,row,flag=false) => { |
| 436 | } | 446 | } |
| 437 | const addCompanyOption = (row) => { | 447 | const addCompanyOption = (row) => { |
| 438 | let flag = true | 448 | let flag = true |
| 439 | documentList().then(()=>{ | 449 | documentList().then(() => { |
| 440 | const obj = { | 450 | const obj = { |
| 441 | tenantName:row.companyName, | 451 | tenantName: row.companyName, |
| 442 | tenantGuid:row.companyGuid | 452 | tenantGuid: row.companyGuid |
| 443 | } | 453 | } |
| 444 | const arr = companyOption.value | 454 | const arr = companyOption.value |
| 445 | arr.forEach((item)=>{ | 455 | arr.forEach((item) => { |
| 446 | if(item.tenantGuid===row.companyGuid){ | 456 | if (item.tenantGuid === row.companyGuid) { |
| 447 | flag = false | 457 | flag = false |
| 448 | } | 458 | } |
| 449 | }) | 459 | }) |
| 450 | if(flag) { | 460 | if (flag) { |
| 451 | arr.unshift(obj) | 461 | arr.unshift(obj) |
| 452 | companyOption.value = arr | 462 | companyOption.value = arr |
| 453 | } | 463 | } |
| 454 | }) | 464 | }) |
| 455 | } | 465 | } |
| 456 | onBeforeMount(()=> { | 466 | onBeforeMount(() => { |
| 457 | //getTableData() | 467 | //getTableData() |
| 458 | documentList() | 468 | // getAssetsList() |
| 469 | // documentList() | ||
| 459 | }) | 470 | }) |
| 460 | </script> | 471 | </script> |
| 461 | 472 | ||
| ... | @@ -468,19 +479,9 @@ onBeforeMount(()=> { | ... | @@ -468,19 +479,9 @@ onBeforeMount(()=> { |
| 468 | </div> | 479 | </div> |
| 469 | </div> | 480 | </div> |
| 470 | <div class="table_panel_wrap"> | 481 | <div class="table_panel_wrap"> |
| 471 | <Table | 482 | <Table ref="tableRef" :tableInfo="tableInfo" :page="page" :colums="colums" v-model="columnInfo" |
| 472 | ref="tableRef" | 483 | @pageChange="pageChange" @columnSave="columnSave" @columnDel="columnDel" @columnEdit="columnEdit" |
| 473 | :tableInfo="tableInfo" | 484 | @columnCancel="columnCancel" @handelSelect="handelSelect"></Table> |
| 474 | :page="page" | ||
| 475 | :colums="colums" | ||
| 476 | v-model="columnInfo" | ||
| 477 | @pageChange="pageChange" | ||
| 478 | @columnSave="columnSave" | ||
| 479 | @columnDel="columnDel" | ||
| 480 | @columnEdit="columnEdit" | ||
| 481 | @columnCancel="columnCancel" | ||
| 482 | @handelSelect="handelSelect" | ||
| 483 | ></Table> | ||
| 484 | </div> | 485 | </div> |
| 485 | </div> | 486 | </div> |
| 486 | </template> | 487 | </template> |
| ... | @@ -490,5 +491,4 @@ onBeforeMount(()=> { | ... | @@ -490,5 +491,4 @@ onBeforeMount(()=> { |
| 490 | .container_wrap { | 491 | .container_wrap { |
| 491 | padding: 0 16px; | 492 | padding: 0 16px; |
| 492 | } | 493 | } |
| 493 | |||
| 494 | </style> | 494 | </style> | ... | ... |
-
Please register or sign in to post a comment