|
|
@@ -48,12 +48,12 @@
|
|
|
<project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
|
|
|
</template>
|
|
|
|
|
|
- <template slot="jeSearch">
|
|
|
+ <template slot="amountSearch">
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
<span>金额(元):</span>
|
|
|
- <avue-input-number v-model="params.jeMin" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ <avue-input-number v-model="params.amountMin" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
<span style="width: 20px; text-align: center;">至</span>
|
|
|
- <avue-input-number v-model="params.jeMax" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
+ <avue-input-number v-model="params.amountMax" :min="0" style="width: 90px !important;"></avue-input-number>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -95,6 +95,7 @@ export default window.$crudCommon({
|
|
|
yearAndMonth: moment(new Date()).format('YYYYMM'),
|
|
|
},
|
|
|
isSelAnnual: false,
|
|
|
+ treeData: [],
|
|
|
|
|
|
wideTableColumns: [],
|
|
|
printTitle: "",
|
|
|
@@ -125,12 +126,11 @@ export default window.$crudCommon({
|
|
|
this.getSubjectList();
|
|
|
},
|
|
|
methods: {
|
|
|
- loadData() {},
|
|
|
loopData(data, level) {
|
|
|
level++;
|
|
|
return data.map(item => {
|
|
|
item.level = level;
|
|
|
- // item.disabled = level === 4 ? false : true;
|
|
|
+ item.disabled = level === 4 ? false : true;
|
|
|
|
|
|
if (item.children && item.children.length) {
|
|
|
this.loopData(item.children, level);
|
|
|
@@ -146,22 +146,20 @@ export default window.$crudCommon({
|
|
|
|
|
|
const column = this.findObject(this.option.column, "subjectId");
|
|
|
column.dicData = this.loopData(JSON.parse(JSON.stringify(res.data.data)), 0);
|
|
|
+ this.treeData = column.dicData;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getFormData() {
|
|
|
- return { ...this.form, yearAndMonth: this.params.yearAndMonth };
|
|
|
- },
|
|
|
handleImport() {
|
|
|
let excelParams = { yearAndMonth: this.params.yearAndMonth };
|
|
|
- this.$refs.uploadExcelDialog.open('', excelParams);
|
|
|
+ this.$refs.uploadExcelDialog.open('/api/kd-scientific/xm/cost/details/import', excelParams);
|
|
|
},
|
|
|
uploadAfter() {
|
|
|
this.page.currentPage = 1;
|
|
|
this.getList(this.page);
|
|
|
},
|
|
|
handleExport() {
|
|
|
- exportBlob(`/api/kd-scientific//export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
+ exportBlob(`/api/kd-scientific/xm/cost/details/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
downloadXls(res.data, `${this.params.yearAndMonth}企业研发费用支出明细账.xlsx`);
|
|
|
});
|
|
|
},
|
|
|
@@ -176,6 +174,42 @@ export default window.$crudCommon({
|
|
|
this.$refs.printWideTable.printTable(isLandscape);
|
|
|
})
|
|
|
},
|
|
|
+ findParentNames(categories, childId, parentNames = []) {
|
|
|
+ const child = categories.find(cat => cat.id == childId);
|
|
|
+
|
|
|
+ if (!child || !child.parentId) {
|
|
|
+ return parentNames;
|
|
|
+ }
|
|
|
+
|
|
|
+ const parent = categories.find(cat => cat.id == child.parentId);
|
|
|
+ if (parent) {
|
|
|
+ parentNames.unshift(parent.name); // 添加到数组开头保持顺序
|
|
|
+ return this.findParentNames(categories, parent.id, parentNames);
|
|
|
+ }
|
|
|
+
|
|
|
+ return parentNames;
|
|
|
+ },
|
|
|
+ getFormData() {
|
|
|
+ let newList = [];
|
|
|
+ const getAllList = data => {
|
|
|
+ data.forEach(element => {
|
|
|
+ newList.push(element);
|
|
|
+ if (element.children && element.children.length) {
|
|
|
+ getAllList(element.children)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ getAllList(this.treeData);
|
|
|
+ let parentNames = this.findParentNames(newList, this.form.subjectId);
|
|
|
+ let currSubjectObj = newList.find(item => item.id == this.form.subjectId);
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...this.form,
|
|
|
+ subjectName: `${parentNames.join('\\')}\\${this.form.$subjectId}`,
|
|
|
+ yearAndMonth: this.params.yearAndMonth,
|
|
|
+ subjectCode: currSubjectObj ? currSubjectObj.code : ''
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
}, {
|
|
|
// 模块路径
|