Commit ccb2388c authored by jack_liu's avatar jack_liu

修改

parent e72476e6
......@@ -17,24 +17,16 @@
style="width: 350px"
@keyup.enter.native="handleQuery"
>
<template slot="prepend">ptype</template></el-input
>
<template slot="prepend">ptype</template></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button
>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
</el-form-item>
</el-form>
<el-table
ref="dictTable"
:gutter="40"
v-loading="loading"
border
ref="dictTable"
row-key="index"
:data="dictList"
@selection-change="handleDictSelectionChange"
......@@ -80,7 +72,8 @@
</template>
<script>
import { getDictList, submit, getlist } from '@/api/production/gxpn'
import { submit, getlist } from '@/api/production/gxpn'
import { getDictData } from '@/api/production/application'
export default {
name: 'Role',
data() {
......@@ -92,69 +85,47 @@ export default {
multipleSelection: [],
dictSelection: [],
queryParams: {
ptype: ''
key: 'GX_CODE'
}
}
},
created() {
this.getDictList()
this.listData()
},
methods: {
getDictList() {
getDictList({
dictType: this.queryParams.ptype
}).then(res => {
listData() {
getDictData(this.queryParams).then(res => {
console.log(res)
this.dictList = res.data
this.loading = false
})
},
//提交按钮
// 提交按钮
onSubmit() {
console.log(this.dictSelection)
if (this.queryParams.ptype === '') {
this.$message.error('ptype为空,不允许提交')
return
}
/* if (this.dictSelection.length === 0) {
return
} */
/* getlist(this.queryParams).then(res => {
const ptypeList = res.data
if (ptypeList.length === 0) {
this.$refs.dictTable.clearSelection()
}
ptypeList.forEach(row => {
this.dictList.forEach(item => {
if (row.pgx === item.dictValue) {
this.$refs.dictTable.toggleRowSelection(item, true)
}
})
}) */
/* this.$nextTick(() => { */
submit({
list: this.dictSelection,
ptype: this.queryParams.ptype
}).then(res => {
if (res.code === 200) {
this.$message.success('提交成功')
/* this.$refs.dictTable.clearSelection()
this.queryParams.ptype = '' */
}
})
// })
// })
},
//查询
// 查询
handleQuery() {
//清空
/* this.$refs.dictTable.clearSelection() */
if (this.queryParams.ptype == '') {
// 清空
this.$refs.dictTable.clearSelection()
if (this.queryParams.ptype === '') {
return
}
getlist(this.queryParams).then(res => {
const ptypeList = res.data
if (ptypeList.length == 0) {
if (ptypeList.length === 0) {
this.$refs.dictTable.clearSelection()
}
ptypeList.forEach(row => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment