Commit 83ed0627 authored by 刘宇扬's avatar 刘宇扬

入库

parent e3427136
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</template> </template>
<script> <script>
import { getDictData, addIncome } from '@/api/income' import { add, updatadevice } from '@/api/magnagement'
export default { export default {
name: 'Role', name: 'Role',
...@@ -102,17 +102,40 @@ export default { ...@@ -102,17 +102,40 @@ export default {
}, },
// 提交时要调的接口 // 提交时要调的接口
submitForm() { submitForm() {
this.$refs.form.validate((valid) => {
if (valid) {
console.log('form', this.form)
// 校验通过,提交表单或进行其他操作
if (this.form.businessId !== undefined) {
updatadevice(this.form).then(res => {
if (res.code === 200) {
this.open = false
this.$message.success('操作成功')
this.getList()
this.reFrom()
} else if (res.code === null) {
this.$message.error(res.message)
}
})
} else {
add(this.form).then(res => {
if (res.code === 200) {
this.open = false
this.$message.success('操作成功')
this.getList()
this.reFrom()
} else if (res.code === null) {
this.$message.error(res.message)
}
})
}
} else {
// 校验失败,显示错误信息或进行其他操作
}
})
}, },
// 调数据字典查询 // 调数据字典查询
getDict() { getDict() {
const obj = {
key: 'GX_CODE'
}
getDictData(obj).then(res => {
if (res.code === 200 && res.data !== null) {
this.pissbList = res.data
}
})
} }
} }
} }
......
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