Bladeren bron

bug处理

@dongkboy 1 jaar geleden
bovenliggende
commit
cb5685c798

+ 2 - 2
.env.development

@@ -3,8 +3,8 @@ VITE_APP_SETTING = true
 # 页面标题
 VITE_APP_TITLE = 掌柜运营平台
 # 接口请求地址,会设置到 axios 的 baseURL 参数上
-VITE_APP_API_BASEURL = http://192.168.0.55:8001  #董鑫
-# VITE_APP_API_BASEURL = http://192.168.0.253:8001  #田智
+# VITE_APP_API_BASEURL = http://192.168.0.55:8001  #董鑫
+VITE_APP_API_BASEURL = http://192.168.0.253:8001  #田智
 # VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
 
 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空

+ 1 - 1
.env.test

@@ -7,7 +7,7 @@ VITE_APP_API_BASEURL = http://test-platform.baoxianzhanggui.com/api #测试地
 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
 VITE_APP_DEBUG_TOOL =
 # 是否禁用开发者工具,可防止被调试
-VITE_APP_DISABLE_DEVTOOL = true
+VITE_APP_DISABLE_DEVTOOL = false
 
 # 是否在打包时启用 Mock
 VITE_BUILD_MOCK = false

+ 39 - 4
src/assets/styles/globals.css

