| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906 |
- <template>
- <div class="register-pages">
- <div class="register-bos">
- <img class="head-img" src="@/assets/images/head.png" alt="" />
- <div class="register-login flex-row-between">
- <div></div>
- <div>
- <!-- <span>已有账号?直接</span> -->
- <a href="http://119.97.180.88:8050/" @click.stop target="_blank"> 已有账号?直接 </a>
- <a href="http://119.97.180.88:8050/" class="zhu" @click.stop target="_blank"> 登录>> </a>
- </div>
- </div>
- <div class="progress-bos">
- <div class="progress-bar" :class="nextNum == 1 ? 'hig1' : 'hig2'">
- <div>01、基本资料</div>
- </div>
- <div class="progress-bar progress-bar2" :class="nextNum == 2 ? 'hig1' : 'hig2'">
- <div>02、完善信息</div>
- </div>
- <div class="progress-bar progress-bar2" :class="nextNum == 3 ? 'hig1' : ''">
- <div>03、完成</div>
- </div>
- </div>
- <template v-if="nextNum == 1">
- <div class="form-bos">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>姓名</div>
- </div>
- <el-input style="width: 448px" v-model="form.purchaseName" placeholder="请输入姓名" />
- <div class="form-tip">请输入采购人全名,方便与您联系!</div>
- </div>
- <div class="form-bos" style="margin-top: 8px">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>手机号码</div>
- </div>
- <el-input :maxlength="11" style="width: 448px" v-model="form.purchasePhone" placeholder="请输入手机号码">
- <template #suffix>
- <span @click="sendSmsCode" :class="['code', countdown > 0 ? 'disabled' : '']">
- {{ codeText }}
- </span>
- </template>
- </el-input>
- </div>
- <div class="form-bos form-bos1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>验证码</div>
- </div>
- <el-input style="width: 448px" v-model="form.code" placeholder="请输入验证码" />
- </div>
- <div class="form-bos form-bos1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>密码</div>
- </div>
- <el-input type="password" show-password style="width: 448px" v-model="form.password" placeholder="请输入密码" />
- </div>
- <div class="form-bos form-bos1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>请再次输入密码</div>
- </div>
- <el-input type="password" show-password style="width: 448px" v-model="form.confirmPassword" placeholder="请输入密码" />
- </div>
- </template>
- <template v-if="nextNum == 2">
- <div class="form-head">基本信息</div>
- <div class="form-bos">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>供应商名称</div>
- </div>
- <el-input style="width: 100%" v-model="form.enterpriseName" placeholder="请输入供应商名称" />
- </div>
- <div class="flex-row-start">
- <div class="form-bos form-bos1" style="flex: 1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>规模</div>
- </div>
- <el-select v-model="form.membershipSize" placeholder="请选择规模" style="width: 100%">
- <el-option v-for="(item, index) in enterpriseList" :key="index" :label="item.enterpriseScaleName" :value="item.id" />
- </el-select>
- </div>
- <div class="form-bos form-bos1" style="flex: 1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>固定电话</div>
- </div>
- <el-input style="width: 100%" v-model="form.fixedPhone" placeholder="请输入固定电话" />
- </div>
- </div>
- <div class="flex-row-start">
- <div class="form-bos form-bos1" style="flex: 1">
- <div class="form-title flex-row-start">
- <div class="star"></div>
- <div>传真</div>
- </div>
- <el-input style="width: 100%" v-model="form.fax" placeholder="请输入固定电话" />
- </div>
- <div class="form-bos form-bos1" style="flex: 1">
- <div class="form-title flex-row-start">
- <div class="star"></div>
- <div>网址</div>
- </div>
- <el-input style="width: 100%" v-model="form.url" placeholder="请输入网址" />
- </div>
- </div>
- <div class="flex-row-start">
- <div class="form-bos form-bos1" style="flex: 1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>企业邮箱</div>
- </div>
- <el-input style="width: 100%" v-model="form.mailbox" placeholder="请输入企业邮箱" />
- </div>
- <div class="form-bos form-bos1" style="flex: 1"></div>
- </div>
- <div class="form-bos form-bos1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>办公地址</div>
- </div>
- <el-cascader
- v-model="regionCodes"
- :options="regionData as any"
- placeholder="请选择省/市/区"
- style="width: 100%"
- @change="handleRegionChange"
- />
- <el-input
- :maxlength="50"
- type="textarea"
- :rows="2"
- style="width: 100%; margin-top: 10px"
- v-model="form.officeAddress"
- placeholder="请输入详细地址"
- show-word-limit
- />
- </div>
- <div class="form-head" style="margin-top: 15px">其它信息</div>
- <div class="form-bos">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>年销量</div>
- </div>
- <el-input style="width: 100%" v-model="form.yearSales" placeholder="请输入年销量" />
- </div>
- <div class="form-bos form-bos1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>主要经营品类</div>
- </div>
- <el-checkbox-group v-model="categoryList">
- <el-checkbox v-for="(item, index) in productCategoryList" :key="index" :label="item.categoryName" :value="item.id" />
- </el-checkbox-group>
- </div>
- <div class="form-bos form-bos1">
- <div class="form-title flex-row-start">
- <div class="star">*</div>
- <div>供应区域</div>
- </div>
- <el-table
- :data="tableData"
- style="width: 100%"
- border
- row-class-name="static-bg-row"
- :header-cell-style="{
- color: '#1D2129',
- backgroundColor: '#F2F3F5',
- fontWeight: 'normal'
- }"
- >
- <el-table-column label="供应区域" minWidth="200" align="center">
- <template #default="scope">
- <el-select
- @change="(res) => regionChange1(res, scope)"
- v-model="scope.row.provinceCode"
- placeholder="请选择供应区域"
- style="width: 100%"
- >
- <el-option v-for="(item, index) in regionData" :key="index" :label="item.label" :value="item.value" />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="供应区域" minWidth="200" align="center">
- <template #default="scope">
- <el-select
- @change="(res) => regionChange2(res, scope)"
- v-model="scope.row.cityCode"
- placeholder="请选择供应区域"
- style="width: 100%"
- :disabled="scope.row.disabled"
- >
- <el-option v-for="(item, index) in scope.row.children" :key="index" :label="item.label" :value="item.value" />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="130" align="center">
- <template #default="scope">
- <el-button type="primary" link @click="onDel(scope)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-button style="width: 100%; margin-top: 10px" @click="addTable">添加</el-button>
- </div>
- <div class="form-head" style="margin-top: 15px">营业执照及相关经营许可证</div>
- <div class="flex-row-start">
- <el-upload
- class="avatar-uploader"
- :action="action"
- :show-file-list="false"
- :on-success="handleAvatarSuccess"
- :before-upload="beforeAvatarUpload"
- >
- <el-icon class="avatar-uploader-icon"><Plus /></el-icon>
- </el-upload>
- <div v-if="form.businessLicense && form.businessLicense != ''">
- <img class="upload-img" v-for="(item, index) in form.businessLicense.split(',')" :key="index" :src="item" />
- </div>
- </div>
- </template>
- <template v-if="nextNum == 3">
- <div class="register-success flex-column-center">
- <img src="@/assets/images/breg.png" alt="" />
- <div class="success-text">您的账户还在审核中,如有疑问,请致电400-111-0027</div>
- <el-button type="primary">
- <a href="http://119.97.180.88:8050/" @click.stop target="_blank">返回登录</a>
- </el-button>
- <!-- <a href="http://119.97.180.88:8050/" class="zhu" @click.stop target="_blank"> 返回登录>> </a> -->
- </div>
- </template>
- <div class="agreement flex-row-start" v-if="nextNum == 1">
- <el-checkbox v-model="radio" />
- <span class="agreement1">我已阅读并同意</span>
- <span class="agreement2" @click="openDialog">《供应商合作服务协议》</span>
- </div>
- </div>
- <div class="pay-foot" v-if="nextNum != 4">
- <div class="foot-bos">
- <el-button @click="previousStep" v-if="nextNum == 2" class="bnt1">返回上一步</el-button>
- <el-button v-if="nextNum != 3" @click="nextStep" class="bnt2" type="primary" :loading="loading">{{
- nextNum == 2 ? '提交并完成注册' : '下一步'
- }}</el-button>
- </div>
- </div>
- <el-dialog
- v-model="dialogVisible"
- title="《供应商合作服务协议》"
- width="30%"
- :before-close="
- () => {
- dialogVisible = false;
- }
- "
- >
- <div>
- <div v-html="content"></div>
- </div>
- <template #footer>
- <span class="dialog-footer">
- <el-button type="primary" @click="onAgree">同意</el-button>
- <el-button @click="dialogVisible = false">取消</el-button>
- </span>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup lang="ts">
- import {
- smsCode,
- selectBusinessByCustomerName,
- registerCustomer,
- enterpriseScale,
- getProductCategoryList,
- registerSupplier,
- selectByPhone
- } from '@/api/breg/index';
- import { onUnmounted } from 'vue';
- import { onPath } from '@/utils/siteConfig';
- import { regionData } from 'element-china-area-data';
- const nextNum = ref<any>(1);
- const codeText = ref<string>('发送验证码');
- const countdown = ref<number>(0);
- const timer = ref<any>(null);
- const enterprise = ref<any>({});
- const loading = ref(false);
- const radio = ref<any>(false);
- const form = ref<any>({
- purchaseName: '',
- purchasePhone: '',
- code: '',
- password: '',
- confirmPassword: '',
- enterpriseName: '',
- membershipSize: '',
- fixedPhone: '',
- fax: '',
- url: '',
- mailbox: '',
- officeProvince: '',
- officeCity: '',
- officeCounty: '',
- officeAddress: '',
- yearSales: '',
- operatingCategory: '',
- supplyAreaList: [],
- businessLicense: ''
- });
- const enterpriseList = ref<any>([]);
- const regionCodes = ref<any>([]);
- const productCategoryList = ref<any>([]);
- const categoryList = ref<any>([]);
- const tableData = ref<any>([{ province: '', provinceCode: '', city: '', cityCode: '', disabled: true, children: [] }]);
- const action = import.meta.env.VITE_APP_BASE_API + '/resource/oss/upload';
- const dialogVisible = ref(false);
- const content = ref(
- '<p>第1条 订购手续</p><p>初次订购用户须按照优易办公规定填写客户信息,通过网站、传真方式提交至优易办公客户服务中心,进行注册登记。</p><p>第2条 客户登记注册</p><p>1、优易办公客户服务中心在受理客户登记申请后,将注册号码通知客户并邮寄相关资料。对于信息不符,重复登记等客户的登记申请,优易办公有权拒绝。</p><p>2、本公司将慎重处理您在本公司网站所提供的个人情报,极力保护您的个人信息。</p><p>3、客户登记信息如有变更需由客户向优易办公客户服务中心提交变更委托,月结客户须以书面形式提交变更申请。</p><p>4、客户在一定时间内无订购时,优易办公有权取消客户的登记及相关资料的寄送。</p><p>第3条 优易办公的服务</p><p>客户可以根据有效期内的商品目录或优易办公网站的规定,购买目录或网站上的商品或享受优易办公的配送服务。</p><p>优易办公将定期送上商品目录及相关资料,同时还会将商品促销信息通过电话、传真或邮件方式发送至您的邮箱。若您不希望收到此类信息,请随时向我们提出,我们会根据您的要求不再向您发送以上信息。</p><p>第4条 商品的订购方式</p><p>1、客户可以通过电话、传真或网上订购。我们在接收您订单的同时,将视为您已接受我们的使用条款。</p><p>① 电话订购。 打电话至优易办公客户服务中心,订购您所需要的商品。</p><p>② 传真订购。 按规定填写订购单后发传真至优易办公客户服务中心。客户服务中心会与您电话确认您订购的商品。</p><p>③ 网上订购。 登录优易办公网站,直接从网上挑选商品,直接订购。</p><p>2、当优易办公客户服务中心处理完您的订单后,可视为您与优易办公之间的买卖协议已经成立。但优易办公客户服务中心认为是特殊商品或特殊服务时,则需通过其他方式订购。</p><p>第5条 商品的交付</p><p>1、商品交付是指将商品送至客户登记注册的送货地址或客户特别指定的送货地址,并由客户指定收货人签收后视为交付完成。月结客户指定送货地点与登记地址不符时,须书面告知优易办公客户服务中心。</p><p>2、商品到达日期会因商品或服务的不同而有所区别。</p><p>3、当客户填写的订单内容不全或有误时;当由于通讯状况造成优易办公本部无法完成正常的订单处理时;当由于天气、灾害、事故等造成货物运送状况不良时;当客户的订单限额超过时;当春节或其他节假日时,请关注网站信息栏告知。</p><p>4、对于预订商品、断货商品或大批量的订购,我们将会另行通知送达日期。</p><p>第6条 配送费</p><p>1、所有优易办公配送范围内需满额即可免运费,未满指定金额时需收取配送费。具体配送地区及运费标准,参见《配送及支付标准》</p><p>2、一次订货若须配送至多个送货地点时,则每处送达地点作为一个订单。订单未满一定金额将加收手续费。</p><p>3、当日追加订单,因商品或订购时间等原因不能合并而造成复数订单时,也同样作为不同订单分别处理。订单未满一定金额将加收手续费。</p><p>4、部分预定商品(包含但不仅限于家具类、白板类、保险箱类)将根据供应商运费标准收取配送费用。</p><p>第7条 付款</p><p>商品到货时,客户须支付货款及未满规定免费送货金额时的送货费。部分商品或服务需支付预付款,货款到账确认后发货。家具类商品需全额支付货款金额后发货。订购金额稳定的个别客户根据优易办公的信用评估结果,可签订月结合同,月结付款。</p><p>第8条 拒收商品</p><p>1、如因客户外出不在等原因,使商品不能送达时,我们将会在次日为您补送,由此产生的费用,优易办公有权要求客户负担。</p><p>2、如客户无故不接受本公司送至的商品,将视为取消订货,客户可能承担因此而产生的相当于商品货值的违约金。</p><p>第9条 不可抗力的责任免除</p><p>因气候灾害、法律修改废除、交通事故、公众处分、运输公司的事故、劳动争议、交通管制等不可抗力造成送货延迟或不能配送,而造成客户损失的,优易办公不承担任何赔偿责任。</p><p>第10条 取消订货</p><p>1、因优易办公的销售系统会在接到客户订单后,即刻安排商品的配送,所以无法取消当日的订货。客户如想取消订货,请参照第12条的规定,按照退货的手续办理。</p><p>2、家具商品如已下单定货,订单无法取消。</p><p>第11条 商品的退换货处理</p><p>1、客户在优易办公商品交付后15天以内,如遇以下情况,可与优易办公客户服务中心取得联系,凭发票办理免费退换货。月结客户结账期内,未收到货品发票时,可凭借交货单办理退换货手续。</p><p>① 您在收到所购商品时,如发现商品缺损、脏污、型号、数量不符或OA耗材类商品无优易办公防伪标识时可当场提出退换货要求,我们将在第二天将新商品免费送至您处。</p><p>② 您在使用过程中发现质量问题时,应立即停止该商品的使用,并与优易办公客户服务中心取得联系,优易办公将上门取货,并对商品进行检测,检测结果确定为产品质量时,优易办公将为您办理免费退换货手续。个别商品的质量检测须根据厂家检测报告为准。</p><p>办公耗材类:</p><p>您在优易办公购买的办公耗材15天以内(商品送达之日起算)如发现质量问题,应立即与优易办公客户服务中心取得联系,并停止使用该产品,进行质量 检测。客户可以自行将该产品送交厂家相关机构进行检测或将商品递交优易办公售后服务中心,由优易办公代为检测,优易办公将依据厂家检测中心的产品质量证明书进行退换货服务。</p><p>整机类(如传真机、打印机、电脑等):</p><p>您在优易办公购买的整机类产品15天内(商品送达之日起算)如发现质量问题, 应立即与优易办公客户服务中心取得联系, 并停止使用该产品, 优易办公 将根据厂家产品检测中心的产品质量证明书为客户提供国家三包规定的退换货服务。家电、手机类产品的退换货按照国家三包规定办理退换货服务。</p><p>2、因客户原因造成退换货的,优易办公将根据具体的情况提供有偿的退换货服务,具体收费标准详询优易办公客服人员。</p><p>3、退款时间:优易办公自收到退回商品并确认退货原因之日起七日内返还客户支付的商品价款。</p><p>4、以下情况不能退换货:</p><p>① 因客户原因,造成商品外观及外包装、使用性能损坏等不能再次销售的商品。</p><p>② 无故要求将货物随意更换成其他产品时。</p><p>③ 根据客户的要求、特别购买或订制的商品。</p><p>④ 合同规定的不可退货商品。</p><p>⑤ 非质量原因的,食品等有保质期或使用期限的商品。</p><p>⑥ 超过厂家规定保修期的商品。</p><p>⑦ 外包装丢失的硒鼓、墨盒等OA消耗品。</p><p>⑧ 家电、手机和整机类产品按国家规定的三包条款执行,无质量问题不可退货。</p><p>⑨ 家具类商品除本身质量原因外,不进行退换货。</p><p>第12条 取消注册</p><p>1、当客户发生如下情况时,或发生优易办公认为不当事由时,优易办公客户服务中心有权取消客户资格,敬请谅解。</p><p>① 客户在订购后无故拖欠货款的,同时优易办公也将用法律手段提起控 诉。</p><p>② 被国家法律部门查封或被监察部门处理的。</p><p>③ 公司发生重组、破产或者被拍卖、强制执行及民事诉讼的。</p><p>④ 所开出的票据无法兑现的。</p><p>⑤ 财产状况恶化或有可能造成财产状况恶化的客观事件发生的。</p><p>⑥ 违反本条款中任何一项内容的。</p><p>2、当客户违反上述任何一条时,因使用优易办公服务而发生尚未偿付的任何债务须立即付清,否则优易办公有使用司法手段通过法律途径维护正当权益的权利及其他产生的损失的追索权利。</p><p>第13条 注册信息的变更</p><p>1、如客户在优易办公登记信息(如公司名称、地址、负责人、电话和传真号码、联系人等)发生变更时,应立即与优易办公客户服务中心联系并提出变更申请。月结客户须以书面形式提交申请。</p><p>2、如您因未及时与客户服务中心联系,造成商品或目录配送时的延迟或没有送到等情况发生的,优易办公将不承担相关责任 。</p><p>第14条 争议解决</p><p>与客户使用条款相关的一切争议,经协商不能达成一致意见的,应当向我公司所在地的人民法院提起诉讼。</p><p>第15条 目录商品的变更</p><p>在商品目录内的部分商品可能会发生式样、价格上的变更,另外也可能发生由于生产商停止生产某种商品而造成无法供货的情况,我们将通过网站第一时间更新信息,敬请谅解。</p><p>第16条 使用条款的修订</p><p>本使用条款及商品目录的记载内容可以不经预告而直接修订。客户在条款修订后,对优易办公的使用可视为对本条款修订内容的接受。</p><p>本客户使用条款的最终解释权归武汉优易达科技有限公司所有</p>'
- );
- onMounted(() => {
- //企业规模
- enterpriseScale({ limit: 999 }).then((res) => {
- if (res.code == 200) {
- enterpriseList.value = res.rows;
- }
- });
- //企业规模
- getProductCategoryList({}).then((res) => {
- if (res.code == 200) {
- productCategoryList.value = res.data;
- }
- });
- });
- // 启动倒计时
- const startCountdown = () => {
- countdown.value = 60;
- codeText.value = `${countdown.value}s 后重新发送`;
- timer.value = setInterval(() => {
- countdown.value--;
- if (countdown.value > 0) {
- codeText.value = `${countdown.value}s 后重新发送`;
- } else {
- clearInterval(timer.value);
- timer.value = null;
- codeText.value = '发送验证码';
- }
- }, 1000);
- };
- // 获取验证码
- const sendSmsCode = () => {
- // 防止倒计时期间重复点击
- if (countdown.value > 0) return;
- const phone = form.value.purchasePhone;
- // 1. 基础格式校验
- if (!validateMobile(phone)) {
- ElMessage({
- message: '请输入正确的手机号码',
- type: 'warning'
- });
- return;
- }
- // 2. 【新增】先调用接口查询用户是否存在
- selectByPhone(form.value.purchasePhone, '1')
- .then((res: any) => {
- // --- 后端返回 200 ---
- // 根据你的后端逻辑:返回 200 代表 "用户不存在" (R.ok),允许注册
- if (res.code === 200) {
- // 手机号可用,继续执行发送验证码逻辑
- smsCode({ phonenumber: form.value.purchasePhone })
- .then((smsRes: any) => {
- if (smsRes.code === 200) {
- ElMessage({
- message: '验证码已发送',
- type: 'success'
- });
- startCountdown(); // 开始倒计时
- } else {
- // 发送短信接口业务失败
- ElMessage.error(smsRes.msg || '发送验证码失败');
- }
- })
- .catch((err: any) => {
- // 发送短信接口网络错误或异常
- ElMessage.error(err.msg || '发送验证码请求异常');
- });
- } else {
- }
- })
- .catch((error: any) => {
- // --- 后端返回非 200 (进入 catch) ---
- // 根据你的后端逻辑:返回 fail 代表 "用户已存在" (R.fail("该手机号已注册"))
- const msg = error.msg || '该手机号已注册,请直接登录';
- ElMessage({
- message: msg,
- type: 'warning' // 或者使用 'error'
- });
- });
- };
- //选择省
- const regionChange1 = (res: any, scope: any) => {
- regionData.forEach((item: any) => {
- if (item.value === res) {
- scope.row.province = item.label;
- scope.row.children = item.children;
- scope.row.city = '';
- scope.row.cityCode = '';
- scope.row.disabled = false;
- }
- });
- };
- //选择市
- const regionChange2 = (res: any, scope: any) => {
- scope.row.children.forEach((item: any) => {
- if (item.value === res) {
- scope.row.city = item.label;
- }
- });
- };
- //新增
- const addTable = () => {
- tableData.value.push({ province: '', provinceCode: '', city: '', cityCode: '', disabled: true, children: [] });
- };
- //删除
- const onDel = (scope: any) => {
- tableData.value.splice(scope.row.$index, 1);
- };
- // 验证手机号
- const validateMobile = (phone: any) => {
- const reg = /^1[3-9]\d{9}$/;
- return reg.test(phone);
- };
- // 验证企业名字
- const validateStrict = (str: any) => {
- if (typeof str !== 'string') return false;
- const trimmed = str.trim();
- if (trimmed.length === 0) return false; // 去空格后为空
- return /^[^a-zA-Z0-9]+$/.test(trimmed);
- };
- // 处理地区选择变化
- const handleRegionChange = (value: string[]) => {
- if (value && value.length === 3) {
- // 根据选中的代码查找对应的名称
- // 根据编码获取名称
- const names: string[] = [];
- if (value[0]) {
- const province = regionData.find((item: any) => item.value === value[0]);
- if (province) {
- form.value.officeProvince = province.label;
- if (value[1] && province.children) {
- const city = province.children.find((item: any) => item.value === value[1]);
- if (city) {
- form.value.officeCity = city.label;
- if (value[2] && city.children) {
- const county = city.children.find((item: any) => item.value === value[2]);
- if (county) {
- form.value.officeCounty = county.label;
- }
- }
- }
- }
- }
- }
- }
- };
- //上传成功
- const handleAvatarSuccess = (res: any) => {
- if (res.code == 200) {
- if (form.value.businessLicense == '') {
- form.value.businessLicense = res.data.url;
- } else {
- form.value.businessLicense = form.value.businessLicense + ',' + res.data.url;
- }
- } else {
- ElMessage({
- message: res.msg,
- type: 'warning'
- });
- }
- };
- import type { UploadProps } from 'element-plus';
- const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
- if (rawFile.size / 1024 / 1024 > 2) {
- ElMessage.error('不能大于2MB!');
- return false;
- }
- return true;
- };
- const nextStep = () => {
- if (nextNum.value == 1) {
- if (!radio.value) {
- ElMessage({
- message: '请勾选协议内容~',
- type: 'warning'
- });
- return;
- }
- const errorMsg1 = {
- purchaseName: '请输入姓名',
- purchasePhone: '请输入手机号码',
- code: '请输入验证码',
- password: '请输入密码',
- confirmPassword: '请再次输入密码'
- };
- let next1 = true;
- Object.keys(errorMsg1).forEach((key) => {
- if ((form.value[key] == '' || form.value[key] == undefined || form.value[key] == null) && next1) {
- next1 = false;
- ElMessage({
- message: `${errorMsg1[key]}`,
- type: 'warning'
- });
- return;
- }
- });
- if (!next1) return;
- if (form.value.password != form.value.confirmPassword) {
- ElMessage({
- message: `密码不一致`,
- type: 'warning'
- });
- return;
- }
- nextNum.value = 2;
- } else if (nextNum.value == 2) {
- const errorMsg2 = {
- enterpriseName: '请输入供应商名称',
- membershipSize: '请选择规模',
- fixedPhone: '请输入固定电话',
- mailbox: '请输入企业邮箱',
- officeCounty: '请选择省市区',
- officeAddress: '请输入详细地址',
- yearSales: '请输入年销量',
- businessLicense: '请上传营业执照'
- };
- let next2 = true;
- Object.keys(errorMsg2).forEach((key) => {
- if ((form.value[key] == '' || form.value[key] == undefined || form.value[key] == null) && next2) {
- next2 = false;
- ElMessage({
- message: `${errorMsg2[key]}`,
- type: 'warning'
- });
- return;
- }
- });
- if (!next2) return;
- if (!validateStrict(form.value.enterpriseName)) {
- ElMessage({
- message: '供应商名称不能有数字或字母',
- type: 'warning'
- });
- return;
- }
- if (categoryList.value.length == 0) {
- ElMessage({
- message: '请选择主要经营品类',
- type: 'warning'
- });
- return;
- }
- form.value.operatingCategory = categoryList.value.join(',');
- if (tableData.value.length == 0) {
- ElMessage({
- message: '请新增供应区域',
- type: 'warning'
- });
- return;
- }
- form.value.supplyAreaList = [];
- tableData.value.forEach((item: any) => {
- if (item.province && item.provinceCode && item.city && item.cityCode) {
- form.value.supplyAreaList.push({
- areaCode: item.provinceCode,
- areaName: item.province,
- parentCode: 0,
- level: 1
- });
- form.value.supplyAreaList.push({
- areaCode: item.cityCode,
- areaName: item.city,
- parentCode: item.provinceCode,
- level: 2
- });
- }
- });
- if (form.value.supplyAreaList.length == 0) {
- ElMessage({
- message: '供应区域不能为空',
- type: 'warning'
- });
- return;
- }
- loading.value = true;
- registerSupplier(form.value).then((res: any) => {
- loading.value = false;
- if (res.code == 200) {
- nextNum.value = 3;
- }
- });
- }
- };
- //上一步
- const previousStep = () => {
- if (nextNum.value == 2) {
- nextNum.value = 1;
- }
- if (nextNum.value == 3) {
- nextNum.value = 2;
- }
- };
- const goLogin = () => {
- onPath('/login');
- };
- const openDialog = () => {
- dialogVisible.value = true;
- };
- const onAgree = () => {
- radio.value = true;
- dialogVisible.value = false;
- };
- // 组件卸载时清除定时器
- onUnmounted(() => {
- if (timer.value) {
- clearInterval(timer.value);
- timer.value = null;
- }
- });
- </script>
- <style lang="scss" scoped>
- .register-pages {
- width: 100%;
- background-color: #ffffff;
- display: flex;
- flex-direction: column;
- .register-bos {
- flex: 1;
- width: 100%;
- min-width: 1200px;
- max-width: 1500px;
- margin: 0 auto;
- padding-top: 20px;
- .head-img {
- width: 185px;
- height: 90px;
- }
- .register-login {
- font-weight: 400;
- font-size: 14px;
- color: #101828;
- margin-top: 20px;
- padding-bottom: 10px;
- border-bottom: 1px solid #e5e7eb;
- .zhu {
- color: #e7000b;
- cursor: pointer;
- }
- }
- .progress-bos {
- padding: 20px;
- display: flex;
- margin-bottom: 24px;
- .progress-bar {
- width: 320px;
- height: 40px;
- background: #f7f8fa;
- font-weight: 500;
- font-size: 16px;
- line-height: 40px;
- padding-left: 16px;
- color: #4e5969;
- position: relative;
- &.hig1 {
- background: #e7000b;
- color: #ffffff;
- }
- &.hig2 {
- background: #ffe8e8;
- color: #1d2129;
- }
- }
- .progress-bar2 {
- width: 354px;
- }
- }
- .form-head {
- width: calc(100% - 40px);
- margin: 0 20px 10px 20px;
- height: 44px;
- background: #f7f8fa;
- font-weight: 500;
- font-size: 16px;
- color: #1d2129;
- line-height: 44px;
- position: relative;
- padding-left: 25px;
- &::after {
- content: '';
- width: 4px;
- height: 16px;
- background: #e7000b;
- position: absolute;
- left: 10px;
- top: 12px;
- }
- }
- .form-bos {
- padding: 0 20px;
- // :deep(.el-input__wrapper) {
- // border: none;
- // box-shadow: none;
- // outline: none;
- // background: #f4f6f8;
- // }
- // :deep(.el-select__wrapper) {
- // border: none;
- // box-shadow: none;
- // outline: none;
- // background: #f4f6f8;
- // }
- // :deep(.el-textarea__inner) {
- // border: none;
- // box-shadow: none;
- // outline: none;
- // background: #f4f6f8;
- // }
- .form-title {
- font-size: 14px;
- color: #1d2129;
- margin-bottom: 8px;
- .star {
- width: 10px;
- color: #f53f3f;
- }
- }
- .form-tip {
- font-size: 12px;
- color: #86909c;
- margin-top: 4px;
- }
- .code {
- font-size: 14px;
- color: #e7000b;
- cursor: pointer;
- &.disabled {
- color: #999;
- cursor: not-allowed;
- }
- }
- }
- .form-bos1 {
- margin-top: 30px;
- }
- .agreement {
- padding-left: 20px;
- margin-top: 30px;
- font-size: 13px;
- .agreement1 {
- color: #999999;
- margin-left: 5px;
- }
- .agreement2 {
- color: #e7000b;
- cursor: pointer;
- }
- }
- }
- .pay-foot {
- width: 100%;
- height: 82px;
- background: #ffffff;
- box-shadow: 0px -2px 13px 0px rgba(0, 0, 0, 0.05);
- margin-top: 47px;
- .foot-bos {
- width: 100%;
- min-width: 1200px;
- max-width: 1500px;
- margin: 0 auto;
- padding-top: 16px;
- padding-left: 20px;
- .bnt1 {
- width: 120px;
- height: 32px;
- background: #f7f8fa;
- }
- .bnt2 {
- width: 120px;
- height: 32px;
- }
- }
- }
- .register-success {
- width: 100%;
- padding-bottom: 30px;
- img {
- width: 324px;
- }
- .success-text {
- font-weight: 400;
- font-size: 14px;
- color: #000000;
- margin: 20px 0 30px 0;
- }
- }
- :deep(.is-bordered-label) {
- font-weight: 400;
- }
- /* 核心代码:禁止 hover 变色 */
- :deep(.el-table .static-bg-row:hover > td) {
- background-color: inherit !important;
- }
- /* 兼容斑马纹情况 */
- :deep(.el-table--striped .static-bg-row:nth-child(2n):hover > td) {
- background-color: inherit !important;
- }
- .avatar-uploader {
- margin: 10px 20px;
- :deep(.el-upload) {
- width: 108px;
- height: 108px;
- background: #f2f3f5;
- border-radius: 2px;
- cursor: pointer;
- position: relative;
- overflow: hidden;
- }
- }
- .upload-img {
- width: 108px;
- height: 108px;
- border-radius: 2px;
- margin-right: 15px;
- }
- .el-icon.avatar-uploader-icon {
- font-size: 28px;
- color: #8c939d;
- width: 178px;
- height: 178px;
- text-align: center;
- }
- }
- </style>
|