身份验证

This commit is contained in:
杰 朱
2021-05-22 16:38:37 +08:00
parent edae082c51
commit bc15722b6f
13 changed files with 245 additions and 28 deletions

View File

@@ -74,6 +74,7 @@
<Compile Include="Request\PoOrderRequest.cs" />
<Compile Include="Request\SnOrderRequest.cs" />
<Compile Include="Request\SaleOrderRequest.cs" />
<Compile Include="Request\Userrequest.cs" />
<Compile Include="Response\MOM\Bom.cs" />
<Compile Include="Response\Pmc\PmcInventoryallRes.cs" />
<Compile Include="Response\Pmc\PmcInventorymomRes.cs" />

View File

@@ -11,8 +11,10 @@ namespace NX.ERP.Model.Request
public List<string> moCodes { get; set; }
public IEnumerable<string> InvCodes { get; set; }
public IEnumerable<string> InvCodes1 { get; set; }
public bool byFinish { get; set; }
public IEnumerable<string> byFinish { get; set; }
public bool byiss { get; set; }

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model.Request
{
public class Userrequest : BaseModel
{
private string opnanme;
private string pasd;
public string Pasd { get => pasd; set => pasd = value; }
public string Opnanme { get => opnanme; set => opnanme = value; }
}
}

View File

@@ -66,6 +66,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Base\SupplierDAL.cs" />
<Compile Include="Account\Accinformation.cs" />
<Compile Include="System\User.cs" />
<Compile Include="U8LoginContext.cs" />
<Compile Include="Base\UnitDAL.cs" />
<Compile Include="Base\WarehouseDAL.cs" />
@@ -128,5 +129,6 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -307,13 +307,17 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
{
where.Add(" mmm.mocode in @moCodes");
}
if (info.InvCodes!= null )
if (info.InvCodes != null)
{
where.Add(" mmm.InvCode in @invcode");
}
if (info.InvCodes1!= null )
{
where.Add(" mmm.invcode1 in @invcode1");
}
if (!info.byFinish)
if (info.byFinish != null)
{
where.Add(" mmm.Status <> 4");
where.Add(" mmm.Status in @byFinish");
}
if (!info.byiss)
{
@@ -333,7 +337,7 @@ SELECT m..mocode, md.SortSeq, md.InvCode, p.cInvName, p.cInvStd,KK.cComUnitNam
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{
return conn.Query<NX.ERP.Model.PmcInventorymomRes>(sql, new { moCodes = info.moCodes, invcode1=info.InvCodes });
return conn.Query<NX.ERP.Model.PmcInventorymomRes>(sql, new { moCodes = info.moCodes, invcode = info.InvCodes, invcode1=info.InvCodes1, info.byFinish });
}
}

46
NX.ERP.U8/System/User.cs Normal file
View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Dapper;
namespace NX.ERP.U8.User
{
public class User
{
public string Userrole(string Opnanme, string Pasd)
{
var AccID = ConfigurationManager.AppSettings["AccId"];
//NX.ERP.U8.U8LoginContext.Instance.PassWord = System.Configuration.ConfigurationManager.AppSettings["Password"];
//NX.ERP.U8.U8LoginContext.Instance.UserId = System.Configuration.ConfigurationManager.AppSettings["UserId"];
var Server = ConfigurationManager.AppSettings["Server"];
var _login = new NX.ERP.U8.U8LoginContext(Server, AccID);
_login.Login(Opnanme, Pasd);
var sql = $@" SELECT 1 from UFSystem..UA_Role where cUser_Id=@Opnanme and cGroup_Id='report' ;";
using (var conn =_login.Connection)
{
return conn.ExecuteScalar<string>(sql, new {Opnanme},null,30,System.Data.CommandType.Text);
}
}
}
}

View File

@@ -26,5 +26,14 @@ namespace NX.ERP.WebAPi.Controllers.System
}
[HttpPost]
[Route("api/System/Userrole")]
public string Userrole(LoginEntity loginEntity)
{
var Userrole = new NX.ERP.U8.User.User();
return Userrole.Userrole(loginEntity.UserId, loginEntity.Password);
}
}
}

View File

@@ -7,7 +7,7 @@
<appSettings>
<add key="server" value="10.0.0.12" />
<add key="AccId" value="u8-2@001" />
<add key="UserId" value="wx995" />
<add key="UserId" value="wx899" />
<add key="Password" value="1" />
<add key="EaiPort" value="80" />
<add key="EaiPath" value="U8EAI/import.asp" />

