身份验证

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\PoOrderRequest.cs" />
<Compile Include="Request\SnOrderRequest.cs" /> <Compile Include="Request\SnOrderRequest.cs" />
<Compile Include="Request\SaleOrderRequest.cs" /> <Compile Include="Request\SaleOrderRequest.cs" />
<Compile Include="Request\Userrequest.cs" />
<Compile Include="Response\MOM\Bom.cs" /> <Compile Include="Response\MOM\Bom.cs" />
<Compile Include="Response\Pmc\PmcInventoryallRes.cs" /> <Compile Include="Response\Pmc\PmcInventoryallRes.cs" />
<Compile Include="Response\Pmc\PmcInventorymomRes.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 List<string> moCodes { get; set; }
public IEnumerable<string> InvCodes { 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; } 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="Properties\AssemblyInfo.cs" />
<Compile Include="Base\SupplierDAL.cs" /> <Compile Include="Base\SupplierDAL.cs" />
<Compile Include="Account\Accinformation.cs" /> <Compile Include="Account\Accinformation.cs" />
<Compile Include="System\User.cs" />
<Compile Include="U8LoginContext.cs" /> <Compile Include="U8LoginContext.cs" />
<Compile Include="Base\UnitDAL.cs" /> <Compile Include="Base\UnitDAL.cs" />
<Compile Include="Base\WarehouseDAL.cs" /> <Compile Include="Base\WarehouseDAL.cs" />
@@ -128,5 +129,6 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </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"); 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"); 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) 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) 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> <appSettings>
<add key="server" value="10.0.0.12" /> <add key="server" value="10.0.0.12" />
<add key="AccId" value="u8-2@001" /> <add key="AccId" value="u8-2@001" />
<add key="UserId" value="wx995" /> <add key="UserId" value="wx899" />
<add key="Password" value="1" /> <add key="Password" value="1" />
<add key="EaiPort" value="80" /> <add key="EaiPort" value="80" />
<add key="EaiPath" value="U8EAI/import.asp" /> <add key="EaiPath" value="U8EAI/import.asp" />

View File

@@ -5,3 +5,8 @@ export const InventorySNDetail = (info) => {
return axios.post('/api/Finance/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" /> <Input v-model="filter.clck" />
</Col> </Col>
<Col span="4"> <Col span="3">
<label>物料编号</label> <label>物料编号</label>
<Input autosize type="textarea" v-model="filter.c_inv_codes" /> <Input autosize type="textarea" v-model="filter.c_inv_codes" />
</Col> </Col>
<Col span="4"> <Col span="3">
<label>序列号</label> <label>序列号</label>
<Input autosize type="textarea" v-model="filter.c_inv_sn" /> <Input autosize type="textarea" v-model="filter.c_inv_sn" />
</Col> </Col>
<Col span="3"> <Col span="3">
<label>入库单据期间</label> <label>入库单据期间</label>
<div> <div>
<DatePicker v-model="filter.dates" type="daterange"></DatePicker> <DatePicker v-model="filter.dates" type="daterange"></DatePicker>
@@ -34,7 +34,7 @@
</div> </div>
</Col> </Col>
<Col span="4"> <Col span="3">
<Button <Button
size="large" size="large"
type="primary" type="primary"
@@ -46,6 +46,14 @@
>导出</Button >导出</Button
> >
</Col> </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> </Row>
</div> </div>
@@ -75,7 +83,8 @@
</template> </template>
<script> <script>
import { InventorySNDetail } from "@/api/Finance"; import { InventorySNDetail, Userrole } from "@/api/Finance";
import add from "@/views/add.vue";
import { import {
pageingData, pageingData,
export_col_to_excel, export_col_to_excel,
@@ -84,14 +93,25 @@ import {
sortByKey, sortByKey,
} from "@/libs/tools"; } from "@/libs/tools";
export default { export default {
components: {
add,
},
data() { data() {
return { return {
modal1: false,
opname: "",
pasd: "",
roleflag: false,
PageSizeOpts: [10, 15, 20, 30], PageSizeOpts: [10, 15, 20, 30],
pageNo: 1, pageNo: 1,
strfilter: "", strfilter: "",
multiple: false, multiple: false,
pageSize: 15, pageSize: 15,
datas: [], datas: [],
datasccc: [],
datasccc2: {
datesc: [],
},
filter: { filter: {
cprk: "", cprk: "",
clck: "", clck: "",
@@ -175,6 +195,7 @@ export default {
align: "center", align: "center",
key: "ckcInvSN", key: "ckcInvSN",
}, },
], ],
}; };
}, },
@@ -182,8 +203,17 @@ export default {
total() { total() {
return this.datas.length; return this.datas.length;
}, },
sData() {
let _data = JSON.parse(JSON.stringify(this.datas));
if (!this.roleflag) {
_data.forEach((element) => {
element.iUnitCost = "***";
});
}
return _data;
},
pagedData() { pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo); return pageingData(this.sData, this.pageSize, this.pageNo);
}, },
}, },
@@ -192,11 +222,44 @@ export default {
}, },
methods: { methods: {
handelExport() { handelExport() {
export_col_to_excel(this.columns, this.datas); export_col_to_excel(this.columns, this.sData);
}, },
handleClick() { handleClick() {
this.loadData(); 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() { async loadData() {
let _beginDate = null; let _beginDate = null;
let _endDate = null; let _endDate = null;
@@ -238,8 +301,17 @@ export default {
}; };
let resp = await InventorySNDetail(_filert); let resp = await InventorySNDetail(_filert);
this.pageNo = 1; 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"); 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) { handlePagechange(page) {
@@ -253,7 +325,6 @@ export default {
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style > <style >
h3 { h3 {
margin: 40px 0 0; margin: 40px 0 0;

View File

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

View File

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