同步修改,联动控制

master
anthonywj 3 years ago
parent b167e01e1d
commit d6f18634db

@ -284,15 +284,6 @@ export const asyncRouterMap = [
}, },
{
path: "phoneRegisterManage",
component: phoneRegisterManage,
name: "设备管理",
icon: "",
meta: {
authRule: ["admin/phoneRegisterManage"]
}
},
{ {
path: "/systemParam", path: "/systemParam",
@ -304,6 +295,15 @@ export const asyncRouterMap = [
authRule: ["systemParam/systemParamConfig"] authRule: ["systemParam/systemParamConfig"]
}, },
children: [ children: [
{
path: "phoneRegisterManage",
component: phoneRegisterManage,
name: "设备管理",
icon: "",
meta: {
authRule: ["admin/phoneRegisterManage"]
}
},
{ {
path: "systemParamConfig", path: "systemParamConfig",
component: systemParamConfig, component: systemParamConfig,
@ -330,22 +330,9 @@ export const asyncRouterMap = [
authRule: ["product/BussinessTypeLocl"] authRule: ["product/BussinessTypeLocl"]
} }
}, },
{
path: "bussinessTypeThird",
name: "第三方单据类型",
component: bussinessTypeThird,
meta: {
authRule: ["system/bussinessTypeThird"]
}
},
{
path: "thirdSys",
name: "第三方系统",
component: thirdSys,
meta: {
authRule: ["thrsys/thirdSys"]
}
},
] ]
}, },
@ -402,7 +389,7 @@ export const asyncRouterMap = [
{ {
path: "spsSyncData", path: "spsSyncData",
component: spsSyncData, component: spsSyncData,
name: "数据同步", name: "同步记录",
icon: "", icon: "",
meta: { meta: {
authRule: ["spsSyncMange/spsSyncData"] authRule: ["spsSyncMange/spsSyncData"]
@ -411,6 +398,39 @@ export const asyncRouterMap = [
] ]
}, },
{
path: "/thrsysMange",
component: Empty,
name: "第三方系统",
redirect: "/thrsysMange/bussinessTypeThird",
icon: "",
meta: {
authRule: ["thrsysMange/manage"]
},
children: [
{
path: "bussinessTypeThird",
name: "单据类型",
component: bussinessTypeThird,
meta: {
authRule: ["thrsysMange/bussinessTypeThird"]
}
},
{
path: "thirdSys",
name: "接口设置",
component: thirdSys,
meta: {
authRule: ["thrsysMange/thirdSys"]
}
},
]
},
// { // {
// path: "systemPDFTemplate", // path: "systemPDFTemplate",
// component: systemPDFTemplate, // component: systemPDFTemplate,
@ -538,149 +558,8 @@ export const asyncRouterMap = [
}, },
] ]
}, },
{
path: "/thrsys",
redirect: "/thrsys/manage",
name: "第三方数据",
component: Empty,
meta: {
authRule: ["thrsys/manage"]
},
children: [
{
path: "thrInvWarehouse",
component: thrInvWarehouse,
name: "仓库信息",
icon: "",
meta: {
authRule: ["thrsys/thrInvWarehouse"]
}
},
{
path: "/corps",
redirect: "/corps/ThrCorps",
name: "往来单位",
component: Empty,
meta: {
authRule: ["thrsys/corp"]
},
children: [
{
path: "ThrCorps",
name: "往来单位查询",
component: ThrCorps,
meta: {
authRule: ["thrsys/ThrCorps"]
}
},
{
path: "thrCorpsImport",
name: "往来单位导入",
component: thrCorpsImport,
meta: {
authRule: ["thrsys/thrCorpsImport"]
}
},
// {
// path: "thrCorpsExport",
// name: "往来单位导出",
// component: thrCorpsExport,
// meta: {
// authRule: ["thrsys/thrCorpsExport"]
// }
// }
],
},
{
path: "/products",
redirect: "/products/thrProducts",
name: "产品信息",
component: Empty,
meta: {
authRule: ["thrsys/products"]
},
children: [
{
path: "thrProducts",
name: "产品信息查询",
component: thrProducts,
meta: {
authRule: ["thrsys/thrProducts"]
}
},
{
path: "thrProductsImport",
name: "产品信息导入",
component: thrProductsImport,
meta: {
authRule: ["thrsys/thrProductsImport"]
}
},
],
},
{
path: "/orders",
redirect: "/orders/ThrOrders",
name: "业务单据",
component: Empty,
meta: {
authRule: ["thrsys/orders"]
},
children: [
{
path: "ThrOrders",
name: "业务单据查询",
component: ThrOrders,
meta: {
authRule: ["thrsys/ThrOrders"]
}
},
{
path: "thrOrderImport",
name: "业务单据导入",
component: thrOrderImport,
meta: {
authRule: ["thrsys/thrOrderImport"]
}
},
],
},
{
path: "/udplatGoods",
redirect: "/udplatGoods/ThrOrders",
name: "阳光采购平台",
hidden: true,
component: Empty,
meta: {
authRule: ["thrsys/udplatGoods"]
},
children: [
{
path: "thrUdplatGoods",
name: "阳光采购平台查询",
component: udplatGoods,
meta: {
authRule: ["thrsys/thrUdplatGoods"]
}
},
{
path: "thrUdplatGoodsImport",
name: "阳光采购平台导入",
component: udplatGoodsImport,
meta: {
authRule: ["thrsys/thrUdplatGoodsImport"]
}
},
],
},
]
}
] ]
}, },
@ -1089,6 +968,150 @@ export const asyncRouterMap = [
// } // }
// }, // },
{
path: "/thrsys",
redirect: "/thrsys/manage",
name: "第三方数据",
component: Home,
icon: "tongyong",
meta: {
authRule: ["thrsys/manage"]
},
children: [
{
path: "thrInvWarehouse",
component: thrInvWarehouse,
name: "仓库信息",
icon: "",
meta: {
authRule: ["thrsys/thrInvWarehouse"]
}
},
{
path: "/corps",
redirect: "/corps/ThrCorps",
name: "往来单位",
component: Empty,
meta: {
authRule: ["thrsys/corp"]
},
children: [
{
path: "ThrCorps",
name: "往来单位查询",
component: ThrCorps,
meta: {
authRule: ["thrsys/ThrCorps"]
}
},
{
path: "thrCorpsImport",
name: "往来单位导入",
component: thrCorpsImport,
meta: {
authRule: ["thrsys/thrCorpsImport"]
}
},
// {
// path: "thrCorpsExport",
// name: "往来单位导出",
// component: thrCorpsExport,
// meta: {
// authRule: ["thrsys/thrCorpsExport"]
// }
// }
],
},
{
path: "/products",
redirect: "/products/thrProducts",
name: "产品信息",
component: Empty,
meta: {
authRule: ["thrsys/products"]
},
children: [
{
path: "thrProducts",
name: "产品信息查询",
component: thrProducts,
meta: {
authRule: ["thrsys/thrProducts"]
}
},
{
path: "thrProductsImport",
name: "产品信息导入",
component: thrProductsImport,
meta: {
authRule: ["thrsys/thrProductsImport"]
}
},
],
},
{
path: "/orders",
redirect: "/orders/ThrOrders",
name: "业务单据",
component: Empty,
meta: {
authRule: ["thrsys/orders"]
},
children: [
{
path: "ThrOrders",
name: "业务单据查询",
component: ThrOrders,
meta: {
authRule: ["thrsys/ThrOrders"]
}
},
{
path: "thrOrderImport",
name: "业务单据导入",
component: thrOrderImport,
meta: {
authRule: ["thrsys/thrOrderImport"]
}
},
],
},
{
path: "/udplatGoods",
redirect: "/udplatGoods/ThrOrders",
name: "阳光采购平台",
hidden: true,
component: Empty,
meta: {
authRule: ["thrsys/udplatGoods"]
},
children: [
{
path: "thrUdplatGoods",
name: "阳光采购平台查询",
component: udplatGoods,
meta: {
authRule: ["thrsys/thrUdplatGoods"]
}
},
{
path: "thrUdplatGoodsImport",
name: "阳光采购平台导入",
component: udplatGoodsImport,
meta: {
authRule: ["thrsys/thrUdplatGoodsImport"]
}
},
],
},
]
},
{ {
path: "/supplier", path: "/supplier",
redirect: "/supplier/basicInstrumentMaintain", redirect: "/supplier/basicInstrumentMaintain",

@ -27,20 +27,21 @@
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button> <el-button type="primary" icon="search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="handleAddClick" <el-button type="primary" icon="search" @click="handleAddClick"
:disabled="!configParms.typeScan"
>新增 >新增
</el-button </el-button
> >
<el-upload <!-- <el-upload-->
:action="uploadFileUrl" <!-- :action="uploadFileUrl"-->
multiple <!-- multiple-->
:limit="3" <!-- :limit="3"-->
:headers="headers" <!-- :headers="headers"-->
:show-file-list="false" <!-- :show-file-list="false"-->
:on-success="handleChange" <!-- :on-success="handleChange"-->
:file-list="fileList" <!-- :file-list="fileList"-->
> <!-- >-->
<el-button size="mini" type="primary">导入单据类型</el-button> <!-- <el-button size="mini" type="primary">导入单据类型</el-button>-->
</el-upload> <!-- </el-upload>-->
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
@ -153,6 +154,7 @@ import {
import modifyDialog from "./BussinessTypeModify"; import modifyDialog from "./BussinessTypeModify";
import axios from "axios"; import axios from "axios";
import store from "@/store"; import store from "@/store";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
export default { export default {
data() { data() {
@ -216,6 +218,7 @@ export default {
multipleSelection: [], multipleSelection: [],
uploadFileUrl: null, uploadFileUrl: null,
headers: {}, headers: {},
configParms: {},
}; };
}, },
@ -391,6 +394,16 @@ export default {
ADMIN_TOKEN: store.getters.token, ADMIN_TOKEN: store.getters.token,
}; };
}, },
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
},
}, },
components: { components: {
modifyDialog, modifyDialog,
@ -399,7 +412,9 @@ export default {
}, },
created() { created() {
this.init(); this.init();
this.getSyncConfig();
this.getList(); this.getList();
}, },
}; };
</script> </script>

