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/DailyMaintenanceStandardList.vue |  512 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 512 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/DailyMaintenanceStandardList.vue b/src/views/eam/DailyMaintenanceStandardList.vue
new file mode 100644
index 0000000..5692a18
--- /dev/null
+++ b/src/views/eam/DailyMaintenanceStandardList.vue
@@ -0,0 +1,512 @@
+<template>
+  <a-card
+    title="鏃ュ父淇濆吇鏍囧噯"
+    :bordered='false'
+  >
+    <div class='table-page-search-wrapper'>
+      <a-form
+        layout='inline'
+        @keyup.enter.native='searchQuery'
+      >
+        <a-row :gutter='24'>
+          <a-col
+            :xl='6'
+            :lg='7'
+            :md='8'
+            :sm='24'
+          >
+            <a-form-item label='鏍囧噯缂栫爜'>
+              <a-input
+                placeholder='璇疯緭鍏ユ爣鍑嗙紪鐮�'
+                v-model='queryParam.num'
+              ></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col
+            :xl='6'
+            :lg='7'
+            :md='8'
+            :sm='24'
+          >
+            <a-form-item label='璁惧鍚嶇О'>
+              <a-input
+                placeholder='璇疯緭鍏ヨ澶囧悕绉�'
+                v-model='queryParam.name'
+              ></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col
+            :md="10"
+            :sm="8"
+          >
+            <a-form-item label="鐗堟湰鐘舵��">
+              <a-radio-group
+                v-model="queryParam.versionStatus"
+                @change="onChange"
+                default-value="2"
+              >
+                <a-radio-button value="1">
+                  鏈敓鏁�
+                </a-radio-button>
+                <a-radio-button value="2">
+                  宸茬敓鏁�
+                </a-radio-button>
+                <a-radio-button value="3">
+                  宸插け鏁�
+                </a-radio-button>
+              </a-radio-group>
+            </a-form-item>
+          </a-col>
+          <!-- <a-col
+            :xl='6'
+            :lg='7'
+            :md='8'
+            :sm='24'
+          >
+            <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>
+
+    <div class="table-operator">
+      <a-button
+        @click='handleAdd'
+        type='primary'
+        icon='plus'
+        v-has="'dailyMaintenanceStandard:add'"
+      >鏂板</a-button>
+      <a-button
+        type='primary'
+        @click='searchQuery'
+        icon='search'
+      >鏌ヨ</a-button>
+      <a-button
+        type='primary'
+        @click='searchReset'
+        icon='reload'
+        style='margin-left: 8px'
+      >閲嶇疆</a-button>
+    </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'
+        bordered
+        rowKey='id'
+        :scroll="{ x: 'calc(1600px + 50%)', y: 900 }"
+        :columns='columns'
+        :dataSource='dataSource'
+        :pagination='ipagination'
+        :loading='loading'
+        :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
+        :customRow='clickThenSelect'
+        @change='handleTableChange'
+      >
+
+        <!-- <span
+          slot='action'
+          slot-scope='text, record'
+        >
+          <a @click='handleEdit(record)'>缂栬緫</a>
+
+          <a-divider type='vertical' />
+          <a-dropdown>
+            <a class='ant-dropdown-link'>鏇村 <a-icon type='down' /></a>
+            <a-menu slot='overlay'>
+              <a-menu-item>
+                <a-popconfirm
+                  title='纭畾鍒犻櫎鍚�?'
+                  @confirm='() => handleDelete(record.id)'
+                >
+                  <a>鍒犻櫎</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span> -->
+
+        <span
+          slot="action"
+          slot-scope="text, record"
+        >
+          <a
+            v-if="record.versionStatus == '2'"
+            @click="handleRevise(record)"
+            v-has="'dailyMaintenanceStandard:revise'"
+          >鍗囩増</a>
+          <a
+            v-if="record.versionStatus == '1'"
+            @click="handleTakeEffect(record)"
+            v-has="'dailyMaintenanceStandard:takeEffect'"
+          >鐢熸晥</a>
+          <a-divider type="vertical" />
+          <a
+            v-if="record.versionStatus == '1'"
+            @click="handleEdit(record)"
+            v-has="'dailyMaintenanceStandard:edit'"
+          >缂栬緫</a>
+          <a-divider type="vertical" />
+          <a-popconfirm
+            v-if="record.versionStatus == '1'"
+            title="纭畾鍒犻櫎鍚�?"
+            @confirm="() => handleDelete(record.id)"
+            v-has="'dailyMaintenanceStandard:delete'"
+          >
+            <a>鍒犻櫎</a>
+          </a-popconfirm>
+        </span>
+
+      </a-table>
+      <a-tabs
+        type="card"
+        defaultActiveKey="1"
+      >
+        <a-tab-pane
+          tab='淇濆吇鏄庣粏'
+          key="1"
+        >
+          <div
+            class="table-operator"
+            style="margin:-16px"
+          >
+            <daily-maintenance-standard-detail :maintenanceStandardId='maintenanceStandardId' />
+          </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-tabs>
+    </div>
+
+    <daily-maintenance-standard-modal
+      ref='modalForm'
+      @ok='modalFormOk'
+    ></daily-maintenance-standard-modal>
+  </a-card>
+</template>
+
+<script>
+
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+import { getAction, postAction, requestPut } from '@/api/manage'
+import DailyMaintenanceStandardDetail from './modules/dailyMaintenanceStandard/DailyMaintenanceStandardDetail'
+import MaintenanceStandardPlanningMaterial from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardPlanningMaterial'
+import MaintenanceStandardSafetyRequirement from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardSafetyRequirement'
+import DailyMaintenanceStandardModal from './modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal'
+import MaintenanceStandardWorkInstruction from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardWorkInstruction'
+import '@/assets/less/TableExpand.less'
+
+export default {
+  name: 'DailyMaintenanceStandardList',
+  mixins: [JeecgListMixin],
+  components: {
+    DailyMaintenanceStandardDetail,
+    DailyMaintenanceStandardModal,
+    MaintenanceStandardPlanningMaterial,
+    MaintenanceStandardSafetyRequirement,
+    MaintenanceStandardWorkInstruction
+  },
+  data() {
+    return {
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1
+          }
+        },
+        {
+          title: '鐗堟湰',
+          align: 'center',
+          dataIndex: 'version',
+        },
+        {
+          title: '鐗堟湰鐘舵��',
+          align: 'center',
+          dataIndex: 'versionStatusName',
+        },
+        {
+          title: '鏍囧噯缂栫爜',
+          align: 'center',
+          dataIndex: 'num',
+        },
+
+        {
+          title: '璁惧缂栫爜',
+          align: 'center',
+          dataIndex: 'equipmentNum',
+        },
+        {
+          title: '璁惧鍚嶇О',
+          align: 'center',
+          dataIndex: 'equipmentName',
+        },
+        {
+          title: '璁惧鍨嬪彿',
+          align: 'center',
+          dataIndex: 'equipmentModel',
+        },
+        {
+          title: '瀵硅薄閮ㄩ棬',
+          align: 'center',
+          dataIndex: 'useDepartName',
+        },
+        {
+          title: '娲惧伐鏂瑰紡',
+          align: 'center',
+          dataIndex: 'assignModeName',
+        },
+        {
+          title: '璐d换鐝粍',
+          align: 'center',
+          dataIndex: 'teamName',
+        },
+        {
+          title: '鐗圭璁惧',
+          align: 'center',
+          dataIndex: 'specificEquipment',
+        },
+        {
+          title: '鐢熸晥鏃堕棿',
+          align: 'center',
+          dataIndex: 'takeEffectTime',
+        },
+        {
+          title: '澶辨晥鏃堕棿',
+          align: 'center',
+          dataIndex: 'loseEfficacyTime',
+        },
+        {
+          title: '鍒涘缓浜�',
+          align: 'center',
+          dataIndex: 'createBy',
+        },
+        {
+          title: '鍒涘缓鏃ユ湡',
+          align: 'center',
+          dataIndex: 'createTime',
+        },
+        // {
+        //   title: '鏇存柊浜�',
+        //   align: 'center',
+        //   dataIndex: 'updateBy',
+        // },
+        // {
+        //   title: '鏇存柊鏃ユ湡',
+        //   align: 'center',
+        //   dataIndex: 'updateTime',
+        // },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: 'center',
+          fixed: 'right',
+          scopedSlots: { customRender: 'action' },
+          width: 200,
+        }
+      ],
+      url: {
+        list: '/eam/maintenanceStandard/getMaintenanceStandardList',
+        delete: '/eam/maintenanceStandard/delete',
+        deleteBatch: '/eam/maintenanceStandard/deleteBatch',
+        versionTakeEffect: "/eam/maintenanceStandard/versionTakeEffect",
+      },
+      /* 鍒嗛〉鍙傛暟 */
+      ipagination: {
+        current: 1,
+        pageSize: 5,
+        pageSizeOptions: ['5', '10', '50'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      maintenanceStandardId: '-1',
+      queryParam: { type: 'daily' }
+    }
+  },
+  watch: {
+    selectionRows() {
+      this.$bus.$emit('dailyMaintenanceStandardSelectionRows', this.selectionRows);
+    },
+  },
+  methods: {
+    clickThenSelect(record) {
+      return {
+        on: {
+          click: () => {
+            this.onSelectChange(record.id.split(','), [record])
+          }
+        }
+      }
+    },
+    onClearSelected() {
+      this.selectedRowKeys = []
+      this.selectionRows = []
+      this.maintenanceStandardId = '-1'
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      if (selectedRowKeys.length == 1) {
+        this.maintenanceStandardId = selectionRows[0]['id']
+      } else {
+        this.maintenanceStandardId = '-1'
+      }
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+    },
+
+    onChange(e) {
+      this.queryParam.versionStatus = e.target.value;
+      this.loadData();
+    },
+
+    loadData(arg) {
+      if (!this.url.list) {
+        this.$message.error('璇疯缃畊rl.list灞炴��!')
+        return
+      }
+      //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.onClearSelected()
+      var params = this.getQueryParams()//鏌ヨ鏉′欢
+      this.loading = true
+      getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          this.dataSource = res.result.records
+          this.ipagination.total = res.result.total
+        }
+        if (res.code === 510) {
+          this.$message.warning(res.message)
+        }
+        this.loading = false
+      })
+    },
+
+    handleEdit: function (record) {
+      this.$refs.modalForm.edit(record)
+      this.$refs.modalForm.title = '缂栬緫'
+      this.$refs.modalForm.disableSubmit = false
+      this.$refs.modalForm.isRevise = false;
+    },
+    handleAdd: function () {
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.title = '鏂板'
+      this.$refs.modalForm.disableSubmit = false
+      this.$refs.modalForm.isRevise = false;
+    },
+
+    //鍗囩増
+    handleRevise: function (record) {
+      this.$refs.modalForm.edit(record);
+      this.$refs.modalForm.title = "淇濆吇鏍囧噯鐗堟湰鍗囩骇";
+      this.$refs.modalForm.disableSubmit = false;
+      this.$refs.modalForm.isRevise = true;
+    },
+
+    //鐢熸晥
+    handleTakeEffect(record) {
+      const that = this;
+      that.confirmLoading = true;
+      this.$confirm({
+        title: '鏃ュ父淇濆吇鏍囧噯鐗堟湰鐢熸晥锛�',
+        content: '鎻愮ず锛氱増鏈敓鏁堝悗涓婁竴鐗堟湰灏嗚嚜鍔ㄥけ鏁堬紝璇疯皑鎱庢搷浣滐紒',
+        okText: '纭',
+        cancelText: '鍙栨秷',
+        onOk() {
+          requestPut(that.url.versionTakeEffect, { id: record.id, num: record.num, versionStatus: '2' }).then((res) => {
+            if (res.success) {
+              that.$message.success("鐗堟湰鐢熸晥鎴愬姛锛�")
+              that.loadData(1)
+            } else {
+              that.$message.warning("鐗堟湰鐢熸晥澶辫触锛�")
+            }
+          }).finally(() => {
+            that.confirmLoading = false;
+          })
+        },
+      })
+    },
+
+    searchReset() {
+      this.maintenanceStandardId = '-1'
+      this.queryParam = { type: 'daily' }
+      this.loadData(1);
+    },
+  }
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+.table-operator .ant-btn {
+  margin: 10px 8px 8px 10px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3