|
@@ -44,9 +44,10 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <template slot="rqSearch">
|
|
|
|
|
|
|
+ <template slot="recordDateSearch">
|
|
|
|
|
+ <span>日期:</span>
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
- v-model="params.rq"
|
|
|
|
|
|
|
+ v-model="params.recordDate"
|
|
|
type="daterange"
|
|
type="daterange"
|
|
|
range-separator="至"
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
@@ -58,7 +59,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template slot="xmIdForm">
|
|
<template slot="xmIdForm">
|
|
|
- <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }" @change="handleProjectChange"></project-select>
|
|
|
|
|
|
|
+ <project-select placeholder="请选择项目名称" v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }"></project-select>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
</avue-crud>
|
|
</avue-crud>
|
|
@@ -129,30 +130,52 @@ export default window.$crudCommon({
|
|
|
this.getSubjectList();
|
|
this.getSubjectList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- loadData() {},
|
|
|
|
|
|
|
+ loopData(data, level) {
|
|
|
|
|
+ level++;
|
|
|
|
|
+ return data.map(item => {
|
|
|
|
|
+ item.level = level;
|
|
|
|
|
+ item.disabled = level === 4 ? false : true;
|
|
|
|
|
+
|
|
|
|
|
+ if (item.children && item.children.length) {
|
|
|
|
|
+ this.loopData(item.children, level);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
getSubjectList() {
|
|
getSubjectList() {
|
|
|
- getSubjectTreeList({ code: '53010108' }).then(res => {
|
|
|
|
|
|
|
+ getSubjectTreeList().then(res => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
|
- const data = res.data.data || [];
|
|
|
|
|
- const column = this.findObject(this.option.column, "fynr");
|
|
|
|
|
- column.dicData = data.length ? data[0].children : [];
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const column = this.findObject(this.option.column, "subjectId");
|
|
|
|
|
+ column.dicData = this.loopData(JSON.parse(JSON.stringify(res.data.data)), 0);
|
|
|
|
|
+ this.treeData = column.dicData;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ getSearchParams() {
|
|
|
|
|
+ let params = { ...this.params };
|
|
|
|
|
+ if (params.recordDate && params.recordDate.length) {
|
|
|
|
|
+ params.recordDateMin = params.recordDate[0];
|
|
|
|
|
+ params.recordDateMax = params.recordDate[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ delete params.recordDate;
|
|
|
|
|
+ return params;
|
|
|
|
|
+ },
|
|
|
getFormData() {
|
|
getFormData() {
|
|
|
return { ...this.form, yearAndMonth: this.params.yearAndMonth };
|
|
return { ...this.form, yearAndMonth: this.params.yearAndMonth };
|
|
|
},
|
|
},
|
|
|
handleImport() {
|
|
handleImport() {
|
|
|
let excelParams = { yearAndMonth: this.params.yearAndMonth };
|
|
let excelParams = { yearAndMonth: this.params.yearAndMonth };
|
|
|
- this.$refs.uploadExcelDialog.open('/api/kd-scientific/other-cost/import', excelParams);
|
|
|
|
|
|
|
+ this.$refs.uploadExcelDialog.open('/api/kd-scientific/xm/other-cost/import', excelParams);
|
|
|
},
|
|
},
|
|
|
uploadAfter() {
|
|
uploadAfter() {
|
|
|
this.page.currentPage = 1;
|
|
this.page.currentPage = 1;
|
|
|
this.getList(this.page);
|
|
this.getList(this.page);
|
|
|
},
|
|
},
|
|
|
handleExport() {
|
|
handleExport() {
|
|
|
- exportBlob(`/api/kd-scientific/other-cost/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
|
|
|
|
+ exportBlob(`/api/kd-scientific/xm/other-cost/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
|
|
|
downloadXls(res.data, `${this.params.yearAndMonth}其他费用-基本信息台账.xlsx`);
|
|
downloadXls(res.data, `${this.params.yearAndMonth}其他费用-基本信息台账.xlsx`);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -167,6 +190,41 @@ export default window.$crudCommon({
|
|
|
this.$refs.printWideTable.printTable(isLandscape);
|
|
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);
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...this.form,
|
|
|
|
|
+ subjectName: `${parentNames.join('\\')}\\${this.form.$subjectId}`,
|
|
|
|
|
+ costType: '其他费用',
|
|
|
|
|
+ yearAndMonth: this.params.yearAndMonth,
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
}, {
|
|
}, {
|
|
|
// 模块路径
|
|
// 模块路径
|