From 05170ec3d816960d4f8a38ec8d202cefe73b4179 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期二, 17 十月 2023 17:40:17 +0800
Subject: [PATCH] 保养问题项处理

---
 src/views/system/modules/DepartList/DepartAuthModal.vue |  570 ++++++++++++++++++++++++++++++--------------------------
 1 files changed, 301 insertions(+), 269 deletions(-)

diff --git a/src/views/system/modules/DepartList/DepartAuthModal.vue b/src/views/system/modules/DepartList/DepartAuthModal.vue
index a4d88ad..d3dd7ab 100644
--- a/src/views/system/modules/DepartList/DepartAuthModal.vue
+++ b/src/views/system/modules/DepartList/DepartAuthModal.vue
@@ -2,32 +2,56 @@
   <a-card :bordered="false">
     <template v-if="this.departId">
       <div class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-form
+          layout="inline"
+          @keyup.enter.native="searchQuery"
+        >
           <a-row :gutter="24">
 
-            <a-col :md="6" :sm="12">
+            <a-col :span="24 / 2  ">
               <a-form-item label="璁惧缂栧彿">
-                <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"></a-input>
+                <a-input
+                  placeholder="璇疯緭鍏ヨ澶囩紪鍙�"
+                  v-model="queryParam.equipmentId"
+                ></a-input>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="8">
-              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
+            <a-col :span="24 / 2  ">
+              <a-button
+                type="primary"
+                @click="searchQuery"
+                icon="search"
+              >鏌ヨ</a-button>
+              <a-button
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+              >閲嶇疆</a-button>
             </a-col>
           </a-row>
         </a-form>
       </div>
-      <div class="table-operator" style="border-top: 5px">
+      <div
+        class="table-operator"
+        style="border-top: 5px"
+      >
         <a-dropdown v-if="selectedRowKeys.length > 0">
-          <a-menu slot="overlay"  @click="handleMenuClick">
+          <a-menu
+            slot="overlay"
+            @click="handleMenuClick"
+          >
             <a-menu-item key="1">
-              <a-icon type="delete" @click="batchDel"/>
+              <a-icon
+                type="delete"
+                @click="batchDel"
+              />
               鎵归噺绉婚櫎
             </a-menu-item>
           </a-menu>
           <a-button style="margin-left: 8px">
             鎵归噺鎿嶄綔
-            <a-icon type="down"/>
+            <a-icon type="down" />
           </a-button>
         </a-dropdown>
       </div>
@@ -42,22 +66,33 @@
         :pagination="ipagination"
         :loading="loading"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
+        @change="handleTableChange"
+      >
 
         <!--<template slot="avatarslot" slot-scope="text, record, index">-->
-          <!--<div class="anty-img-wrap">-->
-            <!--<a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>-->
-          <!--</div>-->
+        <!--<div class="anty-img-wrap">-->
+        <!--<a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>-->
+        <!--</div>-->
         <!--</template>-->
 
-        <span slot="action" slot-scope="text, record">
-        <a-popconfirm title="纭畾绉婚櫎鍚�?" @confirm="() => handleDelete(record.id)">
-                  <a>绉婚櫎</a>
-        </a-popconfirm>
+        <span
+          slot="action"
+          slot-scope="text, record"
+        >
+          <a-popconfirm
+            title="纭畾绉婚櫎鍚�?"
+            @confirm="() => handleDelete(record.id)"
+          >
+            <a>绉婚櫎</a>
+          </a-popconfirm>
         </span>
       </a-table>
     </template>
-    <a-card v-else :bordered="false" style="height:200px">
+    <a-card
+      v-else
+      :bordered="false"
+      style="height:200px"
+    >
       <a-empty>
         <span slot="description"> 璇峰厛閫夋嫨涓�涓儴闂�! </span>
       </a-empty>
@@ -66,268 +101,265 @@
 </template>
 
 <script>
