Commit 787af515 authored by 罗成兵's avatar 罗成兵

细节完善

parent a3a0ce2c
......@@ -4,3 +4,8 @@ VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/
VUE_APP_SERVICE_API=/service-api
#区域编码末尾是否填充0
VUE_APP_AREA_CODE_FULL_ZERO = false
#是否显示发放二维码按钮
VUE_APP_SHOW_QR_CODE = false
......@@ -4,3 +4,8 @@ VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://beta-cqbp-yesuan.yiboshi.com:86/#/
VUE_APP_SERVICE_API=/service-api
#区域编码末尾是否填充0
VUE_APP_AREA_CODE_FULL_ZERO = false
#是否显示发放二维码按钮
VUE_APP_SHOW_QR_CODE = false
\ No newline at end of file
......@@ -3,12 +3,20 @@ NODE_ENV = dev
VUE_APP_BASE_URL2222= https://beta-ysservice.yiboshi.com
VUE_APP_BASE_URL22 = https://ys-service.yiboshi.com
VUE_APP_BASE_URL4 = http://59.230.237.90:8115
VUE_APP_BASE_URL = http://127.0.0.1:8083
VUE_APP_BASE_URL2 = http://127.0.0.1:8083
VUE_APP_BASE_URL = https://beta-cqbp-yesuan.yiboshi.com:86/service-api
VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION2 = https://beta-yesuan.yiboshi.com/#/
VUE_APP_LOCATION1 = https://yesuan.yiboshi.com/#/
VUE_APP_LOCATION = http://127.0.0.1:8080/#/
VUE_APP_LOCATION = http://127.0.0.1:8080/#/
VUE_APP_SERVICE_API=
#区域编码末尾是否填充0
VUE_APP_AREA_CODE_FULL_ZERO = false
#是否显示发放二维码按钮
VUE_APP_SHOW_QR_CODE = true
......@@ -4,3 +4,8 @@ VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/
VUE_APP_SERVICE_API=
#区域编码末尾是否填充0
VUE_APP_AREA_CODE_FULL_ZERO = true
#是否显示发放二维码按钮
VUE_APP_SHOW_QR_CODE = true
......@@ -5,3 +5,8 @@ VUE_APP_LOCATION = https://beta-yesuan.zmnyjk.com/#/
VUE_APP_BASE_PATH = https://beta-yac.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_SERVICE_API=
#区域编码末尾是否填充0
VUE_APP_AREA_CODE_FULL_ZERO = true
#是否显示发放二维码按钮
VUE_APP_SHOW_QR_CODE = true
......@@ -4,4 +4,8 @@ VUE_APP_BASE_URL = http://59.230.237.90:8115
VUE_APP_BASE_PATH = http://59.230.237.90:8110
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
#区域编码末尾是否填充0
VUE_APP_AREA_CODE_FULL_ZERO = true
#是否显示发放二维码按钮
VUE_APP_SHOW_QR_CODE = true
......@@ -57,7 +57,7 @@ const routes = [
path: '/thirdPage',
component: () => import('../views/third/residentInfo.vue'),
children: [
{path: 'residentGrantInfo', name: '页', component: () => import('../views/third/residentInfo.vue')},
{path: 'residentGrantInfo', name: '嵌入居民领取信息主页', component: () => import('../views/third/residentInfo.vue')},
],
},
]
......
<template>
<div>
<a-cascader class="address-select"
:options="areaData"
:load-data="loadData"
change-on-select
v-model:value="innerValue"
placeholder="请选择"
@change="onChange"
/>
</div>
</template>
<script>
import {areCodeTrans} from "../utils/common";
export default {
name: 'DocAddress',
props: {
value: String
},
data() {
return {
innerValue: [],
areaData: []
}
},
mounted() {
this.init()
},
methods: {
async init() {
if (!this.areaData.length) {
const res = await this.$api.common.fetchAreaByCode('0')
this.areaData = this.dataField(res.data || [])
}
let codeList = areCodeTrans(this.value);
if (codeList.length > 1) {
await this.viewHandle(codeList)
}
},
loadData(options) {
const targetOption = options[options.length - 1]
targetOption.loading = true
this.$api.common.fetchAreaByCode(targetOption.value).then(res => {
targetOption.children = this.dataField(res.data || [], options.length === 4)
this.areaData = [...this.areaData]
}).finally(() => {
targetOption.loading = false
})
},
dataField(data, last = false) {
return data.map(e => {
return {
label: e.areaName,
value: e.areaCode,
id: e.id,
isLeaf: last
}
})
},
// 回显处理
async viewHandle(val = []) {
try {
const length = val.length
let current = this.areaData.find(e => e.value === val[0])
let index = 1
while (index < length) {
const res = await this.$api.common.fetchAreaByCode(current.value)
const result = res.data || []
if (!result.length) break
current.children = this.dataField(result, index === 4)
current = current.children.find(e => e.value === val[index])
this.areaData = [...this.areaData]
if (!current) break
index++
}
} catch (err) {
console.warn(err)
}
},
onChange(val) {
console.log(val)
this.$emit('input', val[val.length - 1])
this.$emit('change', val)
}
},
watch: {
value: {
handler(val) {
if (this.innerValue.length > 0 && val == this.innerValue[this.innerValue.length - 1]) {
return
}
let codeList = areCodeTrans(val);
this.innerValue = codeList || []
if (codeList.length > 1) {
this.viewHandle(codeList)
}
},
immediate: true
},
}
}
</script>
<style lang="less" scoped>
</style>
......@@ -121,9 +121,7 @@
<a-col :span="24">
<a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}"
:wrapperCol="{span: 20}">
<all-area-cascader :disabled="disabled" @keyup.enter.native="nextFocus(8)"
ref="input8"
v-model="formData.presentCode"></all-area-cascader>
<DocAddress v-model="formData.presentCode"/>
</a-form-model-item>
</a-col>
</a-row>
......@@ -238,11 +236,10 @@ import {checkPhone, closedDetail, getEnumByFlag, GetUserInfoByCardDevice} from "
import {cardType} from "../../../utils/dropDownCollection";
import moment from 'moment'
import InStockManageInfo from "./inStockManageInfo";
import allAreaCascader from "../../../components/allAreaCascader";
import DocAddress from "../../../components/DocAddress.vue";
let vm = this
export default {
components: {InStockManageInfo, allAreaCascader},
components: {InStockManageInfo,DocAddress},
data() {
let unitInfo = JSON.parse(window.sessionStorage.getItem('unitInfo'));
let userInfo = JSON.parse(window.sessionStorage.getItem('userInfo'));
......
......@@ -24,7 +24,9 @@
</a-button>
</a-form-item>
<a-button type="primary" class="search_btn" style="float: right" @click="share">发放二维码</a-button>
<a-button type="primary" class="search_btn" style="float: right" @click="share" v-if="showQrCode">
发放二维码
</a-button>
<a-button type="primary" class="search_btn" style="float: right;margin-right: 20px" @click="toAdd">发放登记
</a-button>
<div style="clear: both"></div>
......@@ -100,7 +102,8 @@
</div>
</a-modal>
<!--:getContainer="getContainer"-->
<a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" cancelText="关闭" :footer="null"
<a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" cancelText="关闭"
:footer="null"
loading="true"
:maskClosable="false"
width="600px">
......@@ -223,7 +226,7 @@ export default {
return {
// 搜索框对象
searchForm: {
date:[],
date: [],
womenName: "",
womenIdCard: undefined,
telephone: ""
......@@ -256,8 +259,9 @@ export default {
menuId: undefined,
qrCodeShow: false,
qrCodeUrl: "",
unitInfo: {unitName:""},
printDisplay: 'none'
unitInfo: {unitName: ""},
printDisplay: 'none',
showQrCode: process.env.VUE_APP_SHOW_QR_CODE == 'true'
}
},
created() {
......@@ -453,11 +457,11 @@ export default {
share() {
this.qrCodeShow = true;
//不是一个链接APP不给回调,就用一下公司域名吧
let url="https://www.yiboshi.com?"+this.unitInfo.id;
let url = "https://www.yiboshi.com?" + this.unitInfo.id;
QRCode.toDataURL(url, {width: 500, height: 400, margin: 2})
.then(qrCodeUrl => {
this.qrCodeUrl = qrCodeUrl;
}).catch(err => {
.then(qrCodeUrl => {
this.qrCodeUrl = qrCodeUrl;
}).catch(err => {
// console.error(err);
});
},
......@@ -485,17 +489,17 @@ export default {
<style lang="less" scoped>
// 文件上传样式
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 6px;
color: #666;
margin-top: 6px;
color: #666;
}
.btn_space {
margin-right: 5px;
margin-right: 5px;
}
/* .search_form {
......@@ -505,11 +509,11 @@ export default {
padding: 30px;
}*/
.ellipsis {
display: block;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
display: block;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
///deep/ .ant-table-tbody{
......
......@@ -145,14 +145,14 @@ export const checkPhone = (rule, value, callback) => {
//根据枚举标识获取下拉数据
export const getEnumByFlag = (enumFlag) => {
let result = []
let enumSessionStorange = JSON.parse(window.sessionStorage.getItem('allEnum'))
if (enumSessionStorange && enumFlag) {
for (let obj in enumSessionStorange) {
if (obj == enumFlag) {
result = enumSessionStorange[obj]
}
let result = []
let enumSessionStorange = JSON.parse(window.sessionStorage.getItem('allEnum'))
if (enumSessionStorange && enumFlag) {
for (let obj in enumSessionStorange) {
if (obj == enumFlag) {
result = enumSessionStorange[obj]
}
}
}
return result
}
......@@ -215,3 +215,65 @@ export const GetUserInfoByCardDevice = () => {
})
};
/**
* 区域编码转换为控件需要的格式
* @param areaCode
* @returns {string[]}
*/
export function areCodeTrans(areaCode) {
let areaCodeList = []
if (!areaCode) {
return areaCodeList;
}
let fullZero = process.env.VUE_APP_AREA_CODE_FULL_ZERO;
if (fullZero == 'true') {
//末尾填充0实现
return areCodeTrans2(areaCode);
}
//末尾不填充0实现
if (areaCode.length >= 2) {
areaCodeList.push(areaCode.substring(0, 2))
}
if (areaCode.length >= 4) {
areaCodeList.push(areaCode.substring(0, 4))
}
if (areaCode.length >= 6) {
areaCodeList.push(areaCode.substring(0, 6))
}
if (areaCode.length >= 9) {
areaCodeList.push(areaCode.substring(0, 9))
}
if (areaCode.length >= 12) {
areaCodeList.push(areaCode)
}
return areaCodeList
}
//
function areCodeTrans2(areaCode) {
//let areaCode = "140311103204";
let areaCodeList = []
if (!areaCode) {
return areaCodeList;
}
areaCodeList.push(areaCode.substring(0, 2))
if (areaCode.length === 2) {
return areaCodeList;
}
areaCodeList.push(areaCode.substring(0, 4) + "00000000")
if (areaCode.substring(4, 6) == "00") {
return areaCodeList
}
areaCodeList.push(areaCode.substring(0, 6) + "000000")
if (areaCode.substring(6, 9) == "000") {
return areaCodeList
}
areaCodeList.push(areaCode.substring(0, 9) + "000")
if (areaCode.substring(9, 12) == "000") {
return areaCodeList
}
areaCodeList.push(areaCode)
return areaCodeList
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment