From cf9d04b97ef0b8abb63e587e0898e301765ed4b9 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期一, 18 八月 2025 17:07:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/mdc/base/modules/shift/ShiftInfo.vue | 235 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 235 insertions(+), 0 deletions(-)
diff --git a/src/views/mdc/base/modules/shift/ShiftInfo.vue b/src/views/mdc/base/modules/shift/ShiftInfo.vue
new file mode 100644
index 0000000..e6d104e
--- /dev/null
+++ b/src/views/mdc/base/modules/shift/ShiftInfo.vue
@@ -0,0 +1,235 @@
+<template>
+ <div class="shift_info">
+ <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+ <div class="table-operator">
+ <a-button type="primary" v-if="Object.keys(shiftSystemRow).length>0" @click="handleAdd" icon="plus">閰嶇疆</a-button>
+ </div>
+ <!-- table鍖哄煙-begin -->
+ <div style="width: 100%;flex: 1;overflow: auto">
+ <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns"
+ :dataSource="dataSource" :pagination="false" :loading="loading">
+ <span
+ slot="shiftSubStatus"
+ 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="isDaySpan"
+ slot-scope="text, record"
+ >
+ <span v-if="text == 'true'">鏄�</span>
+ <span v-if="text == 'false'">鍚�</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.shiftSubStatus == 1">
+ <a key="1" @click="handleEdit(record)">缂栬緫</a>
+ </a-menu-item>
+ <a-menu-item v-if="record.shiftSubStatus == 0">
+ <a key="2" @click="handleStatus(record.id,1)">鍚敤</a>
+ </a-menu-item>
+ <a-menu-item v-if="record.shiftSubStatus == 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-info-model ref="modalForm" @ok="modalFormOk"></shift-info-model>
+ </div>
+</template>
+
+<script>
+ import {
+ requestPut, putAction, deleteAction
+ } from '@/api/manage'
+ import {
+ JeecgListMixin
+ } from '@/mixins/JeecgListMixin'
+ import ShiftInfoModel from './ShiftInfoModel'
+
+ export default {
+ name: 'ShiftInfo',
+ mixins: [JeecgListMixin],
+ components: {
+ ShiftInfoModel
+ },
+ props: {
+ shiftSystemRow: {
+ type: Object,
+ required: true,
+ default: {}
+ }
+ },
+ data() {
+ return {
+ statusName: '',
+ disabled: true,
+ disableMixinCreated: true,
+ url: {
+ list: '/mdc/mdcShiftSub/queryPageList',
+ changeStatus: '/mdc/mdcShiftSub/updateSubStatusById',
+ deleteBatch: '/mdc/mdcShiftSub/deleteMdcShiftSub'
+ },
+ columns: [
+ {
+ title: '鐝',
+ align: 'center',
+ dataIndex: 'shiftSubName'
+ },
+ {
+ title: '寮�濮嬫椂闂�',
+ align: 'center',
+ dataIndex: 'startDate'
+ },
+ {
+ title: '缁撴潫鏃堕棿',
+ align: 'center',
+ dataIndex: 'endDate'
+ },
+ {
+ title: '鏄惁璺ㄥぉ',
+ align: 'center',
+ dataIndex: 'isDaySpan',
+ scopedSlots: { customRender: 'isDaySpan' }
+ },
+ {
+ title: '寮�濮嬩紤鎭椂闂�',
+ align: 'center',
+ dataIndex: 'sleepStartDate'
+ },
+ {
+ title: '缁撴潫浼戞伅鏃堕棿',
+ align: 'center',
+ dataIndex: 'sleepEndDate'
+ },
+ {
+ title: '鐘舵��',
+ align: 'center',
+ dataIndex: 'shiftSubStatus',
+ scopedSlots: { customRender: 'shiftSubStatus' }
+ },
+ {
+ title: '鎿嶄綔',
+ align: 'center',
+ dataIndex: 'action',
+ scopedSlots: { customRender: 'action' }
+ }
+ ]
+ }
+ },
+ methods: {
+ handleAdd() {
+ this.$refs.modalForm.add(this.shiftSystemRow)
+ this.$refs.modalForm.title = '鐝閰嶇疆'
+ this.$refs.modalForm.disableSubmit = false
+ },
+ handleEdit(record) {
+ record.shiftId = this.shiftSystemRow.id
+ record.shiftName = this.shiftSystemRow.shiftName
+ this.$refs.modalForm.edit(record)
+ this.$refs.modalForm.title = '鐝閰嶇疆'
+ this.$refs.modalForm.disableSubmit = true
+ },
+ 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
+ });
+ }
+ });
+ },
+ handleStatus(id, status) {
+ let _this = this
+ putAction(this.url.changeStatus, { id: id, status: status }).then((res) => {
+ if (res.success) {
+ // _this.$message.success('鎿嶄綔鎴愬姛锛�')
+ _this.$notification.success({
+ message:'娑堟伅',
+ description:"鎿嶄綔鎴愬姛"
+ });
+ _this.loadData()
+ } else {
+ // _this.$message.warning('鎿嶄綔澶辫触锛�')
+ _this.$notification.warning({
+ message:'娑堟伅',
+ description:"鎿嶄綔澶辫触"
+ });
+ }
+ })
+ },
+ },
+ created() {
+ },
+ watch: {
+ shiftSystemRow(val) { // 鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢
+ this.queryParam.shiftId = val.id
+ this.loadData()
+ }
+ }
+
+ }
+</script>
+
+<style lang="less" scoped>
+ .shift_info{
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ }
+
+ @media screen and (min-width: 1920px){
+ .shift_info{
+ height: 748px!important;
+ }
+ }
+ @media screen and (min-width: 1680px) and (max-width: 1920px){
+ .shift_info{
+ height: 748px!important;
+ }
+ }
+ @media screen and (min-width: 1400px) and (max-width: 1680px){
+ .shift_info{
+ height: 600px!important;
+ }
+ }
+ @media screen and (min-width: 1280px) and (max-width: 1400px){
+ .shift_info{
+ height: 501px!important;
+ }
+ }
+ @media screen and (max-width: 1280px){
+ .shift_info{
+ height: 501px!important;
+ }
+ }
+</style>
--
Gitblit v1.9.3