| | |
| | | const queryRepairDepartTreeList = (params)=>getAction("/eam/eamBaseRepairDepart/queryTreeList",params); |
| | | const queryRepDepIdTree = (params)=>getAction("/eam/eamBaseRepairDepart/queryIdTree",params); |
| | | const deleteByRepairDepartId = (params)=>deleteAction("/eam/eamBaseRepairDepart/delete",params); |
| | | |
| | | //EAMä¸å¿ |
| | | const queryEamCenterTreeList = (params)=>getAction("/eam/BaseFactory/queryTreeList",params); |
| | | const queryEamCenterIdTree = (params)=>getAction("/eam/BaseFactory/queryIdTree",params); |
| | | const deleteByEamCenterId = (params)=>deleteAction("/eam/BaseFactory/delete",params); |
| | | //产线æ |
| | | |
| | | |
| | |
| | | editEquipment, |
| | | queryRepairDepartTreeList, |
| | | queryRepDepIdTree, |
| | | deleteByRepairDepartId |
| | | |
| | | deleteByRepairDepartId, |
| | | queryEamCenterTreeList, |
| | | queryEamCenterIdTree, |
| | | deleteByEamCenterId |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="components-input-demo-presuffix"> |
| | | <!----> |
| | | <a-input @click="openModal" placeholder="请ç¹å»éæ©EAMä¸å¿" v-model="textVals" readOnly :disabled="disabled"> |
| | | <a-icon slot="prefix" type="cluster" title="EAMä¸å¿éæ©æ§ä»¶"/> |
| | | <a-icon v-if="storeVals" slot="suffix" type="close-circle" @click="handleEmpty" title="æ¸
空"/> |
| | | </a-input> |
| | | <JSelectBaseFactoryModal |
| | | ref="innerBaseFactorySelectModal" |
| | | :modal-width="modalWidth" |
| | | :multi="multi" |
| | | :rootOpened="rootOpened" |
| | | :BaseFactoryId="value" |
| | | :store="storeField" |
| | | :text="textField" |
| | | :treeBaseFactory="treeBaseFactory" |
| | | @ok="handleOK" |
| | | @initComp="initComp"> |
| | | |
| | | </JSelectBaseFactoryModal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import JSelectBaseFactoryModal from './modal/JSelectBaseFactoryModal' |
| | | import { underLinetoHump } from '@/components/_util/StringUtil' |
| | | export default { |
| | | name: 'JSelectBaseFactory', |
| | | components:{ |
| | | JSelectBaseFactoryModal |
| | | }, |
| | | props:{ |
| | | modalWidth:{ |
| | | type:Number, |
| | | default:500, |
| | | required:false |
| | | }, |
| | | multi:{ |
| | | type:Boolean, |
| | | default:false, |
| | | required:false |
| | | }, |
| | | rootOpened:{ |
| | | type:Boolean, |
| | | default:true, |
| | | required:false |
| | | }, |
| | | value:{ |
| | | type:String, |
| | | required:false |
| | | }, |
| | | disabled:{ |
| | | type: Boolean, |
| | | required: false, |
| | | default: false |
| | | }, |
| | | // èªå®ä¹è¿ååæ®µï¼é»è®¤è¿å id |
| | | customReturnField: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | backBaseFactory: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | }, |
| | | // åå¨å段 [key field] |
| | | store: { |
| | | type: String, |
| | | default: 'id', |
| | | required: false |
| | | }, |
| | | // æ¾ç¤ºå段 [label field] |
| | | text: { |
| | | type: String, |
| | | default: 'factoryName', |
| | | required: false |
| | | }, |
| | | treeBaseFactory: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | |
| | | }, |
| | | data(){ |
| | | return { |
| | | visible:false, |
| | | confirmLoading:false, |
| | | storeVals: '', //[key values] |
| | | textVals: '' //[label values] |
| | | } |
| | | }, |
| | | computed:{ |
| | | storeField(){ |
| | | let field = this.customReturnField |
| | | if(!field){ |
| | | field = this.store; |
| | | } |
| | | return underLinetoHump(field) |
| | | }, |
| | | textField(){ |
| | | return underLinetoHump(this.text) |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.storeVals = this.value |
| | | }, |
| | | watch:{ |
| | | value(val){ |
| | | this.storeVals = val |
| | | } |
| | | }, |
| | | methods:{ |
| | | initComp(textVals){ |
| | | this.textVals = textVals |
| | | }, |
| | | //è¿åéä¸ç车é´ä¿¡æ¯ |
| | | backBaseFactoryInfo(){ |
| | | if(this.backBaseFactory===true){ |
| | | //LOWCOD-2147 ãç¨æ·ç®¡çãéæ©é¨é¨åä¸çº§ä»¥åï¼è´è´£é¨é¨æ²¡ææ°æ®å¯é (é¶çæ¹é èªå®ä¹è¿ååæ®µå¯¼è´) |
| | | if(this.storeVals && this.storeVals.length>0){ |
| | | let arr1 = this.storeVals.split(',') |
| | | let arr2 = this.textVals.split(',') |
| | | let info = [] |
| | | for(let i=0;i<arr1.length;i++){ |
| | | info.push({ |
| | | value: arr1[i], |
| | | text: arr2[i] |
| | | }) |
| | | } |
| | | this.$emit('back', info) |
| | | } |
| | | } |
| | | }, |
| | | openModal(){ |
| | | this.$refs.innerBaseFactorySelectModal.show() |
| | | }, |
| | | handleOK(rows) { |
| | | if (!rows && rows.length <= 0) { |
| | | this.textVals = '' |
| | | this.storeVals = '' |
| | | } else { |
| | | let arr1 = [] |
| | | let arr2 = [] |
| | | for(let dep of rows){ |
| | | arr1.push(dep[this.storeField]) |
| | | arr2.push(dep[this.textField]) |
| | | } |
| | | this.storeVals = arr1.join(',') |
| | | this.textVals = arr2.join(',') |
| | | } |
| | | this.$emit("change", this.storeVals) |
| | | this.backBaseFactoryInfo() |
| | | }, |
| | | getBaseFactoryNames(){ |
| | | return this.departNames |
| | | }, |
| | | handleEmpty(){ |
| | | this.handleOK('') |
| | | } |
| | | }, |
| | | model: { |
| | | prop: 'value', |
| | | event: 'change' |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .components-input-demo-presuffix .anticon-close-circle { |
| | | cursor: pointer; |
| | | color: #ccc; |
| | | transition: color 0.3s; |
| | | font-size: 12px; |
| | | } |
| | | .components-input-demo-presuffix .anticon-close-circle:hover { |
| | | color: #f5222d; |
| | | } |
| | | .components-input-demo-presuffix .anticon-close-circle:active { |
| | | color: #666; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | title="请ç¹å»éæ©EAMä¸å¿" |
| | | :width="modalWidth" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel" |
| | | @update:fullscreen="isFullscreen" |
| | | wrapClassName="j-repair-depart-select-modal" |
| | | switchFullscreen |
| | | cancelText="å
³é"> |
| | | <a-spin tip="Loading..." :spinning="false"> |
| | | <a-input-search style="margin-bottom: 1px" placeholder="请è¾å
¥ä¸å¿/å·¥åº/工段åç§°æå车è¿è¡æç´¢" @search="onSearch" /> |
| | | <a-tree |
| | | checkable |
| | | :class="treeScreenClass" |
| | | :treeData="treeData" |
| | | :checkStrictly="checkStrictly" |
| | | @check="onCheck" |
| | | @select="onSelect" |
| | | @expand="onExpand" |
| | | :autoExpandParent="autoExpandParent" |
| | | :expandedKeys="expandedKeys" |
| | | :checkedKeys="checkedKeys"> |
| | | |
| | | <template slot="title" slot-scope="{title}"> |
| | | <span v-if="title.indexOf(searchValue) > -1"> |
| | | {{title.substr(0, title.indexOf(searchValue))}} |
| | | <span style="color: #f50">{{searchValue}}</span> |
| | | {{title.substr(title.indexOf(searchValue) + searchValue.length)}} |
| | | </span> |
| | | <span v-else>{{title}}</span> |
| | | </template> |
| | | </a-tree> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import {queryEamCenterTreeList} from '@/api/api' |
| | | export default { |
| | | name: 'JSelectBaseFactoryModal', |
| | | props:['modalWidth','multi','rootOpened','BaseFactoryId', 'store', 'text','treeBaseFactory'], |
| | | data(){ |
| | | return { |
| | | visible:false, |
| | | confirmLoading:false, |
| | | treeData:[], |
| | | autoExpandParent:true, |
| | | expandedKeys:[], |
| | | dataList:[], |
| | | checkedKeys:[], |
| | | checkedRows:[], |
| | | searchValue:"", |
| | | checkStrictly: false, |
| | | fullscreen:false |
| | | } |
| | | }, |
| | | created(){ |
| | | this.loadDepart(); |
| | | }, |
| | | watch:{ |
| | | BaseFactoryId(){ |
| | | this.initDepartComponent() |
| | | }, |
| | | visible: { |
| | | handler() { |
| | | this.initDepartComponent(true) |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | | treeScreenClass() { |
| | | return { |
| | | 'my-dept-select-tree': true, |
| | | 'fullscreen': this.fullscreen, |
| | | } |
| | | }, |
| | | }, |
| | | methods:{ |
| | | show(){ |
| | | this.visible=true |
| | | this.checkedRows=[] |
| | | this.checkedKeys=[] |
| | | }, |
| | | loadDepart(){ |
| | | // è¿ä¸ªæ¹æ³æ¯æ¾å°ææçé¨é¨ä¿¡æ¯ |
| | | queryEamCenterTreeList().then(res=>{ |
| | | if(res.success){ |
| | | let arr = [...res.result] |
| | | this.reWriterWithSlot(arr) |
| | | this.treeData = arr |
| | | this.initDepartComponent() |
| | | if(this.rootOpened){ |
| | | this.initExpandedKeys(res.result) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | initDepartComponent(flag){ |
| | | let arr = [] |
| | | //è¯¥æ¹æ³ä¸¤ä¸ªå°æ¹ç¨ 1.visibleæ¹åäºä»¶éæ°è®¾ç½®éä¸é¡¹ 2.ç»ä»¶ç¼è¾é¡µé¢åæ¾ |
| | | let fieldName = flag==true?'key':this.text |
| | | if(this.BaseFactoryId){ |
| | | let arr2 = this.BaseFactoryId.split(',') |
| | | for(let item of this.dataList){ |
| | | if(arr2.indexOf(item[this.store])>=0){ |
| | | arr.push(item[fieldName]) |
| | | } |
| | | } |
| | | } |
| | | if(flag==true){ |
| | | this.checkedKeys = [...arr] |
| | | }else{ |
| | | this.$emit("initComp", arr.join(',')) |
| | | } |
| | | }, |
| | | reWriterWithSlot(arr){ |
| | | for(let item of arr){ |
| | | if(item.children && item.children.length>0){ |
| | | this.reWriterWithSlot(item.children) |
| | | let temp = Object.assign({},item) |
| | | temp.children = {} |
| | | this.dataList.push(temp) |
| | | }else{ |
| | | this.dataList.push(item) |
| | | item.scopedSlots={ title: 'title' } |
| | | } |
| | | } |
| | | }, |
| | | initExpandedKeys(arr){ |
| | | if(arr && arr.length>0){ |
| | | let keys = [] |
| | | for(let item of arr){ |
| | | if(item.children && item.children.length>0){ |
| | | keys.push(item.id) |
| | | } |
| | | } |
| | | this.expandedKeys=[...keys] |
| | | //å
¨é¨keys |
| | | //this.allTreeKeys = [...keys] |
| | | }else{ |
| | | this.expandedKeys=[] |
| | | //this.allTreeKeys = [] |
| | | } |
| | | }, |
| | | onCheck (checkedKeys,info) { |
| | | if(!this.multi){ |
| | | let arr = checkedKeys.checked.filter(item => this.checkedKeys.indexOf(item) < 0) |
| | | this.checkedKeys = [...arr] |
| | | this.checkedRows = (this.checkedKeys.length === 0) ? [] : [info.node.dataRef] |
| | | }else{ |
| | | if(this.checkStrictly){ |
| | | this.checkedKeys = checkedKeys.checked |
| | | }else{ |
| | | this.checkedKeys = checkedKeys |
| | | } |
| | | this.checkedRows = this.getCheckedRows(this.checkedKeys) |
| | | } |
| | | }, |
| | | onSelect(selectedKeys,info) { |
| | | //åæ¶å
³èçæ
åµä¸æèµ°onSelectçé»è¾ |
| | | if(this.checkStrictly){ |
| | | let keys = [] |
| | | keys.push(selectedKeys[0]) |
| | | if(!this.checkedKeys || this.checkedKeys.length===0 || !this.multi){ |
| | | this.checkedKeys = [...keys] |
| | | this.checkedRows=[info.node.dataRef] |
| | | }else{ |
| | | let currKey = info.node.dataRef.key |
| | | if(this.checkedKeys.indexOf(currKey)>=0){ |
| | | this.checkedKeys = this.checkedKeys.filter(item=> item !==currKey) |
| | | }else{ |
| | | this.checkedKeys.push(...keys) |
| | | } |
| | | } |
| | | this.checkedRows = this.getCheckedRows(this.checkedKeys) |
| | | } |
| | | }, |
| | | onExpand (expandedKeys) { |
| | | this.expandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | | handleSubmit(){ |
| | | if(!this.checkedKeys || this.checkedKeys.length==0){ |
| | | this.$emit("ok",'') |
| | | }else{ |
| | | let checkRow = this.getCheckedRows(this.checkedKeys) |
| | | let keyStr = this.checkedKeys.join(",") |
| | | this.$emit("ok", checkRow, keyStr) |
| | | } |
| | | this.handleClear() |
| | | }, |
| | | handleCancel(){ |
| | | this.handleClear() |
| | | }, |
| | | handleClear(){ |
| | | this.visible=false |
| | | this.checkedKeys=[] |
| | | }, |
| | | getParentKey(currKey,treeData){ |
| | | let parentKey |
| | | for (let i = 0; i < treeData.length; i++) { |
| | | const node = treeData[i] |
| | | if (node.children) { |
| | | if (node.children.some(item => item.key === currKey)) { |
| | | parentKey = node.key |
| | | } else if (this.getParentKey(currKey, node.children)) { |
| | | parentKey = this.getParentKey(currKey, node.children) |
| | | } |
| | | } |
| | | } |
| | | return parentKey |
| | | }, |
| | | onSearch(value){ |
| | | const expandedKeys = this.dataList.map((item) => { |
| | | if (item.title.indexOf(value) > -1) { |
| | | return this.getParentKey(item.key,this.treeData) |
| | | } |
| | | return null |
| | | }).filter((item, i, self) => item && self.indexOf(item) === i) |
| | | |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: value, |
| | | autoExpandParent: true, |
| | | }) |
| | | |
| | | |
| | | }, |
| | | // æ ¹æ® checkedKeys è·å rows |
| | | getCheckedRows(checkedKeys) { |
| | | const forChildren = (list, key) => { |
| | | for (let item of list) { |
| | | if (item.id === key) { |
| | | return item |
| | | } |
| | | if (item.children instanceof Array) { |
| | | let value = forChildren(item.children, key) |
| | | if (value != null) { |
| | | return value |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | let rows = [] |
| | | for (let key of checkedKeys) { |
| | | let row = forChildren(this.treeData, key) |
| | | if (row != null) { |
| | | rows.push(row) |
| | | } |
| | | } |
| | | return rows |
| | | }, |
| | | switchCheckStrictly (v) { |
| | | if(v==1){ |
| | | this.checkStrictly = false |
| | | }else if(v==2){ |
| | | this.checkStrictly = true |
| | | } |
| | | }, |
| | | isFullscreen(val){ |
| | | this.fullscreen=val |
| | | } |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | // éå¶é¨é¨éæ©æ é«åº¦ï¼é¿å
é¨é¨å¤ªå¤æ¶ç¹å»ç¡®å®ä¸ä¾¿ |
| | | .my-dept-select-tree{ |
| | | height:350px; |
| | | |
| | | &.fullscreen{ |
| | | height: calc(100vh - 250px); |
| | | } |
| | | overflow-y: scroll; |
| | | } |
| | | .drawer-bootom-button { |
| | | position: absolute; |
| | | bottom: 0; |
| | | width: 100%; |
| | | border-top: 1px solid #e8e8e8; |
| | | padding: 10px 16px; |
| | | text-align: right; |
| | | left: 0; |
| | | background: #fff; |
| | | border-radius: 0 0 2px 2px; |
| | | } |
| | | </style> |
| | |
| | | secondMaintenanceImportExcel: '/eam/maintenanceStandard/importSecondMaintenanceStandard', |
| | | thirdMaintenanceImportExcel: '/eam/maintenanceStandard/importThirdMaintenanceStandard', |
| | | inspectionXlsDownloadUrl: '导å
¥æ¨¡æ¿/ç¹æ£æ å导å
¥æ¨¡æ¿_v1.0.xlsx', |
| | | weekMaintenanceXlsDownloadUrl: '导å
¥æ¨¡æ¿/å¨ä¿æ å导å
¥æ¨¡æ¿_v1.0.xlsx', |
| | | secondMaintenanceXlsDownloadUrl: '导å
¥æ¨¡æ¿/äºä¿æ å导å
¥æ¨¡æ¿_v1.0.xlsx', |
| | | thirdMaintenanceXlsDownloadUrl: '导å
¥æ¨¡æ¿/ä¸ä¿æ å导å
¥æ¨¡æ¿_v1.0.xlsx' |
| | | secondMaintenanceXlsDownloadUrl: '导å
¥æ¨¡æ¿/äºä¿æ å导å
¥æ¨¡æ¿_v1.0.docx', |
| | | thirdMaintenanceXlsDownloadUrl: '导å
¥æ¨¡æ¿/ä¸ä¿æ å导å
¥æ¨¡æ¿_v1.0.docx' |
| | | }, |
| | | standardId: '-1' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :visible="visible" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | > |
| | | |
| | | <a-spin :spinning="loading"> |
| | | <!-- showLine --> |
| | | <a-form> |
| | | <a-form-item label="车é´å±çº§ï¼"> |
| | | <a-tree showLine ref="tree" :expandedKeys.sync="expandedKeys" |
| | | :treeData="treeDataSource" checkable @check="onCheck" v-model="checkedKeys" |
| | | @expand="onExpand"> |
| | | </a-tree> |
| | | </a-form-item> |
| | | </a-form> |
| | | |
| | | </a-spin> |
| | | |
| | | <template slot="footer"> |
| | | <div> |
| | | <a-dropdown |
| | | style="float: left" |
| | | :trigger="['click']" |
| | | placement="topCenter" |
| | | > |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="expandAll">å±å¼ææ</a-menu-item> |
| | | <a-menu-item key="2" @click="closeAll">åå¹¶ææ</a-menu-item> |
| | | <a-menu-item key="3" @click="refreshTree">å·æ°</a-menu-item> |
| | | </a-menu> |
| | | <a-button> |
| | | æ æä½ |
| | | <a-icon type="up"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | <a-popconfirm title="ç¡®å®æ¾å¼ç¼è¾ï¼" @confirm="handleCancel" okText="ç¡®å®" cancelText="åæ¶"> |
| | | <a-button style="margin-right: .8rem">å
³é</a-button> |
| | | </a-popconfirm> |
| | | <a-button |
| | | @click="handleOk" |
| | | type="primary" |
| | | >ç¡®å® |
| | | </a-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getAction, |
| | | postAction, |
| | | deleteAction |
| | | } from '@/api/manage' |
| | | import BaseTree from '@/views/mdc/common/BaseTree' |
| | | import DepartTree from '@/views/mdc/base/modules/DepartList/DepartListTree/DepartTree' |
| | | |
| | | export default { |
| | | name: 'selectEamDeviceModal', |
| | | components: { |
| | | BaseTree, DepartTree |
| | | }, |
| | | props: { |
| | | editDisable: { |
| | | type: Boolean, |
| | | default() { |
| | | return true |
| | | } |
| | | }, |
| | | title: { |
| | | type: String |
| | | }, |
| | | selectedProduction: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | treeDataSource: [], |
| | | expandedKeys: [], |
| | | checkedKeys: [], |
| | | url: { |
| | | getDeviceTree: '/eam/equipment/loadTreeListByEamCenterIds' |
| | | }, |
| | | selectedWorkshopIds: '', |
| | | dataList: [], |
| | | allTreeKeys: [], |
| | | visible: false, |
| | | dataSource: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.closeAll() |
| | | }, |
| | | methods: { |
| | | onExpand(expandedKeys) { |
| | | this.expandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | | queryTreeData(value) { |
| | | this.loading = true |
| | | this.selectedWorkshopIds = value |
| | | getAction(this.url.getDeviceTree, { ids: value }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.getTreeDataSouce(res.result) |
| | | this.treeDataSource = res.result |
| | | this.generateList(this.treeDataSource) |
| | | this.expandedKeys = this.allTreeKeys |
| | | } else { |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | this.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | const node = data[i] |
| | | const key = node.key |
| | | const title = node.title |
| | | this.dataList.push({ |
| | | key, |
| | | title: title |
| | | }) |
| | | this.allTreeKeys.push(key) |
| | | if (node.children) { |
| | | this.generateList(node.children) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | getTreeDataSouce(data) { |
| | | data.forEach(item => { |
| | | if (item.children && item.children.length > 0) { |
| | | this.getTreeDataSouce(item.children) |
| | | } |
| | | item.key = item.equipmentId ? item.equipmentId : item.key |
| | | item.value = item.equipmentId ? item.equipmentId : item.value |
| | | }) |
| | | }, |
| | | expandAll() { |
| | | this.expandedKeys = this.allTreeKeys |
| | | }, |
| | | closeAll() { |
| | | this.expandedKeys = ['-1'] |
| | | }, |
| | | refreshTree() { |
| | | this.queryTreeData(this.selectedWorkshopIds) |
| | | }, |
| | | onCheck(value, obj) { |
| | | this.checkedKeys = value |
| | | this.deviceNodes = obj.checkedNodes.filter(item => item.data.props.equipmentId).map(item => item.data.props.equipmentId) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | }, |
| | | handleOk() { |
| | | this.$emit('selectFinished', this.deviceNodes) |
| | | this.visible = false |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less" scoped> |
| | | /deep/ .ant-modal { |
| | | /*transform-origin: 337px 50px;*/ |
| | | } |
| | | |
| | | .ant-card-body .table-operator { |
| | | margin-bottom: 18px; |
| | | } |
| | | |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 15px; |
| | | padding-bottom: 15px; |
| | | } |
| | | |
| | | .anty-row-operator button { |
| | | margin: 0 5px |
| | | } |
| | | |
| | | .ant-btn-danger { |
| | | background-color: #ffffff |
| | | } |
| | | |
| | | .ant-modal-cust-warp { |
| | | height: 100% |
| | | } |
| | | |
| | | .ant-modal-cust-warp .ant-modal-body { |
| | | height: calc(100% - 110px) !important; |
| | | overflow-y: auto |
| | | } |
| | | |
| | | .ant-modal-cust-warp .ant-modal-content { |
| | | height: 90% !important; |
| | | overflow-y: hidden |
| | | } |
| | | |
| | | .drawer-bottom-button { |
| | | position: absolute; |
| | | bottom: 0; |
| | | width: 100%; |
| | | border-top: 1px solid #e8e8e8; |
| | | padding: 10px 16px; |
| | | text-align: right; |
| | | left: 0; |
| | | background: #fff; |
| | | border-radius: 0 0 2px 2px; |
| | | } |
| | | </style> |
| | |
| | | <a-input-search :readOnly="true" v-model="model.equipmentIds" @search="deviceSearch" enter-button placeholder="è¯·éæ©è®¾å¤" :disabled="!model.selectedProduction"/> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="EAMä¸å¿åé
" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="areaId"> |
| | | <j-multi-select-tag :triggerChange="true" v-model="model.eamFactoryIds" dictCode="mom_base_area,name,id,del_flag = 0 and type = 1" placeholder="请维æ¤ä¸å¿"/> |
| | | <a-form-model-item label="EAMä¸å¿åé
" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eamFactoryIds"> |
| | | <JSelectBaseFactory v-model="model.selectedBaseFactory" :multi="true" @back="backBaseFactoryInfo" :backProduction="true" :treeProductOpera="true"/> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="EAM设å¤åé
" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled"> |
| | | <a-input-search :readOnly="true" v-model="model.eamEquipmentIds" @search="deviceSearch" enter-button placeholder="è¯·éæ©è®¾å¤" :disabled="!model.selectedProduction"/> |
| | | <a-input-search :readOnly="true" v-model="model.eamEquipmentIds" @search="eamDeviceSearch" enter-button placeholder="è¯·éæ©EAM设å¤" :disabled="!model.selectedBaseFactory"/> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="ç»´ä¿®é¨é¨/çç»åé
" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!repairDepartDisabled"> |
| | |
| | | </div> |
| | | |
| | | <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'éæ©è®¾å¤'"/> |
| | | |
| | | <select-eam-device-modal ref="selectEamDeviceModal" @selectFinished="selectEamOK" :title="'éæ©EAM设å¤'"/> |
| | | |
| | | </a-drawer> |
| | | </template> |
| | | |
| | |
| | | import { mapActions } from 'vuex' |
| | | import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' |
| | | import SelectDeviceModal from './SelectDeviceModal' |
| | | import SelectEamDeviceModal from './SelectEamDeviceModal' |
| | | import JSelectBaseFactory from "@comp/jeecgbiz/JSelectBaseFactory.vue"; |
| | | |
| | | export default { |
| | | name: 'UserModal', |
| | | components: { |
| | | JSelectBaseFactory, |
| | | SelectDeviceModal, |
| | | JSelectProduction, |
| | | JSelectRepairDepart |
| | | JSelectRepairDepart, |
| | | SelectEamDeviceModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//åæ¥ç¨æ·å°å·¥ä½æµ |
| | | queryTenantList: '/sys/tenant/queryList', |
| | | userRepairDepartList: '/sys/user/userRepairDepartList', |
| | | userBaseFactoryList: '/sys/user/userBaseFactoryList', |
| | | repairDepartTreeList: '/eam/eamBaseRepairDepart/queryTreeList' |
| | | }, |
| | | tenantsOptions: [], |
| | | rolesOptions: [], |
| | | nextDepartOptions: [], |
| | | nextProductionOptions: [], |
| | | nextBaseFactoryOptions:[], |
| | | nextRepairDepartOptions: [], |
| | | isDepartType: '', |
| | | model: { |
| | | selectedProduction: '', |
| | | selectedRepairDeparts: '' |
| | | selectedRepairDeparts: '', |
| | | selectedBaseFactory:'', |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | // 妿æ¸
空车é´å¼åéç½®éæ©è®¾å¤ |
| | | if (newVal === '') this.model.equipmentIds = '' |
| | | } |
| | | }, |
| | | 'model.selectedBaseFactory': { |
| | | handler(newVal, oldVal) { |
| | | if (newVal && this.$refs.selectEamDeviceModal) { |
| | | // å¦æè½¦é´éæ©ååä¸ä¸è´åéç½®éæ©è®¾å¤ |
| | | if ((oldVal && newVal !== oldVal)) this.model.eamEquipmentIds = '' |
| | | this.$refs.selectEamDeviceModal.queryTreeData(newVal) |
| | | } |
| | | // 妿æ¸
空车é´å¼åéç½®éæ©è®¾å¤ |
| | | if (newVal === '') this.model.eamEquipmentIds = '' |
| | | } |
| | | } |
| | | }, |
| | |
| | | selectedroles: '', |
| | | selecteddeparts: '', |
| | | selectedProduction: '', |
| | | selectedBaseFactory:'', |
| | | selectedRepairDeparts: '' |
| | | }) |
| | | }, |
| | |
| | | that.getUserDeparts(record.id) |
| | | that.getUserProductions(record.id) |
| | | that.getUserRepairDeparts(record.id) |
| | | this.getUserBaseFactorys(record.id) |
| | | } |
| | | }, |
| | | isDisabledAuth(code) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getUserBaseFactorys(userid) { |
| | | let that = this |
| | | // è·åEAMä¸å¿/å·¥åº/工段åé
|
| | | getAction(that.url.userBaseFactoryList, { userId: userid }).then((res) => { |
| | | if (res.success) { |
| | | let BaseFactoryOptions = [] |
| | | let selectedBaseFactoryOptionsKeys = [] |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | selectedBaseFactoryOptionsKeys.push(res.result[i].key) |
| | | //æ°å¢è´è´£ç»´ä¿®é¨é¨/çç»éæ©ä¸ææ¡ |
| | | BaseFactoryOptions.push({ |
| | | value: res.result[i].key, |
| | | label: res.result[i].title |
| | | }) |
| | | } |
| | | |
| | | this.$set(this.model, 'selectedBaseFactory', selectedBaseFactoryOptionsKeys.join(',')) |
| | | that.nextBaseFactoryOptions = BaseFactoryOptions |
| | | } |
| | | }) |
| | | }, |
| | | backDepartInfo(info) { |
| | | this.model.departIds = this.model.selecteddeparts |
| | | this.nextDepartOptions = info.map((item, index, arr) => { |
| | |
| | | backProductionInfo(info) { |
| | | this.model.productionIds = this.model.selectedProduction |
| | | this.nextProductionOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | backBaseFactoryInfo(info) { |
| | | this.model.eamFactoryIds = this.model.selectedBaseFactory |
| | | this.nextBaseFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | |
| | | this.userId = '' |
| | | this.nextDepartOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.nextBaseFactoryOptions = [] |
| | | this.nextRepairDepartOptions = [] |
| | | this.departIdShow = false |
| | | }, |
| | |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | this.nextDepartOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.nextRepairDepartOptions = [] |
| | | this.departIdShow = false |
| | |
| | | this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : [] |
| | | }, |
| | | |
| | | eamDeviceSearch(){ |
| | | this.$refs.selectEamDeviceModal.visible = true |
| | | this.$refs.selectEamDeviceModal.selectedRowKeys = [] |
| | | this.$refs.selectEamDeviceModal.selectedRows = [] |
| | | this.$refs.selectEamDeviceModal.checkedKeys = this.model.eamEquipmentIds ? this.model.eamEquipmentIds.split(',') : [] |
| | | }, |
| | | |
| | | /** |
| | | * 鿩已æè®¾å¤åç¹å»ç¡®å®æ¶è§¦å |
| | | * @param data 已鿩çè®¾å¤æ°ç» |
| | |
| | | selectOK(data) { |
| | | console.log('data=', data) |
| | | this.$set(this.model, 'equipmentIds', data.join(',')) |
| | | }, |
| | | selectEamOK(data) { |
| | | console.log('data=', data) |
| | | this.$set(this.model, 'eamEquipmentIds', data.join(',')) |
| | | } |
| | | } |
| | | } |