From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期一, 18 九月 2023 13:24:30 +0800
Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430

---
 src/views/eam/SpecialtyMaintenanceOrderList.vue |  617 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 617 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/SpecialtyMaintenanceOrderList.vue b/src/views/eam/SpecialtyMaintenanceOrderList.vue
new file mode 100644
index 0000000..d7e8d27
--- /dev/null
+++ b/src/views/eam/SpecialtyMaintenanceOrderList.vue
@@ -0,0 +1,617 @@
+<template>
+  <a-card
+    :bordered="false"
+    title="涓撲笟淇濆吇宸ュ崟"
+  >
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form
+        layout="inline"
+        @keyup.enter.native="searchQuery"
+      >
+        <a-row :gutter="24">
+          <a-col
+            :md="6"
+            :sm="8"
+          >
+            <a-form-item label="淇濆吇宸ュ崟缂栫爜">
+              <a-input
+                placeholder="璇疯緭鍏ヤ繚鍏诲伐鍗曠紪鐮�"
+                v-model="queryParam.num"
+              ></a-input>
+            </a-form-item>
+          </a-col>
+          <!-- <a-col
+            :md="6"
+            :sm="8"
+          >
+            <a-form-item label="鐐规鏂规硶鍚嶇О">
+              <j-input
+                placeholder="璇疯緭鍏ョ偣妫�鏂规硶鍚嶇О"
+                v-model="queryParam.name"
+              ></j-input>
+            </a-form-item>
+          </a-col> -->
+          <a-col
+            :md="6"
+            :sm="8"
+          >
+            <span
+              style="float: left;overflow: hidden;"
+              class="table-page-search-submitButtons"
+            >
+              <a-button
+                type="primary"
+                @click="searchQuery"
+                icon="search"
+              >鏌ヨ</a-button>
+              <a-button
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+              >閲嶇疆</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 鏌ヨ鍖哄煙-END -->
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button
+        @click="handleAdd"
+        type="primary"
+        icon="plus"
+        v-has="'specialtyMaintenanceOrder:add'"
+      >鏂板</a-button>
+      <!-- <a-button
+        v-if="selectedRowKeys.length > 0"
+        type="primary"
+        @click="batchAssign"
+        style="margin-left: 8px"
+      >宸ュ崟娲惧伐</a-button> -->
+      <!-- <a-button
+        type="primary"
+        icon="download"
+        @click="handleExportXls('mom_eam_inspection_order')"
+      >瀵煎嚭</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-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item
+            key="1"
+            @click="batchDel"
+          ><a-icon type="delete" />鍒犻櫎</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button>
+      </a-dropdown> -->
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div>
+      <div
+        class="ant-alert ant-alert-info"
+        style="margin-bottom: 16px;"
+      >
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
+        <a
+          style="margin-left: 24px"
+          @click="onClearSelected"
+        >娓呯┖</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{ x: 'calc(1900px + 50%)', y: 900 }"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        class="j-table-force-nowrap"
+        @change="handleTableChange"
+        :rowClassName="tableRowClass"
+      >
+        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
+        <span
+          slot="action"
+          slot-scope="text, record"
+        >
+          <a-popconfirm
+            title="纭畾涓嬪彂宸ュ崟鍚�?"
+            @confirm="() => handleOrderIssue(record)"
+          >
+            <a
+              v-has="'specialtyMaintenanceOrder:issue'"
+              v-if="record.status == '1'"
+            >涓嬪彂</a>
+          </a-popconfirm>
+          <a-divider
+            v-if="record.status == '1'"
+            type="vertical"
+          />
+          <a-popconfirm
+            title="纭畾鎾ゅ洖宸ュ崟鍚�?"
+            @confirm="() => handleOrderReset(record)"
+          >
+            <a
+              v-has="'specialtyMaintenanceOrder:issue'"
+              v-if="record.status == '2'"
+            >鎾ゅ洖</a>
+          </a-popconfirm>
+          <a-divider
+            v-if="record.status == '2'"
+            type="vertical"
+          />
+          <a-popconfirm
+            title="纭畾鎭㈠宸ュ崟鍚�?"
+            @confirm="() => handleOrderRecover(record)"
+          >
+            <a
+              v-has="'specialtyMaintenanceOrder:recover'"
+              v-if="record.status == '7'"
+            >鎭㈠</a>
+          </a-popconfirm>
+          <a-divider
+            v-if="record.status == '7'"
+            type="vertical"
+          />
+          <a-popconfirm
+            title="纭畾浣滃簾宸ュ崟鍚�?"
+            @confirm="() => handleOrderCancel(record)"
+          >
+            <a
+              v-has="'specialtyMaintenanceOrder:recover'"
+              v-if="record.status == '2'"
+            >浣滃簾</a>
+          </a-popconfirm>
+          <a-divider
+            v-if="record.status == '2'"
+            type="vertical"
+          />
+          <a-popconfirm
+            title="纭畾棰嗗彇宸ュ崟鍚�?"
+            @confirm="() => handleOrderGet(record)"
+          >
+            <a
+              v-has="'specialtyMaintenanceOrder:get'"
+              v-if="record.status == '2' && record.assignMode == '1'"
+            >棰嗗彇</a>
+          </a-popconfirm>
+          <a
+            v-if="record.status == '2' && record.assignMode == '2'  "
+            @click="handleAssignOrder(record)"
+            v-has="'specialtyMaintenanceOrder:assign'"
+          >娲惧伐</a>
+          <a
+            v-if="record.status == '2'&& record.assignMode == '3'  && record.inspectionUserName != null  "
+            @click="handleAssignOrder(record)"
+            v-has="'specialtyMaintenanceOrder:assign'"
+          >鏀规淳</a>
+          <a
+            v-if="record.status == '3'"
+            @click="handleAssignOrder(record)"
+            v-has="'specialtyMaintenanceOrder:assign'"
+          >鏀规淳</a>
+          <a-divider
+            v-if="record.status == '2'"
+            type="vertical"
+          />
+          <a-divider
+            v-if="record.status === '3'"
+            type="vertical"
+          />
+          <a
+            v-if="record.status === '3' || record.status === '4'  "
+            @click="handleOrderExe(record)"
+            v-has="'specialtyMaintenanceOrder:exe'"
+          >鎵ц</a>
+          <a-divider
+            v-if="record.status === '3' || record.status === '4' "
+            type="vertical"
+          />
+          <a
+            v-if="record.status === '1'"
+            @click="handleEdit(record)"
+            v-has="'specialtyMaintenanceOrder:edit'"
+          >缂栬緫</a>
+          <a-divider
+            v-if="record.status === '1'"
+            type="vertical"
+          />
+          <a-dropdown>
+            <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">璇︽儏</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm
+                  title="纭畾鍒犻櫎鍚�?"
+                  @confirm="() => handleDelete(record.id)"
+                >
+                  <a
+                    v-has="'specialtyMaintenanceOrder:delete'"
+                    v-if="record.status === '1'"
+                  >鍒犻櫎</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+        <span
+          slot="num"
+          slot-scope="text, record"
+        >
+          <a
+            v-if="record.status === '3' || record.status === '4' ||record.status === '5'  ||record.status === '7' "
+            class="lot"
+            @click="handleOrderExe(record)"
+          >{{record.num}}</a>
+          <span v-else>{{record.num}}</span>
+        </span>
+
+      </a-table>
+    </div>
+
+    <maintenance-order-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></maintenance-order-modal>
+    <inspection-order-assign-modal
+      ref="InspectionOrderAssignModal"
+      @ok="modalFormOk"
+    ></inspection-order-assign-modal>
+    <specialy-maintenance-order-exe-drawer
+      ref="SpecialyMaintenanceOrderExeDrawer"
+      @ok="modalFormOk"
+    ></specialy-maintenance-order-exe-drawer>
+    <specialty-maintenance-order-assign-modal
+      ref="SpecialtyMaintenanceOrderAssignModal"
+      @ok="modalFormOk"
+    >
+    </specialty-maintenance-order-assign-modal>
+  </a-card>
+</template>
+
+<script>
+
+import '@/assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import MaintenanceOrderModal from './modules/specialtyMaintenanceOrder/MaintenanceOrderModal'
+import InspectionOrderAssignModal from './modules/specialtyMaintenanceOrder/InspectionOrderAssignModal'
+import SpecialyMaintenanceOrderExeDrawer from './modules/specialtyMaintenanceOrder/SpecialyMaintenanceOrderExeDrawer'
+import { getAction, postAction, requestPut } from '@/api/manage'
+import SpecialtyMaintenanceOrderAssignModal from './modules/specialtyMaintenanceOrder/SpecialtyMaintenanceOrderAssignModal.vue'
+import SpecialtyInspectionOrderAssignModal from './modules/specialtyInspectionOrder/SpecialtyInspectionOrderAssignModal.vue'
+
+export default {
+  name: 'SpecialtyMaintenanceOrderList',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    MaintenanceOrderModal,
+    InspectionOrderAssignModal,
+    SpecialyMaintenanceOrderExeDrawer,
+    SpecialtyMaintenanceOrderAssignModal,
+    SpecialtyInspectionOrderAssignModal
+  },
+  data() {
+    return {
+      description: '涓撲笟淇濆吇宸ュ崟',
+      // 琛ㄥご
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: "center",
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1;
+          }
+        },
+        {
+          title: '鐘舵��',
+          align: "center",
+          dataIndex: 'statusName'
+        },
+        {
+          title: '缁翠繚鏂瑰紡',
+          align: "center",
+          dataIndex: 'maintenanceMode'
+        },
+        {
+          title: '淇濆吇宸ュ崟鍙�',
+          align: "center",
+          dataIndex: 'num',
+          scopedSlots: { customRender: 'num' }
+        },
+        {
+          title: '瀵硅薄閮ㄩ棬',
+          align: "center",
+          dataIndex: 'departName',
+        },
+        {
+          title: '淇濆吇绫诲瀷',
+          align: "center",
+          dataIndex: 'maintenanceTypeName',
+        },
+        {
+          title: '淇濆吇鍛ㄦ湡',
+          align: "center",
+          dataIndex: 'maintenanceCycleName',
+        },
+        {
+          title: '娲惧伐鏂瑰紡',
+          align: 'center',
+          dataIndex: 'assignModeName',
+        },
+        {
+          title: '淇濆吇鏂规',
+          align: "center",
+          dataIndex: 'specialtyMaintenancePlanNum',
+        },
+        {
+          title: '璐d换鐝粍',
+          align: "center",
+          dataIndex: 'teamName',
+        },
+        // {
+        //   title: '宸ユ椂瀹氶/姣忓皬鏃�',
+        //   align: "center",
+        //   dataIndex: 'sumOfWorkingHourQuota',
+        // },
+        {
+          title: '璁″垝寮�濮嬫椂闂�',
+          align: "center",
+          dataIndex: 'planStartTime',
+          width: 170
+
+        },
+        {
+          title: '璁″垝缁撴潫鏃堕棿',
+          align: "center",
+          dataIndex: 'planEndTime',
+          width: 170
+        },
+        {
+          title: '瀹為檯寮�濮嬫椂闂�',
+          align: "center",
+          dataIndex: 'actualStartTime',
+          width: 170
+        },
+        {
+          title: '瀹為檯缁撴潫鏃堕棿',
+          align: "center",
+          dataIndex: 'actualEndTime',
+          width: 170
+        },
+        {
+          title: '瀹為檯鐢ㄦ椂',
+          align: "center",
+          dataIndex: 'actualWorkingHourQuota',
+        },
+        {
+          title: '淇濆吇浜�',
+          align: "center",
+          dataIndex: 'maintenanceUserName'
+        },
+        {
+          title: '鍒涘缓浜�',
+          align: "center",
+          dataIndex: 'createBy'
+        },
+        {
+          title: '鍒涘缓鏃ユ湡',
+          align: "center",
+          dataIndex: 'createTime',
+          width: 170
+        },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: "center",
+          fixed: "right",
+          width: 300,
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: "/eam/specialtyMaintenanceOrder/getSpecialtyMaintenanceOrderList",
+        delete: "/eam/specialtyMaintenanceOrder/delete",
+        deleteBatch: "/eam/specialtyMaintenanceOrder/deleteBatch",
+        exportXlsUrl: "/eam/specialtyMaintenanceOrder/exportXls",
+        importExcelUrl: "eam/specialtyMaintenanceOrder/importExcel",
+        edit: "/eam/specialtyMaintenanceOrder/editStatus",
+        orderGet: "/eam/specialtyMaintenanceOrder/orderGet",
+      },
+    }
+  },
+
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    },
+    rowSelection() {
+      return {
+        type: 'checkbox',
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.selectedRowKeys = selectedRowKeys;
+          this.onSelectChange(selectedRows);
+        },
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.distable
+          },
+        }),
+        selectedRowKeys: this.selectedRowKeys,
+      };
+    },
+  },
+
+  methods: {
+
+    // batchAssign() {
+    //   this.$refs.InspectionOrderAssignModal.visible = true
+    //   this.$refs.InspectionOrderAssignModal.title = '宸ュ崟娲惧伐'
+    //   this.$refs.InspectionOrderAssignModal.selectionRows
+    //   this.$refs.InspectionOrderAssignModal.handleShow()
+    //   this.$bus.$emit('selectionRows', this.selectionRows);
+    // },
+    onSelectChange(selectionRows) {
+      this.selectionRows = selectionRows;
+    },
+
+    handleOrderExe(record) {
+      this.$refs.SpecialyMaintenanceOrderExeDrawer.visible = true
+      this.$refs.SpecialyMaintenanceOrderExeDrawer.title = '涓撲笟淇濆吇宸ュ崟鎵ц'
+      this.$refs.SpecialyMaintenanceOrderExeDrawer.handleShow(record)
+      if (record.status === '3') {
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true//淇濆瓨銆佹殏瀛樸�佹姤宸�
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true//鎾ら攢鎸夐挳
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = false//寮�宸ユ寜閽�
+      } else if (record.status === '4') {
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = false
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true
+      } else if (record.status === '5') {
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = false
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true
+      } else if (record.status === '7') {
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.buttonDistable = true
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.revocationDistable = true
+        this.$refs.SpecialyMaintenanceOrderExeDrawer.SWbuttonDistable = true
+      }
+    },
+
+    handleOrderIssue(record) {
+      const that = this;
+      requestPut(that.url.edit, { id: record.id, status: '2' }).then((res) => {
+        if (res.success) {
+          that.$message.success("宸ュ崟涓嬪彂鎴愬姛锛�")
+          that.loadData()
+        } else {
+          that.$message.warning("宸ュ崟涓嬪彂澶辫触锛�")
+        }
+      })
+    },
+    //鎾ゅ洖
+    handleOrderReset(record) {
+      const that = this;
+      requestPut(that.url.edit, { id: record.id, status: '1' }).then((res) => {
+        if (res.success) {
+          that.$message.success("宸ュ崟鎾ゅ洖鎴愬姛锛�")
+          that.loadData()
+        } else {
+          that.$message.warning("宸ュ崟鎾ゅ洖澶辫触锛�")
+        }
+      })
+    },
+    handleOrderGet(record) {
+      const that = this;
+      requestPut(that.url.orderGet, { id: record.id, status: '1' }).then((res) => {
+        if (res.success) {
+          that.$message.success("宸ュ崟棰嗗彇鎴愬姛锛�")
+          that.loadData()
+        } else {
+          that.$message.warning("宸ュ崟棰嗗彇澶辫触锛�")
+        }
+      })
+    },
+    //浣滃簾
+    handleOrderCancel(record) {
+      const that = this;
+      requestPut(that.url.edit, { id: record.id, status: '7' }).then((res) => {
+        if (res.success) {
+          that.$message.success("宸ュ崟浣滃簾鎴愬姛锛�")
+          that.loadData()
+        } else {
+          that.$message.warning("宸ュ崟浣滃簾澶辫触锛�")
+        }
+      })
+    },
+
+    //鎭㈠
+    handleOrderRecover(record) {
+      const that = this;
+      requestPut(that.url.edit, { id: record.id, status: '2' }).then((res) => {
+        if (res.success) {
+          that.$message.success("宸ュ崟鎭㈠鎴愬姛锛�")
+          that.loadData()
+        } else {
+          that.$message.warning("宸ュ崟鎭㈠澶辫触锛�")
+        }
+      })
+    },
+    handleAssignOrder: function (record) {
+      this.$refs.SpecialtyMaintenanceOrderAssignModal.edit(record)
+      this.$refs.SpecialtyMaintenanceOrderAssignModal.title = '宸ュ崟鏀规淳'
+      this.$refs.SpecialtyMaintenanceOrderAssignModal.disableSubmit = false
+    },
+    // modalFormOk() {
+    //   alert(0)
+    //   // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃
+    //   this.loadData();
+    //   //娓呯┖鍒楄〃閫変腑
+    //   this.onClearSelected()
+    // },
+
+    //棰勮棰滆壊
+    tableRowClass(record, index) {
+      if ("1" == record.status || "2" == record.status) {
+        if (record.yellowWarningTime < record.currentDateTime && record.currentDateTime < record.redWarningTime) {
+          return 'yellow'
+        } else if (record.redWarningTime < record.currentDateTime && record.currentDateTime < record.planStartTime) {
+          return 'error'
+        } else if (record.planStartTime < record.currentDateTime) {
+          return 'frozenRowClass'
+        }
+      }
+    },
+  }
+}
+</script>
+<style >
+@import '~@assets/less/common.less';
+.frozenRowClass {
+  color: #c9c9c9;
+  font-weight: bold;
+}
+.success {
+  color: green;
+}
+.error {
+  color: red;
+  font-weight: bold;
+}
+.yellow {
+  color: yellow;
+  font-weight: bold;
+}
+.fontweight {
+  font-weight: bold;
+}
+
+.ant-table-tbody .red {
+  background-color: red !important;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3