Parcourir la source

merge

new-file-system
unknown il y a 4 ans
Parent
révision
b4066e278d
11 fichiers modifiés avec 332 ajouts et 467 suppressions
  1. +2
    -1
      public/static/css/main.css
  2. +2
    -2
      src/services/system.js
  3. +3
    -3
      src/utils/request.js
  4. +3
    -7
      src/views/components_web/newProj/newProj.vue
  5. +1
    -1
      src/views/components_web/projSetting/projSetting.vue
  6. +2
    -6
      src/views/main_web/workspace/components/file-item.vue
  7. +6
    -9
      src/views/main_web/workspace/workspace.new.vue
  8. +165
    -319
      src/views/manage_company/user/index.vue
  9. +141
    -113
      src/views/manage_system/customer/index.vue
  10. +1
    -1
      src/views/manage_system/customer/services.js
  11. +6
    -5
      src/views/manage_system/template/index.vue

+ 2
- 1
public/static/css/main.css Voir le fichier

@@ -6704,6 +6704,7 @@ h4.biaoqianweizhi2{
font-size: 18px;
color: #000;
text-align-last: center;
text-align: center;
}
.el-message-box .el-message-box__btns .el-button{
width: 210px;
@@ -8721,7 +8722,7 @@ h5.dulilabel{
display: inline-block;
width: 28px;
height: 28px;
background-color: #ccc;
background-color: #ccc;
background: url(/static/img/icon_pic_01.png) no-repeat -180px 0px;
}
.selfupdate .webuploader-pick{


+ 2
- 2
src/services/system.js Voir le fichier

@@ -85,7 +85,7 @@ const system = {
});
socket.on('message', (e) => {
if(e.data === '-1') {
notify.error('文件下载失败');
notify.error('文件下载失败,请检查网络。');
onErrorHandler(e);
return;
}
@@ -336,7 +336,7 @@ const system = {
socket.on('message', async (e) => {
console.log('receive download file message:', e);
if(e.data === '-1') {
notify.error('文件上传失败');
notify.error('文件上传失败,请检查网络。');
onErrorHandler(e, uploadFile);
return;
}


+ 3
- 3
src/utils/request.js Voir le fichier

@@ -60,19 +60,19 @@ export async function fetchApi(path, params, config) {
case 404:
return {
Code: 404,
Msg: '找不到指定的服务',
Msg: '找不到指定的服务',
};
default:
return {
Code: 503,
Msg: '服务异常,请稍后再试',
Msg: '服务异常,请稍后再试',
};
}
}
console.error(e);
return {
Code: 503,
Msg: '服务异常,请稍后再试',
Msg: '服务异常,请稍后再试',
};
}
}


+ 3
- 7
src/views/components_web/newProj/newProj.vue Voir le fichier

@@ -1459,7 +1459,6 @@
},3000)
} else {
thisApp.$notify.error({
title: '温馨提示',
message: res.Msg,
offset: 100,
duration: 5000,
@@ -1537,8 +1536,7 @@
goprojInfo: function() {
if (this.newProjData.projectData.projName == undefined || this.newProjData.projectData.projName == null ||
this.newProjData.projectData.projName == "") {
this.$notify({
this.$notify({
message: "请输入项目名称。",
type: "warning",
offset: 100,
@@ -1548,8 +1546,7 @@
}
let rg = /[/\\]{1,}/g;
if (rg.test(this.newProjData.projectData.projName)) {
this.$notify({
this.$notify({
message: "项目名称请不要包含'/' '\\'等字符。",
type: "warning",
offset: 100,
@@ -1559,8 +1556,7 @@
}
if (this.newProjData.projectData.templateID == undefined || this.newProjData.projectData.templateID == null ||
this.newProjData.projectData.templateID == "") {
this.$notify({
this.$notify({
message: "请选择工作链。",
type: "warning",
offset: 100,


+ 1
- 1
src/views/components_web/projSetting/projSetting.vue Voir le fichier

@@ -737,7 +737,7 @@ import { wrapOssProtocol} from "@/services/oss";
// },2000)
} else {
this.$notify({
message: '项目信息修改出现错误.',
message: '项目信息修改出现错误',
type: "error",
offset: 30,
duration: 5000


+ 2
- 6
src/views/main_web/workspace/components/file-item.vue Voir le fichier

@@ -132,8 +132,8 @@
<ul class="rightMenu fileRightMenu">
<li v-if="fileInLocal" @click.stop="openfileBtnClick">打开</li>
<li v-else class="function-disabled" title="请先下载文件再打开">打开</li>
<li v-if="!isCoorFile" @click.stop="copyFileBtnClick">创建文件副本</li>
<li v-if="!isCoorFile" @click.stop="deleteFileClick">移动到回收站</li>
<li v-if="isInWorkFolder" @click.stop="copyFileBtnClick">创建文件副本</li>
<li v-if="isInWorkFolder" @click.stop="deleteFileClick">移动到回收站</li>
</ul>
</div>

@@ -206,10 +206,6 @@ export default {
type: Object,
default: () => ({}),
},
isCoorFile: {//是否是协作文件
type: Boolean,
default: false
},
// rightShowMenu: {
// type: Function,
// default: () => () => {}


+ 6
- 9
src/views/main_web/workspace/workspace.new.vue Voir le fichier

@@ -207,7 +207,6 @@
:nodeFolder="currentNodeFolder"
:currentFolder="currentFolder"
@dblclick.native="fileClick(file)"
isCoorFile=true
:localFileHashMap="localFileHashMap"
:loadingState="localFileLoadStateMap[file.id]"
@dragstart.native="onfileDragStart(file, $event)"
@@ -846,7 +845,7 @@ export default {
*/
clientDownLoad: function (file) {
if(!this.isClient) return;
console.log('下载的文件对象', file);
// console.log('下载的文件对象', file);
const { ipfsCid, archName: fileName, extension, folderId, nodeName } = file;
const folderMap = this.folderMap;
// const { levelId } = folderMap[folderId] || {};
@@ -907,7 +906,7 @@ export default {
async (fileNewState) => {
const resFlag = await services.changeFileWorkStatus(file.id, 1);
if(resFlag.Code !== 0) return;
notify.success('文件已更新');
notify.success(`${file.archName},已更新。`);
const {IpfsCid} = fileNewState;
// 注入到文件下载检测表中
// 同时更新文件队列中file对象的ipfsCid属性这样才能在下次刷新前使文件的记录保持一致
@@ -939,7 +938,7 @@ export default {
if(!this.localFileHashMap[fileStoreKey]) return;
const filePath = `${localWorkspacePrefix}\\${fileStoreKey}`;
if(!isCooperationFile && (file.workStatus === 2 && sessionStorage.userId !== file.modifyUserId)) {
notify.warning('文件正在工作编辑中,请耐心等待');
this.$notify.warning(`${file.modifyName}正在编辑此文件,请在“工作中”标识消失后再尝试打开。`);
return;
}
system.openFile(filePath);
@@ -1063,7 +1062,6 @@ export default {
debugger;
if (file.status == 1 && file.modifyUserID != sessionStorage.userId) {
this.$notify({
message: "其他人编辑中,不能设置历史文件",
type: "warning",
offset: 100,
@@ -1224,15 +1222,14 @@ export default {
var thisApp = this;
if (createUserId != sessionStorage.userId) {
thisApp.$notify({
title: "操作提示",
message: "不能删除他人文件",
message: "不能删除他人文件。",
type: "info",
offset: 100,
duration: 2500,
});
return;
}
this.$confirm("您正在删除文件【" + archName + "】,是否继续?", "", {
this.$confirm(`确认删除“${archName}”吗?`, "", {
confirmButtonText: "确定",
cancelButtonText: "取消",
// showClose: false,
@@ -1242,7 +1239,7 @@ export default {
if(res.Code === 0) {
thisApp.$notify({
title: " ",
message: res.Data,
message: `“${archName}”文件已移除。`,
type: "success",
offset: 100,
duration: 2500,


+ 165
- 319
src/views/manage_company/user/index.vue Voir le fichier

@@ -176,6 +176,7 @@
</div>
<div class="ecBtngroup_Item">
<button
:class="{notclick:!this.multipleSelection[0]}"
type="button"
class="EC_button shadow bt_small_20"
@click="addDept"
@@ -185,6 +186,7 @@
</div>
<div class="ecBtngroup_Item">
<button
:class="{notclick:!this.multipleSelection[0]}"
type="button"
class="EC_button shadow bt_small_20"
@click="deleteUsers"
@@ -366,6 +368,7 @@
<!-- form -->
<el-form
ref="form"
:rules="newUserRules"
:model="currentUser"
label-width="96px"
label-position="left"
@@ -387,7 +390,7 @@
>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="姓名*">
<el-form-item label="姓名" prop="cnName">
<div v-if="eidit == false">
{{ currentUser.cnName }}
</div>
@@ -401,7 +404,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="*用户头像">
<el-form-item label="用户头像">
<div class="large_headImg">
<img
class="imgHead"
@@ -409,18 +412,6 @@
/>
</div>
<div class="uploadImg" v-show="eidit == true">
<!-- <file-Uploader
:mutiple="false"
label="上传头像"
:auto="true"
accept="image"
ref="webUploadlist"
btn-id="filePicker"
:companyId="uploadCompId"
:typeId="uploadTypeHead"
@upload-success="headPicUploadSuccess"
:url="chunkUploadUrl"
></file-Uploader> -->
<file-uploader
:on-success="headPicUploadSuccess"
class="avator-btn"
@@ -433,7 +424,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="*用户名">
<el-form-item label="用户名" prop="userName">
<div v-if="eidit == false">
{{ currentUser.userName }}
</div>
@@ -466,7 +457,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="*平台权限">
<el-form-item label="平台权限" prop="permission">
<div v-if="eidit == false" class="eidit_Input">
{{ currentUser.roleName }}
</div>
@@ -497,7 +488,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="*后台角色">
<el-form-item label="后台角色" prop="backgroundPermission">
<div v-if="eidit == false" class="eidit_Input">
{{ currentUser.backgroundRoleName }}
</div>
@@ -528,7 +519,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="手机*:">
<el-form-item label="手机:" prop="phone">
<div v-if="eidit == false">
{{ currentUser.phone }}
</div>
@@ -765,7 +756,7 @@
>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="部门*:">
<el-form-item label="部门:" prop="arraySuper">
<div v-if="eidit == false">
{{ currentUser.deptName }}
</div>
@@ -920,6 +911,7 @@
<el-form
ref="form"
:model="newUser"
:rules="newUserRules"
label-width="90px"
label-position="left"
>
@@ -935,7 +927,7 @@
>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="姓名*">
<el-form-item label="姓名:" prop="cnName">
<div class="eidit_Input">
<el-input
v-model="newUser.cnName"
@@ -957,18 +949,6 @@
</div>
</div>
<div class="uploadImg">
<!-- <file-Uploader
:mutiple="false"
label="上传头像"
:auto="true"
accept="image"
ref="webUploadlist"
btn-id="filePicker"
:companyId="uploadCompId"
:typeId="uploadTypeHead"
@upload-success="headPicUploadSuccess"
:url="chunkUploadUrl"
></file-Uploader> -->
<file-uploader
:on-success="headPicUploadSuccess"
class="avator-btn"
@@ -980,7 +960,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="用户名*">
<el-form-item label="用户名*:" prop="userName">
<div class="eidit_Input">
<el-input
v-model="newUser.userName"
@@ -992,7 +972,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="性别">
<el-form-item label="性别:">
<div class="eidit_Input">
<el-radio-group v-model="newUser.sex">
<el-radio :label="1">男</el-radio>
@@ -1004,7 +984,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="平台权限*">
<el-form-item label="平台权限:" prop="permission">
<div class="eidit_Input">
<el-select
v-model="newUser.permission"
@@ -1023,7 +1003,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="*后台角色">
<el-form-item label="后台角色:" prop="backgroundPermission">
<div class="eidit_Input">
<el-select
v-model="newUser.backgroundPermission"
@@ -1042,7 +1022,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="手机*:">
<el-form-item label="手机:" prop="phone">
<div class="eidit_Input">
<el-input
v-model="newUser.phone"
@@ -1224,7 +1204,7 @@
<div class="UserEditinfoBox DivInputHeight noborder">
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="部门*:">
<el-form-item label="部门:" prop="arraySuper">
<div class="eidit_Input">
<el-cascader
:options="deptOptions"
@@ -1341,6 +1321,7 @@
<!-- form -->
<el-form
ref="form"
:rules="deptRules"
:model="deptData"
label-width="90px"
label-position="left"
@@ -1357,7 +1338,7 @@
>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="部门名称">
<el-form-item label="部门名称" prop="deptName">
<div class="eidit_Input">
<el-input
v-model="deptData.deptName"
@@ -1418,6 +1399,7 @@
<!-- form -->
<el-form
ref="form"
:rules="deptRules"
:model="deptData"
label-width="90px"
label-position="left"
@@ -1432,7 +1414,7 @@
<div class="UserEditinfoBox DivInputHeight noborder">
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="部门名称">
<el-form-item label="部门名称" prop="deptName">
<div class="eidit_Input">
<el-input
v-model="deptData.deptName"
@@ -1568,6 +1550,32 @@ export default {
}, // 新增用户对象
newUserDeptArry: [],
multipleSelection: [],
deptRules:{
"deptName":[
{required: true, message: "请输入部门名称", trigger: "blur"}
],
},
newUserRules:{
"cnName":[
{required: true, message: "请输入姓名", trigger: "blur"}
],
"userName":[
{required: true, message: "请输入用户名", trigger: "blur"}
],
"permission":[
{required: true, message: "请选择平台权限", trigger: "blur"}
],
"backgroundPermission":[
{required: true, message: "请选择后台角色", trigger: "blur"}
],
"phone":[
{required: true, message: "请输入手机号", trigger: "blur"}
],
"arraySuper":[
{required: true, message: "请选择部门", trigger: "blur"}
],

},
pickerOptionsIn: {
disabledDate(time) {
return time.getTime() > Date.now();
@@ -1822,95 +1830,94 @@ export default {
/**
* 创建部门信息
*/
async createDept() {
if (!this.checkDeptData()) {
return;
}
this.addDeptDisable = true;
var thisApp = this;
var array = new Array();
array = this.deptData.arraySuper;
var levelId = "";
var superId = "";
if (array.length > 0) {
for (var i = 0; i < array.length; i++) {
levelId = levelId + array[i];
if (i < array.length - 1) {
levelId = levelId + "-";
} else {
superId = array[i];
createDept() {
this.$refs['form'].validate(async (valid)=>{
if(!valid) return;
this.addDeptDisable = true;
var thisApp = this;
var array = new Array();
array = this.deptData.arraySuper;
var levelId = "";
var superId = "";
if (array.length > 0) {
for (var i = 0; i < array.length; i++) {
levelId = levelId + array[i];
if (i < array.length - 1) {
levelId = levelId + "-";
} else {
superId = array[i];
}
}
}
}
var parm = {
deptName: this.deptData.deptName,
companyId: sessionStorage.companyId,
remark: "",
// createUserId: sessionStorage.userId || '',
// modifyUserId: sessionStorage.userId || '',
levelId: levelId,
superId: superId,
};
const res = await services.createDepartment(parm);
const ifSucc = res.Code === 0;
if (!ifSucc) {
this.addDeptDisable = false;
this.$notify.error({
title: "溫馨提示",
message: res.Msg,
var parm = {
deptName: this.deptData.deptName,
companyId: sessionStorage.companyId,
remark: "",
// createUserId: sessionStorage.userId || '',
// modifyUserId: sessionStorage.userId || '',
levelId: levelId,
superId: superId,
};
const res = await services.createDepartment(parm);
const ifSucc = res.Code === 0;
if (!ifSucc) {
this.addDeptDisable = false;
this.$notify.error({
message: res.Msg,
offset: 100,
duration: 5000,
});
return;
}
thisApp.addDeptDisable = false;
this.$notify({
message:`部门“${this.deptData.deptName}”已完成添加。`,
type: "success",
offset: 100,
duration: 5000,
duration: 2500,
});
return;
}
thisApp.addDeptDisable = false;
this.$notify({
title: " ",
message: "添加成功",
type: "success",
offset: 100,
duration: 2500,
});
thisApp.listDepts();
this.currentPain = 1;
this.el_formLabelcolor = "textlabelgray";
thisApp.listDepts();
this.currentPain = 1;
this.el_formLabelcolor = "textlabelgray";

})

},
/**
* 更新部门信息
*/
async updateDept() {
if (!this.checkDeptData()) {
return;
}
var thisApp = this;
this.deptData.modifyUserId = sessionStorage.userId;
const deptData = this.deptData;
const param = {
Id: deptData.id,
SuperId: deptData.superId,
CompanyId: deptData.companyId,
LevelId: deptData.arraySuper.join("-"),
DeptName: deptData.deptName,
};
const res = await this.$fetchApi("dept/updateDept", param);
const ifSucc = res.Code === 0;
if (!ifSucc) {
thisApp.$notify.error({
message: res.Msg,
updateDept() {
this.$refs['form'].validate(async (valid)=>{
if(!valid) return;
var thisApp = this;
this.deptData.modifyUserId = sessionStorage.userId;
const deptData = this.deptData;
const param = {
Id: deptData.id,
SuperId: deptData.superId,
CompanyId: deptData.companyId,
LevelId: deptData.arraySuper.join("-"),
DeptName: deptData.deptName,
};
const res = await this.$fetchApi("dept/updateDept", param);
const ifSucc = res.Code === 0;
if (!ifSucc) {
thisApp.$notify.error({
message: res.Msg,
offset: 100,
duration: 5000,
});
}
thisApp.$notify({
message: "修改成功。",
type: "success",
offset: 100,
duration: 5000,
duration: 2500,
});
}
thisApp.$notify({
title: " ",
message: "修改成功",
type: "success",
offset: 100,
duration: 2500,
});
thisApp.listDepts();
this.currentPain = 1;
thisApp.listDepts();
this.currentPain = 1;

})
// // todo
// this.$axios({
// method: "put",
@@ -1946,9 +1953,8 @@ export default {
*/
checkDeptData: function () {
if (this.deptData.deptName == null || this.deptData.deptName == "") {
this.$notify({
message: "请输入部门名称",
this.$notify({
message: "请输入部门名称。",
type: "warning",
offset: 100,
duration: 2500,
@@ -1961,7 +1967,7 @@ export default {
) {
this.$notify({
message: "请选择上级部门",
message: "请选择上级部门",
type: "warning",
offset: 100,
duration: 2500,
@@ -1976,7 +1982,7 @@ export default {
deleteDept: function (data) {
var deptName = data.label;
var thisApp = this;
this.$confirm("删除部门:" + deptName + ", 是否继续?", "", {
this.$confirm(`部门删除后将无法恢复,是否继续删除部门“${deptName}”?`, "", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@@ -1999,7 +2005,7 @@ export default {
}
thisApp.$notify({
title: " ",
message: "删除成功!",
message:`部门“${deptName}”已删除。`,
type: "success",
offset: 100,
duration: 2500,
@@ -2019,13 +2025,6 @@ export default {
*/
addDept: function () {
if (this.multipleSelection[0] == null) {
this.$notify({
message: "请先选择用户",
type: "warning",
offset: 100,
duration: 2500,
});
return;
}
this.isDistWorkDeptDialog = true;
@@ -2086,7 +2085,7 @@ export default {
}
this.$notify({
title: " ",
message: "修改成功",
message: "已完成指派。",
type: "success",
offset: 100,
duration: 2500,
@@ -2101,19 +2100,11 @@ export default {
deleteUsers: function () {
var thisApp = this;
if (thisApp.multipleSelection[0] == null) {
this.$notify({
message: "请先选择用户",
type: "warning",
offset: 100,
duration: 2500,
});
return;
}
if (thisApp.multipleSelection.some((user) => user.default === 1)) {
this.$notify({
message: "法人账号不能删除",
this.$notify({
message: "法人账号不能删除。",
type: "warning",
offset: 100,
duration: 2500,
@@ -2122,7 +2113,7 @@ export default {
}
var node = thisApp.$refs.tree.getCurrentNode();
thisApp
.$confirm("用户被删除后将无法恢复,是否继续删除用户操作?", "", {
.$confirm("用户被删除后将无法恢复,是否继续?", "", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
@@ -2151,21 +2142,13 @@ export default {
}
thisApp.$notify({
title: " ",
message: "删除成功",
message: "所选用户删除完成。",
type: "success",
offset: 100,
duration: 2500,
});
this.getUserList();
// thisApp.nodeClick(node || undefined);
})
.catch(() => {
this.$notify.info({
message: "已取消删除",
offset: 100,
duration: 2500,
});
});
},

@@ -2173,29 +2156,13 @@ export default {
* 创建用户
* @param {boolean} ifcontinue 是否继续创建
*/
async createUser(ifcontinue = false) {
createUser(ifcontinue = false) {
var thisApp = this;
// 验证用户信息
if (!this.checkUser(this.newUser)) {
return;
}
if (
this.newUser.arraySuper != null &&
this.newUser.arraySuper.length > 0
) {
this.$refs['form'].validate(async (valid)=>{
if (!valid) return;
this.newUser.deptid = this.newUser.arraySuper[
this.newUser.arraySuper.length - 1
];
} else {
thisApp.$notify({
message: "请选择职员所在部门",
type: "warning",
offset: 100,
duration: 5000,
});
return;
}
this.newUser.createUserId = sessionStorage.userId;
this.newUser.companyId = sessionStorage.companyId;
const res = await services.addUser(this.newUser);
@@ -2212,7 +2179,7 @@ export default {
// thisApp.newUser = {};
thisApp.$notify({
title: " ",
message: "添加成功",
message: `${this.newUser.cnName}添加成功`,
type: "success",
offset: 100,
duration: 2500,
@@ -2224,83 +2191,7 @@ export default {
if (!ifcontinue) {
this.currentPain = 1;
}
// this.$axios({
// method: "post",
// url: encodeURI(process.env.API_HOST + "sysinfo/userinfo"),
// data: this.newUser,
// })
// .then((response) => {
// if (response.data.state == 1) {
// thisApp.newUser = {};
// thisApp.$notify({
// title: " ",
// message: response.data.message,
// type: "success",
// offset: 100,
// duration: 2500,
// });
// var node = this.$refs.tree.getCurrentNode();
// this.newUser = { headImgUrl: "", isDeparture: 0 };
// // this.listUsers(node.id);
// this.getUserList(node);
// } else {
// thisApp.$notify.error({
//
// message: response.data.message,
// offset: 100,
// duration: 5000,
// });
// }
// })
// .catch((error) => {
// console.log(error);
// });
},
/**
* 验证用户信息
*/
checkUser: function (user) {
if (user.cnName == undefined || user.cnName == "") {
this.$notify({
message: "请输入姓名",
offset: 100,
type: "warning",
duration: 5000,
});
return false;
}
if (user.permission == undefined) {
this.$notify({
message: "请选择用户平台权限",
type: "warning",
offset: 100,
duration: 5000,
});
return false;
}
if (user.backgroundPermission == undefined) {
this.$notify({
message: "请选择用户后台角色",
type: "warning",
offset: 100,
duration: 5000,
});
return false;
}
if (user.phone == undefined || user.phone == "") {
this.$notify({
message: "请输入手机号",
type: "warning",
offset: 100,
duration: 5000,
});
return false;
}
return true;
});
},
/**
* 保存用户信息
@@ -2340,7 +2231,7 @@ export default {
.then((response) => {
if (response.data != null) {
this.$notify({
title: " ",
message: response.data.message,
type: "success",
offset: 100,
@@ -2499,26 +2390,11 @@ export default {
*/
async modifyUser() {
var thisApp = this;
if (!this.checkUser(this.currentUser)) {
return;
}
if (
this.currentUser.arraySuper != null &&
this.currentUser.arraySuper.length > 0
) {
this.$refs['form'].validate(async (valid)=>{
if(!valid) return;
this.currentUser.deptid = this.currentUser.arraySuper[
this.currentUser.arraySuper.length - 1
];
} else {
this.$notify({
message: "请选择职员所在部门",
type: "warning",
offset: 100,
duration: 5000,
});
return;
}
];
this.currentUser.modifyUserId = sessionStorage.userId;
const res = await services.updateUser(this.currentUser);
const ifSucc = res.Code === 0;
@@ -2532,8 +2408,7 @@ export default {
return;
}
thisApp.$notify({
title: "修改成功",
message: "",
message: "修改成功。",
type: "success",
offset: 100,
duration: 2500,
@@ -2541,38 +2416,8 @@ export default {
this.currentPain = 1;
this.editButtonGroup = 1;
// this.listUsers(this.$refs.tree.getCurrentNode().id);
this.getUserList(this.$refs.tree.getCurrentNode());

// this.$axios({
// method: "put",
// url: encodeURI(process.env.API_HOST + "sysinfo/userinfo"),
// data: this.currentUser,
// })
// .then((response) => {
// if (response.data.state == 1) {
// thisApp.$notify({
// title: " ",
// message: response.data.message,
// type: "success",
// offset: 100,
// duration: 2500,
// });
// this.currentPain = 1;
// this.editButtonGroup = 1;
// // this.listUsers(this.$refs.tree.getCurrentNode().id);
// this.getUserList(this.$refs.tree.getCurrentNode());
// } else {
// thisApp.$notify.error({
//
// message: response.data.message,
// offset: 100,
// duration: 5000,
// });
// }
// })
// .catch((error) => {
// console.log(error);
// });
this.getUserList(this.$refs.tree.getCurrentNode());
});
},
/**
* 禁用用户
@@ -2585,8 +2430,7 @@ export default {
} else {
actionText = "禁用";
}
this.$confirm(
actionText + "用户:" + this.currentUser.cnName + ",是否继续?",
this.$confirm(`${actionText}的用户将${actionText == "禁用" ? "无法" : "有权"}访问我司LOCKING,确定${actionText}“${this.currentUser.cnName}”的账户吗?`,
"",
{
confirmButtonText: "确定",
@@ -2606,7 +2450,7 @@ export default {
if (response.data.state == 1) {
thisApp.$notify({
title: " ",
message: actionText + "成功",
message: `${this.currentUser.cnName}已${actionText}`,
type: "success",
offset: 100,
duration: 2500,
@@ -2625,12 +2469,12 @@ export default {
});
})
.catch(() => {
thisApp.$notify.info({
// thisApp.$notify.info({
message: "已取消" + actionText,
offset: 100,
duration: 2500,
});
// message: "已取消" + actionText,
// offset: 100,
// duration: 2500,
// });
});
},
/**
@@ -2639,9 +2483,7 @@ export default {
deleteUserInfo: function () {
var thisApp = this;
this.$confirm(
"用户被删除后将无法恢复,是否继续删除用户:" +
this.currentUser.cnName +
" ?",
`账户删除后将无法恢复,是否继续删除“${this.currentUser.cnName}”的账户?`,
"",
{
confirmButtonText: "确定",
@@ -2703,12 +2545,12 @@ export default {
// });
})
.catch(() => {
this.$notify.info({
// this.$notify.info({
message: "已取消删除",
offset: 100,
duration: 2500,
});
// message: "已取消删除",
// offset: 100,
// duration: 2500,
// });
});
},
/**
@@ -2801,6 +2643,10 @@ export default {
</script>

<style lang="scss" scoped>
.notclick{
cursor:not-allowed;
opacity: 0.8;
}

.avator-btn {
line-height: 50px;


+ 141
- 113
src/views/manage_system/customer/index.vue Voir le fichier

@@ -209,6 +209,7 @@
<el-form
ref="form"
:model="currentCompany"
:rules="companyRules"
label-width="100px"
label-position="right"
>
@@ -222,7 +223,7 @@
<div :class="el_formLabelcolor +' UserEditinfoBox DivInputHeight'">
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="企业简称:" :required="boolEdit">
<el-form-item label="企业简称:" prop="companyName">
<div v-if="boolEdit == false">{{currentCompany.companyName}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-input v-model="currentCompany.companyName"></el-input>
@@ -233,7 +234,7 @@
<!-- 2019-07-31 新加的 -->
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="企业全称:" :required="boolEdit">
<el-form-item label="企业全称:" prop="compAllName">
<div v-if="boolEdit == false">{{currentCompany.compAllName}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-input v-model="currentCompany.compAllName"></el-input>
@@ -253,7 +254,7 @@
</div>-->
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="所属省份:" :required="boolEdit">
<el-form-item label="所属省份:" prop="proviceName" >
<div v-if="boolEdit == false">{{currentCompany.proviceName}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-select v-model="currentCompany.proviceID" placeholder="请选择">
@@ -280,7 +281,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="所属行业:" :required="boolEdit">
<el-form-item label="所属行业:" prop="industryName" >
<div v-if="boolEdit == false">{{currentCompany.industryName}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-select v-model="currentCompany.industryID" placeholder="请选择">
@@ -297,7 +298,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="单位电话:" :required="boolEdit">
<el-form-item label="单位电话:" prop="telphone" >
<div v-if="boolEdit == false">{{currentCompany.telphone}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-input v-model="currentCompany.telphone"></el-input>
@@ -307,7 +308,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="法人:" :required="boolEdit">
<el-form-item label="法人:" prop="cnName" >
<div v-if="boolEdit == false">{{currentCompany.cnName}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-input v-model="currentCompany.cnName"></el-input>
@@ -317,7 +318,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="性别:" :required="boolEdit">
<el-form-item label="性别:" prop="sex" >
<div v-if="boolEdit==false">
<div v-if="currentCompany.sex==1">帅哥</div>
<div v-if="currentCompany.sex==0">美女</div>
@@ -333,7 +334,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="手机号:" :required="boolEdit">
<el-form-item label="手机号:" prop="phone" >
<div v-if="boolEdit == false">{{currentCompany.phone}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-input v-model="currentCompany.phone" :disabled="!!currentCompany.companyID"></el-input>
@@ -343,7 +344,7 @@
</div>
<div class="yiyun_col-6">
<div class="el-form-itemBox">
<el-form-item label="邮箱:" :required="boolEdit">
<el-form-item label="邮箱:" prop="email" >
<div v-if="boolEdit == false">{{currentCompany.email}}</div>
<div v-if="boolEdit == true" class="boolEdit_Input">
<el-input v-model="currentCompany.email"></el-input>
@@ -863,6 +864,36 @@ export default {
el_formLabelcolor: "textlabelgray", //textlabelgray表单label为灰色字 textlabelblock 表单label为黑色字
// 树
listCompanyData: [],
companyRules:{
"companyName":[
{ required: true, message: "请输入企业简称", trigger: "blur" },
],
"compAllName": [
{ required: true, message: "请输入企业全称", trigger: "blur" },
],
"proviceName": [
// { type:'number', required: true, message: "请选择所属省份", trigger:'change' },
{ required: true, message: "请选择所属省份", trigger:'change' },
],
"industryName": [
{ required: true, message: "请选择所属行业", trigger:'change' },
],
"telphone": [
{ required: true, message: "请输入单位电话", trigger: "blur" },
],
"cnName": [
{ required: true, message: "请输入法人", trigger: "blur" },
],
"sex": [
{ required: true, message: "请选择性别", trigger: 'change' },
],
"phone": [
{ required: true, message: "请输入手机号", trigger: "blur" },
],
"email": [
{ required: true, message: "请输入邮箱", trigger: "blur" },
],
},
industryOptions: [
{
value: "建筑行业",
@@ -980,6 +1011,7 @@ export default {
},
],
CompanyInfo: "", // 企业总体信息
initCompanyRecord:{},//记录原始的公司信息
};
},
//生命周期
@@ -989,6 +1021,14 @@ export default {
this.loadIndustury();
this.loadProvinces();
},
computed: {
selectedIndustyId() {
return this.currentCompany.industryID;
},
selectProvinceId() {
return this.currentCompany.proviceID;
}
},
//方法
methods: {
async loadProvinces() {
@@ -1024,6 +1064,7 @@ export default {
var thisApp = this;
const resData = await services.fetchCompanyDetail(companyid);
this.currentCompany = resData;
this.initCompanyRecord = {...resData};
// this.$axios({
// method: "get",
// url: encodeURI(
@@ -1122,53 +1163,35 @@ export default {
/**
* 更新企业信息
*/
async updateCompany() {
if (!this.checkCompanyData()) {
return false;
}
var thisApp = this;
this.currentCompany.modifyUserID = sessionStorage.userId;
const res = await services.updateCompany(this.currentCompany);
const flag = res.Code === 0;
if (!flag) {
return false;
}
thisApp.$notify({
title: " ",
message: '修改成功',
type: "success",
offset: 100,
duration: 2500,
updateSave() {
this.$refs['form'].validate(async (valid)=>{
console.log('valid', valid);
if(!valid) return;
var thisApp = this;
this.currentCompany.modifyUserID = sessionStorage.userId;
const res = await services.updateCompany(this.currentCompany);
const flag = res.Code === 0;
if (!flag) {
return;
}
thisApp.$notify({
title: " ",
message: `企业“${this.currentCompany.companyName}”已完成修改。`,
type: "success",
offset: 100,
duration: 2500,
});
thisApp.listCompany();
this.initCompanyRecord = {...this.currentCompany};//保存之后信息得同步 否则取消的时候回出问题
this.el_formLabelcolor = "textlabelgray";
this.editButtonGroup = 1;
this.boolEdit = false;
this.rightTitle = this.currentCompany.companyName;

});
thisApp.listCompany();
return true;
// this.$axios({
// method: "put",
// url: encodeURI(process.env.API_HOST + "sysinfo/company"),
// data: this.currentCompany,
// })
// .then((response) => {
// if (response.data.state == 1) {
// thisApp.$notify({
// title: " ",
// message: response.data.message,
// type: "success",
// offset: 100,
// duration: 2500,
// });
// thisApp.listCompany();
// } else {
// thisApp.$notify.error({
//
// message: response.data.message,
// offset: 100,
// duration: 5000,
// });
// }
// })
// .catch((error) => {
// console.log(error);
// });
},
/**
* 验证企业信息表单数据
@@ -1317,12 +1340,7 @@ export default {
} else {
actionText = "禁用";
}
this.$confirm(
actionText +
"企业:" +
this.currentCompany.companyName +
", 是否继续?",
"",
this.$confirm(`${actionText}的企业将${actionText == "禁用" ? "无法" : "有权"}访问LOCKING, 确定${actionText}企业“${this.currentCompany.companyName}”吗?`,"",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -1348,19 +1366,19 @@ export default {
}
thisApp.$notify({
title: " ",
message: actionText + "成功",
message: `企业“${this.currentCompany.companyName}”已${actionText}。`,
type: "success",
offset: 100,
duration: 2500,
});
})
.catch(() => {
thisApp.$notify.info({
// thisApp.$notify.info({
message: "已取消" + actionText,
offset: 100,
duration: 2500,
});
// message: "已取消" + actionText,
// offset: 100,
// duration: 2500,
// });
});
},
/**
@@ -1368,8 +1386,7 @@ export default {
*/
deleteCompanyClick: function () {
var thisApp = this;
this.$confirm(
"删除企业:" + this.currentCompany.companyName + ", 是否继续?",
this.$confirm(`确定删除企业“${this.currentCompany.companyName}”吗?`,
"",
{
confirmButtonText: "确定",
@@ -1387,7 +1404,7 @@ export default {
thisApp.currentPain = 1;
thisApp.$notify({
title: " ",
message: "删除成功",
message: `企业“${this.currentCompany.companyName}”已删除。`,
type: "success",
offset: 100,
duration: 2500,
@@ -1403,29 +1420,25 @@ export default {
}
})
.catch(() => {
thisApp.$notify.info({
message: "已取消删除",
offset: 100,
duration: 2500,
});
});
},
/**
* 更新企业信息,保存数据
*/
async updateSave () {
const flag = await this.updateCompany();
if(!flag) return;
this.el_formLabelcolor = "textlabelgray";
this.editButtonGroup = 1;
this.boolEdit = false;
this.rightTitle = this.currentCompany.companyName;
},
// async updateSave () {
// const flag = this.updateCompany();
// console.log(flag);
// if(!flag) return;
// this.el_formLabelcolor = "textlabelgray";
// this.editButtonGroup = 1;
// this.boolEdit = false;
// this.rightTitle = this.currentCompany.companyName;
// },
/**
* 取消更新企业信息
*/
updateCancel: function () {
this.currentCompany = {...this.initCompanyRecord};
this.boolEdit = false;
this.editButtonGroup = 1;
this.rightTitle = this.currentCompany.companyName;
@@ -1483,35 +1496,37 @@ export default {
/**
* 新建企业,保存数据
*/
async addSave() {
if (!this.checkCompanyData()) {
return;
}
var thisApp = this;
this.currentCompany.createUserID = sessionStorage.userId;
this.currentCompany.modifyUserID = sessionStorage.userId;
const res = await services.createCompany(this.currentCompany);
const isSuccess = res.Code === 0;
if (!isSuccess) {
thisApp.$notify.error({
message: res.Msg,
offset: 100,
duration: 5000,
});
return;
}
thisApp.$notify({
title: " ",
message: res.Msg,
type: "success",
offset: 100,
duration: 2500,
addSave() {
this.$refs['form'].validate(async (valid)=>{
if(!valid) return;
var thisApp = this;
this.currentCompany.createUserID = sessionStorage.userId;
this.currentCompany.modifyUserID = sessionStorage.userId;
const res = await services.createCompany(this.currentCompany);
const isSuccess = res.Code === 0;
if (!isSuccess) {
thisApp.$notify.error({
message: res.Msg,
offset: 100,
duration: 5000,
});
return;
}
thisApp.$notify({
message: `企业“${this.currentCompany.companyName}”已完成添加。`,
type: "success",
offset: 100,
duration: 2500,
});
this.currentPain = 1;
this.el_formLabelcolor = "textlabelgray";
this.boolEdit = false;
this.listCompany();

});
this.currentPain = 1;
this.el_formLabelcolor = "textlabelgray";
this.boolEdit = false;
this.listCompany();

},
/*
* 筛选符合条件的tree节点
@@ -1590,6 +1605,19 @@ export default {
filterTreeText(val) {
this.$refs.tree.filter(val);
},
},
// 当选择的所属行业的Id发生变化的时候 及时更新选择行业的名字
selectedIndustyId(val) {
let target = this.industryOptions.find(industry => industry.industryID === this.currentCompany.industryID);
if(target) {
this.currentCompany.industryName = target.name;
}
},
selectProvinceId() {
let target = this.proviceOptions.find(p => p.id === this.currentCompany.proviceID);
if(target) {
this.currentCompany.proviceName = target.label;
}
}
}
};
</script>

+ 1
- 1
src/views/manage_system/customer/services.js Voir le fichier

@@ -144,7 +144,7 @@ export async function updateCompany(data) {
}

const resData = await fetchApi('company/updateCompanyById', { company: fixedData, user: userData });
return wrapErrorHint(resData);
return (resData);
}

async function recursionFetchNode(parentNodeId, topNodeId) {


+ 6
- 5
src/views/manage_system/template/index.vue Voir le fichier

@@ -2272,7 +2272,7 @@ export default {
// todo 自定义自定去重
// if(listProperty)
if (!isEdit && (!data.Node || data.Node.length === 0)) {
notify.error("xmind文件尚未上传");
notify.error("Xmind文件尚未上传。");
return;
}
if (isEdit) {
@@ -2294,7 +2294,7 @@ export default {
// notify.error(res.Msg || `${keyword}失败`);
return;
}
notify.success(`模板${keyword}成功`);
notify.success(`模板${keyword}完成。`);
if (!isEdit) {
thisApp.isShowModelpanel = false;
thisApp.isShowLookIndustryInfo = true;
@@ -3022,10 +3022,11 @@ export default {
},
onUploadSuccess({ response: res }) {
if (res.Code !== 0) {
notify.error(`xmind文件解析失败,${res.Msg}`);
// notify.error(`xmind文件解析失败,${res.Msg}`);
notify.error('请上传正确的Xmind文件。');
return;
}
notify.success("xmind文件解析成功");
notify.success("Xmind文件解析成功。");
this.editTemplateData.Node = res.Data;
this.isXimdUpLoadSuccess = true;
},
@@ -3176,7 +3177,7 @@ export default {
cacelInsertTemplate: function () {
this.$confirm(
"取消操作会清除当前所填写的模板信息,是否确认取消?",
"取消新增模板",
"",
{
confirmButtonText: "确定",
cancelButtonText: "返回",


Chargement…
Annuler
Enregistrer