From 38961119eed0046fc2a1cef88c064b67f15ebb0e Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 28 七月 2025 20:51:03 +0800
Subject: [PATCH] MDC页面添加

---
 src/views/mdc/base/modules/shift/ShiftSystem.vue |  229 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 229 insertions(+), 0 deletions(-)

diff --git a/src/views/mdc/base/modules/shift/ShiftSystem.vue b/src/views/mdc/base/modules/shift/ShiftSystem.vue
new file mode 100644
index 0000000..7197ad4
--- /dev/null
+++ b/src/views/mdc/base/modules/shift/ShiftSystem.vue
@@ -0,0 +1,229 @@
+<template>
+  <div class="shift_system">
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button type="primary" @click="handleAdd" icon="plus">鏂板</a-button>
+    </div>
+    <!-- table鍖哄煙-begin -->
+    <div style="flex: 1;overflow: auto">
+      <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns"
+               :dataSource="dataSource" :pagination="false" :loading="loading"
+               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}">
+         <span
+           slot="shiftStatus"
+           slot-scope="text, record"
+         >
+           <span v-if="text == 0" style="color:red;">鍋滅敤</span>
+           <span v-if="text == 1" style="color:green;">鍚敤</span>
+         </span>
+        <span
+          slot="defaultShift"
+          slot-scope="text, record"
+        >
+            <span v-if="text == 'true'">鏄�</span>
+            <span v-else-if="text == 'false'" >鍚�</span>
+            <span v-else-if="text == null">鍚�</span>
+         </span>
+        <span
+          slot="action"
+          slot-scope="text, record"
+        >
+          <a-dropdown>
+            <a class="ant-dropdown-link">
+              <a-icon type="down"/>
+            </a>
+            <a-menu slot="overlay">
+                <a-menu-item v-if="record.shiftStatus == 1">
+                <a key="0" @click="handleDefault(record)">璁剧疆涓洪粯璁�</a>
+              </a-menu-item>
+              <a-menu-item v-if="record.shiftStatus == 1">
+                <a key="1" @click="handleEdit(record)">缂栬緫</a>
+              </a-menu-item>
+              <a-menu-item v-if="record.shiftStatus == 0">
+                <a key="2" @click="handleStatus(record.id,1)">鍚敤</a>
+              </a-menu-item>
+              <a-menu-item v-if="record.shiftStatus == 1">
+                <a key="3" @click="handleStatus(record.id,0)">鍋滅敤</a>
+              </a-menu-item>
+               <a-menu-item >
+                <a key="4" @click="handleDelete(record.id)">鍒犻櫎</a>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+
+    <shift-system-model ref="modalForm" @ok="modalFormOk"></shift-system-model>
+  </div>
+</template>
+
+<script>
+  import qs from 'qs'
+  import {
+    requestPut, putAction, deleteAction,postAction
+  } from '@/api/manage'
+  import {
+    JeecgListMixin
+  } from '@/mixins/JeecgListMixin'
+  import ShiftSystemModel from './ShiftSystemModel'
+
+  export default {
+    name: 'ShiftSystem',
+    mixins: [JeecgListMixin],
+    components: {
+      ShiftSystemModel
+    },
+    data() {
+      return {
+        statusName: '',
+        disabled: true,
+        disableMixinCreated: false,
+        url: {
+          list: '/mdc/mdcMdcShift/queryPageList',
+          changeStatus: '/mdc/mdcMdcShift/changeStatus',
+          deleteBatch:'/mdc/mdcMdcShift/deleteShift',
+          changeDefaultShift: '/mdc/mdcMdcShift/changeDefaultShift'
+        },
+        columns: [
+          {
+            title: '鐝埗',
+            align: 'center',
+            dataIndex: 'shiftName'
+          },
+          {
+            title: '鐘舵��',
+            align: 'center',
+            dataIndex: 'shiftStatus',
+            scopedSlots: { customRender: 'shiftStatus' }
+          },
+          {
+            title: '榛樿鐝埗',
+            align: 'center',
+            dataIndex: 'defaultShift',
+            scopedSlots: { customRender: 'defaultShift' }
+          },
+          {
+            title: '鎿嶄綔',
+            align: 'center',
+            dataIndex: 'action',
+            scopedSlots: { customRender: 'action' }
+          }
+        ]
+      }
+    },
+    methods: {
+      handleStatus(id, status) {
+        let _this = this
+        putAction(this.url.changeStatus, { id: id, status: status }).then((res) => {
+          if (res.success) {
+            _this.$notification.success({
+              message:'娑堟伅',
+              description:res.message
+            })
+            _this.loadData()
+          } else {
+            _this.$notification.warning({
+              message:'娑堟伅',
+              description:res.message
+            });
+          }
+        })
+      },
+      handleAdd() {
+        this.$refs.modalForm.add()
+        this.$refs.modalForm.title = '鐝埗閰嶇疆'
+        this.$refs.modalForm.disableSubmit = false
+      },
+      handleDefault:function(record){
+        postAction(this.url.changeDefaultShift,qs.stringify({id:record.id})).then((res) =>{
+            if(res.success){
+              // this.$message.success(res.message);
+              this.$notification.success({
+                message:'娑堟伅',
+                description:res.message
+              });
+              this.loadData()
+            }else{
+              // this.$message.success(res.message);
+              this.$notification.warning({
+                message:'娑堟伅',
+                description:res.message
+              });
+            }
+        })
+      },
+      handleDelete: function(record){
+        if(!this.url.deleteBatch){
+          this.$message.error("璇疯缃畊rl.delete灞炴��!")
+          return
+        }
+        var that = this;
+        deleteAction(that.url.deleteBatch, {id: record}).then((res) => {
+          if (res.success) {
+            // that.$message.success(res.message);
+            that.$notification.success({
+              message:'娑堟伅',
+              description:res.message
+            });
+            that.loadData();
+          } else {
+            // that.$message.warning(res.message);
+            that.$notification.warning({
+              message:'娑堟伅',
+              description:res.message
+            });
+          }
+        });
+      },
+      handleEdit(record) {
+        this.$refs.modalForm.edit(record)
+        this.$refs.modalForm.title = '鐝埗閰嶇疆'
+        this.$refs.modalForm.disableSubmit = true
+
+      },
+      onSelectChange(selectedRowKeys, selectionRows) {
+        this.selectedRowKeys = selectedRowKeys;
+        this.selectionRows = selectionRows;
+        this.$emit('selectionShiftRow', this.selectionRows[0])
+      },
+    },
+    created() {
+    }
+
+  }
+</script>
+
+<style lang="less" scoped>
+  .shift_system{
+    overflow: auto;
+    display: flex;
+    flex-direction: column;
+  }
+
+  @media screen and (min-width: 1920px){
+    .shift_system{
+      height: 748px!important;
+    }
+  }
+  @media screen and (min-width: 1680px) and (max-width: 1920px){
+    .shift_system{
+      height: 748px!important;
+    }
+  }
+  @media screen and (min-width: 1400px) and (max-width: 1680px){
+    .shift_system{
+      height: 600px!important;
+    }
+  }
+  @media screen and (min-width: 1280px) and (max-width: 1400px){
+    .shift_system{
+      height: 501px!important;
+    }
+  }
+  @media screen and (max-width: 1280px){
+    .shift_system{
+      height: 501px!important;
+    }
+  }
+</style>

--
Gitblit v1.9.3