Quellcode durchsuchen

增加病人、设备、员工批量删除功能

wennn vor 3 Jahren
Ursprung
Commit
01e94c5050

+ 20 - 2
src/views/customer/components/customerManager.vue

@@ -23,6 +23,7 @@
         </div>
         </div>
         <div class="toolbar-btns">
         <div class="toolbar-btns">
           <el-button v-if="part_view" type="primary" size="mini" :disabled="!isEmptyFrame" @click="handleAdd">入住登记</el-button>
           <el-button v-if="part_view" type="primary" size="mini" :disabled="!isEmptyFrame" @click="handleAdd">入住登记</el-button>
+          <el-button v-if="part_view" type="danger" size="mini" @click="batchDelete">批量删除</el-button>
         </div>
         </div>
       </div>
       </div>
       <el-pagination
       <el-pagination
@@ -818,7 +819,6 @@ export default {
     /** 加载列表数据 */
     /** 加载列表数据 */
     getList() {
     getList() {
       const param = this.MixinClone(this.params)
       const param = this.MixinClone(this.params)
-      console.log('this.params = ' + this.params.fixedCondition)
       this.gridApi.showLoadingOverlay()
       this.gridApi.showLoadingOverlay()
       API_Customer.getList(param).then(response => {
       API_Customer.getList(param).then(response => {
         this.rowData = [...response.data]
         this.rowData = [...response.data]
@@ -1147,7 +1147,6 @@ export default {
       this.remarkParams.fixedCondition = 'part_id=' + this.$store.getters.partId + ' and type=1 and member_id =' + this.formmodel.member_id
       this.remarkParams.fixedCondition = 'part_id=' + this.$store.getters.partId + ' and type=1 and member_id =' + this.formmodel.member_id
       API_Remark.getRemarks(this.remarkParams).then(res => {
       API_Remark.getRemarks(this.remarkParams).then(res => {
         this.remarks = [...res.data]
         this.remarks = [...res.data]
-        console.log('remarks', this.remarks)
       })
       })
     },
     },
     /** 添加备注 */
     /** 添加备注 */
@@ -1267,6 +1266,25 @@ export default {
       }).catch(() => {
       }).catch(() => {
 
 
       })
       })
+    },
+    /** 批量数据删除处理(删除选中的行) */
+    batchDelete: function() {
+      const rows = this.gridApi.getSelectedRows()
+      if (rows.length === 0) {
+        this.$message({ type: 'info', message: '请先勾选需要删除的数据' })
+        return
+      }
+      const ids = []
+      const uids = []
+      rows.forEach(function(item) {
+        ids.push(item.id)
+        uids.push(item.member_id)
+      })
+      this.handlerDelete(ids.join(','))
+      this.deleteMembers(uids) // 同时删除用户
+    },
+    async deleteMembers(ids) {
+      API_User.remove(ids)
     }
     }
   }
   }
 }
 }

+ 20 - 1
src/views/hospital/ncs_customer/customerManager.vue

@@ -23,6 +23,7 @@
         </div>
         </div>
         <div class="toolbar-btns">
         <div class="toolbar-btns">
           <el-button type="primary" size="mini" :disabled="!isEmptyFrame" @click="handleAdd">入住登记</el-button>
           <el-button type="primary" size="mini" :disabled="!isEmptyFrame" @click="handleAdd">入住登记</el-button>
+          <el-button v-if="part_view" type="danger" size="mini" @click="batchDelete">批量删除</el-button>
         </div>
         </div>
       </div>
       </div>
       <el-pagination
       <el-pagination
@@ -1134,7 +1135,6 @@ export default {
       this.remarkParams.fixedCondition = 'part_id=' + this.formmodel.part_id + ' and type=1 and member_id =' + this.formmodel.member_id
       this.remarkParams.fixedCondition = 'part_id=' + this.formmodel.part_id + ' and type=1 and member_id =' + this.formmodel.member_id
       API_Remark.getRemarks(this.remarkParams).then(res => {
       API_Remark.getRemarks(this.remarkParams).then(res => {
         this.remarks = [...res.data]
         this.remarks = [...res.data]
-        console.log('remarks', this.remarks)
       })
       })
     },
     },
     /** 添加备注 */
     /** 添加备注 */
