From af954d6dd06411cd9540520c59dd71dea4eff6e1 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 05 六月 2024 16:50:50 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/router/index.js                                         |   17 +
 north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue                          |   16 +
 north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java              |    4 
 north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue                     |    5 
 north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue                 |   11 
 north-glass-erp/northglass-erp/src/components/sd/order/OrderSizeCheck.vue                  |  138 ++++++++++++
 north-glass-erp/northglass-erp/src/components/sd/order/OrderProcess.vue                    |  135 ++++++++++++
 north-glass-erp/src/main/resources/mapper/userInfo/User.xml                                |   12 +
 north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue |    4 
 north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java      |    7 
 north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue                          |   78 ++++++
 north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue              |   60 +++++
 north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java            |   28 ++
 north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue        |  138 ++++++++++++
 14 files changed, 628 insertions(+), 25 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/OrderProcess.vue b/north-glass-erp/northglass-erp/src/components/sd/order/OrderProcess.vue
new file mode 100644
index 0000000..b83e218
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/OrderProcess.vue
@@ -0,0 +1,135 @@
+<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>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/OrderSizeCheck.vue b/north-glass-erp/northglass-erp/src/components/sd/order/OrderSizeCheck.vue
new file mode 100644
index 0000000..ca27479
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/OrderSizeCheck.vue
@@ -0,0 +1,138 @@
+<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>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/router/index.js b/north-glass-erp/northglass-erp/src/router/index.js
index f64d61c..2bd628a 100644
--- a/north-glass-erp/northglass-erp/src/router/index.js
+++ b/north-glass-erp/northglass-erp/src/router/index.js
@@ -61,6 +61,23 @@
             }
           ]
         },
+        {
+          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妯″潡
         {
diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue
index 5ec9374..412c37a 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue
@@ -572,11 +572,11 @@
             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({
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue
index d23abb2..5d6ca94 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue
@@ -115,12 +115,13 @@
   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;
 }
 
diff --git a/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue b/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
index ddd74b4..543c221 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
@@ -33,16 +33,7 @@
   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: {
diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
index d500099..fcab099 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -2,12 +2,13 @@
 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"
@@ -19,6 +20,7 @@
 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()
@@ -91,7 +93,7 @@
   importConfig: {},
   exportConfig: {},
   scrollY:{ enabled: true,gt:13 },//寮�鍚櫄鎷熸粴鍔�
-  //scrollX:{ enabled: true,gt:15 },//寮�鍚櫄鎷熸粴鍔�
+  scrollX:{ enabled: true,gt:7 },//寮�鍚櫄鎷熸粴鍔�
   showOverflow:true,
   menuConfig: {
     body: {
@@ -104,7 +106,8 @@
           { 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 }
         ]
       ]
     }
@@ -324,12 +327,42 @@
               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
         }
@@ -434,6 +467,10 @@
           otherMoneyVisible.value=true
           break
         }
+        case 'sizeCheck' :{
+          sizeCheckVisible.value=true
+          break
+        }
       }
     }
   },
@@ -500,10 +537,12 @@
       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
       }
 
       //鎸夐挳瀹℃牳杩囧悗鍙樹负鍙嶅
@@ -512,6 +551,7 @@
         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'))}
@@ -656,6 +696,13 @@
       ElMessage.error(res.msg)
     }
   })
+}
+
+const gaveOrderSizeCheck = () => {
+
+
+
+  reviewOrder(2)
 }
 
 const changeCustomer =  () => {
@@ -1074,6 +1121,20 @@
           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>
 
@@ -1111,4 +1172,9 @@
     width: 100%;
   }
 
+  :deep(#sizeCheck .el-dialog__body){
+    height: 90%;
+    width: 100%;
+  }
+
 </style>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
index 45bd89c..933a586 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
@@ -11,6 +11,7 @@
   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()
@@ -65,7 +66,7 @@
           [
             { 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}
           ]
         ]
       }
@@ -193,7 +194,7 @@
         }
       }
     },
-    cellDblclick({ row }){
+    cellClick({ row }){
       rowClickIndex.value = row
     }
   }
@@ -444,13 +445,18 @@
               :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')"
@@ -458,7 +464,7 @@
       <ProcessCardProgress
           :orderId="rowClickIndex.orderId"
           style="width: 100%;height: 100%" />
-    </el-dialog>
+    </el-dialog>-->
   </div>
 </template>
 
diff --git a/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue
new file mode 100644
index 0000000..931e86f
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue
@@ -0,0 +1,138 @@
+<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>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue
new file mode 100644
index 0000000..6dd5d91
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue
@@ -0,0 +1,60 @@
+<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>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java b/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
index fafcdf5..2d93c73 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
@@ -13,6 +13,8 @@
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
+
 @RestController //娉ㄨВuser鎺у埗鍣紝鎸傝浇鍒皊pringboot褰撲腑
 @RequestMapping("/user")  //娉ㄨВ鍓嶇寮傛璇锋眰濡傦細localhost锛�8080/user
 public class UserController {
@@ -55,4 +57,9 @@
 
         //return
     }
+    @ApiOperation("淇敼瀵嗙爜")
+    @PostMapping("/updatePassWord")
+    public Result updatePassWord(@RequestBody Map<String,Object> object){
+        return Result.seccess( userService.updatePassWord(object));
+    }
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
index 04a247f..1a0c719 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
@@ -18,6 +18,8 @@
     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);
 
@@ -30,4 +32,6 @@
     List<String> getUserRole(Integer id);
 
     Boolean userDelete(Integer id);
+
+    Boolean updatePassWordById(Integer id,String passWord);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
index 2e32fbe..9761456 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
@@ -7,6 +7,7 @@
 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;
@@ -15,6 +16,7 @@
 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;
@@ -80,6 +82,32 @@
         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>().
diff --git a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
index 1120d54..a27247d 100644
--- a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
+++ b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
@@ -41,6 +41,12 @@
         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)
@@ -66,4 +72,10 @@
         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>
\ No newline at end of file

--
Gitblit v1.8.0