From a87c690293279fd83448109421a3cd6fc72db9bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B2=88=E6=98=AD=E6=9C=9D?= <18394339404@163.com>
Date: Thu, 20 Jun 2024 19:07:40 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8A=80=E8=83=BD=E5=8C=B9=E9=85=8D?=
=?UTF-8?q?=E3=80=81=E5=B7=A5=E7=A8=8B=E5=B8=88=E7=8A=B6=E6=80=81=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/select.js | 3 +
src/router/index.js | 30 ++--
src/views/record/index.vue | 251 +++++++++++++++++++++++-----
src/views/skill/datamatch/index.vue | 147 +++++++++++++++-
vue.config.js | 2 +-
5 files changed, 366 insertions(+), 67 deletions(-)
diff --git a/src/api/select.js b/src/api/select.js
index f5e9a84..a2c73b6 100644
--- a/src/api/select.js
+++ b/src/api/select.js
@@ -3,6 +3,9 @@ import request from '@/utils/request'
// 获取部门列表
export const reqGetDepartments = () => request({ url: `/WRD-admin/sys/dept/list`, method: 'get' })
+// 获取部门列表
+export const reqGetRegionAndCity = () => request({ url: `/WRD-admin/sys/user/ReignAndCity`, method: 'get' })
+
// 不带部门
// export const reqSelectEngiStatus = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/page`, method: 'get', params: { year, month, page, limit } });
diff --git a/src/router/index.js b/src/router/index.js
index cba01b5..c63f910 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -56,22 +56,22 @@ export const constantRoutes = [
tag: '导航页面',
component: () => import('@/views/nav/nav2.vue'),
hidden: true
- },
- {
- path: '/history',
- component: Layout,
- name: 'History',
- redirect: '/history/orderHist',
- tag: '预约历史查询',
- backgroundImage: require('@/assets/siemens/task.jpg'),
- description: '查看已预约历史',
- children: [{
- path: 'orderHist',
- name: 'OrderHist',
- component: () => import('@/views/orderHist'),
- meta: { title: '预约单查询', icon: 'el-icon-s-custom' }
- }]
}
+ // {
+ // path: '/history',
+ // component: Layout,
+ // name: 'History',
+ // redirect: '/history/orderHist',
+ // tag: '预约历史查询',
+ // backgroundImage: require('@/assets/siemens/task.jpg'),
+ // description: '查看已预约历史',
+ // children: [{
+ // path: 'orderHist',
+ // name: 'OrderHist',
+ // component: () => import('@/views/orderHist'),
+ // meta: { title: '预约单查询', icon: 'el-icon-s-custom' }
+ // }]
+ // }
]
export const asyncRoutes = [
diff --git a/src/views/record/index.vue b/src/views/record/index.vue
index 5dbbf3c..7f90e86 100644
--- a/src/views/record/index.vue
+++ b/src/views/record/index.vue
@@ -10,11 +10,61 @@
-
-
+
+
+
+
-
- {{ year }}年
- {{ month }}月
-
{ return { value: item.region, label: item.region } })
},
// 初始化部门选项为不限
created() {
@@ -977,7 +1048,9 @@ export default {
}
},
intArray() {
- return Object.keys(this.skillSearchList).length === 0 ? [] : this.skillSearchList.map(subArray => parseInt(subArray[1], 10))
+ // 排除空数组元素
+ return Object.keys(this.selected).length === 0 ? [] : this.selected.filter(subArray => subArray.length > 0).map(subArray => parseInt(subArray[0], 10))
+ // return Object.keys(this.skillSearchList).length === 0 ? [] : this.skillSearchList.map(subArray => parseInt(subArray[1], 10))
},
computRulesOfAddWordRecord() {
this.updateRulesBasedOnRole()
@@ -1059,22 +1132,39 @@ export default {
const { page, limit } = this
return index + 1 + (page - 1) * limit
},
-
+ handleRegion(region) {
+ const data = this.regionAndCityList.filter(item => item.region === region)
+ this.cityList = data[0].cities.split(',')
+ this.city = ''
+ console.log(this.cityList)
+ },
async getTableData(year = this.year, month = this.month) {
this.loading = true
- this.handleMonthLastDay()
+ // 确保handleMonthLastDay和dayScreen都完成
+ await Promise.all([
+ this.handleMonthLastDay(),
+ this.dayScreen()
+ ])
- this.dayScreen()
const { page, limit } = this
// 获取全部Engineer/Duty员工列表
- const resOfAllEngis = await this.$API.user.reqGetUserPageWithSkills(page, limit)// select.reqSelectAllEngis(page, limit)
- console.log(resOfAllEngis)
+ var queryInfo = {
+ page: this.page,
+ limit: this.limit,
+ deptId: this.department
+ }
+ const resOfAllEngis = await this.$API.user.reqGetUserPageWithSkills(queryInfo)// select.reqSelectAllEngis(page, limit)
+ // console.log(resOfAllEngis)
if (resOfAllEngis.code === 0) {
- for (var i in resOfAllEngis.data.list) {
- this.$set(resOfAllEngis.data.list[i], 'workRecordsList', [])
- }
- this.engiArray = resOfAllEngis.data.list
+ // for (var i in resOfAllEngis.data.list) {
+ // this.$set(resOfAllEngis.data.list[i], 'workRecordsList', [])
+ // }
+ // this.engiArray = resOfAllEngis.data.list
+ this.engiArray = resOfAllEngis.data.list.map(engi => ({
+ ...engi,
+ workRecordsList: []
+ }))
this.total = resOfAllEngis.data.total
}
@@ -1086,23 +1176,31 @@ export default {
limit
)
if (resOfSelectEngiStatusByMap.code === 0) {
- var EngiStatusMap = resOfSelectEngiStatusByMap.data
+ // var EngiStatusMap = resOfSelectEngiStatusByMap.data
+ // for (const i in EngiStatusMap) {
+ // for (var j in this.engiArray) {
+ // if (i === this.engiArray[j].gid) {
+ // for (var k in EngiStatusMap[i]) {
+ // this.engiArray[j].workRecordsList.push(EngiStatusMap[i][k])
+ // }
+ // }
+ // }
+ // }
+ const EngiStatusMap = resOfSelectEngiStatusByMap.data
for (const i in EngiStatusMap) {
- for (var j in this.engiArray) {
+ for (let j = 0; j < this.engiArray.length; j++) {
if (i === this.engiArray[j].gid) {
- for (var k in EngiStatusMap[i]) {
- this.engiArray[j].workRecordsList.push(EngiStatusMap[i][k])
- }
+ this.engiArray[j].workRecordsList = EngiStatusMap[i]
}
}
}
}
- this.$nextTick(() => {
- // this.departmentId = this.deptId;
- // this.getTableDataByDept(year, month);
- })
this.$nextTick(() => {
this.$refs.statusTable.doLayout()
+ // 渲染数据到表格
+ if (this.$refs.statusTable) {
+ this.$refs.statusTable.data = this.engiArray
+ }
})
this.loading = false
},
@@ -1121,7 +1219,9 @@ export default {
page: this.page,
limit: this.limit,
deptId: this.departmentId,
- skillIdList: this.intArray.join(',')
+ skillIdList: this.intArray.join(','),
+ reign: this.region.trim(),
+ city: this.city.trim()
}
const resultOfSelectEngisByDept =
await this.$API.user.reqGetUserPageWithSkills(queryInfo)// select.reqSelectEngisByDept(page, limit, departmentId)
@@ -1235,7 +1335,9 @@ export default {
this.month = 12
this.year--
}
- this.getTableDataByDept()
+ this.$nextTick(() => {
+ this.getTableDataByDept()
+ })
},
// 下个月按钮回调
nextmonth() {
@@ -1244,7 +1346,9 @@ export default {
this.month = 1
this.year++
}
- this.getTableDataByDept()
+ this.$nextTick(() => {
+ this.getTableDataByDept()
+ })
},
// 处理二月最后一天
@@ -1971,6 +2075,25 @@ export default {
}
}
return targetFormat
+ },
+ // 将原始数据转换为下拉框数据
+ convertToDropdownFormat(sourceData) {
+ const dropdownData = []
+
+ for (const category in sourceData) {
+ if (Object.prototype.hasOwnProperty.call(sourceData, category)) {
+ const categoryData = {
+ categoryName: category,
+ options: sourceData[category].map(item => ({
+ id: item.id,
+ name: item.name
+ }))
+ }
+ dropdownData.push(categoryData)
+ }
+ }
+
+ return dropdownData
}
},
watch: {
@@ -2042,14 +2165,56 @@ export default {
.change-month-button-group {
display: flex;
// text-align: right;
- margin-bottom: 10px;
+ // margin-bottom: 10px;
justify-content: space-between;
position: relative;
+
+ .header-buttons {
+ display: flex;
+ padding: 20px 0 0 0;
+ margin: 0 0 10px 0;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 浅灰色阴影 */
+
+ //下拉框
+ .el-select{
+ // padding-left: 10px;
+ }
+ ::v-deep .el-input__inner{
+ // border: none;
+ }
+ }
}
-.year-month-span {
- position: relative;
- margin-bottom: 10px;
+.el-form {
+ display: flex;
+ flex-wrap: nowrap; /* 防止下拉框换行 */
+ }
+
+ .el-form-item {
+ // margin-right: 10px; /* 为每个下拉框添加一些间距 */
+ margin-left: 20px;
+ }
+
+ /* 如果需要,可以添加媒体查询来调整响应式布局 */
+ @media (max-width: 600px) {
+ .el-form-item {
+ flex-direction: column;
+ }
+ }
+.table-header{
+ display: flex;
+ justify-content: space-between;
+
+ .year-month-span {
+ position: relative;
+ display: flex;
+ align-items: center;
+ margin-bottom: 10px;
+ }
+
+ .el-button-group {
+ margin-bottom: 10px;
+ }
}
.status-desc-group {
@@ -2127,7 +2292,7 @@ export default {
}
::v-deep .el-tag.el-tag--info {
- margin-top: 10px;
+ // margin-top: 10px;
}
::v-deep .el-cascader__search-input{
diff --git a/src/views/skill/datamatch/index.vue b/src/views/skill/datamatch/index.vue
index 534f292..d4a5f98 100644
--- a/src/views/skill/datamatch/index.vue
+++ b/src/views/skill/datamatch/index.vue
@@ -1,9 +1,27 @@
-
-