View File

@@ -5,3 +5,8 @@ export const InventorySNDetail = (info) => {
return axios.post('/api/Finance/InventorySNDetail', info)
}
export const Userrole = (info) => {
return axios.post('/api/System/Userrole', info)
}

View File

@@ -0,0 +1,16 @@
<template>
<div>
首页
</div>
</template>
<script>
export default {
name:"Index"
}
</script>
<style>
</style>

View File

@@ -12,16 +12,16 @@
<Input v-model="filter.clck" />
</Col>
<Col span="4">
<Col span="3">
<label>物料编号</label>
<Input autosize type="textarea" v-model="filter.c_inv_codes" />
</Col>
<Col span="4">
<Col span="3">
<label>序列号</label>
<Input autosize type="textarea" v-model="filter.c_inv_sn" />
</Col>
<Col span="3">
<Col span="3">
<label>入库单据期间</label>
<div>
<DatePicker v-model="filter.dates" type="daterange"></DatePicker>
@@ -34,7 +34,7 @@
</div>
</Col>
<Col span="4">
<Col span="3">
<Button
size="large"
type="primary"
@@ -46,6 +46,14 @@
>导出</Button
>
</Col>
<Col span="3">
<Button type="primary" @click="modal1 = true">身份验证</Button>
<Modal v-model="modal1" title="身份验证" @on-ok="handleClickpsd">
<Input v-model="opname" placeholder="用户名" style="width: 300px" />
<Input v-model="pasd" placeholder="密码" style="width: 300px" />
</Modal>
</Col>
</Row>
</div>
@@ -75,7 +83,8 @@
</template>
<script>
import { InventorySNDetail } from "@/api/Finance";
import { InventorySNDetail, Userrole } from "@/api/Finance";
import add from "@/views/add.vue";
import {
pageingData,
export_col_to_excel,
@@ -84,14 +93,25 @@ import {
sortByKey,
} from "@/libs/tools";
export default {
components: {
add,
},
data() {
return {
modal1: false,
opname: "",
pasd: "",
roleflag: false,
PageSizeOpts: [10, 15, 20, 30],
pageNo: 1,
strfilter: "",
multiple: false,
pageSize: 15,
datas: [],
datasccc: [],
datasccc2: {
datesc: [],
},
filter: {
cprk: "",
clck: "",
@@ -175,6 +195,7 @@ export default {
align: "center",
key: "ckcInvSN",
},
],
};
},
@@ -182,8 +203,17 @@ export default {
total() {
return this.datas.length;
},
sData() {
let _data = JSON.parse(JSON.stringify(this.datas));
if (!this.roleflag) {
_data.forEach((element) => {
element.iUnitCost = "***";
});
}
return _data;
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
return pageingData(this.sData, this.pageSize, this.pageNo);
},
},
@@ -192,11 +222,44 @@ export default {
},
methods: {
handelExport() {
export_col_to_excel(this.columns, this.datas);
export_col_to_excel(this.columns, this.sData);
},
handleClick() {
this.loadData();
},
async handleClickpsd() {
let _filert2 = {
user_id: this.opname,
password: this.pasd,
};
var respr = await Userrole(_filert2);
this.roleflag = respr.data.data;
// console.log(respr);
//this.$Message.info('This is a info tip');
if (respr.data.err_code != 0) {
this.$Message.info(respr.data.err_msg);
this.modal1 = true;
}
if (respr.data.data == null) {
this.$Message.info("无权限");
this.modal1 = true;
}
if (this.roleflag == 1) {
//this.dates=JSON.parse(JSON.stringify(this.datasccc));
// for (var i = 0; i < this.datas.length; i++) {
// //console.log(this.datas[i].iUnitCost);
// this.datas[i].iUnitCost = this.datasccc[i].iUnitCost;
// }
}
// console.log( this.datasccc);
//console.log(respr.data);
},
// Message(h){
// this.$Message.info(h);
// console.log(h);
// },
async loadData() {
let _beginDate = null;
let _endDate = null;
@@ -238,8 +301,17 @@ export default {
};
let resp = await InventorySNDetail(_filert);
this.pageNo = 1;
this.datas = resp.data.data;
// this.datas = resp.data.data;
//this.datasccc2.datesc = resp.data.data;
this.datas = sortByKey(resp.data.data, "Cprk");
// if (this.roleflag != 1) {
// for (var i = 0; i < this.datas.length; i++) {
// this.datas[i].iUnitCost = "***";
// }
// }
// console.log(this.datasccc2.datesc);
},
handlePagechange(page) {
@@ -253,7 +325,6 @@ export default {
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
h3 {
margin: 40px 0 0;

View File

@@ -8,16 +8,29 @@
<Input autosize type="textarea" v-model="filter.mo_codes" />
</Col>
<Col span="4">
<label>子件编码</label>
<label>产品编码</label>
<Input autosize type="textarea" v-model="filter.inv_codes" />
</Col>
<Col span="4">
<label>子件编码</label>
<Input autosize type="textarea" v-model="filter.inv_codes1" />
</Col>
<Col span="3">
<label>状态</label>
<div>
<Checkbox v-model="filter.by_finish">包含已关闭</Checkbox>
<Select v-model="filter.by_finish" multiple
>
<Option
v-for="item in stateList"
:value="item.value"
:key="item.value"
>{{ item.label }}</Option
>
</Select>
</div>
</Col>
<Col span="3">
<label>状态</label>
<div>
@@ -83,10 +96,29 @@ export default {
multiple: false,
pageSize: 15,
datas: [],
stateList: [
{
value: "1",
label: "未审核",
},
{
value: "2",
label: "锁定",
},
{
value: "3",
label: "审核",
},
{
value: "4",
label: "关闭",
},
],
filter: {
inv_codes: "",
inv_codes1: "",
mo_codes: "",
by_finish: false,
by_finish: ["2","3"],
byiss: false,
},
columns: [
@@ -103,7 +135,7 @@ export default {
align: "center",
key: "sort_seq",
fixed: "left",
width: 80,
width: 60,
},
{
title: "类别",
@@ -117,7 +149,7 @@ export default {
title: "产品编码",
align: "center",
key: "inv_code",
width: 100,
width: 75,
fixed: "left",
className: "demo-table-info-new",
},
@@ -125,7 +157,7 @@ export default {
title: "产品名称",
align: "center",
key: "c_inv_name",
width: 140,
width: 100,
fixed: "left",
className: "demo-table-info-new",
},
@@ -133,22 +165,22 @@ export default {
title: "产品规格",
align: "center",
key: "c_inv_std",
width: 175,
width: 120,
fixed: "left",
},
{
title: "产品单位",
title: "单位",
align: "center",
key: "c_com_unit_name",
fixed: "left",
width: 95,
width: 60,
},
{
title: "投产量",
align: "center",
key: "qty",
fixed: "left",
width: 80,
width: 75,
},
{
title: "完成量",
@@ -176,7 +208,7 @@ export default {
align: "center",
key: "st",
fixed: "left",
width: 80,
width: 75,
},
{
title: "子件编码",
@@ -189,7 +221,7 @@ export default {
{
title: "子件名称",
align: "center",
width: 135,
width: 110,
key: "cinvname1",
className: "demo-table-info-old",
fixed: "left",
@@ -319,6 +351,10 @@ export default {
this.filter.inv_codes !== ""
? this.filter.inv_codes.split(/[,\s\n,]/)
: null,
inv_codes1:
this.filter.inv_codes1 !== ""
? this.filter.inv_codes1.split(/[,\s\n,]/)
: null,
mo_codes:
this.filter.mo_codes !== ""
? this.filter.mo_codes.split(/[,\s\n,]/)

View File

@@ -1,6 +1,6 @@
<template>
<div>
<h4>销售订单表</h4>
<h4>采购订单表</h4>
<div>
<Row :gutter="16">
<Col span="4">
@@ -114,6 +114,7 @@ export default {
title: "采购订单号",
align: "center",
key: "cpoid",
width: 110,
},
{
@@ -152,16 +153,19 @@ export default {
title: "累计到货",
align: "center",
key: "ireceivedqty",
width: 100,
},
{
title: "订单数量",
align: "center",
key: "iquantity",
width: 100,
},
{
title: "合计在途",
align: "center",
key: "rqty",
width: 100,
},
{
title: "预计到货日期",
@@ -187,11 +191,13 @@ export default {
title: "行关闭人",
align: "center",
key: "cbcloser",
width: 100,
},
{
title: "订单关闭人",
align: "center",
key: "ccloser",
width: 100,
},