Browse Source

整理代码

master
liutong 1 year ago
parent
commit
69aa4b9d5d
  1. 65
      admin/src/addon/zhjw/views/sales/sales_edit.vue

65
admin/src/addon/zhjw/views/sales/sales_edit.vue

@ -9,13 +9,15 @@
<span class="right">{{ pageName }}</span> <span class="right">{{ pageName }}</span>
</div> </div>
<el-card class="box-card !border-none" shadow="never"> <el-card class="box-card !border-none" shadow="never">
<el-form :model="formData" label-width="90px" ref="formRef" :rules="formRules" class="page-form"> <el-form :model="formData" label-width="240px" ref="formRef" :rules="formRules" class="page-form">
<el-form-item :label="t('studentPhone')" prop="student_phone"> <el-form-item :label="t('studentPhone')" prop="student_phone">
<el-input v-model="formData.student_phone" clearable :placeholder="t('studentPhonePlaceholder')" class="input-width" /> <el-input v-model="formData.student_phone" clearable :placeholder="t('studentPhonePlaceholder')"
class="input-width"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('studentName')" prop="student_name"> <el-form-item :label="t('studentName')" prop="student_name">
<el-input v-model="formData.student_name" clearable :placeholder="t('studentNamePlaceholder')" class="input-width" /> <el-input v-model="formData.student_name" clearable :placeholder="t('studentNamePlaceholder')"
class="input-width"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('sex')" prop="sex"> <el-form-item :label="t('sex')" prop="sex">
@ -31,11 +33,13 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('age')" prop="age"> <el-form-item :label="t('age')" prop="age">
<el-input-number v-model="formData.age" clearable :placeholder="t('agePlaceholder')" class="input-width" :min = "0" max = "300" /> <el-input-number v-model="formData.age" clearable :placeholder="t('agePlaceholder')" class="input-width"
:min="0" max="300"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('schoolName')" prop="school_name"> <el-form-item :label="t('schoolName')" prop="school_name">
<el-input v-model="formData.school_name" clearable :placeholder="t('schoolNamePlaceholder')" class="input-width" /> <el-input v-model="formData.school_name" clearable :placeholder="t('schoolNamePlaceholder')"
class="input-width"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('grade')"> <el-form-item :label="t('grade')">
@ -43,11 +47,13 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('className')"> <el-form-item :label="t('className')">
<el-input v-model="formData.class_name" clearable :placeholder="t('classNamePlaceholder')" class="input-width" /> <el-input v-model="formData.class_name" clearable :placeholder="t('classNamePlaceholder')"
class="input-width"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('sourceChannel')" prop="source_channel"> <el-form-item :label="t('sourceChannel')" prop="source_channel">
<el-select class="input-width" v-model="formData.source_channel" clearable :placeholder="t('sourceChannelPlaceholder')"> <el-select class="input-width" v-model="formData.source_channel" clearable
:placeholder="t('sourceChannelPlaceholder')">
<el-option label="请选择" value=""></el-option> <el-option label="请选择" value=""></el-option>
<el-option <el-option
v-for="(item, index) in source_channelList" v-for="(item, index) in source_channelList"
@ -59,7 +65,8 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('customerSource')" prop="customer_source"> <el-form-item :label="t('customerSource')" prop="customer_source">
<el-select class="input-width" v-model="formData.customer_source" clearable :placeholder="t('customerSourcePlaceholder')"> <el-select class="input-width" v-model="formData.customer_source" clearable
:placeholder="t('customerSourcePlaceholder')">
<el-option label="请选择" value=""></el-option> <el-option label="请选择" value=""></el-option>
<el-option <el-option
v-for="(item, index) in customer_sourceList" v-for="(item, index) in customer_sourceList"
@ -71,7 +78,8 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('addStaffId')" prop="add_staff_id"> <el-form-item :label="t('addStaffId')" prop="add_staff_id">
<el-select class="input-width" v-model="formData.add_staff_id" clearable :placeholder="t('addStaffIdPlaceholder')"> <el-select class="input-width" v-model="formData.add_staff_id" clearable
:placeholder="t('addStaffIdPlaceholder')">
<el-option label="请选择" value=""></el-option> <el-option label="请选择" value=""></el-option>
<el-option <el-option
v-for="(item, index) in addStaffIdList" v-for="(item, index) in addStaffIdList"
@ -83,7 +91,8 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('getStaffId')"> <el-form-item :label="t('getStaffId')">
<el-select class="input-width" v-model="formData.get_staff_id" clearable :placeholder="t('getStaffIdPlaceholder')"> <el-select class="input-width" v-model="formData.get_staff_id" clearable
:placeholder="t('getStaffIdPlaceholder')">
<el-option label="请选择" value=""></el-option> <el-option label="请选择" value=""></el-option>
<el-option <el-option
v-for="(item, index) in getStaffIdList" v-for="(item, index) in getStaffIdList"
@ -95,11 +104,13 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('contactName')" prop="contact_name"> <el-form-item :label="t('contactName')" prop="contact_name">
<el-input v-model="formData.contact_name" clearable :placeholder="t('contactNamePlaceholder')" class="input-width" /> <el-input v-model="formData.contact_name" clearable :placeholder="t('contactNamePlaceholder')"
class="input-width"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('provinceId')"> <el-form-item :label="t('provinceId')">
<el-select class="input-width" v-model="formData.province_id" clearable :placeholder="t('provinceIdPlaceholder')"> <el-select class="input-width" v-model="formData.province_id" clearable
:placeholder="t('provinceIdPlaceholder')">
<el-option label="请选择" value=""></el-option> <el-option label="请选择" value=""></el-option>
<el-option <el-option
v-for="(item, index) in provinceIdList" v-for="(item, index) in provinceIdList"
@ -123,7 +134,8 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('districtId')"> <el-form-item :label="t('districtId')">
<el-select class="input-width" v-model="formData.district_id" clearable :placeholder="t('districtIdPlaceholder')"> <el-select class="input-width" v-model="formData.district_id" clearable
:placeholder="t('districtIdPlaceholder')">
<el-option label="请选择" value=""></el-option> <el-option label="请选择" value=""></el-option>
<el-option <el-option
v-for="(item, index) in districtIdList" v-for="(item, index) in districtIdList"
@ -135,7 +147,8 @@
</el-form-item> </el-form-item>
<el-form-item :label="t('communityName')"> <el-form-item :label="t('communityName')">
<el-input v-model="formData.community_name" clearable :placeholder="t('communityNamePlaceholder')" class="input-width" /> <el-input v-model="formData.community_name" clearable :placeholder="t('communityNamePlaceholder')"
class="input-width"/>
</el-form-item> </el-form-item>
<el-form-item :label="t('customerTags')"> <el-form-item :label="t('customerTags')">
@ -175,7 +188,6 @@ const loading = ref(false)
const pageName = route.meta.title const pageName = route.meta.title
/** /**
* 表单数据 * 表单数据
*/ */
@ -221,19 +233,25 @@ const selectData = ref<any[]>([])
sexList.value = await (await useDictionary('users_sex')).data.dictionary sexList.value = await (await useDictionary('users_sex')).data.dictionary
} }
sexDictList(); sexDictList();
watch(() => sexList.value, () => { formData.sex = sexList.value[0].value }) watch(() => sexList.value, () => {
formData.sex = sexList.value[0].value
})
let source_channelList = ref([]) let source_channelList = ref([])
const source_channelDictList = async () => { const source_channelDictList = async () => {
source_channelList.value = await (await useDictionary('source_channel')).data.dictionary source_channelList.value = await (await useDictionary('source_channel')).data.dictionary
} }
source_channelDictList(); source_channelDictList();
watch(() => source_channelList.value, () => { formData.source_channel = source_channelList.value[0].value }) watch(() => source_channelList.value, () => {
formData.source_channel = source_channelList.value[0].value
})
let customer_sourceList = ref([]) let customer_sourceList = ref([])
const customer_sourceDictList = async () => { const customer_sourceDictList = async () => {
customer_sourceList.value = await (await useDictionary('customer_source')).data.dictionary customer_sourceList.value = await (await useDictionary('customer_source')).data.dictionary
} }
customer_sourceDictList(); customer_sourceDictList();
watch(() => customer_sourceList.value, () => { formData.customer_source = customer_sourceList.value[0].value }) watch(() => customer_sourceList.value, () => {
formData.customer_source = customer_sourceList.value[0].value
})
let customer_tagsList = ref([]) let customer_tagsList = ref([])
const customer_tagsDictList = async () => { const customer_tagsDictList = async () => {
customer_tagsList.value = await (await useDictionary('customer_tags')).data.dictionary customer_tagsList.value = await (await useDictionary('customer_tags')).data.dictionary
@ -241,7 +259,6 @@ const selectData = ref<any[]>([])
customer_tagsDictList(); customer_tagsDictList();
const addStaffIdList = ref([] as any[]) const addStaffIdList = ref([] as any[])
const setAddStaffIdList = async () => { const setAddStaffIdList = async () => {
addStaffIdList.value = await (await getWithStaffList({})).data addStaffIdList.value = await (await getWithStaffList({})).data
@ -287,7 +304,15 @@ const formRules = computed(() => {
, ,
age: [ age: [
{required: true, message: t('agePlaceholder'), trigger: 'blur'}, {required: true, message: t('agePlaceholder'), trigger: 'blur'},
{ validator: (rule: any, value: string, callback: any) => { if (value && !/^\d{0,300}$/.test(value)) { callback(new Error(t('generateBetween')))} else { callback() }}}, {
validator: (rule: any, value: string, callback: any) => {
if (value && !/^\d{0,300}$/.test(value)) {
callback(new Error(t('generateBetween')))
} else {
callback()
}
}
},
] ]
, ,
school_name: [ school_name: [

Loading…
Cancel
Save