-  import {queryTreeListForRole,queryDepartPermission,saveDepartPermission} from '@/api/api'
-  import DepartDataruleModal from './DepartDataruleModal'
-  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-  import { getAction,postAction } from '@/api/manage'
-  import { filterObj } from '@/utils/util'
-  import qs from 'qs'
-  export default {
-    name: 'DepartAuthModal',
-    mixins: [JeecgListMixin],
-    components: { DepartDataruleModal },
-    data(){
-      return {
-        queryParam:{},
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key:'rowIndex',
-            width:60,
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
-            }
-          },
-          {
-            title: '璁惧缂栧彿',
-            align: "center",
-            dataIndex: 'equipmentId',
-            width: 120,
-            // sorter: true
-          },
-          {
-            title: '璁惧鍚嶇О',
-            align: "center",
-            width: 150,
-            dataIndex: 'equipmentName',
-          },
-          {
-            title: '璁惧绫诲瀷',
-            align: "center",
-            width: 120,
-            dataIndex: 'equipmentType',
-            // scopedSlots: {customRender: "avatarslot"}
-          },
-
-          {
-            title: '椹卞姩绫诲瀷',
-            align: "center",
-            width: 80,
-            dataIndex: 'driveType',
-            // sorter: true
-          },
-
-          {
-            title: '鎿嶄綔',
-            dataIndex: 'action',
-            scopedSlots: {customRender: 'action'},
-            align: "center",
-            width: 120
+import { queryTreeListForRole, queryDepartPermission, saveDepartPermission } from '@/api/api'
+import DepartDataruleModal from './DepartDataruleModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getAction, postAction } from '@/api/manage'
+import { filterObj } from '@/utils/util'
+import qs from 'qs'
+export default {
+  name: 'DepartAuthModal',
+  mixins: [JeecgListMixin],
+  components: { DepartDataruleModal },
+  data() {
+    return {
+      queryParam: {},
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: "center",
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1;
           }
+        },
+        {
+          title: '璁惧缂栧彿',
+          align: "center",
+          dataIndex: 'equipmentId',
+          width: 120,
+          // sorter: true
+        },
+        {
+          title: '璁惧鍚嶇О',
+          align: "center",
+          width: 150,
+          dataIndex: 'equipmentName',
+        },
+        {
+          title: '璁惧绫诲瀷',
+          align: "center",
+          width: 120,
+          dataIndex: 'equipmentType',
+          // scopedSlots: {customRender: "avatarslot"}
+        },
 
-        ],
-        disableMixinCreated:true,
-        departId:"",
-        title:"閮ㄩ棬鏉冮檺閰嶇疆",
-        visible: false,
-        loading: false,
-        url:{
-          list:'/mdc/mdcEquipment/equipmentListByDepart',
-          removeEquipmentForDepart:'/mdc/mdcEquipment/removeEquipmentForDepart',
-          serachEquipment:'/mdc/mdcEquipment/equipmentListByDepart',
-          removeEquipmentsForDepart:"/mdc/mdcEquipment/removeEquipmentsForDepart"
+        {
+          title: '椹卞姩绫诲瀷',
+          align: "center",
+          width: 80,
+          dataIndex: 'driveType',
+          // sorter: true
+        },
+
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          scopedSlots: { customRender: 'action' },
+          align: "center",
+          width: 120
+        }
+
+      ],
+      disableMixinCreated: true,
+      departId: "",
+      title: "閮ㄩ棬鏉冮檺閰嶇疆",
+      visible: false,
+      loading: false,
+      url: {
+        list: '/mdc/mdcEquipment/equipmentListByDepart',
+        removeEquipmentForDepart: '/mdc/mdcEquipment/removeEquipmentForDepart',
+        serachEquipment: '/mdc/mdcEquipment/equipmentListByDepart',
+        removeEquipmentsForDepart: "/mdc/mdcEquipment/removeEquipmentsForDepart"
+      }
+    }
+  },
+  methods: {
+
+    show(departId) {
+      this.departId = departId
+      this.loadData();
+    },
+    close() {
+      this.reset()
+      this.$emit('close');
+      this.visible = false;
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData();
+    },
+    searchQuery() {
+      var id = this.queryParam.equipmentId
+      this.loading = true;
+      var params = this.getQueryParams();//鏌ヨ鏉′欢
+
+      params.pageNo = this.ipagination.current;
+      params.pageSize = this.ipagination.pageSize;
+      getAction(this.url.serachEquipment, { equipmentId: this.queryParam.equipmentId, departId: this.departId, pageNo: params.pageNo, pageSize: params.pageSize }).then((res) => {
+        if (res.success) {
+          // console.log(res)
+          //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+          this.dataSource = res.result.records || res.result;
+          if (res.result.total) {
+            this.ipagination.total = res.result.total;
+          } else {
+            this.ipagination.total = 0;
+          }
+          //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+        } else {
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    handleTableChange(pagination, filters, sorter) {
+      //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂
+      //TODO 绛涢��
+      // console.log(pagination)
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field;
+        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+      }
+      this.ipagination = pagination;
+      this.loadData();
+    },
+    loadData() {
+      //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+      // if (arg === 1) {
+      //   this.ipagination.current = 1;
+      // }
+      var params = this.getQueryParams();//鏌ヨ鏉′欢
+
+      params.pageNo = this.ipagination.current;
+      params.pageSize = this.ipagination.pageSize;
+      this.loading = true;
+      getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          // console.log(res)
+          //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+          this.dataSource = res.result.records || res.result;
+          if (res.result.total) {
+            this.ipagination.total = res.result.total;
+          } else {
+            this.ipagination.total = 0;
+          }
+          //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+        } else {
+          // this.$message.warning(res.message)
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: res.message
+          });
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    getQueryParams() {
+      //鑾峰彇鏌ヨ鏉′欢
+      let sqp = {}
+      if (this.superQueryParams) {
+        sqp['superQueryParams'] = encodeURI(this.superQueryParams)
+        sqp['superQueryMatchType'] = this.superQueryMatchType
+      }
+      var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
+      param.field = this.getQueryField();
+      param.pageNo = this.ipagination.current;
+      param.pageSize = this.ipagination.pageSize;
+      param.departId = this.departId;
+      //鑾峰彇鐢ㄦ埛瀹氬埗鐨勫弬鏁板睘鎬�
+      if (this.getCustomQueryParams) {
+        param = this.getCustomQueryParams(param);
+        if (!param) {
+          return false;
         }
       }
+
+      return filterObj(param);
     },
-    methods: {
+    handleDelete(equipmentId) {
 
-      show(departId){
-        this.departId=departId
-        this.loadData();
-      },
-      close () {
-        this.reset()
-        this.$emit('close');
-        this.visible = false;
-      },
-      searchReset() {
-        this.queryParam = {}
-        this.loadData();
-      },
-      searchQuery() {
-        var id = this.queryParam.equipmentId
-        this.loading = true;
-        var params = this.getQueryParams();//鏌ヨ鏉′欢
-
-        params.pageNo = this.ipagination.current;
-        params.pageSize = this.ipagination.pageSize;
-        getAction(this.url.serachEquipment,{equipmentId:this.queryParam.equipmentId,departId:this.departId,pageNo:params.pageNo,pageSize:params.pageSize}).then((res)=>{
-          if (res.success) {
-            // console.log(res)
-            //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
-            this.dataSource = res.result.records||res.result;
-            if(res.result.total)
-            {
-              this.ipagination.total = res.result.total;
-            }else{
-              this.ipagination.total = 0;
-            }
-            //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
-          }else{
-            this.$message.warning(res.message)
-          }
-        }).finally(() => {
-          this.loading = false
-        })
-      },
-      handleTableChange(pagination, filters, sorter) {
-        //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂
-        //TODO 绛涢��
-        // console.log(pagination)
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
-        }
-        this.ipagination = pagination;
-        this.loadData();
-      },
-      loadData(){
-        //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
-        // if (arg === 1) {
-        //   this.ipagination.current = 1;
-        // }
-        var params = this.getQueryParams();//鏌ヨ鏉′欢
-
-        params.pageNo = this.ipagination.current;
-        params.pageSize = this.ipagination.pageSize;
-        this.loading = true;
-        getAction(this.url.list,params).then((res)=>{
-          if (res.success) {
-            // console.log(res)
-            //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
-            this.dataSource = res.result.records||res.result;
-            if(res.result.total)
-            {
-              this.ipagination.total = res.result.total;
-            }else{
-              this.ipagination.total = 0;
-            }
-            //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
-          }else{
-            // this.$message.warning(res.message)
-            this.$notification.warning({
-              message:'娑堟伅',
-              description:res.message
-            });
-          }
-        }).finally(() => {
-          this.loading = false
-        })
-      },
-      getQueryParams() {
-        //鑾峰彇鏌ヨ鏉′欢
-        let sqp = {}
-        if(this.superQueryParams){
-          sqp['superQueryParams']=encodeURI(this.superQueryParams)
-          sqp['superQueryMatchType'] = this.superQueryMatchType
-        }
-        var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
-        param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        param.departId = this.departId;
-        //鑾峰彇鐢ㄦ埛瀹氬埗鐨勫弬鏁板睘鎬�
-        if (this.getCustomQueryParams) {
-          param = this.getCustomQueryParams(param);
-          if(!param){
-            return false;
-          }
-        }
-
-        return filterObj(param);
-      },
-      handleDelete(equipmentId){
-
-        postAction(this.url.removeEquipmentForDepart,qs.stringify({departId:this.departId,equipmentId:equipmentId})).then((res)=>{
-          if (res.success) {
-            // this.$message.warning(res.message)
-            this.$notification.success({
-              message:'娑堟伅',
-              description:res.message
-            });
-
-            this.loadData(this.departId);
-          }else{
-            // this.$message.warning(res.message)
-            this.$notification.warning({
-              message:'娑堟伅',
-              description:res.message
-            });
-
-          }
-        }).finally(() => {
-
-        })
-      },
-      handleMenuClick(e) {
-        if (e.key == 1) {
-          this.batchDel();
-        }
-      },
-      batchDel: function () {
-        if(!this.url.removeEquipmentsForDepart){
-          this.$message.error("璇疯缃畊rl.removeEquipmentsForDepart灞炴��!")
-          return
-        }
-        if (this.selectedRowKeys.length <= 0) {
-          // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒');
-          this.$notification.warning({
-            message:'娑堟伅',
-            description:"璇烽�夋嫨涓�鏉¤褰�"
+      postAction(this.url.removeEquipmentForDepart, qs.stringify({ departId: this.departId, equipmentId: equipmentId })).then((res) => {
+        if (res.success) {
+          // this.$message.warning(res.message)
+          this.$notification.success({
+            message: '娑堟伅',
+            description: res.message
           });
-          return;
+
+          this.loadData(this.departId);
         } else {
-          var ids = "";
-          for (var a = 0; a < this.selectedRowKeys.length; a++) {
-            ids += this.selectedRowKeys[a] + ",";
-          }
-          var that = this;
-          this.$confirm({
-            title: "纭鍒犻櫎",
-            content: "鏄惁鍒犻櫎閫変腑鏁版嵁?",
-            onOk: function () {
-              that.loading = true;
-              postAction(that.url.removeEquipmentsForDepart,qs.stringify({departId:that.departId,equipmentIds:ids})).then((res) => {
-                if (res.success) {
-                  //閲嶆柊璁$畻鍒嗛〉闂
-                  that.reCalculatePage(that.selectedRowKeys.length)
-                  // that.$message.success(res.message);
-                  that.$notification.success({
-                    message:'娑堟伅',
-                    description:res.message
-                  });
-                  that.loadData(that.departId);
-                  that.onClearSelected();
-                } else {
-                  // that.$message.warning(res.message);
-                  that.$notification.warning({
-                    message:'娑堟伅',
-                    description:res.message
-                  });
-                }
-              }).finally(() => {
-                that.loading = false;
-              });
-            }
+          // this.$message.warning(res.message)
+          this.$notification.warning({
+            message: '娑堟伅',
+            description: res.message
           });
+
         }
-      },
+      }).finally(() => {
+
+      })
     },
-  }
+    handleMenuClick(e) {
+      if (e.key == 1) {
+        this.batchDel();
+      }
+    },
+    batchDel: function () {
+      if (!this.url.removeEquipmentsForDepart) {
+        this.$message.error("璇疯缃畊rl.removeEquipmentsForDepart灞炴��!")
+        return
+      }
+      if (this.selectedRowKeys.length <= 0) {
+        // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒');
+        this.$notification.warning({
+          message: '娑堟伅',
+          description: "璇烽�夋嫨涓�鏉¤褰�"
+        });
+        return;
+      } else {
+        var ids = "";
+        for (var a = 0; a < this.selectedRowKeys.length; a++) {
+          ids += this.selectedRowKeys[a] + ",";
+        }
+        var that = this;
+        this.$confirm({
+          title: "纭鍒犻櫎",
+          content: "鏄惁鍒犻櫎閫変腑鏁版嵁?",
+          onOk: function () {
+            that.loading = true;
+            postAction(that.url.removeEquipmentsForDepart, qs.stringify({ departId: that.departId, equipmentIds: ids })).then((res) => {
+              if (res.success) {
+                //閲嶆柊璁$畻鍒嗛〉闂
+                that.reCalculatePage(that.selectedRowKeys.length)
+                // that.$message.success(res.message);
+                that.$notification.success({
+                  message: '娑堟伅',
+                  description: res.message
+                });
+                that.loadData(that.departId);
+                that.onClearSelected();
+              } else {
+                // that.$message.warning(res.message);
+                that.$notification.warning({
+                  message: '娑堟伅',
+                  description: res.message
+                });
+              }
+            }).finally(() => {
+              that.loading = false;
+            });
+          }
+        });
+      }
+    },
+  },
+}
 </script>
 
 <style scoped>
-
 </style>
\ No newline at end of file

--
Gitblit v1.9.3