qushaowei
2023-10-17 05170ec3d816960d4f8a38ec8d202cefe73b4179
保养问题项处理
已重命名2个文件
已添加5个文件
已修改8个文件
5035 ■■■■ 文件已修改
src/views/eam/Daily3MaintenanceOrderList.vue 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/DailyInspectionOrderList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/DailyInspectionStandardList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/DailyMaintenanceOrderList.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/DailyMaintenanceStandardList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue 748 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/daily3MaintenanceOrder/EquipmentPrecisionCheckOrderModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/daily3MaintenanceOrder/EquipmentTechnologyStatusModal.vue 229 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/daily3MaintenanceOrder/StoveCategoryModal.vue 1000 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/dailyMaintenanceOrder/ActualWorkHoursEditTable.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/DepartList.vue 1270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/DepartList/DepartAuthModal.vue 570 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/DepartList/DepartModal.vue 429 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/DepartList/DepartTeam.vue 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/DepartList/TeamModal.vue 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/Daily3MaintenanceOrderList.vue
ÎļþÃû´Ó src/views/eam/DailyMaintenanceOrderList3m.vue ÐÞ¸Ä
@@ -155,14 +155,14 @@
            v-if="record.status == '1'"
            type="vertical"
          />
          <a
          <!-- <a
            v-if="record.status === '2'"
            @click="handleOrderChange(record)"
          >计划变更</a>
          <a-divider
            v-if="record.status == '2'"
            type="vertical"
          />
          /> -->
          <a-popconfirm
            title="确定撤回工单吗?"
            @confirm="() => handleOrderReset(record)"
@@ -252,11 +252,27 @@
            type="vertical"
          /> -->
          <a
            v-if="record.status === '5' || record.status === '8' "
            v-if="record.status === '5' && record.isNotStoveCategoryFlag == false && record.precisionParameters == '1' && (record.precisionInspectionStatus == '0' ||record.precisionInspectionStatus == '1' ||record.precisionInspectionStatus == '2' ||record.precisionInspectionStatus == '3' ||record.precisionInspectionStatus == '4')"
            @click="handlePrecisionCheckOrder(record)"
          >精度检验</a>
          <a-divider
            v-if="record.status === '5'|| record.status === '8'"
            v-if="record.status === '5'&& record.isNotStoveCategoryFlag == false && record.precisionParameters == '1'  && (record.precisionInspectionStatus == '0' ||record.precisionInspectionStatus == '1' ||record.precisionInspectionStatus == '2' ||record.precisionInspectionStatus == '3' ||record.precisionInspectionStatus == '4')"
            type="vertical"
          />
          <a
            v-if="record.status === '5' && record.isNotStoveCategoryFlag == true && (record.stoveExemptStatus == '0' ||record.stoveExemptStatus == '1' ||record.stoveExemptStatus == '2')"
            @click="handleStoveDetection(record)"
          >炉类检测</a>
          <a-divider
            v-if="record.status === '5'&& record.isNotStoveCategoryFlag == true && (record.stoveExemptStatus == '0' ||record.stoveExemptStatus == '1' ||record.stoveExemptStatus == '2')"
            type="vertical"
          />
          <a
            v-if="record.status === '5' && record.isNotStoveCategoryFlag == false && record.precisionParameters == '0'"
            @click="handleTechnologyStatus(record)"
          >技术状态鉴定</a>
          <a-divider
            v-if="record.status === '5'&& record.isNotStoveCategoryFlag == false && record.precisionParameters == '0' "
            type="vertical"
          />
          <a-dropdown>
@@ -283,7 +299,7 @@
          slot-scope="text, record"
        >
          <a
            v-if="record.status === '3' || record.status === '4' ||record.status === '5'  ||record.status === '7' ||record.status === '8'"
            v-if="record.status === '3' || record.status === '4' ||record.status === '5'  ||record.status === '7' "
            class="lot"
            @click="handleOrderExe(record)"
          >{{record.num}}</a>
@@ -309,6 +325,10 @@
      ref="EquipmentPrecisionCheckOrderModal"
      @ok="modalFormOk"
    ></equipment-precision-check-order-modal>
    <stove-category-modal
      ref="StoveCategoryModal"
      @ok="modalFormOk"
    ></stove-category-modal>
    <maintenance-order-assign-modal
      ref="MaintenanceOrderAssignModal"
      @ok="modalFormOk"
@@ -317,6 +337,10 @@
      ref="DailyMaintenanceOrderExeDrawer"
      @ok="modalFormOk"
    ></daily-maintenance-order-exe-drawer>
    <equipment-technology-status-modal
      ref="EquipmentTechnologyStatusModal"
      @ok="modalFormOk"
    ></equipment-technology-status-modal>
  </a-card>