@@ -1254,6 +1254,25 @@ export default {
       }).catch(() => {
       }).catch(() => {
 
 
       })
       })
+    },
+    /** 批量数据删除处理(删除选中的行) */
+    batchDelete: function() {
+      const rows = this.gridApi.getSelectedRows()
+      if (rows.length === 0) {
+        this.$message({ type: 'info', message: '请先勾选需要删除的数据' })
+        return
+      }
+      const ids = []
+      const uids = []
+      rows.forEach(function(item) {
+        ids.push(item.id)
+        uids.push(item.member_id)
+      })
+      this.handlerDelete(ids.join(','))
+      this.deleteMembers(uids) // 同时删除用户
+    },
+    async deleteMembers(ids) {
+      API_User.remove(ids)
     }
     }
   }
   }
 }
 }

+ 26 - 15
src/views/ncs-clerk/components/clerkList.vue

@@ -24,6 +24,7 @@
 <!--        </div>-->
 <!--        </div>-->
         <div class="toolbar-btns">
         <div class="toolbar-btns">
           <el-button v-if="part_view" type="primary" size="mini" @click="handleAddMember">新增</el-button>
           <el-button v-if="part_view" type="primary" size="mini" @click="handleAddMember">新增</el-button>
+          <el-button v-if="part_view" type="danger" size="mini" @click="batchDelete">批量删除</el-button>
         </div>
         </div>
       </div>
       </div>
       <el-pagination
       <el-pagination
@@ -209,6 +210,7 @@ import ButtonCellRender from '@/components/AgGridCellRender/ButtonCellRender'
 import AgGridImg from '@/components/AgGridImg/AgGridImg'
 import AgGridImg from '@/components/AgGridImg/AgGridImg'
 import ImageViewer from 'element-ui/packages/image/src/image-viewer'
 import ImageViewer from 'element-ui/packages/image/src/image-viewer'
 import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
 import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
