Commit 9a9fddd5 authored by 黄奎's avatar 黄奎

页面修改

parent 7221bde1
......@@ -21,34 +21,34 @@
</div>
<div class="row wrap">
<div class="col-12">
<el-input v-model="objOption.GoalMoney" placeholder="金额"
@keyup.native="checkInteger(objOption,'GoalMoney')"></el-input>
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.GoalMoney" ref="GoalMoney2"
label="目标金额" :rules="[val => !!val || '请填写目标金额']" />
</div>
</div>
<div class="row wrap" style="margin-top:10px;">
<div class="col-12">
<selectTree :treeData='DeptList' :defaultArray="returnString" nodeKey="DeptId" :multiple="false"
labelKey="DeptName" childrenKey="ChildList" tipText="选择部门" @getChild="getChild"></selectTree>
<q-select filled stack-label v-model="objOption.Dept_Id" :options="DeptList" emit-value map-options
label="所属部门" option-label="DeptName" option-value="DeptId" />
</div>
</div>
</template>
<template v-if="isShow==2">
<div class="row wrap">
<div class="col-12">
<el-date-picker v-model="value2" style="width:100%" type="month"
value-format="yyyy-MM" placeholder="选择月">
<el-date-picker v-model="value2" style="width:100%" type="month" value-format="yyyy-MM" placeholder="选择月">
</el-date-picker>
</div>
</div>
<div class="row wrap" style="margin-top:10px;">
<div class="col-12">
<el-input v-model="updateMsg.GoalMoney" placeholder="金额" @keyup.native="checkInteger(updateMsg,'GoalMoney')"></el-input>
<q-input filled stack-label maxlength="20" :dense="false" v-model="updateMsg.GoalMoney" ref="GoalMoney2"
label="目标金额" :rules="[val => !!val || '请填写目标金额']" />
</div>
</div>
<div class="row wrap" style="margin-top:10px;">
<div class="col-12">
<selectTree :treeData='DeptList' :defaultArray="returnString2" nodeKey="DeptId" :multiple="false"
labelKey="DeptName" childrenKey="ChildList" tipText="选择部门" @getChild="getChild"></selectTree>
<q-select filled stack-label v-model="updateMsg.Dept_Id" :options="DeptList" emit-value map-options
label="所属部门" option-label="DeptName" option-value="DeptId" />
</div>
</div>
</template>
......@@ -56,10 +56,10 @@
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" v-if="isShow==1" :loading="saveLoading"
@click="saveNeed" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" v-if="isShow==2" :loading="saveLoading"
@click="saveTarget" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" v-if="isShow==1"
:loading="saveLoading" @click="saveNeed" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" v-if="isShow==2"
:loading="saveLoading" @click="saveTarget" />
</q-card-actions>
</q-card>
</q-dialog>
......@@ -72,7 +72,6 @@
} from '../../api/system/index'
//部门
import {
getDeptTree,
getDeptList
} from '../../api/system/dept'
import selectTree from '../../components/common/select-tree'
......@@ -93,7 +92,7 @@
value: '',
objOption: {
GoalMoney: "",
Dept_Id: 0,
Dept_Id: 13,
TimeList: [],
},
updateMsg: {
......@@ -105,39 +104,25 @@
},
optionTitle: "",
DeptList: [], // 部门下拉
returnString: [], //默认岗位
isShow: 1,
value2:'',
returnString2:[]
value2: '',
}
},
created() {
this.queryDeptList();
},
mounted() {
this.initObj();
this.queryDeptTree();
},
methods: {
//获取部门结构树
queryDeptTree() {
getDeptTree({}).then(res => {
if (res.Code == 1) {
queryDeptList() {
var qMsg = {};
getDeptList(qMsg).then(res => {
this.DeptList = res.Data;
}
})
});
},
getChild(deptArray) {
var tempStr = "";
if (deptArray && deptArray != '') {
tempStr = deptArray;
}
if (tempStr) {
this.objOption.Dept_Id = tempStr;
this.updateMsg.Dept_Id = tempStr;
} else {
this.objOption.Dept_Id = 0;
this.updateMsg.Dept_Id = 0;
}
},
//选择月份
dateChange(val) {
this.objOption.TimeList.push(val) // 这里记得格式化
......@@ -156,9 +141,8 @@
this.updateMsg.MonthStr = res.Data.MonthStr;
this.updateMsg.GoalMoney = res.Data.GoalMoney;
this.updateMsg.Dept_Id = res.Data.Dept_Id;
this.returnString2.push(res.Data.Dept_Id);
this.isShow = 2;
this.value2 = this.updateMsg.YearStr+'-'+this.updateMsg.MonthStr;
this.value2 = this.updateMsg.YearStr + '-' + this.updateMsg.MonthStr;
})
this.optionTitle = "修改目标"
} else {
......@@ -192,12 +176,12 @@
})
},
//修改保存
saveTarget(){
if(this.value2){
saveTarget() {
if (this.value2) {
let myDate = this.value2.split('-');
this.updateMsg.YearStr = myDate[0];
this.updateMsg.MonthStr = myDate[1];
}else{
} else {
this.updateMsg.YearStr = '';
this.updateMsg.MonthStr = '';
}
......@@ -219,5 +203,4 @@
}
}
}
</script>
\ No newline at end of file
......@@ -3,13 +3,14 @@
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="dataList" :columns="columns" row-key="name">
<template v-slot:top="props">
<template v-slot:top>
<div class="col-2 q-table__title">目标管理</div>
<q-space />
<div class="page-option">
<el-date-picker v-model="dateTime" size="small" style="margin-right:10px;" type="month" value-format="yyyy-MM" @change="dateChange" placeholder="选择月">
<el-date-picker v-model="dateTime" size="small" style="margin-right:10px;" type="month"
value-format="yyyy-MM" @change="dateChange" placeholder="选择月">
</el-date-picker>
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增阶段" @click="addObj(null)" />
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增目标" @click="addObj(null)" />
</div>
</template>
<template v-slot:body-cell-Id="props">
......@@ -49,25 +50,46 @@
data() {
return {
columns: [{
name: 'DeptName',
label: '部门',
field: 'DeptName',
align: 'left'
},
{
name: 'YearStr',
label: '年份',
field: 'YearStr',
align: 'left'
}, {
},
{
name: 'MonthStr',
label: '月份',
field: 'MonthStr',
align: 'left'
},
{
name: 'GoalMoney',
label: '金额',
field: 'GoalMoney',
align: 'left'
}, {
name: 'CreateBy',
name: 'CreateByName',
label: '创建人',
align: 'left',
field: 'CreateBy'
}, {
field: 'CreateByName'
},
{
name: 'CreateTimeStr',
label: '创建时间',
align: 'left',
field: 'CreateTimeStr'
},
{
name: 'Id',
label: '操作',
field: 'Id'
}],
}
],
msg: {
pageIndex: 1,
pageSize: 12,
......@@ -80,7 +102,7 @@
loading: true,
isShowTargetForm: false,
customObj: {},
dateTime:''
dateTime: ''
}
},
mounted() {
......@@ -88,12 +110,12 @@
},
methods: {
//选择日期
dateChange(val){
if(val){
dateChange(val) {
if (val) {
let myDate = val.split('-');
this.msg.YearStr = myDate[0];
this.msg.MonthStr = myDate[1];
}else{
} else {
this.msg.YearStr = '';
this.msg.MonthStr = '';
}
......@@ -159,10 +181,8 @@
}
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment