Authored by 王涛

Merge branch 'master-joke' into 'master'

1、文档管理master-500分支修改代码迁移到master 2、乙方运维人员编辑页面优化(增加判定录入功能)

1、文档管理master-500分支修改代码迁移到master
2、乙方运维人员编辑页面优化(增加判定录入功能)

See merge request !1076
@@ -422,11 +422,13 @@ export default { @@ -422,11 +422,13 @@ export default {
422 } 422 }
423 423
424 if (res.msg) { 424 if (res.msg) {
425 - proxy.$global.showMsg(res.msg, 'warning'); 425 + proxy.$global.showMsg(res.msg);
426 } else { 426 } else {
427 proxy.$global.showMsg('放入回收站成功!'); 427 proxy.$global.showMsg('放入回收站成功!');
428 - let isUser = !isUserFolder.value;  
429 - reload(isUser); 428 + //joke 屏蔽 20221122 开始
  429 + // let isUser = !isUserFolder.value;
  430 + // reload(isUser);
  431 + //joke 屏蔽 20221122 结束
430 } 432 }
431 433
432 if (props.isRecycle) { 434 if (props.isRecycle) {
@@ -540,10 +542,13 @@ export default { @@ -540,10 +542,13 @@ export default {
540 proxy.$refs[id].validate((valid) => { 542 proxy.$refs[id].validate((valid) => {
541 if (valid) { 543 if (valid) {
542 let params = docForm.value; 544 let params = docForm.value;
543 - if (currentNodeData.value.id == undefined || currentNodeData.value.id == '') {  
544 - params.pid = '0'  
545 - } else {  
546 - params.pid = currentNodeData.value.id; 545 + //joke 修改 20221121
  546 + if (params.id == '' || params.id == null){
  547 + if (currentNodeData.value.id == undefined || currentNodeData.value.id == '') {
  548 + params.pid = '0'
  549 + } else {
  550 + params.pid = currentNodeData.value.id;
  551 + }
547 } 552 }
548 if (isUserFolder.value) { 553 if (isUserFolder.value) {
549 params.id = ""; 554 params.id = "";
@@ -8,6 +8,9 @@ @@ -8,6 +8,9 @@
8 <i class="iconfont icon-gantanhao" style="color:rgb(30,159,255);"></i><span></span> 8 <i class="iconfont icon-gantanhao" style="color:rgb(30,159,255);"></i><span></span>
9 </el-tooltip> 9 </el-tooltip>
10 </el-divider> 10 </el-divider>
  11 + <el-button v-if="!isAdmin()" :size="$global.elementConfig.size.button" @click="add"
  12 + style="float:right;margin-right: 6px;margin-bottom: 6px">录入
  13 + </el-button>
11 <cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true" 14 <cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
12 :showBorder="true" :currentPage="currentPage" :total="total" :loading="false" 15 :showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
13 :showPage="true" :height="height" :pageSize="pageSize"></cm-table-page> 16 :showPage="true" :height="height" :pageSize="pageSize"></cm-table-page>
@@ -18,9 +21,10 @@ @@ -18,9 +21,10 @@
18 <component v-bind:is="componentName" 21 <component v-bind:is="componentName"
19 :docType="docType" 22 :docType="docType"
20 height="500" 23 height="500"
  24 + :isAdd="isAdd"
21 :docTypeName="docTypeName" 25 :docTypeName="docTypeName"
22 :pageSize="pageSize" 26 :pageSize="pageSize"
23 - :treeNode="treeNode" :parentNode="parentNode" :projectId="projectId" @callback="refreshPage"></component> 27 + :treeNode="treeNode" @showPopout="showPopout" :parentNode="parentNode" :projectId="projectId" @callback="refreshPage"></component>
24 </div> 28 </div>
25 </template> 29 </template>
26 </cm-dialog> 30 </cm-dialog>
@@ -53,7 +53,7 @@ export default { @@ -53,7 +53,7 @@ export default {
53 let docTypeName = Vue.ref(''); 53 let docTypeName = Vue.ref('');
54 let componentName = Vue.ref(''); 54 let componentName = Vue.ref('');
55 let dialogFlg = Vue.ref(false); 55 let dialogFlg = Vue.ref(false);
56 - 56 + let isAdd = Vue.ref(false);
57 57
58 let columns = Vue.ref([{ 58 let columns = Vue.ref([{
59 prop: 'nickname', 59 prop: 'nickname',
@@ -64,6 +64,7 @@ export default { @@ -64,6 +64,7 @@ export default {
64 title.value = "个人信息"; 64 title.value = "个人信息";
65 componentName.value = "USER"; 65 componentName.value = "USER";
66 props.parentNode.id = row.id; 66 props.parentNode.id = row.id;
  67 + isAdd.value = false;
67 showDialog(true); 68 showDialog(true);
68 } 69 }
69 }, { 70 }, {
@@ -107,6 +108,7 @@ export default { @@ -107,6 +108,7 @@ export default {
107 title.value = "个人信息"; 108 title.value = "个人信息";
108 componentName.value = "USER"; 109 componentName.value = "USER";
109 props.parentNode.id = row.id; 110 props.parentNode.id = row.id;
  111 + isAdd.value = false;
110 showDialog(true); 112 showDialog(true);
111 }, 113 },
112 render: function (row) { 114 render: function (row) {
@@ -170,10 +172,28 @@ export default { @@ -170,10 +172,28 @@ export default {
170 dialogFlg.value = flg; 172 dialogFlg.value = flg;
171 } 173 }
172 174
  175 + let showPopout = (val) => {
  176 + dialogFlg.value = val;
  177 + getPage();
  178 + }
  179 +
173 let dataList = Vue.ref([]); 180 let dataList = Vue.ref([]);
174 let currentPage = Vue.ref(1); 181 let currentPage = Vue.ref(1);
175 let total = Vue.ref(0); 182 let total = Vue.ref(0);
176 183
  184 + let add = () => {
  185 + title.value = "个人信息录入";
  186 + componentName.value = "USER";
  187 + isAdd.value = true;
  188 + showDialog(true);
  189 + }
  190 +
  191 + let isAdmin = () => {
  192 + let userRoleArr = proxy.$global.common.getUserRole();
  193 + let userName = proxy.$global.common.getUserName();
  194 + return userName != 'admin' && userName != 'root' && !userRoleArr.includes('pmp');
  195 + }
  196 +
177 // 获取表格数据 197 // 获取表格数据
178 let getPage = (obj) => { 198 let getPage = (obj) => {
179 if (!props.treeNode.map || !props.treeNode.map.nodeType) { 199 if (!props.treeNode.map || !props.treeNode.map.nodeType) {
@@ -233,7 +253,11 @@ export default { @@ -233,7 +253,11 @@ export default {
233 dialogFlg, 253 dialogFlg,
234 showDialog, 254 showDialog,
235 componentName, 255 componentName,
236 - refreshPage 256 + add,
  257 + isAdd,
  258 + showPopout,
  259 + refreshPage,
  260 + isAdmin
237 } 261 }
238 } 262 }
239 } 263 }
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <el-row :gutter="5"> 21 <el-row :gutter="5">
22 <el-col :span="8"> 22 <el-col :span="8">
23 <el-form-item label="姓名" prop="nickname" class="form-class"> 23 <el-form-item label="姓名" prop="nickname" class="form-class">
24 - <el-input v-model="ruleForm.nickname" :readonly="true"></el-input> 24 + <el-input v-model="ruleForm.nickname" :readonly="whether"></el-input>
25 </el-form-item> 25 </el-form-item>
26 </el-col> 26 </el-col>
27 <el-col :span="8"> 27 <el-col :span="8">
@@ -129,8 +129,8 @@ @@ -129,8 +129,8 @@
129 </el-form-item> 129 </el-form-item>
130 </el-col> 130 </el-col>
131 <el-col :span="8"> 131 <el-col :span="8">
132 - <el-form-item label="在职状态" prop="certificate" :readonly="true" class="form-class">  
133 - <el-radio-group v-model="ruleForm.state" :disabled="true"> 132 + <el-form-item label="在职状态" prop="state" class="form-class">
  133 + <el-radio-group v-model="ruleForm.state" :disabled="isAdmin()">
134 <el-radio :label="1">在职</el-radio> 134 <el-radio :label="1">在职</el-radio>
135 <el-radio :label="2">离职</el-radio> 135 <el-radio :label="2">离职</el-radio>
136 </el-radio-group> 136 </el-radio-group>
@@ -144,7 +144,7 @@ @@ -144,7 +144,7 @@
144 </el-row> 144 </el-row>
145 <el-row :gutter=""> 145 <el-row :gutter="">
146 <el-col :span="12"> 146 <el-col :span="12">
147 - <el-form-item label="获得证书" prop="post"> 147 + <el-form-item label="获得证书" prop="certificate">
148 <el-input v-model="ruleForm.certificate" :readonly="isAdmin()"></el-input> 148 <el-input v-model="ruleForm.certificate" :readonly="isAdmin()"></el-input>
149 </el-form-item> 149 </el-form-item>
150 </el-col> 150 </el-col>
@@ -167,57 +167,58 @@ @@ -167,57 +167,58 @@
167 </el-form> 167 </el-form>
168 168
169 169
170 -  
171 - <!--工作简历表格-->  
172 - <div class="title" style="padding-left: 0px">  
173 - <i class="iconfont icon-icon--yingbing" /> 工作简历信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','work')" plain>新增</el-button>  
174 - </div>  
175 - <el-table border :data="workInfoTableData" stripe style="width: 100%" >  
176 - <el-table-column label="序号" type="index" width="100" align="center"/>  
177 - <el-table-column prop="place" align="center" label="工作单位" />  
178 - <el-table-column prop="position" align="center" label="职位" />  
179 - <el-table-column prop="startDate" align="center" label="入职日期" />  
180 - <el-table-column prop="endDate" align="center" label="离职日期" />  
181 - <el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >  
182 - <template #default="scope">  
183 - <div class="list-handle"> 170 + <div v-if="showMore">
  171 + <!--工作简历表格-->
  172 + <div class="title" style="padding-left: 0px">
  173 + <i class="iconfont icon-icon--yingbing" /> 工作简历信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','work')" plain>新增</el-button>
  174 + </div>
  175 + <el-table border :data="workInfoTableData" stripe style="width: 100%" >
  176 + <el-table-column label="序号" type="index" width="100" align="center"/>
  177 + <el-table-column prop="place" align="center" label="工作单位" />
  178 + <el-table-column prop="position" align="center" label="职位" />
  179 + <el-table-column prop="startDate" align="center" label="入职日期" />
  180 + <el-table-column prop="endDate" align="center" label="离职日期" />
  181 + <el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >
  182 + <template #default="scope">
  183 + <div class="list-handle">
184 <span class="icon-bg"> 184 <span class="icon-bg">
185 <i class="el-icon-delete" title="删除" @click="deleteByType(scope.row,'work')"></i> 185 <i class="el-icon-delete" title="删除" @click="deleteByType(scope.row,'work')"></i>
186 </span> 186 </span>
187 - <span class="icon-bg"> 187 + <span class="icon-bg">
188 <i class="el-icon-edit-outline" title="修改" @click="updateFamilyOrWorkInfo(scope.row,'work')"></i> 188 <i class="el-icon-edit-outline" title="修改" @click="updateFamilyOrWorkInfo(scope.row,'work')"></i>
189 </span> 189 </span>
190 - </div>  
191 - </template>  
192 - </el-table-column>  
193 - </el-table> 190 + </div>
  191 + </template>
  192 + </el-table-column>
  193 + </el-table>
194 194
195 - <!--家庭成员表格-->  
196 - <div class="title" style="margin-top: 10px;padding-left: 0px">  
197 - <i class="iconfont icon-icon--yingbing" /> 家庭成员信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','family')" plain>新增</el-button>  
198 - </div>  
199 - <el-table border :data="familyInfoTableData" stripe style="width: 100%" >  
200 - <el-table-column label="序号" type="index" width="100" align="center"/>  
201 - <el-table-column prop="name" align="center" label="成员姓名" />  
202 - <el-table-column prop="appellation" align="center" label="称谓" />  
203 - <el-table-column prop="place" align="center" label="工作单位" />  
204 - <el-table-column prop="position" align="center" label="职位" />  
205 - <el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >  
206 - <template #default="scope">  
207 - <div class="list-handle"> 195 + <!--家庭成员表格-->
  196 + <div class="title" style="margin-top: 10px;padding-left: 0px">
  197 + <i class="iconfont icon-icon--yingbing" /> 家庭成员信息 <el-button v-show="!isAdmin()" type="primary" size="small" @click="addFamilyInfo('新增','family')" plain>新增</el-button>
  198 + </div>
  199 + <el-table border :data="familyInfoTableData" stripe style="width: 100%" >
  200 + <el-table-column label="序号" type="index" width="100" align="center"/>
  201 + <el-table-column prop="name" align="center" label="成员姓名" />
  202 + <el-table-column prop="appellation" align="center" label="称谓" />
  203 + <el-table-column prop="place" align="center" label="工作单位" />
  204 + <el-table-column prop="position" align="center" label="职位" />
  205 + <el-table-column v-if="!isAdmin()" prop="address" align="center" label="操作" width="100" >
  206 + <template #default="scope">
  207 + <div class="list-handle">
208 <span class="icon-bg"> 208 <span class="icon-bg">
209 <i class="el-icon-delete" title="删除" @click="deleteByType(scope.row,'family')"></i> 209 <i class="el-icon-delete" title="删除" @click="deleteByType(scope.row,'family')"></i>
210 </span> 210 </span>
211 - <span class="icon-bg"> 211 + <span class="icon-bg">
212 <i class="el-icon-edit-outline" title="修改" @click="updateFamilyOrWorkInfo(scope.row,'family')"></i> 212 <i class="el-icon-edit-outline" title="修改" @click="updateFamilyOrWorkInfo(scope.row,'family')"></i>
213 </span> 213 </span>
214 - </div>  
215 - </template>  
216 - </el-table-column>  
217 - </el-table> 214 + </div>
  215 + </template>
  216 + </el-table-column>
  217 + </el-table>
  218 + </div>
218 </div> 219 </div>
219 <!--资产信息--> 220 <!--资产信息-->
220 - <div class="title"> 221 + <div class="title" v-if="showMore">
221 <i class="iconfont icon-liebiaomoshi"/> 资产信息 222 <i class="iconfont icon-liebiaomoshi"/> 资产信息
222 <el-dropdown v-if="Object.keys(icon).length > 0 && !isAdmin()" size="mini" split-button @click="assetsAdd('bastion',`新建${icon['bastion'].name}资产`)" style="margin-left: 20px"> 223 <el-dropdown v-if="Object.keys(icon).length > 0 && !isAdmin()" size="mini" split-button @click="assetsAdd('bastion',`新建${icon['bastion'].name}资产`)" style="margin-left: 20px">
223 <i class="icon el-icon-plus"/>添加{{icon['bastion'].name}} 224 <i class="icon el-icon-plus"/>添加{{icon['bastion'].name}}
@@ -12,19 +12,19 @@ const assets = (props, {attrs, slots, emit}) => { @@ -12,19 +12,19 @@ const assets = (props, {attrs, slots, emit}) => {
12 12
13 //查询资产类型列表 13 //查询资产类型列表
14 let getAssetType = () => { 14 let getAssetType = () => {
15 - if(Object.keys(icon.value).length > 0){ 15 + if (Object.keys(icon.value).length > 0) {
16 return; 16 return;
17 } 17 }
18 proxy.$http.post(`/api-web/manage/ddic/findSucDdics/OPS_SECOND_PROPERTY`, {}, function (res) { 18 proxy.$http.post(`/api-web/manage/ddic/findSucDdics/OPS_SECOND_PROPERTY`, {}, function (res) {
19 if (res && res.data.length > 0) { 19 if (res && res.data.length > 0) {
20 icon.value = {}; 20 icon.value = {};
21 - res.data.forEach(function(item, index, arr){ 21 + res.data.forEach(function (item, index, arr) {
22 let code = item.ddicCode; 22 let code = item.ddicCode;
23 let obj = {}; 23 let obj = {};
24 // code = code.substring(code.lastIndexOf("_") + 1, code.length).toLowerCase(); 24 // code = code.substring(code.lastIndexOf("_") + 1, code.length).toLowerCase();
25 - obj.name=item.ddicName;  
26 - obj.icon=item.ddicDesc;  
27 - icon.value[code] =obj; 25 + obj.name = item.ddicName;
  26 + obj.icon = item.ddicDesc;
  27 + icon.value[code] = obj;
28 }); 28 });
29 } 29 }
30 }); 30 });
@@ -42,15 +42,14 @@ const assets = (props, {attrs, slots, emit}) => { @@ -42,15 +42,14 @@ const assets = (props, {attrs, slots, emit}) => {
42 let assetsAdd = (type, msg) => { 42 let assetsAdd = (type, msg) => {
43 proxy.$http.get(`/api-web/person/assets/typeList/${type}`, {}, function (res) { 43 proxy.$http.get(`/api-web/person/assets/typeList/${type}`, {}, function (res) {
44 if (res && res.data && res.data.length > 0) { 44 if (res && res.data && res.data.length > 0) {
45 - btnClick('add',res.data,msg); 45 + btnClick('add', res.data, msg);
46 } else { 46 } else {
47 - proxy.$global.showMsg("没有配置属性!","warning"); 47 + proxy.$global.showMsg("没有配置属性!", "warning");
48 } 48 }
49 }); 49 });
50 } 50 }
51 51
52 52
53 -  
54 /** 53 /**
55 * 新增资产 54 * 新增资产
56 * <p> 55 * <p>
@@ -72,13 +71,13 @@ const assets = (props, {attrs, slots, emit}) => { @@ -72,13 +71,13 @@ const assets = (props, {attrs, slots, emit}) => {
72 data = arr; 71 data = arr;
73 } 72 }
74 73
75 - data.map(function (v){ 74 + data.map(function (v) {
76 let str = v.extend; 75 let str = v.extend;
77 - if(str){ 76 + if (str) {
78 try { 77 try {
79 let json = JSON.parse(str); 78 let json = JSON.parse(str);
80 v.extend = json; 79 v.extend = json;
81 - }catch (e){ 80 + } catch (e) {
82 } 81 }
83 } 82 }
84 }) 83 })
@@ -92,12 +91,12 @@ const assets = (props, {attrs, slots, emit}) => { @@ -92,12 +91,12 @@ const assets = (props, {attrs, slots, emit}) => {
92 } 91 }
93 92
94 93
95 - let checkAssets = () =>{ 94 + let checkAssets = () => {
96 let data = btnType.value.data; 95 let data = btnType.value.data;
97 let size = 0; 96 let size = 0;
98 - data.forEach(function (v){  
99 - if( !v.value || v.value == '' || v.value == null){  
100 - size ++; 97 + data.forEach(function (v) {
  98 + if (!v.value || v.value == '' || v.value == null) {
  99 + size++;
101 } 100 }
102 }) 101 })
103 102
@@ -112,15 +111,15 @@ const assets = (props, {attrs, slots, emit}) => { @@ -112,15 +111,15 @@ const assets = (props, {attrs, slots, emit}) => {
112 */ 111 */
113 let addAssets = () => { 112 let addAssets = () => {
114 let data = btnType.value.data 113 let data = btnType.value.data
115 - data.map(function (v){ 114 + data.map(function (v) {
116 v.extend = JSON.stringify(v.extend); 115 v.extend = JSON.stringify(v.extend);
117 }) 116 })
118 117
119 - if(checkAssets()){  
120 - proxy.$global.showMsg(`请填写资产信息,不能全部为空!`,'warning'); 118 + if (checkAssets()) {
  119 + proxy.$global.showMsg(`请填写资产信息,不能全部为空!`, 'warning');
121 return; 120 return;
122 } 121 }
123 - proxy.$http.post(`/api-web/person/assets/add/${props.parentNode.id}`,data , function (res) { 122 + proxy.$http.post(`/api-web/person/assets/add/${props.parentNode.id}`, data, function (res) {
124 if (res && res.success) { 123 if (res && res.success) {
125 proxy.$global.showMsg("添加成功"); 124 proxy.$global.showMsg("添加成功");
126 showDialog(false); 125 showDialog(false);
@@ -138,12 +137,12 @@ const assets = (props, {attrs, slots, emit}) => { @@ -138,12 +137,12 @@ const assets = (props, {attrs, slots, emit}) => {
138 */ 137 */
139 let saveAssets = () => { 138 let saveAssets = () => {
140 let data = btnType.value.data 139 let data = btnType.value.data
141 - data.map(function (v){ 140 + data.map(function (v) {
142 v.extend = JSON.stringify(v.extend); 141 v.extend = JSON.stringify(v.extend);
143 }) 142 })
144 143
145 - if(checkAssets()){  
146 - proxy.$global.showMsg(`请填写资产信息,不能全部为空!`,'warning'); 144 + if (checkAssets()) {
  145 + proxy.$global.showMsg(`请填写资产信息,不能全部为空!`, 'warning');
147 return; 146 return;
148 } 147 }
149 proxy.$http.post(`/api-web/person/assets/edit/${props.parentNode.id}`, data, function (res) { 148 proxy.$http.post(`/api-web/person/assets/edit/${props.parentNode.id}`, data, function (res) {
@@ -162,12 +161,12 @@ const assets = (props, {attrs, slots, emit}) => { @@ -162,12 +161,12 @@ const assets = (props, {attrs, slots, emit}) => {
162 * 时间:2021/11/3 20:14 161 * 时间:2021/11/3 20:14
163 */ 162 */
164 let deleteAssets = (arr) => { 163 let deleteAssets = (arr) => {
165 - proxy.$global.confirm(`您确认永久删除该资产信息吗?`,function (){ 164 + proxy.$global.confirm(`您确认永久删除该资产信息吗?`, function () {
166 proxy.$http.post(`/api-web/person/assets/delete/${props.parentNode.id}`, arr, function (res) { 165 proxy.$http.post(`/api-web/person/assets/delete/${props.parentNode.id}`, arr, function (res) {
167 if (res && res.success) { 166 if (res && res.success) {
168 proxy.$global.showMsg("删除成功"); 167 proxy.$global.showMsg("删除成功");
169 } else { 168 } else {
170 - proxy.$global.showMsg("删除失败,资产不存在或者已被删除!","error"); 169 + proxy.$global.showMsg("删除失败,资产不存在或者已被删除!", "error");
171 } 170 }
172 showDialog(false); 171 showDialog(false);
173 getAssets(); 172 getAssets();
@@ -185,7 +184,11 @@ const assets = (props, {attrs, slots, emit}) => { @@ -185,7 +184,11 @@ const assets = (props, {attrs, slots, emit}) => {
185 * 时间:2021/11/3 20:17 184 * 时间:2021/11/3 20:17
186 */ 185 */
187 let showDialog = (flg) => { 186 let showDialog = (flg) => {
188 - op.value = flg; 187 + if (!props.isAdd) {
  188 + op.value = flg;
  189 + } else {
  190 + proxy.$global.showMsg("请先添加用户!", "error");
  191 + }
189 } 192 }
190 193
191 let okFunc = () => { 194 let okFunc = () => {
@@ -233,22 +236,27 @@ export default { @@ -233,22 +236,27 @@ export default {
233 type: String, 236 type: String,
234 default: '' 237 default: ''
235 }, 238 },
  239 + isAdd: {
  240 + type: Boolean,
  241 + default: false
  242 + }
236 }, 243 },
237 data() { 244 data() {
238 - return {  
239 - } 245 + return {}
240 }, 246 },
241 setup(props, {attrs, slots, emit}) { 247 setup(props, {attrs, slots, emit}) {
242 let height = Vue.ref(window.innerHeight - 130); 248 let height = Vue.ref(window.innerHeight - 130);
  249 + //判定是否展示家庭成员、工作简历级资产列表
  250 + let showMore = Vue.ref(false);
243 251
244 const {proxy} = Vue.getCurrentInstance(); 252 const {proxy} = Vue.getCurrentInstance();
245 let imageUrl = Vue.ref(''); 253 let imageUrl = Vue.ref('');
246 - const familyInfoTableData=Vue.ref([]); 254 + const familyInfoTableData = Vue.ref([]);
247 // 家庭成员信息弹框显示标识 255 // 家庭成员信息弹框显示标识
248 let familyDiaShow = Vue.ref(false); 256 let familyDiaShow = Vue.ref(false);
249 //家庭成员信息弹框标题 257 //家庭成员信息弹框标题
250 let familyDiaTitle = Vue.ref(''); 258 let familyDiaTitle = Vue.ref('');
251 - const workInfoTableData=Vue.ref([]); 259 + const workInfoTableData = Vue.ref([]);
252 // 简历信息弹框显示标识 260 // 简历信息弹框显示标识
253 let workDiaShow = Vue.ref(false); 261 let workDiaShow = Vue.ref(false);
254 //简历信息弹框标题 262 //简历信息弹框标题
@@ -265,21 +273,21 @@ export default { @@ -265,21 +273,21 @@ export default {
265 company: '', 273 company: '',
266 headImgUrl: '', 274 headImgUrl: '',
267 post: '', 275 post: '',
268 - projectId: null, 276 + // projectId: null,
269 quitTime: '', 277 quitTime: '',
270 state: '', 278 state: '',
271 - idcard:'',  
272 - politicsStatus:'',  
273 - hasProof:'', //是否有无犯罪证明 joke add 20221012  
274 - nativePlace:'', //籍贯 joke add 20221012  
275 - birthday:'', //出生日期 joke add 20221012  
276 - partyDate:'', //入党日期 joke add 20221012  
277 - responsibility:'' //岗位职责 joke add 20221012 279 + idcard: '',
  280 + politicsStatus: '',
  281 + hasProof: '', //是否有无犯罪证明 joke add 20221012
  282 + nativePlace: '', //籍贯 joke add 20221012
  283 + birthday: '', //出生日期 joke add 20221012
  284 + partyDate: '', //入党日期 joke add 20221012
  285 + responsibility: '' //岗位职责 joke add 20221012
278 }) 286 })
279 287
280 let familyInfoForm = Vue.ref({ 288 let familyInfoForm = Vue.ref({
281 - id:'',  
282 - personId:props.parentNode.id, //用户id 289 + id: '',
  290 + personId: props.parentNode.id, //用户id
283 name: '', //家庭成员姓名 291 name: '', //家庭成员姓名
284 appellation: '', //家庭成员称谓 292 appellation: '', //家庭成员称谓
285 place: '', //家庭成员工作单位 293 place: '', //家庭成员工作单位
@@ -289,8 +297,8 @@ export default { @@ -289,8 +297,8 @@ export default {
289 let familyInfoFormRef = Vue.ref(''); 297 let familyInfoFormRef = Vue.ref('');
290 298
291 let workInfoForm = Vue.ref({ 299 let workInfoForm = Vue.ref({
292 - id:'',  
293 - personId:props.parentNode.id, //用户id 300 + id: '',
  301 + personId: props.parentNode.id, //用户id
294 place: '', //工作单位 302 place: '', //工作单位
295 position: '', //职位 303 position: '', //职位
296 startDate: '', //入职日期 304 startDate: '', //入职日期
@@ -307,6 +315,10 @@ export default { @@ -307,6 +315,10 @@ export default {
307 }, function (res) { 315 }, function (res) {
308 if (res && res.object) { 316 if (res && res.object) {
309 ruleForm.value = res.object 317 ruleForm.value = res.object
  318 + //如果为新录入,则屏蔽部分页面(家庭成员、工作经历、获得奖励及资产信息)
  319 + if (res.object.id != null && res.object.id != '') {
  320 + showMore.value = true;
  321 + }
310 proxy.familyInfoTableData = res.object.familyInfoList; 322 proxy.familyInfoTableData = res.object.familyInfoList;
311 proxy.workInfoTableData = res.object.workExperienceList; 323 proxy.workInfoTableData = res.object.workExperienceList;
312 } else { 324 } else {
@@ -318,28 +330,48 @@ export default { @@ -318,28 +330,48 @@ export default {
318 imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}` 330 imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}`
319 } 331 }
320 332
  333 + let refreshTable = () => {
  334 + proxy.$http.get("/api-web/bOpsPerson/search", {
  335 + "nickname": props.parentNode.label,
  336 + "id": props.parentNode.id,
  337 + "projectId": props.projectId
  338 + }, function (res) {
  339 + if (res && res.object) {
  340 + //如果为新录入,则屏蔽部分页面(家庭成员、工作经历、获得奖励及资产信息)
  341 + if (res.object.id != null && res.object.id != '') {
  342 + showMore.value = true;
  343 + }
  344 + proxy.familyInfoTableData = res.object.familyInfoList;
  345 + proxy.workInfoTableData = res.object.workExperienceList;
  346 + }
  347 + });
  348 +
  349 + //图片回显
  350 + imageUrl.value = `${sessionStorage.getItem('domainName')}/api-web/bOpsPerson/downloadFile?id=${props.parentNode.id}&access_token=${localStorage.getItem('access_token')}`
  351 + }
  352 +
321 //点击家庭成员信息的新增按钮事件 353 //点击家庭成员信息的新增按钮事件
322 - let showDiaByType = (flg,type) =>{  
323 - if (type === 'family'){ 354 + let showDiaByType = (flg, type) => {
  355 + if (type === 'family') {
324 //展示新增或编辑页面 356 //展示新增或编辑页面
325 familyDiaShow.value = flg; 357 familyDiaShow.value = flg;
326 - if (flg === false){ 358 + if (flg === false) {
327 familyInfoForm.value = { 359 familyInfoForm.value = {
328 - id:'',  
329 - personId:props.parentNode.id, //用户id 360 + id: '',
  361 + personId: props.parentNode.id, //用户id
330 name: '', //家庭成员姓名 362 name: '', //家庭成员姓名
331 appellation: '', //家庭成员称谓 363 appellation: '', //家庭成员称谓
332 place: '', //家庭成员工作单位 364 place: '', //家庭成员工作单位
333 position: '', //家庭成员职位 365 position: '', //家庭成员职位
334 } 366 }
335 } 367 }
336 - }else if (type === 'work'){ 368 + } else if (type === 'work') {
337 //展示新增或编辑页面 369 //展示新增或编辑页面
338 workDiaShow.value = flg; 370 workDiaShow.value = flg;
339 - if (flg === false){ 371 + if (flg === false) {
340 workInfoForm.value = { 372 workInfoForm.value = {
341 - id:'',  
342 - personId:props.parentNode.id, //用户id 373 + id: '',
  374 + personId: props.parentNode.id, //用户id
343 place: '', //工作单位 375 place: '', //工作单位
344 position: '', //职位 376 position: '', //职位
345 startDate: '', //入职日期 377 startDate: '', //入职日期
@@ -349,42 +381,42 @@ export default { @@ -349,42 +381,42 @@ export default {
349 } 381 }
350 } 382 }
351 383
352 - let seTitleByType = (name,type) => {  
353 - if (type === 'family'){ 384 + let seTitleByType = (name, type) => {
  385 + if (type === 'family') {
354 familyDiaTitle.value = name + '家庭成员'; 386 familyDiaTitle.value = name + '家庭成员';
355 - }else if (type === 'work'){ 387 + } else if (type === 'work') {
356 workDiaTitle.value = name + '工作经历'; 388 workDiaTitle.value = name + '工作经历';
357 } 389 }
358 } 390 }
359 391
360 //点击家庭成员新增按钮 392 //点击家庭成员新增按钮
361 - let addFamilyInfo = (name,type) => {  
362 - showDiaByType(true,type);  
363 - seTitleByType(name,type); 393 + let addFamilyInfo = (name, type) => {
  394 + showDiaByType(true, type);
  395 + seTitleByType(name, type);
364 } 396 }
365 //点击修改按钮 397 //点击修改按钮
366 - let updateFamilyOrWorkInfo = (row,type) => { 398 + let updateFamilyOrWorkInfo = (row, type) => {
367 //获取数据 399 //获取数据
368 - if (type === 'family'){ 400 + if (type === 'family') {
369 familyInfoForm.value = { 401 familyInfoForm.value = {
370 - id:row.id,  
371 - personId:props.parentNode.id, //用户id 402 + id: row.id,
  403 + personId: props.parentNode.id, //用户id
372 name: row.name, //家庭成员姓名 404 name: row.name, //家庭成员姓名
373 appellation: row.appellation, //家庭成员称谓 405 appellation: row.appellation, //家庭成员称谓
374 place: row.place, //家庭成员工作单位 406 place: row.place, //家庭成员工作单位
375 position: row.position, //家庭成员职位 407 position: row.position, //家庭成员职位
376 } 408 }
377 - }else if (type === 'work'){ 409 + } else if (type === 'work') {
378 workInfoForm.value = { 410 workInfoForm.value = {
379 - id:row.id,  
380 - personId:props.parentNode.id, //用户id 411 + id: row.id,
  412 + personId: props.parentNode.id, //用户id
381 place: row.place, //工作单位 413 place: row.place, //工作单位
382 position: row.position, //职位 414 position: row.position, //职位
383 startDate: row.startDate, //入职日期 415 startDate: row.startDate, //入职日期
384 endDate: row.endDate, //离职日期 416 endDate: row.endDate, //离职日期
385 } 417 }
386 } 418 }
387 - addFamilyInfo('编辑',type); 419 + addFamilyInfo('编辑', type);
388 } 420 }
389 421
390 /** 422 /**
@@ -394,13 +426,13 @@ export default { @@ -394,13 +426,13 @@ export default {
394 * @param callback 426 * @param callback
395 * @returns {*} 427 * @returns {*}
396 */ 428 */
397 - const checkTel= (rule, value, callback) => {  
398 - var re1=/^0\d{2}-[1-9]\d{7}$/;  
399 - var re2=/^0\d{3}-[1-9]\{6,7}$/;  
400 - var result=re1.test(value)||re2.test(value); 429 + const checkTel = (rule, value, callback) => {
  430 + var re1 = /^0\d{2}-[1-9]\d{7}$/;
  431 + var re2 = /^0\d{3}-[1-9]\{6,7}$/;
  432 + var result = re1.test(value) || re2.test(value);
401 if (!result && value) { 433 if (!result && value) {
402 return callback(new Error('请输入正确的座机号!')) 434 return callback(new Error('请输入正确的座机号!'))
403 - }else{ 435 + } else {
404 callback() 436 callback()
405 } 437 }
406 } 438 }
@@ -411,18 +443,18 @@ export default { @@ -411,18 +443,18 @@ export default {
411 * @param callback 443 * @param callback
412 * @returns {*} 444 * @returns {*}
413 */ 445 */
414 - const checkPhone= (rule, tel, callback) => {  
415 - var mobile = /^1[0-9]\d{9}$/; 446 + const checkPhone = (rule, tel, callback) => {
  447 + var mobile = /^1[0-9]\d{9}$/;
416 if (tel != '' && !mobile.test(tel)) { 448 if (tel != '' && !mobile.test(tel)) {
417 callback(new Error('请输入正确的手机号!')) 449 callback(new Error('请输入正确的手机号!'))
418 } else { 450 } else {
419 callback(); 451 callback();
420 } 452 }
421 } 453 }
422 - const checkIdCard=(rule, idCard, callback) => { 454 + const checkIdCard = (rule, idCard, callback) => {
423 var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; 455 var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
424 if (idCard != '' && !pattern.test(idCard)) { 456 if (idCard != '' && !pattern.test(idCard)) {
425 - callback(new Error('身份证校验失败!')); 457 + callback(new Error('身份证校验失败!'));
426 } else { 458 } else {
427 callback(); 459 callback();
428 } 460 }
@@ -436,45 +468,62 @@ export default { @@ -436,45 +468,62 @@ export default {
436 * @author LH 468 * @author LH
437 * 表单规则校验 469 * 表单规则校验
438 */ 470 */
439 - let rules=Vue.ref({ 471 + let rules = Vue.ref({
440 nickname: [ 472 nickname: [
441 - { message: '请输入姓名', trigger: 'blur' } 473 + {required: true, message: '请输入姓名', trigger: 'blur'}
  474 + ],
  475 + sex: [
  476 + {required: true, message: '请选择性别', trigger: 'blur'}
442 ], 477 ],
443 phone: [ 478 phone: [
444 - { validator: checkPhone, trigger: 'blur' } 479 + {required: true, message: '请输入手机号', trigger: 'blur'},
  480 + {validator: checkPhone,message: '请输入正确的手机号' , trigger: 'blur'}
445 ], 481 ],
446 company: [ 482 company: [
447 - { message:'请输入所在公司', trigger: 'blur' } 483 + {required: true, message: '请输入所在公司', trigger: 'blur'}
448 ], 484 ],
449 idcard: [ 485 idcard: [
450 - { validator:checkIdCard,message:'请输入正确的身份证号', trigger: 'blur'} 486 + {required: true, message: '请输入身份证号', trigger: 'blur'},
  487 + {validator: checkIdCard, message: '请输入正确的身份证号', trigger: 'blur'}
  488 + ],
  489 + entryTime: [
  490 + {required: true, message: '请选择入职时间', trigger: 'blur'}
  491 + ],
  492 + state: [
  493 + {required: true, message: '请选择在职状态', trigger: 'blur'}
  494 + ],
  495 + university: [
  496 + {required: true, message: '请输入毕业院校', trigger: 'blur'}
  497 + ],
  498 + education: [
  499 + {required: true, message: '请输入学历', trigger: 'blur'}
451 ] 500 ]
452 }); 501 });
453 502
454 let familyOrWorkRules = Vue.ref({ 503 let familyOrWorkRules = Vue.ref({
455 name: [ 504 name: [
456 - { required: true, message: '请输入姓名' },  
457 - { message: '请输入姓名', trigger: 'blur' } 505 + {required: true, message: '请输入姓名'},
  506 + {message: '请输入姓名', trigger: 'blur'}
458 ], 507 ],
459 appellation: [ 508 appellation: [
460 - { required: true, message: '请输入称谓' },  
461 - { message: '请输入称谓', trigger: 'blur' } 509 + {required: true, message: '请输入称谓'},
  510 + {message: '请输入称谓', trigger: 'blur'}
462 ], 511 ],
463 place: [ 512 place: [
464 - { required: true, message: '请输入工作单位' },  
465 - { message: '请输入工作单位', trigger: 'blur' } 513 + {required: true, message: '请输入工作单位'},
  514 + {message: '请输入工作单位', trigger: 'blur'}
466 ], 515 ],
467 position: [ 516 position: [
468 - { required: true, message: '请输入职位' },  
469 - { message: '请输入职位', trigger: 'blur' } 517 + {required: true, message: '请输入职位'},
  518 + {message: '请输入职位', trigger: 'blur'}
470 ], 519 ],
471 startDate: [ 520 startDate: [
472 - { required: true, message: '请选择入职日期' },  
473 - { validator:validatorDate,message:'请选择入职日期', trigger: 'blur'} 521 + {required: true, message: '请选择入职日期'},
  522 + {validator: validatorDate, message: '请选择入职日期', trigger: 'blur'}
474 ], 523 ],
475 endDate: [ 524 endDate: [
476 - { required: true, message: '请选择离职日期' },  
477 - { validator:validatorDate,message:'请选择离职日期', trigger: 'blur'} 525 + {required: true, message: '请选择离职日期'},
  526 + {validator: validatorDate, message: '请选择离职日期', trigger: 'blur'}
478 ], 527 ],
479 }); 528 });
480 529
@@ -485,72 +534,82 @@ export default { @@ -485,72 +534,82 @@ export default {
485 */ 534 */
486 // 保存用户信息 535 // 保存用户信息
487 let saveUser = () => { 536 let saveUser = () => {
488 - proxy.$refs.rule.validate((valid) => {  
489 - if (valid) {  
490 - console.log('submit!!');  
491 - proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {  
492 - if (res && res.code == 0) {  
493 - proxy.$global.showMsg('保存成功!');  
494 - }  
495 - });  
496 - } else {  
497 - console.log('error submit!!');  
498 - return false;  
499 - }  
500 - });  
501 - 537 + if (props.treeNode.map == undefined) {
  538 + proxy.$global.showMsg('请先添加业务', 'warning');
  539 + emit('showPopout', false)
502 } 540 }
  541 + proxy.$refs.rule.validate((valid) => {
  542 + if (valid) {
  543 + console.log('submit!!');
  544 + ruleForm.value.busId = props.treeNode.map.nodeType.projectId;
  545 + proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) {
  546 + if (res && res.code == 0) {
  547 + proxy.$global.showMsg('保存成功!');
  548 + }
  549 + emit('showPopout', false)
  550 + });
  551 + } else {
  552 + console.log('error submit!!');
  553 + return false;
  554 + }
  555 + });
  556 +
  557 + }
503 558
504 - let saveOrUpdateByType = (type,rules) => { 559 + let saveOrUpdateByType = (type, rules) => {
505 let msg = '新增'; 560 let msg = '新增';
506 var data = {}; 561 var data = {};
507 - if (type === 'family'){  
508 - if (familyDiaTitle.value.indexOf('新增') == -1){ //表示编辑 562 + if (type === 'family') {
  563 + if (familyDiaTitle.value.indexOf('新增') == -1) { //表示编辑
509 msg = '编辑'; 564 msg = '编辑';
510 } 565 }
511 data = familyInfoForm.value; 566 data = familyInfoForm.value;
512 - }else if (type === 'work'){  
513 - if (workDiaTitle.value.indexOf('新增') == -1){ //表示编辑 567 + } else if (type === 'work') {
  568 + if (workDiaTitle.value.indexOf('新增') == -1) { //表示编辑
514 msg = '编辑'; 569 msg = '编辑';
515 } 570 }
516 data = workInfoForm.value; 571 data = workInfoForm.value;
517 } 572 }
518 rules.validate((valid) => { 573 rules.validate((valid) => {
519 - if (valid){  
520 - proxy.$http.post("/api-web/bOpsPerson/saveOrUpdateByType?type="+type, data, function (res) { 574 + if (valid) {
  575 + proxy.$http.post("/api-web/bOpsPerson/saveOrUpdateByType?type=" + type, data, function (res) {
521 if (res && res.success == true) { 576 if (res && res.success == true) {
522 - proxy.$global.showMsg(msg +'成功!');  
523 - showDiaByType(false,type);  
524 - getPage(); 577 + proxy.$global.showMsg(msg + '成功!');
  578 + showDiaByType(false, type);
  579 + refreshTable();
525 } 580 }
526 }); 581 });
527 } 582 }
528 }) 583 })
529 } 584 }
530 //删除 585 //删除
531 - let deleteByType = (row,type) => {  
532 - proxy.$http.post("/api-web/bOpsPerson/deleteByType?type="+type+"&ids="+row.id, {}, function (res) { 586 + let deleteByType = (row, type) => {
  587 + proxy.$http.post("/api-web/bOpsPerson/deleteByType?type=" + type + "&ids=" + row.id, {}, function (res) {
533 if (res && res.success == true) { 588 if (res && res.success == true) {
534 proxy.$global.showMsg('删除成功!'); 589 proxy.$global.showMsg('删除成功!');
535 - getPage(); 590 + refreshTable();
536 } 591 }
537 }); 592 });
538 } 593 }
539 594
540 595
541 let getFile = (param) => { 596 let getFile = (param) => {
542 - let fileObj = param.file  
543 - let params = {  
544 - file: fileObj,  
545 - id: props.parentNode.id  
546 - }  
547 - // 上传文件  
548 - proxy.$http.uploadFile("/api-web/bOpsPerson/uploadFile", params, function (res) {  
549 - if (res && res.success) {  
550 - proxy.$global.showMsg("上传成功!"); 597 + if (!props.isAdd) {
  598 + let fileObj = param.file
  599 + let params = {
  600 + file: fileObj,
  601 + id: props.parentNode.id
551 } 602 }
552 - })  
553 - imageUrl.value = URL.createObjectURL(fileObj); 603 + // 上传文件
  604 + proxy.$http.uploadFile("/api-web/bOpsPerson/uploadFile", params, function (res) {
  605 + if (res && res.success) {
  606 + proxy.$global.showMsg("上传成功!");
  607 + }
  608 + })
  609 + imageUrl.value = URL.createObjectURL(fileObj);
  610 + } else {
  611 + proxy.$global.showMsg("请先添加用户!", "error");
  612 + }
554 } 613 }
555 614
556 let beforeAvatarUpload = (file) => { 615 let beforeAvatarUpload = (file) => {
@@ -582,12 +641,16 @@ export default { @@ -582,12 +641,16 @@ export default {
582 getAssetType, 641 getAssetType,
583 icon 642 icon
584 } = assets(props, {attrs, slots, emit}); 643 } = assets(props, {attrs, slots, emit});
585 - 644 + let whether = Vue.ref(true);
586 // // 挂载完 645 // // 挂载完
587 Vue.onMounted(() => { 646 Vue.onMounted(() => {
  647 + if (!props.isAdd) {
  648 + getPage();
  649 + getAssets();
  650 + } else {
  651 + whether.value = false;
  652 + }
588 getAssetType(); 653 getAssetType();
589 - getPage();  
590 - getAssets();  
591 }) 654 })
592 655
593 // 监听编辑状态 656 // 监听编辑状态
@@ -595,6 +658,7 @@ export default { @@ -595,6 +658,7 @@ export default {
595 getAssetType(); 658 getAssetType();
596 getPage(); 659 getPage();
597 getAssets(); 660 getAssets();
  661 + refreshTable();
598 }); 662 });
599 return { 663 return {
600 imageUrl, 664 imageUrl,
@@ -632,7 +696,10 @@ export default { @@ -632,7 +696,10 @@ export default {
632 workInfoForm, 696 workInfoForm,
633 updateFamilyOrWorkInfo, 697 updateFamilyOrWorkInfo,
634 familyOrWorkRules, 698 familyOrWorkRules,
635 - familyInfoFormRef 699 + familyInfoFormRef,
  700 + whether,
  701 + showMore,
  702 + refreshTable
636 } 703 }
637 } 704 }
638 } 705 }
@@ -64,8 +64,10 @@ export default { @@ -64,8 +64,10 @@ export default {
64 proxy.$http.get("/api-web/bOpsProject/getTree", params, function (res) { 64 proxy.$http.get("/api-web/bOpsProject/getTree", params, function (res) {
65 if (res && res.data) { 65 if (res && res.data) {
66 dataSource.value = res.data; 66 dataSource.value = res.data;
67 - projectId.value = res.data[0].dataList[0].id;  
68 - treeNode.value = res.data[0]; 67 + if (res.data.length >0){
  68 + projectId.value = res.data[0].dataList[0].id;
  69 + treeNode.value = res.data[0];
  70 + }
69 } else { 71 } else {
70 proxy.$global.showMsg('暂无数据!'); 72 proxy.$global.showMsg('暂无数据!');
71 } 73 }