Преглед изворни кода

密码调整,购物车调整

qymljy пре 2 година
родитељ
комит
83dfbae634

+ 0 - 1
src/Form/projectChange/add.vue

@@ -513,7 +513,6 @@ export default {
         if (!valid) return false
         const res = await this.$api.requested({
           "id": "20221020144202",
-          "version":1,
           "content": this.form
         })
         this.tool.showMessage(res,()=>{

+ 0 - 1
src/HDrpManagement/projectPredictionManage/details/modules/projectList.vue

@@ -577,7 +577,6 @@ export default {
       this.productData(this.selectProject)
     },
     onChange(val,index,data){
-      console.log(data,'9999')
       if (val < data.orderminqty){
         data.orderqty = data.orderminqty.toFixed(4)
       }else {

+ 39 - 12
src/SDrpManagement/shopCart/modules/list.vue

@@ -75,7 +75,7 @@
         label="数量"
         width="150">
         <template slot-scope="scope">
-        <el-input-number size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" @change="changeQty(scope.row)" :step="scope.row.orderaddqty" label="输入数量"></el-input-number>
+        <el-input-number size="mini" v-model="scope.row.qty" :min="scope.row.orderminqty" @change="changeQty(scope.$index,scope.row)" :step="scope.row.orderaddqty" label="输入数量"></el-input-number>
         </template>
       </el-table-column>
       <el-table-column
@@ -150,7 +150,7 @@ export default {
       this.total = res.total
       this.currentPage = res.pageNumber
       console.log(res.data);
-      
+
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
@@ -186,15 +186,42 @@ export default {
       this.listData()
       this.$emit('onRadioChange',this.params.content.istool)
     },
-    async changeQty (row) {
-      const res = await this.$api.requested({
-        "id": 20220924104302,
-        "content": {
-          "sa_shoppingcartid": row.sa_shoppingcartid, 
-          "qty": row.qty //数量
-        },
-      })
-      this.$emit('qtyChange')
+    async changeQty (index,row) {
+      if (row.qty < row.orderminqty){
+        row.qty = row.orderminqty
+        const res = await this.$api.requested({
+          "id": 20220924104302,
+          "content": {
+            "sa_shoppingcartid": row.sa_shoppingcartid,
+            "qty": row.qty //数量
+          },
+        })
+        this.$emit('qtyChange')
+      }else {
+        if ((row.qty - row.orderminqty)/row.orderaddqty > 0){
+          let k = Math.ceil((row.qty - row.orderminqty)/row.orderaddqty)
+          row.qty = k * row.orderaddqty + row.orderminqty
+          const res = await this.$api.requested({
+            "id": 20220924104302,
+            "content": {
+              "sa_shoppingcartid": row.sa_shoppingcartid,
+              "qty": row.qty //数量
+            },
+          })
+          this.$set(this.tableData,index,row)
+          this.$emit('qtyChange')
+        }else {
+          const res = await this.$api.requested({
+            "id": 20220924104302,
+            "content": {
+              "sa_shoppingcartid": row.sa_shoppingcartid,
+              "qty": row.qty //数量
+            },
+          })
+          this.$emit('qtyChange')
+        }
+      }
+
     }
   },
   mounted () {
@@ -220,4 +247,4 @@ export default {
 .image {
   width:40px;height:40px;margin:0px auto;
 }
-</style>
+</style>

+ 12 - 6
src/SManagement/user/user-info/UserInfo.vue

@@ -36,7 +36,7 @@ export default {
         "content": {
         }
       },
-      userInfo:''
+      userInfo:'',
     };
   },
   components: {
@@ -54,18 +54,23 @@ export default {
     },
   },
   watch:{
+
   },
   created() {
     this.getUserInfo()
-    console.log(this.$options);
-
   },
   methods: {
+    queryIs(){
+      let password = sessionStorage.getItem("isPassword")
+      if (password == 1){
+        this.$refs.passWord.dialogVisible = true
+      }
+
+    },
     //获取用户信息
     async getUserInfo() {
       let res = await this.$api.requested(this.param)
       this.userInfo = res.data
-      console.log(this.userInfo);
 
     },
     //上传头像成功
@@ -104,14 +109,15 @@ export default {
     },
   },
   mounted() {
-    if (JSON.parse(sessionStorage.getItem('active_password')) == '1' && JSON.parse(sessionStorage.getItem('isPassword')) == '1'){
+    document.addEventListener("click", this.queryIs);
+    /*if (JSON.parse(sessionStorage.getItem('active_password')) == '1' && JSON.parse(sessionStorage.getItem('isPassword')) == '1'){
       this.$refs.passWord.dialogVisible = true
       console.log(this.$refs.passWord.form,'form')
       this.$refs.passWord.form.pass = ''
       this.$refs.passWord.form.newpass = ''
       this.$refs.passWord.form.checkpass = ''
       console.log(this.$refs.passWord.form,'form')
-    }
+    }*/
   }
 };
 </script>

+ 2 - 3
src/SManagement/user/user-info/components/PassEdit.vue

@@ -4,7 +4,7 @@
     <el-dialog title="修改密码" append-to-body :visible.sync="dialogVisible" :before-close="handleClose">
       <el-form ref="form" :rules="rules" :model="form" label-width="80px">
         <el-form-item label="原密码" prop="pass">
-          <el-input v-model="form.pass" placeholder="请输入原密码" auto-complete="new-password"></el-input>
+          <el-input v-model="form.pass" placeholder="请输入原密码"  auto-complete="new-password"></el-input>
         </el-form-item>
         <el-form-item label="新密码" prop="newpass">
           <el-input placeholder="请输入新密码" v-model="form.newpass" show-password  auto-complete="new-password"></el-input>
@@ -67,13 +67,11 @@ export default {
     },
     onEdit(){
       this.dialogVisible = true
-      console.log(this.form,'form')
       this.form = {
         pass:'',
         newpass:'',
         checkpass:''
       }
-      console.log(this.form,'form')
     },
     passEdit() {
       this.$refs.form.validate(val => {
@@ -116,6 +114,7 @@ export default {
     onClose(){
       sessionStorage.setItem('isPassword','0')
       this.dialogVisible = false
+      this.$refs.form.resetFields()
     }
   },
 };

+ 18 - 14
src/SManagement/user/user-info/components/baseInfo.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="base-info">
     <p class="title">基本信息</p>
-    <el-form :model="ruleForm" 
-             :rules="rules" 
-             ref="ruleForm" 
+    <el-form :model="ruleForm"
+             :rules="rules"
+             ref="ruleForm"
              label-width="104px"
-             label-position="right" 
+             label-position="right"
              class="demo-ruleForm">
       <el-form-item label="姓名:" prop="name" v-focus>
         <el-input v-model="ruleForm.name" size="small" :placeholder="ruleForm.name" :disabled="editStatus" ref="nameEdit"></el-input>
@@ -86,8 +86,8 @@ export default {
         let handle = (e) => {
           if(!el.contains(e.target)) {
             vm.context.ruleForm.name = vm.context.userInfo.name
-            vm.context.editStatus = true       
-            vm.context.$refs.ruleForm.clearValidate()     
+            vm.context.editStatus = true
+            vm.context.$refs.ruleForm.clearValidate()
           }
         }
         el.handle = handle
@@ -102,8 +102,8 @@ export default {
         let handle = (e) => {
           if(!el.contains(e.target)) {
             vm.context.ruleForm.email = vm.context.userInfo.hr.email
-            vm.context.EmailStatus = true  
-            vm.context.$refs.ruleForm.clearValidate()     
+            vm.context.EmailStatus = true
+            vm.context.$refs.ruleForm.clearValidate()
           }
         }
         el.handle = handle
@@ -116,6 +116,9 @@ export default {
   },
   props:['userInfo'],
   computed:{
+  },
+  mounted() {
+
   },
   watch:{
     userInfo: {
@@ -132,7 +135,7 @@ export default {
           this.$nextTick(() => {
             this.$refs.nameEdit.focus()
           })
-        }        
+        }
       }
     },
     EmailStatus: {
@@ -141,23 +144,24 @@ export default {
           this.$nextTick(() => {
             this.$refs.email.focus()
           })
-        }        
+        }
       }
     }
   },
   methods: {
+
     save(type) {
       if(!this.ruleForm.phonenumber) return this.$notify({
           title:'提示',
           message:'请填写手机号',
           type: 'warning'
-        })   
+        })
       this.$refs.ruleForm.validate(async val => {
         if(!val) return  this.$notify({
           title:'提示',
           message:'请按照要求填写信息',
           type: 'warning'
-        })   
+        })
         if( type == 'name') {
           if(this.ruleForm.name == this.userInfo.name) {
             this.$notify({
@@ -171,7 +175,7 @@ export default {
           this.editStatus = true
           this.edit.content.name = this.ruleForm.name
           this.edit.content.phonenumber = this.ruleForm.phonenumber
-          
+
           let res = await this.$api.requested(this.edit)
           this.tool.showMessage(res)
         } else if( type == 'email' ) {
@@ -188,7 +192,7 @@ export default {
           this.edit.content.name = this.ruleForm.name
           this.edit.content.email = this.ruleForm.email
           this.edit.content.phonenumber = this.ruleForm.phonenumber
-          
+
           let res = await this.$api.requested(this.edit)
           this.tool.showMessage(res)
         }