feat(purchaseorder): 添加采购订单排序功能并优化税率输入组件
- 在采购订单列表中添加排序功能,支持按创建时间排序 - 优化税率输入组件,支持税率的精确计算和显示 - 更新采购订单详情页,增加税率列并支持动态计算含税金额 - 修改采购订单查询逻辑,默认按创建时间倒序排列 - 修复采购订单详情页采购员和负责人选择逻辑 - 调整页面布局和样式细节,提升用户体验dev_1.0.0
parent
86de8e2b0a
commit
da0a5c8014
|
|
@ -21,8 +21,11 @@ export function getUser(userId) {
|
||||||
// 新增用户
|
// 新增用户
|
||||||
export function addUser(data) {
|
export function addUser(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user',
|
url: '/system/user/add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -45,14 +48,14 @@ export function delUser(userId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
export function resetUserPwd(userId, password) {
|
export function resetUserPwd(data) {
|
||||||
const data = {
|
|
||||||
userId,
|
|
||||||
password
|
|
||||||
}
|
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/resetPwd',
|
url: '/system/user/resetPwd',
|
||||||
method: 'put',
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
},
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +119,7 @@ export function uploadAvatar(data) {
|
||||||
// 查询授权角色
|
// 查询授权角色
|
||||||
export function getAuthRole(userId) {
|
export function getAuthRole(userId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/authRole/' + userId,
|
url: '/system/user/vue/authRole/' + userId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
<template>
|
||||||
|
<div style="width: 100%">
|
||||||
|
<el-input-number style="width: 100%"
|
||||||
|
v-bind="$attrs"
|
||||||
|
:value="displayValue"
|
||||||
|
@input="onInput"
|
||||||
|
@change="onChange"
|
||||||
|
@blur="onBlur"
|
||||||
|
@focus="onFocus"
|
||||||
|
>
|
||||||
|
<slot/>
|
||||||
|
</el-input-number>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {isNumberStr} from "@/utils";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TaxRateInput",
|
||||||
|
|
||||||
|
props: {
|
||||||
|
// 父组件实际值(未放大的值),例如 0.01
|
||||||
|
value: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: ""
|
||||||
|
},
|
||||||
|
|
||||||
|
// 显示值 : 实际值 = ratio : 1
|
||||||
|
ratio: {
|
||||||
|
type: Number,
|
||||||
|
default: 100
|
||||||
|
},
|
||||||
|
|
||||||
|
// 显示值的小数位精度,比如 2 表示显示保留两位小数
|
||||||
|
precision: {
|
||||||
|
type: Number,
|
||||||
|
default: 4
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
innerDisplayValue: "" // 用户看到的值(已按比例放大)
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
this.innerDisplayValue = this.formatDisplay(newVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
displayValue() {
|
||||||
|
return this.innerDisplayValue;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
// 将实际值转换为显示值
|
||||||
|
formatDisplay(val) {
|
||||||
|
if (val === null || val === "" || isNaN(val) ) return "";
|
||||||
|
// 按精度格式化
|
||||||
|
return this.$calc.mul(val, this.ratio);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 将显示值转换为实际值
|
||||||
|
parseActual(val) {
|
||||||
|
if (val === null || val === "" || isNaN(val)) return "";
|
||||||
|
|
||||||
|
let num = this.$calc.div(val, this.ratio, 4);
|
||||||
|
|
||||||
|
// 输出给父组件时默认保留更高精度
|
||||||
|
return num;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 用户输入
|
||||||
|
onInput(val) {
|
||||||
|
this.innerDisplayValue = val;
|
||||||
|
|
||||||
|
const actual = this.parseActual(val);
|
||||||
|
this.$emit("input", actual);
|
||||||
|
},
|
||||||
|
|
||||||
|
// change 事件透传
|
||||||
|
onChange(val) {
|
||||||
|
const actual = this.parseActual(val);
|
||||||
|
console.log()
|
||||||
|
this.$emit("change", actual);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 原生事件保留
|
||||||
|
onBlur(e) {
|
||||||
|
this.$emit("blur", e);
|
||||||
|
},
|
||||||
|
onFocus(e) {
|
||||||
|
this.$emit("focus", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -99,7 +99,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
::v-deep .el-submenu__title {
|
::v-deep .el-submenu__title {
|
||||||
font-size: 17px;
|
font-size: 15px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,9 @@ export default {
|
||||||
dutyName: null,
|
dutyName: null,
|
||||||
partnerName: null,
|
partnerName: null,
|
||||||
timeType: 'deliveryTime',
|
timeType: 'deliveryTime',
|
||||||
params: {}
|
params: {},
|
||||||
|
orderByColumn:'createTime',
|
||||||
|
isAsc: 'desc'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,10 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="采购员" prop="purchaserId">
|
<el-form-item label="采购员" prop="purchaserId">
|
||||||
<el-input v-model="form.purchaserName" placeholder="请选择采购员" @click.native="purchaserSelectOpen=true" :readonly="true" >
|
<el-input v-model="form.purchaserName" placeholder="请选择采购员"
|
||||||
<el-button slot="append" icon="el-icon-search" @click="purchaserSelectOpen=true"></el-button>
|
@click.native="$refs.purchase.queryParams.roleId=117;purchaserSelectOpen=true;" :readonly="true">
|
||||||
|
<el-button slot="append" icon="el-icon-search"
|
||||||
|
@click="$refs.purchase.queryParams.roleId=117;purchaserSelectOpen=true"></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -94,7 +96,8 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="汇智负责人" prop="ownerId">
|
<el-form-item label="汇智负责人" prop="ownerId">
|
||||||
<el-input v-model="form.ownerName" placeholder="请选择汇智负责人" :readonly="true" >
|
<el-input v-model="form.ownerName" placeholder="请选择汇智负责人" @click.native="ownerSelectOpen=true"
|
||||||
|
:readonly="true">
|
||||||
<el-button slot="append" icon="el-icon-search" @click="ownerSelectOpen=true"></el-button>
|
<el-button slot="append" icon="el-icon-search" @click="ownerSelectOpen=true"></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -148,6 +151,11 @@
|
||||||
<el-input v-model.number="scope.row.price" type="number" :precision="2" :step="0.1" :min="0" @change="calculateRowTotal(scope.row)"></el-input>
|
<el-input v-model.number="scope.row.price" type="number" :precision="2" :step="0.1" :min="0" @change="calculateRowTotal(scope.row)"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="税率(%)" prop="taxRate" width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<tax-rate-input v-model="scope.row.taxRate" :step="0.1" :min="0" :max="100" @change="calculateRowTotal(scope.row)"></tax-rate-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="含税小计" prop="amountTotal"></el-table-column>
|
<el-table-column label="含税小计" prop="amountTotal"></el-table-column>
|
||||||
<el-table-column label="交货日期">
|
<el-table-column label="交货日期">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
@ -176,7 +184,8 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<select-user :visible.sync="purchaserSelectOpen" @user-selected="handlePurchaserSelect"></select-user>
|
<select-user ref="purchase" :visible.sync="purchaserSelectOpen"
|
||||||
|
@user-selected="handlePurchaserSelect"></select-user>
|
||||||
<select-user :visible.sync="ownerSelectOpen" @user-selected="handleOwnerSelect"></select-user>
|
<select-user :visible.sync="ownerSelectOpen" @user-selected="handleOwnerSelect"></select-user>
|
||||||
<select-product :visible.sync="productSelectOpen" @product-selected="handleProductSelected" :vendor-code="currentVendorCode" :product-type="currentProductType"></select-product>
|
<select-product :visible.sync="productSelectOpen" @product-selected="handleProductSelected" :vendor-code="currentVendorCode" :product-type="currentProductType"></select-product>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -188,11 +197,12 @@ import { listAllVendor } from "@/api/base/vendor";
|
||||||
import SelectUser from "@/views/system/user/selectUser";
|
import SelectUser from "@/views/system/user/selectUser";
|
||||||
import SelectProduct from "@/views/system/product/selectProduct";
|
import SelectProduct from "@/views/system/product/selectProduct";
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
import { getDicts } from "@/api/system/dict/data";
|
||||||
|
import TaxRateInput from "@/components/TaxRateInput/TaxInput.vue";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PurchaseOrderDetail",
|
name: "PurchaseOrderDetail",
|
||||||
components: { SelectUser, SelectProduct },
|
components: {TaxRateInput, SelectUser, SelectProduct },
|
||||||
props: {
|
props: {
|
||||||
orderData: {
|
orderData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
@ -223,7 +233,7 @@ export default {
|
||||||
id: null,
|
id: null,
|
||||||
purchaseNo: null,
|
purchaseNo: null,
|
||||||
buyerName: '紫光汇智信息技术有限公司',
|
buyerName: '紫光汇智信息技术有限公司',
|
||||||
buyerAddress: '重庆市南岸区广福大道12号行政中心B区3号楼14-17',
|
buyerAddress: '重庆市两江新区云杉南路6号涉外商务区B6栋7楼',
|
||||||
vendorId: null,
|
vendorId: null,
|
||||||
currency: 'RMB',
|
currency: 'RMB',
|
||||||
purchaserId: null,
|
purchaserId: null,
|
||||||
|
|
@ -276,9 +286,10 @@ export default {
|
||||||
},
|
},
|
||||||
totalAmountWithoutTax() {
|
totalAmountWithoutTax() {
|
||||||
const total = this.form.omsPurchaseOrderItemList?.reduce((acc, cur) => {
|
const total = this.form.omsPurchaseOrderItemList?.reduce((acc, cur) => {
|
||||||
const amount = cur.quantity * cur.price || 0;
|
const amount = this.$calc.mul(cur.quantity, cur.price) || 0;
|
||||||
const taxRate = cur.taxRate || 0;
|
const taxRate = cur.taxRate || 0;
|
||||||
return acc + (amount / (1 + taxRate));
|
console.log(taxRate)
|
||||||
|
return acc + this.$calc.div(amount , (1 + taxRate));
|
||||||
}, 0);
|
}, 0);
|
||||||
return (this.$calc.toFixed(total)) || 0;
|
return (this.$calc.toFixed(total)) || 0;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
<el-table-column label="联系电话" align="center" prop="vendorPhone" width="120"/>
|
<el-table-column label="联系电话" align="center" prop="vendorPhone" width="120"/>
|
||||||
<el-table-column label="发起日期" align="center" prop="createTime" width="180">
|
<el-table-column label="发起日期" align="center" prop="createTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="汇智负责人" align="center" prop="ownerName" width="120"/>
|
<el-table-column label="汇智负责人" align="center" prop="ownerName" width="120"/>
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
<el-table-column label="产品编码" align="center" prop="productCode" width="100"/>
|
<el-table-column label="产品编码" align="center" prop="productCode" width="100"/>
|
||||||
<el-table-column label="产品型号" align="center" prop="productModel" width="100"/>
|
<el-table-column label="产品型号" align="center" prop="productModel" width="100"/>
|
||||||
<el-table-column label="数量" align="center" prop="quantity" width="100"/>
|
<el-table-column label="数量" align="center" prop="quantity" width="100"/>
|
||||||
<el-table-column label="单件" align="center" prop="price" width="100"/>
|
<el-table-column label="单价" align="center" prop="price" width="100"/>
|
||||||
<el-table-column label="小计" align="center" prop="price" width="100">
|
<el-table-column label="小计" align="center" prop="price" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.quantity * scope.row.price}}
|
{{ scope.row.quantity * scope.row.price}}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,8 @@
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="purchaseorderList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="purchaseorderList" @selection-change="handleSelectionChange"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||||
<el-table-column label="采购编号" align="center" prop="purchaseNo" width="180"/>
|
<el-table-column label="采购编号" align="center" prop="purchaseNo" width="180"/>
|
||||||
<el-table-column label="采购方名称" align="center" prop="buyerName" width="120"/>
|
<el-table-column label="采购方名称" align="center" prop="buyerName" width="120"/>
|
||||||
|
|
@ -92,9 +93,9 @@
|
||||||
<el-table-column label="联系人" align="center" prop="vendorUser" width="100"/>
|
<el-table-column label="联系人" align="center" prop="vendorUser" width="100"/>
|
||||||
<el-table-column label="联系电话" align="center" prop="vendorPhone" width="120"/>
|
<el-table-column label="联系电话" align="center" prop="vendorPhone" width="120"/>
|
||||||
<el-table-column label="含税总计金额" align="center" prop="totalAmount" width="120"/>
|
<el-table-column label="含税总计金额" align="center" prop="totalAmount" width="120"/>
|
||||||
<el-table-column label="发起日期" align="center" prop="createTime" width="180">
|
<el-table-column label="发起日期" align="center" prop="createTime" width="180" sortable>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="汇智负责人" align="center" prop="ownerName" width="120"/>
|
<el-table-column label="汇智负责人" align="center" prop="ownerName" width="120"/>
|
||||||
|
|
@ -331,6 +332,8 @@ export default {
|
||||||
approveStatus: null,
|
approveStatus: null,
|
||||||
confirmStatus: null,
|
confirmStatus: null,
|
||||||
status: null,
|
status: null,
|
||||||
|
orderByColumn:'createTime',
|
||||||
|
isAsc: 'desc'
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
|
@ -382,6 +385,11 @@ export default {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
handleSortChange(column, prop, order) {
|
||||||
|
this.queryParams.orderByColumn = column.prop
|
||||||
|
this.queryParams.isAsc = column.order
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,9 @@
|
||||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||||
<!-- </el-row>-->
|
<!-- </el-row>-->
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="purchaseorderList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="purchaseorderList" @selection-change="handleSelectionChange"
|
||||||
|
@sort-change="handleSortChange"
|
||||||
|
>
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||||
<el-table-column label="采购编号" align="center" prop="purchaseNo" width="180"/>
|
<el-table-column label="采购编号" align="center" prop="purchaseNo" width="180"/>
|
||||||
<el-table-column label="采购方名称" align="center" prop="buyerName" />
|
<el-table-column label="采购方名称" align="center" prop="buyerName" />
|
||||||
|
|
@ -73,9 +75,9 @@
|
||||||
<el-table-column label="联系人" align="center" prop="vendorUser" width="100"/>
|
<el-table-column label="联系人" align="center" prop="vendorUser" width="100"/>
|
||||||
<el-table-column label="联系电话" align="center" prop="vendorPhone" width="120"/>
|
<el-table-column label="联系电话" align="center" prop="vendorPhone" width="120"/>
|
||||||
<el-table-column label="含税总计金额" align="center" prop="totalAmount" width="120"/>
|
<el-table-column label="含税总计金额" align="center" prop="totalAmount" width="120"/>
|
||||||
<el-table-column label="发起日期" align="center" prop="createTime" width="180">
|
<el-table-column label="发起日期" align="center" prop="createTime" sortable width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="汇智负责人" align="center" prop="ownerName" width="120"/>
|
<el-table-column label="汇智负责人" align="center" prop="ownerName" width="120"/>
|
||||||
|
|
@ -282,6 +284,8 @@ export default {
|
||||||
approveStatus: null,
|
approveStatus: null,
|
||||||
confirmStatus: '0',
|
confirmStatus: '0',
|
||||||
status: null,
|
status: null,
|
||||||
|
orderByColumn:'createTime',
|
||||||
|
isAsc: 'desc'
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
|
|
@ -329,6 +333,11 @@ export default {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleSortChange(column, prop, order) {
|
||||||
|
this.queryParams.orderByColumn = column.prop
|
||||||
|
this.queryParams.isAsc = column.order
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ export default {
|
||||||
if (userId) {
|
if (userId) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getAuthRole(userId).then((response) => {
|
getAuthRole(userId).then((response) => {
|
||||||
this.form = response.user
|
this.form = response.data.user
|
||||||
this.roles = response.roles
|
this.roles = response.data.roles
|
||||||
this.total = this.roles.length
|
this.total = this.roles.length
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.roles.forEach((row) => {
|
this.roles.forEach((row) => {
|
||||||
|
|
|
||||||
|
|
@ -123,8 +123,8 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="loginName">
|
<el-form-item v-if="form.userId == undefined" label="登录名" prop="loginName">
|
||||||
<el-input v-model="form.loginName" placeholder="请输入用户名称" maxlength="30" />
|
<el-input v-model="form.loginName" placeholder="登录名" maxlength="30" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -476,7 +476,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
resetUserPwd(row.userId, value).then(response => {
|
let data={
|
||||||
|
userId: row.userId,
|
||||||
|
loginName: row.loginName,
|
||||||
|
password: value
|
||||||
|
}
|
||||||
|
resetUserPwd(data).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功,新密码是:" + value)
|
this.$modal.msgSuccess("修改成功,新密码是:" + value)
|
||||||
})
|
})
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
@ -467,4 +468,16 @@ public class SysRoleController extends BaseController
|
||||||
roleService.checkRoleDataScope(roleId);
|
roleService.checkRoleDataScope(roleId);
|
||||||
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
||||||
}
|
}
|
||||||
|
@GetMapping("/vue/deptTree/{roleId}")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
SysRole sysRole = new SysRole();
|
||||||
|
sysRole.setRoleId(roleId);
|
||||||
|
List<Ztree> ztrees = deptService.roleDeptTreeData(sysRole);
|
||||||
|
ajax.put("checkedKeys", ztrees.stream().filter(Ztree::isChecked).map(Ztree::getId).collect(Collectors.toList()));
|
||||||
|
ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,9 @@ package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
|
|
@ -269,6 +271,19 @@ public class SysUserController extends BaseController
|
||||||
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
return prefix + "/authRole";
|
return prefix + "/authRole";
|
||||||
}
|
}
|
||||||
|
@RequiresPermissions("system:user:edit")
|
||||||
|
@GetMapping("/vue/authRole/{userId}")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult authRole(@PathVariable("userId") Long userId)
|
||||||
|
{
|
||||||
|
Map<String,Object> mmap=new HashMap<>();
|
||||||
|
SysUser user = userService.selectUserById(userId);
|
||||||
|
// 获取用户所属的角色列表
|
||||||
|
List<SysRole> roles = roleService.selectRolesByUserId(userId);
|
||||||
|
mmap.put("user", user);
|
||||||
|
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
|
||||||
|
return AjaxResult.success(mmap);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户授权角色
|
* 用户授权角色
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
@ -22,6 +24,7 @@ import com.ruoyi.common.xss.Xss;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@ToString
|
@ToString
|
||||||
|
@Data
|
||||||
public class SysUser extends BaseEntity
|
public class SysUser extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
@ -40,13 +43,16 @@ public class SysUser extends BaseEntity
|
||||||
|
|
||||||
/** 角色ID */
|
/** 角色ID */
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
private String roleKey;
|
||||||
|
|
||||||
/** 登录名称 */
|
/** 登录名称 */
|
||||||
@Excel(name = "登录名称")
|
@Excel(name = "登录名称")
|
||||||
|
@Getter(value = AccessLevel.NONE)
|
||||||
private String loginName;
|
private String loginName;
|
||||||
|
|
||||||
/** 用户名称 */
|
/** 用户名称 */
|
||||||
@Excel(name = "用户名称")
|
@Excel(name = "用户名称")
|
||||||
|
@Getter(value = AccessLevel.NONE)
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/** 用户类型 */
|
/** 用户类型 */
|
||||||
|
|
@ -54,10 +60,12 @@ public class SysUser extends BaseEntity
|
||||||
|
|
||||||
/** 用户邮箱 */
|
/** 用户邮箱 */
|
||||||
@Excel(name = "用户邮箱")
|
@Excel(name = "用户邮箱")
|
||||||
|
@Getter(value = AccessLevel.NONE)
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/** 手机号码 */
|
/** 手机号码 */
|
||||||
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
||||||
|
@Getter(value = AccessLevel.NONE)
|
||||||
private String phonenumber;
|
private String phonenumber;
|
||||||
|
|
||||||
/** 用户性别 */
|
/** 用户性别 */
|
||||||
|
|
@ -68,9 +76,11 @@ public class SysUser extends BaseEntity
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
|
@Getter(value = AccessLevel.NONE)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/** 盐加密 */
|
/** 盐加密 */
|
||||||
|
@Getter(value = AccessLevel.NONE)
|
||||||
private String salt;
|
private String salt;
|
||||||
|
|
||||||
/** 帐号状态(0正常 1停用) */
|
/** 帐号状态(0正常 1停用) */
|
||||||
|
|
@ -116,15 +126,7 @@ public class SysUser extends BaseEntity
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getUserId()
|
|
||||||
{
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Long userId)
|
|
||||||
{
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAdmin()
|
public boolean isAdmin()
|
||||||
{
|
{
|
||||||
|
|
@ -136,35 +138,6 @@ public class SysUser extends BaseEntity
|
||||||
return userId != null && 1L == userId;
|
return userId != null && 1L == userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptId()
|
|
||||||
{
|
|
||||||
return deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeptId(Long deptId)
|
|
||||||
{
|
|
||||||
this.deptId = deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getParentId()
|
|
||||||
{
|
|
||||||
return parentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentId(Long parentId)
|
|
||||||
{
|
|
||||||
this.parentId = parentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getRoleId()
|
|
||||||
{
|
|
||||||
return roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleId(Long roleId)
|
|
||||||
{
|
|
||||||
this.roleId = roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Xss(message = "登录账号不能包含脚本字符")
|
@Xss(message = "登录账号不能包含脚本字符")
|
||||||
@NotBlank(message = "登录账号不能为空")
|
@NotBlank(message = "登录账号不能为空")
|
||||||
|
|
@ -174,11 +147,6 @@ public class SysUser extends BaseEntity
|
||||||
return loginName;
|
return loginName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLoginName(String loginName)
|
|
||||||
{
|
|
||||||
this.loginName = loginName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Xss(message = "用户昵称不能包含脚本字符")
|
@Xss(message = "用户昵称不能包含脚本字符")
|
||||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||||
public String getUserName()
|
public String getUserName()
|
||||||
|
|
@ -186,20 +154,6 @@ public class SysUser extends BaseEntity
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserName(String userName)
|
|
||||||
{
|
|
||||||
this.userName = userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserType()
|
|
||||||
{
|
|
||||||
return userType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserType(String userType)
|
|
||||||
{
|
|
||||||
this.userType = userType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Email(message = "邮箱格式不正确")
|
@Email(message = "邮箱格式不正确")
|
||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||||
|
|
@ -208,52 +162,18 @@ public class SysUser extends BaseEntity
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmail(String email)
|
|
||||||
{
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||||
public String getPhonenumber()
|
public String getPhonenumber()
|
||||||
{
|
{
|
||||||
return phonenumber;
|
return phonenumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPhonenumber(String phonenumber)
|
|
||||||
{
|
|
||||||
this.phonenumber = phonenumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSex()
|
|
||||||
{
|
|
||||||
return sex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSex(String sex)
|
|
||||||
{
|
|
||||||
this.sex = sex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAvatar()
|
|
||||||
{
|
|
||||||
return avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAvatar(String avatar)
|
|
||||||
{
|
|
||||||
this.avatar = avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String getPassword()
|
public String getPassword()
|
||||||
{
|
{
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPassword(String password)
|
|
||||||
{
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String getSalt()
|
public String getSalt()
|
||||||
|
|
@ -261,110 +181,5 @@ public class SysUser extends BaseEntity
|
||||||
return salt;
|
return salt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSalt(String salt)
|
|
||||||
{
|
|
||||||
this.salt = salt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus()
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDelFlag()
|
|
||||||
{
|
|
||||||
return delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelFlag(String delFlag)
|
|
||||||
{
|
|
||||||
this.delFlag = delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLoginIp()
|
|
||||||
{
|
|
||||||
return loginIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginIp(String loginIp)
|
|
||||||
{
|
|
||||||
this.loginIp = loginIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getLoginDate()
|
|
||||||
{
|
|
||||||
return loginDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginDate(Date loginDate)
|
|
||||||
{
|
|
||||||
this.loginDate = loginDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getPwdUpdateDate()
|
|
||||||
{
|
|
||||||
return pwdUpdateDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPwdUpdateDate(Date pwdUpdateDate)
|
|
||||||
{
|
|
||||||
this.pwdUpdateDate = pwdUpdateDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysDept getDept()
|
|
||||||
{
|
|
||||||
if (dept == null)
|
|
||||||
{
|
|
||||||
dept = new SysDept();
|
|
||||||
}
|
|
||||||
return dept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDept(SysDept dept)
|
|
||||||
{
|
|
||||||
this.dept = dept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<SysRole> getRoles()
|
|
||||||
{
|
|
||||||
return roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoles(List<SysRole> roles)
|
|
||||||
{
|
|
||||||
this.roles = roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getRoleIds()
|
|
||||||
{
|
|
||||||
return roleIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleIds(Long[] roleIds)
|
|
||||||
{
|
|
||||||
this.roleIds = roleIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getPostIds()
|
|
||||||
{
|
|
||||||
return postIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPostIds(Long[] postIds)
|
|
||||||
{
|
|
||||||
this.postIds = postIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Long> getUserIdList() {
|
|
||||||
return userIdList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserIdList(List<Long> userIdList) {
|
|
||||||
this.userIdList = userIdList;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by t2.create_time desc
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="listByItemId" resultType="com.ruoyi.sip.domain.OmsPurchaseOrderItem">
|
<select id="listByItemId" resultType="com.ruoyi.sip.domain.OmsPurchaseOrderItem">
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
<if test="userId != null and userId != 0">
|
<if test="userId != null and userId != 0">
|
||||||
AND u.user_id = #{userId}
|
AND u.user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="roleId != null and roleId != ''">
|
||||||
|
AND u.user_id in (select user_id from sys_user_role where role_id=#{roleId})
|
||||||
</if>
|
</if>
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND u.user_name like concat('%', #{userName}, '%')
|
AND u.user_name like concat('%', #{userName}, '%')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue