collectSample.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. size="small"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="100px"
  10. >
  11. <el-form-item label="商品名称" prop="itemTitle">
  12. <el-input
  13. placeholder="请输入商品名称"
  14. style="width: 240px"
  15. v-model="queryParams.itemTitle"
  16. >
  17. </el-input>
  18. </el-form-item>
  19. <el-form-item label="商品ID" prop="itemId">
  20. <el-input
  21. placeholder="请输入商品ID"
  22. style="width: 240px"
  23. v-model="queryParams.itemId"
  24. >
  25. </el-input>
  26. </el-form-item>
  27. <el-form-item>
  28. <el-button
  29. type="primary"
  30. icon="el-icon-search"
  31. size="mini"
  32. @click="handleQuery"
  33. >搜索</el-button
  34. >
  35. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  36. >重置</el-button
  37. >
  38. </el-form-item>
  39. </el-form>
  40. <el-row :gutter="10" class="mb8">
  41. <el-col :span="1.5">
  42. <el-button
  43. type="primary"
  44. plain
  45. icon="el-icon-document-add"
  46. size="mini"
  47. @click="addNew"
  48. >领样申请</el-button
  49. >
  50. </el-col>
  51. </el-row>
  52. <el-table
  53. v-loading="loading"
  54. :data="typeList"
  55. ref="multipleTable"
  56. @selection-change="handleSelectionChange"
  57. >
  58. <el-table-column type="selection" width="50" align="center" />
  59. <el-table-column
  60. label="商品名称"
  61. align="center"
  62. prop="itemTitle"
  63. width="300"
  64. >
  65. <template slot-scope="scope">
  66. <div style="display: flex; width: 100%">
  67. <div style="width: 40%">
  68. <img
  69. :src="scope.row.itemImgUrl"
  70. alt=""
  71. style="width: 70px; height: auto"
  72. />
  73. </div>
  74. <div style="width: 60%" class="item-name-calss">
  75. <a
  76. style="
  77. text-overflow: ellipsis;
  78. white-space: nowrap;
  79. overflow: hidden;
  80. width: 100%;
  81. "
  82. :title="scope.row.itemTitle"
  83. >
  84. {{ scope.row.itemTitle }}
  85. </a>
  86. <p>商品Id: {{ scope.row.itemId }}</p>
  87. <p>商品单价: {{ scope.row.itemPrice / 100 }}元</p>
  88. <p>
  89. 佣金率:
  90. {{
  91. scope.row.commissionRate
  92. ? scope.row.commissionRate / 10 + "%"
  93. : "-"
  94. }}
  95. </p>
  96. </div>
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column
  101. label="预估服务费"
  102. align="center"
  103. prop="regimentalPromotion"
  104. >
  105. </el-table-column>
  106. <el-table-column
  107. label="平台领样要求"
  108. align="center"
  109. prop="sampleRequirement"
  110. >
  111. <template slot-scope="scope">
  112. <div v-if="!!scope.row.sampleRequirement">
  113. {{ scope.row.sampleRequirement }}
  114. </div>
  115. <div v-else>-</div>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="样品数量" align="center" prop="sampleCount">
  119. <template slot-scope="scope">
  120. <div v-if="!!scope.row.sampleCount">
  121. {{ scope.row.sampleCount }}
  122. </div>
  123. <div v-else>-</div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="领样人数" align="center" prop="remark">
  127. <template slot-scope="scope">
  128. <div v-if="!!scope.row.remark">
  129. {{ scope.row.remark }}
  130. </div>
  131. <div v-else>-</div>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="领样份数" align="center" prop="remark">
  135. <template slot-scope="scope">
  136. <div v-if="!!scope.row.remark">
  137. {{ scope.row.remark }}
  138. </div>
  139. <div v-else>-</div>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="状态" align="center" prop="activityItemStatus">
  143. <template slot-scope="scope">
  144. <div v-if="!!scope.row.activityItemStatus">
  145. {{ scope.row.activityItemStatus | activityItemStatusName }}
  146. </div>
  147. <div v-else>-</div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="创建时间" align="center" prop="createTime">
  151. <template slot-scope="scope">
  152. <div v-if="!!scope.row.createTime">
  153. {{ scope.row.createTime.split(" ")[0] }}
  154. </div>
  155. <div v-else>-</div>
  156. </template>
  157. </el-table-column>
  158. <el-table-column
  159. label="手卡信息"
  160. align="center"
  161. prop="partnerRecommendText"
  162. >
  163. <template slot-scope="scope">
  164. <div v-if="!!scope.row.partnerRecommendText">
  165. {{ scope.row.partnerRecommendText }}
  166. </div>
  167. <div v-else>-</div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="归属人" align="center" prop="userName">
  171. </el-table-column>
  172. <el-table-column
  173. label="操作"
  174. align="center"
  175. class-name="small-padding fixed-width"
  176. width="200px"
  177. >
  178. <template slot-scope="scope">
  179. <el-button size="mini" type="text" @click="okInfomation(scope.row)"
  180. >领样申请</el-button
  181. >
  182. <el-button size="mini" type="text" @click="copyInfomation(scope.row)"
  183. >商品复制</el-button
  184. >
  185. <el-button size="mini" type="text" @click="toDetail(scope.row)"
  186. >详情</el-button
  187. >
  188. </template>
  189. </el-table-column>
  190. </el-table>
  191. <pagination
  192. v-show="total > 0"
  193. :total="total"
  194. :page.sync="queryParams.pageNum"
  195. :limit.sync="queryParams.pageSize"
  196. @pagination="getList"
  197. />
  198. <!-- 添加直播 -->
  199. <el-dialog
  200. :title="!!ids ? '修改商品' : '新增商品'"
  201. :visible.sync="openAllocation"
  202. width="800px"
  203. append-to-body
  204. >
  205. <el-form
  206. ref="formBroadcast"
  207. :model="formBroadcast"
  208. :rules="rulesBroadcast"
  209. label-width="100px"
  210. :inline="true"
  211. >
  212. <el-form-item label="创建人" prop="userName" style="width: 100%">
  213. {{ $store.getters.name }}
  214. </el-form-item>
  215. <el-form-item label="活动ID" prop="activityId">
  216. <el-input
  217. placeholder="请输入活动ID"
  218. style="width: 240px"
  219. v-model="formBroadcast.activityId"
  220. :disabled="edit"
  221. >
  222. </el-input>
  223. </el-form-item>
  224. <el-form-item label="商品ID" prop="itemId">
  225. <el-input
  226. placeholder="请输入商品ID"
  227. style="width: 240px"
  228. v-model="formBroadcast.itemId"
  229. :disabled="edit"
  230. >
  231. </el-input>
  232. </el-form-item>
  233. <el-form-item label="发货地" prop="postArea">
  234. <selectTree
  235. :disabled="edit"
  236. style="width: 240px"
  237. v-model="formBroadcast.postArea"
  238. filterable
  239. :data="superiorList"
  240. :props="{
  241. value: 'id',
  242. label: 'name',
  243. }"
  244. />
  245. </el-form-item>
  246. <el-form-item label="不发货地区" prop="noPostArea">
  247. <selectTree
  248. style="width: 240px"
  249. v-model="formBroadcast.noPostArea"
  250. filterable
  251. :multiple="true"
  252. :data="superiorList"
  253. :props="{
  254. value: 'id',
  255. label: 'name',
  256. }"
  257. />
  258. </el-form-item>
  259. <el-form-item label="佣金比例" prop="commissionRate">
  260. <el-input
  261. placeholder="请输入佣金比例"
  262. style="width: 240px"
  263. v-model="formBroadcast.commissionRate"
  264. >
  265. </el-input>
  266. </el-form-item>
  267. <el-form-item label="服务费" prop="regimentalPromotion">
  268. <el-input
  269. placeholder="请输入服务费"
  270. style="width: 240px"
  271. v-model="formBroadcast.regimentalPromotion"
  272. >
  273. </el-input>
  274. </el-form-item>
  275. <el-form-item label="服务费率" prop="regimentalPromotionRate">
  276. <el-input
  277. placeholder="请输入服务费率"
  278. style="width: 240px"
  279. v-model="formBroadcast.regimentalPromotionRate"
  280. >
  281. </el-input>
  282. </el-form-item>
  283. <el-form-item label="领样要求" prop="sampleRequirement">
  284. <el-input
  285. placeholder="请输入领样要求"
  286. style="width: 240px"
  287. v-model="formBroadcast.sampleRequirement"
  288. >
  289. </el-input>
  290. </el-form-item>
  291. <el-form-item label="样品数量" prop="sampleCount">
  292. <el-input
  293. placeholder="请输入样品数量"
  294. style="width: 240px"
  295. v-model="formBroadcast.sampleCount"
  296. >
  297. </el-input>
  298. </el-form-item>
  299. <el-form-item label="商品链接" prop="detailUrl">
  300. <el-input
  301. placeholder="请输入商品链接"
  302. style="width: 240px"
  303. v-model="formBroadcast.detailUrl"
  304. >
  305. </el-input>
  306. </el-form-item>
  307. <el-form-item label="发货率" prop="deliveryRate">
  308. <el-input
  309. placeholder="请输入发货率"
  310. style="width: 240px"
  311. v-model="formBroadcast.deliveryRate"
  312. >
  313. </el-input>
  314. </el-form-item>
  315. <el-form-item
  316. label="手卡内容"
  317. prop="partnerRecommendText"
  318. style="width: 100%"
  319. class="entire-line"
  320. >
  321. <el-input
  322. placeholder="请输入手卡内容"
  323. style="width: 100%"
  324. type="textarea"
  325. :rows="2"
  326. v-model="formBroadcast.partnerRecommendText"
  327. >
  328. </el-input>
  329. </el-form-item>
  330. </el-form>
  331. <div slot="footer" class="dialog-footer">
  332. <el-button
  333. type="primary"
  334. @click="submitFormBroadcast"
  335. :loading="confirmLoading"
  336. >确 定</el-button
  337. >
  338. <el-button
  339. @click="
  340. confirmLoading = false;
  341. openAllocation = false;
  342. formBroadcast = {};
  343. "
  344. >取 消</el-button
  345. >
  346. </div>
  347. </el-dialog>
  348. <!-- 审核拒绝 -->
  349. <el-dialog
  350. title="拒绝原因"
  351. :visible.sync="refuseVisible"
  352. width="500px"
  353. append-to-body
  354. >
  355. <el-input
  356. placeholder="请输入拒绝原因"
  357. style="width: 100%"
  358. type="textarea"
  359. :rows="2"
  360. v-model="refuseInfo"
  361. >
  362. </el-input>
  363. <div slot="footer" class="dialog-footer">
  364. <el-button type="primary" @click="submitRefuse" :loading="refuseLoading"
  365. >确 定</el-button
  366. >
  367. <el-button
  368. @click="
  369. refuseLoading = false;
  370. refuseVisible = false;
  371. refuseInfo = null;
  372. "
  373. >取 消</el-button
  374. >
  375. </div>
  376. </el-dialog>
  377. </div>
  378. </template>
  379. <script>
  380. import { refreshCache } from "@/api/system/dict/type";
  381. import {
  382. getItemList,
  383. getAreaList,
  384. getCity,
  385. checkItem,
  386. editItem,
  387. } from "@/api/goodsManagement/goods";
  388. import selectTree from "./selectTree.vue";
  389. export default {
  390. name: "account-list",
  391. components: {
  392. selectTree,
  393. },
  394. data() {
  395. const equalToPassword = (rule, value, callback) => {
  396. if (!!value && !this.edit) {
  397. checkItem({ itemId: value }).then((res) => {
  398. if (res.message == "true") {
  399. callback();
  400. } else {
  401. callback(new Error(res.message));
  402. }
  403. });
  404. } else {
  405. callback();
  406. }
  407. };
  408. return {
  409. // 遮罩层
  410. loading: true,
  411. // 选中数组
  412. ids: null,
  413. okIds: null,
  414. // 非单个禁用
  415. single: true,
  416. // 非多个禁用
  417. multiple: true,
  418. // 显示搜索条件
  419. showSearch: true,
  420. // 总条数
  421. total: 0,
  422. // 字典表格数据
  423. typeList: [],
  424. //上传文件类型
  425. fileType: [".doc", ".xls", ".xlsx", ".ppt", ".pdf", ".csv"],
  426. // 弹出层标题
  427. title: "",
  428. // 是否显示弹出层
  429. open: false,
  430. openFp: false,
  431. formFp: {},
  432. // 是否可编辑
  433. edit: false,
  434. // 分配销售
  435. openAllocation: false,
  436. // 选择的销售id
  437. saleId: undefined,
  438. // 销售列表
  439. saleList: [],
  440. // 分配销售确定loading
  441. confirmLoadingSale: false,
  442. // 日期范围
  443. dateRange: [],
  444. superiorList: [],
  445. // 查询参数
  446. queryParams: {
  447. pageNum: 1,
  448. pageSize: 10,
  449. itemTitle: undefined,
  450. itemId: undefined,
  451. examineStatus: "2",
  452. },
  453. //页面所有的下拉数据
  454. queryParamsList: {
  455. tagList: [
  456. { value: "2", label: "我的商品" },
  457. { value: "1", label: "待审核" },
  458. { value: "3", label: "审核拒绝" },
  459. ],
  460. },
  461. // 表单参数
  462. form: {},
  463. formBroadcast: {},
  464. //上传报表下拉数据
  465. formList: {},
  466. fileList: [],
  467. accept: "",
  468. //获取销售线索文件流
  469. dateFile: new FormData(),
  470. //销售线索上传loading
  471. confirmLoading: false,
  472. // 表单校验
  473. rules: {},
  474. rulesBroadcast: {
  475. itemId: [
  476. {
  477. required: true,
  478. message: "商品ID必填",
  479. trigger: "blur",
  480. },
  481. { required: true, validator: equalToPassword, trigger: "blur" },
  482. ],
  483. activityId: {
  484. required: true,
  485. message: "活动ID必填",
  486. trigger: "blur",
  487. },
  488. postArea: {
  489. required: true,
  490. message: "发货地必选",
  491. trigger: "change",
  492. },
  493. noPostArea: {
  494. required: true,
  495. message: "不发货地必选",
  496. trigger: "change",
  497. },
  498. commissionRate: {
  499. required: true,
  500. message: "佣金比例必填",
  501. trigger: "blur",
  502. },
  503. regimentalPromotion: {
  504. required: true,
  505. message: "服务费必填",
  506. trigger: "blur",
  507. },
  508. regimentalPromotionRate: {
  509. required: true,
  510. message: "服务费率必填",
  511. trigger: "blur",
  512. },
  513. sampleRequirement: {
  514. required: true,
  515. message: "领样要求必填",
  516. trigger: "blur",
  517. },
  518. sampleCount: {
  519. required: true,
  520. message: "样品数量必填",
  521. trigger: "blur",
  522. },
  523. partnerRecommendText: [
  524. {
  525. required: true,
  526. message: "手卡内容必填",
  527. trigger: "blur",
  528. },
  529. {
  530. min: 5,
  531. max: 200,
  532. message: "手卡内容最少输入5个字符",
  533. trigger: "change",
  534. },
  535. ],
  536. },
  537. // 分配销售展示列表
  538. ksInfo: null,
  539. userId: null,
  540. refuseVisible: false,
  541. refuseLoading: false,
  542. refuseInfo: null,
  543. itemId: null,
  544. };
  545. },
  546. created() {
  547. this.userId = this.$store.getters.userId;
  548. this.getList();
  549. },
  550. filters: {
  551. activityItemStatusName(status) {
  552. const statusMap = {
  553. 1: "待审核",
  554. 2: "审核通过",
  555. 3: "审核失败(拒绝)",
  556. 5: "失效",
  557. };
  558. return statusMap[status];
  559. },
  560. },
  561. methods: {
  562. handleSelectionChange(selection) {
  563. this.okIds = selection.map((item) => item.itemId);
  564. },
  565. okInfomation(item) {
  566. this.$router.replace({
  567. path: "/goodsManagement/promoterSelect",
  568. query: {
  569. itemIds: JSON.stringify([item.itemId]),
  570. },
  571. });
  572. },
  573. toDetail(item) {
  574. localStorage.setItem(
  575. "addItemInfo",
  576. JSON.stringify({ ...item, type: "look" })
  577. );
  578. this.$router.replace({
  579. path: "/goodsManagement/goodsPreview",
  580. });
  581. },
  582. copyInfomation(item) {
  583. if (navigator.clipboard && window.isSecureContext) {
  584. navigator.clipboard
  585. .writeText(
  586. `
  587. 店铺: ${item.shopTitle}
  588. 商品体验: ${item.shopScore}
  589. 商家服务: ${item.mallServiceScore}
  590. 产品: ${item.itemTitle}
  591. 直播价: ¥${item.zkFinalPrice / 100}
  592. 佣金比例: ${item.commissionRate}%
  593. 团长推荐: ${item.partnerRecommendText}
  594. 链接: ${item.detailUrl}`
  595. )
  596. .then(() => {
  597. this.$message.success("复制成功");
  598. })
  599. .catch((err) => {
  600. this.$message.error("复制失败");
  601. });
  602. } else {
  603. // 创建text area
  604. const textArea = document.createElement("textarea");
  605. textArea.value = `
  606. 店铺: ${item.shopTitle}
  607. 商品体验: ${item.shopScore}
  608. 商家服务: ${item.mallServiceScore}
  609. 产品: ${item.itemTitle}
  610. 直播价: ¥${item.zkFinalPrice / 100}
  611. 佣金比例: ${item.commissionRate}%
  612. 团长推荐: ${item.partnerRecommendText}
  613. 链接: ${item.detailUrl}`;
  614. // 使text area不在viewport,同时设置不可见
  615. document.body.appendChild(textArea);
  616. textArea.focus();
  617. textArea.select();
  618. return new Promise((resolve, reject) => {
  619. // 执行复制命令并移除文本框
  620. document.execCommand("copy")
  621. ? resolve()
  622. : reject(new Error("出错了"));
  623. textArea.remove();
  624. }).then(
  625. () => {
  626. this.$message.success("复制成功");
  627. },
  628. () => {
  629. this.$message.error("复制失败");
  630. }
  631. );
  632. }
  633. },
  634. submitRefuse() {
  635. if (!!this.refuseInfo) {
  636. var params = {};
  637. params.itemId = this.itemId;
  638. params.examineStatus = 3;
  639. params.refuseDetail = this.refuseInfo;
  640. params.examineId = this.$store.getters.userId;
  641. params.examineName = this.$store.getters.name;
  642. editItem(params)
  643. .then((res) => {
  644. this.refuseVisible = false;
  645. this.refuseLoading = false;
  646. this.getList();
  647. this.$modal.msgSuccess("已拒绝");
  648. })
  649. .catch(() => {
  650. this.$message.error("失败");
  651. });
  652. } else {
  653. this.$message.error("请输入拒绝原因");
  654. }
  655. },
  656. getAreaList() {
  657. getAreaList().then((res) => {
  658. this.superiorList = res.map((item) => {
  659. return {
  660. id: item,
  661. name: item,
  662. disabled: true,
  663. };
  664. });
  665. });
  666. },
  667. loadNode(node, resolve) {
  668. if (node.level === 0) {
  669. return resolve([{ name: "region" }]);
  670. }
  671. if (node.level > 1) return resolve([]);
  672. console.log(node);
  673. getCity({ province: node.data.id }).then((res) => {
  674. const data = res.map((item) => {
  675. return {
  676. id: item,
  677. name: item,
  678. };
  679. });
  680. resolve(data);
  681. });
  682. // setTimeout(() => {
  683. // const data = [
  684. // {
  685. // name: "leaf",
  686. // leaf: true,
  687. // },
  688. // {
  689. // name: "zone",
  690. // },
  691. // ];
  692. // resolve(data);
  693. // }, 500);
  694. },
  695. handleNodeClick(val) {
  696. console.log(val);
  697. this.$set(this.formBroadcast, "postArea", val.id);
  698. this.$set(this.formBroadcast, "postAreaName", val.name);
  699. if (!val.children || val.children.length == 0) {
  700. this.$refs.selectReport.blur();
  701. }
  702. },
  703. /** 查询字典类型列表 */
  704. getList() {
  705. this.loading = true;
  706. getItemList({ ...this.queryParams }).then((response) => {
  707. this.typeList = response.rows;
  708. this.total = response.total;
  709. this.loading = false;
  710. });
  711. },
  712. // 取消按钮
  713. cancel() {
  714. this.open = false;
  715. this.confirmLoading = false;
  716. this.reset();
  717. },
  718. // 表单重置
  719. reset() {
  720. this.form = {};
  721. this.dateFile = null;
  722. this.resetForm("formBroadcast");
  723. },
  724. /** 搜索按钮操作 */
  725. handleQuery() {
  726. this.queryParams.pageNum = 1;
  727. this.getList();
  728. },
  729. /** 重置按钮操作 */
  730. resetQuery() {
  731. this.dateRange = [];
  732. this.resetForm("queryForm");
  733. this.handleQuery();
  734. },
  735. addNew() {
  736. this.getAreaList();
  737. this.openAllocation = true;
  738. this.edit = false;
  739. this.ids = null;
  740. this.confirmLoading = false;
  741. this.formBroadcast = {};
  742. setTimeout(() => {
  743. this.$refs.formBroadcast.clearValidate();
  744. }, 0);
  745. },
  746. /** 编辑地址 新增达人*/
  747. handleAddbroadcast(item) {
  748. this.getAreaList();
  749. this.$nextTick(() => {
  750. this.ids = item.itemId;
  751. this.edit = true;
  752. this.openAllocation = true;
  753. this.$set(this.formBroadcast, "activityId", item.activityId);
  754. this.$set(this.formBroadcast, "itemId", item.itemId);
  755. this.$set(this.formBroadcast, "postArea", item.postArea);
  756. this.$set(this.formBroadcast, "noPostArea", item.noPostArea);
  757. this.$set(this.formBroadcast, "commissionRate", item.commissionRate);
  758. this.$set(
  759. this.formBroadcast,
  760. "regimentalPromotion",
  761. item.regimentalPromotion
  762. );
  763. this.$set(
  764. this.formBroadcast,
  765. "regimentalPromotionRate",
  766. item.regimentalPromotionRate
  767. );
  768. this.$set(
  769. this.formBroadcast,
  770. "sampleRequirement",
  771. item.sampleRequirement
  772. );
  773. this.$set(this.formBroadcast, "sampleCount", item.sampleCount);
  774. this.$set(this.formBroadcast, "detailUrl", item.detailUrl);
  775. this.$set(this.formBroadcast, "deliveryRate", item.deliveryRate);
  776. this.$set(
  777. this.formBroadcast,
  778. "partnerRecommendText",
  779. item.partnerRecommendText
  780. );
  781. });
  782. },
  783. /** 修改按钮操作 */
  784. handleUpdate(row) {
  785. this.reset();
  786. },
  787. /** 新增直播确定按钮 */
  788. submitFormBroadcast: function () {
  789. this.$refs["formBroadcast"].validate((valid) => {
  790. if (valid) {
  791. if (!this.edit) {
  792. localStorage.setItem(
  793. "addItemInfo",
  794. JSON.stringify(this.formBroadcast)
  795. );
  796. this.$router.replace({
  797. path: "/goodsManagement/goodsPreview",
  798. });
  799. } else {
  800. this.confirmLoading = true;
  801. var params = { ...this.formBroadcast };
  802. params.examineStatus = 1;
  803. editItem(params)
  804. .then((res) => {
  805. this.confirmLoading = false;
  806. this.openAllocation = false;
  807. this.formBroadcast = {};
  808. this.getList();
  809. this.$modal.msgSuccess("修改成功");
  810. })
  811. .catch(() => {
  812. this.confirmLoading = false;
  813. this.$message.error("失败");
  814. });
  815. }
  816. }
  817. });
  818. },
  819. /** 提交按钮 */
  820. submitForm: function () {
  821. this.$refs["form"].validate((valid) => {
  822. if (valid) {
  823. var fileList = this.$refs.fileUploadDialog.fileList;
  824. var dapanUrls = this.$refs.fileUpload.fileList;
  825. var portraitUrls = this.$refs.fileUploadFx.fileList;
  826. if (
  827. fileList.length == 0 &&
  828. dapanUrls.length == 0 &&
  829. portraitUrls.length == 0
  830. ) {
  831. this.$message.error("直播数据,数据大盘,画像分析必须最少上传一项");
  832. return;
  833. } else {
  834. this.confirmLoading = true;
  835. let formData = new FormData();
  836. this.ids;
  837. formData.append("id", this.ids);
  838. formData.append("actualGmv", this.delcommafy(this.form.actualGmv));
  839. formData.append(
  840. "dapanUrls",
  841. JSON.stringify(
  842. dapanUrls.map((item) => {
  843. return item.url;
  844. })
  845. )
  846. );
  847. formData.append(
  848. "portraitUrls",
  849. JSON.stringify(
  850. portraitUrls.map((item) => {
  851. return item.url;
  852. })
  853. )
  854. );
  855. fileList.forEach((file) => formData.append("files", file.raw));
  856. dataUpload(formData)
  857. .then((res) => {
  858. this.confirmLoading = false;
  859. this.$message.success("上传成功");
  860. this.open = false;
  861. this.ids = null;
  862. this.cancel();
  863. this.handleQuery();
  864. })
  865. .catch((err) => {
  866. this.confirmLoading = false;
  867. });
  868. }
  869. console.log(fileList, dapanUrls, portraitUrls);
  870. }
  871. });
  872. },
  873. },
  874. };
  875. </script>
  876. <style lang="scss" scoped>
  877. .entire-line {
  878. width: 100%;
  879. ::v-deep .el-form-item__content {
  880. width: 60%;
  881. }
  882. }
  883. ::v-deep .el-form-item__label {
  884. white-space: nowrap;
  885. }
  886. </style>
  887. <style scoped lang="scss">
  888. ::v-deep a {
  889. color: #409eff;
  890. display: block;
  891. text-align: left;
  892. }
  893. .item-name-calss p {
  894. margin: 0;
  895. text-align: left;
  896. }
  897. .tableBox {
  898. width: 100%;
  899. }
  900. ::v-deep .el-tabs__content {
  901. overflow: initial;
  902. }
  903. </style>