From 7fb0a8f0ab16c149484bf043754cd10cfa94de2f Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期一, 19 一月 2026 14:48:05 +0800
Subject: [PATCH] 增加了业务员,保管员和验收员的对应的显示
---
src/views/component/gyDuty/index.vue | 126 ++++++++++++++++++++++++++++-------------
1 files changed, 86 insertions(+), 40 deletions(-)
diff --git a/src/views/component/gyDuty/index.vue b/src/views/component/gyDuty/index.vue
index 299ae42..4cd3c04 100644
--- a/src/views/component/gyDuty/index.vue
+++ b/src/views/component/gyDuty/index.vue
@@ -1,41 +1,62 @@
<template>
- <div style="padding: 10px">
- <el-table
- v-loading="loading"
- :data="tableData"
- ref="workTypeTable"
- max-height="550"
- @selection-change="handleSelectionChange"
- show-summary
- border
- @row-click="handleRowClick"
- :row-style="rowStyle"
- @cell-dblclick="handleDblclick"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column align="center" label="sorderid" type="index" sortable width="80" />
- <el-table-column
- align="center"
- v-for="(item, index) in tableColumns"
- :key="index"
- :prop="item.ColmCols"
- :label="item.ColmCols"
- :width="flexWidth(item.ColmCols, tableData, item.ColmCols)"
- sortable
- >
- <template slot-scope="{ row, column }">
- <span>{{ row[column.label] }}</span>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="page"
- :limit.sync="pageSize"
- @pagination="currentPage"
- />
- </div>
+ <el-row>
+ <el-col :span="4">
+ <div style="padding: 10px">
+ <el-tree
+ :data="treeData"
+ :props="treeProps"
+ accordion
+ @node-click="handleNodeClick"
+ >
+ </el-tree>
+ </div>
+ </el-col>
+ <el-col :span="20">
+ <div style="padding: 10px">
+ <el-table
+ v-loading="loading"
+ :data="tableData"
+ ref="workTypeTable"
+ max-height="550"
+ @selection-change="handleSelectionChange"
+ show-summary
+ border
+ @row-click="handleRowClick"
+ :row-style="rowStyle"
+ @cell-dblclick="handleDblclick"
+ >
+ <el-table-column type="selection" width="55" align="center" />
+ <el-table-column
+ align="center"
+ label="sorderid"
+ type="index"
+ sortable
+ width="80"
+ />
+ <el-table-column
+ align="center"
+ v-for="(item, index) in tableColumns"
+ :key="index"
+ :prop="item.ColmCols"
+ :label="item.ColmCols"
+ :width="flexWidth(item.ColmCols, tableData, item.ColmCols)"
+ sortable
+ >
+ <template slot-scope="{ row, column }">
+ <span>{{ row[column.label] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ :page.sync="page"
+ :limit.sync="pageSize"
+ @pagination="currentPage"
+ />
+ </div>
+ </el-col>
+ </el-row>
</template>
<script>
@@ -130,9 +151,13 @@
ColmType: "VARCHAR",
},
],
+
+ treeData: [], // 鏍戠姸鍥炬暟鎹�
+ treeProps: {}, // 鏍戠姸鍥惧睘鎬�
};
},
- created() {
+ async created() {
+ await this.getTreeList();
this.getList();
},
props: {
@@ -142,12 +167,33 @@
},
},
methods: {
- // 宸ョ
+ // 鏍戠姸鍥捐妭鐐圭偣鍑讳簨浠�
+ handleNodeClick(e) {
+ console.log(e)
+ this.form.userId = e.id
+ this.getList()
+ },
+ // 鑾峰彇鏍戠姸鍥剧粨鏋�
+ async getTreeList() {
+ this.treeData = []
+ let res = await axios.get(this.$baseUrl + "/Gy_DutyBill/Gy_DutyBillTreeList");
+ console.log(res.data.data);
+ this.treeData = [...JSON.parse(res.data.data)];
+ Object.assign(this.treeProps, {
+ children: "children",
+ label: 'title',
+ key: 'id'
+ })
+ },
+ // 鑱屽姟
getList() {
let sWhere = "";
this.loading = true;
+ if(this.form.userId){
+ sWhere += " and 缁勭粐鏋舵瀯浠g爜 like'" + this.form.userId + "%' ";
+ }
axios
- .get(this.baseURL + "/Gy_DutyBill/Gy_DutyBillList", {
+ .get(this.$baseUrl + "/Gy_DutyBill/Gy_DutyBillList", {
params: { sWhere: sWhere, user: this.user },
})
.then((response) => {
--
Gitblit v1.9.1