|
@@ -17,16 +17,12 @@
|
|
|
>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <!-- <div>
|
|
|
-
|
|
|
- </div> -->
|
|
|
- <!-- <div class="title">新增粮商</div> -->
|
|
|
<div class="unload">
|
|
|
<ws-form ref="customerList" :model="customerList" label-width="120px">
|
|
|
<ws-info-table>
|
|
|
<div style="display: flex; width: 100%; text-align: center">
|
|
|
- <div v-if="switchType==1" style="width: 50%; margin: 0 auto">
|
|
|
- 上传身份证正面
|
|
|
+ <div v-if="switchType == 1" style="width: 50%; margin: 0 auto">
|
|
|
+ 上传身份证正面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
|
:limit="1"
|
|
@@ -40,14 +36,22 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <div style="width: 50%; margin: 0 auto" :class="identityUp" v-if="switchType==2||switchType==3">
|
|
|
+ <div
|
|
|
+ style="width: 50%; margin: 0 auto"
|
|
|
+ :class="identityUp"
|
|
|
+ v-if="switchType == 2 || switchType == 3"
|
|
|
+ >
|
|
|
上传身份证正面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
|
:limit="1"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
- :on-remove="(file) => {handleRemove(file,identityUp)}"
|
|
|
+ :on-remove="
|
|
|
+ (file) => {
|
|
|
+ handleRemove(file, 1)
|
|
|
+ }
|
|
|
+ "
|
|
|
:auto-upload="true"
|
|
|
:on-success="upLoadSuccess1"
|
|
|
:disabled="disabled"
|
|
@@ -56,8 +60,8 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <div v-if="switchType==1" style="width: 50%; margin: 0 auto">
|
|
|
- 上传身份证反面
|
|
|
+ <div v-if="switchType == 1" style="width: 50%; margin: 0 auto">
|
|
|
+ 上传身份证反面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
|
:limit="1"
|
|
@@ -66,20 +70,27 @@
|
|
|
:on-remove="handleRemove"
|
|
|
:auto-upload="true"
|
|
|
:on-success="upLoadSuccess2"
|
|
|
- :disabled = "disabled"
|
|
|
+ :disabled="disabled"
|
|
|
>
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
-
|
|
|
</div>
|
|
|
- <div style="width: 50%; margin: 0 auto" v-if="switchType==2||switchType==3" class="low">
|
|
|
+ <div
|
|
|
+ style="width: 50%; margin: 0 auto"
|
|
|
+ v-if="switchType == 2 || switchType == 3"
|
|
|
+ :class="identityLow"
|
|
|
+ >
|
|
|
上传身份证反面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
|
:limit="1"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
- :on-remove="handleRemove"
|
|
|
+ :on-remove="
|
|
|
+ (file) => {
|
|
|
+ handleRemove(file, 2)
|
|
|
+ }
|
|
|
+ "
|
|
|
:auto-upload="true"
|
|
|
:on-success="upLoadSuccess2"
|
|
|
:disabled="disabled"
|
|
@@ -109,8 +120,8 @@
|
|
|
/>
|
|
|
</ws-form-item>
|
|
|
<div style="display: flex; width: 100%; text-align: center">
|
|
|
- <div style="width: 50%; margin: 0 auto" v-if="switchType==1" >
|
|
|
- 上传银行卡正面
|
|
|
+ <div style="width: 50%; margin: 0 auto" v-if="switchType == 1">
|
|
|
+ 上传银行卡正面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
|
:limit="1"
|
|
@@ -124,14 +135,22 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <div style="width: 50%; margin: 0 auto" v-if="switchType==2||switchType==3" class="bankUp">
|
|
|
+ <div
|
|
|
+ style="width: 50%; margin: 0 auto"
|
|
|
+ v-if="switchType == 2 || switchType == 3"
|
|
|
+ :class="bankUps"
|
|
|
+ >
|
|
|
上传银行卡正面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
|
:limit="1"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
- :on-remove="handleRemove1"
|
|
|
+ :on-remove="
|
|
|
+ (file) => {
|
|
|
+ handleRemove1(file, 1)
|
|
|
+ }
|
|
|
+ "
|
|
|
:auto-upload="true"
|
|
|
:on-success="bankSuccess1"
|
|
|
:disabled="disabled"
|
|
@@ -140,7 +159,7 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <div style="width: 50%; margin: 0 auto" v-if="switchType==1">
|
|
|
+ <div style="width: 50%; margin: 0 auto" v-if="switchType == 1">
|
|
|
上传银行卡反面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
@@ -155,14 +174,22 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
- <div style="width: 50%; margin: 0 auto" v-if="switchType==2||switchType==3" class="bankLow">
|
|
|
+ <div
|
|
|
+ style="width: 50%; margin: 0 auto"
|
|
|
+ v-if="switchType == 2 || switchType == 3"
|
|
|
+ :class="bankLows"
|
|
|
+ >
|
|
|
上传银行卡反面
|
|
|
<el-upload
|
|
|
action="https://www.zthymaoyi.com/upload/admin"
|
|
|
:limit="1"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
- :on-remove="handleRemove1"
|
|
|
+ :on-remove="
|
|
|
+ (file) => {
|
|
|
+ handleRemove1(file, 2)
|
|
|
+ }
|
|
|
+ "
|
|
|
:auto-upload="true"
|
|
|
:on-success="bankSuccess2"
|
|
|
:disabled="disabled"
|
|
@@ -260,8 +287,15 @@
|
|
|
</ws-form-item>
|
|
|
</ws-info-table>
|
|
|
<div class="but">
|
|
|
- <el-button type="primary" @click="commit" v-if="switchType==1 || switchType==3">提交</el-button>
|
|
|
- <el-button type="primary" @click = "cancel" v-if="switchType==2">关闭</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="commit"
|
|
|
+ v-if="switchType == 1 || switchType == 3"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="cancel" v-if="switchType == 2"
|
|
|
+ >关闭</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</ws-form>
|
|
|
</div>
|
|
@@ -272,6 +306,7 @@ import {
|
|
|
customerAdd,
|
|
|
customerIdentity,
|
|
|
getCustomerLook,
|
|
|
+ CustomerEdit,
|
|
|
} from '@/model/houseSelfCollect/index'
|
|
|
|
|
|
export default {
|
|
@@ -287,37 +322,40 @@ export default {
|
|
|
identity: [],
|
|
|
bank: [],
|
|
|
trader: '新增',
|
|
|
- switchType:"",
|
|
|
- identityImgUp:[
|
|
|
+ switchType: '',
|
|
|
+ identityImgUp: [
|
|
|
{
|
|
|
- url:"",
|
|
|
- }
|
|
|
+ url: '',
|
|
|
+ },
|
|
|
],
|
|
|
- identityImgLow:[
|
|
|
+ identityImgLow: [
|
|
|
{
|
|
|
- url:"",
|
|
|
- }
|
|
|
+ url: '',
|
|
|
+ },
|
|
|
],
|
|
|
- bankImgUp:[
|
|
|
+ bankImgUp: [
|
|
|
{
|
|
|
- url:"",
|
|
|
- }
|
|
|
+ url: '',
|
|
|
+ },
|
|
|
],
|
|
|
- bankImgLow:[
|
|
|
+ bankImgLow: [
|
|
|
{
|
|
|
- url:""
|
|
|
- }
|
|
|
+ url: '',
|
|
|
+ },
|
|
|
],
|
|
|
- identityUp:"up",
|
|
|
+ identityUp: 'up',
|
|
|
+ identityLow: 'low',
|
|
|
+ bankUps: 'bankUp',
|
|
|
+ bankLows: 'bankLow',
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
|
- this.switchType = this.$route.query.types
|
|
|
- if(this.$route.query.types == null){
|
|
|
- this.switchType = 1
|
|
|
- }
|
|
|
+ this.switchType = this.$route.query.types
|
|
|
+ if (this.$route.query.types == null) {
|
|
|
+ this.switchType = 1
|
|
|
+ }
|
|
|
let id = this.$route.query.id
|
|
|
- if ( this.switchType == 2) {
|
|
|
+ if (this.switchType == 2) {
|
|
|
this.disabled = true
|
|
|
this.trader = '查看'
|
|
|
this.getList(id)
|
|
@@ -326,24 +364,52 @@ export default {
|
|
|
this.trader = '编辑'
|
|
|
this.getList(id)
|
|
|
}
|
|
|
- console.log( this.switchType)
|
|
|
+ console.log(this.switchType)
|
|
|
},
|
|
|
methods: {
|
|
|
- handleRemove(file,a) {
|
|
|
- console.log(file)
|
|
|
- console.log(a)
|
|
|
- for (let i = 0; i < this.identity.length; i++) {
|
|
|
- if (file.response.url == this.identity[i]) {
|
|
|
- this.identity.splice(i, 1, '')
|
|
|
+ handleRemove(file, index) {
|
|
|
+ if (index == 1) {
|
|
|
+ this.identityUp = ''
|
|
|
+ } else if (index == 2) {
|
|
|
+ this.identityLow = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.switchType == 3) {
|
|
|
+ for (let i = 0; i < this.identity.length; i++) {
|
|
|
+ if (file.url == this.identity[i]) {
|
|
|
+ this.identity.splice(i, 1, '')
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log(this.identity)
|
|
|
+ } else if (this.switchType == 1) {
|
|
|
+ for (let i = 0; i < this.identity.length; i++) {
|
|
|
+ if (file.response.url == this.identity[i]) {
|
|
|
+ this.identity.splice(i, 1, '')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.identity)
|
|
|
}
|
|
|
},
|
|
|
- handleRemove1(file) {
|
|
|
- for (let i = 0; i < this.bank.length; i++) {
|
|
|
- if (file.response.url == this.bank[i]) {
|
|
|
- this.bank.splice(i, 1, '')
|
|
|
+ handleRemove1(file, index) {
|
|
|
+ if (index == 1) {
|
|
|
+ this.bankUps = ''
|
|
|
+ } else if (index == 2) {
|
|
|
+ this.bankLows = ''
|
|
|
+ }
|
|
|
+ if (this.switchType == 3) {
|
|
|
+ for (let i = 0; i < this.bank.length; i++) {
|
|
|
+ if (file.url == this.bank[i]) {
|
|
|
+ this.bank.splice(i, 1, '')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (this.switchType == 1) {
|
|
|
+ for (let i = 0; i < this.bank.length; i++) {
|
|
|
+ if (file.response.url == this.bank[i]) {
|
|
|
+ this.bank.splice(i, 1, '')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
console.log(this.bank)
|
|
|
},
|
|
|
handlePictureCardPreview(file) {
|
|
@@ -392,70 +458,91 @@ export default {
|
|
|
this.$router.push({ path: 'customerManagement' })
|
|
|
},
|
|
|
upLoadSuccess1(e) {
|
|
|
+ this.identityUp = 'up'
|
|
|
this.identity[0] = e.url
|
|
|
},
|
|
|
upLoadSuccess2(e) {
|
|
|
+ this.identityLow = 'low'
|
|
|
this.identity[1] = e.url
|
|
|
},
|
|
|
bankSuccess1(e) {
|
|
|
+ this.bankUps = 'bankUp'
|
|
|
this.bank[0] = e.url
|
|
|
},
|
|
|
bankSuccess2(e) {
|
|
|
+ this.bankLows = 'bankLow'
|
|
|
this.bank[1] = e.url
|
|
|
},
|
|
|
commit() {
|
|
|
- this.$confirm('确定提交客户信息?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
|
|
|
- this.customerList.cardAddressUrl = this.identity.toString()
|
|
|
- this.customerList.payeeAddressUrl = this.bank.toString()
|
|
|
- this.customerList.customerTypeFlag = 1
|
|
|
- this.customerList.customerType = '个人'
|
|
|
- customerAdd(this.customerList)
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- this.customerList.id = response
|
|
|
- customerIdentity(this.customerList)
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- console.log(response.code)
|
|
|
- this.$message.success('添加成功')
|
|
|
- this.$router.push({ path: 'customerManagement' })
|
|
|
- })
|
|
|
-
|
|
|
- // this.$message.success('添加成功')
|
|
|
- // this.$router.push({ path: 'customerManagement' })
|
|
|
- })
|
|
|
+ this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
|
|
|
+ this.customerList.cardAddressUrl = this.identity.toString()
|
|
|
+ this.customerList.payeeAddressUrl = this.bank.toString()
|
|
|
+ this.customerList.customerTypeFlag = 1
|
|
|
+ this.customerList.customerType = '个人'
|
|
|
+ if (this.switchType == 1) {
|
|
|
+ this.$confirm('确定提交客户信息?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- return false
|
|
|
+ .then(() => {
|
|
|
+ // this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
|
|
|
+ // this.customerList.cardAddressUrl = this.identity.toString()
|
|
|
+ // this.customerList.payeeAddressUrl = this.bank.toString()
|
|
|
+ // this.customerList.customerTypeFlag = 1
|
|
|
+ // this.customerList.customerType = '个人'
|
|
|
+ customerAdd(this.customerList)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.customerList.id = response
|
|
|
+ customerIdentity(this.customerList)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ console.log(response.code)
|
|
|
+ this.$message.success('添加成功')
|
|
|
+ this.$router.push({ path: 'customerManagement' })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return false
|
|
|
+ })
|
|
|
+ } else if (this.switchType == 3) {
|
|
|
+ this.$confirm('确定修改客户信息?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
})
|
|
|
+ .then(() => {
|
|
|
+ CustomerEdit(this.customerList)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ this.$router.push({ path: 'customerManagement' })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
getList(ids) {
|
|
|
- getCustomerLook({id:ids})
|
|
|
+ getCustomerLook({ id: ids })
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.customerList = response
|
|
|
- this.identity = this.customerList.cardAddressUrl.split(",")
|
|
|
+ this.identity = this.customerList.cardAddressUrl.split(',')
|
|
|
this.identityImgUp[0].url = this.identity[0]
|
|
|
this.identityImgLow[0].url = this.identity[1]
|
|
|
- this.bank = this.customerList.payeeAddressUrl.split(",")
|
|
|
- this.bankImgUp[0].url = this.bank[0]
|
|
|
- this.bankImgLow[0].url = this.bank[1]
|
|
|
-
|
|
|
+ this.bank = this.customerList.payeeAddressUrl.split(',')
|
|
|
+ this.bankImgUp[0].url = this.bank[0]
|
|
|
+ this.bankImgLow[0].url = this.bank[1]
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-// /deep/.el-form-item {
|
|
|
-// margin-bottom: 0;
|
|
|
-// }
|
|
|
.center {
|
|
|
background: #f6f7fc;
|
|
|
}
|
|
@@ -522,16 +609,16 @@ export default {
|
|
|
text-align: center;
|
|
|
margin: 20px auto;
|
|
|
}
|
|
|
-/deep/.up .el-upload--picture-card{
|
|
|
+/deep/.up .el-upload--picture-card {
|
|
|
display: none;
|
|
|
}
|
|
|
-/deep/.low .el-upload--picture-card{
|
|
|
+/deep/.low .el-upload--picture-card {
|
|
|
display: none;
|
|
|
}
|
|
|
-/deep/.bankUp .el-upload--picture-card{
|
|
|
+/deep/.bankUp .el-upload--picture-card {
|
|
|
display: none;
|
|
|
}
|
|
|
-/deep/.bankLow .el-upload--picture-card{
|
|
|
+/deep/.bankLow .el-upload--picture-card {
|
|
|
display: none;
|
|
|
}
|
|
|
</style>
|