Compare commits
No commits in common. "3af5658a0ea4d24d32c5ac6457385a4a0aac78d2" and "9568f7b59c05d3ac17efb54dc6b595d7373aa1ea" have entirely different histories.
3af5658a0e
...
9568f7b59c
|
@ -8,11 +8,6 @@
|
|||
placeholder="请选择组织部门"
|
||||
@select="handleDeptSelect"
|
||||
/>
|
||||
<el-button-group v-if="showQuickGroup">
|
||||
<el-button v-for="child in firstChildList" :key="child.deptName" plain @click="quickSelect(child)">
|
||||
{{ child.deptName }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -20,25 +15,18 @@
|
|||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import to from "@/utils/await-to.js";
|
||||
import { listDept } from "@/api/system/dept";
|
||||
import { listDept} from "@/api/system/dept";
|
||||
|
||||
export default {
|
||||
name: "DeptTree",
|
||||
components: {
|
||||
Treeselect,
|
||||
},
|
||||
props: {
|
||||
showQuickGroup: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deptId: "",
|
||||
// 部门树数据
|
||||
deptList: [],
|
||||
firstChildList: [],
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.deptId,
|
||||
|
@ -68,14 +56,11 @@ export default {
|
|||
// this.$message.error("默认企业配置错误,请配置sys.user.defaultFactoryId");
|
||||
// }
|
||||
// },
|
||||
quickSelect(child) {
|
||||
this.deptId = child.deptId;
|
||||
this.$emit("deptChange", child);
|
||||
},
|
||||
async initDeptList() {
|
||||
const [err, response] = await to(
|
||||
listDept({
|
||||
deptName: undefined,
|
||||
|
||||
})
|
||||
);
|
||||
if (err) {
|
||||
|
@ -86,7 +71,6 @@ export default {
|
|||
if (response.code === 200) {
|
||||
this.deptList = this.handleTree(response.data, "deptId");
|
||||
this.deptId = this.deptList[0].deptId;
|
||||
this.firstChildList = this.deptList[0].children;
|
||||
this.$emit("deptChange", this.deptList[0]);
|
||||
} else {
|
||||
console.error(response);
|
||||
|
@ -101,14 +85,4 @@ export default {
|
|||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dept-tree {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
.el-button-group {
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
<template>
|
||||
<div class="create-report">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="6" style="margin-top: 10px; margin-bottom: 10px">
|
||||
<dept-tree @deptChange="handleDeptChange" :showQuickGroup="true" />
|
||||
</el-col>
|
||||
<el-col :span="6" style="margin-top: 10px; margin-bottom: 10px">
|
||||
<!-- 时间范围选择 -->
|
||||
<el-date-picker
|
||||
v-model="dateValue"
|
||||
type="monthrange"
|
||||
format="yyyy-MM"
|
||||
value-format="yyyy-MM"
|
||||
start-placeholder="开始月份"
|
||||
end-placeholder="结束月份"
|
||||
@change="handleDateChange"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DeptTree from "@/components/DeptTree/index.vue";
|
||||
export default {
|
||||
name: "CreateReport",
|
||||
components: {
|
||||
DeptTree,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deptId: "",
|
||||
dateValue: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initDate();
|
||||
},
|
||||
methods: {
|
||||
handleDeptChange(value) {
|
||||
this.deptId = value.deptId;
|
||||
console.log(value);
|
||||
},
|
||||
handleDateChange(value) {
|
||||
console.log(value);
|
||||
},
|
||||
initDate() {
|
||||
const date = new Date();
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
this.dateValue = [`${year}-${month}`, `${year}-${month}`];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.create-report {
|
||||
min-height: 50vh;
|
||||
}
|
||||
</style>
|
|
@ -1,23 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<h2>DataDetail</h2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DataDetail',
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -1,23 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<h2>DataOverview</h2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DataOverview',
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -1,59 +0,0 @@
|
|||
<template>
|
||||
<div class="month-data">
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
||||
<el-tab-pane
|
||||
v-for="tab in tabs"
|
||||
:key="tab.cpn"
|
||||
:label="tab.label"
|
||||
:name="tab.cpn"
|
||||
>
|
||||
<component :is="tab.cpn" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CreateReport from "./create-report.vue";
|
||||
import DataOverview from "./data-overview.vue";
|
||||
import DataDetail from "./data-detail.vue";
|
||||
export default {
|
||||
name: "MonthData",
|
||||
components: {
|
||||
CreateReport,
|
||||
DataOverview,
|
||||
DataDetail,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeTab: "CreateReport",
|
||||
tabs: [
|
||||
{
|
||||
label: "报表生成",
|
||||
cpn: "CreateReport",
|
||||
},
|
||||
{
|
||||
label: "数据总览",
|
||||
cpn: "DataOverview",
|
||||
},
|
||||
{
|
||||
label: "数据详情",
|
||||
cpn: "DataDetail",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
handleTabClick(tab) {
|
||||
this.activeTab = tab.name;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.month-data {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
</style>
|
|
@ -1,21 +1,24 @@
|
|||
<template>
|
||||
<div class="data-monitor">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="10" style="margin-top: 10px; margin-bottom: 10px">
|
||||
<dept-tree @deptChange="handleDeptChange" :showQuickGroup="true" />
|
||||
<el-col :span="6" style="margin-top: 10px; margin-bottom: 10px">
|
||||
<dept-tree @deptChange="handleDeptChange" />
|
||||
</el-col>
|
||||
<el-col :span="6" style="margin-top: 10px; margin-bottom: 10px">
|
||||
<!-- 时间范围选择 -->
|
||||
<el-date-picker
|
||||
v-model="dateValue"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="handleDateChange"
|
||||
>
|
||||
<el-date-picker v-model="dateValue" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']" @change="handleDateChange">
|
||||
</el-date-picker>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-radio-group v-model="deptId" @change="handleRadioDeptChange">
|
||||
<el-radio-button :label="229">青岛港</el-radio-button>
|
||||
<el-radio-button :label="230">日照港</el-radio-button>
|
||||
<el-radio-button :label="231">烟台港</el-radio-button>
|
||||
<el-radio-button :label="232">渤海湾港</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -33,6 +36,13 @@ export default {
|
|||
// chooseDept:null,
|
||||
deptId: "",
|
||||
dateValue: [],
|
||||
normalizer(node) {
|
||||
return {
|
||||
id: node.deptId,
|
||||
label: node.deptName,
|
||||
children: node.children,
|
||||
};
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -54,7 +64,7 @@ export default {
|
|||
];
|
||||
},
|
||||
handleRadioDeptChange(value) {
|
||||
this.deptId = value;
|
||||
this.deptId = value
|
||||
this.emitChange();
|
||||
},
|
||||
handleDeptChange(value) {
|
||||
|
|
Loading…
Reference in New Issue