EditModal.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. <template>
  2. <div>
  3. <el-dialog :visible.sync="visible" v-bind="modalOptions">
  4. <div>
  5. <el-form
  6. ref="formData"
  7. :model="formData"
  8. :rules="formRules"
  9. size="mini"
  10. label-suffix=":"
  11. label-width="160px"
  12. >
  13. <div>
  14. <el-tabs v-model="activeName">
  15. <el-tab-pane label="授权信息" name="first">
  16. <el-form-item label="店铺名称" prop="shopName">
  17. <el-input v-model="formData.shopName" maxlength="20" />
  18. </el-form-item>
  19. <el-form-item label="支持的支付类型" prop="payType">
  20. <el-radio-group v-model="formData.payType">
  21. <el-radio :label="9">惠市宝</el-radio>
  22. <el-radio :label="4">通联</el-radio>
  23. <el-radio :label="0">无</el-radio>
  24. </el-radio-group>
  25. </el-form-item>
  26. <el-form-item label="是否支持代金券" prop="isVoucher">
  27. <el-radio-group v-model="formData.isVoucher">
  28. <el-radio :label="1"> 允许 </el-radio>
  29. <el-radio :label="2"> 拒绝 </el-radio>
  30. </el-radio-group>
  31. </el-form-item>
  32. <el-form-item
  33. v-if="formData.isVoucher === 1"
  34. :rules="[
  35. {
  36. required: true,
  37. message: '请输入代金券返还比例',
  38. trigger: 'blur',
  39. },
  40. {
  41. type: 'number',
  42. max: 100,
  43. min: 0,
  44. message: '请输入正确的代金券返还比例,0 ~ 100',
  45. trigger: ['blur', 'change'],
  46. },
  47. ]"
  48. label="代金券返还比例"
  49. prop="voucherReturn"
  50. >
  51. <el-input
  52. v-model.number="formData.voucherReturn"
  53. style="width: 200px"
  54. placeholder="请填写代金券返还比例,范围0 ~ 100"
  55. >
  56. <template #append>%</template>
  57. </el-input>
  58. </el-form-item>
  59. <el-form-item label="代金券提现比例" prop="voucherCoinRatio">
  60. <el-input-number
  61. v-model="formData.voucherCoinRatio"
  62. :precision="2"
  63. :step="0.01"
  64. :max="1"
  65. ></el-input-number>
  66. <span style="margin-left: 10px">比例*100</span>
  67. </el-form-item>
  68. <el-form-item label="是否支持消费金" prop="isBeeCoin">
  69. <el-radio-group v-model="formData.isBeeCoin">
  70. <el-radio :label="1">支持</el-radio>
  71. <el-radio :label="2">不支持</el-radio>
  72. </el-radio-group>
  73. </el-form-item>
  74. <el-form-item
  75. v-if="formData.isBeeCoin === 1"
  76. label="商家消费金提现比例"
  77. prop="beeCoinRatio"
  78. >
  79. <el-input-number
  80. v-model="formData.beeCoinRatio"
  81. :precision="2"
  82. :step="0.01"
  83. :max="1"
  84. ></el-input-number>
  85. <span style="margin-left: 10px">比例*100</span>
  86. </el-form-item>
  87. <el-form-item label="店铺负责人" prop="chargePersonName">
  88. <el-input
  89. v-model="formData.chargePersonName"
  90. maxlength="20"
  91. />
  92. </el-form-item>
  93. <el-form-item label="负责人电话" prop="chargePersonPhone">
  94. <!-- .replace(/(\d{3})\d+(\d{4})$/, '$1****$2') -->
  95. <el-input
  96. v-model="formData.chargePersonPhone"
  97. maxlength="11"
  98. clearable
  99. />
  100. </el-form-item>
  101. <el-form-item label="请选择区域" prop="areaId">
  102. <el-cascader
  103. v-model="regionArrDialog"
  104. :props="regionProps"
  105. size="large"
  106. placeholder="请选择区域"
  107. @change="
  108. formData.areaId =
  109. regionArrDialog[regionArrDialog.length - 1]
  110. "
  111. ></el-cascader>
  112. <div v-if="formData.areaId">
  113. 已选ID:{{ formData.areaId }}
  114. </div>
  115. </el-form-item>
  116. <el-form-item label="官方分类" prop="classifyId">
  117. <!-- <el-cascader
  118. v-model="formData.classificationArr" placeholder="请选择官方分类" :options="categoryList"
  119. :props="{ checkStrictly: false, expandTrigger: 'hover', label: 'storeName', value: 'id', children: 'childs' }"
  120. clearable
  121. /> -->
  122. <el-cascader
  123. v-model="formData.classificationId"
  124. :options="categoryList"
  125. :props="{
  126. checkStrictly: false,
  127. expandTrigger: 'hover',
  128. label: 'storeName',
  129. value: 'id',
  130. children: 'childs',
  131. }"
  132. @change="handleSelectChange"
  133. ></el-cascader>
  134. </el-form-item>
  135. <el-form-item label="店铺地址" prop="shopAdress">
  136. <el-input v-model="formData.shopAdress" maxlength="60" />
  137. </el-form-item>
  138. <el-form-item label="店铺经纬度" prop="longitude">
  139. <div>
  140. <span v-if="formData.longitude">
  141. {{ formData.longitude }} - {{ formData.latitude }}
  142. </span>
  143. <el-button
  144. size="mini"
  145. type="primary"
  146. style="margin-left: 20px"
  147. @click="
  148. $refs.selectAddressMapRef &&
  149. $refs.selectAddressMapRef.show()
  150. "
  151. >
  152. {{ formData.longitude ? "修改" : "选择" }}
  153. </el-button>
  154. </div>
  155. </el-form-item>
  156. <el-form-item label="生效日期" prop="effectiveDate">
  157. <el-date-picker
  158. v-model="formData.effectiveDate"
  159. value-format="yyyy-MM-dd"
  160. type="date"
  161. placeholder="选择日期"
  162. />
  163. </el-form-item>
  164. <el-form-item label="生效年限" prop="effectiveYear">
  165. <el-input
  166. v-model="formData.effectiveYear"
  167. type="text"
  168. placeholder="请输入内容"
  169. maxlength="4"
  170. class="elipt"
  171. style="width: 50%"
  172. show-word-limit
  173. />
  174. <span class="elspan">年</span>
  175. </el-form-item>
  176. <el-form-item label="合同状态" prop="contractState">
  177. <el-radio-group v-model="formData.contractState">
  178. <el-radio :label="1"> 有效 </el-radio>
  179. <el-radio :label="0"> 无效 </el-radio>
  180. </el-radio-group>
  181. </el-form-item>
  182. <el-form-item label="店铺类型" prop="shopType">
  183. <el-radio-group v-model="formData.shopType">
  184. <!-- <el-radio :label="1">品牌厂家</el-radio> -->
  185. <el-radio :label="2">本地</el-radio>
  186. </el-radio-group>
  187. </el-form-item>
  188. <el-form-item
  189. v-if="formData.shopType === 2"
  190. prop="startTime"
  191. label="营业开始时间"
  192. :rules="[
  193. {
  194. required: true,
  195. message: '请选择营业开始时间',
  196. trigger: 'blur',
  197. },
  198. ]"
  199. >
  200. <el-time-select
  201. v-model="formData.startTime"
  202. placeholder="起始时间"
  203. :picker-options="{ start: '00:00', step: '00:05' }"
  204. >
  205. </el-time-select>
  206. </el-form-item>
  207. <el-form-item
  208. v-if="formData.shopType === 2"
  209. prop="endTime"
  210. label="营业结束时间"
  211. :rules="[
  212. {
  213. required: true,
  214. message: '请选择营业结束时间',
  215. trigger: 'blur',
  216. },
  217. ]"
  218. >
  219. <el-time-select
  220. v-model="formData.endTime"
  221. placeholder="营业结束时间"
  222. :picker-options="{
  223. start: '00:00',
  224. step: '00:05',
  225. end: '24:00',
  226. }"
  227. >
  228. </el-time-select>
  229. </el-form-item>
  230. <el-form-item label="惠市宝商家编号">
  231. <el-input v-model="formData.hsbMrchId" maxlength="60" />
  232. </el-form-item>
  233. <el-form-item label="直播间审核" prop="auditLive">
  234. <el-radio-group v-model="formData.auditLive">
  235. <el-radio :label="1">开启</el-radio>
  236. <el-radio :label="0">关闭</el-radio>
  237. </el-radio-group>
  238. </el-form-item>
  239. <el-form-item label="直播间商品审核" prop="auditLiveProduct">
  240. <el-radio-group v-model="formData.auditLiveProduct">
  241. <el-radio :label="1"> 开启 </el-radio>
  242. <el-radio :label="0"> 关闭 </el-radio>
  243. </el-radio-group>
  244. </el-form-item>
  245. <el-form-item
  246. label="兑换商品是否需要核销"
  247. prop="exchangeIsNeedVerification"
  248. >
  249. <el-radio-group v-model="formData.exchangeIsNeedVerification">
  250. <el-radio :label="1"> 是 </el-radio>
  251. <el-radio :label="0"> 否 </el-radio>
  252. </el-radio-group>
  253. </el-form-item>
  254. <el-form-item class="b-shop-rate" prop="score" label="评分">
  255. <el-rate v-model="formData.score"></el-rate>
  256. </el-form-item>
  257. <el-form-item prop="monthlySales" label="月售">
  258. <el-input
  259. v-model.number="formData.monthlySales"
  260. placeholder="请输入商家月售额"
  261. type="number"
  262. ></el-input>
  263. </el-form-item>
  264. <el-form-item prop="perCapita" label="人均">
  265. <el-input
  266. v-model.number="formData.perCapita"
  267. type="number"
  268. placeholder="请输入人均消费额"
  269. closeable
  270. ></el-input>
  271. </el-form-item>
  272. <el-form-item prop="shopBrief" label="商家简介">
  273. <el-input
  274. v-model="formData.shopBrief"
  275. autosize
  276. maxlength="250"
  277. show-word-limit
  278. type="textarea"
  279. placeholder="请输入商家简介"
  280. closeable
  281. ></el-input>
  282. </el-form-item>
  283. <el-form-item prop="advertisement" label="广告图">
  284. <!-- <el-upload
  285. class="avatar-uploader" list-type="picture-card" :file-list="formData.advertisement"
  286. :action="uploadUrl"
  287. :on-success="(r) => formData.advertisement.push({ url: r.url, uid: r.url + Math.random() + Date.now() })"
  288. :on-remove="(e) => formData.advertisement.filter((item) => item.uid !== e.uid)"
  289. >
  290. <i class="el-icon-plus avatar-uploader-icon" />
  291. </el-upload> -->
  292. <el-upload
  293. class="avatar-uploader"
  294. list-type="picture-card"
  295. :file-list="uploadList"
  296. :action="uploadUrl"
  297. :on-success="uploadSuccess"
  298. :on-remove="removeSuccess"
  299. >
  300. <i class="el-icon-plus avatar-uploader-icon" />
  301. </el-upload>
  302. </el-form-item>
  303. </el-tab-pane>
  304. <el-tab-pane label="客户信息" name="second">
  305. <el-form-item label="账号" prop="shopPhone" maxlength="20">
  306. <el-input
  307. ref="shopPhoneCls"
  308. v-model="formData.shopPhone"
  309. maxlength="20"
  310. />
  311. </el-form-item>
  312. <el-form-item label="密码" prop="shopPassword">
  313. <el-input
  314. v-model="formData.shopPassword"
  315. type="password"
  316. maxlength="16"
  317. />
  318. </el-form-item>
  319. </el-tab-pane>
  320. </el-tabs>
  321. </div>
  322. </el-form>
  323. </div>
  324. <template #footer>
  325. <span class="dialog-footer">
  326. <el-button size="mini" @click="handleClose">取 消</el-button>
  327. <el-button
  328. v-if="activeName === 'first'"
  329. type="primary"
  330. size="mini"
  331. @click="activeName = 'second'"
  332. >
  333. 下一步
  334. </el-button>
  335. <el-button
  336. v-else-if="activeName === 'second'"
  337. type="primary"
  338. size="mini"
  339. @click="handleSubmit"
  340. >确 定</el-button
  341. >
  342. </span>
  343. </template>
  344. </el-dialog>
  345. <!-- 选择经纬度 -->
  346. <SelectAddressMap
  347. ref="selectAddressMapRef"
  348. @select="
  349. (address) =>
  350. (formData.longitude = address[0]) && (formData.latitude = address[1])
  351. "
  352. ></SelectAddressMap>
  353. </div>
  354. </template>
  355. <script>
  356. import SelectAddressMap from "./SelectAddressMap";
  357. import {
  358. businessListGetById,
  359. businessListUpdate,
  360. businessListSave,
  361. businessClassList,
  362. } from "@/api/business";
  363. import { getProvinceList, getChildAreaList } from "@/api/address";
  364. import { uploadUrl } from "@/utils/request";
  365. import XeUtils from "xe-utils";
  366. export default {
  367. name: "EditModal",
  368. components: {
  369. SelectAddressMap,
  370. },
  371. data() {
  372. return {
  373. modalOptions: {
  374. closeOnClickModal: false,
  375. width: "820px",
  376. title: "",
  377. },
  378. visible: false,
  379. formData: {
  380. shopId: "",
  381. shopName: "", // 店铺名称
  382. voucherCoinRatio: "", // 代金券提现比例
  383. isBeeCoin: "", // 是否支持消费金
  384. beeCoinRatio: "", // 商家消费金提现比例
  385. chargePersonName: "", // 店铺负责人
  386. chargePersonPhone: "", // 负责人电话
  387. shopAdress: "", // 地址
  388. effectiveDate: "", // 生效日期
  389. effectiveYear: "", // 生效年限
  390. shopType: 2, // 商家类型 1 商家 2 本地
  391. payType: 0, // 支付类型
  392. isVoucher: 1, // 是否支持代金卷 1 true 2 false
  393. voucherReturn: "",
  394. contractState: 1, // 合同状态 1-有效 0-无效
  395. auditLive: 1,
  396. auditLiveProduct: 1,
  397. exchangeIsNeedVerification: 0,
  398. shopPhone: "", // 账号
  399. shopPassword: "", // 密码
  400. perCapita: "", // 人均
  401. score: "", // 评分
  402. advertisement: [], // 广告图
  403. areaId: "", // 区域id
  404. hsbMrchId: "", // 惠市宝商家编号,不是必填
  405. longitude: "", // 经纬度
  406. latitude: "", // 经纬度
  407. classificationId: "", // 商家分类id
  408. classificationArr: [], // 非后端参数
  409. startTime: "",
  410. endTime: "",
  411. shopBrief: "", // 商家简介
  412. monthlySales: "",
  413. },
  414. formRules: {
  415. shopName: [{ required: true, message: "请输入店铺名称" }],
  416. effectiveDate: [{ required: true, message: "请输入生效日期" }],
  417. effectiveYear: [{ required: true, message: "请输入生效年限" }],
  418. chargePersonName: [
  419. { required: true, message: "请输入店铺负责人", trigger: "blur" },
  420. ],
  421. chargePersonPhone: [
  422. { required: true, message: "请输入负责人电话", trigger: "blur" },
  423. {
  424. pattern: /^1[3456789]\d{9}$/,
  425. message: "目前只支持中国大陆的手机号码",
  426. },
  427. ],
  428. shopAdress: [
  429. { required: true, message: "请输入地址", trigger: "blur" },
  430. ],
  431. contractState: [
  432. { required: true, message: "请选择合同状态", trigger: "change" },
  433. ],
  434. shopType: [
  435. { required: true, message: "请选择店铺类型", trigger: "change" },
  436. ],
  437. perCapita: [
  438. { required: true, message: "请输入人均消费额", trigger: "blur" },
  439. ],
  440. shopBrief: [
  441. { required: true, message: "请填写商家介绍", trigger: "blur" },
  442. ],
  443. isVoucher: [
  444. {
  445. required: true,
  446. message: "请选择是否允许使用代金卷",
  447. trigger: "change",
  448. },
  449. ],
  450. auditLive: [
  451. { required: true, message: "请选择状态", trigger: "change" },
  452. ],
  453. auditLiveProduct: [
  454. { required: true, message: "请选择状态", trigger: "change" },
  455. ],
  456. exchangeIsNeedVerification: [
  457. { required: true, message: "请选择状态", trigger: "change" },
  458. ],
  459. score: [
  460. { required: true, message: "请选择商家评分", trigger: "change" },
  461. ],
  462. monthlySales: [
  463. { required: true, message: "请输入商家月售额", trigger: "blur" },
  464. ],
  465. // advertisement: [ { required: true, message: '请上传广告图', trigger: 'trigger' } ],
  466. // classificationArr: [ { required: true, type: 'array', message: '请选择分类' } ],
  467. areaId: [{ required: true, message: "请选择地址", trigger: "blur" }],
  468. longitude: [
  469. { required: true, message: "请选择商家经纬度", trigger: "blur" },
  470. ],
  471. isBeeCoin: [{ required: true, message: "请选择是否支持消费金" }],
  472. beeCoinRatio: [],
  473. shopPhone: [
  474. { required: true, message: "请输入账号", trigger: "blur" },
  475. {
  476. pattern: /^1[3456789]\d{9}$/,
  477. message: "目前只支持中国大陆的手机号码",
  478. },
  479. ],
  480. shopPassword: [
  481. { required: true, message: "请输入密码", trigger: "blur" },
  482. {
  483. pattern: /^[~!@#$%^&*\-+=_.0-9a-zA-Z]{8,16}$/,
  484. message: "8-16密码数字英文混合",
  485. },
  486. ],
  487. },
  488. activeName: "first",
  489. regionArrDialog: [],
  490. regionProps: {
  491. lazy: true,
  492. label: "name",
  493. value: "id",
  494. lazyLoad(node, resolve) {
  495. const { level, value } = node;
  496. if (level === 0) {
  497. getProvinceList().then((res) => {
  498. resolve(res.data);
  499. });
  500. } else if (level != 0) {
  501. getChildAreaList(value).then((res) => {
  502. resolve(
  503. res.data.map((item) => {
  504. item.leaf = level === 3;
  505. return item;
  506. })
  507. );
  508. });
  509. }
  510. },
  511. },
  512. uploadUrl,
  513. categoryList: [],
  514. uploadList: [],
  515. };
  516. },
  517. watch: {
  518. "formData.isBeeCoin": {
  519. deep: true,
  520. handler(val) {
  521. if (val === 1) {
  522. this.formRules.beeCoinRatio = [
  523. { required: true, message: "请输入商家消费金提现比例" },
  524. {
  525. pattern: /^0\.\d{0,2}$|^[1-9]\d*\.\d{0,2}$|^[1-9]\d*$/,
  526. message: "数值有误",
  527. },
  528. ];
  529. } else {
  530. this.formRules.beeCoinRatio = [];
  531. }
  532. },
  533. },
  534. },
  535. created() {
  536. this.getCategoryTreeList();
  537. },
  538. methods: {
  539. handleSelectChange(val){
  540. this.formData.classificationId = val[val.length - 1]
  541. },
  542. // 递归获取id组
  543. handleClose() {
  544. this.visible = false;
  545. },
  546. async getCategoryTreeList() {
  547. const res = await businessClassList({ page: 1, pageSize: 9999 });
  548. XeUtils.eachTree(
  549. res.data.records,
  550. (item) => {
  551. if (Array.isArray(item.childs) && item.childs.length === 0) {
  552. item.childs = undefined;
  553. }
  554. },
  555. { children: "childs" }
  556. );
  557. this.categoryList = res.data.records;
  558. },
  559. initList() {},
  560. handleOpen(params = {}) {
  561. this.modalOptions.title = params.shopId ? "修改商家" : "新增商家";
  562. this.formData = Object.assign(this.$options.data().formData, params, {
  563. // advertisement: params.advertisement ? params.advertisement.split(',').map((item) => ({ url: item, uid: item + Math.random() + new Date() })) : []
  564. });
  565. // this.uploadList = this.formData.advertisement.split("&")
  566. const categoryItem = XeUtils.findTree(
  567. this.categoryList,
  568. (item) => item.id === String(params.classificationId)
  569. );
  570. if (categoryItem && Array.isArray(categoryItem.nodes)) {
  571. this.formData.classificationArr = categoryItem.nodes.map((v) => v.id);
  572. }
  573. if (this.formData.areaId) this.regionArrDialog = [this.formData.areaId];
  574. this.visible = true;
  575. this.initList();
  576. if (params.shopId) {
  577. this.getInfo(params.shopId);
  578. } else {
  579. this.$refs.formData && this.$refs.formData.resetFields();
  580. }
  581. },
  582. async getInfo(id) {
  583. const loading = this.$loading({ text: "加载中" });
  584. try {
  585. const res = await businessListGetById({ shopId: id });
  586. this.formData = Object.assign(this.$options.data().formData, res.data, {
  587. shopId: res.data.shopId || "",
  588. voucherReturn: Number(res.data.voucherReturn),
  589. // advertisement: res.data.advertisement ? res.data.advertisement.split(',').map((item) => ({ url: item, uid: item + Math.random() + new Date() })) : []
  590. // advertisement
  591. });
  592. const arr = this.formData.advertisement.split(",");
  593. if (arr[0] == "") {
  594. this.uploadList = [];
  595. } else {
  596. this.uploadList = arr.map((item) => ({
  597. url: item,
  598. uid: item + Math.random() + new Date(),
  599. }));
  600. }
  601. const categoryItem = XeUtils.findTree(
  602. this.categoryList,
  603. (item) => item.id === String(res.data.classificationId)
  604. );
  605. if (categoryItem && Array.isArray(categoryItem.nodes)) {
  606. this.formData.classificationArr = categoryItem.nodes.map((v) => v.id);
  607. }
  608. if (this.formData.areaId) this.regionArrDialog = [this.formData.areaId];
  609. this.$nextTick(() => {
  610. this.$refs.formData && this.$refs.formData.validate();
  611. });
  612. } finally {
  613. loading.close();
  614. }
  615. },
  616. handleSubmit() {
  617. this.$refs.formData.validate(async (valid) => {
  618. if (valid) {
  619. const loading = this.$loading({ text: "加载中" });
  620. try {
  621. const { advertisement, classificationArr, ...otps } = this.formData;
  622. const params = {
  623. ...otps,
  624. // advertisement: Array.isArray(advertisement) ? advertisement.map((v) => v.url || v).join(',') : '',
  625. // classificationId:
  626. // Array.isArray(classificationArr) && classificationArr.length
  627. // ? classificationArr[classificationArr.length - 1]
  628. // : "",
  629. };
  630. params.advertisement = this.uploadList.reduce(
  631. (prev, item, index) => {
  632. prev += item.url + ",";
  633. return prev;
  634. },
  635. ""
  636. );
  637. // 删除最后一个字符
  638. params.advertisement = params.advertisement.substring(
  639. 0,
  640. params.advertisement.length - 1
  641. );
  642. this.formData.shopId
  643. ? await businessListUpdate(params)
  644. : await businessListSave(params);
  645. loading.close();
  646. this.$message({
  647. message: `${this.formData.shopId ? "编辑" : "添加"}成功!`,
  648. type: "success",
  649. });
  650. this.$emit("success");
  651. this.visible = false;
  652. } catch (e) {
  653. loading.close();
  654. } finally {
  655. loading.close();
  656. }
  657. } else {
  658. this.$message({ message: "请输入相关信息", type: "warning" });
  659. return false;
  660. }
  661. });
  662. },
  663. uploadSuccess(r) {
  664. console.log(r);
  665. this.uploadList.push({
  666. url: r.data.url,
  667. uid: r.url + Math.random() + Date.now(),
  668. });
  669. },
  670. removeSuccess(r) {
  671. this.uploadList = this.uploadList.filter((item) => item.uid !== r.uid);
  672. },
  673. },
  674. };
  675. </script>