更新代码
This commit is contained in:
@@ -20,13 +20,34 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="块-排-列">
|
||||
<el-cascader
|
||||
<el-form-item label="块">
|
||||
<el-input
|
||||
v-model="query.block_num"
|
||||
clearable
|
||||
v-model="locations"
|
||||
:options="locationsOptions"
|
||||
placeholder="请选择标签"
|
||||
@change="hand"
|
||||
size="mini"
|
||||
style="width: 185px;"
|
||||
placeholder="块"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排">
|
||||
<el-input
|
||||
v-model="query.row_num"
|
||||
clearable
|
||||
size="mini"
|
||||
style="width: 185px;"
|
||||
placeholder="排"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="列">
|
||||
<el-input
|
||||
v-model="query.col_num"
|
||||
clearable
|
||||
size="mini"
|
||||
style="width: 185px;"
|
||||
placeholder="列"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位状态">
|
||||
@@ -105,29 +126,7 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" >
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-circle-check"
|
||||
slot="right"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeEnableOn(crud.selections)"
|
||||
>
|
||||
启用
|
||||
</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-circle-close"
|
||||
slot="right"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeEnableOff(crud.selections)">
|
||||
禁用
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
@@ -280,14 +279,9 @@ export default {
|
||||
is_lock: [
|
||||
{ required: true, message: '是否锁定不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
locations: [],
|
||||
locationsOptions: []
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getLocationsOptions()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
@@ -299,23 +293,6 @@ export default {
|
||||
this.query.locationsOptions = this.locations[0] + '/' + this.locations[1] + '/' + this.locations[2]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getLocationsOptions() {
|
||||
crudYsapoint.arrangementTree().then(res => {
|
||||
this.locationsOptions = res
|
||||
})
|
||||
},
|
||||
changeEnableOn(data) {
|
||||
crudYsapoint.changeUsedOn(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
changeEnableOff(data) {
|
||||
crudYsapoint.changeUsedOff(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user