Commit 0ffce21d authored by “yiyousong”'s avatar “yiyousong”

feat: 新增社保配置

parent 105b52c6
#开发环境
NODE_ENV = "development"
VUE_APP_API_BASE_URL=http://192.168.0.250:11071
VUE_APP_API_IMG_URL=http://192.168.0.250:11071/
# VUE_APP_API_BASE_URL=http://192.168.0.98:11078
# VUE_APP_API_IMG_URL=http://192.168.0.98:11078/
# VUE_APP_API_BASE_URL=http://192.168.0.250:11071
# VUE_APP_API_IMG_URL=http://192.168.0.250:11071/
VUE_APP_API_BASE_URL=http://192.168.0.98:11078
VUE_APP_API_IMG_URL=http://192.168.0.98:11078/
#VUE_APP_API_BASE_URL=http://10.12.185.213:11071
\ No newline at end of file
<template>
<div class="social">
<TabHeader label="社保配置"></TabHeader>
<div class="content">
<div class="control">
<a-space>
<div>
<a-button
type="primary"
style="margin-right: 10px"
@click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
</a-space>
</div>
<YTable
:columns="columns"
:data="tableData"
:pageSize.sync="size"
:page.sync="page"
:total="total"
:loading="loading"
:scroll="{ y: 560 }"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
@changePagination="getDataList"
>
<template slot="action" slot-scope="{ record }">
<a-space size="middle">
<span class="primary pointer" @click="handleEdit(record)"
>编辑</span
>
<span class="delete pointer" @click="handleDel(record.id)"
>删除</span
>
</a-space>
</template>
</YTable>
</div>
<!-- 新增、编辑 -->
<AddSocial
ref="AddSocial"
:show.sync="show"
:title="title"
@success="getDataList"
></AddSocial>
</div>
</template>
<script>
import TabHeader from "@/components/TabHeader";
import YTable from "@/components/YTable.vue";
import local from "@/utils/local";
import { getSocialSetList, delSocialSet } from "@/services/social";
import AddSocial from "./modal/AddSocial.vue";
export default {
components: {
TabHeader,
YTable,
AddSocial,
},
data() {
return {
title: "新增",
show: false,
siteId: local.getLocal("siteId"),
columns: [
{
title: "序号",
width: "65px",
customRender: (text, record, index) => {
return this.page * this.size - this.size + index + 1;
},
},
{
title: "接入标识",
dataIndex: "appid",
},
{
title: "渠道标识",
dataIndex: "accessKey",
},
{
title: "密钥",
dataIndex: "privatKey",
},
{
title: "渠道密钥",
dataIndex: "key",
},
{
title: "机具编码",
dataIndex: "az400",
},
{
title: "机具密钥",
dataIndex: "sm4key",
},
{
title: "排号认证码",
dataIndex: "serviceCode",
},
{
title: "业务认证码",
dataIndex: "busCode",
},
{
title: "统一社会信用代码",
dataIndex: "orgCode",
},
{
title: "备注",
dataIndex: "remark",
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
],
tableData: [],
loading: false,
selectedRowKeys: [],
size: 10,
page: 1,
total: 0,
searchValue: "",
};
},
created() {
this.getDataList();
},
methods: {
async getDataList() {
this.loading = true;
let res = await getSocialSetList({
siteId: this.siteId,
page: this.page,
size: this.size,
});
this.loading = false;
if (res.data.code === 1) {
let { data, total } = res.data.data;
if (!data.length && this.page > 1) {
this.page -= 1;
this.getDataList();
}
this.tableData = data;
this.total = total;
}
},
handleAdd() {
this.title = "新增";
this.$refs.AddSocial.onAdd();
this.show = true;
},
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
handleEdit(row) {
this.title = "新增";
this.$refs.AddSocial.onEdit(row);
this.show = true;
},
handleDel(id) {
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
onOk: async () => {
let res = await delSocialSet({ id });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.selectedRowKeys = [];
this.getDataList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
},
};
</script>
<style lang="less" scoped>
.social {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.content {
flex: 1;
padding: 15px;
.control {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
}
</style>
<template>
<div>
<a-modal
v-model="Visible"
:maskClosable="false"
:title="title"
@cancel="handleClose"
width="45%"
>
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
<a-form-model
ref="ruleForm"
:model="formData"
:rules="rules"
:label-col="{ span: 7 }"
:wrapper-col="{ span: 17 }"
>
<a-row>
<a-col :span="12">
<a-form-model-item label="接入标识" prop="appid">
<a-input v-model="formData.appid" placeholder="请输入接入标识" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="渠道标识" prop="accessKey">
<a-input
v-model="formData.accessKey"
placeholder="请输入渠道标识"
/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="密钥" prop="privatKey">
<a-input v-model="formData.privatKey" placeholder="请输入密钥" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="渠道密钥" prop="key">
<a-input v-model="formData.key" placeholder="请输入渠道密钥" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="机具编码" prop="az400">
<a-input v-model="formData.az400" placeholder="请输入机具编码" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="机具密钥" prop="sm4key">
<a-input
v-model="formData.sm4key"
placeholder="请输入机具密钥"
/> </a-form-model-item
></a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="排号认证码" prop="serviceCode">
<a-input
v-model="formData.serviceCode"
placeholder="请输入排号认证码"
/> </a-form-model-item
></a-col>
<a-col :span="12">
<a-form-model-item label="业务认证码" prop="busCode">
<a-input
v-model="formData.busCode"
placeholder="请输入业务认证码"
/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12"
><a-form-model-item label="机构名称" prop="orgName">
<a-input
v-model="formData.orgName"
placeholder="请输入机构名称"
/> </a-form-model-item
></a-col>
<a-col :span="12">
<a-form-model-item label="机具使用地址" prop="address">
<a-input
v-model="formData.address"
placeholder="请输入机具使用地址"
/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="统一社会信用代码" prop="orgCode">
<a-input
v-model="formData.orgCode"
placeholder="请输入统一社会信用代码"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="区域码" prop="regionCode">
<a-input
v-model="formData.regionCode"
placeholder="请输入区域码"
/>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="备注" prop="remark">
<a-input
type="textarea"
v-model="formData.remark"
placeholder="请输入备注"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="启用开关" prop="enabled">
<YSwitch v-model="formData.enabled"></YSwitch>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveSocialSet } from "@/services/social";
import YSwitch from "@/components/yswitch/YSwitch.vue";
import local from "@/utils/local";
export default {
props: {
title: {
required: true,
type: String,
default: "",
},
show: {
type: Boolean,
required: true,
default: false,
},
},
components: {
YSwitch,
},
data() {
return {
formData: {
siteId: local.getLocal("siteId"),
appid: "", // 渠道标识
accessKey: "", // 接入标识
privatKey: "", // 密钥
key: "", // 渠道密钥
az400: "", // 机具编码
sm4key: "", // 机具密钥
serviceCode: "", // 排号认证码
enabled: 1, // 起停用
remark: "", // 备注
busCode: "", // 业务认证码
orgName: "", // 机构名称
address: "", // 机具使用地址
regionCode: "", // 区域码
orgCode: "", // 统一社会信用代码
},
rules: {
appid: [{ required: true, message: "请输入渠道标识", trigger: "blur" }],
accessKey: [
{ required: true, message: "请输入接入标识", trigger: "blur" },
],
privatKey: [{ required: true, message: "请输入密钥", trigger: "blur" }],
key: [{ required: true, message: "请输入渠道密钥", trigger: "blur" }],
},
};
},
computed: {
Visible: {
get() {
return this.show;
},
set(val) {
this.$emit("update:show", val);
},
},
},
methods: {
// 新增
onAdd() {
Object.assign(this.formData, this.$options.data().formData);
this.formData.id && this.$delete(this.formData, "id");
},
// 编辑
onEdit(data) {
this.$nextTick(() => {
this.formData = { ...data };
});
},
// 关闭弹窗
handleClose() {
this.handleReset();
this.Visible = false;
},
// 保存
handleOk() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
let res = await saveSocialSet(this.formData);
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.$emit("success");
this.handleClose();
}
}
});
},
// 重置
handleReset() {
this.$refs.ruleForm.resetFields();
},
},
};
</script>
<style lang="less" scoped></style>
......@@ -230,6 +230,14 @@ const options = {
},
component: () => import("@/pages/basicset/sms/configurat"),
},
{
path: "/social",
name: "社保配置",
meta: {
icon: "contacts",
},
component: () => import("@/pages/basicset/social/Social"),
},
// {
// path: "/appmarket",
......
......@@ -423,4 +423,12 @@ module.exports = {
save: `${BASE_URL}/base/device/blackapp/save`,
delete: `${BASE_URL}/base/device/blackapp/delete`,
},
// 社保管理
social: {
list: `${BASE_URL}/base/social/security/set/list`,
info: `${BASE_URL}/base/social/security/set/info`,
save: `${BASE_URL}/base/social/security/set/save`,
batchSave: `${BASE_URL}/base/social/security/set/batchSave`,
delete: `${BASE_URL}/base/social/security/set/delete`,
},
};
import { social } from "@/services/basicsetApi";
import { request, METHOD } from "@/utils/request";
// 获取社保配置列表
export async function getSocialSetList(data) {
return request(social.list, METHOD.POST, data);
}
// 查看社保配置信息
export async function getSocialSetInfo(data) {
return request(social.info, METHOD.GET, data);
}
// 保存社保配置
export async function saveSocialSet(data) {
return request(social.save, METHOD.POST, data);
}
// 批量保存社保配置
export async function saveSocialSetBatch(data) {
return request(social.batchSave, METHOD.POST, data);
}
// 删除社保配置
export async function delSocialSet(data) {
return request(social.delete, METHOD.GET, 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