Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
New file |
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref, watch} from "vue"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import {useI18n} from "vue-i18n" |
| | | import request from "@/utils/request" |
| | | import {ElMessage} from "element-plus"; |
| | | const { t } = useI18n() |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | loading:false, |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | showOverflow:true, |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | virtualScroll: true, // 开启虚拟滚动功能 |
| | | id: 'OrderList', |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true,gt:13 },//开启虚拟滚动 |
| | | //scrollX:{ enabled: true,gt:15 },//开启虚拟滚动 |
| | | |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | |
| | | |
| | | columns:[ |
| | | |
| | | ], |
| | | mergeCells:[] |
| | | |
| | | |
| | | }) |
| | | |
| | | let props = defineProps({ |
| | | orderId:null |
| | | }) |
| | | const columns = [ |
| | | {field: 'order_number',fixed:"left", width: 90,title: '订单序号',showOverflow:"ellipsis"}, |
| | | // {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: 'product_name', width: 150, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'glass_child',width: 130, title: '单片名称' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'order_type', width: 120,title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'process_id',width: 110, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | |
| | | {field: 'technology_number', width: 90,title: '小片顺序',showOverflow:"ellipsis"}, |
| | | {field: 'quantity', width: 90,title: '数量'}, |
| | | {field: 'shippedQuantity',width: 120, title: '发货数量'}, |
| | | {field: 'inventory',width: 120, title: '库存数量'}, |
| | | {field: 'inventoryArea',width: 120, title: '库存面积'}, |
| | | {field: 'broken_num',width: 90, title: '次破数量'}, |
| | | ] |
| | | let column = [0,1,3,6,7,8,9] |
| | | |
| | | |
| | | onMounted(()=>{ |
| | | getWorkOrder() |
| | | }) |
| | | |
| | | watch(()=>props.orderId,(newValue)=>{ |
| | | getWorkOrder() |
| | | }) |
| | | |
| | | const getWorkOrder = () => { |
| | | request.post(`/report/processCardProgress/${props.orderId}`,column).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | gridOptions.columns = JSON.parse(JSON.stringify(columns)) |
| | | res.data.title.forEach(item =>{ |
| | | let column = {slots: { default: 'quantitySum' }, width: 90,title: item.process} |
| | | gridOptions.columns.push(column) |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | }) |
| | | gridOptions.mergeCells= res.data.mergeCells |
| | | xGrid.value.loadData(res.data.data) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const quantitySum = ( row,column )=>{ |
| | | const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0 |
| | | const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || 0 |
| | | if(reportWorkQuantity===reportWorkQuantityCount){ |
| | | return reportWorkQuantity |
| | | } |
| | | |
| | | return (reportWorkQuantity |
| | | +'(' |
| | | +reportWorkQuantityCount |
| | | +')' ) |
| | | //return |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <vxe-grid |
| | | height="100%" |
| | | size="mini" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #quantitySum="{ row,column }"> |
| | | <span>{{ quantitySum(row,column) }} </span> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | import {defineEmits, onMounted, reactive, ref, watch} from "vue"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import {useI18n} from "vue-i18n" |
| | | import request from "@/utils/request" |
| | | import {ElMessage} from "element-plus"; |
| | | const { t } = useI18n() |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | loading:false, |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | showOverflow:true, |
| | | id:'sizeCheck', |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'review', 'name': '审核',status: 'primary'}, |
| | | ] |
| | | }, |
| | | |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | virtualScroll: true, // 开启虚拟滚动功能 |
| | | scrollY:{ enabled: true,gt:13 },//开启虚拟滚动 |
| | | //scrollX:{ enabled: true,gt:15 },//开启虚拟滚动 |
| | | |
| | | columnConfig: { |
| | | useKey: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'dblclick', |
| | | mode: 'cell', |
| | | showStatus: true, |
| | | showIcon:false |
| | | }, |
| | | mouseConfig:{selected: true}, |
| | | keyboardConfig:{ |
| | | isArrow: true, |
| | | isDel: true, |
| | | isEnter: true, |
| | | isTab: true, |
| | | isEdit: true, |
| | | isChecked: true, |
| | | enterToTab:true |
| | | }, |
| | | |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | columns:[ |
| | | {field: 'width', title: '宽',editRender: { name: 'input'}}, |
| | | {field: 'height', title:'高', editRender: { name: 'input'}}, |
| | | {field: 'quantity', title: '数量' ,editRender: { name: 'input'}, }, |
| | | ], |
| | | editRules: { |
| | | width: [ |
| | | { required: true, message: '必填,参数不一致' } |
| | | ], |
| | | height: [ |
| | | { required: true, message: '必填,参数不一致' } |
| | | ], |
| | | quantity: [ |
| | | { required: true, message: '必填,参数不一致' } |
| | | ] |
| | | } |
| | | }) |
| | | |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'review' :{ |
| | | const errMap = await $grid.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(t('basicData.msg.checkoutLose')) |
| | | return |
| | | } |
| | | // const $table = props.OrderDetail |
| | | // $table.getTableData().fullData.forEach((row)=>{ |
| | | // if()row.computeGrossArea |
| | | // }) |
| | | |
| | | |
| | | emit('getParent') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | const emit = defineEmits(['getParent']) |
| | | |
| | | let props = defineProps({ |
| | | OrderDetail:null |
| | | }) |
| | | onMounted(()=>{ |
| | | const length = props.OrderDetail.getTableData().fullData.length |
| | | const $grid = xGrid.value |
| | | let list = [] |
| | | for (let i = 0; i < length; i++) { |
| | | list.push({}) |
| | | } |
| | | xGrid.value.reloadData(list) |
| | | |
| | | }) |
| | | |
| | | const editClosedEvent = ({ row, column,rowIndex}) => { |
| | | const $table = props.OrderDetail |
| | | let checkVal = row[column.property]*1 |
| | | const oldVal = $table.getTableData().fullData[rowIndex][column.property]*1 |
| | | if(checkVal!=oldVal){ |
| | | row[column.property]=null |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <vxe-grid |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @edit-closed="editClosedEvent" |
| | | > |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path:'userPassWord', |
| | | name: 'userPassWord', |
| | | component: () => import('../views/system/userPassWord/userPassWord.vue'), |
| | | children:[ |
| | | { |
| | | path: 'updateUserPassWord', |
| | | name: 'updateUserPassWord', |
| | | component: () => import('../views/system/userPassWord/UpdateUserPassWord.vue') |
| | | }, |
| | | { |
| | | name:'userPassWord', |
| | | path: '', |
| | | redirect:'/main/userPassWord/updateUserPassWord' |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | //sd模块 |
| | | { |
| | |
| | | titleUploadData.value.dateOfManufacture=null |
| | | } |
| | | |
| | | const inventoryArea = titleUploadData.value.inventoryArea |
| | | /*const inventoryArea = titleUploadData.value.inventoryArea |
| | | if(inventoryArea === null || inventoryArea === undefined || inventoryArea === ''){ |
| | | ElMessage.error("请输入库存区域") |
| | | return |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | let flowData = ref({ |
| | |
| | | justify-content: left; |
| | | flex-wrap: wrap; |
| | | margin-left: 5px; |
| | | margin-top: 15px; |
| | | } |
| | | |
| | | #entirety{ |
| | | text-align: center; |
| | | width: 196px; |
| | | height: 88px; |
| | | width: 195px; |
| | | height: 87px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | order: { |
| | |
| | | import {onMounted, reactive, ref, watch} from "vue" |
| | | import {useRouter,useRoute} from "vue-router" |
| | | import * as XLXS from "xlsx" |
| | | import {ElMessage} from "element-plus" |
| | | import {ElMessage, ElMessageBox} from "element-plus" |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import SelectProduct from "@/views/sd/product/SelectProduct.vue" |
| | | import OrderOtherMoney from "@/components/sd/order/OrderOtherMoney.vue" |
| | | import OrderSizeCheck from "@/components/sd/order/OrderSizeCheck.vue" |
| | | import {changeFilterEvent,filterChanged} from "@/hook" |
| | | import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove" |
| | | import downLoadFile from "@/hook/downLoadFile" |
| | |
| | | let productVisible = ref(false) |
| | | let errorAreaVisible = ref(false) |
| | | let otherMoneyVisible = ref(false) |
| | | let sizeCheckVisible = ref(false) |
| | | const maxTableLen =ref(150) |
| | | let errorArea = ref(0.4) |
| | | const userStore = useUserInfoStore() |
| | |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true,gt:13 },//开启虚拟滚动 |
| | | //scrollX:{ enabled: true,gt:15 },//开启虚拟滚动 |
| | | scrollX:{ enabled: true,gt:7 },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | |
| | | { code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false }, |
| | | { code: 'computedMoney', name: t('basicData.calculateAmount'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: true }, |
| | | { code: 'errorArea', name: '误差结算面积', prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false }, |
| | | { code: 'otherMoney', name: '其他金额', prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false } |
| | | { code: 'otherMoney', name: '其他金额', prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false }, |
| | | { code: 'sizeCheck', name: '尺寸审核', prefixIcon: 'vxe-icon-eye-fill', visible: true, disabled: true } |
| | | ] |
| | | ] |
| | | } |
| | |
| | | ElMessage.error(t('basicData.msg.checkoutLose')) |
| | | return |
| | | } |
| | | |
| | | let order ={ |
| | | title:titleUploadData.value, |
| | | detail:$grid.getTableData().tableData, |
| | | detail:$grid.getTableData().fullData, |
| | | otherMoney:otherMoney.value |
| | | } |
| | | saveOrder(order) |
| | | const errorAreaList = $grid.getTableData().fullData.filter( |
| | | item=>item.computeArea*1 < errorArea.value*1 |
| | | ) |
| | | if(errorAreaList.length){ |
| | | ElMessageBox.confirm( |
| | | `存在 |
| | | ${errorAreaList.length} |
| | | 条结算单片面积小于 |
| | | ${errorArea.value}是否按照${errorArea.value}计算`, |
| | | 'Warning', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | } |
| | | ).then(()=>{ |
| | | errorAreaComputed() |
| | | saveOrder(order) |
| | | }).catch(()=>{ |
| | | saveOrder(order) |
| | | }) |
| | | |
| | | }else { |
| | | saveOrder(order) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | break |
| | | } |
| | |
| | | otherMoneyVisible.value=true |
| | | break |
| | | } |
| | | case 'sizeCheck' :{ |
| | | sizeCheckVisible.value=true |
| | | break |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | if(res.data.order.processReview === 2){ |
| | | gridOptions.toolbarConfig.buttons[4].disabled = true |
| | | |
| | | |
| | | } |
| | | //取消审核按钮禁用 |
| | | //工艺审核后,订单未审核 取消审核按钮禁用和尺寸审核 |
| | | if(res.data.order.processReview === 2 && res.data.order.orderReview === 0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | gridOptions.menuConfig.body.options[0][8].disabled =false |
| | | } |
| | | |
| | | //按钮审核过后变为反审 |
| | |
| | | gridOptions.toolbarConfig.buttons[2].code='reviews' |
| | | gridOptions.toolbarConfig.buttons[2].name=t('basicData.cancelReview') |
| | | gridOptions.toolbarConfig.buttons[3].disabled = false |
| | | |
| | | const button = {'code': 'cancelOrder', |
| | | status: 'primary', |
| | | 'name': (res.data.order.orderReview>0?t('basicData.cancel'):t('basicData.restore'))} |
| | |
| | | ElMessage.error(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const gaveOrderSizeCheck = () => { |
| | | |
| | | |
| | | |
| | | reviewOrder(2) |
| | | } |
| | | |
| | | const changeCustomer = () => { |
| | |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | |
| | | <!-- 尺寸审核窗口--> |
| | | <el-dialog |
| | | id="sizeCheck" |
| | | v-model="sizeCheckVisible" |
| | | :title="'尺寸校验'" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | style="width: 614px;height:445px " |
| | | > |
| | | <order-size-check |
| | | @getParent="gaveOrderSizeCheck" |
| | | :OrderDetail="xGrid"/> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | width: 100%; |
| | | } |
| | | |
| | | :deep(#sizeCheck .el-dialog__body){ |
| | | height: 90%; |
| | | width: 100%; |
| | | } |
| | | |
| | | </style> |
| | |
| | | import footSum from "@/hook/footSum" |
| | | import OrderDetail from "@/components/sd/order/OrderDetail.vue" |
| | | import OrderCraftDetail from "@/components/sd/order/OrderCraftDetail.vue" |
| | | import OrderProcess from "@/components/sd/order/OrderProcess.vue"; |
| | | import {useI18n} from "vue-i18n" |
| | | import {columnDrop2, sortable2} from "@/hook/columnMove"; |
| | | const { t } = useI18n() |
| | |
| | | [ |
| | | { code: 'copy', name: t('searchOrder.copy'), prefixIcon: 'vxe-icon-copy', visible: true}, |
| | | { code: 'copyTitle', name: t('searchOrder.copyTitle'), prefixIcon: 'vxe-icon-copy', visible: true}, |
| | | { code: 'getProcessList', name: t('searchOrder.processFlows'), prefixIcon: 'vxe-icon-file-txt', visible: true} |
| | | // { code: 'getProcessList', name: t('searchOrder.processFlows'), prefixIcon: 'vxe-icon-file-txt', visible: true} |
| | | ] |
| | | ] |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick({ row }){ |
| | | cellClick({ row }){ |
| | | rowClickIndex.value = row |
| | | } |
| | | } |
| | |
| | | :orderId="rowClickIndex===null?null:rowClickIndex.orderId" |
| | | /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="流程卡" name="3"></el-tab-pane> |
| | | <el-tab-pane label="流程卡" name="3"> |
| | | <order-process |
| | | v-if="tabsValue==='3'" |
| | | :orderId="rowClickIndex===null?null:rowClickIndex.orderId" |
| | | /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <el-dialog |
| | | <!-- <el-dialog |
| | | v-model="dialogTableVisible" |
| | | destroy-on-close |
| | | :title="$t('searchOrder.processFlows')" |
| | |
| | | <ProcessCardProgress |
| | | :orderId="rowClickIndex.orderId" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | </el-dialog>--> |
| | | </div> |
| | | </template> |
| | | |
New file |
| | |
| | | <script setup lang="ts"> |
| | | import { reactive, ref } from 'vue' |
| | | import type { FormProps,FormInstance, FormRules } from 'element-plus' |
| | | import {ElMessage,ElMessageBox} from "element-plus"; |
| | | import request from "@/utils/request"; |
| | | import {Avatar, UserFilled} from "@element-plus/icons-vue"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const userStore = useUserInfoStore() |
| | | |
| | | console.log(userStore.user.id) |
| | | //注册用户参数 |
| | | const register = reactive({ |
| | | userId: userStore.user.id, |
| | | oldPassword: '', |
| | | password: '', |
| | | confirmPassword:'' |
| | | }) |
| | | |
| | | |
| | | const oldPassword = (rule: any, value: any, callback: any) => { |
| | | if (value.trim() === '') { |
| | | callback(new Error('旧密码不能为空')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | |
| | | const checkPassword = (rule: any, value: any, callback: any) => { |
| | | if (value.trim() === '') { |
| | | callback(new Error('新密码不能为空')) |
| | | }else if(value.length>16 || value.length<5){ |
| | | callback(new Error('密码长度不能低于5或超过16')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | |
| | | const checkConfirmPassword = (rule: any, value: any, callback: any) => { |
| | | if (value.trim() === '') { |
| | | callback(new Error('确认密码不能为空')) |
| | | }else if(value !== register.password){ |
| | | callback(new Error('两次密码不相同')) |
| | | }else if(value.length>16 || value.length<5){ |
| | | callback(new Error('密码长度不能低于5或超过16')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const rules = reactive<FormRules<typeof register>>({ |
| | | password:[{ validator: checkPassword, trigger: 'blur' }], |
| | | confirmPassword:[{ validator: checkConfirmPassword, trigger: 'blur' }] |
| | | // loginName: [{ validator: validateString, trigger: 'blur' }] |
| | | }) |
| | | |
| | | |
| | | const submitForm = (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | formEl.validate((valid) => { |
| | | if (valid) { |
| | | register.password = btoa(register.password) |
| | | register.oldPassword = btoa(register.oldPassword) |
| | | request.post('/user/updatePassWord', register).then((res) => { |
| | | if (res.data === true) { |
| | | ElMessage.success(`修改成功`) |
| | | router.push("/login") |
| | | } else { |
| | | ElMessage.error('旧密码错误') |
| | | return false |
| | | } |
| | | }).catch(error => { |
| | | ElMessage.error("服务器连接失败") |
| | | return false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div id="main-div"> |
| | | |
| | | <div id="register"> |
| | | <el-form |
| | | label-width="100px" |
| | | :model="register" |
| | | ref="ruleFormRef" |
| | | status-icon |
| | | :rules="rules" |
| | | > |
| | | <el-form-item label="旧密码:" prop="oldPassword"> |
| | | <el-input autocomplete="off" type="text" style="-webkit-text-security: disc" v-model="register.oldPassword" /> |
| | | </el-form-item> |
| | | <el-form-item label="新密码:" prop="password"> |
| | | <el-input autocomplete="off" type="text" style="-webkit-text-security: disc" v-model="register.password" /> |
| | | </el-form-item> |
| | | <el-form-item label="确认密码:" prop="confirmPassword"> |
| | | <el-input autocomplete="off" type="text" style="-webkit-text-security: disc" v-model="register.confirmPassword" /> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button |
| | | type="primary" |
| | | @click="submitForm(ruleFormRef)" |
| | | >修改 |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | h2{ |
| | | text-align: center; |
| | | width: 100vw; |
| | | margin-top: 10vh; |
| | | } |
| | | #register{ |
| | | background-color: #FAFAFA; |
| | | width: 50vw; |
| | | height: 50vh; |
| | | border-radius: 12px; |
| | | box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19); |
| | | display:flex; |
| | | align-items:center; |
| | | justify-content:center; |
| | | min-height: 280px; |
| | | } |
| | | .el-form{ |
| | | max-width: 300px; |
| | | } |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | import {ArrowLeftBold, ArrowRight, Search} from "@element-plus/icons-vue" |
| | | import {useRouter,useRoute,onBeforeRouteUpdate} from "vue-router" |
| | | import {useI18n} from "vue-i18n" |
| | | const { t } = useI18n() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | | indexFlag=index |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div id="main-div"> |
| | | <div id="div-title"> |
| | | <el-breadcrumb :separator-icon="ArrowRight"> |
| | | <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/userPassWord/updateUserPassWord' }">修改密码</el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | </div> |
| | | |
| | | <div id="main-body"> |
| | | <router-view :key="route.fullPath" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #main-div{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | #div-title{ |
| | | height: 2%; |
| | | width: 100%; |
| | | } |
| | | #searchButton{ |
| | | margin-top: -5px; |
| | | margin-left: 1rem; |
| | | } |
| | | #searchButton1{ |
| | | //margin-left: 10rem; |
| | | } |
| | | /*main-body样式*/ |
| | | #main-body{ |
| | | width: 100%; |
| | | height: 95%; |
| | | margin-top: 1%; |
| | | } |
| | | #select{ |
| | | margin-left:0.5rem; |
| | | } |
| | | :deep(.indexTag .el-breadcrumb__inner){ |
| | | color: #5CADFE !important; |
| | | } |
| | | </style> |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController //注解user控制器,挂载到springboot当中 |
| | | @RequestMapping("/user") //注解前端异步请求如:localhost:8080/user |
| | | public class UserController { |
| | |
| | | |
| | | //return |
| | | } |
| | | @ApiOperation("修改密码") |
| | | @PostMapping("/updatePassWord") |
| | | public Result updatePassWord(@RequestBody Map<String,Object> object){ |
| | | return Result.seccess( userService.updatePassWord(object)); |
| | | } |
| | | } |
| | |
| | | User findOne(Integer id); |
| | | |
| | | User findOneLoginName(String LoginName); |
| | | |
| | | User findOnePassWord(Integer id,String passWord); |
| | | @Select("select count(id) FROM `user` where login_name=#{userName} and password=#{password} ") |
| | | int checkUser(@Param("userName") String userName,@Param("password") String password); |
| | | |
| | |
| | | List<String> getUserRole(Integer id); |
| | | |
| | | Boolean userDelete(Integer id); |
| | | |
| | | Boolean updatePassWordById(Integer id,String passWord); |
| | | } |
| | |
| | | import com.example.erp.controller.dto.UserDTO; |
| | | import com.example.erp.entity.userInfo.PermissionBasic; |
| | | import com.example.erp.entity.userInfo.Role; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.entity.userInfo.User; |
| | | import com.example.erp.mapper.userInfo.*; |
| | | import com.example.erp.tools.TokenTools; |
| | |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | |
| | | return returnUser; |
| | | } |
| | | |
| | | @Transactional |
| | | public Boolean updatePassWord(Map<String,Object> object) { |
| | | boolean saveState = false; |
| | | int userId =0; |
| | | String oldPassWord = ""; |
| | | String passWord = ""; |
| | | if (object.get("userId") != null) { |
| | | userId = Integer.parseInt(object.get("userId").toString()); |
| | | } |
| | | if (object.get("oldPassword") != null) { |
| | | oldPassWord = object.get("oldPassword").toString(); |
| | | } |
| | | if (object.get("password") != null) { |
| | | passWord = object.get("password").toString(); |
| | | } |
| | | |
| | | User user =userMapper.findOnePassWord(userId,oldPassWord); |
| | | if (user!=null){ |
| | | if (userMapper.updatePassWordById(userId,passWord)){ |
| | | saveState = true; |
| | | } |
| | | } |
| | | return saveState; |
| | | |
| | | } |
| | | |
| | | /*----------------新版本登陆*/ |
| | | public UserDTO doLogin(UserDTO userDTO) { |
| | | User user = userMapper.selectOne(new QueryWrapper<User>(). |
| | |
| | | where login_name=#{LoginName} |
| | | </select> |
| | | |
| | | <select id="findOnePassWord" > |
| | | SELECT * |
| | | FROM erp_user_info.user |
| | | where id=#{id} and password=#{passWord} |
| | | </select> |
| | | |
| | | <insert id="register" useGeneratedKeys="true" keyProperty="id"> |
| | | insert erp_user_info.user |
| | | (password,user_name) |
| | |
| | | set state =0 |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="updatePassWordById"> |
| | | update erp_user_info.user |
| | | set password=#{passWord},update_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | </mapper> |