优化
This commit is contained in:
@@ -56,8 +56,8 @@
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="devicerecord_id">
|
||||
<el-input v-model="form.devicerecord_id" :disabled="true" style="width: 200px;"/>
|
||||
<el-form-item label="设备名称" prop="device_name">
|
||||
<el-input v-model="form.device_name" :disabled="true" style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
@@ -179,8 +179,9 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import DeviceDialog from '@/views/wms/sb/upkeep/devicemaintenanceplan/DeviceDialog'
|
||||
import { getDepts } from '@/api/system/dept'
|
||||
import { getDepts, getDeptSuperior } from '@/api/system/dept'
|
||||
import PaDialog from '@/views/wms/sb/run/devicerunrecord/PaDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
const start = new Date()
|
||||
const defaultForm = { runrecord_id: null, device_code: null, devicerecord_id: null, run_date: null, run_times: null, prepare_times: null, error_times: null, adjust_times: null, product_qty: null, nok_qty: null, oee_value: null, remark: null, create_id: null, create_name: null, create_time: null }
|
||||
@@ -228,6 +229,11 @@ export default {
|
||||
]
|
||||
}}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
user: 'user'
|
||||
})
|
||||
},
|
||||
created() {
|
||||
const param = {
|
||||
'materOpt_code': this.materOpt_code
|
||||
@@ -238,6 +244,9 @@ export default {
|
||||
this.queryClassId()
|
||||
})
|
||||
this.getDepts()
|
||||
this.query.dept_id = this.user.dept.id
|
||||
this.getSupDepts(this.user.dept.id)
|
||||
this.crud.toQuery()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
@@ -323,6 +332,25 @@ export default {
|
||||
const data = _selectData[0]
|
||||
this.openParam = data
|
||||
this.addPaDialog = true
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
debugger
|
||||
var number = parseFloat(deptId)
|
||||
getDeptSuperior(number).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
})
|
||||
},
|
||||
buildDepts(depts) {
|
||||
depts.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildDepts(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user