@@ -154,15 +154,21 @@ textarea {
 
 /* 全局样式覆盖 */
 .bg-\[var\(--g-sub-sidebar-menu-active-bg\)\]\! {
-  background: var(--g-sub-sidebar-menu-active-bg) /* var(--g-sub-sidebar-menu-active-bg) */ !important;
+  background:
+    var(--g-sub-sidebar-menu-active-bg)
+    /* var(--g-sub-sidebar-menu-active-bg) */ !important;
 }
 
 .bg-\[var\(--g-header-menu-active-bg\)\]\! {
-  background-color: #ffffff1a /* var(--g-header-menu-active-bg) */ !important;
+  background-color:
+    #ffffff1a
+    /* var(--g-header-menu-active-bg) */ !important;
 }
 
 .text-\[var\(--g-header-menu-active-color\)\]\! {
-  color: #fff /* var(--g-header-menu-active-color) */ !important;
+  color:
+    #fff
+    /* var(--g-header-menu-active-color) */ !important;
 }
 
 .sub-menu {
@@ -204,6 +210,33 @@ textarea {
 
 /* 消息提示弹窗 */
 
+/* dialog对话框样式 */
+.el-dialog {
+  padding: 0;
+}
+
+.el-dialog__header {
+  padding: 13px;
+  text-align: center;
+  border-bottom: 1px solid #eee;
+}
+
+.el-dialog__header .el-dialog__title {
+  font-weight: bold;
+  color: #333;
+}
+
+.el-dialog__body {
+  padding: 24px;
+}
+
+.el-dialog__footer {
+  padding: 13px 24px;
+  border-top: 1px solid #eee;
+}
+
+/* dialog对话框样式 */
+
 /* 全局样式覆盖 */
 
 /* 自定义全局样式 */
@@ -294,7 +327,9 @@ textarea {
 }
 
 .elementSpacing > * {
-  margin-bottom: 5px; /* 下边距 */
+  margin-bottom: 5px;
+
+  /* 下边距 */
 }
 
 .size14 {

+ 9 - 3
src/components/Table/index.vue

@@ -67,9 +67,15 @@
             </el-tag>
             <ImagePreview v-else-if="column.component === 'Image'" :src="getImgTo(scope.row, column)" width="50px"
               height="50px"></ImagePreview>
-            <span v-else>
-              {{ getDisplayText(scope.row, column) }}
-            </span>
+            <div v-else>
+              <div v-if="getDisplayText(scope.row, column).includes('\n')" class="flex f-c ">
+                  <span v-for="(line, index) in getDisplayText(scope.row, column).split('\n')" :key="index">{{ line
+                  }}</span>
+              </div>
+              <span v-else>
+                {{ getDisplayText(scope.row, column) }}
+              </span>
+            </div>
           </template>
         </el-table-column>
         <el-table-column label="操作" fixed="right" :width="props.columnwidth" align="center">

+ 130 - 24
src/views/insuranceCompanyConfiguration/insuranceCompanyConfig.vue

@@ -102,13 +102,38 @@
           </ElCol>
           <ElCol :md="24" :lg="12" v-if="dialogType == 'add' || dialogType == 'edit'">
             <el-form-item label="logo">
-              <el-upload action="#" list-type="picture-card" :auto-upload="false" :on-change="sysIconupload"
-                ref="upload1" :limit="1" :class="{ disabled: uploadDisabled }" :on-remove="handleRemove">
-                <img v-if="sysIconList.url" :src="sysIconList.url" class="avatar" style="width: 100%;height: 100%;" />
-                <el-icon v-else class="avatar-uploader-icon">
-                  <Plus />
-                </el-icon>
-              </el-upload>
+              <div class="flex f-c a-start">
+                <el-upload action="" v-if="!companyImgUrl" :auto-upload="false" :show-file-list="false"
+                  accept=".png, .jpg, .jpeg" @change="uploadImage($event)">
+                  <el-button type="primary" size="default">
+                    <template #icon>
+                      <el-icon>
+                        <Upload />
+                      </el-icon>
+                    </template>
+                    上传</el-button>
+                </el-upload>
+                <div class="fileInfo" v-else>
+                  <div class="fileName">{{ companyImgName }}</div>
+                  <div class="fileBtn">
+                    <el-upload :show-file-list="false" :auto-upload="false" accept=".png, .jpg, .jpeg"
+                      @change="uploadImage($event)" style="display: flex; align-items: center;">
+                      <el-icon class="btn-icon">
+                        <Upload />
+                      </el-icon>
+                    </el-upload>
+                    <el-icon class="btn-icon" @click="imageView">
+                      <View />
+                    </el-icon>
+                    <el-icon class="btn-icon" @click="download(companyImgUrl,companyImgName)">
+                      <Download />
+                    </el-icon>
+                    <el-icon class="btn-icon" @click="deleteImage">
+                      <Delete />
+                    </el-icon>
+                  </div>
+                </div>
+              </div>
             </el-form-item>
           </ElCol>
         </el-form>
@@ -122,6 +147,9 @@
         </div>
       </template>
     </el-dialog>
+    <div class="image-view" v-if="imageShow" @click="imageShow = false">
+      <img :src="companyImgUrl" />
+    </div>
   </div>
 </template>
 
@@ -195,9 +223,7 @@ const cpmpanyformRules = ref<FormRules>({
     { required: true, trigger: 'change', message: '请上传图片' },
   ],
 });
-const sysIconList = reactive({
-  url: "",
-})
+
 const props = {
   expandTrigger: 'hover' as const,
   value: 'areaCode',
@@ -206,6 +232,9 @@ const props = {
   checkStrictly: true,
 
 }
+const imageShow=ref(false);//图片预览开关
+const companyImgName = ref();
+const companyImgUrl = ref();
 const FormRef = ref<FormInstance>()
 const provinceoptions = ref()//省市区回显数据
 const areaOptions = ref()//省市区数据
@@ -213,7 +242,6 @@ const dialogTitle = ref('添加保险公司')//弹窗title
 const dialogType = ref('add')//弹窗title  add | edit | subsidiaryadd | subsidiaryedit
 const fromSize = ref<ComponentSize>('large')//表单大小
 const loading = ref(false)
-const uploadDisabled = ref(false)//图片回显去掉上传按键
 const tableHeight = ref(''); // 初始化表格高度
 const multipleTableRef = ref();
 const tabledata = ref([]);//树形数据
@@ -241,8 +269,7 @@ const columns: Column[] = [
       } else if (type == 0) {
         return <ElTag>渠道</ElTag>;
       } else {
-        return <ElTag>{type}</ElTag>;
-
+        return <ElTag>寿险</ElTag>;
       }
     }
   },
@@ -346,8 +373,9 @@ const companyEdit = (column: any) => {
     cpmpanyform.nameSimple = column.nameSimple;
     cpmpanyform.remark = column.remark;
     cpmpanyform.type = column.type;
-    cpmpanyform.logo = column.logo;
-    sysIconList.url = column.downloadUrl;
+    cpmpanyform.logo = column.logoFile.id;
+    companyImgUrl.value=column.downloadUrl
+    companyImgName.value=column.logoFile.fileName;
   } else {
     dialogType.value = 'subsidiaryedit';
     dialogTitle.value = '编辑';
@@ -360,7 +388,6 @@ const companyEdit = (column: any) => {
     cpmpanyform.parentId = column.parentId;
     cpmpanyform.parentName = column.parentName;
     cpmpanyform.remark = column.remark;
-    sysIconList.url = column.downloadUrl;
   }
 
   // (Object.keys(cpmpanyform) as (keyof typeof cpmpanyform)[]).forEach((key) => {
@@ -439,21 +466,47 @@ const saveInfo = async (formEl: FormInstance | undefined) => {
     }
   })
 }
