1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068 |
- <!-- 组织架构模块 添加船舶页面 -->
- <template>
- <div class="box-body"
- v-loading="loading">
- <div class="label-box">
- <span class="label-title">{{ title }}</span>
- <div class="button-float">
- <el-button v-if="!id"
- type="primary"
- @click="save('ruleForm', false)">保存并继续新建</el-button>
- <el-button type="primary"
- @click="save('ruleForm', true)">保存</el-button>
- <el-button @click="cancel">返回</el-button>
- </div>
- </div>
- <div class="main-list">
- <el-form ref="ruleForm"
- :model="ruleForm"
- :rules="rules"
- class="demo-ruleForm">
- <el-form-item label="中文名"
- prop="staffName">
- <el-input v-model="ruleForm.staffName"
- placeholder="请输入"
- maxlength="20" />
- </el-form-item>
- <el-form-item label="账号"
- v-if="id"
- class="serviceType">
- <span class="tips">
- <svg-icon icon-class="tips" />
- <p>成员唯一标识,可以使用工号、邮箱等<br />公司系统内统一的ID</p>
- </span>
- <el-input v-model="ruleForm.staffAccount"
- maxlength="20"
- placeholder="登录账号唯一标识" />
- </el-form-item>
- <el-form-item label="账号"
- prop="staffAccount"
- class="serviceType"
- v-else>
- <span class="tips">
- <svg-icon icon-class="tips" />
- <p>成员唯一标识,可以使用工号、邮箱等<br />公司系统内统一的ID</p>
- </span>
- <el-input v-model="ruleForm.staffAccount"
- maxlength="20"
- placeholder="登录账号唯一标识" />
- </el-form-item>
- <el-form-item label="修改密码"
- prop="loginPasswordNew"
- v-if="id">
- <el-input clearable
- :type="inputType"
- autocomplete="new-password"
- name="password"
- @focus="changeInputType"
- v-model="ruleForm.loginPasswordNew"
- placeholder="密码任意6位数字,大小写字母,符号组合"
- minlength="6"
- maxlength="20" />
- </el-form-item>
- <el-form-item label="密码"
- prop="loginPassword"
- v-if="!id">
- <el-input clearable
- :type="inputType"
- autocomplete="new-password"
- name="password"
- @focus="changeInputType"
- v-model="ruleForm.loginPassword"
- minlength="6"
- maxlength="20"
- placeholder="密码任意6位数字,大小写字母,符号组合" />
- </el-form-item>
- <el-form-item label="确认密码"
- prop="loginPasswordAgain"
- v-if="
- (id &&
- ruleForm.loginPasswordNew &&
- ruleForm.loginPasswordNew.length > 0) ||
- !id
- ">
- <el-input clearable
- :type="inputType"
- autocomplete="new-password"
- name="password"
- @focus="changeInputType"
- v-model="ruleForm.loginPasswordAgain"
- minlength="6"
- maxlength="20"
- placeholder="请再次确认密码" />
- </el-form-item>
- <el-form-item label="确认密码"
- v-show="
- !(
- (id &&
- ruleForm.loginPasswordNew &&
- ruleForm.loginPasswordNew.length > 0) ||
- !id
- )
- ">
- <el-input clearable
- :type="inputType"
- autocomplete="new-password"
- name="password"
- @focus="changeInputType"
- v-model="ruleForm.loginPasswordAgain"
- minlength="6"
- maxlength="20"
- placeholder="请再次确认密码" />
- </el-form-item>
- <el-form-item label="手机号"
- prop="staffMobilePhone">
- <el-input v-model="ruleForm.staffMobilePhone"
- placeholder="请输入常用手机号" />
- </el-form-item>
- <el-form-item label="公司/部门"
- prop="underCompId"
- class="dept-comp">
- <el-select v-model="ruleForm.underCompId"
- placeholder="请选择"
- @change="changeDept">
- <el-option v-for="item in companyList"
- :key="item.compId"
- :label="item.compName"
- :value="item.compId" />
- </el-select>
- <el-select v-model="ruleForm.deptId"
- placeholder="请选择"
- @change="changeRole">
- <el-option v-for="item in deptList"
- :key="item.deptId"
- :label="item.deptName"
- :value="item.deptId" />
- </el-select>
- </el-form-item>
- </el-form>
- <div class="department">
- <div>
- <span class="star font">职务</span>
- <span class="ontent"
- v-if="zhiwu1.roleName">{{
- zhiwu1.roleName
- }}</span>
- <span class="operaction"
- @click="setwork">设置</span>
- </div>
- <!-- <div class="lastspan">
- <span class="star font">关联船舶</span>
- <div class="ontent"
- style="width: 800px;">
- <span v-for="(item, key) in seleteShipList"
- :key="key"
- v-show="item.vesselId"
- class="ontent shipName">{{ item.vesselName }}</span>
- <span style="padding-left: 4px;"
- class="operaction shipSelectSet"
- @click="setChargeShip">设置</span>
- </div>
- </div> -->
- <div style="display:flex">
- <span class=" font">兼职职务</span>
- <span class="operaction"
- @click="partTimeSetting">设置</span>
- <div class="boxClass">
- <div v-for="(item, index) in jobList"
- :key="index"
- v-show="item.roleId"
- style="margin-bottom: 10px">
- <span class=" aaa">兼职{{ index + 1 }}:{{ item.roleName }}</span>
- <!-- <div class="lastspan">
- <span class="star bbb">关联船舶</span>
- <div class="ontent"
- style="width: 800px;">
- <span v-for="(item, index) in item.asd"
- :key="item.vesselId + index"
- v-show="item.vesselId"
- class="ontent shipName">{{ item.vesselName }}</span>
- <span class="operaction shipSelectSet"
- @click="setUpShip(item)">设置</span>
- </div>
- </div> -->
- </div>
- </div>
- </div>
- </div>
- <div class="uphead">
- <span class="imghead font">上传签名:</span>
- <img :src="
- ruleForm.electronicSignature === ''
- ? url
- : ruleForm.electronicSignature
- "
- class="img" />
- <input type="file"
- class="kyc-passin"
- @change="uploadPhoto($event)" />
- <span class="talk">支持上传jpg/png文件,大小不能超过1M</span>
- </div>
- </div>
- <!-- 主要职务选择 -->
- <el-dialog title="设置成员主职职务"
- :visible.sync="mainJobSelection"
- width="650px"
- center
- :close-on-click-modal="false">
- <div class="checkBoxClass">
- <span class="member">成员将属于以下职务</span>
- <el-radio-group @change="handleCheckAllChanges"
- v-model="post"
- class="postBox">
- <el-radio class="checkBoxCla"
- v-for="(item, key) in data1"
- :key="key"
- :label="item.roleId">{{ item.roleName }}</el-radio>
- </el-radio-group>
- </div>
- <span slot="footer"
- class="dialog-footer">
- <el-button @click="mainJobSelection = false">取 消</el-button>
- <el-button type="primary"
- @click="setMainJob">确 定</el-button>
- </span>
- </el-dialog>
- <!--6.设置成员职务-->
- <el-dialog title="设置兼职职务职务"
- :visible.sync="setDuty"
- width="650px"
- center
- :close-on-click-modal="false">
- <div class="adddepartment">
- <div class="adddepartment1">
- <div v-loading="roleLoading">
- <div class="block">
- <el-tree class="ship-tree"
- :props="props"
- node-key="id"
- :load="loadNode"
- lazy>
- <!-- @change="val => radioGroupChange(data, val, node)" -->
- <template slot-scope="{ node, data }">
- <span v-if="node.level === 2">
- <el-checkbox-group v-model="data.check" @change="val => radioGroupChange(data, val, node)">
- <el-checkbox class="zhiwuChecks"
- v-for="item in data.roid"
- :key="item.roleId"
- :label="item">
- {{ item.roleName }}
- </el-checkbox>
- </el-checkbox-group>
- </span>
- <span v-else>{{ data.deptName }}</span>
- </template>
- </el-tree>
- </div>
- </div>
- </div>
- <div class="adddepartment2">
- <span class="adddepartment4">成员将属于以下职务</span>
- <div class="primaryzw">
- <div class="ciyaozhiwu"
- v-for="(item, index) in jobList"
- :key="index">
- {{ item.roleName }}
- <span class="zhiwuDel"
- @click="delZhiWu(item)">删除</span>
- </div>
- </div>
- </div>
- </div>
- <span slot="footer"
- class="dialog-footer">
- <el-button @click="setDuty = false">取 消</el-button>
- <el-button type="primary"
- @click="setDutysave">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 7.关联船舶 -->
- <el-dialog title="负责船舶"
- :visible.sync="chargeShip"
- width="650px"
- center
- :close-on-click-modal="false">
- <div class="adddepartment">
- <div class="adddepartment1"
- v-loading="loadingVessel">
- <div class="search-box">
- <el-input class="search-keyword"
- v-model.trim="searchKeyword"
- maxlength="50"
- placeholder="请输入船舶名称"
- clearable
- @clear="getClear"
- @keyup.enter.native="getList" />
- <svg-icon icon-class="searchIcon"
- class="searchIcon"
- @click="getList" />
- </div>
- <el-checkbox :indeterminate="isIndeterminate"
- v-model="checkAll"
- @change="handleCheckAllChange">全选</el-checkbox>
- <!--<el-checkbox :indeterminate="isIndeterminate" v-model="checkAntiFlag" @change="checkAnti">反选</el-checkbox>-->
- <el-checkbox-group v-model="shipCheckList"
- @change="handleCheckedCitiesChange">
- <el-checkbox class="zhiwuCheck"
- v-for="(item, index) in shipList"
- :label="item.vesselId"
- :key="item.vesselId + index">
- {{ item.vesselName }}
- </el-checkbox>
- </el-checkbox-group>
- </div>
- <div class="adddepartment2">
- <span class="adddepartment4">成员将属于以下船舶</span>
- <div class="primaryzw">
- <div class="ciyaozhiwu"
- v-for="(item, index) in seleteShipList"
- :key="index">
- {{ item.vesselName }}
- <span class="zhiwuDel"
- @click="delShipSelect(item.vesselId)">删除</span>
- </div>
- </div>
- </div>
- </div>
- <span slot="footer"
- class="dialog-footer">
- <el-button @click="getNowList">取 消</el-button>
- <el-button type="primary"
- @click="saveChargeShip">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 兼职船舶 -->
- <el-dialog title="负责船舶"
- :visible.sync="partTimeJobShip"
- width="650px"
- center
- :close-on-click-modal="false">
- <div class="adddepartment">
- <div class="adddepartment1"
- v-loading="loadingVessel">
- <div class="search-box">
- <el-input class="search-keyword"
- v-model.trim="searchKeyword"
- maxlength="50"
- placeholder="请输入船舶名称"
- clearable
- @clear="getClear"
- @keyup.enter.native="getList" />
- <svg-icon icon-class="searchIcon"
- class="searchIcon"
- @click="getList" />
- </div>
- <el-checkbox :indeterminate="isIndeterminates"
- v-model="checkAll"
- @change="handleCheckAllChangess">全选</el-checkbox>
- <!--<el-checkbox :indeterminate="isIndeterminate" v-model="checkAllAnti" @change="checkAnti">反选</el-checkbox>-->
- <el-checkbox-group v-model="shipCheckLists"
- @change="handleCheckedCitiesChangess">
- <el-checkbox class="zhiwuCheck"
- v-for="(item, index) in shipLists"
- :label="item.vesselId"
- :key="item.vesselId + index">
- {{ item.vesselName }}
- </el-checkbox>
- </el-checkbox-group>
- </div>
- <div class="adddepartment2">
- <span class="adddepartment4">成员将属于以下船舶</span>
- <div class="primaryzw">
- <div class="ciyaozhiwu"
- v-for="(item, index) in seleteShipLists"
- :key="index">
- {{ item.vesselName }}
- <span class="zhiwuDel"
- @click="delShipSelects(item.vesselId)">删除</span>
- </div>
- </div>
- </div>
- </div>
- <span slot="footer"
- class="dialog-footer">
- <el-button @click="cancels">取 消</el-button>
- <el-button type="primary"
- @click="determine">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { addadmin,checkApp } from "../../api/organization/orgAddMan";
- import {
- getOssInterimCredentials,
- GotOssAccessConfig,
- uploadShipFiles
- } from "../../api/upload";
- import { client } from "../../utils/alioss";
- import { validPassword } from "../../utils/validate";
- import shoreApi from "../../api/organization/shore";
- import {
- staffInfo,
- changeInfo,
- saveRole,
- companyVessels,
- getDeptListByCompId
- } from "../../api/shoreBasedMembers";
- const validPasswordRule = function (rule, value, callback) {
- if (value)
- if (!validPassword(value)) {
- callback(
- // this.$message({
- // message: '密码为6到20位数字密码任意组合!',
- // type: 'error'
- // })
- new Error("密码为6到20位数字密码任意组合")
- );
- return;
- } else {
- callback();
- return;
- }
- callback();
- // if (!validPassword(value)) {
- // callback(new Error('密码为6到20位数字密码任意组合'));
- // } else {
- // callback();
- // }
- };
- export default {
- name: "shoreMemberAdd",
- data () {
- const validcodeId = (rule, value, callback) => {
- const reg = /[0-9a-zA-Z]$/;
- if (!reg.test(value)) {
- callback(
- new Error("账号必须是由数字和字母组合")
- // this.$message({
- // type: 'error',
- // message: '账号必须是由数字和字母组合',
- // showClose: true,
- // })
- );
- } else {
- callback();
- }
- };
- const validcodeName = (rule, value, callback) => {
- const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;
- if (!reg.test(value)) {
- callback(
- new Error("密码必须是由6位数字和字母组合")
- // this.$message({
- // type: 'error',
- // message: '密码必须是由6位数字和字母组合',
- // showClose: true,
- // })
- );
- } else {
- callback();
- }
- };
- const validPasswordAgain = (rule, value, callback) => {
- if (value === "") {
- callback(
- this.$message({
- type: "error",
- message: "带*号的为必填项",
- showClose: true
- })
- );
- } else if (
- (value !== this.ruleForm.loginPassword && !this.id) ||
- (value !== this.ruleForm.loginPasswordNew && this.id)
- ) {
- callback(
- this.$message({
- type: "error",
- message: "两次密码不一致",
- showClose: true
- })
- );
- } else {
- callback();
- }
- };
- const validcodePhonee = (rule, value, callback) => {
- const reg = /^1[345789]\d{9}$/;
- if (!reg.test(value)) {
- callback(
- new Error("手机号格式填写错误")
- // this.$message({
- // type: 'error',
- // message: '手机号格式填写错误',
- // showClose: true,
- // })
- );
- } else {
- callback();
- }
- };
- return {
- aaabbb: [],
- postList: [],
- post: "",
- mainJobSelection: false,
- isIndeterminate: false,
- isIndeterminates: false,
- loadingVessel: false,
- checkAll: false,
- checkAntiFlag: false,
- compId: sessionStorage.getItem("enterprise-front-companyId"),
- searchKeyword: "", // 关联船舶 搜索关键词
- datamsg: "",
- title: "",
- /* 页面传递来的数据 */
- checklist: [
- {
- value: ""
- }
- ],
- Department: "",
- Departmentname: "",
- /* 设置部门 */
- checklist1: [
- {
- key: "",
- value: ""
- }
- ],
- Department1: "",
- Departmentname1: "",
- zwmsg: "",
- // 船舶
- checklist2: [],
- /* 设置关联船舶 */
- url:
- "http://winsea-saas-test.oss-cn-shanghai.aliyuncs.com/default-logo.png",
- setUpTheDepartment: false,
- setDuty: false,
- chargeShip: false,
- partTimeJobShip: false,
- loading: false,
- ruleForm: {
- deptId: "",
- staffName: "",
- staffAccount: "",
- loginPassword: "",
- loginPasswordAgain: "",
- loginPasswordAgainNew: "",
- loginPasswordNew: "",
- staffMobilePhone: "",
- electronicSignature: "",
- majorRoleId: "",
- roles: [
- {
- roleId: "",
- major: "1"
- }
- ],
- vessels: [{vesselId:'e88a798337c14cd7b8e0dfe7f9efdf5a',vesselName:'试用船舶'}],
- roleVesselIds: []
- },
- rules: {
- staffAccount: [
- {
- required: true,
- // validator: validcodeId,
- trigger: "blur",
- message: "请输入账号"
- }
- ],
- loginPassword: [
- {
- required: true,
- validator: validcodeName,
- trigger: "blur"
- }
- ],
- loginPasswordAgain: [
- {
- required: true,
- validator: validPasswordAgain,
- trigger: "blur"
- }
- ],
- loginPasswordNew: [
- {
- validator: validPasswordRule,
- trigger: "blur"
- }
- ],
- staffName: [
- {
- required: true,
- trigger: "blur",
- message: "请输入中文名"
- }
- ],
- staffMobilePhone: [
- {
- required: true,
- validator: validcodePhonee,
- trigger: "blur"
- }
- ],
- underCompId: [
- {
- required: true,
- trigger: "change"
- }
- ]
- },
- data: [],
- data5: [],
- data6: [],
- data1: [
- {
- id: "",
- label: "",
- disabled: true,
- children: []
- }
- ],
- shipList: [],
- shipLists: [],
- primaryzw: "1",
- zhiwuCheckList: [],
- zhiwuChec1kList: [],
- zhiwu1: {},
- zhiwu2: [],
- zhiwu11: {},
- shipCheckList: [],
- shipCheckLists: [],
- seleteShipList: [],
- seleteShipLists: [],
- companyList: [],
- deptList: [],
- inputType: "text",
- isChrome: true,
- roleLoading: false,
- id: this.$route.query.id,
- postId: "",
- partTimeJobList: [],
- partTimeDepartmentList: [],
- checkedCities: [],
- props: {
- label: "name",
- children: "children",
- isLeaf: "leaf"
- },
- check: [],
- aaaaaa: [],
- gggg: []
- };
- },
- computed: {
- jobList () {
- let res = [];
- Object.keys(this.check).forEach((value, index) => {
- this.check[value].forEach(ite => {
- console.log(ite,res)
- // if(res.length>0){
- // if(res.every( function( item, index, array ){ return item.roleId!=ite.roleId})){
- // console.log(ite)
- // res.push(ite);
- // }else{
- // console.log(ite)
- // }
- // }else{
- res.push(ite);
- // }
- });
- });
- let _a = res.filter(v => v);
- _a.forEach(v => {
- if (v.asd === undefined) v.asd = [];
- });
- return _a;
- }
- },
- created () {
- this.baseInfo();
- },
- methods: {
- async loadNode (node, resolve) {
- if (node.level === 0) {
- // 发起一级请求
- return resolve(this.partTimeDepartmentList);
- }
- if (node.level === 1) {
- // 发起二级请求
- let uuid = node.data.deptId;
- let response = await shoreApi.queryRoleSelectData({
- vesselBankFlag: "B",
- underCompId: this.ruleForm.underCompId,
- deptId: uuid
- });
- this.partTimeJobList = response;
- if (this.partTimeJobList !== null)
- this.partTimeJobList = this.partTimeJobList.map(itemA => {
- return {
- ...itemA,
- deptId: uuid
- };
- });
- let _check = [];
- for (let variable of this.partTimeJobList) {
- let curr;
- for (let variable2 of this.jobList) {
- if (variable.roleId === variable2.roleId) curr = variable;
- }
- if (curr) {
- _check.push(curr);
- // break;
- }
- }
- this.jobList.forEach(item => {
- item.asd.forEach(itemA => {
- _check.forEach(itemB => {
- if (item.deptId === itemB.deptId)
- if (itemB.asd === undefined) {
- itemB.asd = [];
- } else {
- itemB.asd.push(itemA);
- }
- });
- });
- });
- this.aaabbb[uuid] = _check;
- return resolve([
- {
- id: node.data.deptId,
- roid: this.partTimeJobList,
- check: _check,
- leaf: true
- }
- ]);
- }
- if (node.level > 1) {
- return resolve([]);
- }
- },
- radioGroupChange (data, val, node) {
- this.check=[]
- for (let i = 0; i < val.length; i++) {
- data.id=val[i].deptId+'_'+val[i].roleId
- this.$set(this.check, data.id, [val[i]]);
- }
- // console.log(this.check)
- this.aaabbb[data.id] = val;
- },
- //tree
- remove (node, data) {
- // const parent = node.parent;
- // const children = parent.data.children || parent.data;
- // const index = children.findIndex(d => d.id === data.id);
- // children.splice(index, 1);
- },
- // 取消
- cancels () {
- this.partTimeJobShip = false;
- // this.ruleForm.roleVesselIds = [];
- // this.jobList.forEach(item => {
- // item.asd.forEach(ite => {
- // this.ruleForm.roleVesselIds.push(item.roleId + "_" + ite.vesselId);
- // });
- // });
- },
- // 确定
- determine () {
- this.partTimeJobShip = false;
- this.ruleForm.roleVesselIds = [];
- this.jobList.forEach(item => {
- item.asd.forEach(ite => {
- this.ruleForm.roleVesselIds.push(item.roleId + "_" + ite.vesselId);
- });
- });
- },
- append (data) {
- const newChild = { id: id++, label: "testtest", children: [] };
- if (!data.children) {
- this.$set(data, "children", []);
- }
- data.children.push(newChild);
- },
- getList () {
- // 船舶
- shoreApi
- .getVessels({ searchKeyword: this.searchKeyword })
- .then(response => {
- this.shipList = response;
- this.shipLists = response;
- let _isIndeterminate = false;
- this.shipList.forEach(v => {
- this.seleteShipList.forEach(v2 => {
- if (v2.vesselId === v.vesselId) _isIndeterminate = true;
- });
- });
- this.shipLists.forEach(v => {
- this.seleteShipList.forEach(v2 => {
- if (v2.vesselId === v.vesselId) _isIndeterminate = true;
- });
- });
- this.isIndeterminate = _isIndeterminate;
- this.isIndeterminates = _isIndeterminate;
- let _checkAll = false;
- let selectMum = 0;
- this.shipList.forEach(v => {
- this.seleteShipList.forEach(v2 => {
- if (v2.vesselId === v.vesselId) selectMum++;
- });
- });
- this.shipLists.forEach(v => {
- this.seleteShipList.forEach(v2 => {
- if (v2.vesselId === v.vesselId) selectMum++;
- });
- });
- if (this.shipList.length === selectMum) {
- _checkAll = true;
- this.isIndeterminate = false;
- } else {
- _checkAll = false;
- }
- if (this.shipLists.length === selectMum) {
- _checkAll = true;
- this.isIndeterminates = false;
- } else {
- _checkAll = false;
- }
- this.checkAll = _checkAll;
- });
- },
- getClear () {
- this.searchKeyword = null;
- this.getList();
- },
- //反选
- checkAnti (val) {
- // console.log(val,'反选')
- this.checkAll = !val;
- // if(val){
- // this.checkAll = false;
- // }
- let citiesId = [];
- let shipCheck = [];
- this.shipList.forEach(item => {
- citiesId.push({ vesselId: item.vesselId, vesselName: item.vesselName });
- shipCheck.push(item.vesselId);
- });
- if (this.shipCheckList.length === this.shipList.length) {
- this.isIndeterminate = false;
- this.shipCheckList = [];
- this.seleteShipList = [];
- } else if (this.shipCheckList.length === 0) {
- this.isIndeterminate = false;
- this.shipCheckList = shipCheck;
- this.seleteShipList = citiesId;
- }
- },
- // 关联船舶全选
- handleCheckAllChange (val) {
- if (val) {
- this.checkAntiFlag = false;
- }
- // this.checkAntiFlag = !val;
- // console.log(val,'正选')
- let citiesId = [];
- let shipCheck = [];
- this.shipList.forEach(item => {
- citiesId.push({ vesselId: item.vesselId, vesselName: item.vesselName });
- shipCheck.push(item.vesselId);
- });
- this.shipCheckList = val ? shipCheck : [];
- this.seleteShipList = val ? citiesId : [];
- this.isIndeterminate = false;
- },
- // 关联船舶单选
- handleCheckedCitiesChange (value) {
- // 差集
- let t = [];
- this.shipList.forEach(v1 => {
- let b = Object.assign({}, v1);
- value.forEach(v2 => {
- if (v2 === v1.vesselId) b = null;
- });
- t.push(b);
- });
- //加
- this.shipList.forEach(item => {
- value.forEach(gitem => {
- if (item.vesselId === gitem) {
- let currIndex = this.seleteShipList.findIndex(
- value => value.vesselId === gitem
- );
- if (currIndex === -1)
- this.seleteShipList.push({
- vesselId: item.vesselId,
- vesselName: item.vesselName
- });
- }
- });
- });
- // 删
- let _t = t.filter(v => !!v);
- let a = this.seleteShipList.filter(v => {
- let r = true;
- _t.forEach(v2 => {
- if (v.vesselId === v2.vesselId) r = false;
- });
- return r;
- });
- this.seleteShipList = a;
- let _isIndeterminate = false;
- this.shipList.forEach(v => {
- if (value.includes(v.vesselId)) {
- _isIndeterminate = true;
- }
- });
- this.isIndeterminate = _isIndeterminate;
- let _checkAll = false;
- let selectMum = 0;
- this.shipList.forEach(v => {
- if (value.includes(v.vesselId)) {
- selectMum++;
- }
- });
- if (this.shipList.length === selectMum) {
- _checkAll = true;
- this.isIndeterminate = false;
- } else {
- _checkAll = false;
- }
- this.checkAll = _checkAll;
- },
- // 关联船舶全选
- handleCheckAllChangess (val) {
- let citiesId = [];
- let shipChecks = [];
- this.shipLists.forEach(item => {
- citiesId.push({ vesselId: item.vesselId, vesselName: item.vesselName });
- shipChecks.push(item.vesselId);
- });
- this.shipCheckLists = val ? shipChecks : [];
- this.seleteShipLists = val ? citiesId : [];
- this.gggg.asd = val ? citiesId : [];
- this.isIndeterminates = false;
- },
- // 关联船舶单选
- handleCheckedCitiesChangess (value) {
- // 差集
- let t = [];
- this.shipLists.forEach(v1 => {
- let b = Object.assign({}, v1);
- value.forEach(v2 => {
- if (v2 === v1.vesselId) b = null;
- });
- t.push(b);
- });
- //加
- this.shipLists.forEach(item => {
- value.forEach(gitem => {
- if (item.vesselId === gitem) {
- let currIndex = this.seleteShipLists.findIndex(
- value => value.vesselId === gitem
- );
- if (currIndex === -1)
- this.seleteShipLists.push({
- vesselId: item.vesselId,
- vesselName: item.vesselName
- });
- this.gggg.asd = this.seleteShipLists;
- }
- });
- });
- // 删
- let _t = t.filter(v => !!v);
- let a = this.seleteShipLists.filter(v => {
- let r = true;
- _t.forEach(v2 => {
- if (v.vesselId === v2.vesselId) r = false;
- });
- return r;
- });
- this.seleteShipLists = a;
- this.gggg.asd = a;
- let _isIndeterminates = false;
- this.shipLists.forEach(v => {
- if (value.includes(v.vesselId)) {
- _isIndeterminates = true;
- }
- });
- this.isIndeterminates = _isIndeterminates;
- let _checkAll = false;
- let selectMum = 0;
- this.shipLists.forEach(v => {
- if (value.includes(v.vesselId)) {
- selectMum++;
- }
- });
- if (this.shipLists.length === selectMum) {
- _checkAll = true;
- this.isIndeterminates = false;
- } else {
- _checkAll = false;
- }
- this.checkAll = _checkAll;
- },
- // 选船操作
- shipCheck (id) {
- this.seleteShipList = [];
- for (let i = 0; i < id.length; i++) {
- this.seleteShipList.push({
- vesselId: id[i],
- vesselName: this.shipList.find(item => item.vesselId === id[i])
- .vesselName
- });
- }
- },
- // 选船操作
- shipChecks (id) {
- this.seleteShipLists = [];
- for (let i = 0; i < id.length; i++) {
- this.seleteShipLists.push({
- vesselId: id[i],
- vesselName: this.shipLists.find(item => item.vesselId === id[i])
- .vesselName
- });
- }
- },
- changeInputType () {
- this.inputType = "password";
- },
- // 当前页面信息
- getMemberInfo () {
- this.loading = true;
- staffInfo({ staffId: this.id }).then(response => {
- this.ruleForm = response;
- this.zhiwu1.roleId = this.ruleForm.majorRoleId;
- if (this.ruleForm.underCompId) {
- this.changeDept(this.ruleForm.underCompId);
- }
- if (this.ruleForm.deptId) {
- shoreApi
- .queryRoleSelectData({
- vesselBankFlag: "B",
- underCompId: this.ruleForm.underCompId,
- deptId: this.ruleForm.deptId
- })
- .then(response => {
- this.data6 = response.map(item => {
- return {
- ...item,
- state: false
- };
- });
- this.data1 = this.data6;
- this.roleLoading = false;
- });
- }
- if (!this.ruleForm.electronicSignature) {
- this.ruleForm.electronicSignature = this.url;
- }
- // console.log(response)
- // TODO: 此处存在疑问点?
- this.zhiwu1.roleName = response.majorRole
- ? response.majorRole.roleName
- : "";
- this.post = response.majorRole ? response.majorRole.roleId : "";
- if (response.majorRole && response.majorRole.vessels)
- response.majorRole.vessels.forEach(item => {
- this.seleteShipList.push(item);
- this.aaaaaa.push(item.vesselId);
- });
- response.roles.forEach(item => {
- this.$set(this.check, `${item.deptId}_${item.roleId}`, [item]);
- this.$set(this.aaabbb, `${item.deptId}_${item.roleId}`, [item]);
- if (item.vessels !== null)
- item.vessels.forEach(itemD => {
- Object.keys(this.check).forEach((value, index) => {
- if (value === `${item.deptId}_${item.roleId}`) {
- this.check[value].forEach(ite => {
- if (ite.asd === undefined) {
- ite.asd = [];
- }
- ite.asd.push(itemD);
- });
- }
- });
- });
- });
- response.roles.forEach(item => {
- if (item.vessels !== null) {
- item.vessels = item.vessels.map(ite => {
- return {
- ...ite,
- roleId: item.roleId
- };
- });
- }
- });
- this.ruleForm.roleVesselIds = [];
- response.roles.forEach(item => {
- if (item.vessels !== null)
- item.vessels.forEach(itemA => {
- this.ruleForm.roleVesselIds.push(
- itemA.roleId + "_" + itemA.vesselId
- );
- // this.jobList.forEach(ite => {
- // if (ite.roleId === item.roleId) {
- // ite.asd.push(itemA);
- // }
- // });
- });
- });
- // TODO: 此处存在
- this.ruleForm.vessels = response.majorRole
- ? response.majorRole.vessels
- : "";
- // let vessels = response.vessels.filter(function(v) {
- // return v;
- // });
- // this.shipCheckList = [];
- // this.seleteShipList = vessels.filter(v => {
- // let t = false;
- // this.shipList.forEach(v2 => {
- // if (v2.vesselId === v.vesselId) {
- // t = true;
- // this.shipCheckList.push(v.vesselId);
- // }
- // });
- // return t;
- // });
- let checkedCount = this.shipCheckList.length;
- this.checkAll = checkedCount === this.shipList.length;
- this.isIndeterminate =
- checkedCount > 0 && checkedCount < this.shipList.length;
- // if (response.roles.length > 0) {
- // this.zhiwu1 = response.roles[0];
- // response.roles.find(item => {
- // if (item.major === "1") {
- // this.zhiwu1 = {
- // roleId: item.roleId,
- // roleName: item.roleName,
- // major: "1"
- // };
- // }
- // this.zhiwuCheckList.push(item.roleId);
- // });
- // this.zhiwu2 = response.roles.filter(item => {
- // return item.major !== "1";
- // });
- // }
- this.loading = false;
- });
- },
- // 上传签名
- uploadPhoto (e) {
- const fileTypes = [".jpg", ".png"];
- const filePath = e.target.value;
- if (filePath) {
- let isNext = false;
- const fileEnd = filePath.substring(filePath.indexOf("."));
- for (let i = 0; i < fileTypes.length; i++) {
- if (fileTypes[i] === fileEnd) {
- isNext = true;
- break;
- }
- }
- if (!isNext) {
- this.$message({
- message: "不接受此类型文件",
- type: "error",
- showClose: true
- });
- e.target.value = "";
- return false;
- }
- } else {
- return false;
- }
- const file = e.target.files[0];
- uploadShipFiles(file, {
- companyId: this.compId || "",
- modelId: ""
- }).then(response => {
- this.ruleForm.electronicSignature =
- this.$store.getters.baseInfo.fileUrl + response.appendixPath;
- this.$message({
- type: "success",
- message: "上传签名成功!",
- showClose: true
- });
- });
- },
- cancel () {
- this.$router.go(-1);
- },
- // 数据转换
- getSelectLabel () {
- this.ruleForm.majorRoleId = this.zhiwu1.roleId;
- // 公司
- this.ruleForm.underCompName = this.companyList.find(
- item => item.compId === this.ruleForm.underCompId
- ).compName;
- // 部门
- this.ruleForm.deptName = this.deptList.find(
- item => item.deptId === this.ruleForm.deptId
- ).deptName;
- if (this.ruleForm.loginPasswordNew) {
- this.ruleForm.loginPassword = this.ruleForm.loginPasswordNew;
- }
- },
- // 编辑
- editSave () {
- this.ruleForm.staffId = this.id;
- changeInfo(this.ruleForm)
- .then(() => {
- // this.cancel();
- this.$message({
- message: "保存成功",
- type: "success",
- showClose: true
- });
- // for(var i =0;i<this.zhiwu2.length;i++){
- // var param = {
- // staffId:this.id,
- // roleId:this.zhiwu2[i].roleId,
- // roleMajor:'0'
- // }
- // saveRole(param).then(() => {
- // })
- // }
- // this.getMemberInfo();
- this.$router.go(-1);
- this.loading = false;
- })
- .catch(code => {
- this.loading = false;
- if (code === "MANAGEMENT_002") {
- this.$message({
- type: "error",
- message: "手机号冲突!",
- showClose: true
- });
- return false;
- }
- if (code === "MANAGEMENT_001") {
- this.$message({
- type: "error",
- message: "用户名冲突!",
- showClose: true
- });
- return false;
- }
- if (code === "MANAGEMENT_003") {
- this.$message({
- type: "error",
- message: "邮箱冲突!",
- showClose: true
- });
- return false;
- }
- if (code === "MANAGEMENT_010") {
- this.$message({
- type: "error",
- message: "成员名称重复!",
- showClose: true
- });
- return false;
- }
- });
- },
- // 保存
- addSave (flag) {
- addadmin(this.ruleForm)
- .then(() => {
- // this.cancel();
- var commonUser={};
- commonUser.phone = this.ruleForm.staffMobilePhone
- checkApp(commonUser).then(()=>{
- })
- this.$message({
- message: "保存成功",
- type: "success",
- showClose: true
- });
- if (flag) {
- this.$router.go(-1);
- } else {
- this.clearZhiwu();
- this.checklist = [
- {
- value: ""
- }
- ];
- this.checklist1 = [
- {
- value: ""
- }
- ];
- this.seleteShipList = [];
- this.ruleForm.staffName = "";
- this.ruleForm.deptId = "";
- this.url =
- "http://winsea-saas-test.oss-cn-shanghai.aliyuncs.com/default-logo.png";
- this.$nextTick(() => {
- this.$refs.ruleForm.clearValidate();
- this.$refs.ruleForm.resetFields();
- });
- }
- this.loading = false;
- })
- .catch(code => {
- this.loading = false;
- if (code === "MANAGEMENT_002") {
- this.$message({
- type: "error",
- message: "手机号冲突!",
- showClose: true
- });
- return false;
- }
- if (code === "MANAGEMENT_001") {
- this.$message({
- type: "error",
- message: "用户名冲突!",
- showClose: true
- });
- return false;
- }
- if (code === "MANAGEMENT_003") {
- this.$message({
- type: "error",
- message: "邮箱冲突!",
- showClose: true
- });
- return false;
- }
- });
- },
- // 保存
- save (formName, flag) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- if (this.ruleForm.roles.length !== 0)
- if (this.ruleForm.roles[0].roleId === "" || this.zhiwu1.roleName === null) {
- this.$message({
- type: "warning",
- message: "请先设置职务!",
- showClose: true
- });
- return false;
- }
- // else if (this.ruleForm.vessels.length === 0) {
- // this.$message({
- // type: "warning",
- // message: "请先设置关联船舶!",
- // showClose: true,
- // });
- // return false;
- // }
- this.loading = true;
- this.getSelectLabel();
- if (this.id) {
- this.editSave();
- } else {
- this.addSave(flag);
- }
- this.isIndeterminate = false;
- } else {
- this.$message({
- message: "带*号的为必填项",
- type: "error",
- showClose: true
- });
- return false;
- }
- });
- },
- // 设置职务
- setwork () {
- if (this.ruleForm.deptId) {
- this.mainJobSelection = true;
- } else {
- this.$message({
- message: "请先选择部门!",
- type: "warning",
- showClose: true
- });
- }
- },
- // 设置船
- setChargeShip () {
- // console.info(this.seleteShipList, this.aaaaaa);
- this.chargeShip = true;
- this.shipCheckList = this.seleteShipList.map(item => item.vesselId);
- // this.shipCheckList = this.aaaaaa;
- this.isIndeterminate = true;
- },
- setUpShip (data) {
- this.gggg = data;
- if (this.gggg.asd.length !== 0) {
- let _aaa = [];
- this.gggg.asd.forEach(item => {
- _aaa.push(item.vesselId);
- });
- this.shipCheckLists = _aaa;
- this.isIndeterminates = true;
- } else {
- this.shipCheckLists = this.gggg.asd;
- this.isIndeterminates = false;
- }
- this.seleteShipLists = this.gggg.asd;
- this.partTimeJobShip = true;
- },
- // 兼职设置
- partTimeSetting () {
- if (this.ruleForm.deptId) {
- this.setDuty = true;
- } else {
- this.$message({
- message: "请先选择部门!",
- type: "warning",
- showClose: true
- });
- }
- },
- // 基础数据
- async baseInfo () {
- // 公司
- shoreApi.compAndChildrenInfo().then(res => {
- res[0].children.unshift({
- compId: res[0].compId,
- compName: res[0].compName
- });
- this.companyList = res[0].children;
- });
- // 船舶
- this.loadingVessel = true;
- let res = await shoreApi.getVessels();
- this.loadingVessel = false;
- this.shipList = res;
- this.shipLists = res;
- if (this.id) {
- this.getMemberInfo();
- this.title = "编辑成员";
- } else {
- this.title = "添加成员";
- }
- // 职员
- this.roleLoading = true;
- shoreApi.queryRoleSelectData({ vesselBankFlag: "B" }).then(response => {
- this.roleLoading = false;
- this.data5 = response.map(item => {
- return {
- ...item,
- state: false
- };
- });
- });
- },
- changeRole (id) {
- this.roleLoading = true;
- shoreApi
- .queryRoleSelectData({
- vesselBankFlag: "B",
- underCompId: this.ruleForm.underCompId,
- deptId: id
- })
- .then(response => {
- this.data6 = response.map(item => {
- return {
- ...item,
- state: false
- };
- });
- this.data1 = this.data6;
- if (!this.data1.find(item => item.roleId === this.zhiwu1.roleId)) {
- this.zhiwu1.roleName = null;
- }
- this.data1.forEach(item => {
- this.zhiwu2.forEach((gitem, gindex) => {
- if (gitem.roleId == item.roleId) {
- this.zhiwu2.splice(gindex, 1);
- }
- this.zhiwuCheckList.forEach((citem, cindex) => {
- if (gitem.roleId == citem) {
- this.zhiwuCheckList.splice(cindex, 1);
- }
- });
- });
- });
- // this.zhiwuCheckList.push(item.roleId);
- // if(this.zhiwu2.find(item => item.roleId === this.zhiwu1.roleId)){
- // this.zhiwu2 = [];
- // }
- this.roleLoading = false;
- });
- },
- changeDept (id) {
- // 部门
- getDeptListByCompId({ vesselBankFlag: "B", underCompId: id }).then(
- response => {
- this.postId = id;
- this.deptList = response;
- this.partTimeDepartmentList = response;
- }
- );
- },
- adddepartmentDel () {
- this.resetChecked();
- this.checklist = [
- {
- key: "",
- value: ""
- }
- ];
- },
- /* 删除 */
- resetChecked (key, value) {
- this.$refs.tree.setCheckedKeys([key]);
- this.checklist.push({
- key,
- value
- });
- },
- // /* 清空 */
- // check(data) {
- // this.checklist = [];
- // const key = data.id;
- // const value = data.label;
- // this.resetChecked(key, value);
- // },
- departmentsave () {
- this.setUpTheDepartment = false;
- this.ruleForm.deptId = this.checklist[0].key;
- },
- // 主要职务单选
- handleCheckAllChanges (value) {
- // this.zhiwu1 = {
- // roleName: this.data1.find(item => item.roleId === value).roleName
- // };
- this.zhiwu1 = {
- major:1,
- roleId: value,
- roleName: this.data1.find(item => item.roleId === value).roleName
- };
- },
- /* 保存 */
- // 设置主要职务
- setMainJob () {
- this.setDuty = false;
- this.zhiwu11 = this.zhiwu1;
- const zhiwuAll = [];
- zhiwuAll.push(this.zhiwu1);
- this.ruleForm.roles = zhiwuAll.concat(this.zhiwu2);
- this.mainJobSelection = false;
- },
- /* 设置职务 */
- setDutysave () {
- // if (this.zhiwu1.roleId) {
- this.setDuty = false;
- this.ruleForm.roleVesselIds = [];
- this.zhiwu2 = []
- this.zhiwu11 = this.zhiwu1;
- const zhiwuAll = [];
- zhiwuAll.push(this.zhiwu1);
- this.jobList.forEach(item => {
- item.asd.forEach(ite => {
- this.ruleForm.roleVesselIds.push(item.roleId + "_" + ite.vesselId);
- });
- this.zhiwu2.push({
- roleId: item.roleId,
- roleName: this.partTimeJobList.find(item1 => item1.roleId === item.roleId)
- .roleName,
- major: "0"
- });
- zhiwuAll.push({
- roleId: item.roleId,
- roleName: this.partTimeJobList.find(item1 => item1.roleId === item.roleId)
- .roleName,
- major: "0"
- });
- });
- this.ruleForm.roles = zhiwuAll
- // } else {
- // this.$message({
- // type: "error",
- // message: "请选择主要职务",
- // showClose: true
- // });
- // }
- },
- getNowList () {
- this.chargeShip = false;
- this.searchKeyword = null;
- this.getList();
- },
- saveChargeShip () {
- this.getNowList();
- this.ruleForm.vessels = this.seleteShipList;
- },
- zhiwu2Check (data) {
- this.zhiwu2 = [];
- for (let i = 0; i < data.length; i++) {
- this.zhiwu2.push({
- roleId: data[i],
- roleName: this.partTimeJobList.find(item => item.roleId === data[i])
- .roleName,
- major: "0"
- });
- }
- },
- // 职务操作
- zhiwuCheck (id) {
- // if (this.primaryzw == "1") {
- // this.zhiwuCheckList = [];
- // this.zhiwuCheckList.push(data[data.length - 1]);
- // this.zhiwu1 = {
- // roleId: data[data.length - 1],
- // roleName: this.data1.find(
- // item => item.roleId === data[data.length - 1]
- // ).roleName,
- // major: "1"
- // };
- // } else {
- // this.zhiwu2 = [];
- // for (let i = 0; i < data.length; i++) {
- // this.zhiwu2.push({
- // roleId: data[i],
- // roleName: this.data5.find(item => item.roleId === data[i]).roleName,
- // major: "0"
- // });
- // }
- // }
- this.roleLoading = true;
- shoreApi
- .queryRoleSelectData({
- vesselBankFlag: "B",
- underCompId: this.ruleForm.underCompId,
- deptId: id.join(",")
- })
- .then(response => {
- this.partTimeJobList = response;
- // this.data6 = response.map(item => {
- // return {
- // ...item,
- // state: false
- // };
- // });
- // this.data1 = this.data6;
- this.roleLoading = false;
- });
- },
- zhiwuRadio1 (data) {
- this.data1 = this.data6;
- for (let i = 0; i < this.data1.length; i++) {
- this.data1[i].state = false;
- }
- for (let i = 0; i < this.zhiwu2.length; i++) {
- for (let j = 0; j < this.data1.length; j++) {
- if (this.zhiwu2[i].roleId == this.data1[j].roleId) {
- this.data1[j].state = true;
- }
- }
- }
- this.zhiwuCheckList = [];
- this.zhiwuCheckList.push(data);
- },
- zhiwuRadio2 (data) {
- this.data1 = this.data5;
- for (let i = 0; i < this.data1.length; i++) {
- this.data1[i].state = false;
- }
- for (let i = 0; i < this.data1.length; i++) {
- if (this.zhiwu1.roleId == this.data1[i].roleId) {
- this.data1[i].state = true;
- }
- }
- this.zhiwuCheckList = [];
- if (data.length > 0) {
- for (let i = 0; i < data.length; i++) {
- this.zhiwuCheckList.push(data[i].roleId);
- }
- }
- },
- delZhiWu (data) {
- for (
- let i = 0;
- i < this.aaabbb[`${data.deptId}_${data.roleId}`].length;
- i++
- ) {
- if (
- this.aaabbb[`${data.deptId}_${data.roleId}`][i].roleId == data.roleId
- ) {
- this.aaabbb[`${data.deptId}_${data.roleId}`].splice(i, 1);
- }
- }
- for (let i = 0; i < this.jobList.length; i++) {
- if (data.roleId === this.jobList[i].roleId) {
- this.jobList.splice(i, 1);
- this.$forceUpdate();
- }
- }
- // for (let i = 0; i < this.data1.length; i++) {
- // if (data.roleId == this.data1[i].roleId) {
- // this.data1[i].state = false;
- // }
- // }
- },
- // 弹出框确认关闭
- handleClose (done) {
- this.clearZhiwu();
- done();
- },
- clearZhiwu () {
- this.zhiwu11 = [];
- this.zhiwu1 = {};
- this.zhiwu2 = [];
- this.zhiwuCheckList = [];
- this.primaryzw = "1";
- this.shipCheckList = [];
- this.seleteShipList = [];
- },
- delShipSelect (data) {
- const num = this.shipCheckList.indexOf(data);
- this.shipCheckList.splice(num, 1);
- for (let i = 0; i < this.seleteShipList.length; i++) {
- if (this.seleteShipList[i].vesselId == data) {
- this.seleteShipList.splice(i, 1);
- }
- }
- if (this.seleteShipList.length === 0) {
- this.isIndeterminate = false;
- } else {
- this.isIndeterminate = true;
- }
- },
- delShipSelects (data) {
- const num = this.shipCheckLists.indexOf(data);
- this.shipCheckLists.splice(num, 1);
- for (let i = 0; i < this.seleteShipLists.length; i++) {
- if (this.seleteShipLists[i].vesselId == data) {
- this.seleteShipLists.splice(i, 1);
- }
- }
- this.gggg.asd = this.seleteShipLists;
- if (this.seleteShipLists.length === 0) {
- this.isIndeterminate = false;
- } else {
- this.isIndeterminate = true;
- }
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .dept-comp {
- /deep/ .el-select:nth-child(1) {
- margin-right: 10px;
- }
- /deep/ .el-input__inner,
- .el-select {
- width: 203px !important;
- }
- }
- .serviceType {
- /deep/ .el-form-item__label {
- padding-right: 25px;
- }
- .el-form-item__content {
- position: relative;
- }
- .tips {
- font-size: 20px;
- color: #999;
- position: absolute;
- left: -25px;
- cursor: pointer;
- z-index: 99;
- &:hover {
- p {
- display: block;
- }
- }
- p {
- display: none;
- box-shadow: 0 1px 8px rgba(137, 142, 146, 0.34);
- font-size: 12px;
- line-height: 16px;
- background: #fff;
- color: #333;
- padding: 3px;
- margin: 0;
- margin-top: -4px;
- border-radius: 5px;
- height: 40px;
- }
- }
- }
- .border {
- width: 960px;
- height: 100%;
- border-left: 1px solid #cccccc;
- }
- .organization-box {
- height: calc(86vh - 10px);
- overflow-y: auto;
- border: none;
- }
- .uphead {
- margin: 20px 0;
- height: 60px;
- line-height: 60px;
- }
- .img {
- display: inline-block;
- height: 60px;
- width: 60px;
- border-radius: 10px;
- vertical-align: sub;
- }
- .kyc-passin {
- margin-left: 20px;
- width: 170px;
- }
- .talk {
- font-size: 12px;
- color: #999999;
- }
- /deep/.el-dialog__body {
- padding: 0;
- }
- /deep/ .el-dialog--center .el-dialog__body {
- padding: 0;
- }
- .adddepartment {
- height: 400px;
- display: flex;
- justify-content: space-between;
- }
- .adddepartment1 {
- padding: 20px;
- width: 50%;
- overflow-y: auto;
- .el-checkbox-group {
- padding-left: 15px;
- }
- .search-box {
- margin-bottom: 10px;
- .search-keyword {
- margin-right: 30px;
- }
- }
- }
- .adddepartment2 {
- padding: 20px;
- width: 50%;
- background-color: #eeeeee;
- }
- /deep/.el-tree-node__content {
- height: 40px;
- }
- .adddepartment3 {
- height: 36px;
- line-height: 36px;
- background-color: #ffffff;
- position: relative;
- margin-bottom: 5px;
- }
- .adddepartment4 {
- display: inline-block;
- margin-bottom: 20px;
- }
- .adddepartmentLeft {
- width: 195px;
- display: inline-block;
- position: absolute;
- left: 10px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .shipName {
- padding: 4px 8px;
- background-color: #dde9fc;
- margin-right: 10px;
- margin-bottom: 10px;
- }
- .ddv1 {
- //width: 730px;
- vertical-align: top;
- margin-top: 2px;
- }
- .ddv1 > span {
- float: left;
- }
- .adddepartmentDel {
- display: inline-block;
- position: absolute;
- right: 20px;
- color: #1d6ced;
- cursor: pointer;
- }
- /deep/.el-form-item .el-input__inner {
- width: 420px;
- }
- .main-list {
- height: calc(42vh);
- }
- .primaryzw {
- width: 100%;
- margin-bottom: 30px;
- }
- .zhiwuCheck {
- display: block;
- margin-top: 10px;
- }
- .zhiwuChecks {
- display: block;
- margin-left: -30px;
- }
- .zhuyaozhiwu {
- margin-top: 10px;
- background-color: #ffffff;
- padding: 3px 8px;
- // display: inline-block;
- }
- .ciyaozhiwu {
- background-color: #ffffff;
- padding: 5px 10px;
- // display: inline-block;
- margin-top: 10px;
- }
- .zhiwuradio {
- margin-top: 5px;
- margin-right: 10px;
- }
- .zhiwuDel {
- margin-inline-start: 10px;
- color: #1d6ced;
- cursor: pointer;
- float: right;
- }
- .lastspan {
- display: flex;
- }
- .ddv1 {
- flex: 1;
- }
- .inputPsd {
- -webkit-text-security: disc;
- }
- /deep/ .el-form-item__error {
- display: block;
- }
- .dept-comp {
- /deep/ .el-form-item__error {
- display: none;
- }
- /deep/ .el-form-item__content {
- /deep/ .el-input {
- width: 202px;
- }
- }
- }
- /deep/ .el-form-item__content {
- /deep/ .el-input {
- width: 420px;
- }
- }
- .member {
- display: inline-block;
- margin: 10px 0 0 10px;
- }
- .checkBoxClass {
- // float: left;
- width: 650px;
- height: 100%;
- }
- .checkBoxCla {
- width: 25%;
- margin: 10px 0 10px 20px;
- }
- .boxClass {
- margin-left: 10px;
- }
- .aaa {
- display: inline-block;
- padding-right: 12px;
- font-size: 14px;
- color: #666666;
- margin-bottom: 15px;
- }
- .bbb {
- display: inline-block;
- padding-right: 12px;
- font-size: 14px;
- color: #666666;
- }
- .postBox {
- width: 100%;
- }
- .ship-tree {
- /deep/.el-tree-node__content {
- height: auto;
- }
- /deep/.el-radio-group {
- display: flex;
- flex-direction: column;
- text-align: left;
- & > .el-radio {
- margin: 2px;
- }
- }
- }
- </style>
|