Commit b84a9f1d authored by jack_liu's avatar jack_liu

修改

parent 74b1892b
......@@ -71,11 +71,7 @@
<el-row style="padding-left: 8.6%; padding-top: 1%">
<el-col :span="12">
<el-form-item style="flex-basis: 50%">
<el-button
type="primary"
@click="onSubmit"
>提交</el-button
>
<el-button type="primary" @click="onSubmit">提交</el-button>
</el-form-item>
</el-col>
</el-row>
......@@ -84,7 +80,7 @@
</template>
<script>
import { getDictList, submit } from '@/api/production/gxpn'
import { getDictList, submit, getlist } from '@/api/production/gxpn'
export default {
name: 'Role',
data() {
......@@ -97,7 +93,7 @@ export default {
dictSelection: [],
queryParams: {
ptype: ''
},
}
}
},
created() {
......@@ -114,22 +110,40 @@ export default {
},
//提交按钮
onSubmit() {
console.log(this.dictSelection)
if( this.queryParams.ptype === '' ){
this.$message.error('ptype为空,不允许提交')
return;
}
console.log(this.dictSelection)
submit(this.dictSelection).then(res => {
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 = ''
/* this.$refs.dictTable.clearSelection()
this.queryParams.ptype = '' */
}
})
})
})
},
//查询
handleQuery() {
......@@ -138,14 +152,15 @@ export default {
if (this.queryParams.ptype == '') {
return
}
getDictList({
dictLabel: this.queryParams.ptype
}).then(res => {
const dictList = res.data
this.dictList.forEach(row => {
dictList.forEach(item => {
if (row.businessId === item.businessId) {
this.$refs.dictTable.toggleRowSelection(row, true)
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)
}
})
})
......@@ -183,5 +198,4 @@ export default {
height: 12em;
width: 4px;
}
</style>
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