优化
This commit is contained in:
@@ -151,7 +151,7 @@ import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import AddDialog from '@/views/wms/sb/repair/devicerepair/AddDialog'
|
||||
import { getDepts } from '@/api/system/dept'
|
||||
import { getDepts, getDeptSuperior } from '@/api/system/dept'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
@@ -186,21 +186,24 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user'
|
||||
])
|
||||
...mapGetters({
|
||||
user: 'user'
|
||||
})
|
||||
},
|
||||
created() {
|
||||
debugger
|
||||
const param = {
|
||||
'materOpt_code': this.materOpt_code
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = this.class_idStr
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
this.getDepts()
|
||||
this.query.dept_id = this.user.dept.id
|
||||
this.getSupDepts(this.user.dept.id)
|
||||
this.crud.toQuery()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
@@ -283,6 +286,25 @@ export default {
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,11 +209,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
const arr = this.form.tableData
|
||||
/* const arr = this.form.tableData
|
||||
if (arr.length === 0) {
|
||||
this.crud.notify('明细不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}*/
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
const data = {
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -88,7 +88,7 @@
|
||||
@click="submit"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
|
||||
@@ -161,6 +161,16 @@
|
||||
<el-table-column prop="audit_time" label="审核时间" width="150px" show-overflow-tooltip />
|
||||
<el-table-column prop="source_bill_code" label="源单号" show-overflow-tooltip />
|
||||
<el-table-column prop="source_bill_type" label="源单业务类型" width="120px" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="formterStatus(scope.row)"
|
||||
:disabled-dle="scope.row.invstatus !== '01'"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -169,6 +179,7 @@
|
||||
<resuftDialog :dialog-show.sync="resuftDialog" :open-param="openParam" />
|
||||
<ReceiveDialog :dialog-show.sync="receiveDialog" :open-param="openParam" />
|
||||
<StartDialog :dialog-show.sync="startDialog" :open-param="openParam" />
|
||||
<AddDialog/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -188,11 +199,12 @@ import ExecuteDialog from '@/views/wms/sb/repair/devicerepairpa/ExecuteDialog'
|
||||
import resuftDialog from '@/views/wms/sb/repair/devicerepairpa/resuftDialog'
|
||||
import ReceiveDialog from '@/views/wms/sb/repair/devicerepairpa/ReceiveDialog'
|
||||
import StartDialog from '@/views/wms/sb/repair/devicerepairpa/StartDialog'
|
||||
import AddDialog from '@/views/wms/sb/repair/devicerepair/AddDialog'
|
||||
|
||||
export default {
|
||||
name: 'Devicerepairpa',
|
||||
dicts: ['EM_DEVICE_WX_INVTYPE', 'EM_DEVICE_WX_INVSTATUS', 'EM_FAULT_LEVEL'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect, ExecuteDialog, resuftDialog, ReceiveDialog, StartDialog },
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect, ExecuteDialog, resuftDialog, ReceiveDialog, StartDialog, AddDialog },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -202,7 +214,7 @@ export default {
|
||||
sort: 'repair_id,desc',
|
||||
crudMethod: { ...crudDevicerepairmst },
|
||||
optShow: {
|
||||
add: false,
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
@@ -249,6 +261,9 @@ export default {
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formterStatus(row) {
|
||||
return '06,07,99'.includes(row.invstatus)
|
||||
},
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
@@ -289,9 +304,6 @@ export default {
|
||||
startRepair() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
if (data.invstatus !== '02') {
|
||||
return this.crud.notify('只能对提交状态的单据维修', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
this.openParam = data
|
||||
this.startDialog = true
|
||||
},
|
||||
@@ -383,7 +395,7 @@ export default {
|
||||
this.confirm_flag = false
|
||||
this.result_flag = false
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
if ('01,03,04,05,06,07,99'.includes(rows[i].invstatus)) {
|
||||
if ('03,04,05,06,07,99'.includes(rows[i].invstatus)) {
|
||||
this.start_flag = true
|
||||
}
|
||||
if ('01,02,04,05,06,07,99'.includes(rows[i].invstatus)) {
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<el-table-column prop="fault_desc" label="故障描述" show-overflow-tooltip width="120px" />
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip width="120px" />
|
||||
<el-table-column prop="fault_time" label="故障时间" width="150px" />
|
||||
<el-table-column prop="create_name" label="创建人" />
|
||||
<el-table-column prop="create_name" label="报修人" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px" />
|
||||
<el-table-column prop="process_name" label="处理人" />
|
||||
<el-table-column prop="process_time" label="处理时间" width="150px" />
|
||||
|
||||
Reference in New Issue
Block a user