身份验证

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

@@ -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,
},