ysh 3 سال پیش
والد
کامیت
e0bd656da7

+ 166 - 0
src/views/system/schedulingInformation/BdAnnualLeaveList.vue

@@ -0,0 +1,166 @@
+<template>
+  <a-card :bordered="false">
+
+    <!-- 查询区域 -->
+  
+  <!-- 查询区域 -->
+  <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.yearName"></a-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>
+  
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</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-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"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        @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>
+
+      </a-table>
+    </div>
+    <!-- table区域-end -->
+
+    <!-- 表单区域 -->
+    <BdAnnualLeave-modal ref="modalForm" @ok="modalFormOk"></BdAnnualLeave-modal>
+  </a-card>
+</template>
+
+<script>
+  import BdAnnualLeaveModal from './BdAnnualLeaveModal'
+  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
+  import JDictSelectTag from '@/components/dict/JDictSelectTag'
+  import JTreeSelect from '@/components/jeecg/JTreeSelect'
+  export default {
+    name: 'BdAnnualLeaveList',
+    mixins: [JeecgListMixin],
+    components: {
+      BdAnnualLeaveModal,
+      JDictSelectTag,
+      JTreeSelect
+    },
+    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: 'yearName'
+          },
+          {
+            title: '年假生效日期',
+            align: 'center',
+            dataIndex: 'beginDate'
+          },
+          {
+            title: '年假失效日期',
+            align: 'center',
+            dataIndex: 'endDate'
+          },
+          {
+            title: '备注',
+            align: 'center',
+            dataIndex: 'demo'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align: 'center',
+            scopedSlots: { customRender: 'action' },
+          }
+        ],
+        url: {
+          list: '/schedulingInformation/bdAnnualLeave/list',
+          delete: '/schedulingInformation/bdAnnualLeave/delete',
+          deleteBatch: '/schedulingInformation/bdAnnualLeave/deleteBatch',
+          exportXlsUrl: '/schedulingInformation/bdAnnualLeave/exportXls',
+          importExcelUrl: 'schedulingInformation/bdAnnualLeave/importExcel',
+        },
+      }
+    },
+    computed: {
+      importExcelUrl: function () {
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less'
+</style>

+ 196 - 0
src/views/system/schedulingInformation/BdAnnualLeaveModal.vue

@@ -0,0 +1,196 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="关闭">
+
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="年度">
+          <a-input placeholder="请输入年度" v-decorator="['yearName', validatorRules.yearName]"/>
+        </a-form-item>
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="年假生效日期">
+          <a-date-picker format="YYYY-MM-DD" v-decorator="['beginDate', validatorRules.beginDate]"/>
+          <!-- <a-input placeholder="请输入年假生效日期" v-decorator="['beginDate', validatorRules.beginDate]"/> -->
+        </a-form-item>
+      
+        <a-form-item
+         :labelCol="labelCol"
+         :wrapperCol="wrapperCol"
+         label="年假失效日期">
+         <a-date-picker format="YYYY-MM-DD" v-decorator="['endDate', validatorRules.endDate]"/>
+         <!-- <a-input placeholder="请输入年假失效日期" v-decorator="['endDate', validatorRules.endDate]"/> -->
+        </a-form-item>
+        
+        <a-form-item
+         :labelCol="labelCol"
+         :wrapperCol="wrapperCol"
+         label="备注">
+         <a-input placeholder="请输入备注" v-decorator="['demo', validatorRules.demo]"/>
+        </a-form-item>
+      </a-form>
+    </a-spin>
+  </a-modal>
+  
+</template>
+
+<script>
+  import pick from 'lodash.pick'
+  import { httpAction } from '@/api/manage'
+  import { duplicateCheck } from '@/api/api'
+  import JDictSelectTag from '@/components/dict/JDictSelectTag'
+  // import departWindow from './DepartWindow'
+import { queryIdTree } from '@/api/api'
+  let validatorCodeTimer = null
+
+  export default {
+    name: 'BdAnnualLeaveModal',
+    components: { 
+    JDictSelectTag,
+    // departWindow
+    },
+    data() {
+      return {
+        departTree:[],
+        checkedDepartKeys:[],
+        selectDeptKeys:[],
+        visibles:false,
+        title: '操作',
+        visible: false,
+        deptname:"",
+        deptid:"",
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        form: this.$form.createForm(this),
+        validatorRules: {
+          yearName: {
+            rules: [
+              {required: true, message: '请输入年度' },
+              {
+                validator: this.validateName
+              }
+            ]
+          },
+          beginDate: { rules: [{ required: true, message: '请输入年假生效日期' }] },
+          endDate: { rules: [{ required: true, message: '请输入年假失效日期' }] },
+        },
+        url: {
+          add: '/schedulingInformation/bdAnnualLeave/add',
+          edit: '/schedulingInformation/bdAnnualLeave/edit',
+        },
+        readOnly:false
+      }
+    },
+    created() {
+      
+    },
+    methods: {
+      validateName(rule, value, callback) {
+        if (!value) {
+          callback()
+        } else {
+          
+          if (value.length != 4) {
+            callback("请输入正确格式的年度");
+          }
+          if (!RegExp(/^[0-9]*$/).test(value)) {
+           callback("请输入正确格式的年度");
+          }
+          callback()
+        }
+      },
+      add() {
+        this.edit({})
+      },
+      edit(record) {
+        this.form.resetFields()
+        console.log(record)
+        this.model = Object.assign({}, record)
+        this.visible = true
+        if(record.id){
+          this.readOnly=true
+        }else{
+          this.readOnly=false
+        }
+       
+        this.$nextTick(() => {
+          this.form.setFieldsValue(pick(this.model,
+            'yearName',
+            'beginDate',
+            'endDate',
+            'demo'
+          ))
+        })
+      },
+      close() {
+        this.$emit('close')
+        this.visible = false
+      },
+      handleOk() {
+        const that = this
+        // 触发表单验证
+        // if(this.model.deptId==null||this.model.deptId==""){
+        //   that.$message.warning("请选择部门!");
+        //   return;
+        // }
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true
+            let httpurl = ''
+            let method = ''
+            if (!this.model.id) {
+              httpurl += this.url.add
+              method = 'post'
+            } else {
+              httpurl += this.url.edit
+              method = 'put'
+            }
+
+            let formData = Object.assign(this.model, values)
+            formData.beginDate = formData.beginDate?formData.beginDate.format('YYYY-MM-DD HH:mm:ss'):null;
+            formData.endDate = formData.endDate?formData.endDate.format('YYYY-MM-DD HH:mm:ss'):null;
+            formData.deptId=this.deptid;
+            httpAction(httpurl, formData, method).then((res) => {
+              if (res.success) {
+                that.$message.success(res.message)
+                that.$emit('ok')
+              } else {
+                that.$message.warning(res.message)
+              }
+            }).finally(() => {
+              that.confirmLoading = false
+              that.close()
+            })
+          }
+        })
+      },
+      handleCancel() {
+        this.close()
+      },
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+
+</style>

+ 1 - 1
src/views/system/schedulingInformation/ViewClockInList.vue

@@ -116,7 +116,7 @@
           <a-tag color="#87d068" v-if="record.showState == '2'">
            正常
           </a-tag>
-           <a-icon v-if="record.showState == '2'" title="该员工在未排班或休息班打卡" slot="count" type="exclamation-circle" style="color: #f57301" />
+           <a-icon v-if="record.showState == '2'" title="该员工在未排班或休息班打卡" slot="count" type="exclamation-circle" style="color: #f52b02" />
           <a-tag color="#87d068" v-if="record.showState == '0'">
             正常
           </a-tag>