Selaa lähdekoodia

值班管理子查询功能

dbcgit 5 vuotta sitten
vanhempi
commit
cdadc64c11

+ 1 - 1
backend/src/dashoo.cn/modi_webapi/app/service/duty/detail.go

@@ -89,7 +89,7 @@ func (s DetailService) Save(Id int, param *detail.UpdDateReq) (*detail.Entity, e
 
 // 批量添加
 func (s DetailService) Adds(param *detail.ListEntity) (id int64, err error) {
-	result, err := s.SafeModel.Insert(param.DataList)
+	result, err := s.SafeModel.Save(param.DataList)
 	if err != nil {
 		return 0, err
 	} else {

+ 8 - 5
frontend_web/src/views/duty/detail/index.vue

@@ -206,9 +206,12 @@ export default {
     getDetailData () {
       let _this = this
       DutyApi.getDetailByDutyId({
-        Id: _this.dutyDetail.Id
+        DutyId: _this.dutyDetail.Id
       }).then(res => {
-        _this.list = res
+        if (res.length > 0) {
+          _this.list = res
+        }
+
       })
     },
     // 新增表格
@@ -387,7 +390,7 @@ export default {
     formatPerson (row, column, cellValue, index) {
       let label = '休息'
       for (var i = 0; i < this.PeopleList.length; i++) {
-        if (this.PeopleList[i].ItemValue === cellValue) {
+        if (this.PeopleList[i].ItemValue == cellValue) {
           return this.PeopleList[i].ItemName
         }
       }
@@ -395,13 +398,13 @@ export default {
 
     }, formatLocal (row, column, cellValue, index) {
       for (var i = 0; i < this.LocalList.length; i++) {
-        if (this.LocalList[i].ItemValue === cellValue) {
+        if (this.LocalList[i].ItemValue == cellValue) {
           return this.LocalList[i].ItemName
         }
       }
     }, formatTime (row, column, cellValue, index) {
       for (var i = 0; i < this.TimeList.length; i++) {
-        if (this.TimeList[i].ItemValue === cellValue) {
+        if (this.TimeList[i].ItemValue == cellValue) {
           return this.TimeList[i].ItemName
         }
       }