| | |
| | | </template> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules"> |
| | | <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="统一编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> |
| | | <a-form-model-item label="统一编码" prop="equipmentId"> |
| | | <a-input-search :readOnly="true" |
| | | v-model="model.equipmentId" |
| | | :disabled="disSearch" @search="deviceSearch" enter-button placeholder='请选择统一编码' /> |
| | | :disabled="disSearch" @search="deviceSearch" enter-button placeholder='请选择统一编码'/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="设备名称"> |
| | | <a-input :disabled="disSearch" :readOnly="disableSubmit" allow-clear placeholder="请输入设备名称" |
| | | v-model="model.equipmentName"/> |
| | | </a-form-model-item> |
| | |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item v-if="isDepartType == 0" label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled"> |
| | | <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false" @back="backDepartInfo" :backDepart="true" :treeOpera="true"></j-select-equipment-depart> |
| | | <a-form-model-item v-if="isDepartType == 0" label="部门分配" v-show="!departDisabled"> |
| | | <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false" |
| | | @back="backDepartInfo" :backDepart="true" |
| | | :treeOpera="true"></j-select-equipment-depart> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item v-if="isDepartType == -1" label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item v-if="isDepartType == -1" label="设备类型"> |
| | | <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请选择设备类型" |
| | | :triggerChange="true" |
| | | v-model="model.equipmentType"> |
| | |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="车间分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled" ref="selectedProduction" prop="selectedProduction"> |
| | | <a-form-model-item label="车间分配" v-show="!productionDisabled" ref="selectedProduction" |
| | | prop="selectedProduction"> |
| | | <!--<j-select-equipment-production v-decorator="['selectedProduction',{rules:[{required:true,message:'请选择车间!'}]}]" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>--> |
| | | <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production> |
| | | <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false" |
| | | @back="backProductionInfo" :backProduction="true" |
| | | :treeProductOpera="true"></j-select-equipment-production> |
| | | </a-form-model-item> |
| | | |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item v-if="isDepartType == 0" label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请选择设备类型" |
| | | :triggerChange="true" |
| | | v-model="model.equipmentType"> |
| | | <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'> |
| | | {{item.equipmentTypeName}} |
| | | </a-select-option> |
| | | </a-select> |
| | | <a-form-model-item v-if="isDepartType == 0" label="设备类型"> |
| | | <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请选择设备类型" |
| | | :triggerChange="true" |
| | | v-model="model.equipmentType"> |
| | | <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'> |
| | | {{item.equipmentTypeName}} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | |
| | | </a-col> |
| | |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="机床IP" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="机床IP"> |
| | | <a-input :disabled="true" :readOnly="disableSubmit" placeholder="请输入机床IP" |
| | | v-model="model.equipmentIp"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="机床端口" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="机床端口"> |
| | | <a-input :disabled="true" :readOnly="disableSubmit" placeholder="请输入机床端口" |
| | | v-model="model.dataPort"/> |
| | | </a-form-model-item> |
| | |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="驱动类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="驱动类型"> |
| | | <j-dict-select-tag :disabled="true" :readOnly="disableSubmit" placeholder="请选择驱动类型" |
| | | :triggerChange="true" dictCode="mdc_driveType" |
| | | v-model="model.driveType" allow-clear/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设备型号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="设备型号"> |
| | | <a-input :disabled="true" :readOnly="disableSubmit" allow-clear placeholder="请输入设备型号" |
| | | v-model="model.equipmentModel"/> |
| | | </a-form-model-item> |
| | |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="系统类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-dict-select-tag placeholder="请选择系统类型" :triggerChange="true" dictCode="system_type" v-model="model.systemType" allow-clear/> |
| | | <a-form-model-item label="系统类型"> |
| | | <j-dict-select-tag placeholder="请选择系统类型" :triggerChange="true" dictCode="system_type" |
| | | v-model="model.systemType" allow-clear/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-dict-select-tag placeholder="请选择设备状态" :triggerChange="true" dictCode="mdc_equipment_status" v-model="model.equipmentStatus" allow-clear/> |
| | | <a-form-model-item label="设备状态"> |
| | | <j-dict-select-tag placeholder="请选择设备状态" :triggerChange="true" dictCode="mdc_equipment_status" |
| | | v-model="model.equipmentStatus" allow-clear/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12" v-has="'equipment_attribute'"> |
| | | <a-form-model-item label="设备属性"> |
| | | <j-dict-select-tag v-model="model.attribute" type="radio" |
| | | dictCode="equipment_attribute"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="排序"> |
| | | <a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请输入排序" |
| | | v-model="model.sortNo" style="width: 100%"/> |
| | | </a-form-model-item> |
| | |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item :labelCol="{span:3}" :wrapperCol="{span:21}" label="备注"> |
| | | <a-form-model-item :labelCol="{span:4}" :wrapperCol="{span:19}" label="备注"> |
| | | <a-textarea :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请输入备注" |
| | | v-model="model.remark"/> |
| | | </a-form-model-item> |
| | |
| | | import pick from 'lodash.pick' |
| | | import moment from 'moment' |
| | | import Vue from 'vue' |
| | | import { ACCESS_TOKEN } from "@/store/mutation-types" |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import { getAction } from '@/api/manage' |
| | | import { addEquipment,editEquipment} from '@/api/api' |
| | | import { disabledAuthFilter } from "@/utils/authFilter" |
| | | import { addEquipment, editEquipment } from '@/api/api' |
| | | import { disabledAuthFilter } from '@/utils/authFilter' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import JSelectEquipmentProduction from '../../../../../components/jeecgbiz/JSelectEquipmentProduction' |
| | | import JSelectProduction from '../../../../../components/jeecgbiz/JSelectProduction' |
| | | import DeviceListModel from './DeviceListModal' |
| | | import JSelectEquipmentDepart from '../../../../../components/jeecgbiz/JSelectEquipmentDepart' |
| | | import {mapActions} from 'vuex' |
| | | import { mapActions } from 'vuex' |
| | | |
| | | export default { |
| | | name: "UserModal", |
| | | name: 'UserModal', |
| | | components: { |
| | | JSelectProduction, |
| | | JSelectEquipmentDepart, |
| | | JSelectEquipmentProduction, |
| | | DeviceListModel |
| | | }, |
| | | data () { |
| | | data() { |
| | | return { |
| | | disSearch:false, |
| | | disSearch: false, |
| | | departDisabled: false, //是否是我的部门调用该页面 |
| | | productionDisabled: false, //是否是我的车间调用该页面 |
| | | roleDisabled: false, //是否是角色维护调用该页面 |
| | | modalWidth:800, |
| | | drawerWidth:700, |
| | | modalToggleFlag:true, |
| | | modalWidth: 800, |
| | | drawerWidth: 700, |
| | | modalToggleFlag: true, |
| | | confirmDirty: false, |
| | | userId:"", //保存用户id |
| | | userId: '', //保存用户id |
| | | // disableSubmit:false, |
| | | disableSubmit: true, |
| | | dateFormat:"YYYY-MM-DD", |
| | | dateFormat: 'YYYY-MM-DD', |
| | | form: this.$form.createForm(this), |
| | | |
| | | validatorRules:{ |
| | | validatorRules: { |
| | | // equipmentId: [{required: false, message: '请选择设备编号!'}, {validator: this.validatequipmentId}], |
| | | equipmentId: |
| | | [ |
| | | { |
| | | required: true, message: '请选择设备编号!' |
| | | }, |
| | | required: true, message: '请选择设备编号!' |
| | | } |
| | | // { |
| | | // validator: this.validatequipmentId |
| | | // } |
| | | ], |
| | | // trigger: 'blur' // 触发方式 |
| | | // trigger: 'blur' // 触发方式 |
| | | |
| | | selectedProduction: |
| | | [ |
| | | { |
| | | required:true,message: '请选择车间' |
| | | required: true, message: '请选择车间' |
| | | } |
| | | ] |
| | | |
| | | }, |
| | | departIdShow:false, |
| | | title:"操作", |
| | | departIdShow: false, |
| | | title: '操作', |
| | | visible: false, |
| | | model: { |
| | | equipmentId: "", |
| | | equipmentName: "", |
| | | equipmentModel: "", |
| | | equipmentIp: "", |
| | | dataPort: "", |
| | | driveType: "", |
| | | systemType: "", |
| | | equipmentId: '', |
| | | equipmentName: '', |
| | | equipmentModel: '', |
| | | equipmentIp: '', |
| | | dataPort: '', |
| | | driveType: '', |
| | | systemType: '', |
| | | equipmentStatus: '0', |
| | | deviceLevel: "", |
| | | deviceCategory: "", |
| | | deviceLevel: '', |
| | | deviceCategory: '' |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 }, |
| | | sm: { span: 14 } |
| | | }, |
| | | uploadLoading:false, |
| | | uploadLoading: false, |
| | | confirmLoading: false, |
| | | headers:{}, |
| | | headers: {}, |
| | | url: { |
| | | fileUpload: window._CONFIG['domianURL']+"/sys/common/upload", |
| | | userWithDepart: "/mdc/mdcEquipment/equipmentDepartList", // 引入为指定用户查看部门信息需要的url |
| | | fileUpload: window._CONFIG['domianURL'] + '/sys/common/upload', |
| | | userWithDepart: '/mdc/mdcEquipment/equipmentDepartList', // 引入为指定用户查看部门信息需要的url |
| | | //引入为指定用户查看车间信息需要的url |
| | | userProductionList: '/mdc/mdcEquipment/equipmentProductionList', |
| | | userId:"/sys/user/generateUserId", // 引入生成添加用户情况下的url |
| | | syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//同步用户到工作流 |
| | | userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url |
| | | syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流 |
| | | queryTenantList: '/sys/tenant/queryList', |
| | | check:'/sys/duplicate/check', |
| | | queryEquipmentType:'/mdc/mdcEquipmentType/queryEquipmentType' |
| | | check: '/sys/duplicate/check', |
| | | queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' |
| | | }, |
| | | tenantsOptions: [], |
| | | rolesOptions:[], |
| | | nextDepartOptions:[], |
| | | nextProductionOptions:[], |
| | | selectList:[], |
| | | isDepartType:'' |
| | | rolesOptions: [], |
| | | nextDepartOptions: [], |
| | | nextProductionOptions: [], |
| | | selectList: [], |
| | | isDepartType: '' |
| | | } |
| | | }, |
| | | created () { |
| | | const token = Vue.ls.get(ACCESS_TOKEN); |
| | | this.headers = {"X-Access-Token":token} |
| | | created() { |
| | | const token = Vue.ls.get(ACCESS_TOKEN) |
| | | this.headers = { 'X-Access-Token': token } |
| | | this.queryGroup() |
| | | this.queryTreeData() |
| | | // this.initRoleList() |
| | | // this.initTenantList() |
| | | }, |
| | | computed:{ |
| | | uploadAction:function () { |
| | | return this.url.fileUpload; |
| | | computed: { |
| | | uploadAction: function() { |
| | | return this.url.fileUpload |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | } else { |
| | | // this.$message.warn(res.message) |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() =>{ |
| | | }).finally(() => { |
| | | }) |
| | | }, |
| | | queryGroup() { |
| | |
| | | } else { |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | |
| | | }, |
| | | getDeviceRows(val) { |
| | | console.log(val) |
| | | if(val.equipmentid ){ |
| | | if (val.equipmentid) { |
| | | this.model.equipmentId = val.equipmentid |
| | | this.model.equipmentName = val.equipmentname |
| | | this.model.equipmentModel = val.equipmentmodel |
| | | this.model.equipmentIp = val.equipmentip |
| | | this.model.dataPort = val.dataport |
| | | this.model.driveType = val.drivetype |
| | | this.model.controlSystem = val.controlsystem |
| | | this.model.saveTableName = val.savetablename |
| | | this.model.equipmentModel = val.equipmentmodel |
| | | this.model.equipmentIp = val.equipmentip |
| | | this.model.dataPort = val.dataport |
| | | this.model.driveType = val.drivetype |
| | | this.model.controlSystem = val.controlsystem |
| | | this.model.saveTableName = val.savetablename |
| | | } |
| | | |
| | | }, |
| | |
| | | this.$refs.deviceListModel.title = '选择设备' |
| | | this.$refs.deviceListModel.disableSubmit = false |
| | | }, |
| | | add () { |
| | | this.refresh(); |
| | | this.edit({activitiSync:'1',userIdentity:1,equipmentId:"",equipmentName:"",equipmentModel:"",equipmentIp:'',dataPort:"",driveType:"",controlSystem:"",saveTableName:"",equipmentStatus:'0'}); |
| | | add() { |
| | | this.refresh() |
| | | this.edit({ |
| | | activitiSync: '1', |
| | | userIdentity: 1, |
| | | equipmentId: '', |
| | | equipmentName: '', |
| | | equipmentModel: '', |
| | | equipmentIp: '', |
| | | dataPort: '', |
| | | driveType: '', |
| | | controlSystem: '', |
| | | saveTableName: '', |
| | | equipmentStatus: '0', |
| | | attribute: 0 |
| | | }) |
| | | }, |
| | | edit (record) { |
| | | let that = this; |
| | | that.visible = true; |
| | | edit(record) { |
| | | let that = this |
| | | that.visible = true |
| | | //根据屏幕宽度自适应抽屉宽度 |
| | | this.resetScreenSize(); |
| | | this.resetScreenSize() |
| | | |
| | | // that.userId = record.id; |
| | | // console.log(record) |
| | | that.model = Object.assign({}, record); |
| | | that.model = Object.assign({}, record) |
| | | // that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record); |
| | | // this.model = Object.assign({}, record) |
| | | |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort', |
| | | 'driveType', 'sortNo', 'remark','systemVersion','devicePower','controlSystem','saveTableName')) |
| | | 'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName')) |
| | | }) |
| | | if(record.hasOwnProperty("id")){ |
| | | if (record.hasOwnProperty('id')) { |
| | | // that.getUserRoles(record.id); |
| | | that.getUserDeparts(record.id); |
| | | that.getUserDeparts(record.id) |
| | | } |
| | | // console.log('that.model=',that.model) |
| | | }, |
| | | isDisabledAuth(code){ |
| | | return disabledAuthFilter(code); |
| | | isDisabledAuth(code) { |
| | | return disabledAuthFilter(code) |
| | | }, |
| | | //窗口最大化切换 |
| | | toggleScreen(){ |
| | | if(this.modalToggleFlag){ |
| | | this.modalWidth = window.innerWidth; |
| | | }else{ |
| | | this.modalWidth = 800; |
| | | toggleScreen() { |
| | | if (this.modalToggleFlag) { |
| | | this.modalWidth = window.innerWidth |
| | | } else { |
| | | this.modalWidth = 800 |
| | | } |
| | | this.modalToggleFlag = !this.modalToggleFlag; |
| | | this.modalToggleFlag = !this.modalToggleFlag |
| | | }, |
| | | // 根据屏幕变化,设置抽屉尺寸 |
| | | resetScreenSize(){ |
| | | let screenWidth = document.body.clientWidth; |
| | | if(screenWidth < 500){ |
| | | this.drawerWidth = screenWidth; |
| | | }else{ |
| | | this.drawerWidth = 700; |
| | | resetScreenSize() { |
| | | let screenWidth = document.body.clientWidth |
| | | if (screenWidth < 500) { |
| | | this.drawerWidth = screenWidth |
| | | } else { |
| | | this.drawerWidth = 700 |
| | | } |
| | | }, |
| | | getUserDeparts(userid){ |
| | | let that = this; |
| | | getUserDeparts(userid) { |
| | | let that = this |
| | | //部门的url |
| | | getAction(that.url.userWithDepart,{equipmentId:userid}).then((res)=>{ |
| | | if(res.success){ |
| | | getAction(that.url.userWithDepart, { equipmentId: userid }).then((res) => { |
| | | if (res.success) { |
| | | // console.log(res.result) |
| | | let departOptions=[]; |
| | | let selectDepartKeys=[] |
| | | let departOptions = [] |
| | | let selectDepartKeys = [] |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | selectDepartKeys.push(res.result[i].key); |
| | | selectDepartKeys.push(res.result[i].key) |
| | | //新增负责部门选择下拉框 |
| | | departOptions.push({ |
| | | value: res.result[i].key, |
| | |
| | | }) |
| | | } |
| | | |
| | | that.model.selectedDeparts = selectDepartKeys.join(",") |
| | | that.model.selectedDeparts = selectDepartKeys.join(',') |
| | | // that.model.selectedProduction = selectDepartKeys.join(",") |
| | | |
| | | that.nextDepartOptions=departOptions; |
| | | that.nextDepartOptions = departOptions |
| | | // console.log('that.nextDepartOptions=',that.nextDepartOptions) |
| | | } |
| | | }) |
| | | |
| | | getAction(that.url.userProductionList,{equipmentId:userid}).then((res)=>{ |
| | | if(res.success){ |
| | | getAction(that.url.userProductionList, { equipmentId: userid }).then((res) => { |
| | | if (res.success) { |
| | | // console.log(res.result) |
| | | let ProductionOptions=[]; |
| | | let selectProductKeys=[] |
| | | let ProductionOptions = [] |
| | | let selectProductKeys = [] |
| | | // console.log(res.result) |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | selectProductKeys.push(res.result[i].key); |
| | | selectProductKeys.push(res.result[i].key) |
| | | //新增负责部门选择下拉框 |
| | | ProductionOptions.push({ |
| | | value: res.result[i].key, |
| | |
| | | }) |
| | | } |
| | | |
| | | that.model.selectedProduction = selectProductKeys.join(",") |
| | | that.model.selectedProduction = selectProductKeys.join(',') |
| | | |
| | | that.nextProductionOptions=ProductionOptions; |
| | | that.nextProductionOptions = ProductionOptions |
| | | // console.log('that.nextProductionOptions=',that.nextProductionOptions) |
| | | } |
| | | }) |
| | |
| | | }, |
| | | backDepartInfo(info) { |
| | | // console.log(info) |
| | | this.model.departIds = this.model.selectedDeparts; |
| | | this.nextDepartOptions = info.map((item,index,arr)=>{ |
| | | let c = {label:item.text, value: item.value+""} |
| | | return c; |
| | | this.model.departIds = this.model.selectedDeparts |
| | | this.nextDepartOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | backProductionInfo(info) { |
| | | // console.log(info) |
| | | this.model.productionIds = this.model.selectedProduction; |
| | | this.nextProductionOptions = info.map((item,index,arr)=>{ |
| | | let c = {label:item.text, value: item.value+""} |
| | | return c; |
| | | this.model.productionIds = this.model.selectedProduction |
| | | this.nextProductionOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | |
| | | refresh () { |
| | | this.userId="" |
| | | this.nextDepartOptions=[]; |
| | | this.nextProductionOptions = []; |
| | | this.departIdShow=false; |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.disableSubmit = false; |
| | | this.nextDepartOptions=[]; |
| | | refresh() { |
| | | this.userId = '' |
| | | this.nextDepartOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.departIdShow=false; |
| | | this.departIdShow = false |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | this.nextDepartOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.departIdShow = false |
| | | // this.$refs.form.resetFields(); |
| | | }, |
| | | moment, |
| | | handleSubmit () { |
| | | const that = this; |
| | | handleSubmit() { |
| | | const that = this |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | that.confirmLoading = true |
| | | //如果是上级择传入departIds,否则为空 |
| | | // if(this.model.userIdentity!==2){ |
| | | // this.model.departIds=""; |
| | | // } |
| | | let obj; |
| | | if(!this.model.id){ |
| | | this.model.id = this.userId; |
| | | obj=addEquipment(this.model); |
| | | }else{ |
| | | obj=editEquipment(this.model,{ |
| | | id: this.model.id |
| | | }); |
| | | let obj |
| | | if (!this.model.id) { |
| | | this.model.id = this.userId |
| | | obj = addEquipment(this.model) |
| | | } else { |
| | | obj = editEquipment(this.model, { |
| | | id: this.model.id |
| | | }) |
| | | } |
| | | obj.then((res)=>{ |
| | | if(res.success){ |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleConfirmBlur(e) { |
| | | const value = e.target.value; |
| | | const value = e.target.value |
| | | this.confirmDirty = this.confirmDirty || !!value |
| | | }, |
| | | identityChange(e){ |
| | | if(e.target.value===1){ |
| | | this.departIdShow=false; |
| | | }else{ |
| | | this.departIdShow=true; |
| | | identityChange(e) { |
| | | if (e.target.value === 1) { |
| | | this.departIdShow = false |
| | | } else { |
| | | this.departIdShow = true |
| | | } |
| | | }, |
| | | /** |
| | | * 编辑或查看详情数据时清除抽屉表单验证 |
| | | */ |
| | | removeValidate(){ |
| | | removeValidate() { |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | }, |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .avatar-uploader > .ant-upload { |
| | | width:104px; |
| | | height:104px; |
| | | width: 104px; |
| | | height: 104px; |
| | | } |
| | | |
| | | .ant-upload-select-picture-card i { |
| | | font-size: 49px; |
| | | color: #999; |
| | |
| | | color: #666; |
| | | } |
| | | |
| | | .ant-table-tbody .ant-table-row td{ |
| | | padding-top:10px; |
| | | padding-bottom:10px; |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | .drawer-bottom-button { |