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

细节完善

parent a3a0ce2c
...@@ -4,3 +4,8 @@ VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com ...@@ -4,3 +4,8 @@ VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/ VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/
VUE_APP_SERVICE_API=/service-api 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 ...@@ -4,3 +4,8 @@ VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://beta-cqbp-yesuan.yiboshi.com:86/#/ VUE_APP_LOCATION = https://beta-cqbp-yesuan.yiboshi.com:86/#/
VUE_APP_SERVICE_API=/service-api 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 ...@@ -3,12 +3,20 @@ NODE_ENV = dev
VUE_APP_BASE_URL2222= https://beta-ysservice.yiboshi.com VUE_APP_BASE_URL2222= https://beta-ysservice.yiboshi.com
VUE_APP_BASE_URL22 = https://ys-service.yiboshi.com VUE_APP_BASE_URL22 = https://ys-service.yiboshi.com
VUE_APP_BASE_URL4 = http://59.230.237.90:8115 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_BASE_PATH = https://beta-yac.yiboshi.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION2 = https://beta-yesuan.yiboshi.com/#/ VUE_APP_LOCATION2 = https://beta-yesuan.yiboshi.com/#/
VUE_APP_LOCATION1 = https://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_LOCATION = http://127.0.0.1:8080/#/
VUE_APP_SERVICE_API= 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 ...@@ -4,3 +4,8 @@ VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/ VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/
VUE_APP_SERVICE_API= 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/#/ ...@@ -5,3 +5,8 @@ VUE_APP_LOCATION = https://beta-yesuan.zmnyjk.com/#/
VUE_APP_BASE_PATH = https://beta-yac.zmnyjk.com VUE_APP_BASE_PATH = https://beta-yac.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_SERVICE_API= 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 ...@@ -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_BASE_PATH = http://59.230.237.90:8110
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' 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 = [ ...@@ -57,7 +57,7 @@ const routes = [
path: '/thirdPage', path: '/thirdPage',
component: () => import('../views/third/residentInfo.vue'), component: () => import('../views/third/residentInfo.vue'),
children: [ 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 @@ ...@@ -121,9 +121,7 @@
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}" <a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}"
:wrapperCol="{span: 20}"> :wrapperCol="{span: 20}">
<all-area-cascader :disabled="disabled" @keyup.enter.native="nextFocus(8)" <DocAddress v-model="formData.presentCode"/>
ref="input8"
v-model="formData.presentCode"></all-area-cascader>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -238,11 +236,10 @@ import {checkPhone, closedDetail, getEnumByFlag, GetUserInfoByCardDevice} from " ...@@ -238,11 +236,10 @@ import {checkPhone, closedDetail, getEnumByFlag, GetUserInfoByCardDevice} from "
import {cardType} from "../../../utils/dropDownCollection"; import {cardType} from "../../../utils/dropDownCollection";
import moment from 'moment' import moment from 'moment'
import InStockManageInfo from "./inStockManageInfo"; import InStockManageInfo from "./inStockManageInfo";
import allAreaCascader from "../../../components/allAreaCascader"; import DocAddress from "../../../components/DocAddress.vue";
let vm = this let vm = this
export default { export default {
components: {InStockManageInfo, allAreaCascader}, components: {InStockManageInfo,DocAddress},
data() { data() {
let unitInfo = JSON.parse(window.sessionStorage.getItem('unitInfo')); let unitInfo = JSON.parse(window.sessionStorage.getItem('unitInfo'));
let userInfo = JSON.parse(window.sessionStorage.getItem('userInfo')); let userInfo = JSON.parse(window.sessionStorage.getItem('userInfo'));
......
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
</a-button> </a-button>
</a-form-item> </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 type="primary" class="search_btn" style="float: right;margin-right: 20px" @click="toAdd">发放登记
</a-button> </a-button>
<div style="clear: both"></div> <div style="clear: both"></div>
...@@ -100,7 +102,8 @@ ...@@ -100,7 +102,8 @@
</div> </div>
</a-modal> </a-modal>
<!--:getContainer="getContainer"--> <!--: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" loading="true"
:maskClosable="false" :maskClosable="false"
width="600px"> width="600px">
...@@ -223,7 +226,7 @@ export default { ...@@ -223,7 +226,7 @@ export default {
return { return {
// 搜索框对象 // 搜索框对象
searchForm: { searchForm: {
date:[], date: [],
womenName: "", womenName: "",
womenIdCard: undefined, womenIdCard: undefined,
telephone: "" telephone: ""
...@@ -256,8 +259,9 @@ export default { ...@@ -256,8 +259,9 @@ export default {
menuId: undefined, menuId: undefined,
qrCodeShow: false, qrCodeShow: false,
qrCodeUrl: "", qrCodeUrl: "",
unitInfo: {unitName:""}, unitInfo: {unitName: ""},
printDisplay: 'none' printDisplay: 'none',
showQrCode: process.env.VUE_APP_SHOW_QR_CODE == 'true'
} }
}, },
created() { created() {
...@@ -453,7 +457,7 @@ export default { ...@@ -453,7 +457,7 @@ export default {
share() { share() {
this.qrCodeShow = true; this.qrCodeShow = true;
//不是一个链接APP不给回调,就用一下公司域名吧 //不是一个链接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}) QRCode.toDataURL(url, {width: 500, height: 400, margin: 2})
.then(qrCodeUrl => { .then(qrCodeUrl => {
this.qrCodeUrl = qrCodeUrl; this.qrCodeUrl = qrCodeUrl;
......
...@@ -215,3 +215,65 @@ export const GetUserInfoByCardDevice = () => { ...@@ -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 diff is collapsed.
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