后台接口及企业管理完善

pull/7/head^2
WeiRan 2024-09-01 15:35:58 +08:00
parent 9a87b64c6b
commit f427e262ce
4 changed files with 122 additions and 3 deletions

View File

@ -38,3 +38,6 @@ export function sendrequest1(options){
})
}

View File

@ -6,3 +6,11 @@ export function companyauthentication(data){
data: data
})
}
export function ifcompanyauthentication(data){
return request({
url:"/market/company/ifcompanyauthentication",
method: "POST",
data: data
})
}

View File

@ -15,5 +15,15 @@ export function selectTypeList(data){
method: "POST",
data: data
})
}export function selectproductspecification(data){
return request({
url:"/market/product/specification",
method: "POST",
data: data
})
}

View File

@ -1,5 +1,6 @@
<template>
<div>
{{myapi}}
<el-row>
<el-col :span="24"><div class="grid-content bg-purple-dark">
<el-form ref="form" :model="myapi" label-width="120px" :rules="rules">
@ -19,7 +20,7 @@
<el-row>
<el-col :span="24"><div class="grid-content bg-purple-dark">
<el-button type="info" @click="test(myapi)"></el-button>
<el-button type="primary">立即申请</el-button>
<el-button type="primary" @click="apply(myapi)"></el-button>
</div></el-col>
</el-row>
</el-form>
@ -37,7 +38,7 @@
{{myapi.apiAddress}}
</el-form-item>
<el-form-item label="返回格式:">
{{myapi.returnFormat}}/
{{myapi.returnFormat}}
</el-form-item>
<el-form-item label="请求方式:">
{{myapi.requestMethod}}
@ -116,6 +117,69 @@
<el-button @click="dialogVisible = false">返回</el-button>
</span>
</el-dialog>
<!--支付规格选择对话框-->
<el-dialog
title="提示"
:visible.sync="dialogVisible1"
width="50%"
:before-close="handleClose1">
<el-form ref="form" :model="myapi" label-width="120px" :rules="rules">
<el-form-item label="产品名称:" >
{{myapi.productName}}
</el-form-item>
<el-form-item label="产品价格:">
{{myapi.productPrice}}/
</el-form-item>
<el-form-item label="产品介绍:">
{{myapi.productContent}}
</el-form-item>
<el-form-item label="重要路由:">
{{myapi.apiRouter}}
</el-form-item>
</el-form>
<el-divider></el-divider>
<span style="color: #1ab394">请选择申请规格</span>
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
label="支付规格"
width="180">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<div slot="reference" class="name-wrapper">
<el-tag size="medium">{{ scope.row.productSpecificationName }}</el-tag>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
label="价格"
width="180">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<div slot="reference" class="name-wrapper">
<el-tag size="medium">{{ scope.row.middlePrice }}</el-tag>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEdit(scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false"> </el-button>
<el-button type="primary" @click="dialogVisible1 = false"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -123,6 +187,9 @@
//jsjsjson,
//import from ',
import {sendrequest, sendrequest1} from "@/api/apitest/apitest";
import api from "js-cookie";
import {companyauthentication, ifcompanyauthentication} from "@/api/authentication/authentication";
import {selectproductspecification} from "@/api/market/product";
export default {
name: "Apitest",
@ -140,7 +207,9 @@ export default {
},
activeName: 'first',
dialogVisible: false,
ruleForm:{}
dialogVisible1: false,
ruleForm:{},
tableData:[]
};
},
// data",
@ -149,6 +218,7 @@ export default {
watch: {},
//",
methods: {
api,
//
handleClick(tab, event) {
console.log(tab, event);
@ -163,6 +233,20 @@ export default {
apiRouter: myapi.apiRouter
}
},
//
apply(myapi){
//
ifcompanyauthentication().then(response=>{
if (response.code!=200){
alert(response.msg)
}else {
alert(JSON.stringify(myapi))
this.getproductspecification(myapi)
this.dialogVisible1=true
}
})
},
//
handleClose(done) {
this.$confirm('确认关闭?')
@ -171,6 +255,20 @@ export default {
})
.catch(_ => {});
},
//
handleClose1(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
//
getproductspecification(specification){
selectproductspecification(specification).then(response=>{
this.tableData=response.data
})
},
//
submitForm(ruleForm){
sendrequest(ruleForm).then(response=>{