diff --git a/config/index.js b/config/index.js index a6a51a11..a4cef1bf 100644 --- a/config/index.js +++ b/config/index.js @@ -14,7 +14,8 @@ module.exports = { // 请求的目标主机 // target: 'http://116.255.223.226:8082/nsgk_test/', // 公网测试环境 // target: `http://192.168.0.116:8091/nsgk_api/`, // 内网测试环境 - target: 'http://localhost:8080/', + //target: 'http://localhost:8080/', + target: 'http://192.168.0.106:8080/', changeOrigin: true, pathRewrite: { '^/api': '' diff --git a/package-lock.json b/package-lock.json index 90449a49..2f2c2ab2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1351,6 +1351,11 @@ "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" }, + "bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==" + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -4281,7 +4286,7 @@ "fastclick": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/fastclick/-/fastclick-1.0.6.tgz", - "integrity": "sha1-FhYlsnsaWAZAWTa9qaLBkm0Gvmo=", + "integrity": "sha512-cXyDBT4g0uWl/Xe75QspBDAgAWQ0lkPi/zgp6YFEUHj6WV6VIZl7R6TiDZhdOVU3W4ehp/8tG61Jev1jit+ztQ==", "dev": true }, "fastparse": { @@ -4436,7 +4441,7 @@ "font-awesome.css": { "version": "4.7.2", "resolved": "https://registry.npmjs.org/font-awesome.css/-/font-awesome.css-4.7.2.tgz", - "integrity": "sha1-B1pCARQo8gJyVO9phgx1ergWyVI=" + "integrity": "sha512-FIyRbig4PDY15NGzejM3b8OQ/lWvId8PHnE4CnuDtc8/YYs07cvnqLCyfvIJPwJl5SA/Rq+9jAe9W+Fr1pv0DA==" }, "for-in": { "version": "1.0.2", @@ -12355,7 +12360,7 @@ "vue-html5-editor": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/vue-html5-editor/-/vue-html5-editor-1.1.1.tgz", - "integrity": "sha1-WRAhCoMNjI00eaHx/shHMZKqA7M=", + "integrity": "sha512-Ckmb8djta+XQMUQaxRcCUNBXEzjPF5p6c2nQ5ICcIuR8eYz4b0HAGzXlSDfL3ZxkrVHO2Hx0VrUORLu2Lwem4g==", "dev": true }, "vue-lazyload": { diff --git a/package.json b/package.json index b7acc1be..de93cd5c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "build": "node build/build.js" }, "dependencies": { + "bignumber.js": "^9.1.2", "@vant/area-data": "^1.2.2", "axios": "^0.21.1", "echarts": "^5.3.3", diff --git a/src/api/sunVillage_info/fixedAssets.js b/src/api/sunVillage_info/fixedAssets.js index acb99fbf..7c16ccc9 100644 --- a/src/api/sunVillage_info/fixedAssets.js +++ b/src/api/sunVillage_info/fixedAssets.js @@ -1166,4 +1166,20 @@ export function assetResourceDetail(id, parms) { }); } +// 公式科目模板分类列表 +export function expressionReportByCategory(name) { + return request({ + url: '/finance/expressionReport/category/' + name, + method: 'get', + }) +} + +//查询资产负债表(公式报表模板) +export const assetLiabilityReportByExpTpl = (data) => { + return request({ + url: '/finance/report/assetLiabilityReportByExpTpl', + method: 'get', + params: data + }) +} diff --git a/src/assets/images/sunVillage_info/index_block_23.png b/src/assets/images/sunVillage_info/index_block_23.png new file mode 100644 index 00000000..611f4e34 Binary files /dev/null and b/src/assets/images/sunVillage_info/index_block_23.png differ diff --git a/src/router/index.js b/src/router/index.js index 4019c168..bcfe9e18 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4245,6 +4245,15 @@ export const constantRoutes = [ }, component: (resolve) => require(['@/views/sunVillage_info/resourceDetail'], resolve) }, + { ////阳光村务(新)-- 修改资源 + path: '/sunVillage_info/detailed_liabilities', + name: 'sunVillageInfoDetailedLiabilities', + meta: { + title: '负债表', + hidden: true, + }, + component: (resolve) => require(['@/views/sunVillage_info/detailed_liabilities'], resolve) + }, { ////农业综合行政执法公众平台 path: '/lawEnforcement/index_new', name: 'lawEnforcementIndexNew', diff --git a/src/utils/finance.js b/src/utils/finance.js new file mode 100644 index 00000000..8dac27d2 --- /dev/null +++ b/src/utils/finance.js @@ -0,0 +1,259 @@ +import {numFormat} from "@/utils/index"; +import BigNumber from "bignumber.js"; + +export const FINANCE = { + CONFIG_KEY: '_Finance_config', + EXPRESSION_REPORT_TEMPLATE: { + ASSET_AND_LIABILITY: "资产负债表", + QUARTER_REPORT: "季度报表", + INCOME_DISTRIBUTION_REPORT: "收益分配表", + }, + + VOUCHER_CACHE_LIFECYCLE: 300000, + + getConfig(name, defVal) { + let config = localStorage.getItem(this.CONFIG_KEY); + if(config) + { + config = JSON.parse(config); + if(config.hasOwnProperty(name)) + return config[name]; + } + return defVal; + }, + setConfig(name, val) { + let config = localStorage.getItem(this.CONFIG_KEY); + if(!config) + config = {}; + else + config = JSON.parse(config); + config[name] = val; + localStorage.setItem(this.CONFIG_KEY, JSON.stringify(config)); + }, + makeSubjectsTree(SubjectsList, subjectTypes) { + let func = (pid) => { + let arr = null; + for(let v of SubjectsList) + { + let parentId = v.parentId || v.subjectId.substr(0, v.subjectId.length - 3) || null; + if(parentId == pid) + { + if(!arr) arr = []; + let a = func(v.subjectId); + if(a) + { + v.children = a; + v.is_last = 'N'; + } + else + v.is_last = 'Y'; + v.disabled = false; + v.label = v.subjectId + ' ' + v.subjectName; + v.label2 = v.subjectId + ' ' + v.subjectNameAll; + v.id = v.subjectId; + arr.push(v); + } + } + return arr; + }; + let res = func(null) || []; + if(!subjectTypes) + return res; + let r = []; + res.forEach((x) => { + let subjectIdStart = x.subjectId[0]; + let item = r.find((y) => y.subjectId == subjectIdStart); + if(!item) + { + let type = subjectTypes.find((y) => y.dictValue == subjectIdStart); + if(!type) + return; + item = { + id: type.dictValue, + subjectId: type.dictValue, + label: type.dictLabel, + label2: type.dictLabel, + sortFlag: type.dictSort, + is_last: 'N', + subjectName: '', + subjectNameAll: '', + children: [], + disabled: true, + }; + r.push(item); + } + item.children.push(x); + }); + r.sort((a, b) => a.dictSort - b.dictSort); + return r; + }, + makeSubjectsTree_filter(SubjectsList, subjectTypes, filterFunc) { + let func = (pid) => { + let arr = null; + for(let v of SubjectsList) + { + let parentId = v.parentId || v.subjectId.substr(0, v.subjectId.length - 3) || null; + if(parentId == pid) + { + if(!arr) arr = []; + let a = func(v.subjectId); + if(a) + { + v.children = a; + v.is_last = 'N'; + } + else + v.is_last = 'Y'; + v.label = v.subjectId + ' ' + v.subjectName; + v.label2 = v.subjectId + ' ' + v.subjectNameAll; + v.disabled = !filterFunc(v); + arr.push(v); + } + } + return arr; + }; + let filter_func = (children) => { + let res = null; + if(children) + { + let newChildren = []; + for(let v of children) + { + let b = filterFunc(v); + let arr = filter_func(v.children); + if(!arr) + delete v.children; + else + { + v.children = arr; + b = true; + } + if(b) + newChildren.push(v); + } + let r = newChildren.length > 0; + if(r) + res = newChildren; + } + return res; + }; + let res = filter_func(func(null) || []) || []; + let r = []; + res.forEach((x) => { + let subjectIdStart = x.subjectId[0]; + let item = r.find((y) => y.subjectId == subjectIdStart); + if(!item) + { + let type = subjectTypes.find((y) => y.dictValue == subjectIdStart); + if(!type) + return; + item = { + id: type.dictValue, + label: type.dictLabel, + label2: type.dictLabel, + subjectId: type.dictValue, + sortFlag: type.dictSort, + is_last: 'N', + subjectNameAll: '', + children: [], + disabled: true, + }; + r.push(item); + } + item.children.push(x); + }); + r.sort((a, b) => a.dictSort - b.dictSort); + return r; + }, + /*数字每隔3位一位小数: 0返回空白 */ + formatNum(value) { + if(value === undefined || value === null) + return ''; + if(typeof(value) === "string") + { + if(value.indexOf(',') !== -1) + return value; + value = Number(value); + if(isNaN(value)) + return ''; + } + if(value === 0) + return ''; + return numFormat(value); + }, + formatList(list) { + if(!list || !Array.isArray(list) && !list.length && arguments.length > 1) + return []; + list.forEach((x) => { + for(let i = 1; i < arguments.length; i++) + { + let k = arguments[i]; + if(!x.hasOwnProperty(k)) + continue; + x[k] = this.formatNum(x[k]); + } + }); + return list; + }, + obtainAssetSubject(str) { + if(!str) + return null; + let i = str.indexOf(":"); + if(i > 0) + return str.substring(0, i); + else if(/^\d+$/g.test(str)) + return str; + else + return null; + }, + Number(a) { + return new BigNumber(a, 10); + }, + zero() { + return new BigNumber(0, 10); + }, + add(a, b) { + if(!(a instanceof BigNumber)) + a = new BigNumber(a, 10); + if(!(b instanceof BigNumber)) + b = new BigNumber(b, 10); + return a.plus(b, 10); + }, + subtract(a, b) { + if(!(a instanceof BigNumber)) + a = new BigNumber(a, 10); + if(!(b instanceof BigNumber)) + b = new BigNumber(b, 10); + return a.minus(b, 10); + }, + neg(a) { + if(!(a instanceof BigNumber)) + a = new BigNumber(a, 10); + return a.negated(); + }, + isZero(a) { + if(!(a instanceof BigNumber)) + a = new BigNumber(a, 10); + return a.isZero(); + }, + toNumber(a) { + if(typeof(a) === 'number') + return a; + if(a instanceof BigNumber) + return a.toNumber(); + return Number(a); + }, + calcFontSizeFromTextLength(text, baseSize) { + if(!text) + return baseSize; + const N = 28; + let length = 0; + for(let i = 0; i < text.length; i++) + { + length += text.charCodeAt(i) > 127 ? 2 : 1; + } + const r = Math.round(baseSize - (Math.max(length / N, 1.0)) + 1); + //console.log(text, r); + return r; + }, +}; diff --git a/src/views/sunVillage_info/detailed_liabilities.vue b/src/views/sunVillage_info/detailed_liabilities.vue new file mode 100644 index 00000000..f7c7e6c3 --- /dev/null +++ b/src/views/sunVillage_info/detailed_liabilities.vue @@ -0,0 +1,752 @@ + + + + 资产负债表 + + + + + + + + + {{date}} + + + + + + + + + + + + + + + + + + + + + + 编制单位:{{ this.$store.getters.bookName }} + {{ accountingYear }}年{{ accountingMonth }}期 + 金额单位:元 + + + + + 资产 + 年初余额 + 期末余额 + 负债与所有者权益 + 年初余额 + 期末余额 + + + + + {{ item.subjectNameLeft }} + {{ item.ncyeLeft }} + {{ item.qmyeLeft }} + {{ item.subjectNameRight }} + {{ item.ncyeRight }} + {{ item.qmyeRight }} + + + + + + + + + + + + +
{{date}}