</template>
@@ -328,9 +352,11 @@
import MaintenanceOrderModal from './modules/dailyMaintenanceOrder/MaintenanceOrderModal'
import FinishDevolutionModal from './modules/dailyMaintenanceOrder/FinishDevolutionModal'
import MaintenanceOrderChangeModal from './modules/dailyMaintenanceOrder/MaintenanceOrderChangeModal'
import EquipmentPrecisionCheckOrderModal from './modules/dailyMaintenanceOrder/EquipmentPrecisionCheckOrderModal'
import EquipmentPrecisionCheckOrderModal from './modules/daily3MaintenanceOrder/EquipmentPrecisionCheckOrderModal'
import StoveCategoryModal from './modules/daily3MaintenanceOrder/StoveCategoryModal'
import MaintenanceOrderAssignModal from './modules/dailyMaintenanceOrder/MaintenanceOrderAssignModal'
import DailyMaintenanceOrderExeDrawer from './modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer'
import DailyMaintenanceOrderExeDrawer from './modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer'
import EquipmentTechnologyStatusModal from './modules/daily3MaintenanceOrder/EquipmentTechnologyStatusModal'
import { getAction, postAction, requestPut } from '@/api/manage'
export default {
@@ -342,11 +368,14 @@
    MaintenanceOrderAssignModal,
    EquipmentPrecisionCheckOrderModal,
    DailyMaintenanceOrderExeDrawer,
    MaintenanceOrderChangeModal
    MaintenanceOrderChangeModal,
    StoveCategoryModal,
    EquipmentTechnologyStatusModal
  },
  data() {
    return {
      description: '日常保养工单',
      description: '三级保养工单',
      queryParam: { maintenanceType: '3' },
      // è¡¨å¤´
      columns: [
        {
@@ -360,15 +389,15 @@
          }
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName'
        },
        {
          title: '保养工单号',
          align: "center",
          dataIndex: 'num',
          scopedSlots: { customRender: 'num' }
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName'
        },
        {
          title: '保养周期',
@@ -476,7 +505,7 @@
        }
      ],
      url: {
        list: "/eam/dailyMaintenanceOrder/getDailyMaintenanceOrderList",
        list: "/eam/dailyMaintenanceOrder/getDailyMaintenanceOrder3List",
        delete: "/eam/dailyMaintenanceOrder/delete",
        deleteBatch: "/eam/dailyMaintenanceOrder/deleteBatch",
        exportXlsUrl: "/eam/dailyMaintenanceOrder/exportXls",
@@ -573,10 +602,21 @@
      this.$refs.EquipmentPrecisionCheckOrderModal.disableSubmit = false;
    },
    handleOrderChange: function (record) {
    handleTechnologyStatus: function (record) {
      this.$refs.EquipmentTechnologyStatusModal.edit(record);
      this.$refs.EquipmentTechnologyStatusModal.title = "技术状态编辑";
      this.$refs.EquipmentTechnologyStatusModal.disableSubmit = false;
    },
    handleStoveDetection: function (record) {
      this.$refs.StoveCategoryModal.edit(record);
      this.$refs.StoveCategoryModal.title = "温度均匀性检测条件确认表";
      this.$refs.StoveCategoryModal.disableSubmit = false;
    },
    handleOrderChange: function (record) {
      this.$refs.MaintenanceOrderChangeModal.edit(record);
      this.$refs.MaintenanceOrderChangeModal.title = "生产设备保养计划变更申请单";
      this.$refs.MaintenanceOrderChangeModal.title = "温度均匀性检测条件确认表";
      this.$refs.MaintenanceOrderChangeModal.disableSubmit = false;
    },
src/views/eam/DailyInspectionOrderList.vue
@@ -1,7 +1,7 @@
<template>
  <a-card
    :bordered="false"
    title="日常点检工单"
    title="日保周保工单"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
src/views/eam/DailyInspectionStandardList.vue
@@ -1,6 +1,6 @@
<template>
  <a-card
    title="日常点检"
    title="日保周保标准"
    :bordered='false'
  >
    <div class='table-page-search-wrapper'>
src/views/eam/DailyMaintenanceOrderList.vue
@@ -1,7 +1,7 @@
<template>
  <a-card
    :bordered="false"
    title="日常保养工单"
    title="二级保养工单"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
@@ -315,7 +315,8 @@
  },
  data() {
    return {
      description: '日常保养工单',
      description: '二级保养工单',
      queryParam: { maintenanceType: '2' },
      // è¡¨å¤´
      columns: [
        {
@@ -329,16 +330,21 @@
          }
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName'
        },
        {
          title: '保养工单号',
          align: "center",
          dataIndex: 'num',
          scopedSlots: { customRender: 'num' }
        },
        {
          title: '状态',
          align: "center",
          dataIndex: 'statusName'
        },
        // {
        //   title: '保养类型',
        //   align: "center",
        //   dataIndex: 'maintenanceTypeName',
        // },
        {
          title: '保养周期',
          align: "center",
@@ -491,7 +497,7 @@
    },
    handlePrintInfo(record) {
      let href = `${window._CONFIG['domianURL']}/jmreport/view/857408393168490496?id=`+record.id; //网站链接
      let href = `${window._CONFIG['domianURL']}/jmreport/view/857408393168490496?id=` + record.id; //网站链接
      window.open(href, "_blank");
    },
@@ -627,7 +633,7 @@
  font-weight: bold;
}
.yellow {
  color: yellow;
  color: rgba(255, 255, 0, 0.443);
  font-weight: bold;
}
.fontweight {
src/views/eam/DailyMaintenanceStandardList.vue
@@ -1,6 +1,6 @@
<template>
  <a-card
    title="日常保养标准"
    title="周期性保养标准"
    :bordered='false'
  >
    <div class='table-page-search-wrapper'>
src/views/eam/modules/daily3MaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,748 @@
<template>
  <a-drawer
    :title="title"
    :width="drawerWidth"
    :visible="visible"
    @close="handleCancel"
    :confirmLoading="confirmLoading"
    :maskClosable="maskClosable"
  >
    <a-card :style="getBackground()">
      <template>
        <a-card>
          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
            <a-row :style="{textAlign:'left'}">
              <a-button
                :style="{marginRight: '8px'}"
                @click="handleSW"
                :disabled=SWbuttonDistable
                type="primary"
                v-has="'dailyMaintenanceOrder:SW'"
              >开工</a-button>
              <a-button
                :style="{marginRight: '8px'}"
                @click="handleReport"
                :disabled="buttonDistable"
                type="primary"
                v-has="'dailyMaintenanceOrder:report'"
              >报工</a-button>
              <a-button
                :style="{marginRight: '8px'}"
                @click="handleReset"
                :disabled="revocationDistable"
                type="primary"
                v-has="'dailyMaintenanceOrder:reset'"
              >撤销</a-button>
            </a-row>
          </div>
          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
            <a-row :gutter="24">
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="状态"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.statusName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="{span:8}"
                  :wrapperCol="{span:16}"
                  label="保养工单号"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.num }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="使用部门"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hightColor"
                  >{{ this.model.departName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="责任班组"
                  class="hightColor"
                >
                  <span
                    v-if="this.model != null"
                    class="hight"
                  >{{ this.model.teamName }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :span="24">
                <a-form-item
                  label="问题及处理措施描述"
                  :labelCol="{span:3}"
                  :wrapperCol="{span:18}"
                  class="hightColor"
                >
                  <a-textarea
                    allowClear
                    :disabled="this.model.status!='4'"
                    :placeholder="'请输入问题及处理措施描述'"
                    v-model="model.description"
                  />
                </a-form-item>
              </a-col>
            </a-row>
          </div>
          <a-tabs
            type="card"
            defaultActiveKey="1"
          >
            <a-tab-pane
              tab='保养明细'
              key="1"
              class="hightColor"
            >
              <div>
                <a-table
                  ref="table"
                  size="middle"
                  bordered
                  rowKey="id"
                  :columns="columns"
                  :dataSource="dataSource"
                  :loading="loading"
                  @change="handleTableChange"
                  :pagination="ipagination"
                >
                  <!-- :scroll="{ x: 'calc(1200px + 50%)', y: 900 }" -->
                  <!-- :scroll="{x:true}" -->
                  <template
                    v-for="col in columns"
                    :slot="col.dataIndex"
                    slot-scope='text, record, index'
                  >
                    <div :key="col.dataIndex">
                      <span
                        v-if=" col.dataIndex == 'photo' && !text"
                        style="font-size: 12px;font-style: italic;"
                      >无图片</span>
                      <img
                        v-if="col.dataIndex == 'photo'  && text"
                        :src="getImgView(text)"
                        :preview="record.maintenanceStandardDetailId"
                        height="25px"
                        alt=""
                        style="max-width:80px;font-size: 12px;font-style: italic;"
                      />
                      <!-- ç¤ºæ„å›¾ å¼€å§‹ -->
                      <!-- <Tooltip
                        placement="top"
                        title="预览图片"
                      >
                        <img
                          v-if=" col.dataIndex == 'photo' && record.sketchPhoto.path && (record.sketchPhoto.format.toLowerCase()=='jpg'||record.sketchPhoto.format.toLowerCase()=='bmp'||record.sketchPhoto.format.toLowerCase()=='png'||record.sketchPhoto.format.toLowerCase()=='jpeg'||record.sketchPhoto.format.toLowerCase()=='gif')"
                          width="30"
                          height="14"
                          border="1"
                          draggable="false"
                          preview="1"
                          :preview-text="''"
                          :src="record.sketchPhoto.src"
                        />
                      </Tooltip>
                      <a
                        v-if=" col.dataIndex == 'photo' &&  record.sketchPhoto.path && record.sketchPhoto.format.toLowerCase()=='pdf'"
                        href="javascript:;"
                        @click="viewP(record.sketchPhoto)"
                      >
                        é¢„览
                      </a> -->
                      <a-input
                        :value="text"
                        v-if="col.dataIndex == 'maintenanceOrderDetailUda1'"
                        @change="(e)=>handleChange(e, record.key, col, index)"
                      />
                    </div>
                  </template>
                </a-table>
                <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
                  <a-row :style="{textAlign:'right'}">
                    <a-button
                      :style="{marginRight: '8px'}"
                      @click="handleCancel"
                    >
                      å–消
                    </a-button>
                    <a-button
                      @click="handleOk()"
                      type="primary"
                      :disabled="this.model.status!='4'"
                      :loading="confirmLoading"
                    >保存</a-button>
                  </a-row>
                  <!-- v-has="'dailyMaintenanceOrder:actualWorkHoursSave'" -->
                  <!-- :disabled="false" -->
                </div>
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='计划用料'
              key="2"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <maintenance-standard-planning-material :maintenanceStandardId='maintenanceStandardId' />
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='危险防控'
              key="3"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <maintenance-standard-safety-requirement :maintenanceStandardId='maintenanceStandardId' />
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='作业指导书'
              key="4"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <maintenance-standard-work-instruction :maintenanceStandardId='maintenanceStandardId' />
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='实际用料'
              key="5"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <actual-material-edit-table
                  :dailyMaintenanceOrderId="this.model.id"
                  :dailyMaintenanceOrderStatus="this.model.status"
                  :equipmentId="this.model.equipmentId"
                ></actual-material-edit-table>
              </div>
            </a-tab-pane>
            <a-tab-pane
              tab='实际工时'
              key="6"
            >
              <div
                class="table-operator"
                style="margin:-16px"
              >
                <actual-work-hours-edit-table
                  :dailyMaintenanceOrderId="this.model.id"
                  :dailyMaintenanceOrderStatus="this.model.status"
                  :equipmentId="this.model.equipmentId"
                  :teamId="this.model.teamId"
                ></actual-work-hours-edit-table>
              </div>
            </a-tab-pane>
          </a-tabs>
        </a-card>
      </template>
    </a-card>
    <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
      <a-row :style="{textAlign:'right'}">
        <a-button
          :style="{marginRight: '8px'}"
          @click="handleCancel"
        >
          å–消
        </a-button>
        <a-button
          :style="{marginRight: '8px'}"
          @click="handleTS"
          :disabled="buttonDistable"
          type="primary"
          v-if="false"
        >暂存</a-button>
        <a-button
          @click="handleOk"
          :disabled="buttonDistable"
          type="primary"
          v-if="false"
        >保存</a-button>
      </a-row>
    </div>
  </a-drawer>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { requestPut, getAction, downFile, postAction } from '@/api/manage'
import Tooltip from 'ant-design-vue/es/tooltip'
import { preview } from 'vue-photo-preview'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
import PdfView from '@views/common/PdfView'
import { getFileAccessHttpUrl } from '@/api/manage';
import MaintenanceStandardPlanningMaterial from '../dailyMaintenanceOrder/MaintenanceStandardPlanningMaterial'
import MaintenanceStandardSafetyRequirement from '../dailyMaintenanceOrder/MaintenanceStandardSafetyRequirement'
import MaintenanceStandardWorkInstruction from '../dailyMaintenanceOrder/MaintenanceStandardWorkInstruction'
import ActualMaterialEditTable from '../dailyMaintenanceOrder/ActualMaterialEditTable.vue'
import ActualWorkHoursEditTable from '../dailyMaintenanceOrder/ActualWorkHoursEditTable.vue'
export default {
  name: 'DailyMaintenanceOrderExeDrawer',
  mixins: [JeecgListMixin],
  components: {
    PdfView,
    preview,
    Tooltip,
    MaintenanceStandardPlanningMaterial,
    MaintenanceStandardSafetyRequirement,
    MaintenanceStandardWorkInstruction,
    ActualMaterialEditTable,
    ActualWorkHoursEditTable
  },
  data() {
    return {
      title: "日常保养工单执行",
      visible: false,
      maskClosable: true,
      confirmLoading: false,
      drawerWidth: "100%",
      buttonDistable: false,
      SWbuttonDistable: false,
      revocationDistable: false,
      currentNodeSelect: '',
      maintenanceStandardId: '-1',
      loading: false,
      dataSource: [],
      model: {},
      form: this.$form.createForm(this),
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      validatorRules: {
        // description: {
        //   rules: [
        //     { required: true, message: '请输入描述!' },
        //   ]
        // }
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          width: 60,
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '部位',
          align: 'center',
          dataIndex: 'location',
        },
        // class: "notshow"
        {
          title: '示意图',
          align: 'center',
          dataIndex: 'photo',
          scopedSlots: { customRender: 'photo' },
        },
        // class: "notshow"
        {
          title: '保养项目',
          align: 'center',
          dataIndex: 'maintenanceProjectNum',
        },
        {
          title: '保养标准',
          align: 'center',
          dataIndex: 'standard',
        },
        // {
        //   title: '方法',
        //   align: 'center',
        //   dataIndex: 'maintenanceMethodName',
        // },
        // {
        //   title: '工具',
        //   align: 'center',
        //   dataIndex: 'maintenanceTool',
        // },
        {
          title: '安全要求',
          align: 'center',
          dataIndex: 'maintenanceRequire',
        },
        {
          title: '工时定额(小时)',
          align: 'center',
          dataIndex: 'workingHourQuota',
        },
        {
          title: '保养周期',
          align: 'center',
          dataIndex: 'maintenanceCycleName',
        },
        {
          title: '维保专业',
          align: 'center',
          dataIndex: 'maintenanceSpecialtyName',
        },
        {
          title: '保养人',
          align: 'center',
          dataIndex: 'maintenanceOrderDetailUda1',
          width: 200,
          scopedSlots: { customRender: 'maintenanceOrderDetailUda1' },
        },
      ],
      url: {
        list: "/eam/dailyMaintenanceOrderDetail/getDailyMaintenanceOrderDetailList",
        urlDownload: window._CONFIG['staticDomainURL'],
        download: '/sys/upload/downloadFile',
        editStatus: "/eam/dailyMaintenanceOrder/editStatus",
        revocation: "/eam/dailyMaintenanceOrder/revocation3M",
        report: "/eam/dailyMaintenanceOrder/report3M",
        edit: "/eam/dailyMaintenanceOrderDetail/edit"
      },
    }
  },
  mounted() {
    this.$bus.$on('closeDrawer', (data) => {
      this.visible = false;
    })
  },
  methods: {
    handleShow(record) {
      this.model = Object.assign({}, record);
      this.maintenanceStandardId = record.maintenanceStandardId
      this.dataSource = []
      this.visible = true;
      this.queryParam.dailyMaintenanceOrderId = record.id
      this.loadData1(1)
    },
    loadData1(arg) {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
        return
      }
      //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1;
      }
      var params = this.getQueryParams();//查询条件
      this.loading = true;
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          // for (let i = 0; i < res.result.records.length; i++) {
          //   let r = res.result.records[i].sketchPhoto;
          //   r.src = this.getSrc(res.result.records[i].sketchPhoto);
          // }
          //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
      })
    },
    modalFormOk() {
      //清空列表选中
      this.onClearSelected()
    },
    loadData() {
    },
    getBackground() {
      return "background-color:rgba(127, 127, 127,0.08)";
    },
    handleCancel() {
      this.$emit('ok');
      this.alterFlag = new Date();
      this.close()
    },
    close() {
      this.visible = false;
    },
    //暂存
    handleTS() {
    },
    //开工
    handleSW() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '保养工单开工',
        content: '提示:开工后无法撤回,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.editStatus, { id: that.model.id, status: '4' }).then((res) => {
            if (res.success) {
              that.model.status = '4'
              that.$message.success("工单开工成功!")
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
            } else {
              that.$message.warning("工单开工失败!")
            }
          }).finally(() => {
            that.confirmLoading = false;
            // that.close();
          })
        },
      })
    },
    //报工
    handleReport() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '保养工单报工',
        content: '提示:报工后保养完工,请谨慎操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.report, { id: that.model.id, status: '5', description: that.model.description }).then((res) => {
            if (res.success) {
              that.model.status = '5'
              that.$message.success(res.message)
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
              that.$emit('ok');
              that.alterFlag = new Date();
              that.close();
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false;
            //
          })
        },
      })
    },
    //撤销
    handleReset() {
      const that = this;
      that.confirmLoading = true;
      this.$confirm({
        title: '完工撤销',
        content: '提示:完工撤销后可继续报工操作!',
        okText: '确认',
        cancelText: '取消',
        onOk() {
          requestPut(that.url.revocation, { id: that.model.id, status: '4' }).then((res) => {
            if (res.success) {
              that.model.status = '4'
              that.$message.success(res.message)
              that.buttonDistable = false
              that.revocationDistable = true
              that.SWbuttonDistable = true
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false;
            // that.close();
          })
        },
      })
    },
    //保存
    handleOk() {
      const that = this
      this.loading = true;
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true
          let formData = {}
          formData.dailyMaintenanceOrderDetails = that.dataSource;
          let obj = obj = postAction(this.url.edit, formData)
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message)
              that.$emit('ok')
            } else {
              that.$message.warning(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false
            that.loadData1();
            this.loading = false;
          })
        }
      })
    },
    handleChange(value, key, column, index) {
      let that = this;
      const temp = [...that.dataSource];
      const target = temp[index];
      if (target) {
        target[column.dataIndex] = value;
        if ('maintenanceOrderDetailUda1' == column.dataIndex) {
          target['maintenanceOrderDetailUda1'] = value.target.value;
        }
        that.dataSource = temp;
      }
    },
    view(record) {
      this.$refs.pdfview.showPdf(record.src);
    },
    handleDownload(record) {
      downFile(this.url.download, { id: record.upload.id }).then((res) => {
        if (!res) {
          this.$message.warning('文件下载失败')
          return
        } else {
          let fileName = record.upload.name;
          if (typeof window.navigator.msSaveBlob !== 'undefined') {
            window.navigator.msSaveBlob(new Blob([res]), fileName);
          } else {
            let url = window.URL.createObjectURL(new Blob([res]));
            let link = document.createElement('a');
            link.style.display = 'none';
            link.href = url;
            link.setAttribute('download', fileName);
            document.body.appendChild(link);
            link.click()
            document.body.removeChild(link) //下载完成移除元素
            window.URL.revokeObjectURL(url) //释放掉blob对象
          }
        }
      })
    },
    getSrc(record) {
      if (!record.path) {
        return '';
      }
      //本地:local\Minio:minio\阿里云:alioss
      if (record.uploadType == 'local') {
        let ssoLoginFlag = Vue.ls.get("ssoLoginFlag");
        let deployMode = Vue.ls.get("deployMode");
        if (ssoLoginFlag && deployMode == "container") {
          var baseProject = Vue.ls.get("baseProject");
          console.log("baseProject==>" + baseProject)
          var hostname = window.location.protocol + "//" + window.location.host;
          var url = hostname + '/' + baseProject + '/sys/common/static';
          return getFileAccessHttpUrl(record.path + record.encodeName, url, window._CONFIG['hyperTextTransfer'])
        } else {
          //根据发布状态修改https æˆ– http
          return getFileAccessHttpUrl(record.path + record.encodeName, this.url.urlDownload, window._CONFIG['hyperTextTransfer'])
        }
      } else if (record.uploadType == 'alioss') {
        const OSS = require('ali-oss')
        const client = new OSS({
          // region以杭州为例(oss-cn-hangzhou),其他region按实际情况填写。
          region: window._CONFIG['region'],
          // é˜¿é‡Œäº‘主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录RAM控制台创建RAM账号。
          accessKeyId: window._CONFIG['accessKeyId'],
          accessKeySecret: window._CONFIG['accessKeySecret'],
          bucket: window._CONFIG['bucket'],
        })
        // object-key表示从OSS下载文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。
        return client.signatureUrl(record.path)
      }
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.hightColor {
  height: 10%;
  font-weight: bold;
  font-size: 20px;
  color: #1b1e1e;
}
.frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.hight {
  color: #f5222d;
}
/deep/ .red {
  color: red;
}
</style>
src/views/eam/modules/daily3MaintenanceOrder/EquipmentPrecisionCheckOrderModal.vue
ÎļþÃû´Ó src/views/eam/modules/dailyMaintenanceOrder/EquipmentPrecisionCheckOrderModal.vue ÐÞ¸Ä
@@ -456,6 +456,7 @@
        if (res.success) {
          this.dataSource = res.result[0].precisionInspectionDetails
          this.model = Object.assign({}, res.result[0]);
          debugger
        }
      })
    },
