{"version":3,"sources":["webpack:///./src/views/SalesReporting2/PaymentTrackingReport/ReleaseInput/index.vue?81cb","webpack:///./src/views/SalesReporting2/PaymentTrackingReport/ReleaseInput/index.vue?2a72","webpack:///./src/views/SalesReporting2/PaymentTrackingReport/ReleaseInput/index.vue","webpack:///./src/views/SalesReporting2/PaymentTrackingReport/ReleaseInput/index.vue?7915"],"names":["_withScopeId","n","_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","style","src","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","key","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","render","_ctx","_cache","$props","$setup","$data","$options","_component_a_button","_component_a_space","_component_a_table","_component_a_modal","default","onClick","goBack","_","type","save2","rowKey","item","index","dataSource","columns","pagination","scroll","x","colWidth","y","colHeight","rowClassName","totalRowClass","bordered","colFather","name","slots","title","fn","cTitle","$event","displayColumnsClick","columnsSons","colSon","pr","columnsGrandsons","colGrandson","ar","visible","warningVisible","footer","forceExit","saveForExit","constraintNegNumber","number","replace","setup","props","id","store","state","salesReport","fcSearchParams","years","make","closeOrNot","startYear","globalModified","renderInputCell","record","rowName","value","onInput","target","isModified","renderYearSumCell","colName","subColumns","PMT","possibleReleaseRowData","columnsAll","distinctColor","column","generateDynamicColumns","initColumns","year","yearObj","display","parent","dataIndex","canExpand","expandStatus","customHeaderCell","children","customRender","rowobj","push","subObj","Object","entries","parentTitle","forEach","col","defaultWidth","len","filter","length","calculateHeight","table","document","getElementsByClassName","clinetHeight","body","clientHeight","top","getBoundingClientRect","createFirstRowObj","firstObj","createLastRowObj","lastObj","firstRowObj","lastRowObj","initDataSource","generateTableData","dataList","parseInt","columnsNameList","data","reduce","lst","row","rowData","obj","ele","val","initColumnData","colDataObj","values","toNumber","str","parseFloat","toString","replaceAll","calculateArColumns","objKey","keys","plus","round","calculateYearCols","getData","params","yearList","then","res","middleData","reverse","resetModifiedFlag","modifiedObj","JSON","parse","stringify","slice","i","array","rest","yearLength","j","directSubsidy","payoutToDealer","pmt","save","inputRow","shift","newFirstRow","unshift","splice","showData","console","log","window","addEventListener","router","toRoute","hasForceExit","go","to","renderRowName","cols","fixed","width","sonList","sons","father","customHeaderRow","weights","includes","__exports__"],"mappings":"2IAAA,W,8ECIMA,EAAe,SAAAC,GAAK,OAAC,yBAAa,mBAAmBA,EAAEA,IAAI,0BAAcA,GACzEC,EAAa,CAAEC,MAAO,iBACtBC,EAAa,CAAED,MAAO,yBACtBE,EAA0B,6BAAiB,QAC3CC,EAA2BN,GAAa,WAAmB,uCAAoB,UAAW,CAAEO,MAAO,CAAC,eAAe,UAAY,CACtH,gCAAoB,MAAO,CACtCC,IAAK,IACLL,MAAO,SAEI,gCAAoB,SAAU,CAAEA,MAAO,cAAgB,mBAClE,MACEM,EAA0B,6BAAiB,QAC3CC,EAAa,CAAEP,MAAO,uBACtBQ,EAA2BX,GAAa,WAAmB,uCAAoB,MAAO,CAAEG,MAAO,WAAa,0BAA2B,MACvIS,EAAa,CAAC,WACdC,EAAa,CACjBC,IAAK,EACLX,MAAO,eAEHY,EAAc,CAClBD,IAAK,EACLX,MAAO,eAEHa,EAAc,CAAEF,IAAK,GACrBG,EAA4BjB,GAAa,WAAmB,uCAAoB,MAAO,KAAM,oBAAqB,MAClHkB,EAA4BlB,GAAa,WAAmB,uCAAoB,MAAO,KAAM,2BAA4B,MACzHmB,EAAc,CAClBF,EACAC,GAEIE,EAAc,CAAEN,IAAK,GACrBO,EAAc,CAAEP,IAAK,GACrBQ,EAA4BtB,GAAa,WAAmB,uCAAoB,MAAO,KAAM,wBAAyB,MACtHuB,EAAc,CAClBD,GAEIE,EAAc,CAAEV,IAAK,GACrBW,EAA4BzB,GAAa,WAAmB,uCAAoB,IAAK,KAAM,oBAAqB,MAChH0B,EAA2B,6BAAiB,QAC5CC,EAA2B,6BAAiB,QAE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AgB,GAChB1B,MAAK,EACLgD,eAAc,EACdhB,UAAS,EACTC,YAAW,EACXH,eAAc,EACdjC,OAAM,EACNiL,gBAAe,GACfjK,cAAa,O,iCC1pBzB,MAAMoK,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAASjM,GAAQ,CAAC,YAAY,qBAE1E","file":"js/chunk-ab4e5584.564a9606.js","sourcesContent":["export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=3e6a641c&lang=scss&scoped=true\"","import { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, createSlots as _createSlots, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\nimport _imports_0 from '@/assets/images/claim/rect.png'\n\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3e6a641c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"release-input\" }\nconst _hoisted_2 = { class: \"release-input__header\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"Back\")\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"section\", { style: {\"padding-left\":\"-12px\"} }, [\n /*#__PURE__*/_createElementVNode(\"img\", {\n src: _imports_0,\n class: \"rect\"\n }),\n /*#__PURE__*/_createElementVNode(\"strong\", { class: \"wrap-title\" }, \"Release Input\")\n], -1))\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"Save\")\nconst _hoisted_6 = { class: \"release-input__body\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"warning\" }, \"* Amount w/o VAT (RMB)\", -1))\nconst _hoisted_8 = [\"onClick\"]\nconst _hoisted_9 = {\n key: 0,\n class: \"expand-icon\"\n}\nconst _hoisted_10 = {\n key: 1,\n class: \"expand-icon\"\n}\nconst _hoisted_11 = { key: 0 }\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", null, \"Possible Release\", -1))\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", null, \"(Accrual vs. Payout BE)\", -1))\nconst _hoisted_14 = [\n _hoisted_12,\n _hoisted_13\n]\nconst _hoisted_15 = { key: 1 }\nconst _hoisted_16 = { key: 0 }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", null, \"t/o already released\", -1))\nconst _hoisted_18 = [\n _hoisted_17\n]\nconst _hoisted_19 = { key: 1 }\nconst _hoisted_20 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"p\", null, \"历史数据已修改,请点击保存退出。\", -1))\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\"Exit\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"Save\")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_a_button = _resolveComponent(\"a-button\")!\n const _component_a_space = _resolveComponent(\"a-space\")!\n const _component_a_table = _resolveComponent(\"a-table\")!\n const _component_a_modal = _resolveComponent(\"a-modal\")!\n\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_a_space, null, {\n default: _withCtx(() => [\n _createVNode(_component_a_button, { onClick: _ctx.goBack }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n }, 8, [\"onClick\"]),\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_a_space, null, {\n default: _withCtx(() => [\n _createVNode(_component_a_button, {\n type: \"primary\",\n onClick: _ctx.save2\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createVNode(_component_a_table, {\n rowKey: (item, index) => index,\n dataSource: _ctx.dataSource,\n columns: _ctx.columns,\n pagination: false,\n scroll: {\n x: _ctx.colWidth,\n y: _ctx.colHeight,\n },\n rowClassName: _ctx.totalRowClass,\n bordered: \"\"\n }, _createSlots({ _: 2 }, [\n _renderList(_ctx.columns, (colFather) => {\n return {\n name: colFather.slots.title,\n fn: _withCtx(() => [\n _createElementVNode(\"div\", null, [\n _createElementVNode(\"span\", null, _toDisplayString(colFather.cTitle), 1),\n (colFather.canExpand)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n onClick: ($event: any) => (_ctx.displayColumnsClick(colFather.cTitle))\n }, [\n (colFather.expandStatus)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_9, \" -\"))\n : (_openBlock(), _createElementBlock(\"span\", _hoisted_10, \" +\"))\n ], 8, _hoisted_8))\n : _createCommentVNode(\"\", true)\n ])\n ])\n }\n }),\n _renderList(_ctx.columnsSons, (colSon, index) => {\n return {\n name: colSon.slots.title,\n fn: _withCtx(() => [\n (\n colSon.cTitle ===\n 'Possible Release (Accrual vs. Payout BE)'\n )\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_11, _hoisted_14))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_15, _toDisplayString(colSon.pr || ''), 1))\n ])\n }\n }),\n _renderList(_ctx.columnsGrandsons, (colGrandson, index) => {\n return {\n name: colGrandson.slots.title,\n fn: _withCtx(() => [\n (colGrandson.cTitle === 't/o already released (+)')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, _hoisted_18))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_19, _toDisplayString(colGrandson.ar || ''), 1))\n ])\n }\n })\n ]), 1032, [\"rowKey\", \"dataSource\", \"columns\", \"scroll\", \"rowClassName\"])\n ])\n ]),\n _createVNode(_component_a_modal, {\n visible: _ctx.warningVisible,\n \"onUpdate:visible\": _cache[0] || (_cache[0] = ($event: any) => ((_ctx.warningVisible) = $event))\n }, {\n footer: _withCtx(() => [\n _createVNode(_component_a_button, { onClick: _ctx.forceExit }, {\n default: _withCtx(() => [\n _hoisted_21\n ]),\n _: 1\n }, 8, [\"onClick\"]),\n _createVNode(_component_a_button, {\n type: \"primary\",\n onClick: _ctx.saveForExit\n }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ]),\n default: _withCtx(() => [\n _hoisted_20\n ]),\n _: 1\n }, 8, [\"visible\"])\n ], 64))\n}","\nimport {\n defineComponent,\n ref,\n createVNode,\n computed,\n nextTick,\n onMounted,\n} from 'vue';\nimport { useStore } from 'vuex';\nimport {\n useRoute,\n onBeforeRouteLeave,\n useRouter,\n RouteLocationNormalizedLoaded,\n} from 'vue-router';\nimport { ColumnsType } from '../types';\nimport AInput from 'ant-design-vue/lib/input';\nimport AButton from 'ant-design-vue/lib/button';\nimport {\n getCheckingOverviewReleaseList,\n getCheckingOverviewReleaseSave,\n} from '@/API/salesReporting';\nimport Decimal from '@/utils/closing/decimal';\n\n/**\n * 限制数字格式为负数\n */\nfunction constraintNegNumber(number: string) {\n number = number.replace(/[^0-9\\\\-]/g, '');\n if (number === '-') {\n number = '';\n } else if (number !== '' && number !== '0') {\n if (number[0] !== '-') {\n number = `-${number}`;\n }\n }\n return number;\n}\n\nexport default defineComponent({\n // components: { PlusCircleOutlined },\n setup(props, { emit }) {\n // 前端生成记录需要 e.g. 1 2 3 4 ....\n let id = 1;\n const store = useStore();\n const {\n yearList: years,\n make,\n closeOrNot,\n startYear,\n } = store.state.salesReport.fcSearchParams;\n const globalModified = ref(false);\n\n //* Direct Subsidy / Payout to dealer / PMT 三列输入单元格渲染\n const renderInputCell = ({ record }: any, type: string) => {\n //* (New Add) 表示固定用于新增数据的行\n // console.log('renderInputCell', record[type], record);\n if (record.rowName === 'Text') {\n return createVNode(AInput, {\n value: record[type],\n // type: 'number', //? 设置单元格只能输入数字\n onInput: ($event: any) => {\n //TODO 修改历史数据后改变状态\n record[type] = constraintNegNumber($event.target.value);\n record.isModified[type] = true;\n globalModified.value = true;\n },\n class: record.isModified[type] ? 'modified' : '',\n });\n }\n if (record.rowName === 't/o to-be released') {\n return createVNode('p', {}, `${record[type]}`);\n }\n };\n\n const renderYearSumCell = ({ record, index }: any, colName: string) => {\n // console.log(record, '123');\n if (\n record.rowName === 'Text' ||\n record.rowName === 't/o to-be released'\n ) {\n return createVNode('p', {}, `${record[colName]}`);\n }\n };\n\n //* 根据后台数据 生成全部表头\n //* 表头数据中的 Possible Release 和 t/o already released的全部数据\n const subColumns = {\n 'Direct Subsidy': 'directSubsidy',\n 'Payout to Dealer': 'payoutToDealer',\n PMT: 'pmt',\n };\n const possibleReleaseRowData =\n store.state.salesReport.possibleReleaseRowData;\n const columnsAll = ref([]);\n\n const distinctColor = (column: any, type: string) => {\n return { class: [type] };\n };\n //* 动态生成表列名\n const generateDynamicColumns = () => {\n const initColumns = [];\n for (const year of years) {\n //* Y2021等数据对象 并放入表头数组中\n const yearObj = {\n // group: 1, //TODO 要不要加个分组信息?\n cTitle: year,\n display: true,\n parent: null,\n dataIndex: year,\n key: year,\n canExpand: true,\n expandStatus: false,\n slots: { title: year },\n customHeaderCell: (column: any) =>\n distinctColor(column, 'distinct-shallow-blue'),\n children: [\n {\n pr: possibleReleaseRowData[year],\n slots: { title: `${year}_pr` },\n customHeaderCell: (column: any) =>\n distinctColor(column, 'distinct-dark-blue'),\n children: [\n {\n ar: 0,\n slots: { title: `${year}_ar` },\n customRender: (rowobj: any) =>\n renderYearSumCell(rowobj, year),\n customHeaderCell: (column: any) =>\n distinctColor(\n column,\n 'distinct-shallow-blue'\n ),\n },\n ],\n },\n ],\n };\n initColumns.push(yearObj);\n //* pmt等数据对象\n for (const [key, value] of Object.entries(subColumns)) {\n const subObj = {\n cTitle: key,\n display: false,\n parent: year,\n dataIndex: `${value}_${year}`,\n key: `${value}_${year}`,\n canExpand: false,\n slots: { title: `${value}_${year}` },\n customHeaderCell: (column: any) =>\n distinctColor(column, 'distinct-gray'),\n children: [\n {\n slots: { title: `${value}_${year}_pr` },\n pr: possibleReleaseRowData[`${value}_${year}`],\n customHeaderCell: (column: any) =>\n distinctColor(column, 'distinct-dark-blue'),\n children: [\n {\n ar: 0,\n slots: { title: `${value}_${year}_ar` },\n customHeaderCell: (column: any) =>\n distinctColor(\n column,\n 'distinct-shallow-blue'\n ),\n customRender: (rowobj: any) =>\n renderInputCell(\n rowobj,\n `${value}_${year}`\n ),\n },\n ],\n },\n ],\n };\n initColumns.push(subObj);\n }\n }\n columnsAll.value = initColumns;\n };\n generateDynamicColumns();\n\n const displayColumnsClick = (parentTitle: string) => {\n columnsAll.value.forEach((col: any) => {\n if (col.parent === parentTitle) {\n col.display = !col.display;\n }\n if (col.cTitle === parentTitle) {\n col.expandStatus = !col.expandStatus;\n }\n });\n };\n //* 获取需要display的表头 并塞入第一列\n // const columns = computed(() => {\n // const cols = columnsAll.value.filter((col: any) => {\n // return col.display;\n // });\n // cols.unshift({\n // dataIndex: 'rowName',\n // key: 'rowName',\n // fixed: 'left',\n // slots: { title: 'rowName' },\n // children: [\n // {\n // cTitle: 'Possible Release (Accrual vs. Payout BE)',\n // slots: { title: 'rowName2' },\n // children: [\n // {\n // cTitle: 't/o already released (+)',\n // width: 200,\n // dataIndex: 'rowName',\n // slots: { title: 'rowName3' },\n // customRender: renderRowName,\n // },\n // ],\n // },\n // ],\n // });\n // return cols;\n // });\n\n //* 计算表格宽度\n const colWidth = computed(() => {\n const defaultWidth = 150;\n const len = columnsAll.value.filter((col: any) => {\n return col.display;\n }).length;\n return defaultWidth * len + 200;\n });\n\n //* 计算表格高度\n const colHeight = ref(500);\n const calculateHeight = () => {\n const table = document.getElementsByClassName(\n 'ant-table-wrapper'\n )[0];\n const clinetHeight = document.body.clientHeight;\n const top = table.getBoundingClientRect().top;\n colHeight.value = clinetHeight - top - 150;\n };\n\n nextTick(() => {\n calculateHeight();\n });\n\n //TODO 初始化(New Add)行\n const createFirstRowObj = () => {\n const firstObj: any = { rowName: '(New Add)', isModified: {} };\n for (const year of years) {\n firstObj[`${year}`] = 0;\n for (const [key, value] of Object.entries(subColumns)) {\n firstObj[`${value}_${year}`] = 0;\n }\n }\n return firstObj;\n };\n\n const createLastRowObj = () => {\n const lastObj: any = { rowName: 't/o to-be released' };\n for (const year of years) {\n lastObj[`${year}`] = 0;\n }\n return lastObj;\n };\n\n // 假数据\n const dataSource = ref([]);\n const emptyDataSource: any[] = [];\n const firstRowObj = createFirstRowObj();\n const lastRowObj = createLastRowObj();\n // const initDataSource = ref([firstRowObj, lastRowObj]);\n const initDataSource = ref([]);\n\n //* 动态生成表格数据\n const generateTableData = (dataList: any) => {\n // const data: any[] = [];\n if (dataList.length > 0) {\n id = parseInt(dataList[0][0]) + 1;\n }\n const columnsNameList: string[] = ['', 'rowName'];\n for (const year of years) {\n columnsNameList.push(`${year}`);\n for (const [key, value] of Object.entries(subColumns)) {\n columnsNameList.push(`${value}_${year}`);\n }\n }\n const data = dataList.reduce((lst: any, row: any) => {\n const rowData = row.reduce(\n (obj: any, ele: string, index: number) => {\n if (index === 0) {\n return {\n ...obj,\n id: ele,\n };\n }\n if (index === 1) {\n return {\n ...obj,\n [columnsNameList[index]]: 'Text',\n val: ele,\n };\n }\n return {\n ...obj,\n [columnsNameList[index]]: ele,\n isModified: {\n [columnsNameList[index]]: false,\n },\n };\n },\n {}\n );\n return [...lst, rowData];\n }, []);\n // console.log('generateTableData', data);\n return data;\n };\n\n // console.log('initDataSource', initDataSource.value);\n\n //* 点击加号展开数据\n // const isExpanded = ref(false);\n // const expandData = () => {\n // isExpanded.value = !isExpanded.value;\n // if (isExpanded.value) {\n // dataSource.value = initDataSource.value;\n // } else {\n // dataSource.value = emptyDataSource;\n // }\n // };\n\n //* 计算表头第三行ar数据时,初始化一个 0值对象\n const initColumnData = () => {\n const colDataObj: any = {};\n for (const year of years) {\n colDataObj[`${year}`] = { [year]: 0 };\n for (const value of Object.values(subColumns)) {\n colDataObj[`${year}`][`${value}_${year}`] = 0;\n }\n }\n return colDataObj;\n };\n\n //* 千分位字符串变成数字\n const toNumber = (str: string) => {\n if (str === '') {\n return 0;\n }\n return parseFloat(str.toString().replaceAll(',', ''));\n };\n\n const calculateArColumns = (children: any) => {\n //* 重新计算 ds ptd pmt 三列表头第三行数据(按列计算)\n const colDataObj = initColumnData();\n children.forEach((row: any) => {\n if (row.rowName === 'Text') {\n for (const objKey in colDataObj) {\n for (const key of Object.keys(colDataObj[objKey])) {\n colDataObj[objKey][key] =\n toNumber(colDataObj[objKey][key]) +\n toNumber(row[key]);\n }\n }\n }\n });\n //* 计算每一年的表头第三行的ar, 以及尾行t/o to-be released\n for (const year of years) {\n colDataObj[year][year] = 0;\n for (const value of Object.values(subColumns)) {\n // children[children.length - 1][`${value}_${year}`] = possibleReleaseRowData[`${value}_${year}`]\n colDataObj[year][year] += toNumber(\n colDataObj[year][`${value}_${year}`]\n );\n }\n children[children.length - 1][year] = new Decimal(\n possibleReleaseRowData[year]\n )\n .plus(colDataObj[year][year])\n .round(0);\n }\n\n columnsAll.value.forEach((col: any) => {\n let val;\n for (const year of years) {\n if (col.cTitle === year) {\n val = colDataObj[year][year];\n } else {\n for (const [key, value] of Object.entries(subColumns)) {\n if (col.cTitle === key && col.parent === year) {\n val = colDataObj[year][`${value}_${year}`];\n children[children.length - 1][\n `${value}_${year}`\n ] = new Decimal(\n possibleReleaseRowData[`${value}_${year}`]\n )\n .plus(val)\n .round(0);\n }\n }\n }\n }\n col.children[0].children[0].ar = new Decimal(val).round(0);\n });\n };\n\n const calculateYearCols = (children: any) => {\n //* 重新计算Y2021等列数据\n children.forEach((row: any) => {\n if (row.rowName === 'Text') {\n for (const year of years) {\n row[year] = 0;\n for (const value of Object.values(subColumns)) {\n row[year] += toNumber(row[`${value}_${year}`]);\n }\n row[year] = new Decimal(row[year]).round(0);\n }\n }\n });\n };\n\n const getData = () => {\n const params = {\n make,\n closeOrNot,\n startYear,\n yearList: years,\n };\n getCheckingOverviewReleaseList(params).then((res: any) => {\n const middleData = generateTableData(res.dataList.reverse());\n initDataSource.value = [firstRowObj, ...middleData, lastRowObj];\n calculateArColumns(initDataSource.value);\n calculateYearCols(initDataSource.value);\n dataSource.value = initDataSource.value;\n });\n };\n\n const resetModifiedFlag = () => {\n initDataSource.value.forEach((data: any) => {\n const modifiedObj = data.isModified;\n if (modifiedObj && Object.keys(modifiedObj).length > 0) {\n Object.keys(modifiedObj).forEach((key: string) => {\n modifiedObj[key] = false;\n });\n }\n });\n globalModified.value = false;\n };\n\n const save2 = () => {\n const data = JSON.parse(JSON.stringify(initDataSource.value)).slice(\n 1,\n initDataSource.value.length - 1\n );\n\n const dataList = [];\n for (let i = 0; i < data.length; i++) {\n const array = [];\n const row = data[i];\n const { id, val, rowName, isModified, ...rest } = row;\n const keys = Object.keys(rest);\n const yearLength = keys.length / 4;\n array.push(id);\n array.push(val);\n\n for (let j = 0; j < yearLength; j++) {\n const directSubsidy = toNumber(\n row[`directSubsidy_${keys[j]}`]\n );\n const payoutToDealer = toNumber(\n row[`payoutToDealer_${keys[j]}`]\n );\n const pmt = toNumber(row[`pmt_${keys[j]}`]);\n array.push(directSubsidy + payoutToDealer + pmt);\n array.push(directSubsidy);\n array.push(payoutToDealer);\n array.push(pmt);\n }\n dataList.push(array);\n }\n const params = {\n make,\n yearList: years,\n dataList,\n };\n return getCheckingOverviewReleaseSave(params).then((res: any) => {\n resetModifiedFlag();\n const children = dataSource.value as Array;\n calculateArColumns(children);\n calculateYearCols(children);\n });\n };\n\n //* 新增一行数据\n const save = () => {\n //TODO 需要校验传入的是不是数字\n if (dataSource.value.length > 0) {\n //* 将保存的数据填入数据源中\n const children = dataSource.value as Array;\n const inputRow = children.shift();\n inputRow.rowName = 'Text';\n inputRow.val = '';\n inputRow.id = id++;\n const newFirstRow = createFirstRowObj();\n children.unshift(newFirstRow);\n children.splice(1, 0, inputRow);\n calculateArColumns(children);\n calculateYearCols(children);\n }\n };\n\n getData();\n\n const showData = () => {\n console.log('dataSource', dataSource.value);\n console.log('columnsAll', columnsAll.value);\n };\n\n onMounted(() => {\n window.addEventListener('resize', calculateHeight);\n });\n\n //* 以下代码实现: 如未点保存退出页面,系统提醒用户:“历史数据已修改,请点击保存退出。”如果用户不点击保存直接退出,修改后的数据不记录;\n const router = useRouter();\n const toRoute = ref();\n const hasForceExit = ref(false);\n const warningVisible = ref(false);\n\n const goBack = () => {\n router.go(-1);\n };\n\n const forceExit = () => {\n hasForceExit.value = true;\n router.push(toRoute.value as RouteLocationNormalizedLoaded);\n };\n\n const saveForExit = () => {\n warningVisible.value = false;\n save2().then((_: any) => {\n router.push(toRoute.value as RouteLocationNormalizedLoaded);\n });\n };\n\n onBeforeRouteLeave((to) => {\n if (hasForceExit.value) {\n return true;\n }\n if (globalModified.value) {\n toRoute.value = to;\n warningVisible.value = true;\n return false;\n } else {\n return true;\n }\n });\n\n //* 表格第一列 固定行的行头渲染逻辑\n const renderRowName = ({ record }: any) => {\n const obj = {\n children: record.rowName,\n props: {} as any,\n };\n if (record.rowName === '(New Add)') {\n // return createVNode('p', {}, `${record.rowName}`);\n return createVNode(\n AButton,\n { onClick: save },\n { default: () => `${record.rowName}` }\n );\n }\n if (record.rowName === 'Text') {\n return createVNode(AInput, {\n value: record.val,\n onInput: ($event: any) => {\n record.val = $event.target.value;\n },\n });\n }\n return obj;\n };\n\n const columns = computed(() => {\n const cols = columnsAll.value.filter((col: any) => {\n return col.display;\n });\n cols.unshift({\n dataIndex: 'rowName',\n key: 'rowName',\n fixed: 'left',\n slots: { title: 'rowName' },\n customHeaderCell: (column: any) =>\n distinctColor(column, 'distinct-shallow-blue'),\n children: [\n {\n cTitle: 'Possible Release (Accrual vs. Payout BE)',\n slots: { title: 'rowName2' },\n customHeaderCell: (column: any) =>\n distinctColor(column, 'distinct-dark-blue'),\n children: [\n {\n cTitle: 't/o already released (+)',\n width: 200,\n dataIndex: 'rowName',\n slots: { title: 'rowName3' },\n customRender: renderRowName,\n customHeaderCell: (column: any) =>\n distinctColor(\n column,\n 'distinct-shallow-blue'\n ),\n },\n ],\n },\n ],\n });\n return cols;\n });\n\n //* 动态计算 表头第二行 用于设置插槽 来绑定pr数据\n const columnsSons = computed(() => {\n const sonList = columns.value.reduce((sons: any, father: any) => {\n return [...sons, ...father.children];\n }, []);\n return sonList;\n });\n //* 动态计算 表头第三行 用于设置插槽 来绑定ar数据\n const columnsGrandsons = computed(() => {\n const sonList = columnsSons.value.reduce(\n (sons: any, father: any) => {\n return [...sons, ...father.children];\n },\n []\n );\n return sonList;\n });\n\n const customHeaderRow = (column: any, index: any) => {\n if (index === 1) {\n return {\n class: 'second-table-header',\n };\n }\n };\n\n const totalRowClass = (record: any) => {\n const weights = ['t/o to-be released'];\n if (weights.includes(record.rowName)) {\n return 'last-row';\n }\n };\n\n return {\n renderRowName,\n dataSource,\n columns,\n colWidth,\n colHeight,\n displayColumnsClick,\n showData,\n save,\n // isExpanded,\n // expandData,\n columnsSons,\n columnsGrandsons,\n save2,\n globalModified,\n forceExit,\n saveForExit,\n warningVisible,\n goBack,\n customHeaderRow,\n totalRowClass,\n };\n },\n});\n","import { render } from \"./index.vue?vue&type=template&id=3e6a641c&scoped=true&ts=true\"\nimport script from \"./index.vue?vue&type=script&lang=ts\"\nexport * from \"./index.vue?vue&type=script&lang=ts\"\n\nimport \"./index.vue?vue&type=style&index=0&id=3e6a641c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/app/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-3e6a641c\"]])\n\nexport default __exports__"],"sourceRoot":""}