Commit ccb2388c authored by jack_liu's avatar jack_liu

修改

parent e72476e6
...@@ -17,24 +17,16 @@ ...@@ -17,24 +17,16 @@
style="width: 350px" style="width: 350px"
@keyup.enter.native="handleQuery" @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-form-item> <el-form-item>
<el-button <el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
type="primary"
size="small"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
ref="dictTable"
:gutter="40" :gutter="40"
v-loading="loading"
border border
ref="dictTable"
row-key="index" row-key="index"
:data="dictList" :data="dictList"
@selection-change="handleDictSelectionChange" @selection-change="handleDictSelectionChange"
...@@ -80,7 +72,8 @@ ...@@ -80,7 +72,8 @@
</template> </template>
<script> <script>
import { getDictList, submit, getlist } from '@/api/production/gxpn' import { submit, getlist } from '@/api/production/gxpn'
import { getDictData } from '@/api/production/application'
export default { export default {
name: 'Role', name: 'Role',
data() { data() {
...@@ -92,69 +85,47 @@ export default { ...@@ -92,69 +85,47 @@ export default {
multipleSelection: [], multipleSelection: [],
dictSelection: [], dictSelection: [],
queryParams: { queryParams: {
ptype: '' key: 'GX_CODE'
} }
} }
}, },
created() { created() {
this.getDictList() this.listData()
}, },
methods: { methods: {
getDictList() { listData() {
getDictList({ getDictData(this.queryParams).then(res => {
dictType: this.queryParams.ptype console.log(res)
}).then(res => {
this.dictList = res.data this.dictList = res.data
this.loading = false this.loading = false
}) })
}, },
//提交按钮 // 提交按钮
onSubmit() { onSubmit() {
console.log(this.dictSelection) console.log(this.dictSelection)
if (this.queryParams.ptype === '') { if (this.queryParams.ptype === '') {
this.$message.error('ptype为空,不允许提交') this.$message.error('ptype为空,不允许提交')
return 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({ submit({
list: this.dictSelection, list: this.dictSelection,
ptype: this.queryParams.ptype ptype: this.queryParams.ptype
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success('提交成功') this.$message.success('提交成功')
/* this.$refs.dictTable.clearSelection()
this.queryParams.ptype = '' */
} }
}) })
// })
// })
}, },
//查询 // 查询
handleQuery() { handleQuery() {
//清空 // 清空
/* this.$refs.dictTable.clearSelection() */ this.$refs.dictTable.clearSelection()
if (this.queryParams.ptype == '') { if (this.queryParams.ptype === '') {
return return
} }
getlist(this.queryParams).then(res => { getlist(this.queryParams).then(res => {
const ptypeList = res.data const ptypeList = res.data
if (ptypeList.length == 0) { if (ptypeList.length === 0) {
this.$refs.dictTable.clearSelection() this.$refs.dictTable.clearSelection()
} }
ptypeList.forEach(row => { 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