Commit 48cfe4a3 authored by 白日依山山山's avatar 白日依山山山

fix:客户准入、已办待办搜索

parent 403ee951
......@@ -13,15 +13,11 @@
</item>
</div>
<div v-if="['FACTORY'].indexOf(baseInfo.bp_type)===-1">
<div v-if="['FACTORY'].indexOf(baseInfo.bp_type)===-1" class="baseinfo-supp">
<div slot="name" class="section-title" style="">基本信息补录</div>
<item v-for="(ele, i) of baseInfo_B" :key="ele.title">
<div slot="name" class="font-color">{{ ele.title }}</div>
<span v-if="ele.type === 'date'" slot="content">{{ baseInfo[ele.prop] | dateFormat }}</span>
<span v-else-if="ele.type === 'currency'" slot="content">{{ baseInfo[ele.prop] | currency }}</span>
<span v-else-if="ele.type === 'bool'" slot="content">{{ baseInfo[ele.prop] === 'Y' ? '是' : '否' }}</span>
<Checkbox v-else-if="ele.type === 'checkbox'" :value="baseInfo[ele.prop]==='Y'" shape="square"/>
<span v-else slot="content">{{ baseInfo[ele.prop] }}</span>
<!-- <div slot="name" class="font-color">{{ ele.title }}</div> -->
<Field :label="ele.title" v-model="baseInfo[ele.prop]" rows="1" autosize type="textarea" input-align="right" required placeholder="请输入"/>
</item>
</div>
<div>
......@@ -56,16 +52,21 @@
<span v-else slot="content">{{ baseInfo[ele.prop] }}</span>
</item>
</div>
<div class="foot-bottom">
<button class="success" @click="save">保存</button>
</div>
</list-item>
</template>
<script>
import { Checkbox } from 'vant'
import { Checkbox, Field } from 'vant'
import 'vant/lib/checkbox/style'
import 'vant/lib/field/style'
export default {
components: {
Checkbox,
Field,
},
props: ['baseInfo'],
data () {
......@@ -90,6 +91,53 @@ export default {
},
},
methods: {
async save () {
let flag = false
console.log('基本信息', this.baseInfo_B);
let obj = {
'bp_id': this.baseInfo['bp_id'],
}
this.baseInfo_B.forEach(item => {
obj[item.prop] = this.baseInfo[item.prop]
})
console.log('保存信息', obj)
Object.keys(obj).map(key => {
if (obj[key] === undefined || obj[key] === null || obj[key] === '') {
flag = true
}
})
if (flag) {
hlsPopup.showLongCenter('请将必填字段填写完整')
return
}
// 财务部联系电话校验
let financeContactReg = /^\d{11}$/
if (!financeContactReg.test(obj.finance_contact)) {
hlsPopup.showLongCenter('财务部联系电话错误!')
return
}
// 身份证校验
let idcardReg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
if (!idcardReg.test(obj.contact_card_no)) {
hlsPopup.showLongCenter('联系人身份证格式错误!')
return
}
let url = process.env.basePath + 'bp_access_info_save'
let param = {
'master': obj,
}
console.log(param)
hlsPopup.showLoading('请稍候')
let res = await this.$post(url, param)
this.hlsPopup.hideLoading()
if (res.result === 'S') {
hlsPopup.showLongCenter('保存成功')
} else {
hlsPopup.showLongCenter('保存失败')
}
},
factory (arr) {
let outArr = []
if (arr.length) {
......@@ -178,8 +226,8 @@ export default {
},
createFormOrg () {
let orgInfo = [// 法人代表信息
['姓名', 'legal_person', 'text'],
['身份证号', 'id_card_no', 'text'],
['姓名', 'legal_person', 'bool'],
['身份证号', 'id_card_no', 'bool'],
['证件有效期从', 'id_card_date_from', 'date'],
['证件有效期到', 'id_card_date_to', 'date'],
['手机号', 'cell_phone', 'text'],
......@@ -220,4 +268,9 @@ export default {
margin-top: 12px;
position: relative;
}
.baseinfo-supp{
/deep/ .hls-item{
padding-left:5px
}
}
</style>
......@@ -86,6 +86,7 @@ export default {
doneList: [],
pageNum: 1,
pageNum_1: 1,
search_pageNum: 1,
mysetTimeout: null,
}
},
......@@ -95,8 +96,11 @@ export default {
// this.getDoneList()
// },
activated() {
this.pageNum = 1
this.pageNum_1 = 1
this.getTodoList()
this.getDoneList()
this.search_pageNum = 1
},
methods: {
// tab切换
......@@ -104,13 +108,18 @@ export default {
this.selected = name
},
searchList() {
if (this.selected === 'todo') {
this.pageNum = 1
} else if (this.selected === 'done') {
this.pageNum_1 = 1
}
if (this.mysetTimeout !== null) {
clearTimeout(this.mysetTimeout)
this.mysetTimeout = setTimeout(() => {
this.loadMore()
}, 1000)
} else {
this.mysetTimeout = setTimeout(() => {
this.mysetTimeout = setTimeout(() => {
this.loadMore()
}, 1000)
}
......
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