diff --git a/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue b/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue index d6cd2bac..86e7057e 100644 --- a/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue +++ b/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue @@ -56,8 +56,8 @@ - - + + diff --git a/mes/qd/src/views/wms/sb/run/devicerunrecord/index.vue b/mes/qd/src/views/wms/sb/run/devicerunrecord/index.vue index 22641768..42353634 100644 --- a/mes/qd/src/views/wms/sb/run/devicerunrecord/index.vue +++ b/mes/qd/src/views/wms/sb/run/devicerunrecord/index.vue @@ -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 + } + }) } } }