|
@@ -131,7 +131,9 @@
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
-
|
|
|
|
|
|
+ <!-- <div class="table-operator">
|
|
|
|
+ <a-button @click="handleAdds()" type="primary" icon="plus" >新增</a-button>
|
|
|
|
+ </div> -->
|
|
<!-- table区域-begin -->
|
|
<!-- table区域-begin -->
|
|
<a-tabs default-active-key="1" @change="callback">
|
|
<a-tabs default-active-key="1" @change="callback">
|
|
|
|
|
|
@@ -183,6 +185,52 @@
|
|
|
|
|
|
</a-tab-pane>
|
|
</a-tab-pane>
|
|
</a-tabs>
|
|
</a-tabs>
|
|
|
|
+ <a-modal v-model="vailts" title="年假新增" @ok="addval()">
|
|
|
|
+ <a-spin :spinning="confirmLoading">
|
|
|
|
+ <a-form :form="form">
|
|
|
|
+ <a-form-item
|
|
|
|
+ :labelCol="labelCol"
|
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
|
+ label="员工姓名">
|
|
|
|
+ <j-select-user-by-dep v-decorator="['userId', validatorRules.realname]"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item
|
|
|
|
+ :labelCol="labelCol"
|
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
|
+ label="部门名称">
|
|
|
|
+ <a-input placeholder="请输入部门名称" :disabled="true" v-decorator="['deptNames', validatorRules.deptname ]" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item
|
|
|
|
+ :labelCol="labelCol"
|
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
|
+ label="类型">
|
|
|
|
+ <j-dict-select-tag disabled v-decorator="['holidayType', {initialValue:'年假'}]" :triggerChange="true" placeholder="请选择类型"
|
|
|
|
+ dictCode="vacation_type" />
|
|
|
|
+
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item
|
|
|
|
+ :labelCol="labelCol"
|
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
|
+ label="开始日期">
|
|
|
|
+ <a-date-picker showTime format='YYYY-MM-DD HH:mm:ss' v-decorator="[ 'startDate', validatorRules.startDate]" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item
|
|
|
|
+ :labelCol="labelCol"
|
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
|
+ label="结束日期">
|
|
|
|
+ <a-date-picker showTime :disabled-date="disabledDate" format='YYYY-MM-DD HH:mm:ss' v-decorator="[ 'endDate', validatorRules.endDate]" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item
|
|
|
|
+ :labelCol="labelCol"
|
|
|
|
+ :wrapperCol="wrapperCol"
|
|
|
|
+ label="备注">
|
|
|
|
+ <a-textarea :maxLength="255" placeholder="请输入备注" v-decorator="['demo', {}]" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </a-form>
|
|
|
|
+ </a-spin>
|
|
|
|
+ </a-modal>
|
|
<!-- table区域-end -->
|
|
<!-- table区域-end -->
|
|
|
|
|
|
<!-- 表单区域 -->
|
|
<!-- 表单区域 -->
|
|
@@ -195,23 +243,48 @@
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
|
import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
|
import departWindow from '../modules/DepartWindow'
|
|
import departWindow from '../modules/DepartWindow'
|
|
- import { httpAction,getAction,downFile } from '@/api/manage'
|
|
|
|
|
|
+ import { httpAction,getAction,downFile} from '@/api/manage'
|
|
|
|
+ import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
|
import moment from "moment"
|
|
import moment from "moment"
|
|
export default {
|
|
export default {
|
|
name: 'BdSchedulingList',
|
|
name: 'BdSchedulingList',
|
|
mixins: [JeecgListMixin],
|
|
mixins: [JeecgListMixin],
|
|
components: {
|
|
components: {
|
|
JDictSelectTag,
|
|
JDictSelectTag,
|
|
- departWindow
|
|
|
|
|
|
+ departWindow,
|
|
|
|
+ JSelectUserByDep
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ confirmLoading:false,
|
|
description: '加班信息',
|
|
description: '加班信息',
|
|
departNames:"",
|
|
departNames:"",
|
|
|
|
+ userid:"",
|
|
|
|
+ deptid:"",
|
|
|
|
+ vailts:false,
|
|
toggleSearchStatuss:false,
|
|
toggleSearchStatuss:false,
|
|
queryParam2:{},
|
|
queryParam2:{},
|
|
departNamest:"",
|
|
departNamest:"",
|
|
dataSources:[],
|
|
dataSources:[],
|
|
|
|
+ form: this.$form.createForm(this),
|
|
|
|
+ validatorRules:{
|
|
|
|
+ realname:{rules: [{ required: true, message: '请输入员工名称!' },{
|
|
|
|
+ validator: this.validateRealname
|
|
|
|
+ }]},
|
|
|
|
+ deptname:{rules: [{ required: true, message: '请输入部门名称!' }]},
|
|
|
|
+ type:{rules: [{ required: true, message: '请选择类型' }]},
|
|
|
|
+ startDate:{rules: [{ required: true, message: '请选择开始日期' },{validator:this.validatestartDate}]},
|
|
|
|
+ endDate:{rules: [{ required: true, message: '请选择结束日期' }]},
|
|
|
|
+ },
|
|
|
|
+ model: {},
|
|
|
|
+ labelCol: {
|
|
|
|
+ xs: { span: 24 },
|
|
|
|
+ sm: { span: 5 },
|
|
|
|
+ },
|
|
|
|
+ wrapperCol: {
|
|
|
|
+ xs: { span: 24 },
|
|
|
|
+ sm: { span: 16 },
|
|
|
|
+ },
|
|
loadings:false,
|
|
loadings:false,
|
|
isorters:{
|
|
isorters:{
|
|
column: 'userDate',
|
|
column: 'userDate',
|
|
@@ -374,7 +447,9 @@ import moment from "moment"
|
|
list2:'/vacation/vacation/list',
|
|
list2:'/vacation/vacation/list',
|
|
exportXlsUrl: "/workOvertime/workOvertime/exportXls",
|
|
exportXlsUrl: "/workOvertime/workOvertime/exportXls",
|
|
exportXlsUrls: "/vacation/vacation/exportXls",
|
|
exportXlsUrls: "/vacation/vacation/exportXls",
|
|
- importExcelUrl:"/workOvertime/workOvertime/importExcel"
|
|
|
|
|
|
+ importExcelUrl:"/workOvertime/workOvertime/importExcel",
|
|
|
|
+ dept:"/sys/user/queryUsersByusername",
|
|
|
|
+ add:"/vacation/vacation/add"
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -383,6 +458,103 @@ import moment from "moment"
|
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
|
}
|
|
}
|
|
},methods: {
|
|
},methods: {
|
|
|
|
+ addval(){
|
|
|
|
+ this.form.validateFields((err, values) => {
|
|
|
|
+ if (!err) {
|
|
|
|
+ var startDate= this.form.getFieldValue('startDate');
|
|
|
|
+ var endDate= this.form.getFieldValue('endDate');
|
|
|
|
+ var holidayType= this.form.getFieldValue('holidayType');
|
|
|
|
+ var demo=this.form.getFieldValue('demo');
|
|
|
|
+ var userId=this.form.getFieldValue('userId');
|
|
|
|
+ this.confirmLoading=true;
|
|
|
|
+ httpAction(this.url.add, {
|
|
|
|
+ userId: userId,
|
|
|
|
+ startDate:moment(startDate).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
+ endDate:moment(endDate).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
|
+ demo:demo,
|
|
|
|
+ holidayType:holidayType
|
|
|
|
+ },"post").then(res => {
|
|
|
|
+ if (res.success) {
|
|
|
|
+ this.$message.success(res.message);
|
|
|
|
+ this.confirmLoading=false;
|
|
|
|
+ this.vailts=false;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning(res.message);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleAdds(){
|
|
|
|
+
|
|
|
|
+ this.form.setFieldsValue({
|
|
|
|
+ endDate:null,
|
|
|
|
+ startDate:null,
|
|
|
|
+ demo:null,
|
|
|
|
+ userId:null,
|
|
|
|
+ deptNames:null
|
|
|
|
+ })
|
|
|
|
+ this.vailts=true;
|
|
|
|
+ },
|
|
|
|
+ disabledDate(current) {
|
|
|
|
+ var startDate= this.form.getFieldValue('startDate');
|
|
|
|
+ return current <= moment(startDate).subtract(0, 'day');
|
|
|
|
+ },
|
|
|
|
+ validatestartDate(rule, value, callback) {
|
|
|
|
+ if (!value) {
|
|
|
|
+ callback()
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ var end=this.form.getFieldValue('endDate');
|
|
|
|
+ if(end!=null){
|
|
|
|
+ var start=new Date(value);
|
|
|
|
+ var ends=new Date(end);
|
|
|
|
+ if(ends.getTime()<start.getTime()){
|
|
|
|
+ this.form.setFieldsValue({
|
|
|
|
+ endDate:null
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ queryDeptName(e){
|
|
|
|
+ getAction(this.url.dept,{id:e}).then((res)=>{
|
|
|
|
+ if(res.success){
|
|
|
|
+ if(res.result.length>0){
|
|
|
|
+ var list=res.result;
|
|
|
|
+ var deptids=[];
|
|
|
|
+ var deptname=[];
|
|
|
|
+ for(var i=0;i<list.length;i++){
|
|
|
|
+ deptids.push(list[i].deptid);
|
|
|
|
+ deptname.push(list[i].deptname);
|
|
|
|
+ }
|
|
|
|
+ this.deptid=deptids.join(",");
|
|
|
|
+ this.form.setFieldsValue({
|
|
|
|
+ deptNames:deptname.join(",")
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ this.deptid="";
|
|
|
|
+ this.form.setFieldsValue({
|
|
|
|
+ deptNames:""
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ validateRealname(rule, value, callback) {
|
|
|
|
+ if (!value) {
|
|
|
|
+ callback()
|
|
|
|
+ this.deptid="";
|
|
|
|
+ this.form.setFieldsValue({
|
|
|
|
+ deptNames:""
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.queryDeptName(value);
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
handleToggleSearchs(){
|
|
handleToggleSearchs(){
|
|
this.toggleSearchStatuss = !this.toggleSearchStatuss;
|
|
this.toggleSearchStatuss = !this.toggleSearchStatuss;
|
|
},
|
|
},
|