+import * as API_User from "@/api/user";
 let prevOverflow = ''
 let prevOverflow = ''
 
 
 export default {
 export default {
@@ -482,19 +484,31 @@ export default {
     },
     },
     /** 批量数据删除处理(删除选中的行) */
     /** 批量数据删除处理(删除选中的行) */
     batchDelete: function() {
     batchDelete: function() {
-      if (this.multipleSelection.length === 0) {
-        this.$alert('没有选择任何记录!', '系统提示', {
-          confirmButtonText: '确定',
-          callback: action => {
-          }
-        })
-      } else {
-        const ids = []
-        this.multipleSelection.forEach(function(item) {
-          ids.push(item.member_id)
-        })
-        this.handlerDelete(ids.join(','))
+      const rows = this.gridApi.getSelectedRows()
+      if (rows.length === 0) {
+        this.$message({ type: 'info', message: '请先勾选需要删除的数据' })
+        return
       }
       }
+      const ids = []
+      const uids = []
+      let isFounder = 0
+      rows.forEach(function(item) {
+        if (item.founder === 1) {
+          isFounder = 1
+          return
+        }
+        ids.push(item.clerk_id)
+        uids.push(item.member_id)
+      })
+      if (isFounder === 1) {
+        this.$message({ type: 'info', message: '不能删除机构负责人' })
+        return
+      }
+      this.handlerDelete(ids.join(','))
+      this.deleteMembers(uids) // 同时删除用户
+    },
+    async deleteMembers(ids) {
+      API_User.remove(ids)
     },
     },
     /** 性别格式化 */
     /** 性别格式化 */
     formatterSex(row) {
     formatterSex(row) {
@@ -524,15 +538,12 @@ export default {
           if (params.member_id) {
           if (params.member_id) {
             if (this.roleZzId === params.role_id) {
             if (this.roleZzId === params.role_id) {
               const addIds = this.newCheckList.filter(function(val) { return _this.oldCheckList.indexOf(val) === -1 })
               const addIds = this.newCheckList.filter(function(val) { return _this.oldCheckList.indexOf(val) === -1 })
-              console.log('addIds=', addIds)
               const delIds = this.oldCheckList.filter(function(val) { return _this.newCheckList.indexOf(val) === -1 })
               const delIds = this.oldCheckList.filter(function(val) { return _this.newCheckList.indexOf(val) === -1 })
-              console.log('delIds=', delIds)
               const data = {
               const data = {
                 clerkId: params.clerk_id,
                 clerkId: params.clerk_id,
                 addIds: addIds.join(','),
                 addIds: addIds.join(','),
                 delIds: delIds.join(',')
                 delIds: delIds.join(',')
               }
               }
-              console.log('data==', data)
               clerk_API.updateParentById(data)
               clerk_API.updateParentById(data)
             }
             }
             clerk_API.update(params.clerk_id, params).then(response => {
             clerk_API.update(params.clerk_id, params).then(response => {

+ 13 - 0
src/views/ncs-device/components/deviceManager.vue

@@ -22,6 +22,7 @@
         </div>
         </div>
         <div class="toolbar-btns">
         <div class="toolbar-btns">
           <el-button v-if="part_view" type="primary" size="mini" @click="handleAdd">新增设备</el-button>
           <el-button v-if="part_view" type="primary" size="mini" @click="handleAdd">新增设备</el-button>
+          <el-button v-if="part_view" type="danger" size="mini" @click="batchDelete">批量删除</el-button>
         </div>
         </div>
       </div>
       </div>
       <el-pagination
       <el-pagination
@@ -795,6 +796,18 @@ export default {
     },
     },
     websocketclose: function(e) {
     websocketclose: function(e) {
       console.log('connection closed (' + e.code + ')')
       console.log('connection closed (' + e.code + ')')
+    },
+    batchDelete() {
+      const rows = this.gridApi.getSelectedRows()
+      if (rows.length === 0) {
+        this.$message({ type: 'info', message: '请先勾选需要删除的数据' })
+        return
+      }
+      const ids = []
+      rows.forEach(function(item) {
+        ids.push(item.id)
+      })
+      this.handlerDelete(ids.join(','))
     }
     }
 
 
   }
   }

+ 3 - 3
src/views/ncs-orginazition/components/partInfoEdit.vue

@@ -367,10 +367,10 @@ export default {
     onSubmit() {
     onSubmit() {
       this.$refs['editform'].validate((valid) => {
       this.$refs['editform'].validate((valid) => {
         if (valid) {
         if (valid) {
-          if (this.dayStart && this.dayStart !== null) {
+          if (this.dayStart) {
             this.formmodel.day_start = this.dayStart.toLocaleTimeString('chinese', { hour12: false })
             this.formmodel.day_start = this.dayStart.toLocaleTimeString('chinese', { hour12: false })
           }
           }
-          if (this.nightStart && this.nightStart !== null) {
+          if (this.nightStart) {
             this.formmodel.night_start = this.nightStart.toLocaleTimeString('chinese', { hour12: false })
             this.formmodel.night_start = this.nightStart.toLocaleTimeString('chinese', { hour12: false })
           }
           }
           API_Part.editPartSetting(this.formmodel, this.partId).then(res => {
           API_Part.editPartSetting(this.formmodel, this.partId).then(res => {
@@ -379,7 +379,7 @@ export default {
         } else {
         } else {
           this.$message.error('表单填写错误,请检查!')
           this.$message.error('表单填写错误,请检查!')
         }
         }
-      })``
+      })
     },
     },
     /** 获取上级机构数组 特指医院 **/
     /** 获取上级机构数组 特指医院 **/
     getPartents() {
     getPartents() {