Commit b81f5aa6 by gyt

feat(客户管理): crm4需求变更

parent 877e3f28
......@@ -47,6 +47,42 @@
color: #666666;
}
}
.tax-title-wrap{
position: relative;
}
.company-list{
z-index: 999;
position: absolute;
top: 102rpx;
left: 125rpx;
width: calc(100% - 100rpx);
max-height: 400rpx;
height: fix-content;
overflow-y: auto;
background-color: #ffffff;
box-shadow: 0px 5px 5px 3px #e6e6e6;
padding: 30rpx 10rpx 10rpx;
.close{
position: absolute;
top: 5rpx;
right: 20rpx;
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
font-weight: 700;
border: 1px solid #929292;
color: #979797;
border-radius: 50%;
}
.company-list-item{
font-size: 28rpx;
line-height: 50rpx;
}
}
}
.tab-group{
padding:25rpx 20rpx;
......
......@@ -18,19 +18,20 @@
<view><text>收票邮箱</text>{{item.email}}</view>
</view>
<view class="b row bothSide">
<view class="l row verCenter" @click="setdefault(item.tax_id)" v-if="!form">
<view class="l row verCenter"></view>
<!-- <view class="l row verCenter" @click="setdefault(item.tax_id)" v-if="!form">
<text class="icon iconfont icon-checked1"
:class="{'icon-checked':item.is_default==1}"></text>
<text>{{item.is_default==1?"已默认":"设为默认"}}</text>
</view>
<view v-else></view>
</view> -->
<!-- <view v-else></view> -->
<!-- <view class="l row verCenter" @click="setChoose(item.tax_id)" v-else>
<text class="icon iconfont icon-checked1"
:class="{'icon-checked':item.checkedx}"></text>
<text>{{item.checkedx?"已选择":"选择"}}</text>
</view> -->
<view class="r row verCenter">
<text @click.stop="deleteAdress(item.tax_id)">删除</text>
<!-- <text @click.stop="deleteAdress(item.tax_id)">删除</text> -->
<view @click.stop="goUpdate(item.tax_id)">修改</view>
</view>
</view>
......
......@@ -19,58 +19,36 @@
<text :class="{'act':formParams.inv_type==2}" @click="changeTab(2)">个人</text>
</view>
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type!=2">
<view class="input-group row verCenter tax-title-wrap" v-if="formParams.inv_type!=2">
<text class="label required">公司名称</text>
<input type="text" v-model="formParams.tax_title" @blur="tianyancha()" placeholder="请输入公司名称" placeholder-class="placeholder-class" />
<input type="text" v-model="formParams.tax_title" @input="searchCompay" @blur="tianyancha()" placeholder="请输入公司名称"
placeholder-class="placeholder-class" />
<view v-show="showCompanyList" class="company-list">
<view class="close" @click="showCompanyList = false">X</view>
<view v-for="item in certification" class="company-list-item" @click="companyClick(item.customer_name)">{{item.customer_name}}</view>
</view>
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==2">
<text class="label required">开票人名称</text>
<input type="text" v-model="formParams.tax_title" placeholder="请输入开票人名称" placeholder-class="placeholder-class" />
<input type="text" v-model="formParams.tax_title" placeholder="请输入开票人名称"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type!=2">
<text class="label required ">公司税号</text>
<input type="text" v-model="formParams.tax_no" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type!=2">
<text class="label required">公司电话</text>
<input type="text" v-model="formParams.company_phone" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==3">
<text class="label required">注册地址</text>
<input type="text" v-model="formParams.consignee_address" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==3">
<text class="label required">开户银行</text>
<input type="text" v-model="formParams.bank_name" placeholder="请输入开户银行" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==3">
<text class="label required">开户银行账号</text>
<input type="text" v-model="formParams.bank_account" placeholder="请输入开户银行账号" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">发票接收邮箱</text>
<input type="text" v-model="formParams.email" placeholder="请输入发票接收邮箱" placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label" :class="{'required':formParams.inv_type!=3}">收票人</text>
<input type="text" v-model="formParams.consignee" placeholder="请输入收票人" placeholder-class="placeholder-class" />
<input type="text" v-model="formParams.tax_no" placeholder="系统自动查询后补充"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label" :class="{'required':formParams.inv_type!=3}">收票人手机号</text>
<input type="number" v-model="formParams.consignee_phone" placeholder="请输入收票人手机号" placeholder-class="placeholder-class" />
<text class="label required">{{formParams.inv_type==3?'邮箱':'发票接收邮箱'}}</text>
<input type="text" v-model="formParams.email" placeholder="请输入邮箱" placeholder-class="placeholder-class" />
</view>
</view>
<view class="setting-default row verCenter bothSide">
<!-- <view class="setting-default row verCenter bothSide">
<view class="tt">默认发票信息</view>
<view>
<switch @change="onSwitchChange" checked color="#D0121B" style="transform:scale(0.8)" />
</view>
</view>
</view> -->
</view>
<view class="foot">
<view class="btn" @click="submitI()">确认</view>
......@@ -88,24 +66,19 @@
export default {
data() {
return {
showCompanyList: false,
certification: [],
formParams:{
tax_title: "",
consignee_address: "",
company_phone: "",
tax_no: "",
bank_name: "",
bank_account: "",
consignee: "",
consignee_phone: "",
email: "",
intl_code: "0086",
is_default:1,
inv_type:3 // 3 专票 2普票个人 否则普票 公司
inv_type:3, // 3 专票 2普票个人 否则普票 公司
}
}
},
onLoad: function() {
this.getUsreInfo()
},
onShow() {
......@@ -123,8 +96,6 @@
}
this.formParams.tax_title=res.data.com_name||this.formParams.tax_title
this.formParams.tax_no=res.data.tax_number||this.formParams.tax_no
this.formParams.company_phone=res.data.phone_number
this.formParams.consignee_address=res.data.com_address
} else {
uni.showToast({
title: res.msg,
......@@ -133,6 +104,13 @@
}
});
},
getUsreInfo(){
this.request(Api_Url + '/api/user/info', 'GET', {}, true).then(res => {
if (res.code == 0) {
this.certification = res.data.certification
}
});
},
changeTab(inv_type){
this.formParams.inv_type=inv_type
console.log(this.formParams.inv_type)
......@@ -140,6 +118,13 @@
onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0;
},
searchCompay(e) {
this.showCompanyList = true
},
companyClick(e) {
this.formParams.tax_title = e
this.showCompanyList = false
},
submitI(){
if(!this.formParams.tax_title){
uni.showToast({
......@@ -148,112 +133,20 @@
});
return;
}
if(this.formParams.inv_type==3){
if(!this.formParams.tax_no){
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.company_phone){
uni.showToast({
title: '公司电话不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.consignee_address){
uni.showToast({
title: '注册地址不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.bank_name){
uni.showToast({
title: '开户银行不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.bank_account){
uni.showToast({
title: '银行账号不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.email){
uni.showToast({
title: '发票接收邮箱不能为空',
icon: 'none'
});
return;
}
}else if(this.formParams.inv_type==2){
if(!this.formParams.email){
uni.showToast({
title: '发票接收邮箱不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.consignee){
uni.showToast({
title: '收票人不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.consignee_phone){
uni.showToast({
title: '收票人手机不能为空',
icon: 'none'
});
return;
}
}else{
if(!this.formParams.tax_no){
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.company_phone){
uni.showToast({
title: '公司电话不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.email){
uni.showToast({
title: '发票接收邮箱不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.consignee){
uni.showToast({
title: '收票人不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.consignee_phone){
uni.showToast({
title: '收票人手机不能为空',
icon: 'none'
});
return;
}
if(!this.formParams.email){
uni.showToast({
title: '邮箱不能为空',
icon: 'none'
});
return;
}
if (this.formParams.inv_type != 2 && !this.formParams.tax_no) {
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
this.request(Api_Url + '/api/invoice/add', 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
......
......@@ -20,10 +20,14 @@
<text :class="{'act':formParams.inv_type==2}" @click="changeTab(2)">个人</text>
</view>
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type!=2">
<view class="input-group row verCenter tax-title-wrap" v-if="formParams.inv_type!=2">
<text class="label required">公司名称</text>
<input type="text" v-model="formParams.tax_title" @blur="tianyancha()" placeholder="请输入公司名称"
<input type="text" v-model="formParams.tax_title" @input="searchCompay" @blur="tianyancha()" placeholder="请输入公司名称"
placeholder-class="placeholder-class" />
<view v-show="showCompanyList" class="company-list">
<view class="close" @click="showCompanyList = false">X</view>
<view v-for="item in certification" class="company-list-item" @click="companyClick(item.customer_name)">{{item.customer_name}}</view>
</view>
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==2">
<text class="label required">开票人名称</text>
......@@ -35,53 +39,19 @@
<input type="text" v-model="formParams.tax_no" placeholder="系统自动查询后补充"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type!=2">
<text class="label required">公司电话</text>
<input type="text" v-model="formParams.company_phone" placeholder="系统自动查询后补充"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==3">
<text class="label required">注册地址</text>
<input type="text" v-model="formParams.consignee_address" placeholder="系统自动查询后补充"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==3">
<text class="label required">开户银行</text>
<input type="text" v-model="formParams.bank_name" placeholder="请输入开户银行"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter" v-if="formParams.inv_type==3">
<text class="label required">开户银行账号</text>
<input type="text" v-model="formParams.bank_account" placeholder="请输入开户银行账号"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label required">发票接收邮箱</text>
<input type="text" v-model="formParams.email" placeholder="请输入发票接收邮箱"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label" :class="{'required':formParams.inv_type!=3}">收票人</text>
<input type="text" v-model="formParams.consignee" placeholder="请输入收票人"
<text class="label required">{{formParams.inv_type==3?'邮箱':'发票接收邮箱'}}</text>
<input type="text" v-model="formParams.email" placeholder="请输入收邮箱"
placeholder-class="placeholder-class" />
</view>
<view class="input-group row verCenter">
<text class="label" :class="{'required':formParams.inv_type!=3}">收票人手机号</text>
<input type="number" v-model="formParams.consignee_phone" placeholder="请输入收票人手机号"
placeholder-class="placeholder-class" />
</view>
</view>
<view class="setting-default row verCenter bothSide">
<!-- <view class="setting-default row verCenter bothSide">
<view class="tt">默认发票信息</view>
<view>
<switch @change="onSwitchChange" :checked="formParams.is_default==1" color="#D0121B" style="transform:scale(0.8)" />
</view>
</view>
</view> -->
</view>
<view class="foot">
<view class="btn" @click="submitI()">确认</view>
......@@ -99,18 +69,13 @@
export default {
data() {
return {
showCompanyList: false,
certification: [],
formParams: {
tax_id: "",
tax_title: "",
consignee_address: "",
company_phone: "",
tax_no: "",
bank_name: "",
bank_account: "",
consignee: "",
consignee_phone: "",
email: "",
intl_code: "0086",
is_default: 1,
inv_type: 3 // 3 专票 2普票个人 否则普票 公司
}
......@@ -119,6 +84,7 @@
onLoad: function(options) {
this.formParams.tax_id = options.tax_id || ''
this.getData()
this.getUsreInfo()
},
onShow() {
......@@ -166,6 +132,13 @@
}
});
},
getUsreInfo(){
this.request(Api_Url + '/api/user/info', 'GET', {}, true).then(res => {
if (res.code == 0) {
this.certification = res.data.certification
}
});
},
changeTab(inv_type) {
this.formParams.inv_type = inv_type
console.log(this.formParams.inv_type)
......@@ -173,6 +146,13 @@
onSwitchChange(e) {
this.formParams.is_default = e.detail.value ? 1 : 0;
},
searchCompay(e) {
this.showCompanyList = true
},
companyClick(e) {
this.formParams.tax_title = e
this.showCompanyList = false
},
submitI() {
if (!this.formParams.tax_title) {
uni.showToast({
......@@ -181,112 +161,21 @@
});
return;
}
if (this.formParams.inv_type == 3) {
if (!this.formParams.tax_no) {
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.company_phone) {
uni.showToast({
title: '公司电话不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.consignee_address) {
uni.showToast({
title: '注册地址不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.bank_name) {
uni.showToast({
title: '开户银行不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.bank_account) {
uni.showToast({
title: '银行账号不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.email) {
uni.showToast({
title: '发票接收邮箱不能为空',
icon: 'none'
});
return;
}
} else if (this.formParams.inv_type == 2) {
if (!this.formParams.email) {
uni.showToast({
title: '发票接收邮箱不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.consignee) {
uni.showToast({
title: '收票人不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.consignee_phone) {
uni.showToast({
title: '收票人手机不能为空',
icon: 'none'
});
return;
}
} else {
if (!this.formParams.tax_no) {
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.company_phone) {
uni.showToast({
title: '公司电话不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.email) {
uni.showToast({
title: '发票接收邮箱不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.consignee) {
uni.showToast({
title: '收票人不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.consignee_phone) {
uni.showToast({
title: '收票人手机不能为空',
icon: 'none'
});
return;
}
if (!this.formParams.email) {
uni.showToast({
title: '发票接收邮箱不能为空',
icon: 'none'
});
return;
}
if (this.formParams.inv_type != 2&&!this.formParams.tax_no) {
uni.showToast({
title: '公司税号不能为空',
icon: 'none'
});
return;
}
this.request(Api_Url + '/api/invoice/update', 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
......
......@@ -147,10 +147,12 @@
this.userinfo = res.data.userinfo
uni.setStorageSync('user_info', JSON.stringify(this.userinfo));
this.certification.forEach(item => {
if (item.com_name == this.userinfo.company_name) {
if (item.customer_name == this.userinfo.company_name) {
this.companyId = item.id
}
})
this.companyId = this.companyId || this.certification[0].customer_id
this.userinfo.company_name = this.userinfo.company_name || this.certification[0].customer_name
} else {
uni.showToast({
title: res.msg,
......
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 sign in to comment