src/views/eam/modules/daily3MaintenanceOrder/EquipmentTechnologyStatusModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,229 @@
<template>
  <a-modal
    :title="title"
    :width="650"
    :visible="visible"
    :maskClosable="false"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              label="统一编号"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入统一编号'"
                v-decorator="['equipmentNum', validatorRules.equipmentNum ]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item
              label="设备名称"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入设备名称'"
                v-decorator="['equipmentName', validatorRules.equipmentName ]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item
              label="型号"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入型号'"
                v-decorator="['equipmentModel', validatorRules.equipmentModel ]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item
              label="规格"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input
                allow-clear
                :disabled="true"
                :placeholder="disableSubmit?'':'请输入规格'"
                v-decorator="['specification', validatorRules.specification ]"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item
              label="技术状态"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="technologyStatus"
            >
              <j-dict-select-tag
                allow-clear
                placeholder="请选择技术状态"
                :triggerChange="true"
                dictCode="technology_status"
                v-decorator="['technologyStatus', validatorRules.technologyStatus ]"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <template slot="footer">
      <a-button
        :style="{marginRight: '8px'}"
        @click="handleCancel"
      >
        å…³é—­
      </a-button>
      <a-button
        :disabled="disableSubmit || confirmLoading"
        :loading="confirmLoading"
        @click="handleOk"
        type="primary"
      >保存</a-button>
      <!-- icon="save" -->
    </template>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
export default {
  name: 'EquipmentTechnologyStatusModal',
  data() {
    return {
      title: "操作",
      visible: false,
      codeDisable: true,
      disableSubmit: false,
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 19 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        technologyStatus: {
          rules: [
            { required: true, message: '请输入选择技术状态!' },
          ]
        },
      },
      url: {
        edit: "/eam/dailyMaintenanceOrder/editTechnologyStatus"
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: ""
    }
  },
  created() {
  },
  methods: {
    edit(record) {
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.visible = true;
      this.disableSubmit = false;
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'equipmentNum', 'equipmentName', 'equipmentModel', 'specification', 'technologyStatus'))
      });
      if (record.id) {
        this.codeDisable = true;
      } else {
        this.codeDisable = false;
      }
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          let obj;
          if (!this.model.id) {
            obj = postAction(this.url.add, formData);
          } else {
            obj = requestPut(this.url.edit, { id: this.model.equipmentId, technologyStatus: this.model.technologyStatus, maintenanceOrderId: this.model.id });
          }
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
              that.alterFlag = new Date();
            } else {
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        }
      })
    },
    handleCancel() {
      this.close()
    },
  },
}
</script>
<style scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
</style>
src/views/eam/modules/daily3MaintenanceOrder/StoveCategoryModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1000 @@
<template>
  <a-modal
    :width="1000"
    :visible="visible"
    :maskClosable="false"
    @ok="handleOk"
    cancelText="关闭"
    @cancel="handleCancel"
    :confirmLoading="confirmLoading"
  >
    <!-- :title="title" -->
    <!-- <a-spin :spinning="confirmLoading"> -->
    <!-- <a-form :form="form"> -->
    <a-divider
      orientation="center"
      style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;"
    > æ¸©åº¦å‡åŒ€æ€§æ£€æµ‹æ¡ä»¶ç¡®è®¤è¡¨ </a-divider>
    <!-- <div :style="{height: '115px',float: 'left',width: '100%',border: '1px solid #e9e9e9',padding: '50px 20px',background: '#fff',}"> -->
    <span
      class="ant-descriptions-title"
      style="font-size: large;font-style: normal;font-size: 20px;"
    >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在三保实施过程中,进行了维修或更换且符合以下条款之一者必须进行炉温均匀性检测并对下列条款进行打√确认。</span>
    <!-- </div> -->
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >序号</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >维修或更换项目</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >是/否</span>
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >1</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >增加最高工作温度或降低最低工作温度</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_1 == '1'"
          @change="handleSwitch(model.result_1)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >2</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >炉子温度均匀性变更为更小的温度偏差要求</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_2 == '1'"
          @change="handle2Switch(model.result_2)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >3</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >使用不同的加热组件或加热组件的类型或位置变化</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_3 == '1'"
          @change="handle3Switch(model.result_3)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >4</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >热风循环设备的气流方式/速率变化的。如:挡板位置、风扇速度、风扇数量等等变化</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_4 == '1'"
          @change="handle4Switch(model.result_4)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >5</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >耐热层厚度的改变或使用不同热性能的新型耐热材料</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_5 == '1'"
          @change="handle5Switch(model.result_5)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >6</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >真空炉加热室重新设计或材料改变</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_6 == '1'"
          @change="handle6Switch(model.result_6)"
        />
      </div>
    </div>
    <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
      <span
        class="ant-descriptions-title"
        style="font-size: large;font-style: normal;font-size: 15px;"
      >7</span>
    </div>
    <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
      <span
        class="ant-descriptions-title"
        style="font-size: large;font-style: normal;font-size: 15px;"
      >控制传感器位置或类型发生改变</span>
    </div>
    <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
      <a-switch
        checked-children="是"
        un-checked-children="否"
        :checked="model.result_7 == '1'"
        @change="handle7Switch(model.result_7)"
      />
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >8</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >温度控制系统、控制方式或参数发生改变</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_8 == '1'"
          @change="handle8Switch(model.result_8)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >9</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >燃气炉燃烧压气设定值相对于原始设定值发生改变</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_9 == '1'"
          @change="handle9Switch(model.result_9)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >10</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >工作区位置或大小改变</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_10 == '1'"
          @change="handle10Switch(model.result_10)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >11</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >采用原有规格和型号的材料、在原有位置上更换加热系统</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_11 == '1'"
          @change="handle11Switch(model.result_11)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >12</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >使用相同或相似传热特性的材料更换原有耐热材料</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_12 == '1'"
          @change="handle12Switch(model.result_12)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >13</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >维修热风循环设备,其气流方式/速率与原来一致的。如:挡板位置、风扇速度、风扇数量等</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_13 == '1'"
          @change="handle13Switch(model.result_13)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >14</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >按规定的位置更换同类型控制传感器</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_14 == '1'"
          @change="handle14Switch(model.result_14)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >15</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >按原来的型号、参数更换温度控制仪表</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_15 == '1'"
          @change="handle15Switch(model.result_15)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >16</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >设备的安装位置被改变</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_16 == '1'"
          @change="handle16Switch(model.result_16)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >17</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >更换加热系统连接件或配件</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_17 == '1'"
          @change="handle17Switch(model.result_17)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >18</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >使用过程中,炉子上其它传感器(监测、超温或记录)的读数超出均匀性要求范围,且与均匀性有关</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_18 == '1'"
          @change="handle18Switch(model.result_18)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >19</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >炉门部分维修</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_19 == '1'"
          @change="handle19Switch(model.result_19)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '45px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >20</span>
      </div>
      <div :style="{height: '45px',float: 'left',width: '80%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >加热炉停用三个月以上,再次使用前</span>
      </div>
      <div :style="{height: '45px',float: 'right',width: '10%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-switch
          checked-children="是"
          un-checked-children="否"
          :checked="model.result_20 == '1'"
          @change="handle20Switch(model.result_20)"
        />
      </div>
    </div>
    <div>
      <div :style="{height: '130px',float: 'left',width: '10%',border: '1px solid #e9e9e9',padding: '20px 20px',background: '#fff',}">
        <span
          class="ant-descriptions-title"
          style="font-size: large;font-style: normal;font-size: 15px;"
        >确认</span>
      </div>
      <div :style="{height: '130px',float: 'left',width: '90%',border: '1px solid #e9e9e9',padding: '10px 10px',background: '#fff',}">
        <a-row :gutter="24">
          <span
            class="ant-descriptions-title"
            style="font-size: large;font-style: normal;font-size: 15px;"
          >&nbsp;&nbsp;&nbsp;1、经对设备进行三保及对上述项目进行确认,无需进行温度均匀性检测&nbsp;&nbsp;&nbsp;</span>
          <a-switch
            checked-children="是"
            un-checked-children="否"
            :checked="model.result_21 == '1'"
            @change="handle21Switch(model.result_21)"
          />
          <span
            class="ant-descriptions-title"
            style="font-size: large;font-style: normal;font-size: 15px;"
          >&nbsp;&nbsp;&nbsp;。</span>
        </a-row>
        <a-row :gutter="24">
          <span
            class="ant-descriptions-title"
            style="font-size: large;font-style: normal;font-size: 15px;"
          >&nbsp;&nbsp;&nbsp;2、经对第&nbsp;&nbsp;&nbsp;</span>
          <a-input-number
            v-model="model.sort"
            :min=0
            :max=20
          />
          <span
            class="ant-descriptions-title"
            style="font-size: large;font-style: normal;font-size: 15px;"
          >&nbsp;&nbsp;&nbsp;项进行维修或更换(改变)等,需进行温度均匀性检测&nbsp;&nbsp;&nbsp;</span>
          <a-switch
            checked-children="是"
            un-checked-children="否"
            :checked="model.result_22 == '1'"
            @change="handle22Switch(model.result_22)"
          />
          <span
            class="ant-descriptions-title"
            style="font-size: large;font-style: normal;font-size: 15px;"
          >&nbsp;&nbsp;&nbsp;。</span>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <span
              class="ant-descriptions-title"
              style="font-size: large;font-style: normal;font-size: 15px;"
            >&nbsp;&nbsp;&nbsp;维修室主任:&nbsp;&nbsp;&nbsp;</span>
            <span v-if="this.model != null">{{ this.model.repairDirectorUserName }}</span>
            <span v-else>-</span>
          </a-col>
          <a-col :span="12">
            <span
              class="ant-descriptions-title"
              style="font-size: large;font-style: normal;font-size: 15px;"
            >&nbsp;&nbsp;&nbsp;保养人员:&nbsp;&nbsp;&nbsp;</span>
            <span v-if="this.model != null">{{ this.model.maintenanceUserName }}</span>
            <span v-else>-</span>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <span
              class="ant-descriptions-title"
              style="font-size: large;font-style: normal;font-size: 15px;"
            >&nbsp;&nbsp;&nbsp;仪表工:&nbsp;&nbsp;&nbsp;</span>
            <span v-if="this.model != null">{{ this.model.meterUserName }}</span>
            <span v-else>-</span>
          </a-col>
          <a-col :span="12">
            <span
              class="ant-descriptions-title"
              style="font-size: large;font-style: normal;font-size: 15px;"
            >&nbsp;&nbsp;&nbsp;日期:&nbsp;&nbsp;&nbsp;</span>
            <span v-if="this.model != null">{{ this.model.updateTime }}</span>
            <span v-else>-</span>
          </a-col>
        </a-row>
      </div>
    </div>
    <!-- </a-form> -->
    <!-- </a-spin> -->
    <template slot="footer">
      <a-button
        :style="{marginRight: '8px'}"
        @click="handleCancel()"
      >
        å…³é—­
      </a-button>
      <a-button
        @click="handleOk()"
        type="primary"
        :loading="confirmLoading"
        :disabled="disableSubmit || confirmLoading"
      >确定</a-button>
    </template>
  </a-modal>
