作者 shenhailong

Merge remote-tracking branch 'origin/hqpt_vue' into hqpt_vue

... ... @@ -10,6 +10,8 @@ import PreManifest from './views/agent/PreManifest.vue'
import Company from './views/nav1/company.vue'
import Department from './views/nav1/department.vue'
import Group from './views/nav1/groupcompany.vue'
import Process from './views/hqpt/Process.vue'
import Job from './views/hqpt/Job.vue'
// import Form from './views/nav1/Form.vue'
import User from './views/nav1/user.vue'
... ... @@ -64,6 +66,16 @@ let routes = [
]
},
{
path: '/guestService',
component: Home,
name: '客服系统',
iconCls: 'fa fa-id-card-o',
children: [
{ path: '/process', component: Process, name: '工单管理' },
{ path: '/job', component: Job, name: '任务管理' }
]
},
{
path: '/satff',
component: Home,
name: '生活保障部门',
... ... @@ -72,8 +84,6 @@ let routes = [
{ path: '/security_inspection', component: SecrityInspection, name: '职工公寓安全巡视管理' },
{ path: '/key', component: Key, name: '职工公寓备用钥匙使用登记管理' },
{ path: '/maintain', component: Maintain, name: '职工公寓设施设备维修记录管理' },
{ path: '/come_car', component: ComeCar, name: '职工公寓外来人员车辆登记管理' },
{ path: '/on_duty', component: OnDuty, name: '职工公寓值班巡视记录管理' },
]
},
{
... ...
<template>
<section>
<el-dialog
:data="dialogData"
title="执行过程"
:visible.sync="centerDialogVisible"
width="30%"
center>
<span>{{dialogData.coment}}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
<!--工具条-->
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
<el-form :inline="true" :model="filters">
<el-form-item>
<el-input v-model="filters.processName" placeholder="工单名称"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" v-on:click="getProcessList()">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleAdd()">新增</el-button>
</el-form-item>
</el-form>
</el-col>
<!--列表-->
<el-table :data="processList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column type="index" width="60">
</el-table-column>
<el-table-column prop="process.processname" label="工单名称" width="100">
</el-table-column>
<el-table-column prop="user.realname" label="执行者" min-width="100" sortable>
</el-table-column>
<el-table-column prop="auditresuld" label="执行状态" min-width="80" :formatter="formatType" sortable>
</el-table-column>
<el-table-column label="操作" min-width="260">
<template slot-scope="scope">
<el-button size="small" @click="setPerm(scope.$index, scope.row)">开始执行</el-button>
<el-button size="small" @click="setPerm(scope.$index, scope.row)">完成任务</el-button>
<el-button size="small" @click="setPerm(scope.$index, scope.row)">任务转交</el-button>
<el-button size="small" @click="shwoDialog(scope.$index, scope.row)">工单内容</el-button>
<el-button size="small" @click="shwoDialog(scope.$index, scope.row)">任务内容</el-button>
<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--工具条-->
<el-col :span="24" class="toolbar">
<el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button>
<el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;">
</el-pagination>
</el-col>
<!--编辑界面-->
<el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false">
<el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm">
<el-form-item label="ID">
<span>{{editForm.roleId}}</span>
</el-form-item>
<el-form-item label="岗位名称">
<el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input>
</el-form-item>
<el-form-item label="岗位描述">
<el-input v-model="editForm.description" auto-complete="off" placeholder="请输入岗位/角色描述:例如:用户管理员"></el-input>
</el-form-item>
<el-form-item label="部门名称">
<el-select v-model="editForm.departmentId" placeholder="请选择">
<el-option
v-for="item in departmentNameList"
:key="item.departmentId"
:label="item.departmentName"
:value="item.departmentId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="editFormVisible = false">取消</el-button>
<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
</div>
</el-dialog>
<!--新增界面-->
<el-dialog title="新增" :visible.sync="addFormVisible" width="60%">
<el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm">
<el-form-item label="工单名称" prop="processname">
<el-input v-model="addForm.processname" auto-complete="off" placeholder="请输入工单标题:"></el-input>
</el-form-item>
<el-form-item label="开始日期" prop="begindate">
<el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.begindate" style="width: 100%;"></el-date-picker>
</el-form-item>
<el-form-item label="结束日期" prop="enddate">
<el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.enddate" style="width: 100%;"></el-date-picker>
</el-form-item>
<el-form-item label="工单类型" prop="vacationtype">
<el-select v-model="addForm.vacationtype" placeholder="请选择">
<el-option label="运维检查" value="0"></el-option>
<el-option label="设备故障" value="1"></el-option>
<el-option label="电话报修" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单内容" prop="reason">
<el-input type="textarea" v-model="addForm.reason"></el-input>
</el-form-item>
<el-form-item>
<el-cascader-panel
:options="options"
v-model="jodUserId"
@change="cascaderhandleChange"
></el-cascader-panel>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="addFormVisible = false">取消</el-button>
<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
</div>
</el-dialog>
</section>
</template>
<script>
import util from '../../common/js/util'
import NProgress from 'nprogress'
import { getList,add} from '@/api/job_api';
import moment from 'moment'
import parseTime from '@/utils'
import loginUserInfo from '@/api/base'
import ElFormItem from "../../../node_modules/element-ui/packages/form/src/form-item.vue";
export default {
components: {ElFormItem},
data() {
return {
filters: {
processName: '',
parseTime: parseTime
},
departmentNameList:[],
processList: [],
permissons: [],
permIds: [],
total: 0,
pageNum: 1,
pageSize: 5,
listLoading: false,
sels: [],//列表选中列
//编辑界面是否显示
editFormVisible: false,
editLoading: false,
editFormRules: {
roleName: [
{ required: true, message: '请输入岗位/角色名称', trigger: 'blur' }
]
},
//编辑界面数据
editForm: {
roleId: 1,
description: '',
roleName: '',
roleSign: 1,
departmentId:''
},
//用户ID
//执行任务人ID
jodUserId: 0,
//新增界面是否显示
addFormVisible: false,
//设置权限界面是否显示
PermFormVisible: false,
addLoading: false,
addFormRules: {
roleName: [
{ required: true, message: '请输入岗位/角色名称', trigger: 'blur' }
],
description: [
{ required: true, message: '请输入岗位/角色描述', trigger: 'blur' }
]
},
//新增界面数据
addForm: {
processname: '',
begindate: '',
enddate: '',
vacationtype:'',
reason: '',
userId: ''
},
permForm: {
roleId: 1,
description: '',
roleName: '',
roleSign: 1,
permissions: []
},
centerDialogVisible: false,
dialogData:{},
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
},
options:[{
value: '1',
label: '测试公司',
children: [{
value: '2',
label: '测试部门一',
children: [{
value: '1',
label: '测试岗位1',
children: [{
value: '1',
label: '测试人员1'
}]
}]
}, {
value: '3',
label: '测试部门二',
children: [{
value: '2',
label: '测试岗位2',
children: [{
value: '1',
label: '测试人员2'
}]
}, {
value: '3',
label: '测试岗位3',
children: [{
value: '1',
label: '测试人员3'
}]
}]
}]
}],
}
},
methods: {
//性别显示转换
formatType: function (row, column) {
let msg = '未知';
switch (row.auditresuld){
case 0:
msg='未执行';
break;
case 1:
msg='执行中';
break;
case 2:
msg='执行完毕';
break;
case 3:
msg='任务转交';
break;
}
return msg;
},
formatState: function (row, column) {
let msg = '未知';
switch (row.processstatus){
case 0:
msg='未分配';
break;
case 1:
msg='已分配';
break;
case 2:
msg='执行中';
break;
case 3:
msg='已完成';
break;
}
return msg;
},
handleCurrentChange(val) {
this.pageNum = val;
},
//获取工单列表
getProcessList() {
let para = {
pageNum: this.pageNum,
pageSize: this.pageSize,
roleName: this.filters.processName
};
this.listLoading = true;
//NProgress.start();
getList(para).then((res) => {
let resData = res.data.data;
this.total = resData.total;
this.processList = resData.list;
this.listLoading = false;
//NProgress.done();
}).catch((error) => {
this.listLoading = false;
if(null!= error.response && error.response!==undefined){
let status= error.response.status;
let msg = error.response.statusText;
alert(status+msg);
}else {
alert(error);
}
});
},
//删除
handleDel: function (index, row) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.listLoading = true;
//NProgress.start();
let para = { roleId: row.roleId };
remove(para).then((res) => {
this.listLoading = false;
//NProgress.done();
this.$message({
message: '删除成功',
type: 'success'
});
}).catch((error) => {
this.listLoading = false;
alert(error);
});
}).catch();
},
/**
* 显示编辑界面
* @param index
* @param row 为这行的数据对象
*/
handleEdit: function (index, row) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
this.getdepartmentNames();
},
//显示新增界面,每次点开初始化数据
handleAdd: function () {
this.addFormVisible = true;
this.addForm = {
processname: '',
begindate: '',
enddate: '',
vacationtype:'',
reason: '',
userid: loginUserInfo.userId
}
},
//编辑
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.editLoading = true;
//NProgress.start();
let para = Object.assign({}, this.editForm);
//不需要提交的 去掉,后端不好接收
para.authorities = null;
para.permissions = null;
para.roles = null;
// para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd');
/*
查询之后格式this.filters.column.create_start_date中日期发生变化;
Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) 变成了 "2017-08-08T16:00:00.000Z";
所以使用 moment 日期格式化插件将时间转换成 [ Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) ] 格
式;
*/
/*moment 安装 npm install moment --save*/
para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss');
this.editLoading = false;
edit(para).then((res) => {
//NProgress.done();
this.$message({
message: '提交成功',
type: 'success'
});
this.$refs['editForm'].resetFields();
this.editFormVisible = false;
}).catch(error => alert(error));
});
}
});
},
//新增
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.addLoading = true;
//NProgress.start();
let para = Object.assign({}, this.addForm);
add(para).then((res) => {
this.addLoading = false;
if (res.status ===200) {
this.$message({
message: '提交成功',
type: 'success'
});
this.$refs['permForm'].resetFields();
this.addFormVisible = false;
this.getProcessList();
}
}).catch(error => alert(error));
});
}
});
},
selsChange: function (sels) {
this.sels = sels;
},
//批量删除
batchRemove: function () {
var ids = this.sels.map(item => item.roleId).toString();
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.listLoading = true;
//NProgress.start();
let para = { ids: ids };
batchRemove(para).then((res) => {
this.listLoading = false;
//NProgress.done();
this.$message({
message: '删除成功',
type: 'success'
})
});
}).catch(() => {
});
},
shwoDialog(index,row) {
this.dialogData = Object.assign({}, row);
this.centerDialogVisible = true;
},
cascaderhandleChange:function (value) {
let defaultvalue = ["0","0","0","0"];
defaultvalue = value;
console.log(defaultvalue);
this.jodUserId = defaultvalue[3];
}
},
mounted() {
this.getProcessList();
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
... ...
<template>
<section>
<el-dialog
:data="dialogData"
title="提示"
:visible.sync="centerDialogVisible"
width="30%"
center>
<span>{{dialogData.reason}}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
<!--工具条-->
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
<el-form :inline="true" :model="filters">
<el-form-item>
<el-input v-model="filters.processName" placeholder="工单名称"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" v-on:click="getProcessList()">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleAdd()">新增</el-button>
</el-form-item>
</el-form>
</el-col>
<!--列表-->
<el-table :data="processList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column type="index" width="60">
</el-table-column>
<el-table-column prop="processname" label="工单名称" width="100">
</el-table-column>
<el-table-column prop="user.realname" label="添加者" min-width="100" sortable>
</el-table-column>
<el-table-column label="开始日期" width="200px" align="center" sortable>
<template slot-scope="scope">
<span>{{ scope.row.begindate}}</span>
</template>
</el-table-column>
<el-table-column label="结束日期" width="200px" align="center" sortable>
<template slot-scope="scope">
<span>{{ scope.row.enddate}}</span>
</template>
</el-table-column>
<el-table-column prop="vacationtype" label="工单类型" min-width="80" :formatter="formatType" sortable>
</el-table-column>
<el-table-column prop="processstatus" label="工单状态" min-width="80" :formatter="formatState" sortable>
</el-table-column>
<el-table-column label="操作" min-width="260">
<template slot-scope="scope">
<!--<el-button size="small" @click="setPerm(scope.$index, scope.row)">分配工单</el-button>-->
<el-button size="small" @click="shwoDialog(scope.$index, scope.row)">查看内容</el-button>
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--工具条-->
<el-col :span="24" class="toolbar">
<el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button>
<el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;">
</el-pagination>
</el-col>
<!--编辑界面-->
<el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false">
<el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm">
<el-form-item label="ID">
<span>{{editForm.roleId}}</span>
</el-form-item>
<el-form-item label="岗位名称">
<el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input>
</el-form-item>
<el-form-item label="岗位描述">
<el-input v-model="editForm.description" auto-complete="off" placeholder="请输入岗位/角色描述:例如:用户管理员"></el-input>
</el-form-item>
<el-form-item label="部门名称">
<el-select v-model="editForm.departmentId" placeholder="请选择">
<el-option
v-for="item in departmentNameList"
:key="item.departmentId"
:label="item.departmentName"
:value="item.departmentId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="editFormVisible = false">取消</el-button>
<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
</div>
</el-dialog>
<!--新增界面-->
<el-dialog title="新增" :visible.sync="addFormVisible" width="60%">
<el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm">
<el-form-item label="工单名称" prop="processname">
<el-input v-model="addForm.processname" auto-complete="off" placeholder="请输入工单标题:"></el-input>
</el-form-item>
<el-form-item label="开始日期" prop="begindate">
<el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.begindate" style="width: 100%;"></el-date-picker>
</el-form-item>
<el-form-item label="结束日期" prop="enddate">
<el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.enddate" style="width: 100%;"></el-date-picker>
</el-form-item>
<el-form-item label="工单类型" prop="vacationtype">
<el-select v-model="addForm.vacationtype" placeholder="请选择">
<el-option label="运维检查" value="0"></el-option>
<el-option label="设备故障" value="1"></el-option>
<el-option label="电话报修" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单内容" prop="reason">
<el-input type="textarea" v-model="addForm.reason"></el-input>
</el-form-item>
<el-form-item>
<el-cascader-panel
:options="options"
v-model="addForm.jobuserid"
@change="cascaderhandleChange"
></el-cascader-panel>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="addFormVisible = false">取消</el-button>
<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
</div>
</el-dialog>
</section>
</template>
<script>
import util from '../../common/js/util'
import NProgress from 'nprogress'
import { getList,add} from '@/api/process_api';
import moment from 'moment'
import parseTime from '@/utils'
import loginUserInfo from '@/api/base'
import ElFormItem from "../../../node_modules/element-ui/packages/form/src/form-item.vue";
export default {
components: {ElFormItem},
data() {
return {
filters: {
processName: '',
parseTime: parseTime
},
departmentNameList:[],
processList: [],
permissons: [],
permIds: [],
total: 0,
pageNum: 1,
pageSize: 5,
listLoading: false,
sels: [],//列表选中列
//编辑界面是否显示
editFormVisible: false,
editLoading: false,
editFormRules: {
roleName: [
{ required: true, message: '请输入岗位/角色名称', trigger: 'blur' }
]
},
//编辑界面数据
editForm: {
roleId: 1,
description: '',
roleName: '',
roleSign: 1,
departmentId:''
},
//新增界面是否显示
addFormVisible: false,
//设置权限界面是否显示
PermFormVisible: false,
addLoading: false,
addFormRules: {
roleName: [
{ required: true, message: '请输入岗位/角色名称', trigger: 'blur' }
],
description: [
{ required: true, message: '请输入岗位/角色描述', trigger: 'blur' }
]
},
//新增界面数据
addForm: {
processname: '',
begindate: '',
enddate: '',
vacationtype:'',
reason: '',
userId: '',
jobuserid: 0
},
jobForm: {
taskid: 1,
userid: 1,
auditresuld: ''
},
centerDialogVisible: false,
dialogData:{},
options:[{
value: '1',
label: '测试公司',
children: [{
value: '2',
label: '测试部门一',
children: [{
value: '1',
label: '测试岗位1',
children: [{
value: '1',
label: '测试人员1'
}]
}]
}, {
value: '3',
label: '测试部门二',
children: [{
value: '2',
label: '测试岗位2',
children: [{
value: '1',
label: '测试人员2'
}]
}, {
value: '3',
label: '测试岗位3',
children: [{
value: '1',
label: '测试人员3'
}]
}]
}]
}],
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
}
}
},
methods: {
//性别显示转换
formatType: function (row, column) {
return row.vacationtype == 1 ? '运维检查' : row.vacationtype == 0 ? '设备故障' : '电话报修';
},
formatState: function (row, column) {
let msg = '未知';
switch (row.processstatus){
case 0:
msg='未分配';
break;
case 1:
msg='已分配';
break;
case 2:
msg='执行中';
break;
case 3:
msg='已完成';
break;
}
return msg;
},
handleCurrentChange(val) {
this.pageNum = val;
},
//获取工单列表
getProcessList() {
let para = {
pageNum: this.pageNum,
pageSize: this.pageSize,
roleName: this.filters.processName
};
this.listLoading = true;
//NProgress.start();
getList(para).then((res) => {
let resData = res.data.data;
this.total = resData.total;
this.processList = resData.list;
this.listLoading = false;
//NProgress.done();
}).catch((error) => {
this.listLoading = false;
if(null!= error.response && error.response!==undefined){
let status= error.response.status;
let msg = error.response.statusText;
alert(status+msg);
}else {
alert(error);
}
});
},
//删除
handleDel: function (index, row) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.listLoading = true;
//NProgress.start();
let para = { roleId: row.roleId };
remove(para).then((res) => {
this.listLoading = false;
//NProgress.done();
this.$message({
message: '删除成功',
type: 'success'
});
}).catch((error) => {
this.listLoading = false;
alert(error);
});
}).catch();
},
/**
* 显示编辑界面
* @param index
* @param row 为这行的数据对象
*/
handleEdit: function (index, row) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
this.getdepartmentNames();
},
//显示新增界面,每次点开初始化数据
handleAdd: function () {
this.addFormVisible = true;
this.addForm = {
processname: '',
begindate: '',
enddate: '',
vacationtype:'',
reason: '',
userid: loginUserInfo.userId,
jobuserid: 0
}
},
//编辑
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.editLoading = true;
//NProgress.start();
let para = Object.assign({}, this.editForm);
//不需要提交的 去掉,后端不好接收
para.authorities = null;
para.permissions = null;
para.roles = null;
// para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd');
/*
查询之后格式this.filters.column.create_start_date中日期发生变化;
Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) 变成了 "2017-08-08T16:00:00.000Z";
所以使用 moment 日期格式化插件将时间转换成 [ Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) ] 格
式;
*/
/*moment 安装 npm install moment --save*/
para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss');
this.editLoading = false;
edit(para).then((res) => {
//NProgress.done();
this.$message({
message: '提交成功',
type: 'success'
});
this.$refs['editForm'].resetFields();
this.editFormVisible = false;
}).catch(error => alert(error));
});
}
});
},
//新增
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.addLoading = true;
//NProgress.start();
let para = Object.assign({}, this.addForm);
add(para).then((res) => {
this.addLoading = false;
if (res.status ===200) {
this.$message({
message: '提交成功',
type: 'success'
});
this.$refs['jobForm'].resetFields();
this.addFormVisible = false;
this.getProcessList();
}
}).catch(error => alert(error));
});
}
});
},
selsChange: function (sels) {
this.sels = sels;
},
//批量删除
batchRemove: function () {
var ids = this.sels.map(item => item.roleId).toString();
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.listLoading = true;
//NProgress.start();
let para = { ids: ids };
batchRemove(para).then((res) => {
this.listLoading = false;
//NProgress.done();
this.$message({
message: '删除成功',
type: 'success'
})
});
}).catch(() => {
});
},
shwoDialog(index,row) {
this.dialogData = Object.assign({}, row);
this.centerDialogVisible = true;
},
cascaderhandleChange:function (value) {
let defaultvalue = ["0","0","0","0"];
defaultvalue = value;
console.log(defaultvalue);
this.addForm.jobuserid = defaultvalue[3];
}
},
mounted() {
this.getProcessList();
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
... ...