|
|
@@ -69,10 +69,12 @@
|
|
|
:data="pageResult"
|
|
|
:columns="columns"
|
|
|
button4Name="查看"
|
|
|
+ editButtonName="编辑"
|
|
|
:showBatchDelete="false"
|
|
|
@findPage="findPage"
|
|
|
button1Background="#F2904B"
|
|
|
- @handleButton4="handleTableEdit"
|
|
|
+ @handleButton4="handleDetail"
|
|
|
+ @handleEdit="handleTableEdit"
|
|
|
></kt-common-table>
|
|
|
</SplitArea>
|
|
|
<!-- 右侧列表页面End -->
|
|
|
@@ -80,7 +82,7 @@
|
|
|
</el-main>
|
|
|
|
|
|
<el-dialog
|
|
|
- title="详情"
|
|
|
+ :title="dialogTitle"
|
|
|
width="60%"
|
|
|
:visible.sync="dialogVisible"
|
|
|
:close-on-click-modal="false"
|
|
|
@@ -90,9 +92,10 @@
|
|
|
>
|
|
|
<el-form
|
|
|
:model="formData"
|
|
|
+ :rules="formDataRules"
|
|
|
ref="formData"
|
|
|
:inline="true"
|
|
|
- disabled
|
|
|
+ :disabled="isDisabled"
|
|
|
label-width="130px"
|
|
|
size="small"
|
|
|
>
|
|
|
@@ -176,20 +179,31 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" type="primary" @click="closeDialog">关闭</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ style="background-color: #ffc000; border: 1px solid #ffc000"
|
|
|
+ @click="closeDialog"
|
|
|
+ >取消</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="submitForm"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
|
|
|
import tree from "@/components/ztree.vue"; // 机构树组件
|
|
|
import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
|
|
|
+import Cookies from "js-cookie";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- KtButton,
|
|
|
tree,
|
|
|
KtCommonTable
|
|
|
},
|
|
|
@@ -203,7 +217,10 @@ export default {
|
|
|
realName: "",
|
|
|
mobile: ""
|
|
|
},
|
|
|
+ dialogTitle:'',
|
|
|
+ isDisabled:false,
|
|
|
formData: {},
|
|
|
+
|
|
|
roles: [],
|
|
|
peopledeptid: "",
|
|
|
/**Split 开始 */
|
|
|
@@ -255,19 +272,35 @@ export default {
|
|
|
sortable: false
|
|
|
}
|
|
|
],
|
|
|
- sexoptions: [],
|
|
|
- user_statusoptions: [],
|
|
|
+ sexoptions: JSON.parse(localStorage.getItem('sexOptions')) ,
|
|
|
+ user_statusoptions: JSON.parse(localStorage.getItem('user_statusoptions')) ,
|
|
|
+ roles: JSON.parse(localStorage.getItem('find_all')) ,
|
|
|
option: [],
|
|
|
- roles: []
|
|
|
- // 新增编辑界面数据
|
|
|
+ formDataRules:{
|
|
|
+ deptId:[{ required: true, message: "请选择机构", trigger: "change" }],
|
|
|
+ mobile: [
|
|
|
+ { required: true, message: "请输入手机号", trigger: "blur" },
|
|
|
+ { min: 11, max: 11, message: "请输入11位手机号码", trigger: "blur" },
|
|
|
+ {
|
|
|
+ pattern:
|
|
|
+ /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
|
|
|
+ message: "请输入正确的手机号",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ name: [{ required: true, message: "请填写名称", trigger: "blur" }],
|
|
|
+ // password: [{ required: true, message: "请填写密码", trigger: "blur" }],
|
|
|
+ status: [{ required: true, message: "请选择状态", trigger: "change" }],
|
|
|
+ roleId: [{ required: true, message: "请填写角色", trigger: "blur" }],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.$api.role.findAll().then(res => {
|
|
|
- this.roles = res.data;
|
|
|
- });
|
|
|
- this.getDictItems("user_status");
|
|
|
- this.getDictItems("sex");
|
|
|
+ // this.$api.role.findAll().then(res => {
|
|
|
+ // this.roles = res.data;
|
|
|
+ // });
|
|
|
+ // this.getDictItems("user_status");
|
|
|
+ // this.getDictItems("sex");
|
|
|
this.findLeftTreeData(); // 获取机构树的数据
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -292,6 +325,7 @@ export default {
|
|
|
// 点击事件
|
|
|
this.currentTreeNode = evt;
|
|
|
this.pageData.deptId = this.currentTreeNode.id;
|
|
|
+ this.pageData.pageNum =1;
|
|
|
this.findPage();
|
|
|
this.formData.deptId = [];
|
|
|
this.platform(treeId);
|
|
|
@@ -314,7 +348,6 @@ export default {
|
|
|
|
|
|
// 右侧列表的方法Start
|
|
|
async findPage(data) {
|
|
|
-
|
|
|
// 获取分页数据
|
|
|
if (data && data.pageRequest) {
|
|
|
this.pageData.pageNum = data.pageRequest.pageNum;
|
|
|
@@ -323,7 +356,7 @@ export default {
|
|
|
let dto = {
|
|
|
deptId: this.pageData.deptId,
|
|
|
mobile: this.pageData.mobile,
|
|
|
- name: this.pageData.realName,
|
|
|
+ name: this.pageData.name,
|
|
|
userId: this.pageData.userId,
|
|
|
status: this.pageData.status,
|
|
|
roleId: ""
|
|
|
@@ -372,7 +405,7 @@ export default {
|
|
|
closeDialog() {
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
- handleTableEdit(params) {
|
|
|
+ detail(params){
|
|
|
this.$api.dept.findDeptTree().then(res => {
|
|
|
this.option = res.data;
|
|
|
});
|
|
|
@@ -383,9 +416,51 @@ export default {
|
|
|
this.formData.password = "";
|
|
|
}
|
|
|
});
|
|
|
- this.dialogTitle = "编辑后线人员";
|
|
|
+ },
|
|
|
+ handleTableEdit(params){
|
|
|
+ this.detail(params)
|
|
|
+ this.dialogTitle = "编辑";
|
|
|
+ this.isDisabled=false
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ handleDetail(params) {
|
|
|
+ this.detail(params)
|
|
|
+ this.dialogTitle = "详情";
|
|
|
+ this.isDisabled=true
|
|
|
this.dialogVisible = true;
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 提交
|
|
|
+ submitForm() {
|
|
|
+ this.$refs.formData.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$confirm("确认提交审核吗?", "提示", {})
|
|
|
+ .then(() => {
|
|
|
+ this.$api.user.saveOrUpdate(this.formData).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$refs["formData"].resetFields();
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: `操作失败,请重新添加,(${res.msg})`,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消提交",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|