-const sysIconupload = (file: any) => {
-  let files = file.raw;
+
+const uploadImage = async (file: any) => {
+  let files = file.raw
   const params = new FormData(); // 声明formData数据类型
   params.append("file", files);
   api.toolApi.fileupload(params).then((res: any) => {
     if (res.code == 200) {
       cpmpanyform.logo = res.data.id;
-      uploadDisabled.value = true;
+      companyImgName.value = res.data.fileName;
+      companyImgUrl.value = res.data.downloadUrl;
     }
   })
 }
-const handleRemove = () => {
-  sysIconList.url = '';
-  uploadDisabled.value = false;
-
+// 图片预览
+const imageView = () => {
+  imageShow.value=true;
+}
+// 图片下载
+const download = (url:string, name:string) => {
+  let image = new Image();
+  // 解决跨域 Canvas 污染问题
+  image.setAttribute("crossOrigin", "anonymous");
+  image.onload = function () {
+    let canvas = document.createElement("canvas");
+    canvas.width = image.width;
+    canvas.height = image.height;
+    let context: any = canvas.getContext("2d");
+    context.drawImage(image, 0, 0, image.width, image.height);
+    let url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
+    let a = document.createElement("a"); // 生成一个a元素
+    let event = new MouseEvent("click"); // 创建一个单击事件
+    a.download = name; // 设置图片名称
+    a.href = url; // 将生成的URL设置为a.href属性
+    a.dispatchEvent(event); // 触发a的单击事件
+  }
+  image.src = url
+}
+// 图片删除
+const deleteImage = () => {
+  companyImgName.value = ''
+  companyImgUrl.value = ''
 }
 const close = () => {
   cpmpanyform.code = '';
@@ -465,7 +518,6 @@ const close = () => {
   cpmpanyform.type = '';
   cpmpanyform.logo = '';
   provinceoptions.value = [];
-  sysIconList.url = '';
 }
 </script>
 <style scoped lang="scss">
@@ -505,5 +557,59 @@ const close = () => {
 .disabled :deep(.el-upload--picture-card) {
   opacity: 0;
 }
+
+.fileInfo {
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+  padding: 2px 20px;
+  margin: 0 10px;
+  border-radius: 5px;
+
+  &:hover {
+    background: #ccc;
+  }
+
+  .fileName {
+    width: 200px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+
+  .fileBtn {
+    display: flex;
+    align-items: center;
+
+    .btn-icon {
+      margin: 0 10px;
+      font-size: 16px;
+      cursor: pointer;
+
+      &:hover {
+        color: #00a0f4;
+      }
+    }
+  }
+}
+
+.image-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  z-index: 9999;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  height: 100%;
+  background: rgb(0 0 0 / 60%);
+
+  img {
+    width: 800px;
+    height: 800px;
+    border-radius: 5px;
+  }
+}
 </style>
 <!-- 样式区域 -->

+ 1 - 1
src/views/insuranceCompanyConfiguration/paymentCodeConfig.vue

@@ -59,7 +59,7 @@
           </ElCol>
           <ElCol :md="24" :lg="12">
             <el-form-item label="简称" prop="companyName">
-              <el-input v-model="paymentform.companyName" placeholder="请输入姓名" disabled />
+              <el-input v-model="paymentform.companyName" placeholder="" disabled />
             </el-form-item>
           </ElCol>
           <ElCol :md="24" :lg="12">

+ 2 - 2
src/views/organizationManagement/organization/organizationAdd.vue

@@ -129,10 +129,10 @@
 
     </PageMain>
     <FixedActionBar>
-      <ElButton type="primary" size="large" @click="submitForm(ruleFormRef)">
+      <ElButton type="primary"  @click="submitForm(ruleFormRef)">
         保存
       </ElButton>
-      <ElButton size="large" @click="router.back()">
+      <ElButton  @click="router.back()">
         取消
       </ElButton>
     </FixedActionBar>

+ 9 - 1
src/views/organizationManagement/organization/organizationDetail.vue

@@ -136,6 +136,8 @@ import { ref, nextTick } from 'vue'
 import { useRoute, useRouter } from 'vue-router';
 import { ElMessage, ElMessageBox } from 'element-plus'
 import ImagePreview from '@/components/ImagePreview/index.vue';
+import { loadDicts, getDict } from '@/utils/composables/dictService';
+
 
 import api from '@/api';
 const route = useRoute();
@@ -149,6 +151,8 @@ const mainElement = ref<HTMLElement | null>(null);
 const containerLeftHeight = ref('0px');
 const dialogVisible = ref(false)
 onMounted(() => {
+  loadDicts(['exhibition_scope']);//获取多个字典
+
   activeName.value = typeName.value;
   nextTick(() => {
     if (mainElement.value) {
@@ -164,6 +168,10 @@ const columns = [
     prop: "exhibitionScope", label: "营业范围", width: '200', formatter: (row: any) => {
       let exhibitionScope = row.exhibitionScope;
       if (exhibitionScope) {
+        exhibitionScope=exhibitionScope.map((ele: any) => {
+          ele = getDict('exhibition_scope').find(val => val.value == ele).label;
+          return ele;
+        })
         let sysType = exhibitionScope.join(',');
         return sysType;
       }
@@ -339,7 +347,7 @@ const detailQuery = () => {
 const getDeptTree = () => {
   api.dept.getDeptTree({ sysCode: code.value }).then((res: any) => {
     if (res.code == '200') {
-      tableData.value = res.data[0].children;
+      tableData.value = res.data;
     } else {
       ElMessage({
         type: 'success',

+ 2 - 1
src/views/organizationManagement/organization/organizationlist.vue

@@ -233,7 +233,8 @@ const columns = [
       }
     }
   },
-  { prop: "createTime", label: "创建时间", width: '180', },
+  { prop: "createTime", label: "创建时间", width: '180',
+  },
   { prop: "createBy", label: "创建人", width: '120', },
   { prop: "contact", label: "联系人", width: '120', },
   { prop: "telephone", label: "联系电话", width: '200' },

+ 1 - 1
src/views/organizationManagement/organization/subOrganizatioAdd.vue

@@ -36,7 +36,7 @@
             <el-form-item label="展业范围" prop="exhibitionScope">
               <el-select v-model="deptform.exhibitionScope" multiple placeholder="请选择展业范围" clearable>
                 <el-option :label="item.label" v-for="(item, index) in dictLists.exhibition_scopeList" :key="index"
-                  :value="item.label" />
+                  :value="item.value" />
               </el-select>
             </el-form-item>
           </ElCol>

+ 51 - 40
src/views/personnel/memberManagement.vue

@@ -108,7 +108,7 @@
       <template #footer>
         <div class="dialog-footer">
           <el-button @click="UpdatedialogVisible = false">取消</el-button>
-          <el-button type="primary" @click="memberAdd">
+          <el-button type="primary" @click="memberAdd(memberFormRef)">
             保存
           </el-button>
         </div>
@@ -206,48 +206,58 @@ const roleListfun = () => {
   });
 }
 //添加
-const memberAdd = () => {
-  if (dialogType.value == 'add') {
-    api.member.userAdd(memberform).then((res: any) => {
-      if (res.code == '200') {
-        ElMessage({
-          type: 'success',
-          message: res.msg,
-          plain: true,
-        })
-        findpage();
-        UpdatedialogVisible.value = false;
+const memberAdd = async (formEl: FormInstance | undefined) => {
+  if (!formEl) return
+  await formEl.validate((valid) => {
+    if (valid) {
+      if (dialogType.value == 'add') {
+        api.member.userAdd(memberform).then((res: any) => {
+          if (res.code == '200') {
+            ElMessage({
+              type: 'success',
+              message: res.msg,
+              plain: true,
+            })
+            findpage();
+            UpdatedialogVisible.value = false;
+          } else {
+            ElMessage({
+              type: 'error',
+              message: res.msg,
+              plain: true,
+            })
+          }
+        });
       } else {
-        ElMessage({
-          type: 'error',
-          message: res.msg,
-          plain: true,
-        })
+        console.log(memberform)
+        api.member.userEdit(memberform).then((res: any) => {
+          if (res.code == '200') {
+            ElMessage({
+              type: 'success',
+              message: res.msg,
+              plain: true,
+            })
+            findpage();
+            UpdatedialogVisible.value = false;
+          } else {
+            ElMessage({
+              type: 'success',
+              message: res.msg,
+              plain: true,
+            })
+          }
+        });
       }
-    });
-  } else {
-    console.log(memberform)
-    api.member.userEdit(memberform).then((res: any) => {
-      if (res.code == '200') {
-        ElMessage({
-          type: 'success',
-          message: res.msg,
-          plain: true,
-        })
-        findpage();
-        UpdatedialogVisible.value = false;
-      } else {
-        ElMessage({
-          type: 'success',
-          message: res.msg,
-          plain: true,
-        })
-      }
-    });
-  }
-
-
+    } else {
+      ElMessage({
+        type: 'error',
+        message: '信息不完整',
+        plain: true,
+      })
+    }
+  })
 }
+
 //交互事件===========================
 function handleEnter(e: any) {
   if (e.keyCode == 13 || e.keyCode == 108) {
@@ -512,4 +522,5 @@ const close = () => {
 .el-inputs {
   width: 100% !important;
 }
+
 </style>