Browse Source

护理工单,账号管理,部门管理

nanMing 2 years ago
parent
commit
cac1a1ae8a

+ 12 - 0
ruoyi-ui/src/utils/regular.js

@@ -40,6 +40,18 @@ export const chineseOne = (rule, value, callback) => {
   }
 }
 
+export const Email = (rule, value, callback) => {
+  let reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
+  if (value) {
+    if (value.includes('✱')) {
+      callback()
+    } else {
+      reg.test(value) ? callback() : callback(new Error('请输入正确的邮箱地址'));
+    }
+  } else {
+    callback()
+  }
+}
 export const Phone = (rule, value, callback) => {
   let reg = /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/;
   if (value) {

+ 19 - 13
ruoyi-ui/src/views/organization/kugl/gdjdcx/index.vue

@@ -165,7 +165,7 @@
 <script>
 import {addHlgd, delHlgd, gdListHlgd, getHlgd, updateHlgd} from "@/api/organization/kugl/hlgd";
 import {mapState} from "vuex";
-import { decryptRowData_ECB } from "@/api/tool/sm4";
+import { decryptRowData_ECB,decryptData_ECB } from "@/api/tool/sm4";
 
 
 export default {
@@ -236,11 +236,11 @@ export default {
         isWc: [
           { required: true, message: "是否完成不能为空", trigger: "blur" }
         ],
-      }
+      },
+      decodeStr:{},
     };
   },
   created() {
-    // console.log(this.$route.query,'$route.query.name');
     if(this.$route.query&&this.$route.query.isWc)
     {
       this.queryParams.isWc=this.$route.query.isWc;
@@ -263,7 +263,7 @@ export default {
         this.queryParams.params["endJhfusj"] = this.daterangeJhfusj[1];
       }
       gdListHlgd(this.queryParams).then(response => {
-        this.hlgdList = decryptRowData_ECB(response.rows, ["xm", "zjhm"], [1, 2]);
+        this.hlgdList = decryptRowData_ECB(response.rows, ["xm", "zjhm", "ygXm", "ygZjhm", "sjYgXm"], [1, 2, 1, 2, 1]);
         this.total = response.total;
         this.loading = false;
       });
@@ -344,14 +344,15 @@ export default {
       this.reset();
       const id = row.id;
       getHlgd(id).then(response => {
-        this.form.id = response.data.id;
-        this.form.jhryId = response.data.jhryId;
-        this.form.jhfusj = response.data.jhfusj;
-        this.form.sjryId = response.data.jhryId;
-        this.form.sjYgXm = response.data.ygXm;
-        this.form.sjYgZjhm = response.data.ygZjhm;
-        this.form.sjYgXb = response.data.ygXb;
-        // this.form = response.data;
+        this.decodeStr = decryptData_ECB(this.deepCopy(response.data), ["xm", "zjhm", "ygXm", "ygZjhm","sjYgXm"], [99, 99, 99, 99, 99])
+        let data = decryptData_ECB(response.data, ["xm", "zjhm", "ygXm", "ygZjhm","sjYgXm"], [1, 2, 1, 2,1])
+        this.form.id = data.id;
+        this.form.jhryId = data.jhryId;
+        this.form.jhfusj = data.jhfusj;
+        this.form.sjryId = data.jhryId;
+        this.form.sjYgXm = data.ygXm;
+        this.form.sjYgZjhm = data.ygZjhm;
+        this.form.sjYgXb = data.ygXb;
         this.open = true;
         this.title = "工单完成";
       });
@@ -362,7 +363,12 @@ export default {
         if (valid) {
           this.submitFormLoading = true;
           if (this.form.id != null) {
-            updateHlgd(this.form).then(response => {
+            let params = {
+              ...this.form,
+              sjYgXm: this.form.sjYgXm.includes('✱') ? this.decodeStr.ygXm : this.form.sjYgXm,
+              sjYgZjhm: this.form.sjYgZjhm.includes('✱') ? this.decodeStr.ygZjhm : this.form.sjYgZjhm,
+            }
+            updateHlgd(params).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();

+ 2 - 2
ruoyi-ui/src/views/organization/kugl/khjy/index.vue

@@ -154,7 +154,7 @@
 
 <script>
 import {addKhjy, delKhjy, getKhjy, listKhjy, updateKhjy} from "@/api/organization/kugl/khjy";
-import {chineseOne, Regular, Phone} from '@/utils/regular';
+import {chineseOne, Mobile} from '@/utils/regular';
 import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
 
 export default {
@@ -208,7 +208,7 @@ export default {
         tsrlxfs: [
           { required: true, message: "投诉人手机号码不能为空", trigger: "blur" }
           ,
-          {validator: Phone, trigger: "blur"}
+          {validator: Mobile, trigger: "blur"}
         ],
         tsnr: [
           { required: true, message: "投诉内容不能为空", trigger: "blur" }

+ 15 - 4
ruoyi-ui/src/views/organization/kugl/zlhljh/index.vue

@@ -118,7 +118,7 @@
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleAdd(scope.row)"
+            @click="handleAdd(scope.row,scope.$index)"
             v-hasPermi="['organization:hlgd:add']"
             >制定工单</el-button
           >
@@ -334,6 +334,8 @@ export default {
           { required: true, message: "是否完成不能为空", trigger: "blur" },
         ],
       },
+      decodeStr:[],
+      decodeIdx:null,
     };
   },
   created() {
@@ -350,6 +352,8 @@ export default {
     getList() {
       this.loading = true;
       listHlgd(this.queryParams).then((response) => {
+        this.decodeStr = decryptRowData_ECB(this.deepCopy(response.rows), ["xm", "zjhm"], [99, 99]);
+        console.log(this.decodeStr);
         this.hlgdList = decryptRowData_ECB(response.rows, ["xm", "zjhm"], [1, 2]);
         this.total = response.total;
         this.loading = false;
@@ -403,8 +407,8 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    /** 新增按钮操作 */
-    handleAdd(row) {
+    /** 制定工单按钮操作 */
+    handleAdd(row,idx) {
       this.reset();
       this.open = true;
       this.form.jgId = this.user.userData.jgId;
@@ -419,6 +423,7 @@ export default {
       this.form.xb = row.xb;
       this.open = true;
       this.queryParamsMin.khId = row.khId;
+      this.decodeIdx = idx
       this.getFwxmList();
     },
     /** 新增服务项目按钮操作 */
@@ -488,6 +493,7 @@ export default {
       }
       this.$refs["form"].validate((valid) => {
         if (valid) {
+          console.log(this.form.id);
           if (this.form.id != null) {
             this.submitFormLoading = true;
             updateHlgd(this.form).then((response) => {
@@ -496,7 +502,12 @@ export default {
               this.getList();
             }).finally(()=>this.submitFormLoading =false);
           } else {
-            addHlgd(this.form).then((response) => {
+            let params = {
+              ...this.form,
+              xm: this.decodeStr[this.decodeIdx].xm,
+              zjhm: this.decodeStr[this.decodeIdx].zjhm,
+            }
+            addHlgd(params).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();

+ 20 - 31
ruoyi-ui/src/views/system/dept/index.vue

@@ -106,7 +106,7 @@
         <el-row>
           <el-col :span="24" v-if="form.parentId !== 0">
             <el-form-item label="上级部门" prop="parentIdData">
-              <DeptCascader v-model.sync="form.parentIdData"></DeptCascader>
+              <DeptCascader v-model="form.parentIdData"></DeptCascader>
               <!--<el-cascader v-if="show" :key="modalKey" v-model="form.parentIdData" :props="props" ></el-cascader>-->
               <!--<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />-->
             </el-form-item>
@@ -157,7 +157,7 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="所属区划" required>
-              <el-input v-model="form.locationName|| '无'" :disabled="true" v-if="form.deptId"/>
+              <el-input v-model="form.locationName" :disabled="true" v-if="form.deptId"/>
               <RegionCascaderSelect valueProp="code" v-model="form.location" v-else></RegionCascaderSelect>
             </el-form-item>
           </el-col>
@@ -175,6 +175,7 @@
 import {addDept, delDept, getDept, listDept, updateDept} from "@/api/system/dept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { Email,Mobile } from '@/utils/regular'
 import {mapGetters, mapState} from "vuex";
 import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
 
@@ -220,18 +221,10 @@ export default {
           { required: true, message: "显示排序不能为空", trigger: "blur" }
         ],
         email: [
-          {
-            type: "email",
-            message: "请输入正确的邮箱地址",
-            trigger: ["blur", "change"]
-          }
+          { validator: Email, trigger: "blur" }
         ],
         phone: [
-          {
-            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-            message: "请输入正确的手机号码",
-            trigger: "blur"
-          }
+          {validator: Mobile, trigger: 'blur' }
         ],
       }
     };
@@ -255,7 +248,6 @@ export default {
         item.hasChildren = true;
         item.isZs = (tree.locationCode == item.locationCode ? "直属":"")
       });
-      console.log("zzz",data)
       resolve(data);
     },
     async updateTreeData(node) {
@@ -366,7 +358,7 @@ export default {
       this.reset();
       getDept(row.deptId).then(response => {
         this.open = true;
-        this.form = response.data;
+        this.form = decryptData_ECB(response.data, ['leader', 'phone', 'email'], [1, 3, 5]);
         // this.show = false;
         this.form.parentIdData =[...row.ancestors.split(',').map(item=>{
           return parseInt(item)
@@ -374,9 +366,6 @@ export default {
         // this.$nextTick(() => {
         //   this.show = true;
         // });
-        console.log(this.form.parentIdData,'this.form.parentIdData');
-        console.log(row,'this.form.parentIdData');
-
         this.title = "修改部门";
       });
     },
@@ -384,20 +373,20 @@ export default {
     submitForm: function() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.location && this.form.parentIdData){
-            if (this.form.location.length != this.form.parentIdData.length + 1
-              && this.form.location.length != this.form.parentIdData.length
-            ){
-              this.$modal.msgError("所属区划只能是当前部门层级或者上一级(直属)");
-              return
-            }
-          }
-          if (this.form.location){
-            this.form.locationCode = this.form.location[this.form.location.length-1];
-          }else{
-            this.$modal.msgError("所属区划不能为空");
-            return
-          }
+          // if (this.form.location && this.form.parentIdData){
+          //   if (this.form.location.length != this.form.parentIdData.length + 1
+          //     && this.form.location.length != this.form.parentIdData.length
+          //   ){
+          //     this.$modal.msgError("所属区划只能是当前部门层级或者上一级(直属)");
+          //     return
+          //   }
+          // }
+          // if (this.form.location){
+          //   this.form.locationCode = this.form.location[this.form.location.length-1];
+          // }else{
+          //   this.$modal.msgError("所属区划不能为空");
+          //   return
+          // }
           if(this.form.parentIdData)
           {
             this.form.parentId=this.form.parentIdData[this.form.parentIdData.length-1]

+ 1 - 1
ruoyi-ui/src/views/system/zhgl/sqyljg/index.vue

@@ -467,7 +467,7 @@ export default {
       const id = row.id || this.ids
       getZhgl(id).then(response => {
         response.data.status = '02';
-        this.form = response.data;
+        this.form = decryptData_ECB(response.data,['frxm','frlxfs'],[1,3])
         /****** sks 需要改动的地方 start ******/
         // this.copyForm=this.deepCopy(response.data)
         /****** sks 需要改动的地方 end ******/

+ 1 - 1
ruoyi-ui/src/views/system/zhgl/yljg/index.vue

@@ -325,7 +325,7 @@ export default {
       this.reset()
       const id = row.id || this.ids
       getZhgl(id).then((response) => {
-        this.form = response.data
+        this.form = decryptData_ECB(response.data,['frxm','frlxfs'],[1,3])
         this.open = true
         this.title = '详情'
       })

+ 1 - 1
ruoyi-ui/vue.config.js

@@ -40,7 +40,7 @@ module.exports = {
         // target: `http://ch.tshe.cn/`,
         // target: `http://sky.tshe.cn/`,
         // target: `http://4j9755v434.qicp.vip:30877`,
-        // target: `http://10.16.4.3:8080`, //陈航
+        // target: `http://10.16.4.1:8080`, //陈航
         // target: `http://10.16.4.5:8080`,//孙坤阳
         target: `http://localhost:8080`,
         // target: `http://mz.tshe.cn:801/prod-api`,