Browse Source

选择客户公共页面

zhanglei
yunuo970428 7 months ago
parent
commit
fe660c0895
  1. 103
      yxt-as-ui/src/components/publicPage/quickAddCustomer.vue
  2. 74
      yxt-as-ui/src/components/publicPage/selectCustomer.vue

103
yxt-as-ui/src/components/publicPage/quickAddCustomer.vue

@ -394,7 +394,10 @@ export default {
brakepads_km: '',
brakepads_date: '',
carRemarks: '',
byRemarks: ''
byRemarks: '',
vehState: '',
saleOrgName: '',
saleDate: ''
},
rules: {
name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
@ -487,45 +490,41 @@ export default {
}
return val
},
showAdd(value, sid) {
showAdd(value) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.init()
if (sid !== '') {
this.viewTitle = '【快捷新增】客户信息'
req.quickAddInit({ sid: sid }).then((resp) => {
if (resp.success) {
this.formobj = resp.data
this.basics(value)
}
})
} else {
this.viewTitle = '【新增】客户信息'
this.basics(value)
}
},
//
basics(value) {
this.formobj.isOnRemind = '否'
this.formobj.isOnRemindKey = '0'
this.formobj.customerType = value.customerType
this.formobj.customerTypeKey = value.customerTypeKey
this.formobj.visitWay = value.visitWay
this.formobj.visitWayKey = value.visitWayKey
this.formobj.userSid = window.sessionStorage.getItem('userSid')
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.formobj.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
if (this.formobj.customerType === '个人') {
this.formobj.certificateType = '身份证'
this.formobj.certificateTypeKey = '01'
} else {
this.formobj.certificateType = '营业执照'
this.formobj.certificateTypeKey = '02'
}
typeValues({ psid: value.psid, type: 'customerClass' }).then((res) => {
this.viewTitle = '【新增】客户信息'
req.customerInit(value).then((res) => {
if (res.success) {
this.customerClass_list = res.data
this.formobj = res.data
typeValues({ type: 'customerType' }).then((resp) => {
if (resp.success) {
this.customerType_list = resp.data
this.customerType_list.forEach((e) => {
if (e.dictValue === this.formobj.customerType) {
typeValues({ psid: e.sid, type: 'customerClass' }).then((respsone) => {
if (respsone.success) {
this.customerClass_list = respsone.data
}
})
}
})
}
})
//
if (res.data.vehState !== '0') {
this.formobj.isOnRemind = '否'
this.formobj.isOnRemindKey = '0'
if (this.formobj.customerType === '个人') {
this.formobj.certificateType = '身份证'
this.formobj.certificateTypeKey = '01'
} else {
this.formobj.certificateType = '营业执照'
this.formobj.certificateTypeKey = '02'
}
}
}
})
},
@ -627,7 +626,39 @@ export default {
useOrgSid: '',
sid: '',
customerOrgName: '',
customerOrgSid: ''
customerOrgSid: '',
customerVehSid: '',
customerSid: '',
vehMark: '',
vinNo: '',
engineNo: '',
vehModelSid: '',
vehModel: '',
mileage: '',
lastMileage: '',
nextMaintainDate: '',
buyDate: '',
commercialInsuranceEndDate: '',
compulsoryInsuranceEndDate: '',
currentMileage: '',
monthKm: '',
filter_km: '',
filter_date: '',
engineoil_km: '',
engineoil_date: '',
gearoil_km: '',
gearoil_date: '',
treasurewheel_km: '',
treasurewheel_date: '',
fanbelt_km: '',
fanbelt_date: '',
brakepads_km: '',
brakepads_date: '',
carRemarks: '',
byRemarks: '',
vehState: '',
saleOrgName: '',
saleDate: ''
}
this.submitdisabled = false
this.$emit('doback')

74
yxt-as-ui/src/components/publicPage/selectCustomer.vue

@ -16,7 +16,7 @@
<el-input v-model="listQuery.params.vehMark" placeholder="" clearable/>
</el-form-item>
<el-form-item label="车架号">
<el-input v-model="listQuery.params.vinNo" placeholder="请输入4位以上的车架号" clearable/>
<el-input v-model="listQuery.params.vinNo" placeholder="" clearable/>
</el-form-item>
<el-form-item label="联系电话">
<el-input v-model="listQuery.params.mobile" placeholder="" clearable/>
@ -68,7 +68,7 @@
<!-- 快捷新增客户 -->
<quickAddCustomer ref="divQuickAdd" v-show="viewState == 3" @doback="resetState" @reloadlist="getList" />
<!-- 客户登记 -->
<el-dialog :visible.sync="dialogVisible" width="30%" :show-close="false">
<el-dialog :visible.sync="dialogVisible" width="40%" :show-close="false">
<el-form ref="form_obj" v-model="formobj" class="formaddcopy02">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="24">
@ -79,6 +79,8 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">客户类型</div>
<el-form-item>
@ -88,6 +90,17 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">车架号</div>
<el-form-item><el-input class="addinputInfo" style="width: 40%" v-model="formobj.vinNo" clearable placeholder="" /></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item><span style="color: red;font-weight: bold">若填写的车架号为集团销售车辆平台自动获取相应客户信息</span></el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirm()"> </el-button>
@ -115,15 +128,7 @@ export default {
data() {
return {
btndisabled: false,
isQuickAdd: false, //
btnList: [
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toQuickAdd',
btnLabel: '快捷新增客户'
},
{
type: 'primary',
size: 'small',
@ -168,7 +173,11 @@ export default {
visitWayKey: '',
customerType: '', //
customerTypeKey: '',
psid: ''
psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
},
visitWay_list: [],
customerType_list: []
@ -202,9 +211,6 @@ export default {
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
case 'toQuickAdd':
this.toQuickAdd()
break
case 'toAdd':
this.toAdd()
break
@ -267,30 +273,18 @@ export default {
this.listQuery.params.customerTypeKey = ''
this.getList()
},
toQuickAdd() {
if (this.sids.length === 1) {
this.dialogVisible = true
this.isQuickAdd = true
this.formobj = {
visitWay: '', //
visitWayKey: '',
customerType: '', //
customerTypeKey: '',
psid: ''
}
} else {
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' })
}
},
toAdd() {
this.dialogVisible = true
this.isQuickAdd = false
this.formobj = {
visitWay: '', //
visitWayKey: '',
customerType: '', //
customerTypeKey: '',
psid: ''
psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
}
},
visitWayChange(value) {
@ -307,17 +301,19 @@ export default {
}
},
handleConfirm() {
if (this.formobj.customerType !== '' && this.formobj.visitWay !== '') {
this.formobj.userSid = window.sessionStorage.getItem('userSid')
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.formobj.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1)
if (this.formobj.customerType !== '' && this.formobj.visitWay !== '' && this.formobj.vinNo !== '') {
this.dialogVisible = false
if (this.isQuickAdd) {
this.viewState = 3
this.$refs['divQuickAdd'].showAdd(this.formobj, this.sids[0])
} else {
this.viewState = 3
this.$refs['divQuickAdd'].showAdd(this.formobj, '')
if (this.formobj.vinNo.length !== 8 && this.formobj.vinNo.length !== 17) {
this.$message({ showClose: true, message: '车架号长度为8位或17位', type: 'error' })
return
}
this.viewState = 3
this.$refs['divQuickAdd'].showAdd(this.formobj)
} else {
this.$message({ showClose: true, message: '请填写联络方式和客户类型', type: 'warning' })
this.$message({ showClose: true, message: '请填写联络方式、客户类型、车架号的信息', type: 'error' })
}
},
handleAffirm(row) {

Loading…
Cancel
Save