Browse Source

选择客户公共页面

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

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

@ -394,7 +394,10 @@ export default {
brakepads_km: '', brakepads_km: '',
brakepads_date: '', brakepads_date: '',
carRemarks: '', carRemarks: '',
byRemarks: '' byRemarks: '',
vehState: '',
saleOrgName: '',
saleDate: ''
}, },
rules: { rules: {
name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }], name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }],
@ -487,35 +490,33 @@ export default {
} }
return val return val
}, },
showAdd(value, sid) { showAdd(value) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['form_obj'].clearValidate() this.$refs['form_obj'].clearValidate()
}) })
this.init() this.init()
if (sid !== '') { this.viewTitle = '【新增】客户信息'
this.viewTitle = '【快捷新增】客户信息' req.customerInit(value).then((res) => {
req.quickAddInit({ sid: sid }).then((resp) => { if (res.success) {
this.formobj = res.data
typeValues({ type: 'customerType' }).then((resp) => {
if (resp.success) { if (resp.success) {
this.formobj = resp.data this.customerType_list = resp.data
this.basics(value) 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
} }
}) })
} else {
this.viewTitle = '【新增】客户信息'
this.basics(value)
} }
}, })
// }
basics(value) { })
//
if (res.data.vehState !== '0') {
this.formobj.isOnRemind = '否' this.formobj.isOnRemind = '否'
this.formobj.isOnRemindKey = '0' 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 === '个人') { if (this.formobj.customerType === '个人') {
this.formobj.certificateType = '身份证' this.formobj.certificateType = '身份证'
this.formobj.certificateTypeKey = '01' this.formobj.certificateTypeKey = '01'
@ -523,9 +524,7 @@ export default {
this.formobj.certificateType = '营业执照' this.formobj.certificateType = '营业执照'
this.formobj.certificateTypeKey = '02' this.formobj.certificateTypeKey = '02'
} }
typeValues({ psid: value.psid, type: 'customerClass' }).then((res) => { }
if (res.success) {
this.customerClass_list = res.data
} }
}) })
}, },
@ -627,7 +626,39 @@ export default {
useOrgSid: '', useOrgSid: '',
sid: '', sid: '',
customerOrgName: '', 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.submitdisabled = false
this.$emit('doback') 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-input v-model="listQuery.params.vehMark" placeholder="" clearable/>
</el-form-item> </el-form-item>
<el-form-item label="车架号"> <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>
<el-form-item label="联系电话"> <el-form-item label="联系电话">
<el-input v-model="listQuery.params.mobile" placeholder="" clearable/> <el-input v-model="listQuery.params.mobile" placeholder="" clearable/>
@ -68,7 +68,7 @@
<!-- 快捷新增客户 --> <!-- 快捷新增客户 -->
<quickAddCustomer ref="divQuickAdd" v-show="viewState == 3" @doback="resetState" @reloadlist="getList" /> <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-form ref="form_obj" v-model="formobj" class="formaddcopy02">
<el-row style="border-top: 1px solid #E0E3EB"> <el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="24"> <el-col :span="24">
@ -79,6 +79,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="24"> <el-col :span="24">
<div class="span-sty">客户类型</div> <div class="span-sty">客户类型</div>
<el-form-item> <el-form-item>
@ -88,6 +90,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </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> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirm()"> </el-button> <el-button type="primary" @click="handleConfirm()"> </el-button>
@ -115,15 +128,7 @@ export default {
data() { data() {
return { return {
btndisabled: false, btndisabled: false,
isQuickAdd: false, //
btnList: [ btnList: [
{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toQuickAdd',
btnLabel: '快捷新增客户'
},
{ {
type: 'primary', type: 'primary',
size: 'small', size: 'small',
@ -168,7 +173,11 @@ export default {
visitWayKey: '', visitWayKey: '',
customerType: '', // customerType: '', //
customerTypeKey: '', customerTypeKey: '',
psid: '' psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
}, },
visitWay_list: [], visitWay_list: [],
customerType_list: [] customerType_list: []
@ -202,9 +211,6 @@ export default {
btnHandle(btnKey) { btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey) console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) { switch (btnKey) {
case 'toQuickAdd':
this.toQuickAdd()
break
case 'toAdd': case 'toAdd':
this.toAdd() this.toAdd()
break break
@ -267,30 +273,18 @@ export default {
this.listQuery.params.customerTypeKey = '' this.listQuery.params.customerTypeKey = ''
this.getList() 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() { toAdd() {
this.dialogVisible = true this.dialogVisible = true
this.isQuickAdd = false
this.formobj = { this.formobj = {
visitWay: '', // visitWay: '', //
visitWayKey: '', visitWayKey: '',
customerType: '', // customerType: '', //
customerTypeKey: '', customerTypeKey: '',
psid: '' psid: '',
vinNo: '',
userSid: '',
orgPath: '',
useOrgSid: ''
} }
}, },
visitWayChange(value) { visitWayChange(value) {
@ -307,17 +301,19 @@ export default {
} }
}, },
handleConfirm() { 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 this.dialogVisible = false
if (this.isQuickAdd) { if (this.formobj.vinNo.length !== 8 && this.formobj.vinNo.length !== 17) {
this.viewState = 3 this.$message({ showClose: true, message: '车架号长度为8位或17位', type: 'error' })
this.$refs['divQuickAdd'].showAdd(this.formobj, this.sids[0]) return
} else {
this.viewState = 3
this.$refs['divQuickAdd'].showAdd(this.formobj, '')
} }
this.viewState = 3
this.$refs['divQuickAdd'].showAdd(this.formobj)
} else { } else {
this.$message({ showClose: true, message: '请填写联络方式和客户类型', type: 'warning' }) this.$message({ showClose: true, message: '请填写联络方式、客户类型、车架号的信息', type: 'error' })
} }
}, },
handleAffirm(row) { handleAffirm(row) {

Loading…
Cancel
Save