@ -14,6 +14,7 @@
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button> <el-button type="primary" icon="search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="handleAddClick" <el-button type="primary" icon="search" @click="handleAddClick"
:disabled="!configParms.typeBus"
>新增 >新增
</el-button </el-button
> >
@ -119,6 +120,7 @@
import {getLocalBusType, addLocalBusType, updateLocalBusType, deleteLocalBusType} from "@/api/basic/busLocalType"; import {getLocalBusType, addLocalBusType, updateLocalBusType, deleteLocalBusType} from "@/api/basic/busLocalType";
import modifyDialog from "./BussinessTypeLoclModify"; import modifyDialog from "./BussinessTypeLoclModify";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
export default { export default {
data() { data() {
@ -156,6 +158,7 @@ export default {
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
configParms: {},
}; };
}, },
@ -295,6 +298,16 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
},
}, },
components: { components: {
modifyDialog, modifyDialog,
@ -302,6 +315,7 @@ export default {
mounted() { mounted() {
}, },
created() { created() {
this.getSyncConfig();
this.getList(); this.getList();
}, },
}; };

@ -29,10 +29,11 @@
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button> <el-button type="primary" icon="search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="handleAddClick" <el-button type="primary" icon="search" @click="handleAddClick"
:disabled="!configParms.typeBus"
>新增 >新增
</el-button </el-button
> >
<el-button type="primary" icon="search" @click="updateDownload"></el-button> <!-- <el-button type="primary" icon="search" @click="updateDownload"></el-button>-->
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
@ -125,6 +126,7 @@ import {
import modifyDialog from "./BussinessTypeThirdModify"; import modifyDialog from "./BussinessTypeThirdModify";
import axios from "axios"; import axios from "axios";
import {getBasicThirdSys} from "@/api/basic/basicThirdSys"; import {getBasicThirdSys} from "@/api/basic/basicThirdSys";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
export default { export default {
data() { data() {
@ -155,6 +157,7 @@ export default {
multipleSelection: [], multipleSelection: [],
uploadFileUrl: null, uploadFileUrl: null,
loading: false, loading: false,
configParms: {},
}; };
}, },
@ -333,6 +336,16 @@ export default {
this.getList(); this.getList();
} }
}, },
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
},
}, },
components: { components: {
modifyDialog, modifyDialog,
@ -341,6 +354,7 @@ export default {
}, },
created() { created() {
this.init(); this.init();
this.getSyncConfig();
this.getBasicThirdSys(); this.getBasicThirdSys();
this.getList(); this.getList();

@ -246,7 +246,7 @@
> >
<selectDiDetail :editQuery="diDetails" <selectDiDetail :editQuery="diDetails"
></selectDiDetail> ></selectDiDetail>
</el-dialog>- </el-dialog>
</div> </div>
</template> </template>

@ -10,7 +10,7 @@
同步服务 同步服务
</template> </template>
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="6" class="el-col" style="margin-top: 6px"> <el-col :span="6" class="el-col" >
<el-switch <el-switch
v-model="configQuery.downstreamEnable" v-model="configQuery.downstreamEnable"
@ -20,7 +20,7 @@
</el-col> </el-col>
<el-col :span="14" class="el-col"> <el-col :span="14" class="el-col">
<div> <div>
<span style="color: red;margin-top: 16px">说明:&nbsp;修改同步参数时,请关闭数据同步服务 </span> <span style="color: red;">说明:&nbsp;修改同步参数时,请关闭数据同步服务 </span>
</div> </div>
</el-col> </el-col>
@ -40,7 +40,7 @@
style="width: 100px" style="width: 100px"
size="small" size="small"
type="number" type="number"
v-model="configQuery.syncTime" v-model="configQuery.syncTime" :disabled="configQuery.downstreamEnable"
splaceholder="请输入内容" splaceholder="请输入内容"
></el-input> ></el-input>
</div> </div>

@ -32,10 +32,24 @@
<el-button-group style="display:flex;"> <el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button> <el-button type="primary" icon="search" @click="getList"></el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(1)"></el-button> <el-button type="primary" icon="search" @click="createScheduleDialog(1)"
<el-button type="primary" icon="search" @click="createScheduleDialog(2)"></el-button> :disabled="!configParms.orderScanFinish&& !configParms.orderUnReceive&& !configParms.orderUnCheck"
<el-button type="primary" icon="search" @click="createScheduleDialog(3)"></el-button> >同步单据
<el-button type="primary" icon="search" @click="createScheduleDialog(4)">DI</el-button> </el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(2)"
:disabled="!configParms.typeBus&& !configParms.typeScan&& !configParms.typeThird">
同步单据类型
</el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(3)"
:disabled="!configParms.basicProducts&& !configParms.basicCorp&&
!configParms.basicInv&&!configParms.basicThirdProducts&& !configParms.basicThirdCorp&& !configParms.basicThirdInv
&& !configParms.basicThirdBusOrder&& !configParms.sysUser"
>同步基础信息
</el-button>
<el-button type="primary" icon="search" @click="createScheduleDialog(4)"
:disabled="!configParms.dbDiProducts">同步国家库DI数据
</el-button>
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
</el-row> </el-row>
@ -178,6 +192,7 @@ export default {
templateDlUrl: null, templateDlUrl: null,
checked: false, checked: false,
syncTime: null, syncTime: null,
configParms: {},
}; };
}, },
@ -260,7 +275,7 @@ export default {
createScheduleDialog(type) { createScheduleDialog(type) {
if (this.$isNotBlank(this.syncTime)) { if (this.$isNotBlank(this.syncTime)) {
this.$confirm("此操作将从"+this.syncTime+"开始同步最新数据,是否继续", "提示", { this.$confirm("此操作将从" + this.syncTime + "开始同步最新数据,是否继续", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
@ -352,8 +367,17 @@ export default {
2: "danger", 2: "danger",
}; };
return statusMap[status]; return statusMap[status];
} },
, getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
},
}, },
mounted() { mounted() {
@ -364,6 +388,7 @@ export default {
ADMIN_ID: store.getters.adminId, ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token, ADMIN_TOKEN: store.getters.token,
}; };
this.getSyncConfig();
this.getList(); this.getList();
this.getConfig(); this.getConfig();
}, },

@ -1,456 +1,470 @@
<template> <template>
<div> <div>
<el-card> <el-card>
<el-form :inline="true" :model="query" class="query-form" size="mini"> <el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="query.userName" placeholder="用户账号"></el-input> <el-input v-model="query.userName" placeholder="用户账号"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="query.userFlag" placeholder="状态"> <el-select v-model="query.userFlag" placeholder="状态">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="禁用" value="0"></el-option> <el-option label="禁用" value="0"></el-option>
<el-option label="正常" value="1"></el-option> <el-option label="正常" value="1"></el-option>
<el-option label="未验证" value="2"></el-option> <el-option label="未验证" value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <!--
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="query.roleId" placeholder="角色"> <el-select v-model="query.roleId" placeholder="角色">
<el-option label="全部角色" value=""></el-option> <el-option label="全部角色" value=""></el-option>
<el-option v-for="item in roles" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in roles" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
--> -->
<el-form-item> <el-form-item>
<el-button-group> <el-button-group>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="onReset" @click="onReset"
></el-button> ></el-button>
<el-button type="primary" icon="search" @click="onSubmit" <el-button type="primary" icon="search" @click="onSubmit"
>查询 >查询
</el-button </el-button
>
<el-button type="primary" @click.native="handleForm(null, null)"
>新增
</el-button
>
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="用户账号" prop="userName" fixed></el-table-column>
<el-table-column label="用户名称" prop="employeeName" fixed>
</el-table-column>
<el-table-column label="状态" fixed="">
<template slot-scope="scope">
<el-tag :type="scope.row.userFlag | statusFilterType">{{
scope.row.userFlag | statusFilterName
}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="comments" fixed></el-table-column>
<el-table-column
label="登录时间"
with="300"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span> {{ scope.row.lastLoginTime }}</span>
<!-- <span>{{ formatTime(scope.row.lastLoginTime,"yyyy-MM-dd") }}</span> -->
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="handleForm(scope.$index, scope.row)"
>编辑
</el-button>
<el-button
type="text"
size="small"
:disabled="scope.row.id === 1"
@click.native="handleDel(scope.$index, scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="query.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
> >
</el-pagination> <el-button type="primary" @click.native="handleForm(null, null)"
:disabled="!configParms.sysUser && query.customerId == 110"
<!--表单--> >新增
<el-dialog </el-button
:title="formMap[formName]"
:visible.sync="formVisible"
:before-close="hideForm"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="70%"
top="5vh"
> >
<el-form :model="formData" :rules="formRules" ref="dataForm"> </el-button-group>
<el-row :gutter="20" class="el-row" type="flex"> </el-form-item>
<el-col :span="10" class="el-col" type="flex"> </el-form>
<div class="text item"> <el-table v-loading="loading" :data="list" style="width: 100%">
<el-form-item label="用户账号" prop="userName"> <el-table-column label="用户账号" prop="userName" fixed></el-table-column>
<el-input v-model="formData.userName" size="small"></el-input> <el-table-column label="用户名称" prop="employeeName" fixed>
</el-form-item> </el-table-column>
</div> <el-table-column label="状态" fixed="">
</el-col> <template slot-scope="scope">
<el-col :span="10" class="el-col"> <el-tag :type="scope.row.userFlag | statusFilterType">{{
<div class="text item"> scope.row.userFlag | statusFilterName
<div class="text item"> }}
<el-form-item label="用户名称" prop="employeeName"> </el-tag>
<el-input v-model="formData.employeeName" size="small"></el-input> </template>
</el-form-item> </el-table-column>
</div> <el-table-column label="备注" prop="comments" fixed></el-table-column>
</div> <el-table-column
</el-col> label="登录时间"
</el-row> with="300"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span> {{ scope.row.lastLoginTime }}</span>
<!-- <span>{{ formatTime(scope.row.lastLoginTime,"yyyy-MM-dd") }}</span> -->
</template>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native="handleForm(scope.$index, scope.row)"
>编辑
</el-button>
<el-button
type="text"
size="small"
:disabled="scope.row.id === 1"
@click.native="handleDel(scope.$index, scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row :gutter="20" class="el-row" type="flex"> <el-pagination
<el-col :span="10" class="el-col" type="flex"> :page-size="query.limit"
<div class="text item"> @current-change="handleCurrentChange"
<el-form-item label="登录密码" prop="passWord"> layout="prev, pager, next"
<el-input :total="total"
type="password" >
size="small" </el-pagination>
v-model="formData.passWord"
></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div class="text item">
<div class="text item">
<el-form-item label="确认密码" prop="checkPassword">
<el-input
type="password"
size="small"
v-model="formData.checkPassword"
></el-input>
</el-form-item>
</div>
</div>
</el-col>
</el-row>
<el-form-item label="状态" prop="userFlag"> <!--表单-->
<el-radio-group v-model="formData.userFlag" :disabled="formData.id === 1"> <el-dialog
<el-radio :label="0">禁用</el-radio> :title="formMap[formName]"
<el-radio :label="1">正常</el-radio> :visible.sync="formVisible"
<!-- <el-radio :label="2">未验证</el-radio>--> :before-close="hideForm"
</el-radio-group> :close-on-click-modal="false"
</el-form-item> :close-on-press-escape="false"
<el-form-item label="角色"> width="70%"
<el-checkbox-group v-model="formData.roles" :disabled="formData.id === 1"> top="5vh"
<el-checkbox >
v-for="item in roles" <el-form :model="formData" :rules="formRules" ref="dataForm">
:key="item.id" <el-row :gutter="20" class="el-row" type="flex">
:label="item.id" <el-col :span="10" class="el-col" type="flex">
>{{ item.name }} <div class="text item">
</el-checkbox <el-form-item label="用户账号" prop="userName">
> <el-input v-model="formData.userName" size="small"></el-input>
</el-checkbox-group> </el-form-item>
</el-form-item> </div>
</el-form> </el-col>
<div slot="footer" class="dialog-footer"> <el-col :span="10" class="el-col">
<el-button @click.native="hideForm" size="small">取消</el-button> <div class="text item">
<el-button <div class="text item">
type="primary" <el-form-item label="用户名称" prop="employeeName">
<el-input v-model="formData.employeeName" size="small"></el-input>
</el-form-item>
</div>
</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="passWord">
<el-input
type="password"
size="small"
v-model="formData.passWord"
></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="10" class="el-col">
<div class="text item">
<div class="text item">
<el-form-item label="确认密码" prop="checkPassword">
<el-input
type="password"
size="small" size="small"
@click.native="formSubmit()" v-model="formData.checkPassword"
:loading="formLoading" ></el-input>
>提交 </el-form-item>
</el-button
>
</div> </div>
</el-dialog> </div>
</el-card> </el-col>
</div> </el-row>
<el-form-item label="状态" prop="userFlag">
<el-radio-group v-model="formData.userFlag" :disabled="formData.id === 1">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
<!-- <el-radio :label="2">未验证</el-radio>-->
</el-radio-group>
</el-form-item>
<el-form-item label="角色">
<el-checkbox-group v-model="formData.roles" :disabled="formData.id === 1">
<el-checkbox
v-for="item in roles"
:key="item.id"
:label="item.id"
>{{ item.name }}
</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm" size="small">取消</el-button>
<el-button
type="primary"
size="small"
@click.native="formSubmit()"
:loading="formLoading"
>提交
</el-button
>
</div>
</el-dialog>
</el-card>
</div>
</template> </template>
<script> <script>
import { import {
authAdminList, authAdminList,
authAdminRoleList, authAdminRoleList,
authAdminSave, authAdminSave,
authAdminDelete, authAdminDelete,
roleCustomers roleCustomers
} from "../../../api/auth/authAdmin"; } from "../../../api/auth/authAdmin";
import store from "../../../store/index"; import store from "../../../store/index";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
const formJson = { const formJson = {
id: "", id: "",
passWord: "", passWord: "",
userName: "", userName: "",
checkPassword: "", checkPassword: "",
employeeName: "", employeeName: "",
userFlag: 1, userFlag: 1,
roles: [] roles: []
}; };
export default { export default {
data() { data() {
let validatePass = (rule, value, callback) => { let validatePass = (rule, value, callback) => {
if (value === "") { if (value === "") {
callback(new Error("请输入密码")); callback(new Error("请输入密码"));
} else { } else {
callback(); callback();
} }
}; };
let validatePass2 = (rule, value, callback) => { let validatePass2 = (rule, value, callback) => {
if (value === "") { if (value === "") {
callback(new Error("请再次输入密码")); callback(new Error("请再次输入密码"));
} else if (value !== this.formData.passWord) { } else if (value !== this.formData.passWord) {
callback(new Error("两次输入密码不一致!")); callback(new Error("两次输入密码不一致!"));
} else { } else {
callback(); callback();
} }
}; };
return { return {
roles: [], roles: [],
query: { query: {
userName: "", userName: "",
userFlag: "", userFlag: "",
page: 1, page: 1,
limit: 20, limit: 20,
roleId: "", roleId: "",
customerId: store.getters.customerId, customerId: store.getters.customerId,
}, },
list: [], list: [],
total: 0, total: 0,
loading: true, loading: true,
index: null, index: null,
formName: null, formName: null,
formMap: { formMap: {
add: "新增", add: "新增",
edit: "编辑" edit: "编辑"
}, },
formLoading: false, formLoading: false,
formVisible: false, formVisible: false,
formData: formJson, formData: formJson,
formRules: {}, configParms: {},
addRules: { formRules: {},
userName: [ addRules: {
{required: true, message: "请输入姓名", trigger: "blur"} userName: [
], {required: true, message: "请输入姓名", trigger: "blur"}
passWord: [ ],
{required: true, message: "请输入密码", trigger: "blur"}, passWord: [
{validator: validatePass, trigger: "blur"} {required: true, message: "请输入密码", trigger: "blur"},
], {validator: validatePass, trigger: "blur"}
checkPassword: [ ],
{ checkPassword: [
required: true, {
message: "请再次输入密码", required: true,
trigger: "blur" message: "请再次输入密码",
}, trigger: "blur"
{validator: validatePass2, trigger: "blur"} },
], {validator: validatePass2, trigger: "blur"}
userFlag: [ ],
{required: true, message: "请选择状态", trigger: "change"} userFlag: [
] {required: true, message: "请选择状态", trigger: "change"}
}, ]
editRules: { },
userName: [ editRules: {
{required: true, message: "请输入姓名", trigger: "blur"} userName: [
], {required: true, message: "请输入姓名", trigger: "blur"}
userFlag: [ ],
{required: true, message: "请选择状态", trigger: "change"} userFlag: [
] {required: true, message: "请选择状态", trigger: "change"}
}, ]
deleteLoading: false },
}; deleteLoading: false
};
},
methods: {
onReset() {
this.$router.push({
path: ""
});
this.query = {
userName: "",
userFlag: "",
page: 1,
limit: 20,
roleId: "",
customerId: store.getters.customerId,
};
this.getList();
}, },
methods: { onSubmit() {
onReset() { this.$router.push({
this.$router.push({ path: "",
path: "" query: this.query
}); });
this.query = { this.getList();
userName: "", },
userFlag: "", handleCurrentChange(val) {
page: 1, this.query.page = val;
limit: 20, this.getList();
roleId: "", },
customerId: store.getters.customerId, getList() {
}; this.loading = true;
this.getList(); authAdminList(this.query)
}, .then(response => {
onSubmit() { this.loading = false;
this.$router.push({ this.list = response.data.list || [];
path: "", this.total = response.data.total || 0;
query: this.query })
}); .catch(() => {
this.getList(); this.loading = false;
}, this.list = [];
handleCurrentChange(val) { this.total = 0;
this.query.page = val; this.roles = [];
this.getList(); });
}, },
getList() { getRoleList() {
this.loading = true; roleCustomers(this.query)
authAdminList(this.query) .then(response => {
.then(response => { this.roles = response.data.list || [];
this.loading = false; })
this.list = response.data.list || []; .catch(() => {
this.total = response.data.total || 0; this.roles = [];
}) });
.catch(() => { },
this.loading = false; //
this.list = []; resetForm() {
this.total = 0; if (this.$refs["dataForm"]) {
this.roles = []; //
}); this.$refs["dataForm"].clearValidate();
},
getRoleList() {
roleCustomers(this.query)
.then(response => {
this.roles = response.data.list || [];
})
.catch(() => {
this.roles = [];
});
},
// //
resetForm() { this.$refs["dataForm"].resetFields();
if (this.$refs["dataForm"]) { }
// },
this.$refs["dataForm"].clearValidate(); //
// hideForm() {
this.$refs["dataForm"].resetFields(); //
} this.formVisible = !this.formVisible;
}, //
// this.$refs["dataForm"].resetFields();
hideForm() { return true;
// },
this.formVisible = !this.formVisible; //
// handleForm(index, row) {
this.$refs["dataForm"].resetFields(); this.formVisible = true;
return true; this.formData = JSON.parse(JSON.stringify(formJson));
}, if (row !== null) {
// this.formData = Object.assign({}, row);
handleForm(index, row) { }
this.formVisible = true; this.formName = "add";
this.formData = JSON.parse(JSON.stringify(formJson)); this.formRules = this.addRules;
if (row !== null) { if (index !== null) {
this.formData = Object.assign({}, row); this.index = index;
} this.formName = "edit";
this.formName = "add"; this.formRules = this.editRules;
this.formRules = this.addRules; }
if (index !== null) { },
this.index = index; formSubmit() {
this.formName = "edit"; console.log(
this.formRules = this.editRules; this.formData.userName +
"-----" +
this.formData.employeeName +
this.formData.userFlag
);
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.formLoading = true;
let data = Object.assign({}, this.formData);
authAdminSave(data, this.formName).then(response => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
} }
}, this.$message.success("操作成功");
formSubmit() { this.formVisible = false;
console.log( if (this.formName === "add") {
this.formData.userName + //
"-----" + if (response.data && response.data.id) {
this.formData.employeeName + data.id = response.data.id;
this.formData.userFlag this.list.unshift(data);
); }
this.$refs["dataForm"].validate(valid => { } else {
if (valid) { this.list.splice(this.index, 1, data);
this.formLoading = true;
let data = Object.assign({}, this.formData);
authAdminSave(data, this.formName).then(response => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName === "add") {
//
if (response.data && response.data.id) {
data.id = response.data.id;
this.list.unshift(data);
}
} else {
this.list.splice(this.index, 1, data);
}
//
this.resetForm();
});
}
});
},
//
handleDel(index, row) {
if (row.id) {
this.$confirm("确认删除该记录吗?", "提示", {
type: "warning"
})
.then(() => {
let para = {id: row.id};
this.deleteLoading = true;
authAdminDelete(para)
.then(response => {
this.deleteLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
//
this.list.splice(index, 1);
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
} }
//
this.resetForm();
});
} }
});
}, },
filters: { //
statusFilterType(status) { handleDel(index, row) {
const statusMap = { if (row.id) {
0: "gray", this.$confirm("确认删除该记录吗?", "提示", {
1: "success", type: "warning"
2: "danger" })
}; .then(() => {
return statusMap[status]; let para = {id: row.id};
}, this.deleteLoading = true;
statusFilterName(status) { authAdminDelete(para)
const statusMap = { .then(response => {
0: "禁用", this.deleteLoading = false;
1: "正常", if (response.code !== 20000) {
2: "未验证" this.$message.error(response.message);
}; return false;
return statusMap[status]; }
} this.$message.success("操作成功");
//
this.list.splice(index, 1);
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},
getSyncConfig() {
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
}, },
mounted() { },
filters: {
statusFilterType(status) {
const statusMap = {
0: "gray",
1: "success",
2: "danger"
};
return statusMap[status];
}, },
created() { statusFilterName(status) {
// const statusMap = {
let query = this.$route.query; 0: "禁用",
this.query = Object.assign(this.query, query); 1: "正常",
this.query.limit = parseInt(this.query.limit); 2: "未验证"
// };
this.getList(); return statusMap[status];
//
this.getRoleList();
} }
},
mounted() {
},
created() {
//
let query = this.$route.query;
this.query = Object.assign(this.query, query);
this.query.limit = parseInt(this.query.limit);
//
this.getList();
//
this.getRoleList();
this.getSyncConfig();
}
}; };
</script> </script>

Loading…
Cancel
Save