Commit a06c7146 authored by 高宇's avatar 高宇

1.测试按钮

parent 12f77bd4
......@@ -66,3 +66,12 @@ export function exportIncomeWmsLabel(query) {
responseType: 'blob'
})
}
// 7.测试接口
export function test(query) {
return request({
url: '/incomewmslabel/test',
method: 'get',
params: query,
})
}
......@@ -180,6 +180,15 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
style="margin-left: 107px;float: left;"
class="commonField.exportClass"
:type="commonField.typeSuccess"
:icon="commonField.exportIcon"
:size="commonField.smallSize"
@click="test"
:loading="testLoading"
>测试</el-button>
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button :loading="addLoading" class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
......@@ -194,12 +203,15 @@ import {
delIncomeWmsLabel,
addIncomeWmsLabel,
updateIncomeWmsLabel,
exportIncomeWmsLabel } from '@/api/incomeWmsLabel'
exportIncomeWmsLabel, test
} from '@/api/incomeWmsLabel'
import commonField from '@/utils/commonField'
export default {
name: 'IncomeWmsLabel',
data() {
return {
// 测试按钮loading
testLoading: false,
// 新增确认按钮loading
addLoading: false,
// 遮罩层
......@@ -260,6 +272,34 @@ export default {
this.getList() // 列表查询
},
methods: {
/**
* @description: 测试接口
* @author: gaoyu
* @param:
* @return:
**/
test() {
if (this.form.mac && this.form.mac !== undefined && this.form.mac !== '') {
this.testLoading = true
// 调接口
const obj = {
mac: this.form.mac
}
test(obj).then(res => {
if (res.data) {
this.testLoading = false
this.$message.success("成功")
} else {
this.testLoading = false
this.$message.error("失败")
}
}).catch(() => {
this.testLoading = false
})
} else {
this.$refs.form.validateField("mac")
}
},
/**
* @description: 提交时校验parms中的数据
* @author: gaoyu
......
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