fix
Showing
3 changed files
with
207 additions
and
191 deletions
| ... | @@ -12,7 +12,6 @@ export const getEntryList = (params) => request({ | ... | @@ -12,7 +12,6 @@ export const getEntryList = (params) => request({ |
| 12 | export const deleteEntryAll = (params) => request({ | 12 | export const deleteEntryAll = (params) => request({ |
| 13 | url: `${import.meta.env.VITE_API_NEW_PORTAL}/da-intable/delete?guid=${params}`, | 13 | url: `${import.meta.env.VITE_API_NEW_PORTAL}/da-intable/delete?guid=${params}`, |
| 14 | method: 'delete', | 14 | method: 'delete', |
| 15 | data: params | ||
| 16 | }) | 15 | }) |
| 17 | /** 获取资产入表信息新增 */ | 16 | /** 获取资产入表信息新增 */ |
| 18 | export const createEntry = (params) => request({ | 17 | export const createEntry = (params) => request({ |
| ... | @@ -34,6 +33,12 @@ export const getDocumentList = (params) => request({ | ... | @@ -34,6 +33,12 @@ export const getDocumentList = (params) => request({ |
| 34 | method: 'post', | 33 | method: 'post', |
| 35 | data: params | 34 | data: params |
| 36 | }) | 35 | }) |
| 36 | /**资产详情 */ | ||
| 37 | export const getAssetDetail = (data) => request({ | ||
| 38 | url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/intable/get-table-select`, | ||
| 39 | method: 'post', | ||
| 40 | data | ||
| 41 | }) | ||
| 37 | 42 | ||
| 38 | /** 资产融资管理 */ | 43 | /** 资产融资管理 */ |
| 39 | /** 获取资产融资信息列表 */ | 44 | /** 获取资产融资信息列表 */ | ... | ... |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | import { ref} from "vue"; | 2 | import { ref } from "vue"; |
| 3 | import {ElMessage} from "element-plus" | 3 | import { ElMessage } from "element-plus" |
| 4 | import PageNav from "@/components/PageNav/index.vue"; | 4 | import PageNav from "@/components/PageNav/index.vue"; |
| 5 | import dayjs from "dayjs"; | 5 | import dayjs from "dayjs"; |
| 6 | const props = defineProps({ | 6 | const props = defineProps({ |
| 7 | tableInfo:{ | 7 | tableInfo: { |
| 8 | type:Object, | 8 | type: Object, |
| 9 | default:{} as any, | 9 | default: {} as any, |
| 10 | }, | 10 | }, |
| 11 | colums:{ | 11 | colums: { |
| 12 | type:Array<any>, | 12 | type: Array<any>, |
| 13 | default:[], | 13 | default: [], |
| 14 | }, | 14 | }, |
| 15 | columnInfo:{ | 15 | columnInfo: { |
| 16 | type:Object, | 16 | type: Object, |
| 17 | default:{} as any, | 17 | default: {} as any, |
| 18 | }, | 18 | }, |
| 19 | page:{ | 19 | page: { |
| 20 | type:Object, | 20 | type: Object, |
| 21 | default:{} as any, | 21 | default: {} as any, |
| 22 | }, | 22 | }, |
| 23 | }) | 23 | }) |
| 24 | 24 | ||
| 25 | const colums = computed(() => { | 25 | const colums = computed(() => { |
| 26 | return props.colums | 26 | return props.colums |
| 27 | }) | 27 | }) |
| 28 | const tableDataLoading = computed(() => { | 28 | const tableDataLoading = computed(() => { |
| 29 | return props?.tableInfo?.loading; | 29 | return props?.tableInfo?.loading; |
| 30 | }); | 30 | }); |
| 31 | const data = computed(() => props?.tableInfo?.data) | 31 | const data = computed(() => props?.tableInfo?.data) |
| 32 | const tableInfo = computed(() => props?.tableInfo || {}) | 32 | const tableInfo = computed(() => props?.tableInfo || {}) |
| 33 | const columnInfo = ref({...props?.columnInfo?.value}) | 33 | const columnInfo = ref({ ...props?.columnInfo?.value }) |
| 34 | const isEdit = computed(()=>props?.tableInfo?.isEdit) | 34 | const isEdit = computed(() => props?.tableInfo?.isEdit) |
| 35 | const flag = computed(()=>props?.tableInfo?.flag) | 35 | const flag = computed(() => props?.tableInfo?.flag) |
| 36 | const page = computed(()=> props?.page) | 36 | const page = computed(() => props?.page) |
| 37 | const emits = defineEmits(["pageChange","columnSave","columnCancel","columnDel","columnEdit","handelSelect","handelInput","searchSelect","selectScroll"]) | 37 | const emits = defineEmits(["pageChange", "columnSave", "columnCancel", "columnDel", "columnEdit", "handelSelect", "handelInput", "searchSelect", "selectScroll"]) |
| 38 | 38 | ||
| 39 | const selectRef = ref() | 39 | const selectRef = ref() |
| 40 | const columnEdit = (row) => { | 40 | const columnEdit = (row) => { |
| 41 | if(!tableInfo.value.isEdit){ | 41 | if (!tableInfo.value.isEdit) { |
| 42 | columnInfo.value = {...row} | 42 | columnInfo.value = { ...row } |
| 43 | 43 | ||
| 44 | emits("columnEdit",{...row}) | 44 | emits("columnEdit", { ...row }) |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | } | 47 | } |
| 48 | const columnDel = (row) => { | 48 | const columnDel = (row) => { |
| 49 | if(!tableInfo.value.isEdit){ | 49 | if (!tableInfo.value.isEdit) { |
| 50 | columnInfo.value = {...row} | 50 | columnInfo.value = { ...row } |
| 51 | emits("columnDel",{...row}) | 51 | emits("columnDel", { ...row }) |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | } | 54 | } |
| 55 | const columnDel1 = (row) => { | 55 | const columnDel1 = (row) => { |
| 56 | //columnInfo.value = {} | 56 | //columnInfo.value = {} |
| 57 | columnInfo.value = {...row} | 57 | columnInfo.value = { ...row } |
| 58 | emits("columnDel",{...row}) | 58 | emits("columnDel", { ...row }) |
| 59 | 59 | ||
| 60 | } | 60 | } |
| 61 | const columnSave = (row) => { | 61 | const columnSave = (row) => { |
| 62 | emits("columnSave",{...columnInfo.value}) | 62 | emits("columnSave", { ...columnInfo.value }) |
| 63 | } | 63 | } |
| 64 | const columnCancel = (row) => { | 64 | const columnCancel = (row) => { |
| 65 | columnInfo.value = {} | 65 | columnInfo.value = {} |
| ... | @@ -67,150 +67,121 @@ const columnCancel = (row) => { | ... | @@ -67,150 +67,121 @@ const columnCancel = (row) => { |
| 67 | } | 67 | } |
| 68 | const pageChange = (page) => { | 68 | const pageChange = (page) => { |
| 69 | let info = { ...page }; | 69 | let info = { ...page }; |
| 70 | emits("pageChange",info) | 70 | emits("pageChange", info) |
| 71 | } | 71 | } |
| 72 | const handelSelect = (value,item,row) => { | 72 | const handelSelect = (value, item, row) => { |
| 73 | const selectOption = item.selectOption() | 73 | const selectOption = item.selectOption() |
| 74 | const optionItem = selectOption.find(option=> option[item.selectKey]===value ) | 74 | const optionItem = selectOption.find(option => option[item.selectKey] === value) |
| 75 | console.log(optionItem) | 75 | console.log(optionItem) |
| 76 | emits("handelSelect",{...optionItem},item.prop,row) | 76 | emits("handelSelect", { ...optionItem }, item.prop, row) |
| 77 | } | 77 | } |
| 78 | const searchSelect = (value) => { | 78 | const searchSelect = (value) => { |
| 79 | emits("searchSelect",value) | 79 | emits("searchSelect", value) |
| 80 | } | 80 | } |
| 81 | const secectClick = (value) => { | 81 | const secectClick = (value) => { |
| 82 | emits("handelSelect",value) | 82 | emits("handelSelect", value) |
| 83 | } | 83 | } |
| 84 | const selectInput = (value) => { | 84 | const selectInput = (value) => { |
| 85 | emits("searchSelect",value) | 85 | emits("searchSelect", value) |
| 86 | } | 86 | } |
| 87 | const selectScroll = () => { | 87 | const selectScroll = () => { |
| 88 | emits("selectScroll") | 88 | emits("selectScroll") |
| 89 | } | 89 | } |
| 90 | const numberChange = (value,key,fn) => { | 90 | const numberChange = (value, key, fn) => { |
| 91 | //console.log(value,key,fn) | 91 | //console.log(value,key,fn) |
| 92 | const value1 = fn(value,key) | 92 | const value1 = fn(value, key) |
| 93 | //console.log(value1) | 93 | //console.log(value1) |
| 94 | //columnInfo.value[key] = columnInfo.value[key].toString().slice(0,12) | 94 | //columnInfo.value[key] = columnInfo.value[key].toString().slice(0,12) |
| 95 | //const string = columnInfo.value[key] | 95 | //const string = columnInfo.value[key] |
| 96 | // console.log(columnInfo.value[key]) | 96 | // console.log(columnInfo.value[key]) |
| 97 | } | 97 | } |
| 98 | const numberChange1 = (value,key,fn) => { | 98 | const numberChange1 = (value, key, fn) => { |
| 99 | const value1 = fn && fn(value,key) | 99 | const value1 = fn && fn(value, key) |
| 100 | } | 100 | } |
| 101 | const numberWidthCommas = (num) => { | 101 | const numberWidthCommas = (num) => { |
| 102 | if (num == null) { | 102 | if (num == null) { |
| 103 | return '--' | 103 | return '--' |
| 104 | } | 104 | } |
| 105 | let parts = num.toFixed(2).split(".") | 105 | let parts = num.toFixed(2).split(".") |
| 106 | parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,",") | 106 | parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") |
| 107 | return parts.join(".") | 107 | return parts.join(".") |
| 108 | } | 108 | } |
| 109 | defineExpose({ | 109 | defineExpose({ |
| 110 | columnInfo, | 110 | columnInfo, |
| 111 | selectRef | 111 | selectRef |
| 112 | }) | 112 | }) |
| 113 | </script> | 113 | </script> |
| 114 | 114 | ||
| 115 | <template> | 115 | <template> |
| 116 | <div class="table_panel" style="height: 100%;"> | 116 | <div class="table_panel" style="height: 100%;"> |
| 117 | <el-table | 117 | <el-table :data="data" v-loading="tableDataLoading" height="100%" tooltip-effect="light" |
| 118 | :data="data" | 118 | max-height="calc(100% - 44px)" :style="{ 'min-height': 'calc(100% - 44px)', }" border> |
| 119 | v-loading="tableDataLoading" | 119 | <el-table-column v-for="item in colums" :prop="item?.prop" :type="item?.type" :align="item.align || 'left'" |
| 120 | height="100%" | 120 | :label="item.label" :width="item.width" :show-overflow-tooltip="true" :key="item.prop"> |
| 121 | tooltip-effect="light" | 121 | <template #default="{ row }"> |
| 122 | max-height="calc(100% - 44px)" | 122 | <template v-if="item.componentType === 'dateTime' && row.guid === tableInfo.currentId && !item.type"> |
| 123 | :style="{ 'min-height':'calc(100% - 44px)', }" | 123 | <el-date-picker v-model="columnInfo[item.prop]" type="date" placeholder="选择日期" |
| 124 | border | 124 | :disabled="item.componentDisabled === false ? item.componentDisabled : true" size="small"> |
| 125 | > | 125 | </el-date-picker> |
| 126 | <el-table-column | 126 | </template> |
| 127 | v-for="item in colums" | 127 | <template v-else-if="item.componentType === 'dateTime' && row.guid != tableInfo.currentId && !item.type"> |
| 128 | :prop="item?.prop" | 128 | {{ !row[item.prop] ? '--' : dayjs(row[item.prop]).format("YYYY-MM-DD") }} |
| 129 | :type="item?.type" | 129 | </template> |
| 130 | :align="item.align || 'left' " | 130 | <template v-else-if="item.componentType === 'number' && row.guid === tableInfo.currentId && !item.type"> |
| 131 | :label="item.label" | 131 | <div class="price"> |
| 132 | :width="item.width" | 132 | <el-input size="small" style="width: 100%;" v-model="columnInfo[item.prop]" |
| 133 | :show-overflow-tooltip="true" | 133 | @input="numberChange($event, item.prop, item.input)" |
| 134 | :key="item.prop"> | 134 | @change="numberChange1($event, item.prop, item.change)" v-bind="item.config || {}" |
| 135 | <template #default="{ row }"> | 135 | :placeholder="item.placeholder"> |
| 136 | <template v-if="item.componentType==='dateTime' && row.guid===tableInfo.currentId && !item.type"> | 136 | </el-input> |
| 137 | <el-date-picker | 137 | <span>{{ item.propType }}</span> |
| 138 | v-model="columnInfo[item.prop]" | 138 | </div> |
| 139 | type="date" | 139 | </template> |
| 140 | placeholder="选择日期" | 140 | <template |
| 141 | :disabled="item.componentDisabled===false ? item.componentDisabled : true" | 141 | v-else-if="item.componentType === 'number' && row.guid != tableInfo.currentId && !item.type && item.toFixed"> |
| 142 | size="small" | 142 | {{ numberWidthCommas(row[item.prop]) }} {{ item.propType }} |
| 143 | > | ||
| 144 | </el-date-picker> | ||
| 145 | </template> | ||
| 146 | <template v-else-if="item.componentType==='dateTime' && row.guid!=tableInfo.currentId && !item.type"> | ||
| 147 | {{ !row[item.prop] ? '--' : dayjs(row[item.prop]).format("YYYY-MM-DD")}} | ||
| 148 | </template> | ||
| 149 | <template v-else-if="item.componentType==='number' && row.guid===tableInfo.currentId && !item.type"> | ||
| 150 | <div class="price"> | ||
| 151 | <el-input size="small" style="width: 100%;" | ||
| 152 | v-model="columnInfo[item.prop]" | ||
| 153 | @input="numberChange($event,item.prop,item.input)" | ||
| 154 | @change="numberChange1($event,item.prop,item.change)" | ||
| 155 | v-bind="item.config || {}" :placeholder="item.placeholder"> | ||
| 156 | </el-input> | ||
| 157 | <span>{{ item.propType }}</span> | ||
| 158 | </div> | ||
| 159 | </template> | ||
| 160 | <template v-else-if="item.componentType==='number' && row.guid!=tableInfo.currentId && !item.type &&item.toFixed"> | ||
| 161 | {{ numberWidthCommas(row[item.prop]) }} {{ item.propType }} | ||
| 162 | </template> | ||
| 163 | <template v-else-if="item.componentType==='number'&&row.guid!=tableInfo.currentId && !item.type && !item.toFixed"> | ||
| 164 | {{ row[item.prop] }} | ||
| 165 | </template> | ||
| 166 | <template v-else-if="item.componentType==='select' && row.guid===tableInfo.currentId && !item.type"> | ||
| 167 | <el-select | ||
| 168 | v-model="columnInfo[item.prop]" | ||
| 169 | filterable | ||
| 170 | :disabled="item?.editDisabled ? item?.editDisabled() : false" | ||
| 171 | @change="handelSelect($event,item,row)" | ||
| 172 | size="small" | ||
| 173 | placeholder="请选择" | ||
| 174 | > | ||
| 175 | <el-option | ||
| 176 | v-for="option in item.selectOption()" | ||
| 177 | :key="option" | ||
| 178 | :label="option[item.selectKey]" | ||
| 179 | :value="option[item.selectKey]"> | ||
| 180 | </el-option> | ||
| 181 | </el-select> | ||
| 182 | </template> | ||
| 183 | <template v-else-if="item.componentType !=='dateTime' && item.componentType !=='number' && row.guid===tableInfo.currentId && !item.type"> | ||
| 184 | <el-input | ||
| 185 | v-model="columnInfo[item.prop]" | ||
| 186 | style="width: 100%;" | ||
| 187 | placeholder="请输入内容" | ||
| 188 | size="small" | ||
| 189 | :disabled="item.componentDisabled===false ? item.componentDisabled : true" | ||
| 190 | ></el-input> | ||
| 191 | </template> | ||
| 192 | </template> | ||
| 193 | |||
| 194 | </el-table-column> | ||
| 195 | <el-table-column label="操作" width="160px" fixed="right"> | ||
| 196 | <template #default="{ row }"> | ||
| 197 | <template v-if="row.guid === tableInfo.currentId"> | ||
| 198 | <span class=" operate_btn active" @click="columnSave(row)">保存</span> | ||
| 199 | <span class="operate_btn active" @click="columnCancel(row)" >取消</span> | ||
| 200 | <span class="operate_btn active" v-if="flag==='edit'" @click="columnDel1(row)" >删除</span> | ||
| 201 | </template> | ||
| 202 | <template v-else> | ||
| 203 | <span class=" operate_btn active" :class="[isEdit ? 'disabled':'' ]" @click="columnEdit(row)">编辑</span> | ||
| 204 | <span class="operate_btn active" :class="[isEdit ? 'disabled':'' ]" @click="columnDel(row)" >删除</span> | ||
| 205 | </template> | ||
| 206 | </template> | 143 | </template> |
| 207 | </el-table-column> | 144 | <template |
| 208 | </el-table> | 145 | v-else-if="item.componentType === 'number' && row.guid != tableInfo.currentId && !item.type && !item.toFixed"> |
| 209 | <PageNav | 146 | {{ row[item.prop] }} |
| 210 | :pageInfo="page" | 147 | </template> |
| 211 | @pageChange="pageChange" | 148 | <template v-else-if="item.componentType === 'select' && row.guid === tableInfo.currentId && !item.type"> |
| 212 | /> | 149 | <el-select v-model="columnInfo[item.prop]" filterable |
| 213 | </div> | 150 | :disabled="item?.editDisabled ? item?.editDisabled() : false" @change="handelSelect($event, item, row)" |
| 151 | size="small" placeholder="请选择"> | ||
| 152 | <el-option v-for="option in item.selectOption()" :key="option" :label="option[item.selectKey]" | ||
| 153 | :value="option[item.selectKey]"> | ||
| 154 | </el-option> | ||
| 155 | </el-select> | ||
| 156 | </template> | ||
| 157 | <template | ||
| 158 | v-else-if="item.componentType !== 'dateTime' && item.componentType !== 'number' && row.guid === tableInfo.currentId && !item.type"> | ||
| 159 | <el-input v-model="columnInfo[item.prop]" style="width: 100%;" placeholder="请输入内容" size="small" | ||
| 160 | :disabled="item.componentDisabled === false ? item.componentDisabled : true"></el-input> | ||
| 161 | </template> | ||
| 162 | <template | ||
| 163 | v-else-if="item.componentType !== 'dateTime' && item.componentType !== 'number' && row.guid != tableInfo.currentId && !item.type"> | ||
| 164 | {{ row[item.prop] ? row[item.prop] : '--' }} | ||
| 165 | </template> | ||
| 166 | </template> | ||
| 167 | |||
| 168 | </el-table-column> | ||
| 169 | <el-table-column label="操作" width="160px" fixed="right"> | ||
| 170 | <template #default="{ row }"> | ||
| 171 | <template v-if="row.guid === tableInfo.currentId"> | ||
| 172 | <span class=" operate_btn active" @click="columnSave(row)">保存</span> | ||
| 173 | <span class="operate_btn active" @click="columnCancel(row)">取消</span> | ||
| 174 | <span class="operate_btn active" v-if="flag === 'edit'" @click="columnDel1(row)">删除</span> | ||
| 175 | </template> | ||
| 176 | <template v-else> | ||
| 177 | <span class=" operate_btn active" :class="[isEdit ? 'disabled' : '']" @click="columnEdit(row)">编辑</span> | ||
| 178 | <span class="operate_btn active" :class="[isEdit ? 'disabled' : '']" @click="columnDel(row)">删除</span> | ||
| 179 | </template> | ||
| 180 | </template> | ||
| 181 | </el-table-column> | ||
| 182 | </el-table> | ||
| 183 | <PageNav :pageInfo="page" @pageChange="pageChange" /> | ||
| 184 | </div> | ||
| 214 | </template> | 185 | </template> |
| 215 | 186 | ||
| 216 | 187 | ||
| ... | @@ -243,16 +214,16 @@ defineExpose({ | ... | @@ -243,16 +214,16 @@ defineExpose({ |
| 243 | } | 214 | } |
| 244 | 215 | ||
| 245 | .input_comb { | 216 | .input_comb { |
| 246 | > span:not(:last-child) { | 217 | >span:not(:last-child) { |
| 247 | margin-right: 12px; | 218 | margin-right: 12px; |
| 248 | 219 | ||
| 249 | > span { | 220 | >span { |
| 250 | margin-right: 4px; | 221 | margin-right: 4px; |
| 251 | } | 222 | } |
| 252 | } | 223 | } |
| 253 | 224 | ||
| 254 | > span:last-child { | 225 | >span:last-child { |
| 255 | > span { | 226 | >span { |
| 256 | margin-right: 4px; | 227 | margin-right: 4px; |
| 257 | } | 228 | } |
| 258 | } | 229 | } |
| ... | @@ -266,7 +237,7 @@ defineExpose({ | ... | @@ -266,7 +237,7 @@ defineExpose({ |
| 266 | padding-right: 4px; | 237 | padding-right: 4px; |
| 267 | position: relative; | 238 | position: relative; |
| 268 | 239 | ||
| 269 | & ~ .active { | 240 | &~.active { |
| 270 | padding-left: 4px; | 241 | padding-left: 4px; |
| 271 | margin-left: 1px; | 242 | margin-left: 1px; |
| 272 | 243 | ||
| ... | @@ -288,13 +259,15 @@ defineExpose({ | ... | @@ -288,13 +259,15 @@ defineExpose({ |
| 288 | } | 259 | } |
| 289 | } | 260 | } |
| 290 | } | 261 | } |
| 291 | .disabled { | ||
| 292 | color: #BDBDBD !important; | ||
| 293 | cursor: not-allowed; | ||
| 294 | } | ||
| 295 | .price { | ||
| 296 | display: flex; | ||
| 297 | align-items: center; | ||
| 298 | justify-content: space-between; | ||
| 299 | } | ||
| 300 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 262 | |||
| 263 | .disabled { | ||
| 264 | color: #BDBDBD !important; | ||
| 265 | cursor: not-allowed; | ||
| 266 | } | ||
| 267 | |||
| 268 | .price { | ||
| 269 | display: flex; | ||
| 270 | align-items: center; | ||
| 271 | justify-content: space-between; | ||
| 272 | } | ||
| 273 | </style> | ... | ... |
| ... | @@ -11,9 +11,11 @@ import { | ... | @@ -11,9 +11,11 @@ import { |
| 11 | deleteEntryAll, | 11 | deleteEntryAll, |
| 12 | createEntry, | 12 | createEntry, |
| 13 | intableUpdate, | 13 | intableUpdate, |
| 14 | getDocumentList | 14 | getDocumentList, |
| 15 | getAssetDetail | ||
| 15 | } from "@/api/modules/dataTransaction"; | 16 | } from "@/api/modules/dataTransaction"; |
| 16 | import { getDamCatalogTable } from '@/api/modules/dataAsset'; | 17 | import { getDamCatalogTable } from '@/api/modules/dataAsset'; |
| 18 | import { da } from 'element-plus/es/locale'; | ||
| 17 | const route = useRoute() | 19 | const route = useRoute() |
| 18 | const userStore = useUserStore(); | 20 | const userStore = useUserStore(); |
| 19 | const searchItemList = ref([ | 21 | const searchItemList = ref([ |
| ... | @@ -68,7 +70,8 @@ const columnInfo = ref({ | ... | @@ -68,7 +70,8 @@ const columnInfo = ref({ |
| 68 | issuingEntityName: "", | 70 | issuingEntityName: "", |
| 69 | issuingEntityGuid: "", | 71 | issuingEntityGuid: "", |
| 70 | companyGuid: "", | 72 | companyGuid: "", |
| 71 | registerGuid: "" | 73 | registerGuid: "", |
| 74 | damGuid: "" | ||
| 72 | }) | 75 | }) |
| 73 | const companyOption = ref<any>([ | 76 | const companyOption = ref<any>([ |
| 74 | { | 77 | { |
| ... | @@ -95,6 +98,16 @@ const colums = [ | ... | @@ -95,6 +98,16 @@ const colums = [ |
| 95 | selectOption: () => companyOption.value | 98 | selectOption: () => companyOption.value |
| 96 | }, | 99 | }, |
| 97 | { | 100 | { |
| 101 | prop: "daName", | ||
| 102 | label: "资产名称", | ||
| 103 | width: "180", | ||
| 104 | componentType: "select", | ||
| 105 | componentDisabled: false, | ||
| 106 | //editDisabled:()=> tableInfo.value.flag==="edit" ? true :false, | ||
| 107 | selectOption: () => assetsOption.value, | ||
| 108 | selectKey: "daName", | ||
| 109 | }, | ||
| 110 | { | ||
| 98 | prop: "intableTime", | 111 | prop: "intableTime", |
| 99 | label: "入表时间", | 112 | label: "入表时间", |
| 100 | width: "130", | 113 | width: "130", |
| ... | @@ -134,16 +147,7 @@ const colums = [ | ... | @@ -134,16 +147,7 @@ const colums = [ |
| 134 | 147 | ||
| 135 | } | 148 | } |
| 136 | }, | 149 | }, |
| 137 | { | 150 | |
| 138 | prop: "daName", | ||
| 139 | label: "资产名称", | ||
| 140 | width: "180", | ||
| 141 | componentType: "select", | ||
| 142 | componentDisabled: false, | ||
| 143 | //editDisabled:()=> tableInfo.value.flag==="edit" ? true :false, | ||
| 144 | selectOption: () => assetsOption.value, | ||
| 145 | selectKey: "damName", | ||
| 146 | }, | ||
| 147 | { | 151 | { |
| 148 | prop: "daCode", | 152 | prop: "daCode", |
| 149 | label: "资产编号", | 153 | label: "资产编号", |
| ... | @@ -190,13 +194,29 @@ const documentList = async () => { | ... | @@ -190,13 +194,29 @@ const documentList = async () => { |
| 190 | 194 | ||
| 191 | return Promise.resolve() | 195 | return Promise.resolve() |
| 192 | } | 196 | } |
| 197 | // const params = { | ||
| 198 | // daName: row.damName, | ||
| 199 | // type: 1, | ||
| 200 | // companyGuid: row.tenantGuid, | ||
| 201 | // isCompany: true | ||
| 202 | // } | ||
| 203 | // getAssetDetail(params).then((res: any) => { | ||
| 204 | // if (res?.code === proxy.$passCode) { | ||
| 205 | // console.log(res.data, '--123-') | ||
| 206 | |||
| 207 | // } | ||
| 208 | // }) | ||
| 193 | // 查资产 | 209 | // 查资产 |
| 194 | const getAssetsList = async () => { | 210 | const getAssetsList = async (values, row,) => { |
| 195 | const res = await getDamCatalogTable({ | 211 | console.log(values, row, '--查资产-') |
| 196 | pageSize: -1, | 212 | const params = { |
| 197 | pageIndex: 1, | 213 | daName: '', |
| 198 | }) | 214 | type: 1, |
| 199 | assetsOption.value = res.data.records || [] | 215 | companyGuid: values?.tenantGuid || row.companyGuid, |
| 216 | isCompany: true | ||
| 217 | } | ||
| 218 | const res = await getAssetDetail(params) | ||
| 219 | assetsOption.value = res.data || [] | ||
| 200 | console.log(assetsOption.value, '---') | 220 | console.log(assetsOption.value, '---') |
| 201 | return Promise.resolve() | 221 | return Promise.resolve() |
| 202 | } | 222 | } |
| ... | @@ -236,7 +256,8 @@ const createOneData = () => { | ... | @@ -236,7 +256,8 @@ const createOneData = () => { |
| 236 | intableMoney: 0, | 256 | intableMoney: 0, |
| 237 | issuingEntityName: "", | 257 | issuingEntityName: "", |
| 238 | companyGuid: "", | 258 | companyGuid: "", |
| 239 | registerGuid: "" | 259 | registerGuid: "", |
| 260 | damGuid: "" | ||
| 240 | }) | 261 | }) |
| 241 | //tableInfo.value.data = arr | 262 | //tableInfo.value.data = arr |
| 242 | tableInfo.value.currentId = BASE_ID | 263 | tableInfo.value.currentId = BASE_ID |
| ... | @@ -302,7 +323,7 @@ const columnSave = async (row) => { | ... | @@ -302,7 +323,7 @@ const columnSave = async (row) => { |
| 302 | ElMessage.success(`${tableInfo.value.flag === 'create' ? '新增' : '修改'}成功`); | 323 | ElMessage.success(`${tableInfo.value.flag === 'create' ? '新增' : '修改'}成功`); |
| 303 | getTableData() | 324 | getTableData() |
| 304 | columnInfoReset() | 325 | columnInfoReset() |
| 305 | documentList() | 326 | // documentList() |
| 306 | findTab(false) | 327 | findTab(false) |
| 307 | tableRef.value.columnInfo = {} | 328 | tableRef.value.columnInfo = {} |
| 308 | } else { | 329 | } else { |
| ... | @@ -326,7 +347,8 @@ const columnInfoReset = () => { | ... | @@ -326,7 +347,8 @@ const columnInfoReset = () => { |
| 326 | issuingEntityName: "", | 347 | issuingEntityName: "", |
| 327 | issuingEntityGuid: "", | 348 | issuingEntityGuid: "", |
| 328 | companyGuid: "", | 349 | companyGuid: "", |
| 329 | registerGuid: "" | 350 | registerGuid: "", |
| 351 | damGuid: "" | ||
| 330 | } | 352 | } |
| 331 | } | 353 | } |
| 332 | const columnEdit = (row) => { | 354 | const columnEdit = (row) => { |
| ... | @@ -376,12 +398,24 @@ const handelSelect = (row, key, row1) => { | ... | @@ -376,12 +398,24 @@ const handelSelect = (row, key, row1) => { |
| 376 | tableRef.value.columnInfo.effectiveDate = "" | 398 | tableRef.value.columnInfo.effectiveDate = "" |
| 377 | } else { | 399 | } else { |
| 378 | if (tableInfo.value.flag === "create") { | 400 | if (tableInfo.value.flag === "create") { |
| 379 | console.log(row, '-----') | 401 | console.log(row, '--create---') |
| 402 | // const params = { | ||
| 403 | // daName: row.damName, | ||
| 404 | // type: 1, | ||
| 405 | // companyGuid: row.tenantGuid, | ||
| 406 | // isCompany: true | ||
| 407 | // } | ||
| 408 | // getAssetDetail(params).then((res: any) => { | ||
| 409 | // if (res?.code === proxy.$passCode) { | ||
| 410 | // console.log(res.data, '--123-') | ||
| 411 | |||
| 412 | // } | ||
| 413 | // }) | ||
| 380 | const currentDate = dayjs().format('YYYY-MM-DD'); | 414 | const currentDate = dayjs().format('YYYY-MM-DD'); |
| 381 | columnInfo.value = { | 415 | columnInfo.value = { |
| 382 | guid: row.guid, | 416 | guid: row.guid, |
| 383 | companyName: row.rightMainName, | 417 | companyName: row.tenantName, |
| 384 | daName: row.damName, | 418 | daName: row.daName, |
| 385 | registerTime: row.registerTime, | 419 | registerTime: row.registerTime, |
| 386 | daCode: row.daCode, | 420 | daCode: row.daCode, |
| 387 | effectiveDate: row.effectiveDate, | 421 | effectiveDate: row.effectiveDate, |
| ... | @@ -390,7 +424,8 @@ const handelSelect = (row, key, row1) => { | ... | @@ -390,7 +424,8 @@ const handelSelect = (row, key, row1) => { |
| 390 | issuingEntityName: row.issuingEntityName, | 424 | issuingEntityName: row.issuingEntityName, |
| 391 | issuingEntityGuid: row.issuingEntityGuid, | 425 | issuingEntityGuid: row.issuingEntityGuid, |
| 392 | companyGuid: row.tenantGuid, | 426 | companyGuid: row.tenantGuid, |
| 393 | registerGuid: row.registerGuid | 427 | registerGuid: row.registerGuid, |
| 428 | damGuid: row.damGuid | ||
| 394 | } | 429 | } |
| 395 | const { guid, ...obj } = columnInfo.value | 430 | const { guid, ...obj } = columnInfo.value |
| 396 | tableRef.value.columnInfo = obj | 431 | tableRef.value.columnInfo = obj |
| ... | @@ -401,6 +436,7 @@ const handelSelect = (row, key, row1) => { | ... | @@ -401,6 +436,7 @@ const handelSelect = (row, key, row1) => { |
| 401 | columnInfo.value.effectiveDate = row.effectiveDate | 436 | columnInfo.value.effectiveDate = row.effectiveDate |
| 402 | columnInfo.value.issuingEntityName = row.issuingEntityName | 437 | columnInfo.value.issuingEntityName = row.issuingEntityName |
| 403 | columnInfo.value.registerGuid = row.registerGuid; | 438 | columnInfo.value.registerGuid = row.registerGuid; |
| 439 | columnInfo.value.damGuid = row.damGuid; | ||
| 404 | tableRef.value.columnInfo = { ...columnInfo.value } | 440 | tableRef.value.columnInfo = { ...columnInfo.value } |
| 405 | } | 441 | } |
| 406 | 442 | ||
| ... | @@ -415,7 +451,8 @@ const findTab = (flag) => { | ... | @@ -415,7 +451,8 @@ const findTab = (flag) => { |
| 415 | tab.meta.editPage = flag | 451 | tab.meta.editPage = flag |
| 416 | } | 452 | } |
| 417 | const addAssetsOption = (values, row, flag = false) => { | 453 | const addAssetsOption = (values, row, flag = false) => { |
| 418 | getAssetsList().then(() => { | 454 | console.log(values, row, flag, '--新增-') |
| 455 | getAssetsList(values, row).then(() => { | ||
| 419 | const obj = { | 456 | const obj = { |
| 420 | costAccessmentGuid: null, | 457 | costAccessmentGuid: null, |
| 421 | daCode: row.daCode, | 458 | daCode: row.daCode, |
| ... | @@ -432,6 +469,7 @@ const addAssetsOption = (values, row, flag = false) => { | ... | @@ -432,6 +469,7 @@ const addAssetsOption = (values, row, flag = false) => { |
| 432 | state: row.state, | 469 | state: row.state, |
| 433 | tenantGuid: row.companyGuid, | 470 | tenantGuid: row.companyGuid, |
| 434 | tenantName: row.companyName, | 471 | tenantName: row.companyName, |
| 472 | damGuid: row.damGuid | ||
| 435 | } | 473 | } |
| 436 | const arr = assetsOption.value | 474 | const arr = assetsOption.value |
| 437 | if (values && values.tenantGuid === row.companyGuid) { | 475 | if (values && values.tenantGuid === row.companyGuid) { | ... | ... |
-
Please register or sign in to post a comment