</template>
<script>
import { getAction, postAction, requestPut } from '@/api/manage'
import pick from 'lodash.pick'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import Tooltip from 'ant-design-vue/es/tooltip'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileAccessHttpUrl } from '@/api/manage';
export default {
  name: "StoveCategoryModal",
  mixins: [JeecgListMixin],
  components: {
    JMultiSelectTag,
    Tooltip,
  },
  data() {
    return {
      title: "操作",
      visible: false,
      disableSubmit: false,
      codeDisable: true,
      dataSource: [],
      model: {},
      departs: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        num: {
          rules: [
            { required: true, message: '请输入保养工单编码!' },
          ]
        },
      },
      url: {
        add: "/eam/maintenanceStoveExempt/maintenanceStoveExempt",
        getStoveCategory: "/eam/maintenanceStoveExempt/getStoveCategory",
        list: "/eam/dailyMaintenanceOrder/getMaintenanceCycleByStandardId",
      },
    }
  },
  methods: {
    edit(record) {
      let that = this;
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.getStoveCategory()
      this.visible = true;
      that.$nextTick(() => {
        // that.form.setFieldsValue(pick(that.model, 'num', 'teamId', 'remark'));
      });
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleCancel() {
      this.close();
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      that.form.validateFields((err, values) => {
        if (!err) {
          this.$confirm({
            title: '温度均匀性检测条件确认',
            content: '提示:请谨慎操作!',
            okText: '确认',
            cancelText: '取消',
            onOk() {
              let formData = Object.assign(that.model, values);
              that.confirmLoading = true;
              postAction(that.url.add, formData).then((res) => {
                if (res.success) {
                  that.$message.success(res.message);
                  that.$emit('ok', new Date());
                } else {
                  that.$message.warning(res.message);
                }
              }).finally(() => {
                that.confirmLoading = false;
                that.close();
              })
            },
          })
        }
      })
    },
    handleDelete(text, record, index) {
      this.dataSource.splice(index, 1);
    },
    getStoveCategory() {
      getAction(this.url.getStoveCategory, { maintenanceOrderId: this.model.id }).then((res) => {
        if (res.success) {
          this.model = Object.assign({}, res.result[0]);
        }
      })
    },
    handleSwitch(result_1) {
      if ('0' == result_1) {
        this.model.result_1 = '1'
      } else {
        this.model.result_1 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle2Switch(result_2) {
      if ('0' == result_2) {
        this.model.result_2 = '1'
      } else {
        this.model.result_2 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    // handle2Switch(result2) {
    //   if ('0' == result2) {
    //     this.model.result2 = '1'
    //   } else {
    //     this.model.result2 = '0'
    //   }
    //   this.model = Object.assign({}, this.model);
    // },
    handle3Switch(result_3) {
      if ('0' == result_3) {
        this.model.result_3 = '1'
      } else {
        this.model.result_3 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle4Switch(result_4) {
      if ('0' == result_4) {
        this.model.result_4 = '1'
      } else {
        this.model.result_4 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle5Switch(result_5) {
      if ('0' == result_5) {
        this.model.result_5 = '1'
      } else {
        this.model.result_5 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle6Switch(result_6) {
      if ('0' == result_6) {
        this.model.result_6 = '1'
      } else {
        this.model.result_6 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle7Switch(result_7) {
      if ('0' == result_7) {
        this.model.result_7 = '1'
      } else {
        this.model.result_7 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle8Switch(result_8) {
      if ('0' == result_8) {
        this.model.result_8 = '1'
      } else {
        this.model.result_8 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle9Switch(result_9) {
      if ('0' == result_9) {
        this.model.result_9 = '1'
      } else {
        this.model.result_9 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle10Switch(result_10) {
      if ('0' == result_10) {
        this.model.result_10 = '1'
      } else {
        this.model.result_10 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle11Switch(result_11) {
      if ('0' == result_11) {
        this.model.result_11 = '1'
      } else {
        this.model.result_11 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle12Switch(result_12) {
      if ('0' == result_12) {
        this.model.result_12 = '1'
      } else {
        this.model.result_12 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle13Switch(result_13) {
      if ('0' == result_13) {
        this.model.result_13 = '1'
      } else {
        this.model.result_13 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle14Switch(result_14) {
      if ('0' == result_14) {
        this.model.result_14 = '1'
      } else {
        this.model.result_14 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle15Switch(result_15) {
      if ('0' == result_15) {
        this.model.result_15 = '1'
      } else {
        this.model.result_15 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle16Switch(result_16) {
      if ('0' == result_16) {
        this.model.result_16 = '1'
      } else {
        this.model.result_16 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle17Switch(result_17) {
      if ('0' == result_17) {
        this.model.result_17 = '1'
      } else {
        this.model.result_17 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle18Switch(result_18) {
      if ('0' == result_18) {
        this.model.result_18 = '1'
      } else {
        this.model.result_18 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle19Switch(result_19) {
      if ('0' == result_19) {
        this.model.result_19 = '1'
      } else {
        this.model.result_19 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle20Switch(result_20) {
      if ('0' == result_20) {
        this.model.result_20 = '1'
      } else {
        this.model.result_20 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle21Switch(result_21) {
      if ('0' == result_21) {
        this.model.result_21 = '1'
      } else {
        this.model.result_21 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    handle22Switch(result_22) {
      if ('0' == result_22) {
        this.model.result_22 = '1'
      } else {
        this.model.result_22 = '0'
      }
      this.model = Object.assign({}, this.model);
    },
    // onChangeJudgmentResult(e) {
    //   this.model.judgmentResult = e.target.value
    // },
    // handleChange(value, key, column, index) {
    //   let that = this;
    //   const temp = [...that.dataSource];
    //   const target = temp.filter(item => key === item.key)[index];
    //   if (target) {
    //     if ('actualMeasure' == column.dataIndex) {
    //       target['actualMeasure'] = value.target.value;
    //     }
    //     //显示带过来的数据
    //     that.dataSource = temp;
    //   }
    // },
  },
}
</script>
<style lang="less" scoped>
/deep/ .frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
.hightColor {
  height: 10%;
  font-weight: bold;
  font-size: 20px;
  color: #1b1e1e;
}
.frozenRowClass {
  color: #c9c9c9;
}
.fontweight {
  font-weight: bold;
}
.hight {
  color: #f5222d;
}
/deep/ .red {
  color: red;
}
.line {
  width: 1px;
  height: 300px;
  background-color: #000;
  border: none;
  float: left;
}
</style>
src/views/eam/modules/dailyMaintenanceOrder/ActualWorkHoursEditTable.vue
@@ -175,7 +175,7 @@
          dataIndex: 'username',
          align: "center",
          scopedSlots: { customRender: 'username' },
          className: 'red',
          // className: 'red',
          width: 250,
        },
        {
@@ -188,7 +188,7 @@
          title: '*实际工时',
          dataIndex: 'actualWorkingHourQuota',
          align: "center",
          className: 'red',
          // className: 'red',
          scopedSlots: { customRender: 'actualWorkingHourQuota' },
          width: 250,
        },
src/views/system/DepartList.vue
@@ -1,51 +1,105 @@
<template xmlns:background-color="http://www.w3.org/1999/xhtml">
  <a-row :gutter="10">
    <a-col :md="12" :sm="24">
    <a-col
      :md="12"
      :sm="24"
    >
      <a-card :bordered="false">
        <!-- æŒ‰é’®æ“ä½œåŒºåŸŸ -->
        <a-row style="margin-left: 14px">
          <a-button @click="handleAdd(1)" type="primary">添加部门</a-button>
          <a-button @click="handleAdd(2)" type="primary">添加下级</a-button>
          <a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button>
          <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
            <a-button type="primary" icon="import">导入</a-button>
          <a-button
            @click="handleAdd(1)"
            type="primary"
          >添加部门</a-button>
          <a-button
            @click="handleAdd(2)"
            type="primary"
          >添加下级</a-button>
          <a-button
            type="primary"
            icon="download"
            @click="handleExportXls('部门信息')"
          >导出</a-button>
          <a-upload
            name="file"
            :showUploadList="false"
            :multiple="false"
            :headers="tokenHeader"
            :action="importExcelUrl"
            @change="handleImportExcel"
          >
            <a-button
              type="primary"
              icon="import"
            >导入</a-button>
          </a-upload>
          <a-button title="删除多条数据" @click="batchDel" type="default">批量删除</a-button>
          <a-button
            title="删除多条数据"
            @click="batchDel"
            type="default"
          >批量删除</a-button>
          <!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>-->
        </a-row>
        <div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
          <a-alert type="info" :showIcon="true">
          <a-alert
            type="info"
            :showIcon="true"
          >
            <div slot="message">
              å½“前选择:<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
              <a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a>
              <a
                v-if="this.currSelected.title"
                style="margin-left: 10px"
                @click="onClearSelected"
              >取消选择</a>
            </div>
          </a-alert>
          <a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/>
          <a-input-search
            @search="onSearch"
            style="width:100%;margin-top: 10px"
            placeholder="请输入部门名称"
          />
          <!-- æ ‘-->
          <a-col :md="10" :sm="24">
          <a-col
            :md="10"
            :sm="24"
          >
            <template>
              <a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">
               <span style="user-select: none">
            <a-tree
              checkable
              multiple
              @select="onSelect"
              @check="onCheck"
              @rightClick="rightHandle"
              :selectedKeys="selectedKeys"
              :checkedKeys="checkedKeys"
              :treeData="departTree"
              :checkStrictly="checkStrictly"
              :expandedKeys="iExpandedKeys"
              :autoExpandParent="autoExpandParent"
              @expand="onExpand"/>
              <a-dropdown
                :trigger="[this.dropTrigger]"
                @visibleChange="dropStatus"
              >
                <span style="user-select: none">
                  <a-tree
                    checkable
                    multiple
                    @select="onSelect"
                    @check="onCheck"
                    @rightClick="rightHandle"
                    :selectedKeys="selectedKeys"
                    :checkedKeys="checkedKeys"
                    :treeData="departTree"
                    :checkStrictly="checkStrictly"
                    :expandedKeys="iExpandedKeys"
                    :autoExpandParent="autoExpandParent"
                    @expand="onExpand"
                  />
                </span>
                <!--新增右键点击事件,和增加添加和删除功能-->
                <a-menu slot="overlay">
                  <a-menu-item @click="handleAdd(3)" key="1">添加</a-menu-item>
                  <a-menu-item @click="handleDelete" key="2">删除</a-menu-item>
                  <a-menu-item @click="closeDrop" key="3">取消</a-menu-item>
                  <a-menu-item
                    @click="handleAdd(3)"
                    key="1"
                  >添加</a-menu-item>
                  <a-menu-item
                    @click="handleDelete"
                    key="2"
                  >删除</a-menu-item>
                  <a-menu-item
                    @click="closeDrop"
                    key="3"
                  >取消</a-menu-item>
                </a-menu>
              </a-dropdown>
            </template>
@@ -54,14 +108,35 @@
      </a-card>
      <!---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------>
      <div class="drawer-bootom-button">
        <a-dropdown :trigger="['click']" placement="topCenter">
        <a-dropdown
          :trigger="['click']"
          placement="topCenter"
        >
          <a-menu slot="overlay">
            <a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
            <a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
            <a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
            <a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
            <a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
            <a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
            <a-menu-item
              key="1"
              @click="switchCheckStrictly(1)"
            >父子关联</a-menu-item>
            <a-menu-item
              key="2"
              @click="switchCheckStrictly(2)"
            >取消关联</a-menu-item>
            <a-menu-item
              key="3"
              @click="checkALL"
            >全部勾选</a-menu-item>
            <a-menu-item
              key="4"
              @click="cancelCheckALL"
            >取消全选</a-menu-item>
            <a-menu-item
              key="5"
              @click="expandAll"
            >展开所有</a-menu-item>
            <a-menu-item
              key="6"
              @click="closeAll"
            >合并所有</a-menu-item>
          </a-menu>
          <a-button>
            æ ‘操作 <a-icon type="up" />
@@ -70,589 +145,684 @@
      </div>
      <!---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------>
    </a-col>
    <a-col :md="12" :sm="24">
    <a-col
      :md="12"
      :sm="24"
    >
      <a-tabs defaultActiveKey="1">
        <a-tab-pane tab="基本信息" key="1" >
          <a-card :bordered="false" v-if="selectedKeys.length>0">
            <a-form-model ref="form" :model="model" :rules="validatorRules">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departName" label="机构名称">
                <a-input placeholder="请输入机构/部门名称" v-model="model.departName" />
        <a-tab-pane
          tab="基本信息"
          key="1"
        >
          <a-card
            :bordered="false"
            v-if="selectedKeys.length>0"
          >
            <a-form-model
              ref="form"
              :model="model"
              :rules="validatorRules"
            >
              <a-form-model-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                prop="departName"
                label="机构名称"
              >
                <a-input
                  placeholder="请输入机构/部门名称"
                  v-model="model.departName"
                />
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
              <a-form-model-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="使用部门编码"
                prop="useDepartNum"
              >
                <a-input
                  id="useDepartNum"
                  placeholder="请输入使用部门编码"
                  v-model="model.useDepartNum"
                />
              </a-form-model-item>
              <a-form-model-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="维修部门编码"
                prop="repairDepartNum"
              >
                <a-input
                  id="repairDepartNum"
                  placeholder="请输入维修部门编码"
                  v-model="model.repairDepartNum"
                />
              </a-form-model-item>
              <a-form-model-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="上级部门"
              >
                <a-tree-select
                  style="width:100%"
                  :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
                  :treeData="treeData"
                  :disabled="disable"
                  v-model="model.parentId"
                  placeholder="无">
                  placeholder="无"
                >
                </a-tree-select>
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
              <a-form-model-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="排序"
              >
                <a-input-number v-model="model.departOrder" />
              </a-form-model-item>
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="备注">
                <a-textarea placeholder="请输入备注" v-model="model.memo"/>
              <a-form-model-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="备注"
              >
                <a-textarea
                  placeholder="请输入备注"
                  v-model="model.memo"
                />
              </a-form-model-item>
            </a-form-model>
            <div class="anty-form-btn">
              <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
              <a-button @click="submitCurrForm" type="primary" htmlType="button" icon="form">保存</a-button>
              <a-button
                @click="emptyCurrForm"
                type="default"
                htmlType="button"
                icon="sync"
              >重置</a-button>
              <a-button
                @click="submitCurrForm"
                type="primary"
                htmlType="button"
                icon="form"
              >保存</a-button>
            </div>
          </a-card>
          <a-card v-else >
          <a-card v-else>
            <a-empty>
              <span slot="description"> è¯·å…ˆé€‰æ‹©ä¸€ä¸ªéƒ¨é—¨! </span>
            </a-empty>
          </a-card>
        </a-tab-pane>
        <a-tab-pane tab="部门权限" key="2" forceRender>
        <a-tab-pane
          tab="部门权限"
          key="2"
          forceRender
        >
          <!--<depart-auth-modal ref="departAuth"/>-->
          <depart-m-auth-modal ref="departMAuth"></depart-m-auth-modal>
        </a-tab-pane>
        <a-tab-pane v-if="isDepartType == 0" tab="设备列表" key="3" forceRender>
          <depart-auth-modal ref="departAuth"/>
        <a-tab-pane
          v-if="isDepartType == 0"
          tab="设备列表"
          key="3"
          forceRender
        >
          <depart-auth-modal ref="departAuth" />
        </a-tab-pane>
        <a-tab-pane
          v-if="isDepartType == 0"
          tab="班组列表"
          key="4"
          forceRender
        >
          <depart-team ref="departTeam" />
        </a-tab-pane>
      </a-tabs>
    </a-col>
    <depart-modal ref="departModal" @ok="loadTree"></depart-modal>
    <depart-modal
      ref="departModal"
      @ok="loadTree"
    ></depart-modal>
  </a-row>
</template>
<script>
  import {mapActions} from 'vuex'
  import DepartMModal from './modules/DepartModal'
  import DepartModal from './modules/DepartList/DepartModal'
  import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api'
  import {httpAction, deleteAction} from '@/api/manage'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import DepartAuthModal from './modules/DepartList/DepartAuthModal'
  import DepartMAuthModal from './modules/DepartAuthModal'
import { mapActions } from 'vuex'
import DepartMModal from './modules/DepartModal'
import DepartModal from './modules/DepartList/DepartModal'
import { queryDepartTreeList, searchByKeywords, deleteByDepartId } from '@/api/api'
import { httpAction, deleteAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DepartAuthModal from './modules/DepartList/DepartAuthModal'
import DepartMAuthModal from './modules/DepartAuthModal'
import DepartTeam from './modules/DepartList/DepartTeam'
  // è¡¨å¤´
  const columns = [
    {
      title: '机构名称',
      dataIndex: 'departName'
    },
    {
      title: '机构类型',
      align: 'center',
      dataIndex: 'orgType'
    },
    {
      title: '机构编码',
      dataIndex: 'orgCode',
    },
    {
      title: '手机号',
      dataIndex: 'mobile'
    },
    {
      title: '传真',
      dataIndex: 'fax'
    },
    {
      title: '地址',
      dataIndex: 'address'
    },
    {
      title: '排序',
      align: 'center',
      dataIndex: 'departOrder'
    },
    {
      title: '操作',
      align: 'center',
      dataIndex: 'action',
      scopedSlots: {customRender: 'action'}
// è¡¨å¤´
const columns = [
  {
    title: '机构名称',
    dataIndex: 'departName'
  },
  {
    title: '机构类型',
    align: 'center',
    dataIndex: 'orgType'
  },
  {
    title: '机构编码',
    dataIndex: 'orgCode',
  },
  {
    title: '手机号',
    dataIndex: 'mobile'
  },
  {
    title: '传真',
    dataIndex: 'fax'
  },
  {
    title: '地址',
    dataIndex: 'address'
  },
  {
    title: '排序',
    align: 'center',
    dataIndex: 'departOrder'
  },
  {
    title: '操作',
    align: 'center',
    dataIndex: 'action',
    scopedSlots: { customRender: 'action' }
  }
]
export default {
  name: 'DepartList',
  mixins: [JeecgListMixin],
  components: {
    DepartAuthModal,
    DepartModal,
    DepartMModal,
    DepartMAuthModal,
    DepartTeam
  },
  data() {
    return {
      isDepartType: "",
      iExpandedKeys: [],
      loading: false,
      autoExpandParent: true,
      currFlowId: '',
      currFlowName: '',
      disable: true,
      treeData: [],
      visible: false,
      departTree: [],
      rightClickSelectedKey: '',
      rightClickSelectedOrgCode: '',
      hiding: true,
      model: {},
      dropTrigger: '',
      depart: {},
      columns: columns,
      disableSubmit: false,
      checkedKeys: [],
      selectedKeys: [],
      autoIncr: 1,
      currSelected: {},
      allTreeKeys: [],
      checkStrictly: true,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      graphDatasource: {
        nodes: [],
        edges: []
      },
      validatorRules: {
        departName: [{ required: true, message: '请输入机构/部门名称!' }],
        orgCode: [{ required: true, message: '请输入机构编码!' }],
        orgCategory: [{ required: true, message: '请输入机构类型!' }],
        mobile: [{ validator: this.validateMobile }]
      },
      url: {
        delete: '/sys/sysDepart/delete',
        edit: '/sys/sysDepart/edit',
        deleteBatch: '/sys/sysDepart/deleteBatch',
        exportXlsUrl: "sys/sysDepart/exportXls",
        importExcelUrl: "sys/sysDepart/importExcel",
      },
      orgCategoryDisabled: false,
    }
  ]
  export default {
    name: 'DepartList',
    mixins: [JeecgListMixin],
    components: {
      DepartAuthModal,
      DepartModal,
      DepartMModal,
      DepartMAuthModal
    },
    data() {
      return {
        isDepartType:"",
        iExpandedKeys: [],
        loading: false,
        autoExpandParent: true,
        currFlowId: '',
        currFlowName: '',
        disable: true,
        treeData: [],
        visible: false,
        departTree: [],
        rightClickSelectedKey: '',
        rightClickSelectedOrgCode: '',
        hiding: true,
        model: {},
        dropTrigger: '',
        depart: {},
        columns: columns,
        disableSubmit: false,
        checkedKeys: [],
        selectedKeys: [],
        autoIncr: 1,
        currSelected: {},
        allTreeKeys:[],
        checkStrictly: true,
        labelCol: {
          xs: {span: 24},
          sm: {span: 5}
        },
        wrapperCol: {
          xs: {span: 24},
          sm: {span: 16}
        },
        graphDatasource: {
          nodes: [],
          edges: []
        },
        validatorRules: {
          departName: [{required: true, message: '请输入机构/部门名称!'}],
          orgCode: [{required: true, message: '请输入机构编码!'}],
          orgCategory:[{required: true, message: '请输入机构类型!'}],
          mobile:[{validator: this.validateMobile}]
        },
        url: {
          delete: '/sys/sysDepart/delete',
          edit: '/sys/sysDepart/edit',
          deleteBatch: '/sys/sysDepart/deleteBatch',
          exportXlsUrl: "sys/sysDepart/exportXls",
          importExcelUrl: "sys/sysDepart/importExcel",
        },
        orgCategoryDisabled:false,
      }
    },
    computed: {
      importExcelUrl: function () {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() =>{
        })
      },
      loadData() {
        this.refresh();
      },
      loadTree() {
        var that = this
        that.treeData = []
        that.departTree = []
        queryDepartTreeList().then((res) => {
          if (res.success) {
            //部门全选后,再添加部门,选中数量增多
            this.allTreeKeys = [];
            for (let i = 0; i < res.result.length; i++) {
              let temp = res.result[i]
              that.treeData.push(temp)
              that.departTree.push(temp)
              that.setThisExpandedKeys(temp)
              that.getAllKeys(temp);
              // console.log(temp.id)
            }
            this.loading = false
          }
        })
      },
      setThisExpandedKeys(node) {
        if (node.children && node.children.length > 0) {
          this.iExpandedKeys.push(node.key)
          for (let a = 0; a < node.children.length; a++) {
            this.setThisExpandedKeys(node.children[a])
          }
        }
      },
      refresh() {
        this.loading = true
        this.loadTree()
      },
      // å³é”®æ“ä½œæ–¹æ³•
      rightHandle(node) {
        this.dropTrigger = 'contextmenu'
        console.log(node.node.eventKey)
        this.rightClickSelectedKey = node.node.eventKey
        this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
      },
      onExpand(expandedKeys) {
        console.log('onExpand', expandedKeys)
        this.iExpandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      backFlowList() {
        this.$router.back(-1)
      },
      // å³é”®ç‚¹å‡»ä¸‹æ‹‰æ¡†æ”¹å˜äº‹ä»¶
      dropStatus(visible) {
        if (visible == false) {
          this.dropTrigger = ''
        }
      },
      // å³é”®ä¸‹æ‹‰å…³é—­ä¸‹æ‹‰æ¡†
      closeDrop() {
        this.dropTrigger = ''
      },
      addRootNode() {
        this.$refs.nodeModal.add(this.currFlowId, '')
      },
      batchDel: function () {
        if (this.checkedKeys.length <= 0) {
          // this.$message.warning('请选择一条记录!')
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  methods: {
    ...mapActions(['QueryDepartTree']),
    queryTreeData() {
      this.QueryDepartTree().then(res => {
        if (res.success) {
          this.isDepartType = res.result[0].value
        } else {
          // this.$message.warn(res.message)
          this.$notification.warning({
            message:'消息',
            description:"请选择一条记录"
            message: '消息',
            description: res.message
          });
        } else {
          var ids = ''
          for (var a = 0; a < this.checkedKeys.length; a++) {
            ids += this.checkedKeys[a] + ','
        }
      }).finally(() => {
      })
    },
    loadData() {
      this.refresh();
    },
    loadTree() {
      var that = this
      that.treeData = []
      that.departTree = []
      queryDepartTreeList().then((res) => {
        if (res.success) {
          //部门全选后,再添加部门,选中数量增多
          this.allTreeKeys = [];
          for (let i = 0; i < res.result.length; i++) {
            let temp = res.result[i]
            that.treeData.push(temp)
            that.departTree.push(temp)
            that.setThisExpandedKeys(temp)
            that.getAllKeys(temp);
            // console.log(temp.id)
          }
          var that = this
          this.$confirm({
            title: '确认删除',
            content: '确定要删除所选中的 ' + this.checkedKeys.length + ' æ¡æ•°æ®ï¼Œä»¥åŠå­èŠ‚ç‚¹æ•°æ®å—?',
            onOk: function () {
              deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
                if (res.success) {
                  // that.$message.success(res.message)
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                  that.loadTree()
                  that.onClearSelected()
                } else {
                  // that.$message.warning(res.message)
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                }
              })
            }
          })
          this.loading = false
        }
      },
      onSearch(value) {
        let that = this
        if (value) {
          searchByKeywords({keyWord: value}).then((res) => {
            if (res.success) {
              that.departTree = []
              for (let i = 0; i < res.result.length; i++) {
                let temp = res.result[i]
                that.departTree.push(temp)
              }
            } else {
              // that.$message.warning(res.message)
              that.$notification.warning({
                message:'消息',
                description:res.message
              });
            }
          })
        } else {
          that.loadTree()
      })
    },
    setThisExpandedKeys(node) {
      if (node.children && node.children.length > 0) {
        this.iExpandedKeys.push(node.key)
        for (let a = 0; a < node.children.length; a++) {
          this.setThisExpandedKeys(node.children[a])
        }
      },
      nodeModalOk() {
        this.loadTree()
      },
      nodeModalClose() {
      },
      hide() {
        console.log(111)
        this.visible = false
      },
      onCheck(checkedKeys, info) {
        console.log('onCheck', checkedKeys, info)
        this.hiding = false
        //---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
        if(this.checkStrictly){
          this.checkedKeys = checkedKeys.checked;
        }else{
          this.checkedKeys = checkedKeys
      }
    },
    refresh() {
      this.loading = true
      this.loadTree()
    },
    // å³é”®æ“ä½œæ–¹æ³•
    rightHandle(node) {
      this.dropTrigger = 'contextmenu'
      console.log(node.node.eventKey)
      this.rightClickSelectedKey = node.node.eventKey
      this.rightClickSelectedOrgCode = node.node.dataRef.orgCode
    },
    onExpand(expandedKeys) {
      console.log('onExpand', expandedKeys)
      this.iExpandedKeys = expandedKeys
      this.autoExpandParent = false
    },
    backFlowList() {
      this.$router.back(-1)
    },
    // å³é”®ç‚¹å‡»ä¸‹æ‹‰æ¡†æ”¹å˜äº‹ä»¶
    dropStatus(visible) {
      if (visible == false) {
        this.dropTrigger = ''
      }
    },
    // å³é”®ä¸‹æ‹‰å…³é—­ä¸‹æ‹‰æ¡†
    closeDrop() {
      this.dropTrigger = ''
    },
    addRootNode() {
      this.$refs.nodeModal.add(this.currFlowId, '')
    },
    batchDel: function () {
      if (this.checkedKeys.length <= 0) {
        // this.$message.warning('请选择一条记录!')
        this.$notification.warning({
          message: '消息',
          description: "请选择一条记录"
        });
      } else {
        var ids = ''
        for (var a = 0; a < this.checkedKeys.length; a++) {
          ids += this.checkedKeys[a] + ','
        }
        //---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
      },
      onSelect(selectedKeys, e) {
        console.log('selected', selectedKeys, e)
        this.hiding = false
        let record = e.node.dataRef
        console.log('onSelect-record', record)
        this.currSelected = Object.assign({}, record)
        this.model = this.currSelected
        this.selectedKeys = [record.key]
        this.model.parentId = record.parentId
        this.setValuesToForm(record)
        if(this.isDepartType == 0){
          this.$refs.departAuth.show(record.id);
        }
        this.$refs.departMAuth.show(record.id)
      },
      // è§¦å‘onSelect事件时,为部门树右侧的form表单赋值
      setValuesToForm(record) {
        if(record.orgCategory == '1'){
          this.orgCategoryDisabled = true;
        }else{
          this.orgCategoryDisabled = false;
        }
      },
      getCurrSelectedTitle() {
        return !this.currSelected.title ? '' : this.currSelected.title
      },
      onClearSelected() {
        this.hiding = true
        this.checkedKeys = []
        this.currSelected = {}
        this.selectedKeys = []
        if(this.isDepartType == 0){
          this.$refs.departAuth.departId = ''
        }
        this.$refs.departMAuth.departId = ''
      },
      handleNodeTypeChange(val) {
        this.currSelected.nodeType = val
      },
      notifyTriggerTypeChange(value) {
        this.currSelected.notifyTriggerType = value
      },
      receiptTriggerTypeChange(value) {
        this.currSelected.receiptTriggerType = value
      },
      submitCurrForm() {
        this.$refs.form.validate(valid => {
          if (valid) {
            if (!this.currSelected.id) {
              // this.$message.warning('请点击选择要修改部门!')
              this.$notification.warning({
                message:'消息',
                description:"请点击选择要修改部门"
              });
              return
            }
            httpAction(this.url.edit, this.currSelected, 'put').then((res) => {
              if (res.success) {
                // this.$message.success('保存成功!')
                this.$notification.warning({
                  message:'消息',
                  description:"保存成功"
                });
                this.loadTree()
              } else {
                // this.$message.error(res.message)
                this.$notification.warning({
                  message:'消息',
                  description:res.message
                });
              }
            })
          }
        })
      },
      emptyCurrForm() {
        this.$refs.form.resetFields();
        this.model={}
      },
      nodeSettingFormSubmit() {
        this.$refs.form.validate(valid => {
          if (valid) {
            console.log('Received values of form: ', this.model)
          }
        })
      },
      openSelect() {
        this.$refs.sysDirectiveModal.show()
      },
      handleAdd(num) {
        if (num == 1) {
          this.$refs.departModal.add()
          this.$refs.departModal.title = '新增'
        } else if (num == 2) {
          console.log(this.currSelected)
          let key = this.currSelected.key
          if (!key) {
            this.$message.warning('请先点击选中上级部门!')
            return false
          }
          this.$refs.departModal.add(this.selectedKeys)
          this.$refs.departModal.title = '新增'
        } else {
          this.$refs.departModal.add(this.rightClickSelectedKey)
          this.$refs.departModal.title = '新增'
        }
      },
      handleDelete() {
        var that = this
        this.$confirm({
          title: '确认删除',
          content: '确定要删除此部门以及子节点数据吗?',
          content: '确定要删除所选中的 ' + this.checkedKeys.length + ' æ¡æ•°æ®ï¼Œä»¥åŠå­èŠ‚ç‚¹æ•°æ®å—?',
          onOk: function () {
            deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => {
              if (resp.success) {
                //删除成功后,去除已选中中的数据
                that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1);
                that.$message.success('删除成功!')
            deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
              if (res.success) {
                // that.$message.success(res.message)
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                });
                that.loadTree()
                //删除后同步清空右侧基本信息内容
                let orgCode=that.model.orgCode;
                if(orgCode && orgCode === that.rightClickSelectedOrgCode){
                  that.onClearSelected()
                }
                that.onClearSelected()
              } else {
                that.$message.warning('删除失败!')
                // that.$message.warning(res.message)
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                });
              }
            })
          }
        })
      },
      selectDirectiveOk(record) {
        console.log('选中指令数据', record)
        this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode})
        this.currSelected.sysCode = record.sysCode
      },
      getFlowGraphData(node) {
        this.graphDatasource.nodes.push({
          id: node.id,
          text: node.flowNodeName
      }
    },
    onSearch(value) {
      let that = this
      if (value) {
        searchByKeywords({ keyWord: value }).then((res) => {
          if (res.success) {
            that.departTree = []
            for (let i = 0; i < res.result.length; i++) {
              let temp = res.result[i]
              that.departTree.push(temp)
            }
          } else {
            // that.$message.warning(res.message)
            that.$notification.warning({
              message: '消息',
              description: res.message
            });
          }
        })
        if (node.children.length > 0) {
          for (let a = 0; a < node.children.length; a++) {
            let temp = node.children[a]
            this.graphDatasource.edges.push({
              source: node.id,
              target: temp.id
            })
            this.getFlowGraphData(temp)
          }
        }
      },
      } else {
        that.loadTree()
      }
    },
    nodeModalOk() {
      this.loadTree()
    },
    nodeModalClose() {
    },
    hide() {
      console.log(111)
      this.visible = false
    },
    onCheck(checkedKeys, info) {
      console.log('onCheck', checkedKeys, info)
      this.hiding = false
      //---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
      expandAll () {
        this.iExpandedKeys = this.allTreeKeys
      },
      closeAll () {
        this.iExpandedKeys = []
      },
      checkALL () {
        this.checkStriccheckStrictlytly = false
        this.checkedKeys = this.allTreeKeys
      },
      cancelCheckALL () {
        //this.checkedKeys = this.defaultCheckedKeys
        this.checkedKeys = []
      },
      switchCheckStrictly (v) {
        if(v==1){
          this.checkStrictly = false
        }else if(v==2){
          this.checkStrictly = true
        }
      },
      getAllKeys(node) {
        // console.log('node',node);
        this.allTreeKeys.push(node.key)
        if (node.children && node.children.length > 0) {
          for (let a = 0; a < node.children.length; a++) {
            this.getAllKeys(node.children[a])
          }
        }
      if (this.checkStrictly) {
        this.checkedKeys = checkedKeys.checked;
      } else {
        this.checkedKeys = checkedKeys
      }
      //---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
    },
    onSelect(selectedKeys, e) {
      console.log('selected', selectedKeys, e)
      this.hiding = false
      let record = e.node.dataRef
      console.log('onSelect-record', record)
      this.currSelected = Object.assign({}, record)
      this.model = this.currSelected
      this.selectedKeys = [record.key]
      this.model.parentId = record.parentId
      this.setValuesToForm(record)
      if (this.isDepartType == 0) {
        this.$refs.departAuth.show(record.id);
        this.$refs.departTeam.show(record.id);
      }
      this.$refs.departMAuth.show(record.id)
    },
    created() {
      this.queryTreeData()
      this.currFlowId = this.$route.params.id
      this.currFlowName = this.$route.params.name
      // this.loadTree()
    // è§¦å‘onSelect事件时,为部门树右侧的form表单赋值
    setValuesToForm(record) {
      if (record.orgCategory == '1') {
        this.orgCategoryDisabled = true;
      } else {
        this.orgCategoryDisabled = false;
      }
    },
    getCurrSelectedTitle() {
      return !this.currSelected.title ? '' : this.currSelected.title
    },
    onClearSelected() {
      this.hiding = true
      this.checkedKeys = []
      this.currSelected = {}
      this.selectedKeys = []
      if (this.isDepartType == 0) {
        this.$refs.departAuth.departId = ''
        this.$refs.departTeam.departId = ''
      }
      this.$refs.departMAuth.departId = ''
    },
    handleNodeTypeChange(val) {
      this.currSelected.nodeType = val
    },
    notifyTriggerTypeChange(value) {
      this.currSelected.notifyTriggerType = value
    },
    receiptTriggerTypeChange(value) {
      this.currSelected.receiptTriggerType = value
    },
    submitCurrForm() {
      this.$refs.form.validate(valid => {
        if (valid) {
          if (!this.currSelected.id) {
            // this.$message.warning('请点击选择要修改部门!')
            this.$notification.warning({
              message: '消息',
              description: "请点击选择要修改部门"
            });
            return
          }
  }
          httpAction(this.url.edit, this.currSelected, 'put').then((res) => {
            if (res.success) {
              // this.$message.success('保存成功!')
              this.$notification.warning({
                message: '消息',
                description: "保存成功"
              });
              this.loadTree()
            } else {
              // this.$message.error(res.message)
              this.$notification.warning({
                message: '消息',
                description: res.message
              });
            }
          })
        }
      })
    },
    emptyCurrForm() {
      this.$refs.form.resetFields();
      this.model = {}
    },
    nodeSettingFormSubmit() {
      this.$refs.form.validate(valid => {
        if (valid) {
          console.log('Received values of form: ', this.model)
        }
      })
    },
    openSelect() {
      this.$refs.sysDirectiveModal.show()
    },
    handleAdd(num) {
      if (num == 1) {
        this.$refs.departModal.add()
        this.$refs.departModal.title = '新增'
      } else if (num == 2) {
        console.log(this.currSelected)
        let key = this.currSelected.key
        if (!key) {
          this.$message.warning('请先点击选中上级部门!')
          return false
        }
        this.$refs.departModal.add(this.selectedKeys)
        this.$refs.departModal.title = '新增'
      } else {
        this.$refs.departModal.add(this.rightClickSelectedKey)
        this.$refs.departModal.title = '新增'
      }
    },
    handleDelete() {
      var that = this
      this.$confirm({
        title: '确认删除',
        content: '确定要删除此部门以及子节点数据吗?',
        onOk: function () {
          deleteByDepartId({ id: that.rightClickSelectedKey }).then((resp) => {
            if (resp.success) {
              //删除成功后,去除已选中中的数据
              that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1);
              that.$message.success('删除成功!')
              that.loadTree()
              //删除后同步清空右侧基本信息内容
              let orgCode = that.model.orgCode;
              if (orgCode && orgCode === that.rightClickSelectedOrgCode) {
                that.onClearSelected()
              }
            } else {
              that.$message.warning('删除失败!')
            }
          })
        }
      })
    },
    selectDirectiveOk(record) {
      console.log('选中指令数据', record)
      this.nodeSettingForm.setFieldsValue({ directiveCode: record.directiveCode })
      this.currSelected.sysCode = record.sysCode
    },
    getFlowGraphData(node) {
      this.graphDatasource.nodes.push({
        id: node.id,
        text: node.flowNodeName
      })
      if (node.children.length > 0) {
        for (let a = 0; a < node.children.length; a++) {
          let temp = node.children[a]
          this.graphDatasource.edges.push({
            source: node.id,
            target: temp.id
          })
          this.getFlowGraphData(temp)
        }
      }
    },
    //---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
    expandAll() {
      this.iExpandedKeys = this.allTreeKeys
    },
    closeAll() {
      this.iExpandedKeys = []
    },
    checkALL() {
      this.checkStriccheckStrictlytly = false
      this.checkedKeys = this.allTreeKeys
    },
    cancelCheckALL() {
      //this.checkedKeys = this.defaultCheckedKeys
      this.checkedKeys = []
    },
    switchCheckStrictly(v) {
      if (v == 1) {
        this.checkStrictly = false
      } else if (v == 2) {
        this.checkStrictly = true
      }
    },
    getAllKeys(node) {
      // console.log('node',node);
      this.allTreeKeys.push(node.key)
      if (node.children && node.children.length > 0) {
        for (let a = 0; a < node.children.length; a++) {
          this.getAllKeys(node.children[a])
        }
      }
    }
    //---- author:os_chengtgen -- date:20190827 --  for:切换父子勾选模式 =======------
  },
  created() {
    this.queryTreeData()
    this.currFlowId = this.$route.params.id
    this.currFlowName = this.$route.params.name
    // this.loadTree()
  },
}
</script>
<style scoped>
  .ant-card-body .table-operator {
    margin: 15px;
  }
.ant-card-body .table-operator {
  margin: 15px;
}
  .anty-form-btn {
    width: 100%;
    text-align: center;
  }
.anty-form-btn {
  width: 100%;
  text-align: center;
}
  .anty-form-btn button {
    margin: 0 5px;
  }
.anty-form-btn button {
  margin: 0 5px;
}
  .anty-node-layout .ant-layout-header {
    padding-right: 0
  }
.anty-node-layout .ant-layout-header {
  padding-right: 0;
}
  .header {
    padding: 0 8px;
  }
.header {
  padding: 0 8px;
}
  .header button {
    margin: 0 3px
  }
.header button {
  margin: 0 3px;
}
  .ant-modal-cust-warp {
    height: 100%
  }
.ant-modal-cust-warp {
  height: 100%;
}
  .ant-modal-cust-warp .ant-modal-body {
    height: calc(100% - 110px) !important;
    overflow-y: auto
  }
.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto;
}
  .ant-modal-cust-warp .ant-modal-content {
    height: 90% !important;
    overflow-y: hidden
  }
.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden;
}
  #app .desktop {
    height: auto !important;
  }
#app .desktop {
  height: auto !important;
}
  /** Button按钮间距 */
  .ant-btn {
    margin-left: 3px
  }
/** Button按钮间距 */
.ant-btn {
  margin-left: 3px;
}
  .drawer-bootom-button {
    /*position: absolute;*/
    bottom: 0;
    width: 100%;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: left;
    left: 0;
    background: #fff;
    border-radius: 0 0 2px 2px;
  }
.drawer-bootom-button {
  /*position: absolute;*/
  bottom: 0;
  width: 100%;
  border-top: 1px solid #e8e8e8;
  padding: 10px 16px;
  text-align: left;
  left: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
</style>
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("请设置url.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("请设置url.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>
src/views/system/modules/DepartList/DepartModal.vue
@@ -8,81 +8,131 @@
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
      <a-form-model
        ref="form"
        :model="model"
        :rules="validatorRules"
      >
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="机构名称"
          prop="departName"
          :hidden="false"
          hasFeedback >
          <a-input id="departName" placeholder="请输入机构/部门名称" v-model="model.departName"/>
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="上级部门" hasFeedback>
        <a-tree-select
          style="width:100%"
          :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
          :treeData="departTree"
          v-model="model.parentId"
          placeholder="请选择上级部门"
          :disabled="condition">
        </a-tree-select>
        </a-form-model-item>
        <!--<a-form-model-item-->
          <!--:labelCol="labelCol"-->
          <!--:wrapperCol="wrapperCol"-->
          <!--label="机构类型">-->
         <!--<template v-if="seen">-->
            <!--<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">-->
              <!--<a-radio value="1">-->
                <!--公司-->
              <!--</a-radio>-->
            <!--</a-radio-group>-->
          <!--</template>-->
          <!--<template v-else>-->
            <!--<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">-->
              <!--<a-radio value="2">-->
                <!--部门-->
              <!--</a-radio>-->
              <!--<a-radio value="3">-->
                <!--岗位-->
              <!--</a-radio>-->
            <!--</a-radio-group>-->
       <!--</template>-->
        <!--</a-form-model-item>-->
        <!--<a-form-model-item-->
          <!--:labelCol="labelCol"-->
          <!--:wrapperCol="wrapperCol"-->
          <!--prop="mobile"-->
          <!--label="电话">-->
          <!--<a-input placeholder="请输入电话" v-model="model.mobile"/>-->
        <!--</a-form-model-item>-->
        <!--<a-form-model-item-->
          <!--:labelCol="labelCol"-->
          <!--:wrapperCol="wrapperCol"-->
          <!--label="传真">-->
          <!--<a-input placeholder="请输入传真" v-model="model.fax"/>-->
        <!--</a-form-model-item>-->
        <!--<a-form-model-item-->
          <!--:labelCol="labelCol"-->
          <!--:wrapperCol="wrapperCol"-->
          <!--label="地址">-->
          <!--<a-input placeholder="请输入地址" v-model="model.address"/>-->
        <!--</a-form-model-item>-->
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序">
          <a-input-number v-model="model.departOrder"/>
          hasFeedback
        >
          <a-input
            id="departName"
            placeholder="请输入机构/部门名称"
            v-model="model.departName"
          />
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="备注">
          <a-textarea placeholder="请输入备注" v-model="model.memo"/>
          label="使用部门编码"
          prop="useDepartNum"
          :hidden="false"
          hasFeedback
        >
          <a-input
            id="useDepartNum"
            placeholder="请输入使用部门编码"
            v-model="model.useDepartNum"
          />
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="维修部门编码"
          prop="repairDepartNum"
          :hidden="false"
          hasFeedback
        >
          <a-input
            id="repairDepartNum"
            placeholder="请输入维修部门编码"
            v-model="model.repairDepartNum"
          />
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          :hidden="seen"
          label="上级部门"
          hasFeedback
        >
          <a-tree-select
            style="width:100%"
            :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
            :treeData="departTree"
            v-model="model.parentId"
            placeholder="请选择上级部门"
            :disabled="condition"
          >
          </a-tree-select>
        </a-form-model-item>
        <!--<a-form-model-item-->
        <!--:labelCol="labelCol"-->
        <!--:wrapperCol="wrapperCol"-->
        <!--label="机构类型">-->
        <!--<template v-if="seen">-->
        <!--<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">-->
        <!--<a-radio value="1">-->
        <!--公司-->
        <!--</a-radio>-->
        <!--</a-radio-group>-->
        <!--</template>-->
        <!--<template v-else>-->
        <!--<a-radio-group v-model="model.orgCategory" placeholder="请选择机构类型">-->
        <!--<a-radio value="2">-->
        <!--部门-->
        <!--</a-radio>-->
        <!--<a-radio value="3">-->
        <!--岗位-->
        <!--</a-radio>-->
        <!--</a-radio-group>-->
        <!--</template>-->
        <!--</a-form-model-item>-->
        <!--<a-form-model-item-->
        <!--:labelCol="labelCol"-->
        <!--:wrapperCol="wrapperCol"-->
        <!--prop="mobile"-->
        <!--label="电话">-->
        <!--<a-input placeholder="请输入电话" v-model="model.mobile"/>-->
        <!--</a-form-model-item>-->
        <!--<a-form-model-item-->
        <!--:labelCol="labelCol"-->
        <!--:wrapperCol="wrapperCol"-->
        <!--label="传真">-->
        <!--<a-input placeholder="请输入传真" v-model="model.fax"/>-->
        <!--</a-form-model-item>-->
        <!--<a-form-model-item-->
        <!--:labelCol="labelCol"-->
        <!--:wrapperCol="wrapperCol"-->
        <!--label="地址">-->
        <!--<a-input placeholder="请输入地址" v-model="model.address"/>-->
        <!--</a-form-model-item>-->
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
        >
          <a-input-number v-model="model.departOrder" />
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="备注"
        >
          <a-textarea
            placeholder="请输入备注"
            v-model="model.memo"
          />
        </a-form-model-item>
      </a-form-model>
@@ -91,143 +141,144 @@
</template>
<script>
  import { httpAction } from '@/api/manage'
  import { queryIdTree } from '@/api/api'
  import pick from 'lodash.pick'
  import ATextarea from 'ant-design-vue/es/input/TextArea'
  export default {
    name: "SysDepartModal",
    components: { ATextarea },
    data () {
      return {
        departTree:[],
        orgTypeData:[],
        phoneWarning:'',
        departName:"",
        title:"操作",
        seen:false,
        visible: false,
        condition:true,
        disableSubmit:false,
        model: {},
        defaultModel:{
          departOrder:0,
          orgCategory:'1'
        },
        menuhidden:false,
        menuusing:true,
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
import { httpAction } from '@/api/manage'
import { queryIdTree } from '@/api/api'
import pick from 'lodash.pick'
import ATextarea from 'ant-design-vue/es/input/TextArea'
export default {
  name: "SysDepartModal",
  components: { ATextarea },
  data() {
    return {
      departTree: [],
      orgTypeData: [],
      phoneWarning: '',
      departName: "",
      title: "操作",
      seen: false,
      visible: false,
      condition: true,
      disableSubmit: false,
      model: {},
      defaultModel: {
        departOrder: 0,
        orgCategory: '1'
      },
      menuhidden: false,
      menuusing: true,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
        confirmLoading: false,
        validatorRules:{
          departName:[{ required: true, message: '请输入机构/部门名称!' }],
          // orgCode:[{ required: true, message: '请输入机构编码!' }],
          // mobile: [{validator:this.validateMobile}],
          // orgCategory:[{required: true, message: '请输入机构类型!'}]
        },
        url: {
          add: "/sys/sysDepart/add",
        },
        dictDisabled:true,
      confirmLoading: false,
      validatorRules: {
        departName: [{ required: true, message: '请输入机构/部门名称!' }],
        useDepartNum: [{ required: false, message: '请输入使用部门编码!' }],
        repairDepartNum: [{ required: false, message: '请输入维修部门编码!' }],
        // orgCode:[{ required: true, message: '请输入机构编码!' }],
        // mobile: [{validator:this.validateMobile}],
        // orgCategory:[{required: true, message: '请输入机构类型!'}]
      },
      url: {
        add: "/sys/sysDepart/add",
      },
      dictDisabled: true,
    }
  },
  created() {
  },
  methods: {
    loadTreeData() {
      var that = this;
      queryIdTree().then((res) => {
        if (res.success) {
          that.departTree = [];
          for (let i = 0; i < res.result.length; i++) {
            let temp = res.result[i];
            that.departTree.push(temp);
          }
        }
      })
    },
    add(depart) {
      if (depart) {
        this.seen = false;
        this.dictDisabled = false;
      } else {
        this.seen = true;
        this.dictDisabled = true;
      }
      this.edit(depart);
    },
    edit(record) {
      this.visible = true;
      this.model = Object.assign({}, this.defaultModel, record)
      this.loadTreeData();
      this.model.parentId = record != null ? record.toString() : null;
      if (this.seen) {
        this.model.orgCategory = '1';
      } else {
        this.model.orgCategory = '2';
      }
    },
    created () {
    close() {
      this.$emit('close');
      this.disableSubmit = false;
      this.visible = false;
      this.$refs.form.resetFields();
    },
    methods: {
      loadTreeData(){
        var that = this;
        queryIdTree().then((res)=>{
          if(res.success){
            that.departTree = [];
            for (let i = 0; i < res.result.length; i++) {
              let temp = res.result[i];
              that.departTree.push(temp);
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = true;
          httpAction(this.url.add, this.model, "post").then((res) => {
            if (res.success) {
              // that.$message.success(res.message);
              that.$notification.success({
                message: '消息',
                description: res.message
              });
              that.loadTreeData();
              that.$emit('ok');
            } else {
              // that.$message.warning(res.message);
              that.$notification.warning({
                message: '消息',
                description: res.message
              });
            }
          }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        })
      },
      add (depart) {
        if(depart){
          this.seen = false;
          this.dictDisabled = false;
        }else{
          this.seen = true;
          this.dictDisabled = true;
        } else {
          return false;
        }
        this.edit(depart);
      },
      edit (record) {
          this.visible = true;
          this.model = Object.assign({}, this.defaultModel, record)
          this.loadTreeData();
          this.model.parentId = record!=null?record.toString():null;
           if(this.seen){
             this.model.orgCategory = '1';
           }else{
             this.model.orgCategory = '2';
           }
      },
      close () {
        this.$emit('close');
        this.disableSubmit = false;
        this.visible = false;
        this.$refs.form.resetFields();
      },
      handleOk () {
        const that = this;
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            httpAction(this.url.add,this.model,"post").then((res)=>{
              if(res.success){
                // that.$message.success(res.message);
                that.$notification.success({
                  message:'消息',
                  description:res.message
                });
                that.loadTreeData();
                that.$emit('ok');
              }else{
                // that.$message.warning(res.message);
                that.$notification.warning({
                  message:'消息',
                  description:res.message
                });
              }
            }).finally(() => {
              that.confirmLoading = false;
              that.close();
            })
          }else{
            return false;
          }
        })
      },
      handleCancel () {
        this.close()
      },
      validateMobile(rule,value,callback){
        if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)){
          callback();
        }else{
          callback("您的手机号码格式不正确!");
        }
      })
    },
    handleCancel() {
      this.close()
    },
    validateMobile(rule, value, callback) {
      if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)) {
        callback();
      } else {
        callback("您的手机号码格式不正确!");
      }
    }
  }
}
</script>
<style scoped>
</style>
src/views/system/modules/DepartList/DepartTeam.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,394 @@
<template>
  <a-card :bordered="false">
    <template v-if="this.departId">
      <div class="table-page-search-wrapper">
        <a-form
          layout="inline"
          @keyup.enter.native="searchQuery"
        >
          <a-row :gutter="24">
            <a-col :span="24 / 2  ">
              <a-form-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="班组编号"
              >
                <j-input
                  placeholder="请输入班组编号"
                  v-model="queryParam.num"
                ></j-input>
              </a-form-item>
            </a-col>
            <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-button
                type="primary"
                @click="handleAdd"
                icon="plus"
                style="margin-left: 8px"
              >新增</a-button>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <div
        class="table-operator"
        style="border-top: 5px"
      >
        <a-dropdown v-if="selectedRowKeys.length > 0">
          <a-menu
            slot="overlay"
            @click="handleMenuClick"
          >
            <a-menu-item key="1">
              <a-icon
                type="delete"
                @click="batchDel"
              />
              æ‰¹é‡ç§»é™¤
            </a-menu-item>
          </a-menu>
          <a-button style="margin-left: 8px">
            æ‰¹é‡æ“ä½œ
            <a-icon type="down" />
          </a-button>
        </a-dropdown>
      </div>
      <a-table
        ref="table"
        bordered
        size="middle"
        rowKey="id"
        :scroll="{x: 500}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @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>-->
        <!--</template>-->
        <span
          slot="name"
          slot-scope="text"
        >
          <j-ellipsis
            :value="text"
            :length="7"
          />
        </span>
        <span
          slot="action"
          slot-scope="text, record"
        >
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <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-empty>
        <span slot="description"> è¯·å…ˆé€‰æ‹©ä¸€ä¸ªéƒ¨é—¨! </span>
      </a-empty>
    </a-card>
    <team-modal
      ref="modalForm"
      @ok="modalFormOk"
      :departId=this.departId
    ></team-modal>
    <!-- :nodeSelected="nodeSelected" -->
  </a-card>
</template>
<script>
import { queryTreeListForRole, queryDepartPermission, saveDepartPermission } from '@/api/api'
import DepartDataruleModal from './DepartDataruleModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction, postAction, deleteAction } from '@/api/manage'
import { filterObj } from '@/utils/util'
import JEllipsis from '@/components/jeecg/JEllipsis'
import qs from 'qs'
import TeamModal from './TeamModal'
export default {
  name: 'DepartTeam',
  mixins: [JeecgListMixin],
  components: { DepartDataruleModal, TeamModal, JEllipsis },
  data() {
    return {
      queryParam: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '部门',
          align: "center",
          dataIndex: 'departId_dictText',
        },
        {
          title: '班组编号',
          align: "center",
          dataIndex: 'num',
        },
        {
          title: '班组名称',
          align: "center",
          dataIndex: 'name',
          scopedSlots: { customRender: 'name' },
        },
        {
          title: '备注',
          align: "center",
          dataIndex: 'remark',
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' },
          align: "center",
          width: 120
        }
      ],
      disableMixinCreated: true,
      departId: "",
      title: "部门权限配置",
      visible: false,
      loading: false,
      hidden: true,
      url: {
        list: '/base/team/list',
        remove: '/base/team/delete',
        serachTeams: '/base/team/list',
        deleteBatch: "/base/team/deleteBatch"
      }
    }
  },
  methods: {
    show(departId) {
      this.departId = departId
      this.loadData();
    },
    close() {
      this.reset()
      this.$emit('close');
      this.visible = false;
    },
    searchReset() {
      this.queryParam = {}
      this.loadData();
    },
    searchQuery() {
      this.loading = true;
      var params = this.getQueryParams();//查询条件
      params.pageNo = this.ipagination.current;
      params.pageSize = this.ipagination.pageSize;
      getAction(this.url.serachTeams, 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)
        }
      }).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(id) {
      deleteAction(this.url.remove, { id: id }).then((res) => {
        if (res.success) {
          // this.$message.warning(res.message)
          this.$notification.success({
            message: '消息',
            description: res.message
          });
          this.show(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.deleteBatch) {
        this.$message.error("请设置url.deleteBatch属性!")
        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;
            deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
              if (res.success) {
                //重新计算分页问题
                that.reCalculatePage(that.selectedRowKeys.length)
                // that.$message.success(res.message);
                that.$notification.success({
                  message: '消息',
                  description: res.message
                });
                that.show(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>
src/views/system/modules/DepartList/TeamModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,286 @@
<template>
  <a-modal
    :title="title"
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-model-item
              :labelCol="{span:4}"
              :wrapperCol="{span:18}"
              :hidden="seen"
              label="上级部门"
              hasFeedback
            >
              <a-tree-select
                style="width:100%"
                :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
                :treeData="departTree"
                v-model="model.departId"
                placeholder="请选择上级部门"
                :disabled="true"
              >
              </a-tree-select>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              label="班组编号"
              :labelCol="{span:4}"
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="disableSubmit"
                allow-clear
                placeholder="请输入班组编号"
                v-decorator="['num', validatorRules.num ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              label="班组名称"
              :labelCol="{span:4}"
              :wrapperCol="{span:18}"
            >
              <a-input
                :readOnly="disableSubmit"
                allow-clear
                placeholder="请输入班组名称"
                v-decorator="['name', validatorRules.name ]"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item
              :labelCol="{span:4}"
              :wrapperCol="{span:18}"
              label="备注"
            >
              <a-textarea
                :readOnly="disableSubmit"
                placeholder="请输入备注"
                allow-clear
                v-decorator="['remark', validatorRules.remark]"
              />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
import pick from 'lodash.pick'
import { postAction, requestPut } from '@/api/manage'
import { duplicateCheck } from '@/api/api'
import { queryIdTree } from '@/api/api'
export default {
  name: 'TeamModal',
  props: {
    // nodeSelected: {
    //   type: Object,
    //   default: {}
    // },
    departId: {
      type: String,
      default: ""
    },
  },
  data() {
    return {
      title: "操作",
      visible: false,
      model: {},
      departTree: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      confirmLoading: false,
      form: this.$form.createForm(this),
      validatorRules: {
        num: {
          rules: [
            { required: true, message: '请输入班组编号!' },
            { min: 0, max: 30, message: '长度不超过 30 ä¸ªå­—符', trigger: 'blur' },
            { validator: this.validateNum },
          ]
        },
        name: {
          rules: [
            { required: true, message: '请输入班组名称!' },
            { min: 0, max: 64, message: '长度不超过 64 ä¸ªå­—符', trigger: 'blur' },
            { validator: this.validateName },
          ]
        },
        remark: {
          rules: [
            { min: 0, max: 100, message: '长度不超过 100 ä¸ªå­—符', trigger: 'blur' },
          ]
        }
      },
      url: {
        add: "/base/team/add",
        edit: "/base/team/edit"
      },
      disableSubmit: false,
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      // alterFlag: ""
    }
  },
  created() {
  },
  methods: {
    add() {
      this.edit({});
    },
    edit(record) {
      this.loadTreeData();
      this.form.resetFields();
      this.model = Object.assign({}, record);
      this.model.departId = this.departId
      this.visible = true;
      this.disableSubmit = false;
      this.$nextTick(() => {
        this.form.setFieldsValue(pick(this.model, 'num', 'name', 'remark'))
      });
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      const that = this;
      // è§¦å‘表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let formData = Object.assign(this.model, values);
          let obj;
          if (!this.model.id) {
            obj = postAction(this.url.add, formData);
          } else {
            obj = requestPut(this.url.edit, formData, { id: this.model.id });
          }
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
              that.alterFlag = new Date()
            } else {
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        }
      })
    },
    loadTreeData() {
      var that = this;
      queryIdTree().then((res) => {
        if (res.success) {
          that.departTree = [];
          for (let i = 0; i < res.result.length; i++) {
            let temp = res.result[i];
            that.departTree.push(temp);
          }
        }
      })
    },
    handleCancel() {
      this.close()
    },
    //验证 ç¼–号
    validateNum(rule, value, callback) {
      var params = {
        tableName: 'mom_base_team',
        fieldName: 'num',
        fieldVal: value,
        dataId: this.model.id,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false å‡åˆ é™¤ï¼štrue
        delFlag: 'true',
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
        } else {
          callback("编号已存在!");
        }
      })
    },
    //验证 åç§°
    validateName(rule, value, callback) {
      var params = {
        tableName: 'mom_base_team',
        fieldName: 'name',
        fieldVal: value,
        dataId: this.model.id,
        //数据库中存在字段del_flag并使用该字段作为未删除策略,真删除:false å‡åˆ é™¤ï¼štrue
        delFlag: 'true',
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback();
        } else {
          callback("名称已存在!");
        }
      })
    },
  },
  // watch: {
  //   alterFlag() {
  //     this.$bus.$emit('queryTreeData');
  //   }
  // }
}
</script>
<style scoped>
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** ä¸»è¡¨å•行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
</style>