| | |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="6"> |
| | | <a-form-model-item prop="areaCode" label="区号"> |
| | | <a-input :placeholder="disableSubmit?'':'请输入区号'" v-model="model.areaCode" :disabled="disableSubmit"/> |
| | | <a-form-model-item prop="technologyStatus" label="技术状态"> |
| | | <j-dict-select-tag dict-code="technology_status" placeholder="请选择技术状态" |
| | | v-model="model.technologyStatus" :disabled="disableSubmit" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | |
| | | <a-form-model-item prop="assetStatus" label="资产状态"> |
| | | <j-dict-select-tag dict-code="asset_status" v-model="model.assetStatus" |
| | | disabled/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item prop="equipmentUse" label="设备用途"> |
| | | <j-dict-select-tag dict-code="equipment_use" v-model="model.equipmentUse" |
| | | placeholder="请选择设备用途" :disabled="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item prop="operator" label="操作工"> |
| | | <a-input :placeholder="disableSubmit?'':'请输入操作工'" v-model="model.operator" :disabled="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | <a-form-model-item prop="orgId" label="使用车间"> |
| | | <a-tree-select v-model="model.orgId" |
| | | style="width: 100%" |
| | | :tree-data="treeData" |
| | | :tree-data="treeDataAlias" |
| | | :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" |
| | | placeholder="请选择使用车间" |
| | | allow-clear |
| | |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | | <a-form-model-item prop="equipmentManager" label="设备管理员"> |
| | | <j-search-select-tag placeholder="请选择设备管理员" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0 and post='PCR0004' and status=1" :disabled="disableSubmit"/> |
| | | <a-form-model-item prop="equipmentManager" label="设备责任人"> |
| | | <j-search-select-tag placeholder="请选择设备责任人" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0 and post='PCR0004' and status=1" :disabled="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="6"> |
| | |
| | | { required: true, message: '请选择使用车间' } |
| | | ], |
| | | equipmentManager: [ |
| | | { required: true, message: '请选择设备管理员' } |
| | | { required: true, message: '请选择设备责任人' } |
| | | ], |
| | | deviceType: [ |
| | | { required: false, message: '请选择设备类型' } |
| | |
| | | loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions' |
| | | }, |
| | | treeData: [], |
| | | treeDataAlias: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | getAction(this.url.loadProductionOptions).then(res => { |
| | | if (res.success) { |
| | | this.treeData = [...res.result] |
| | | this.treeDataAlias = this.deepCopyAndModify(res.result) |
| | | }else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | deepCopyAndModify(arr) { |
| | | // 如果当前元素不是数组或对象,直接返回 |
| | | if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) { |
| | | return arr; |
| | | } |
| | | |
| | | // 如果是数组,创建一个新数组并递归处理每个元素 |
| | | if (Array.isArray(arr)) { |
| | | const newArray = []; |
| | | for (let i = 0; i < arr.length; i++) { |
| | | newArray.push(this.deepCopyAndModify(arr[i])); |
| | | } |
| | | return newArray; |
| | | } |
| | | |
| | | // 如果是对象,创建一个新对象并递归处理每个属性 |
| | | const newObj = {}; |
| | | for (const key in arr) { |
| | | if (arr.hasOwnProperty(key)) { |
| | | if(key === 'selectable') { |
| | | newObj[key] = true; |
| | | } else if(key === 'children') { |
| | | newObj[key] = this.deepCopyAndModify(arr[key]); |
| | | }else { |
| | | newObj[key] = arr[key]; |
| | | } |
| | | |
| | | } |
| | | } |
| | | return newObj; |
| | | } |
| | | } |
| | | } |
| | | </script> |