|
|
@@ -155,6 +155,8 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
// 总列数
|
|
|
+import DutyApi from '@/api/duty'
|
|
|
+import itemDetailApi from '@/api/sysadmin/itemdetail'
|
|
|
const columnNum = 9
|
|
|
// 固定列数
|
|
|
const fixRowHeadNum = 2
|
|
|
@@ -170,8 +172,6 @@ const columnProperty = [
|
|
|
'Saturday',
|
|
|
'Sunday'
|
|
|
]
|
|
|
-import DutyApi from '@/api/duty'
|
|
|
-import itemDetailApi from '@/api/sysadmin/itemdetail'
|
|
|
export default {
|
|
|
name: 'dutyEdit',
|
|
|
data () {
|
|
|
@@ -187,7 +187,7 @@ export default {
|
|
|
dutyDetail: {
|
|
|
Id: -1,
|
|
|
Year: -1,
|
|
|
- Term: -1,
|
|
|
+ Term: -1
|
|
|
},
|
|
|
year: '',
|
|
|
years: [],
|
|
|
@@ -200,9 +200,7 @@ export default {
|
|
|
list: []
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
- this.init()
|
|
|
- },
|
|
|
+
|
|
|
mounted () {
|
|
|
this.getLocal()
|
|
|
this.getPeople()
|
|
|
@@ -214,6 +212,22 @@ export default {
|
|
|
this.getDetailData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 初始化单选框
|
|
|
+ selectCheckBox () {
|
|
|
+ let selectLocal = new Map()
|
|
|
+ let selectTime = new Map()
|
|
|
+
|
|
|
+ for (var i = 0; i < this.list.length; i++) {
|
|
|
+ if (selectLocal.get(this.list[i].Local + '') !== true) {
|
|
|
+ this.selectLocal.push(this.list[i].Local + '')
|
|
|
+ }
|
|
|
+ if (selectTime.get(this.list[i].Time + '') !== true) {
|
|
|
+ this.selectTime.push(this.list[i].Time + '')
|
|
|
+ }
|
|
|
+ selectLocal.set(this.list[i].Local + '', true)
|
|
|
+ selectTime.set(this.list[i].Time + '', true)
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取值班子表表格
|
|
|
getDetailData () {
|
|
|
let _this = this
|
|
|
@@ -222,8 +236,8 @@ export default {
|
|
|
}).then(res => {
|
|
|
if (res.length > 0) {
|
|
|
_this.list = res
|
|
|
+ _this.selectCheckBox()
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
// 新增表格
|
|
|
@@ -270,7 +284,7 @@ export default {
|
|
|
},
|
|
|
// 删除一行
|
|
|
deleteRow (index, rows) {
|
|
|
- rows.splice(index, 1);
|
|
|
+ rows.splice(index, 1)
|
|
|
},
|
|
|
// 获取字典表地点
|
|
|
getLocal () {
|
|
|
@@ -309,19 +323,7 @@ export default {
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- // 获取本年年份
|
|
|
- init () {
|
|
|
- var myDate = new Date()
|
|
|
- var year = myDate.getFullYear()// 获取当前年
|
|
|
- this.initSelectYear(year)
|
|
|
- },
|
|
|
- // 循环遍历年份
|
|
|
- initSelectYear (year) {
|
|
|
- this.years = []
|
|
|
- for (let i = 0; i < 5; i++) {
|
|
|
- this.years.push({ value: (year - i), label: (year - i) + '年' })
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
// 单元格、行选中
|
|
|
cellclick (row, column, cell, event) {
|
|
|
// 第3列开始可以选中
|
|
|
@@ -411,7 +413,6 @@ export default {
|
|
|
_this.termList.forEach(function (value, key) {
|
|
|
if (_this.dutyDetail.Term == value.ItemValue) {
|
|
|
_this.termName = value.ItemName
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -423,14 +424,15 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return label
|
|
|
-
|
|
|
- }, formatLocal (row, column, cellValue, index) {
|
|
|
+ },
|
|
|
+ formatLocal (row, column, cellValue, index) {
|
|
|
for (var i = 0; i < this.LocalList.length; i++) {
|
|
|
if (this.LocalList[i].ItemValue == cellValue) {
|
|
|
return this.LocalList[i].ItemName
|
|
|
}
|
|
|
}
|
|
|
- }, formatTime (row, column, cellValue, index) {
|
|
|
+ },
|
|
|
+ formatTime (row, column, cellValue, index) {
|
|
|
for (var i = 0; i < this.TimeList.length; i++) {
|
|
|
if (this.TimeList[i].ItemValue == cellValue) {
|
|
|
return this.TimeList[i].ItemName
|
|
|
@@ -439,7 +441,7 @@ export default {
|
|
|
},
|
|
|
// 关闭当前页
|
|
|
closeWindow () {
|
|
|
- window.location.href = "./#/duty";
|
|
|
+ window.location.href = './#/duty'
|
|
|
}
|
|
|
}
|
|
|
}
|