|
@@ -29,7 +29,9 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="small" @click="handleEdit(scope.row)">任务管理</el-button>
|
|
|
+ <el-button size="small" @click="QuestsFun(scope.row)">任务管理</el-button>
|
|
|
+ <el-button size="small" @click="RedactFun(scope.row)">编辑公司</el-button>
|
|
|
+ <el-button size="small" @click="DeleteFun(scope.row)">删除公司</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -39,7 +41,7 @@
|
|
|
layout="total, prev, pager, next, jumper" :total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <el-drawer title="添加公司" :visible.sync="dialog" direction="rtl" ref="drawer">
|
|
|
+ <el-drawer :title="showDra" :visible.sync="dialog" direction="rtl" ref="drawer">
|
|
|
<div class="demo-drawers">
|
|
|
<el-form :model="form" :rules="rules" ref="ruleForm">
|
|
|
<el-form-item label="公司名称" :label-width="LabelWidth" prop="T_name">
|
|
@@ -51,9 +53,9 @@
|
|
|
:key="index"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="用户名" :label-width="LabelWidth" prop="T_user">
|
|
|
+ <!-- <el-form-item label="用户名" :label-width="LabelWidth" prop="T_user">
|
|
|
<el-input v-model="form.T_user" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="密码" :label-width="LabelWidth" prop="T_passstr">
|
|
|
<el-input v-model="form.T_passstr" autocomplete="off" show-password></el-input>
|
|
|
</el-form-item>
|
|
@@ -379,6 +381,7 @@
|
|
|
UserList,
|
|
|
UserUp,
|
|
|
UserAdd,
|
|
|
+ UserDel,
|
|
|
UserPowerAll,
|
|
|
TaskList,
|
|
|
TaskUp,
|
|
@@ -424,12 +427,13 @@
|
|
|
},
|
|
|
optionsData: [],
|
|
|
TimeValue: '',
|
|
|
+ showDra:'新增公司',
|
|
|
form: {
|
|
|
T_power: '', // 权限
|
|
|
T_name: '', // 某某公司名称
|
|
|
- T_user: '', // 登录用户名
|
|
|
+ // T_user: '', // 登录用户名
|
|
|
T_pass: '', // 密码 MD5
|
|
|
- T_passstr: '', // 密码明文
|
|
|
+ T_passstr: '12345678', // 密码明文
|
|
|
},
|
|
|
form2: {
|
|
|
T_task_id: '', // 权限
|
|
@@ -444,18 +448,18 @@
|
|
|
T_power: [{
|
|
|
required: true,
|
|
|
message: '请选择权限',
|
|
|
- trigger: 'change'
|
|
|
+ trigger: ['blur','change']
|
|
|
}],
|
|
|
T_name: [{
|
|
|
required: true,
|
|
|
message: '请输入公司名称',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
- T_user: [{
|
|
|
- required: true,
|
|
|
- message: '请输入登录用户名',
|
|
|
- trigger: 'blur'
|
|
|
- }],
|
|
|
+ // T_user: [{
|
|
|
+ // required: true,
|
|
|
+ // message: '请输入登录用户名',
|
|
|
+ // trigger: 'blur'
|
|
|
+ // }],
|
|
|
T_passstr: [{
|
|
|
required: true,
|
|
|
message: '请输入密码',
|
|
@@ -632,6 +636,7 @@
|
|
|
this.$refs.pdf.SetPdf(e)
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
submitForm1(formName) {
|
|
|
let arrClass = {...this.form1}
|
|
|
if(arrClass.length != 0){
|
|
@@ -679,7 +684,7 @@
|
|
|
}
|
|
|
this.innerDrawer = true
|
|
|
this.blNum = 1
|
|
|
- console.log('新增赋值',this.form1)
|
|
|
+
|
|
|
for (let obj in this.form1) {
|
|
|
if(obj=='T_task_id'){
|
|
|
console.log('T_task_id')
|
|
@@ -710,13 +715,46 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- handleEdit(e) {
|
|
|
+ QuestsFun(e) {
|
|
|
this.pages1.T_uuid = e.T_uuid
|
|
|
this.Drawer = true
|
|
|
this.pages1.page = 1
|
|
|
this.GetTaskListApi()
|
|
|
this.GetAdminList_AllApi()
|
|
|
},
|
|
|
+ RedactFun(e){
|
|
|
+ console.log(e)
|
|
|
+ this.showDra = '编辑公司'
|
|
|
+ this.form.T_uuid = e.T_uuid// 某某公司名称
|
|
|
+ this.form.T_name = e.T_name// 某某公司名称
|
|
|
+ this.form.T_power = e.T_power// 权限
|
|
|
+ // this.form.T_user = e.T_user// 登录用户名
|
|
|
+ this.form.T_pass = e.T_pass// 密码 MD5
|
|
|
+ this.form.T_passstr = e.T_passstr// 密码明文
|
|
|
+
|
|
|
+ this.dialog = true
|
|
|
+ this.GetPowerAllApi()
|
|
|
+ if (this.$refs.ruleForm != undefined) {
|
|
|
+ this.$refs.ruleForm.clearValidate()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ DeleteFun(e){
|
|
|
+ this.$confirm('此操作将删除公司,请谨慎使用, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '删除',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ UserDel({T_uuid:e.T_uuid}).then(res=>{
|
|
|
+ if(res.data.Code==200) this.$message.success('删除成功!'); this.GetUserListApi()
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
GetTaskListApi() {
|
|
|
TaskList(this.pages1).then(res => {
|
|
|
if (res.data.Code === 200) {
|
|
@@ -726,7 +764,10 @@
|
|
|
})
|
|
|
},
|
|
|
NewsMang() {
|
|
|
+ this.showDra = '新增公司'
|
|
|
this.dialog = true
|
|
|
+ Object.keys(this.form).forEach(item=>{this.form[item] = null})
|
|
|
+ this.form.T_passstr = '12345678'
|
|
|
this.GetPowerAllApi()
|
|
|
if (this.$refs.ruleForm != undefined) {
|
|
|
this.$refs.ruleForm.clearValidate()
|
|
@@ -743,7 +784,7 @@
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.form.T_pass = this.$md5(this.form.T_passstr)
|
|
|
- this.SetUserAddApi()
|
|
|
+ this.showDra == '新增公司'?this.SetUserAddApi():this.SetUserUpApi()
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
@@ -751,7 +792,6 @@
|
|
|
},
|
|
|
SetUserAddApi() {
|
|
|
UserAdd(this.form).then(res => {
|
|
|
- console.log()
|
|
|
if (res.data.Code === 200) {
|
|
|
this.$message.success('新增公司成功')
|
|
|
this.dialog = false
|
|
@@ -760,6 +800,16 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ SetUserUpApi() {
|
|
|
+ UserUp(this.form).then(res => {
|
|
|
+ if (res.data.Code === 200) {
|
|
|
+ this.$message.success('编辑公司成功')
|
|
|
+ this.dialog = false
|
|
|
+ this.pages.page = 1
|
|
|
+ this.GetUserListApi()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
Changswitch(val) {
|
|
|
UserUp(val).then(res => {
|
|
|
if (res.data.Code === 200) {
|