Authored by 张凯

1、文档管理master-500分支修改代码迁移到v32

2、乙方运维人员编辑页面优化(增加判定录入功能)
... ... @@ -422,11 +422,13 @@ export default {
}
if (res.msg) {
proxy.$global.showMsg(res.msg, 'warning');
proxy.$global.showMsg(res.msg);
} else {
proxy.$global.showMsg('放入回收站成功!');
let isUser = !isUserFolder.value;
reload(isUser);
//joke 屏蔽 20221122 开始
// let isUser = !isUserFolder.value;
// reload(isUser);
//joke 屏蔽 20221122 结束
}
if (props.isRecycle) {
... ... @@ -540,10 +542,13 @@ export default {
proxy.$refs[id].validate((valid) => {
if (valid) {
let params = docForm.value;
if (currentNodeData.value.id == undefined || currentNodeData.value.id == '') {
params.pid = '0'
} else {
params.pid = currentNodeData.value.id;
//joke 修改 20221121
if (params.id == '' || params.id == null){
if (currentNodeData.value.id == undefined || currentNodeData.value.id == '') {
params.pid = '0'
} else {
params.pid = currentNodeData.value.id;
}
}
if (isUserFolder.value) {
params.id = "";
... ...
... ... @@ -8,6 +8,9 @@
<i class="iconfont icon-gantanhao" style="color:rgb(30,159,255);"></i><span></span>
</el-tooltip>
</el-divider>
<el-button v-if="!isAdmin()" :size="$global.elementConfig.size.button" @click="add"
style="float:right;margin-right: 6px;margin-bottom: 6px">录入
</el-button>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="true" :height="height" :pageSize="pageSize"></cm-table-page>
... ... @@ -18,9 +21,10 @@
<component v-bind:is="componentName"
:docType="docType"
height="500"
:isAdd="isAdd"
:docTypeName="docTypeName"
:pageSize="pageSize"
:treeNode="treeNode" :parentNode="parentNode" :projectId="projectId" @callback="refreshPage"></component>
:treeNode="treeNode" @showPopout="showPopout" :parentNode="parentNode" :projectId="projectId" @callback="refreshPage"></component>
</div>
</template>
</cm-dialog>
... ...
... ... @@ -53,7 +53,7 @@ export default {
let docTypeName = Vue.ref('');
let componentName = Vue.ref('');
let dialogFlg = Vue.ref(false);
let isAdd = Vue.ref(false);
let columns = Vue.ref([{
prop: 'nickname',
... ... @@ -64,6 +64,7 @@ export default {
title.value = "个人信息";
componentName.value = "USER";
props.parentNode.id = row.id;
isAdd.value = false;
showDialog(true);
}
}, {
... ... @@ -107,6 +108,7 @@ export default {
title.value = "个人信息";
componentName.value = "USER";
props.parentNode.id = row.id;
isAdd.value = false;
showDialog(true);
},
render: function (row) {
... ... @@ -170,10 +172,28 @@ export default {
dialogFlg.value = flg;
}
let showPopout = (val) => {
dialogFlg.value = val;
getPage();
}
let dataList = Vue.ref([]);
let currentPage = Vue.ref(1);
let total = Vue.ref(0);
let add = () => {
title.value = "个人信息录入";
componentName.value = "USER";
isAdd.value = true;
showDialog(true);
}
let isAdmin = () => {
let userRoleArr = proxy.$global.common.getUserRole();
let userName = proxy.$global.common.getUserName();
return userName != 'admin' && userName != 'root' && !userRoleArr.includes('pmp');
}
// 获取表格数据
let getPage = (obj) => {
if (!props.treeNode.map || !props.treeNode.map.nodeType) {
... ... @@ -233,7 +253,11 @@ export default {
dialogFlg,
showDialog,
componentName,
refreshPage
add,
isAdd,
showPopout,
refreshPage,
isAdmin
}
}
}
... ...
... ... @@ -21,7 +21,7 @@
<el-row :gutter="5">
<el-col :span="8">
<el-form-item label="姓名" prop="nickname" class="form-class">
<el-input v-model="ruleForm.nickname" :readonly="true"></el-input>
<el-input v-model="ruleForm.nickname" :readonly="whether"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
... ... @@ -129,8 +129,8 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="在职状态" prop="certificate" :readonly="true" class="form-class">
<el-radio-group v-model="ruleForm.state" :disabled="true">
<el-form-item label="在职状态" prop="state" class="form-class">
<el-radio-group v-model="ruleForm.state" :disabled="isAdmin()">
<el-radio :label="1">在职</el-radio>
<el-radio :label="2">离职</el-radio>
</el-radio-group>
... ... @@ -144,7 +144,7 @@
</el-row>
<el-row :gutter="">
<el-col :span="12">
<el-form-item label="获得证书" prop="post">
<el-form-item label="获得证书" prop="certificate">
<el-input v-model="ruleForm.certificate" :readonly="isAdmin()"></el-input>
</el-form-item>
</el-col>
... ... @@ -167,57 +167,58 @@
</el-form>
<!--工作简历表格-->
<div class="title" style="padding-left: 0px">
<i class="iconfont icon-icon--yingbing" /> 工作简历信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','work')" plain>新增</el-button>
</div>
<el-table border :data="workInfoTableData" stripe style="width: 100%" >
<el-table-column label="序号" type="index" width="100" align="center"/>
<el-table-column prop="place" align="center" label="工作单位" />
<el-table-column prop="position" align="center" label="职位" />
<el-table-column prop="startDate" align="center" label="入职日期" />
<el-table-column prop="endDate" align="center" label="离职日期" />
<el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >
<template #default="scope">
<div class="list-handle">
<div v-if="showMore">
<!--工作简历表格-->
<div class="title" style="padding-left: 0px">
<i class="iconfont icon-icon--yingbing" /> 工作简历信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','work')" plain>新增</el-button>
</div>
<el-table border :data="workInfoTableData" stripe style="width: 100%" >
<el-table-column label="序号" type="index" width="100" align="center"/>
<el-table-column prop="place" align="center" label="工作单位" />
<el-table-column prop="position" align="center" label="职位" />
<el-table-column prop="startDate" align="center" label="入职日期" />
<el-table-column prop="endDate" align="center" label="离职日期" />
<el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >
<template #default="scope">
<div class="list-handle">
<span class="icon-bg">
<i class="el-icon-delete" title="删除" @click="deleteByType(scope.row,'work')"></i>
</span>
<span class="icon-bg">
<span class="icon-bg">
<i class="el-icon-edit-outline" title="修改" @click="updateFamilyOrWorkInfo(scope.row,'work')"></i>
</span>
</div>
</template>
</el-table-column>
</el-table>
</div>
</template>
</el-table-column>
</el-table>
<!--家庭成员表格-->
<div class="title" style="margin-top: 10px;padding-left: 0px">
<i class="iconfont icon-icon--yingbing" /> 家庭成员信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','family')" plain>新增</el-button>
</div>
<el-table border :data="familyInfoTableData" stripe style="width: 100%" >
<el-table-column label="序号" type="index" width="100" align="center"/>
<el-table-column prop="name" align="center" label="成员姓名" />
<el-table-column prop="appellation" align="center" label="称谓" />
<el-table-column prop="place" align="center" label="工作单位" />
<el-table-column prop="position" align="center" label="职位" />
<el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >
<template #default="scope">
<div class="list-handle">
<!--家庭成员表格-->
<div class="title" style="margin-top: 10px;padding-left: 0px">
<i class="iconfont icon-icon--yingbing" /> 家庭成员信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','family')" plain>新增</el-button>
</div>
<el-table border :data="familyInfoTableData" stripe style="width: 100%" >
<el-table-column label="序号" type="index" width="100" align="center"/>
<el-table-column prop="name" align="center" label="成员姓名" />
<el-table-column prop="appellation" align="center" label="称谓" />
<el-table-column prop="place" align="center" label="工作单位" />
<el-table-column prop="position" align="center" label="职位" />
<el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >
<template #default="scope">
<div class="list-handle">
<span class="icon-bg">
<i class="el-icon-delete" title="删除" @click="deleteByType(scope.row,'family')"></i>
</span>
<span class="icon-bg">
<span class="icon-bg">
<i class="el-icon-edit-outline" title="修改" @click="updateFamilyOrWorkInfo(scope.row,'family')"></i>
</span>
</div>
</template>
</el-table-column>
</el-table>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!--资产信息-->
<div class="title">
<div class="title" v-if="showMore">
<i class="iconfont icon-liebiaomoshi"/> 资产信息
<el-dropdown v-if="Object.keys(icon).length > 0 && !isAdmin()" size="mini" split-button @click="assetsAdd('bastion',`新建${icon['bastion'].name}资产`)" style="margin-left: 20px">
<i class="icon el-icon-plus"/>添加{{icon['bastion'].name}}
... ...
... ... @@ -12,19 +12,19 @@ const assets = (props, {attrs, slots, emit}) => {
//查询资产类型列表
let getAssetType = () => {
if(Object.keys(icon.value).length > 0){
if (Object.keys(icon.value).length > 0) {
return;
}
proxy.$http.post(`/api-web/manage/ddic/findSucDdics/OPS_SECOND_PROPERTY`, {}, function (res) {
if (res && res.data.length > 0) {
icon.value = {};
res.data.forEach(function(item, index, arr){
res.data.forEach(function (item, index, arr) {
let code = item.ddicCode;
let obj = {};
// code = code.substring(code.lastIndexOf("_") + 1, code.length).toLowerCase();
obj.name=item.ddicName;
obj.icon=item.ddicDesc;
icon.value[code] =obj;
obj.name = item.ddicName;
obj.icon = item.ddicDesc;
icon.value[code] = obj;
});
}
});
... ... @@ -42,15 +42,14 @@ const assets = (props, {attrs, slots, emit}) => {
let assetsAdd = (type, msg) => {
proxy.$http.get(`/api-web/person/assets/typeList/${type}`, {}, function (res) {
if (res && res.data && res.data.length > 0) {
btnClick('add',res.data,msg);
btnClick('add', res.data, msg);
} else {
proxy.$global.showMsg("没有配置属性!","warning");
proxy.$global.showMsg("没有配置属性!", "warning");
}
});
}
/**
* 新增资产
* <p>
... ... @@ -72,13 +71,13 @@ const assets = (props, {attrs, slots, emit}) => {
data = arr;
}
data.map(function (v){
data.map(function (v) {
let str = v.extend;
if(str){
if (str) {
try {
let json = JSON.parse(str);
v.extend = json;
}catch (e){
} catch (e) {
}
}
})
... ... @@ -92,12 +91,12 @@ const assets = (props, {attrs, slots, emit}) => {
}
let checkAssets = () =>{
let checkAssets = () => {
let data = btnType.value.data;
let size = 0;
data.forEach(function (v){
if( !v.value || v.value == '' || v.value == null){
size ++;
data.forEach(function (v) {
if (!v.value || v.value == '' || v.value == null) {
size++;
}
})
... ... @@ -112,15 +111,15 @@ const assets = (props, {attrs, slots, emit}) => {
*/
let addAssets = () => {
let data = btnType.value.data
data.map(function (v){
data.map(function (v) {
v.extend = JSON.stringify(v.extend);
})
if(checkAssets()){
proxy.$global.showMsg(`请填写资产信息,不能全部为空!`,'warning');
if (checkAssets()) {
proxy.$global.showMsg(`请填写资产信息,不能全部为空!`, 'warning');
return;
}
proxy.$http.post(`/api-web/person/assets/add/${props.parentNode.id}`,data , function (res) {
proxy.$http.post(`/api-web/person/assets/add/${props.parentNode.id}`, data, function (res) {
if (res && res.success) {
proxy.$global.showMsg("添加成功");
showDialog(false);
... ... @@ -138,12 +137,12 @@ const assets = (props, {attrs, slots, emit}) => {
*/
let saveAssets = () => {
let data = btnType.value.data
data.map(function (v){
data.map(function (v) {
v.extend = JSON.stringify(v.extend);
})
if(checkAssets()){
proxy.$global.showMsg(`请填写资产信息,不能全部为空!`,'warning');
if (checkAssets()) {
proxy.$global.showMsg(`请填写资产信息,不能全部为空!`, 'warning');
return;
}
proxy.$http.post(`/api-web/person/assets/edit/${props.parentNode.id}`, data, function (res) {
... ... @@ -162,12 +161,12 @@ const assets = (props, {attrs, slots, emit}) => {
* 时间:2021/11/3 20:14
*/
let deleteAssets = (arr) => {
proxy.$global.confirm(`您确认永久删除该资产信息吗?`,function (){
proxy.$global.confirm(`您确认永久删除该资产信息吗?`, function () {
proxy.$http.post(`/api-web/person/assets/delete/${props.parentNode.id}`, arr, function (res) {
if (res && res.success) {
proxy.$global.showMsg("删除成功");
} else {
proxy.$global.showMsg("删除失败,资产不存在或者已被删除!","error");
proxy.$global.showMsg("删除失败,资产不存在或者已被删除!", "error");
}
showDialog(false);
getAssets();
... ... @@ -185,7 +184,11 @@ const assets = (props, {attrs, slots, emit}) => {
* 时间:2021/11/3 20:17
*/
let showDialog = (flg) => {
op.value = flg;
if (!props.isAdd) {
op.value = flg;
} else {
proxy.$global.showMsg("请先添加用户!", "error");
}
}
let okFunc = () => {
... ... @@ -233,22 +236,27 @@ export default {
type: String,
default: ''
},
isAdd: {
type: Boolean,
default: false
}
},
data() {
return {
}
return {}
},
setup(props, {attrs, slots, emit}) {
let height = Vue.ref(window.innerHeight - 130);
//判定是否展示家庭成员、工作简历级资产列表
let showMore = Vue.ref(false);
const {proxy} = Vue.getCurrentInstance();
let imageUrl = Vue.ref('');
const familyInfoTableData=Vue.ref([]);
const familyInfoTableData = Vue.ref([]);
// 家庭成员信息弹框显示标识
let familyDiaShow = Vue.ref(false);
//家庭成员信息弹框标题
let familyDiaTitle = Vue.ref('');
const workInfoTableData=Vue.ref([]);
const workInfoTableData = Vue.ref([]);
// 简历信息弹框显示标识
let workDiaShow = Vue.ref(false);
//简历信息弹框标题
... ... @@ -265,21 +273,21 @@ export default {
company: '',
headImgUrl: '',
post: '',
projectId: null,
// projectId: null,
quitTime: '',
state: '',
idcard:'',
politicsStatus:'',
hasProof:'', //是否有无犯罪证明 joke add 20221012
nativePlace:'', //籍贯 joke add 20221012
birthday:'', //出生日期 joke add 20221012
partyDate:'', //入党日期 joke add 20221012
responsibility:'' //岗位职责 joke add 20221012
idcard: '',
politicsStatus: '',
hasProof: '', //是否有无犯罪证明 joke add 20221012
nativePlace: '', //籍贯 joke add 20221012
birthday: '', //出生日期 joke add 20221012
partyDate: '', //入党日期 joke add 20221012
responsibility: '' //岗位职责 joke add 20221012
})
let familyInfoForm = Vue.ref({
id:'',
personId:props.parentNode.id, //用户id
id: '',
personId: props.parentNode.id, //用户id
name: '', //家庭成员姓名
appellation: '', //家庭成员称谓
place: '', //家庭成员工作单位
... ... @@ -289,8 +297,8 @@ export default {
let familyInfoFormRef = Vue.ref('');
let workInfoForm = Vue.ref({
id:'',
personId:props.parentNode.id, //用户id
id: '',
personId: props.parentNode.id, //用户id
place: '', //工作单位
position: '', //职位
startDate: '', //入职日期
... ... @@ -307,6 +315,10 @@ export default {
}, function (res) {
if (res && res.object) {
ruleForm.value = res.object
//如果为新录入,则屏蔽部分页面(家庭成员、工作经历、获得奖励及资产信息)
if (res.object.id != null && res.object.id != '') {
showMore.value = true;
}
proxy.familyInfoTableData = res.object.familyInfoList;
proxy.workInfoTableData = res.object.workExperienceList;
} else {
... ... @@ -318,28 +330,48 @@ export default {
imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}`
}
let refreshTable = () => {
proxy.$http.get("/api-web/bOpsPerson/search", {
"nickname": props.parentNode.label,
"id": props.parentNode.id,
"projectId": props.projectId
}, function (res) {
if (res && res.object) {
//如果为新录入,则屏蔽部分页面(家庭成员、工作经历、获得奖励及资产信息)
if (res.object.id != null && res.object.id != '') {
showMore.value = true;
}
proxy.familyInfoTableData = res.object.familyInfoList;
proxy.workInfoTableData = res.object.workExperienceList;
}
});
//图片回显
imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}`
}
//点击家庭成员信息的新增按钮事件
let showDiaByType = (flg,type) =>{
if (type === 'family'){
let showDiaByType = (flg, type) => {
if (type === 'family') {
//展示新增或编辑页面
familyDiaShow.value = flg;
if (flg === false){
if (flg === false) {
familyInfoForm.value = {
id:'',
personId:props.parentNode.id, //用户id
id: '',
personId: props.parentNode.id, //用户id
name: '', //家庭成员姓名
appellation: '', //家庭成员称谓
place: '', //家庭成员工作单位
position: '', //家庭成员职位
}
}
}else if (type === 'work'){
} else if (type === 'work') {
//展示新增或编辑页面
workDiaShow.value = flg;
if (flg === false){
if (flg === false) {
workInfoForm.value = {
id:'',
personId:props.parentNode.id, //用户id
id: '',
personId: props.parentNode.id, //用户id
place: '', //工作单位
position: '', //职位
startDate: '', //入职日期
... ... @@ -349,42 +381,42 @@ export default {
}
}
let seTitleByType = (name,type) => {
if (type === 'family'){
let seTitleByType = (name, type) => {
if (type === 'family') {
familyDiaTitle.value = name + '家庭成员';
}else if (type === 'work'){
} else if (type === 'work') {
workDiaTitle.value = name + '工作经历';
}
}
//点击家庭成员新增按钮
let addFamilyInfo = (name,type) => {
showDiaByType(true,type);
seTitleByType(name,type);
let addFamilyInfo = (name, type) => {
showDiaByType(true, type);
seTitleByType(name, type);
}
//点击修改按钮
let updateFamilyOrWorkInfo = (row,type) => {
let updateFamilyOrWorkInfo = (row, type) => {
//获取数据
if (type === 'family'){
if (type === 'family') {
familyInfoForm.value = {
id:row.id,
personId:props.parentNode.id, //用户id
id: row.id,
personId: props.parentNode.id, //用户id
name: row.name, //家庭成员姓名
appellation: row.appellation, //家庭成员称谓
place: row.place, //家庭成员工作单位
position: row.position, //家庭成员职位
}
}else if (type === 'work'){
} else if (type === 'work') {
workInfoForm.value = {
id:row.id,
personId:props.parentNode.id, //用户id
id: row.id,
personId: props.parentNode.id, //用户id
place: row.place, //工作单位
position: row.position, //职位
startDate: row.startDate, //入职日期
endDate: row.endDate, //离职日期
}
}
addFamilyInfo('编辑',type);
addFamilyInfo('编辑', type);
}
/**
... ... @@ -394,13 +426,13 @@ export default {
* @param callback
* @returns {*}
*/
const checkTel= (rule, value, callback) => {
var re1=/^0\d{2}-[1-9]\d{7}$/;
var re2=/^0\d{3}-[1-9]\{6,7}$/;
var result=re1.test(value)||re2.test(value);
const checkTel = (rule, value, callback) => {
var re1 = /^0\d{2}-[1-9]\d{7}$/;
var re2 = /^0\d{3}-[1-9]\{6,7}$/;
var result = re1.test(value) || re2.test(value);
if (!result && value) {
return callback(new Error('请输入正确的座机号!'))
}else{
} else {
callback()
}
}
... ... @@ -411,18 +443,18 @@ export default {
* @param callback
* @returns {*}
*/
const checkPhone= (rule, tel, callback) => {
var mobile = /^1[0-9]\d{9}$/;
const checkPhone = (rule, tel, callback) => {
var mobile = /^1[0-9]\d{9}$/;
if (tel != '' && !mobile.test(tel)) {
callback(new Error('请输入正确的手机号!'))
} else {
callback();
}
}
const checkIdCard=(rule, idCard, callback) => {
const checkIdCard = (rule, idCard, callback) => {
var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
if (idCard != '' && !pattern.test(idCard)) {
callback(new Error('身份证校验失败!'));
callback(new Error('身份证校验失败!'));
} else {
callback();
}
... ... @@ -436,45 +468,62 @@ export default {
* @author LH
* 表单规则校验
*/
let rules=Vue.ref({
let rules = Vue.ref({
nickname: [
{ message: '请输入姓名', trigger: 'blur' }
{required: true, message: '请输入姓名', trigger: 'blur'}
],
sex: [
{required: true, message: '请选择性别', trigger: 'blur'}
],
phone: [
{ validator: checkPhone, trigger: 'blur' }
{required: true, message: '请输入手机号', trigger: 'blur'},
{validator: checkPhone,message: '请输入正确的手机号' , trigger: 'blur'}
],
company: [
{ message:'请输入所在公司', trigger: 'blur' }
{required: true, message: '请输入所在公司', trigger: 'blur'}
],
idcard: [
{ validator:checkIdCard,message:'请输入正确的身份证号', trigger: 'blur'}
{required: true, message: '请输入身份证号', trigger: 'blur'},
{validator: checkIdCard, message: '请输入正确的身份证号', trigger: 'blur'}
],
entryTime: [
{required: true, message: '请选择入职时间', trigger: 'blur'}
],
state: [
{required: true, message: '请选择在职状态', trigger: 'blur'}
],
university: [
{required: true, message: '请输入毕业院校', trigger: 'blur'}
],
education: [
{required: true, message: '请输入学历', trigger: 'blur'}
]
});
let familyOrWorkRules = Vue.ref({
name: [
{ required: true, message: '请输入姓名' },
{ message: '请输入姓名', trigger: 'blur' }
{required: true, message: '请输入姓名'},
{message: '请输入姓名', trigger: 'blur'}
],
appellation: [
{ required: true, message: '请输入称谓' },
{ message: '请输入称谓', trigger: 'blur' }
{required: true, message: '请输入称谓'},
{message: '请输入称谓', trigger: 'blur'}
],
place: [
{ required: true, message: '请输入工作单位' },
{ message: '请输入工作单位', trigger: 'blur' }
{required: true, message: '请输入工作单位'},
{message: '请输入工作单位', trigger: 'blur'}
],
position: [
{ required: true, message: '请输入职位' },
{ message: '请输入职位', trigger: 'blur' }
{required: true, message: '请输入职位'},
{message: '请输入职位', trigger: 'blur'}
],
startDate: [
{ required: true, message: '请选择入职日期' },
{ validator:validatorDate,message:'请选择入职日期', trigger: 'blur'}
{required: true, message: '请选择入职日期'},
{validator: validatorDate, message: '请选择入职日期', trigger: 'blur'}
],
endDate: [
{ required: true, message: '请选择离职日期' },
{ validator:validatorDate,message:'请选择离职日期', trigger: 'blur'}
{required: true, message: '请选择离职日期'},
{validator: validatorDate, message: '请选择离职日期', trigger: 'blur'}
],
});
... ... @@ -485,72 +534,82 @@ export default {
*/
// 保存用户信息
let saveUser = () => {
proxy.$refs.rule.validate((valid) => {
if (valid) {
console.log('submit!!');
proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {
if (res && res.code == 0) {
proxy.$global.showMsg('保存成功!');
}
});
} else {
console.log('error submit!!');
return false;
}
});
if (props.treeNode.map == undefined) {
proxy.$global.showMsg('请先添加业务', 'warning');
emit('showPopout', false)
}
proxy.$refs.rule.validate((valid) => {
if (valid) {
console.log('submit!!');
ruleForm.value.busId = props.treeNode.map.nodeType.projectId;
proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {
if (res && res.code == 0) {
proxy.$global.showMsg('保存成功!');
}
emit('showPopout', false)
});
} else {
console.log('error submit!!');
return false;
}
});
}
let saveOrUpdateByType = (type,rules) => {
let saveOrUpdateByType = (type, rules) => {
let msg = '新增';
var data = {};
if (type === 'family'){
if (familyDiaTitle.value.indexOf('新增') == -1){ //表示编辑
if (type === 'family') {
if (familyDiaTitle.value.indexOf('新增') == -1) { //表示编辑
msg = '编辑';
}
data = familyInfoForm.value;
}else if (type === 'work'){
if (workDiaTitle.value.indexOf('新增') == -1){ //表示编辑
} else if (type === 'work') {
if (workDiaTitle.value.indexOf('新增') == -1) { //表示编辑
msg = '编辑';
}
data = workInfoForm.value;
}
rules.validate((valid) => {
if (valid){
proxy.$http.post("/api-web/bOpsPerson/saveOrUpdateByType?type="+type, data, function (res) {
if (valid) {
proxy.$http.post("/api-web/bOpsPerson/saveOrUpdateByType?type=" + type, data, function (res) {
if (res && res.success == true) {
proxy.$global.showMsg(msg +'成功!');
showDiaByType(false,type);
getPage();
proxy.$global.showMsg(msg + '成功!');
showDiaByType(false, type);
refreshTable();
}
});
}
})
}
//删除
let deleteByType = (row,type) => {
proxy.$http.post("/api-web/bOpsPerson/deleteByType?type="+type+"&ids="+row.id, {}, function (res) {
let deleteByType = (row, type) => {
proxy.$http.post("/api-web/bOpsPerson/deleteByType?type=" + type + "&ids=" + row.id, {}, function (res) {
if (res && res.success == true) {
proxy.$global.showMsg('删除成功!');
getPage();
refreshTable();
}
});
}
let getFile = (param) => {
let fileObj = param.file
let params = {
file: fileObj,
id: props.parentNode.id
}
// 上传文件
proxy.$http.uploadFile("/api-web/bOpsPerson/uploadFile", params, function (res) {
if (res && res.success) {
proxy.$global.showMsg("上传成功!");
if (!props.isAdd) {
let fileObj = param.file
let params = {
file: fileObj,
id: props.parentNode.id
}
})
imageUrl.value = URL.createObjectURL(fileObj);
// 上传文件
proxy.$http.uploadFile("/api-web/bOpsPerson/uploadFile", params, function (res) {
if (res && res.success) {
proxy.$global.showMsg("上传成功!");
}
})
imageUrl.value = URL.createObjectURL(fileObj);
} else {
proxy.$global.showMsg("请先添加用户!", "error");
}
}
let beforeAvatarUpload = (file) => {
... ... @@ -582,12 +641,16 @@ export default {
getAssetType,
icon
} = assets(props, {attrs, slots, emit});
let whether = Vue.ref(true);
// // 挂载完
Vue.onMounted(() => {
if (!props.isAdd) {
getPage();
getAssets();
} else {
whether.value = false;
}
getAssetType();
getPage();
getAssets();
})
// 监听编辑状态
... ... @@ -595,6 +658,7 @@ export default {
getAssetType();
getPage();
getAssets();
refreshTable();
});
return {
imageUrl,
... ... @@ -632,7 +696,10 @@ export default {
workInfoForm,
updateFamilyOrWorkInfo,
familyOrWorkRules,
familyInfoFormRef
familyInfoFormRef,
whether,
showMore,
refreshTable
}
}
}
... ...
... ... @@ -64,8 +64,10 @@ export default {
proxy.$http.get("/api-web/bOpsProject/getTree", params, function (res) {
if (res && res.data) {
dataSource.value = res.data;
projectId.value = res.data[0].dataList[0].id;
treeNode.value = res.data[0];
if (res.data.length >0){
projectId.value = res.data[0].dataList[0].id;
treeNode.value = res.data[0];
}
} else {
proxy.$global.showMsg('暂无数据!');
}
... ...