Browse Source

新增组件及页面

liuqiwen 4 years ago
parent
commit
b40076c677

+ 2 - 1
dgtis-ui/src/main.js

@@ -19,7 +19,7 @@ import './assets/icons' // icon
 import './permission' // permission control
 import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree,levelText } from "@/utils/ruoyi";
+import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree,levelText,getArea } from "@/utils/ruoyi";
 import Pagination from "@/components/Pagination";
 //自定义表格工具扩展
 import RightToolbar from "@/components/RightToolbar"
@@ -35,6 +35,7 @@ Vue.prototype.selectDictLabels = selectDictLabels
 Vue.prototype.download = download
 Vue.prototype.handleTree = handleTree
 Vue.prototype.levelText = levelText
+Vue.prototype.getArea = getArea
 
 Vue.prototype.msgSuccess = function (msg) {
   this.$message({ showClose: true, message: msg, type: "success" });

+ 13 - 0
dgtis-ui/src/utils/ruoyi.js

@@ -187,3 +187,16 @@ export function levelText(val){
   }
 
 }
+
+// 解析地址省、市、区县、街道
+export function getArea(val){
+  var reg = /.+?(省|市|自治区|自治州|县|区)/g;
+  var areaArr = val.match(reg);
+  var newArea = [].concat(areaArr);
+  if(areaArr.length>2){
+    newArea.push(val.split(areaArr[2])[1]);
+  }else{
+    newArea.push(val.split(areaArr[1])[1]);
+  }
+  return newArea;
+}

+ 24 - 6
dgtis-ui/src/views/system/userInfo/components/contact.vue

@@ -3,12 +3,30 @@
   <div class="userInfoPanel mt10 pd15">
     <el-table v-loading="loading" :data="data">
       <el-table-column label="地址描述" width="90" align="center" prop="des" />
-      <el-table-column label="地址_国家" align="center" prop="nation" />
-      <el-table-column label="地址_省" align="center" prop="province" />
-      <el-table-column label="地址_市县" align="center" prop="city" :show-overflow-tooltip="true" />
-      <el-table-column label="地址_区镇" align="center" prop="area" />
-      <el-table-column label="地址_街道门牌号" width="190" align="center" prop="raid"></el-table-column>
-      <el-table-column label="地址_邮政编码" align="center" prop="postalCode" />
+      <el-table-column label="国家" align="center" prop="nation" />
+      <el-table-column label="省" align="center">
+        <template slot-scope="scope">
+          <span>{{ getArea(scope.row.ral)[0] }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="市县" align="center" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <span v-if="getArea(scope.row.ral).length>3">{{ getArea(scope.row.ral)[1] }}</span>
+          <span v-else>{{ getArea(scope.row.ral)[0] }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="区镇" align="center">
+        <template slot-scope="scope">
+          <span v-if="getArea(scope.row.ral).length>3">{{ getArea(scope.row.ral)[2] }}</span>
+          <span v-else>{{ getArea(scope.row.ral)[1] }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="街道门牌号" width="190" align="center">
+        <template slot-scope="scope">
+          <span>{{ getArea(scope.row.ral)[(getArea(scope.row.ral).length-1)] }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="邮政编码" align="center" prop="zipcode" />
       <el-table-column label="微信" align="center" prop="wechat" :show-overflow-tooltip="true"  />
       <el-table-column label="邮箱" align="center" prop="email" :show-overflow-tooltip="true" />
       <el-table-column label="QQ" align="center" prop="qq"  :show-overflow-tooltip="true"/>

+ 3 - 1
dgtis-ui/src/views/system/userInfo/index.vue

@@ -85,7 +85,7 @@
             <span class="value">{{custInfo.incomesource}}</span>
           </el-col>
           <el-col :span="12">
-            <span class="name">户籍所在地</span>
+            <span class="name">联系地址</span>
             <span class="value">{{custInfo.homeaddress}}</span>
           </el-col>
         </el-row>
@@ -250,6 +250,8 @@ export default {
                   response.data.custInfo.email ? contactDataItem.email = response.data.custInfo.email:'';
                   response.data.custInfo.wechat ? contactDataItem.wechat = response.data.custInfo.wechat:'';
                   response.data.custInfo.pmphone ? contactDataItem.pmphone = response.data.custInfo.pmphone:'';
+                  response.data.custInfo.ral ? contactDataItem.ral = response.data.custInfo.ral:'';
+                  response.data.custInfo.zipcode ? contactDataItem.zipcode = response.data.custInfo.zipcode:'';
                   JSON.stringify(contactDataItem) == "{}" ? that.contactData = []: that.contactData.push(contactDataItem);
               }
           );