平台验证

master
chenqf 3 years ago
parent 61be01a1ed
commit 49438d04cb

@ -43,3 +43,4 @@ export function modifyUnit(query) {

@ -55,6 +55,12 @@
size="small" size="small"
@click.native.stop="handleModifyClick(scope.row)" @click.native.stop="handleModifyClick(scope.row)"
>编辑</el-button >编辑</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="handleLinkClick(scope.row)"
>关联自助平台</el-button
> >
<el-button <el-button
type="text" type="text"
@ -139,6 +145,93 @@
> >
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
:title="editTypeMap[editType]"
:visible.sync="editLoginVisible"
width="60%"
>
<el-form :model="editLogin" ref="editLogin" :rules="platformRules">
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex">
<div class="edit-text">
<el-form-item label="自助平台名称:" prop="platformId">
<el-select
v-model="editLogin.platformId"
style="width: 94%"
@change="intentPlatform"
placeholder="请选择自助平台"
>
<el-option
v-for="item in platformList"
:key="item.platformId"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex">
<div class="text item">
<el-form-item label="账号:" prop="platformUsername">
<el-input
v-model="editLogin.platformUsername"
style="width: 80%"
size="small"
@input="change()"
></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex">
<div class="text item">
<el-form-item label="密码:" prop="platformPassword">
<el-input
v-model="editLogin.platformPassword"
style="width: 80%"
size="small"
@input="change()"
></el-input>
</el-form-item>
</div>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native.stop="cancelDialog" size="small">取消</el-button>
<el-button type="primary" size="small" @click.native="linkSubmit()"
>提交</el-button
>
</div>
</el-dialog>
<el-dialog title="选择自助平台" :visible.sync="platformVisible" width="35%">
<el-table
v-loading="loading"
@row-click="intentPlatform"
:data="platformList"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
width="80"
></el-table-column>
<el-table-column
label="自助平台名称"
prop="name"
width="140"
></el-table-column>
</el-table>
</el-dialog>
</div> </div>
</template> </template>
@ -149,7 +242,10 @@ import {
modifyUnit, modifyUnit,
deleteUnitMaintain, deleteUnitMaintain,
} from "../../api/receipts/unitMaintain"; } from "../../api/receipts/unitMaintain";
import {
getPlatform,
linkPlatform,
} from "../../api/auth/platform";
export default { export default {
data() { data() {
return { return {
@ -166,16 +262,31 @@ export default {
spell: null, spell: null,
creditNo: null, creditNo: null,
}, },
editLogin: {
platformId: null,
platformUsername: null,
platformPassword: null,
appid: null,
appKey: null,
sceretKey: null,
},
editPlatfromQuery: {
id: null,
name: null,
host: null,
},
platformVisible: false,
editLoginVisible: false,
checked: false, checked: false,
editDialogVisible: false, editDialogVisible: false,
list: [], list: [],
platformList: [],
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
rules: { rules: {
name: [ name: [
{ required: true, message: "请输入往来单位名称", trigger: "change" }, { required: true, message: "请输入往来单位名称", trigger: "change" },
], ],
spell: [ spell: [
{ required: true, message: "请输入往来单位简写", trigger: "change" }, { required: true, message: "请输入往来单位简写", trigger: "change" },
], ],
@ -183,10 +294,23 @@ export default {
{ required: true, message: "请输入社会信用号", trigger: "change" }, { required: true, message: "请输入社会信用号", trigger: "change" },
], ],
}, },
platformRules: {
platformId: [
{ required: true, message: "请选择自助平台", trigger: "change" },
],
userName: [
{ required: true, message: "请输入账号", trigger: "change" },
],
password: [
{ required: true, message: "请输入密码", trigger: "change" },
],
},
editType: 0, editType: 0,
editTypeMap: { editTypeMap: {
0: "新增往来单位", 0: "新增往来单位",
1: "编辑往来单位", 1: "编辑往来单位",
2: "关联自助平台",
}, },
}; };
}, },
@ -217,7 +341,19 @@ export default {
this.total = 0; this.total = 0;
}); });
}, },
//
getPlatformList() {
this.loading = true;
getPlatform()
.then((response) => {
this.loading = false;
this.platformList = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.platformList = [];
});
},
deleteUnit(data) { deleteUnit(data) {
this.loading = true; this.loading = true;
let tquery = { let tquery = {
@ -239,6 +375,7 @@ export default {
cancelDialog() { cancelDialog() {
this.editDialogVisible = false; this.editDialogVisible = false;
this.editLoginVisible = false;
}, },
handleModifyClick(row) { handleModifyClick(row) {
@ -246,7 +383,11 @@ export default {
this.editDialogVisible = true; this.editDialogVisible = true;
this.editQuery = row; this.editQuery = row;
}, },
handleLinkClick(row) {
this.editType = 2;
this.editLoginVisible = true;
this.editLogin = row;
},
handleAddClick() { handleAddClick() {
this.editType = 0; this.editType = 0;
this.editDialogVisible = true; this.editDialogVisible = true;
@ -311,7 +452,9 @@ export default {
} }
}); });
}, },
intentPlatform(value) {
this.editPlatfromQuery.id = value;
},
deleteDialog(rowId) { deleteDialog(rowId) {
this.$confirm("此操作将永久删除该产品信息, 是否继续?", "提示", { this.$confirm("此操作将永久删除该产品信息, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -323,6 +466,27 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
linkSubmit() {
this.$refs["editLogin"].validate((valid) => {
if (valid) {
linkPlatform(this.editLogin)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "关联成功",
});
this.cancelDialog();
} else {
this.$message.error(response.message);
}
})
.catch(() => {});
}
});
},
exportTxt() {}, exportTxt() {},
@ -339,7 +503,7 @@ export default {
mounted() {}, mounted() {},
created() { created() {
this.getList(); this.getList();
this.getPlatformList();
var pinyin = require("pinyin"); var pinyin = require("pinyin");
console.log( console.log(
pinyin("中心", { pinyin("中心", {

Loading…
Cancel
Save