samplingList.vue 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908
  1. <!-- @format -->
  2. <template>
  3. <div class="app-container">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. size="small"
  8. :inline="true"
  9. v-show="showSearch"
  10. label-width="100px"
  11. >
  12. <el-form-item label="领样人" prop="collectSampleId">
  13. <el-select
  14. filterable
  15. v-model="queryParams.collectSampleId"
  16. placeholder="人员名称"
  17. clearable
  18. style="width: 240px"
  19. >
  20. <el-option
  21. v-for="item in queryParamsList.personList"
  22. :key="item.userId"
  23. :label="item.nickMame"
  24. :value="item.userId"
  25. >
  26. <div style="display: flex">
  27. <span
  28. style="
  29. width: 10px;
  30. height: 10px;
  31. border-radius: 50%;
  32. background-color: green;
  33. position: relative;
  34. top: 12px;
  35. margin-right: 5px;
  36. "
  37. :style="
  38. item.status == '0' ? 'backgroundColor:green' : 'backgroundColor:red'
  39. "
  40. >{{ item.value }}</span
  41. ><span>{{ item.nickMame }}</span>
  42. </div>
  43. </el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item label="商品创建人" prop="itemCreateId">
  47. <el-select
  48. filterable
  49. v-model="queryParams.itemCreateId"
  50. placeholder="人员名称"
  51. clearable
  52. style="width: 240px"
  53. >
  54. <el-option
  55. v-for="item in queryParamsList.personList"
  56. :key="item.userId"
  57. :label="item.nickMame"
  58. :value="item.userId"
  59. >
  60. <div style="display: flex">
  61. <span
  62. style="
  63. width: 10px;
  64. height: 10px;
  65. border-radius: 50%;
  66. background-color: green;
  67. position: relative;
  68. top: 12px;
  69. margin-right: 5px;
  70. "
  71. :style="
  72. item.status == '0' ? 'backgroundColor:green' : 'backgroundColor:red'
  73. "
  74. >{{ item.value }}</span
  75. ><span>{{ item.nickMame }}</span>
  76. </div>
  77. </el-option>
  78. </el-select>
  79. </el-form-item>
  80. <el-form-item label="商品名称" prop="itemTitle">
  81. <el-input
  82. placeholder="请输入商品名称"
  83. style="width: 240px"
  84. v-model="queryParams.itemTitle"
  85. >
  86. </el-input>
  87. </el-form-item>
  88. <el-form-item label="商品ID" prop="itemId">
  89. <el-input
  90. placeholder="请输入商品ID"
  91. style="width: 240px"
  92. v-model="queryParams.itemId"
  93. >
  94. </el-input>
  95. </el-form-item>
  96. <el-form-item label="达人名称" prop="promoterNickName">
  97. <el-input
  98. placeholder="请输入达人名称"
  99. style="width: 240px"
  100. v-model="queryParams.promoterNickName"
  101. >
  102. </el-input>
  103. </el-form-item>
  104. <el-form-item label="达人ID" prop="promoterId">
  105. <el-input
  106. placeholder="请输入达人ID"
  107. style="width: 240px"
  108. v-model="queryParams.promoterId"
  109. >
  110. </el-input>
  111. </el-form-item>
  112. <el-form-item label="电话号码" prop="promoterPhone">
  113. <el-input
  114. placeholder="请输入电话号码"
  115. style="width: 240px"
  116. v-model="queryParams.promoterPhone"
  117. >
  118. </el-input>
  119. </el-form-item>
  120. <el-form-item
  121. label="收货人"
  122. prop="consignee"
  123. v-if="queryParams.collectSampleStatus == '3'"
  124. >
  125. <el-input
  126. placeholder="请输入收货人"
  127. style="width: 240px"
  128. v-model="queryParams.consignee"
  129. >
  130. </el-input>
  131. </el-form-item>
  132. <el-form-item>
  133. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
  134. >搜索</el-button
  135. >
  136. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  137. </el-form-item>
  138. </el-form>
  139. <!-- <el-row :gutter="10" class="mb8">
  140. <el-col :span="1.5">
  141. <el-button
  142. type="primary"
  143. plain
  144. icon="el-icon-document-add"
  145. size="mini"
  146. @click="addNew"
  147. >新增商品</el-button
  148. >
  149. </el-col>
  150. </el-row> -->
  151. <el-button
  152. type="primary"
  153. plain
  154. size="mini"
  155. @click="addNew"
  156. style="margin-bottom: 15px"
  157. >导出</el-button
  158. >
  159. <el-tabs v-model="queryParams.collectSampleStatus" @tab-click="handleClick">
  160. <el-tab-pane
  161. :label="item.label"
  162. :name="item.value"
  163. v-for="(item, index) in queryParamsList.tagList"
  164. :key="index"
  165. >
  166. <el-button
  167. type="primary"
  168. plain
  169. size="mini"
  170. @click="batchProcess"
  171. v-if="queryParams.collectSampleStatus == 1"
  172. style="margin-bottom: 15px"
  173. >批量审核</el-button
  174. >
  175. <el-table
  176. v-loading="loading"
  177. :data="typeList"
  178. ref="multipleTable"
  179. @selection-change="handleSelectionChange"
  180. style="width: 100%"
  181. :row-key="getRowKeys"
  182. @sort-change="sortChange"
  183. >
  184. <el-table-column
  185. type="selection"
  186. width="50"
  187. align="center"
  188. v-show="queryParams.collectSampleStatus == '3'"
  189. />
  190. <el-table-column
  191. label="商品名称"
  192. align="center"
  193. prop="itemTitle"
  194. width="300"
  195. fixed="left"
  196. >
  197. <template slot-scope="scope">
  198. <div style="display: flex; width: 100%">
  199. <div style="width: 40%">
  200. <img
  201. :src="scope.row.itemImgUrl"
  202. alt=""
  203. style="width: 70px; height: auto"
  204. />
  205. </div>
  206. <div style="width: 60%" class="item-name-calss">
  207. <a
  208. style="
  209. text-overflow: ellipsis;
  210. white-space: nowrap;
  211. overflow: hidden;
  212. width: 100%;
  213. "
  214. :title="scope.row.itemTitle"
  215. >
  216. {{ scope.row.itemTitle }}
  217. </a>
  218. <p>商品Id: {{ scope.row.itemId }}</p>
  219. <p>
  220. 商品单价:
  221. {{ scope.row.itemPrice / 100 }}元
  222. </p>
  223. <p>
  224. 佣金率:
  225. {{
  226. scope.row.commissionRate ? scope.row.commissionRate / 10 + "%" : "-"
  227. }}
  228. </p>
  229. </div>
  230. </div>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. label="达人名称"
  235. align="center"
  236. prop="promoterNickName"
  237. width="300"
  238. >
  239. <template slot-scope="scope">
  240. <div style="display: flex; width: 100%">
  241. <div style="width: 40%">
  242. <el-popover
  243. placement="top"
  244. title=""
  245. trigger="hover"
  246. @show="getPromoterInfo(scope.row)"
  247. >
  248. <el-skeleton
  249. style="width: 300px"
  250. :loading="loadingPromoterInfo"
  251. animated
  252. >
  253. <template slot="template">
  254. <el-skeleton-item
  255. variant="image"
  256. style="width: 300px; height: 240px"
  257. />
  258. <div style="padding: 14px">
  259. <el-skeleton-item variant="h3" style="width: 50%" />
  260. <div
  261. style="
  262. display: flex;
  263. align-items: center;
  264. justify-items: space-between;
  265. margin-top: 16px;
  266. height: 16px;
  267. "
  268. >
  269. <el-skeleton-item variant="text" style="margin-right: 16px" />
  270. <el-skeleton-item variant="text" style="width: 30%" />
  271. </div>
  272. </div>
  273. </template>
  274. <template>
  275. <el-card v-if="promoterInfo">
  276. <div style="display: flex; width: 100%">
  277. <div style="width: 40%">
  278. <img
  279. :src="promoterInfo.promoterUrl"
  280. alt=""
  281. style="width: 100%; height: auto"
  282. />
  283. </div>
  284. <div
  285. style="width: 60%; margin-left: 15px; padding: 10px 0"
  286. class="item-name-calss"
  287. >
  288. <a
  289. style="
  290. text-overflow: ellipsis;
  291. white-space: nowrap;
  292. overflow: hidden;
  293. width: 100%;
  294. "
  295. :title="scope.row.promoterNickName"
  296. >
  297. {{ scope.row.promoterNickName }}
  298. </a>
  299. <p>达人Id: {{ scope.row.promoterId }}</p>
  300. </div>
  301. </div>
  302. <div class="show-main">
  303. <div style="width: 40%">
  304. <p class="p-main">
  305. {{
  306. promoterInfo.orderAmount
  307. ? allMoney(promoterInfo.orderAmount / 100)
  308. : ""
  309. }}
  310. </p>
  311. <p class="p-title">近30天睿选GMV</p>
  312. </div>
  313. <div style="width: 40%">
  314. <p class="p-main">
  315. {{ promoterInfo.operationCompletionRate }}
  316. </p>
  317. <p class="p-title">作业完成率</p>
  318. </div>
  319. </div>
  320. <div class="show-main">
  321. <div style="width: 40%">
  322. <p class="p-main">{{ promoterInfo.videoSales }}</p>
  323. <p class="p-title">短视频销售额</p>
  324. </div>
  325. <div style="width: 40%">
  326. <p class="p-main">
  327. {{ promoterInfo.avgVideoSales }}
  328. </p>
  329. <p class="p-title">单视频销售额</p>
  330. </div>
  331. </div>
  332. </el-card>
  333. </template>
  334. </el-skeleton>
  335. <img
  336. slot="reference"
  337. :src="scope.row.promoterUrl"
  338. alt=""
  339. style="width: 70px; height: auto"
  340. />
  341. </el-popover>
  342. </div>
  343. <div style="width: 60%" class="item-name-calss">
  344. <a
  345. style="
  346. text-overflow: ellipsis;
  347. white-space: nowrap;
  348. overflow: hidden;
  349. width: 100%;
  350. "
  351. :title="scope.row.promoterNickName"
  352. @click="toIndexDetails(scope.row)"
  353. >
  354. {{ scope.row.promoterNickName }}
  355. </a>
  356. <p>达人Id: {{ scope.row.promoterId }}</p>
  357. </div>
  358. </div>
  359. </template>
  360. </el-table-column>
  361. <el-table-column
  362. label="领样人"
  363. align="center"
  364. prop="collectSampleName"
  365. width="150"
  366. >
  367. <template slot-scope="scope">
  368. <div v-if="!!scope.row.collectSampleName">
  369. {{ scope.row.collectSampleName }}
  370. <a
  371. v-if="
  372. $store.getters.roles[0] == 'admin' ||
  373. $store.getters.roles[0] == 'associationManager' ||
  374. $store.getters.roles[0] == 'bdManager'
  375. "
  376. style="text-align: center"
  377. @click="getUserList(scope.row)"
  378. >编辑</a
  379. >
  380. <a
  381. v-if="scope.row.sampleVoucherStatus == 2"
  382. style="text-align: center"
  383. @click="
  384. lookImageVisible = true;
  385. lookImage = scope.row.sampleVoucher;
  386. "
  387. >查看凭证</a
  388. >
  389. </div>
  390. <div v-else>-</div>
  391. </template>
  392. </el-table-column>
  393. <el-table-column
  394. label="商品创建人"
  395. align="center"
  396. prop="itemCreateName"
  397. width="150"
  398. >
  399. </el-table-column>
  400. <el-table-column
  401. label="收货人"
  402. align="center"
  403. prop="consignee"
  404. width="150"
  405. v-if="queryParams.collectSampleStatus == '3'"
  406. >
  407. </el-table-column>
  408. <el-table-column
  409. label="领样备注"
  410. align="center"
  411. prop="sampleRequirement"
  412. width="150"
  413. >
  414. <template slot-scope="scope">
  415. <div v-if="!!scope.row.sampleRequirement">
  416. {{ scope.row.sampleRequirement }}
  417. </div>
  418. <div v-else>-</div>
  419. </template>
  420. </el-table-column>
  421. <el-table-column label="样品数量" align="center" prop="sampleCount" width="150">
  422. <template slot-scope="scope">
  423. <div v-if="!!scope.row.sampleCount">
  424. {{ scope.row.sampleCount }}
  425. </div>
  426. <div v-else>-</div>
  427. </template>
  428. </el-table-column>
  429. <el-table-column
  430. label="快递单号"
  431. align="center"
  432. prop="courierNumber"
  433. width="150"
  434. v-if="queryParams.collectSampleStatus == '4'"
  435. >
  436. <template slot-scope="scope">
  437. <div v-if="!!scope.row.courierNumber">
  438. {{ scope.row.courierNumber }}
  439. </div>
  440. <div v-else>-</div>
  441. </template>
  442. </el-table-column>
  443. <el-table-column
  444. label="单号更新时间"
  445. align="center"
  446. prop="courierNumberTime"
  447. width="150"
  448. v-if="queryParams.collectSampleStatus == '4'"
  449. sortable="custom"
  450. >
  451. <template slot-scope="scope">
  452. <div v-if="!!scope.row.courierNumberTime">
  453. {{ scope.row.courierNumberTime | formatDate("yyyy-MM-dd HH:mm:ss") }}
  454. </div>
  455. <div v-else>-</div>
  456. </template>
  457. </el-table-column>
  458. <el-table-column
  459. label="达人单品出单量"
  460. align="center"
  461. prop="promoterOrderNum"
  462. width="150"
  463. >
  464. <template slot-scope="scope">
  465. <div v-if="!!scope.row.promoterOrderNum">
  466. {{ scope.row.promoterOrderNum }}
  467. </div>
  468. <div v-else>-</div>
  469. </template>
  470. </el-table-column>
  471. <el-table-column
  472. label="达人出单量"
  473. align="center"
  474. prop="validOrderNum"
  475. width="150"
  476. >
  477. <template slot-scope="scope">
  478. <div v-if="!!scope.row.validOrderNum">
  479. {{ scope.row.validOrderNum }}
  480. </div>
  481. <div v-else>-</div>
  482. </template>
  483. </el-table-column>
  484. <el-table-column
  485. label="达人出单金额"
  486. align="center"
  487. prop="validAmount"
  488. width="150"
  489. >
  490. <template slot-scope="scope">
  491. <div v-if="!!scope.row.validAmount">
  492. {{ scope.row.validAmount ? allMoney(scope.row.validAmount / 100) : "" }}
  493. </div>
  494. <div v-else>-</div>
  495. </template>
  496. </el-table-column>
  497. <!-- <el-table-column label="领样人数" align="center" prop="sampleCount">
  498. <template slot-scope="scope">
  499. <div v-if="!!scope.row.sampleCount">
  500. {{ scope.row.sampleCount }}
  501. </div>
  502. <div v-else>-</div>
  503. </template>
  504. </el-table-column>
  505. <el-table-column label="领样份数" align="center" prop="sampleCount">
  506. <template slot-scope="scope">
  507. <div v-if="!!scope.row.sampleCount">
  508. {{ scope.row.sampleCount }}
  509. </div>
  510. <div v-else>-</div>
  511. </template>
  512. </el-table-column> -->
  513. <el-table-column
  514. label="状态"
  515. align="center"
  516. prop="collectSampleStatus"
  517. width="150"
  518. >
  519. <template slot-scope="scope">
  520. <div v-if="!!scope.row.collectSampleStatus">
  521. {{ scope.row.collectSampleStatus | collectSampleStatusName }}
  522. </div>
  523. <div v-else>-</div>
  524. </template>
  525. </el-table-column>
  526. <el-table-column
  527. label="备注"
  528. align="center"
  529. prop="collectSampleDesc"
  530. width="150"
  531. >
  532. <template slot-scope="scope">
  533. <div
  534. v-if="
  535. !!scope.row.collectSampleDesc &&
  536. (scope.row.collectSampleStatus == 2 ||
  537. scope.row.collectSampleStatus == 5)
  538. "
  539. >
  540. {{ scope.row.collectSampleDesc }}
  541. </div>
  542. <div v-else>-</div>
  543. </template>
  544. </el-table-column>
  545. <el-table-column
  546. label="创建时间"
  547. align="center"
  548. prop="createTime"
  549. width="150"
  550. sortable="custom"
  551. >
  552. <template slot-scope="scope">
  553. <div v-if="!!scope.row.createTime">
  554. {{ scope.row.createTime }}
  555. </div>
  556. <div v-else>-</div>
  557. </template>
  558. </el-table-column>
  559. <el-table-column
  560. label="拒绝原因"
  561. align="center"
  562. prop="refuseDetail"
  563. v-if="queryParams.collectSampleStatus == 3"
  564. >
  565. <template slot-scope="scope">
  566. <div v-if="!!scope.row.refuseDetail">
  567. {{ scope.row.refuseDetail }}
  568. </div>
  569. <div v-else>-</div>
  570. </template>
  571. </el-table-column>
  572. <el-table-column
  573. label="操作"
  574. align="center"
  575. class-name="small-padding fixed-width"
  576. width="250px"
  577. fixed="right"
  578. >
  579. <template slot-scope="scope">
  580. <el-button
  581. size="mini"
  582. type="text"
  583. @click="okInfomation(scope.row)"
  584. v-if="
  585. queryParams.collectSampleStatus == '1' &&
  586. ($store.getters.roles[0] == 'admin' ||
  587. $store.getters.roles[0] == 'supplyChainAdmin' ||
  588. $store.getters.roles[0] == 'courtship' ||
  589. $store.getters.roles[0] == 'courtshipManager')
  590. "
  591. :disabled="
  592. $store.getters.roles[0] != 'admin' &&
  593. $store.getters.roles[0] != 'supplyChainAdmin' &&
  594. $store.getters.roles[0] != 'courtship' &&
  595. $store.getters.roles[0] != 'courtshipManager'
  596. "
  597. >通过</el-button
  598. >
  599. <el-button
  600. size="mini"
  601. type="text"
  602. @click="
  603. ids = scope.row.id;
  604. refuseInfo = '';
  605. refuseVisible = true;
  606. "
  607. v-if="
  608. (queryParams.collectSampleStatus == '1' ||
  609. queryParams.collectSampleStatus == '3') &&
  610. ($store.getters.roles[0] == 'admin' ||
  611. $store.getters.roles[0] == 'supplyChainAdmin' ||
  612. $store.getters.roles[0] == 'courtship' ||
  613. $store.getters.roles[0] == 'courtshipManager')
  614. "
  615. >拒绝</el-button
  616. >
  617. <el-button
  618. size="mini"
  619. type="text"
  620. @click="deleteInfomation(scope.row)"
  621. v-if="
  622. queryParams.collectSampleStatus == '1' &&
  623. scope.row.collectSampleId == $store.getters.userId
  624. "
  625. >作废</el-button
  626. >
  627. <el-button
  628. size="mini"
  629. type="text"
  630. @click="handleAddbroadcast(scope.row)"
  631. v-if="queryParams.collectSampleStatus == '3'"
  632. :disabled="
  633. $store.getters.roles[0] != 'admin' &&
  634. $store.getters.roles[0] != 'supplyChainAdmin' &&
  635. $store.getters.roles[0] != 'courtship' &&
  636. $store.getters.roles[0] != 'courtshipManager'
  637. "
  638. >录入单号</el-button
  639. >
  640. <el-button
  641. size="mini"
  642. type="text"
  643. @click="toUpdateTask(scope.row)"
  644. v-if="queryParams.collectSampleStatus == '3'"
  645. >上传作业</el-button
  646. >
  647. <el-button
  648. size="mini"
  649. type="text"
  650. @click="
  651. workVisible = true;
  652. noticeContent = '';
  653. ids = scope.row.id;
  654. "
  655. v-if="queryParams.collectSampleStatus == '5'"
  656. :disabled="
  657. $store.getters.roles[0] != 'admin' &&
  658. $store.getters.roles[0] != 'supplyChainAdmin' &&
  659. $store.getters.roles[0] != 'bdManager' &&
  660. $store.getters.roles[0] != 'bd' &&
  661. $store.getters.roles[0] != 'association' &&
  662. $store.getters.roles[0] != 'associationManager'
  663. "
  664. >上传作业</el-button
  665. >
  666. <el-button
  667. size="mini"
  668. type="text"
  669. @click="
  670. workLookVisible = true;
  671. ids = scope.row.id;
  672. showWork = scope.row.taskFileUrl;
  673. "
  674. :disabled="!scope.row.taskFileUrl"
  675. v-if="
  676. queryParams.collectSampleStatus == '6' ||
  677. queryParams.collectSampleStatus == '5'
  678. "
  679. >查看作业</el-button
  680. >
  681. <el-button
  682. size="mini"
  683. type="text"
  684. @click="copyInfomation(scope.row)"
  685. v-if="queryParams.collectSampleStatus == '3'"
  686. >复制</el-button
  687. >
  688. <el-button
  689. slot="reference"
  690. size="mini"
  691. type="text"
  692. style="margin-right: 5px"
  693. @click="updateKd(scope.row)"
  694. v-if="queryParams.collectSampleStatus == '4'"
  695. :disabled="
  696. $store.getters.roles[0] != 'admin' &&
  697. $store.getters.roles[0] != 'supplyChainAdmin' &&
  698. $store.getters.roles[0] != 'courtship' &&
  699. $store.getters.roles[0] != 'courtshipManager'
  700. "
  701. >修改单号</el-button
  702. >
  703. <el-popover
  704. placement="top"
  705. title=""
  706. trigger="hover"
  707. @show="courierNumberInfo(scope.row)"
  708. >
  709. <el-skeleton
  710. style="width: 500px"
  711. :loading="loadingCourierNumber"
  712. animated
  713. >
  714. <template slot="template">
  715. <div style="padding: 14px">
  716. <el-skeleton-item variant="h3" style="width: 50%" />
  717. <div
  718. style="
  719. display: flex;
  720. align-items: center;
  721. justify-items: space-between;
  722. margin-top: 16px;
  723. height: 16px;
  724. "
  725. >
  726. <el-skeleton-item variant="text" style="margin-right: 16px" />
  727. <el-skeleton-item variant="text" style="width: 30%" />
  728. </div>
  729. </div>
  730. </template>
  731. <template>
  732. <el-card v-if="courierInfo">
  733. <div
  734. style="width: 100%; max-height: 500px; overflow: auto"
  735. class="item-name-calss dh-data"
  736. v-if="
  737. !!courierInfo.expressData && courierInfo.expressData.length > 0
  738. "
  739. >
  740. <timeline :reverse="false">
  741. <timeline-item
  742. v-for="(activity, index) in courierInfo.expressData"
  743. :key="index"
  744. :timestamp="activity.ftime"
  745. >
  746. {{ activity.context }}
  747. </timeline-item>
  748. </timeline>
  749. </div>
  750. <div v-else>
  751. <el-empty description="暂无数据"></el-empty>
  752. </div>
  753. </el-card>
  754. <el-card v-else>
  755. <el-empty description="暂无数据"></el-empty>
  756. </el-card>
  757. </template>
  758. </el-skeleton>
  759. <el-button
  760. slot="reference"
  761. size="mini"
  762. type="text"
  763. style="margin-right: 5px"
  764. v-if="queryParams.collectSampleStatus == '4'"
  765. >物流详情</el-button
  766. >
  767. </el-popover>
  768. <el-button
  769. size="mini"
  770. style="margin-left: 5px"
  771. type="text"
  772. @click="toDetail(scope.row)"
  773. >详情</el-button
  774. >
  775. </template>
  776. </el-table-column>
  777. </el-table>
  778. <pagination
  779. v-show="total > 0"
  780. :total="total"
  781. :page.sync="queryParams.pageNum"
  782. :limit.sync="queryParams.pageSize"
  783. @pagination="getList"
  784. />
  785. </el-tab-pane>
  786. </el-tabs>
  787. <!-- 添加直播 -->
  788. <el-dialog
  789. title="录入订单"
  790. :visible.sync="openAllocation"
  791. width="800px"
  792. append-to-body
  793. :close-on-click-modal="false"
  794. >
  795. <el-form
  796. ref="formBroadcast"
  797. :model="formBroadcast"
  798. :rules="rulesBroadcast"
  799. label-width="100px"
  800. :inline="true"
  801. >
  802. <el-form-item label="选择快递公司" prop="companyCode">
  803. <el-select v-model="formBroadcast.companyCode" placeholder="请选择">
  804. <el-option
  805. v-for="item in superiorList"
  806. :key="item.code"
  807. :label="item.name"
  808. :value="item.code"
  809. >
  810. </el-option>
  811. </el-select>
  812. </el-form-item>
  813. <el-form-item label="快递单号" prop="courierNumber">
  814. <el-input
  815. placeholder="请输入快递单号"
  816. style="width: 240px"
  817. v-model.trim="formBroadcast.courierNumber"
  818. >
  819. </el-input>
  820. </el-form-item>
  821. </el-form>
  822. <div slot="footer" class="dialog-footer">
  823. <el-button type="primary" @click="submitFormBroadcast" :loading="confirmLoading"
  824. >确 定</el-button
  825. >
  826. <el-button
  827. @click="
  828. confirmLoading = false;
  829. openAllocation = false;
  830. formBroadcast = {};
  831. "
  832. >取 消</el-button
  833. >
  834. </div>
  835. </el-dialog>
  836. <!-- 审核拒绝 -->
  837. <el-dialog
  838. title="拒绝原因"
  839. :visible.sync="refuseVisible"
  840. width="500px"
  841. append-to-body
  842. :close-on-click-modal="false"
  843. >
  844. <el-input
  845. placeholder="请输入拒绝原因"
  846. style="width: 100%"
  847. type="textarea"
  848. :rows="2"
  849. v-model="refuseInfo"
  850. >
  851. </el-input>
  852. <div slot="footer" class="dialog-footer">
  853. <el-button type="primary" @click="submitRefuse" :loading="refuseLoading"
  854. >确 定</el-button
  855. >
  856. <el-button
  857. @click="
  858. refuseLoading = false;
  859. refuseVisible = false;
  860. refuseInfo = null;
  861. "
  862. >取 消</el-button
  863. >
  864. </div>
  865. </el-dialog>
  866. <!-- 上传作业 -->
  867. <el-dialog
  868. title="上传作业"
  869. :visible.sync="workVisible"
  870. width="500px"
  871. append-to-body
  872. :close-on-click-modal="false"
  873. >
  874. <uploadEditor
  875. v-model="noticeContent"
  876. style="min-height: 100px"
  877. v-if="workVisible"
  878. />
  879. <div slot="footer" class="dialog-footer">
  880. <el-button type="primary" @click="workUpload" :loading="workLoading"
  881. >确 定</el-button
  882. >
  883. <el-button
  884. @click="
  885. workLoading = false;
  886. workVisible = false;
  887. noticeContent = '';
  888. "
  889. >取 消</el-button
  890. >
  891. </div>
  892. </el-dialog>
  893. <!-- 查看作业 -->
  894. <el-dialog
  895. title="查看作业"
  896. :visible.sync="workLookVisible"
  897. width="900px"
  898. append-to-body
  899. center
  900. :close-on-click-modal="false"
  901. >
  902. <div v-html="showWork" style="width: 100%; overflow: auto"></div>
  903. <el-dialog
  904. width="30%"
  905. title="拒绝原因"
  906. :visible.sync="innerVisible"
  907. append-to-body
  908. center
  909. :close-on-click-modal="false"
  910. >
  911. <el-input
  912. placeholder="请输入拒绝原因"
  913. style="width: 100%"
  914. type="textarea"
  915. :rows="2"
  916. v-model="innerInfo"
  917. >
  918. </el-input>
  919. <div
  920. slot="footer"
  921. class="dialog-footer"
  922. v-if="
  923. $store.getters.roles[0] == 'admin' ||
  924. $store.getters.roles[0] == 'supplyChainAdmin' ||
  925. $store.getters.roles[0] == 'courtship' ||
  926. $store.getters.roles[0] == 'courtshipManager'
  927. "
  928. >
  929. <el-button type="primary" @click="workReject" :loading="workLookLoading"
  930. >确 定</el-button
  931. >
  932. <el-button
  933. @click="
  934. innerVisible = false;
  935. innerInfo = null;
  936. "
  937. >取 消</el-button
  938. >
  939. </div>
  940. </el-dialog>
  941. <div
  942. slot="footer"
  943. class="dialog-footer"
  944. v-if="
  945. ($store.getters.roles[0] == 'admin' ||
  946. $store.getters.roles[0] == 'supplyChainAdmin' ||
  947. $store.getters.roles[0] == 'courtship' ||
  948. $store.getters.roles[0] == 'courtshipManager') &&
  949. queryParams.collectSampleStatus == '6'
  950. "
  951. >
  952. <el-button type="primary" @click="workLookUpload" :loading="workLookLoading"
  953. >通 过</el-button
  954. >
  955. <el-button
  956. @click="
  957. innerVisible = true;
  958. innerInfo = null;
  959. "
  960. >拒 绝</el-button
  961. >
  962. </div>
  963. </el-dialog>
  964. <!-- 查看凭证 -->
  965. <el-dialog
  966. title="查看凭证"
  967. :visible.sync="lookImageVisible"
  968. width="500px"
  969. append-to-body
  970. :close-on-click-modal="false"
  971. @before-close="
  972. lookImageVisible = false;
  973. lookImage = undefined;
  974. "
  975. >
  976. <img :src="lookImage" style="width: 100%; height: auto" alt="" />
  977. </el-dialog>
  978. <!-- 上传作业 -->
  979. <el-dialog
  980. title="修改领样人"
  981. :visible.sync="editUserIdVisible"
  982. width="500px"
  983. append-to-body
  984. :close-on-click-modal="false"
  985. >
  986. <el-form
  987. ref="formUser"
  988. :model="formUser"
  989. :rules="formUserRules"
  990. label-width="100px"
  991. :inline="true"
  992. >
  993. <el-form-item label="选择人员" prop="userData">
  994. <el-select
  995. v-model="formUser.userData"
  996. placeholder="请选择"
  997. clearable
  998. filterable
  999. >
  1000. <el-option
  1001. v-for="item in userList"
  1002. :key="item.code"
  1003. :label="item.userName"
  1004. :value="item.userId + '@' + item.userName"
  1005. >
  1006. </el-option>
  1007. </el-select>
  1008. </el-form-item>
  1009. </el-form>
  1010. <div slot="footer" class="dialog-footer">
  1011. <el-button type="primary" @click="submitFormUser" :loading="confirmLoading"
  1012. >确 定</el-button
  1013. >
  1014. <el-button
  1015. @click="
  1016. confirmLoading = false;
  1017. editUserIdVisible = false;
  1018. formUser = {};
  1019. "
  1020. >取 消</el-button
  1021. >
  1022. </div>
  1023. </el-dialog>
  1024. </div>
  1025. </template>
  1026. <script>
  1027. // import { refreshCache } from "@/api/system/dict/type";
  1028. import uploadEditor from "./uploadEditor.vue";
  1029. import { downFilePost } from "@/api/supplyChain/supplyChain";
  1030. import Timeline from "./timeline/index.js";
  1031. import TimelineItem from "./timeline-item/index.js";
  1032. import {
  1033. getCity,
  1034. checkItem,
  1035. editPreview,
  1036. getList,
  1037. getCompany,
  1038. getPromoterInfo,
  1039. copyInfo,
  1040. courierNumberInfo,
  1041. removePreview,
  1042. updateCourierNumber,
  1043. toUpdateTask,
  1044. batchProcess,
  1045. updatePreview,
  1046. getUserList,
  1047. } from "@/api/goodsManagement/goods";
  1048. import { getSupplyChainUserList } from "@/api/supplyChain/supplyChain";
  1049. import selectTree from "./selectTree.vue";
  1050. export default {
  1051. name: "SamplingList",
  1052. components: {
  1053. selectTree,
  1054. uploadEditor,
  1055. Timeline,
  1056. TimelineItem,
  1057. },
  1058. data() {
  1059. const equalToPassword = (rule, value, callback) => {
  1060. if (!!value && !this.edit) {
  1061. checkItem({ itemId: value }).then((res) => {
  1062. if (res.message == "true") {
  1063. callback();
  1064. } else {
  1065. callback(new Error(res.message));
  1066. }
  1067. });
  1068. } else {
  1069. callback();
  1070. }
  1071. };
  1072. return {
  1073. editUserIdVisible: false,
  1074. userList: [],
  1075. lookImageVisible: false,
  1076. lookImage: undefined,
  1077. noticeContent: "",
  1078. workVisible: false,
  1079. workLookVisible: false,
  1080. innerVisible: false,
  1081. innerInfo: null,
  1082. // 遮罩层
  1083. loading: true,
  1084. // 选中数组
  1085. ids: null,
  1086. // 非单个禁用
  1087. single: true,
  1088. // 非多个禁用
  1089. multiple: true,
  1090. // 显示搜索条件
  1091. showSearch: true,
  1092. // 总条数
  1093. total: 0,
  1094. // 字典表格数据
  1095. typeList: [],
  1096. //上传文件类型
  1097. fileType: [".doc", ".xls", ".xlsx", ".ppt", ".pdf", ".csv"],
  1098. // 弹出层标题
  1099. title: "",
  1100. // 是否显示弹出层
  1101. open: false,
  1102. openFp: false,
  1103. formFp: {},
  1104. // 是否可编辑
  1105. edit: false,
  1106. // 分配销售
  1107. openAllocation: false,
  1108. // 选择的销售id
  1109. saleId: undefined,
  1110. // 销售列表
  1111. saleList: [],
  1112. // 分配销售确定loading
  1113. confirmLoadingSale: false,
  1114. // 日期范围
  1115. dateRange: [],
  1116. superiorList: [],
  1117. // 查询参数
  1118. queryParams: {
  1119. pageNum: 1,
  1120. pageSize: 10,
  1121. itemTitle: undefined,
  1122. itemId: undefined,
  1123. promoterNickName: undefined,
  1124. promoterId: undefined,
  1125. collectSampleStatus: "",
  1126. promoterPhone: undefined,
  1127. consignee: undefined,
  1128. itemCreateId: undefined,
  1129. collectSampleId: undefined,
  1130. },
  1131. //页面所有的下拉数据
  1132. queryParamsList: {
  1133. tagList: [
  1134. { value: "", label: "全部" },
  1135. { value: "1", label: "待审核" },
  1136. { value: "3", label: "待录入单号" },
  1137. { value: "4", label: "已发货" },
  1138. { value: "5", label: "待上传作业" },
  1139. { value: "6", label: "待审核作业" },
  1140. { value: "2", label: "审核拒绝" },
  1141. { value: "7", label: "审核通过" },
  1142. ],
  1143. personList: [],
  1144. },
  1145. // 表单参数
  1146. form: {},
  1147. formUserRules: {
  1148. userData: {
  1149. required: true,
  1150. message: "人员必选",
  1151. trigger: "change",
  1152. },
  1153. },
  1154. formUser: {},
  1155. formBroadcast: {},
  1156. //上传报表下拉数据
  1157. formList: {},
  1158. fileList: [],
  1159. accept: "",
  1160. //获取销售线索文件流
  1161. dateFile: new FormData(),
  1162. //销售线索上传loading
  1163. confirmLoading: false,
  1164. // 表单校验
  1165. rules: {},
  1166. rulesBroadcast: {
  1167. companyCode: {
  1168. required: true,
  1169. message: "快递公司必选",
  1170. trigger: "change",
  1171. },
  1172. courierNumber: {
  1173. required: true,
  1174. message: "快递单号必填",
  1175. trigger: "blur",
  1176. },
  1177. },
  1178. // 分配销售展示列表
  1179. ksInfo: null,
  1180. userId: null,
  1181. refuseVisible: false,
  1182. refuseLoading: false,
  1183. workLoading: false,
  1184. workLookLoading: false,
  1185. showWork: null,
  1186. refuseInfo: null,
  1187. itemId: null,
  1188. promoterInfo: null,
  1189. loadingPromoterInfo: true,
  1190. loadingCourierNumber: true,
  1191. courierInfo: null,
  1192. okIds: [],
  1193. updateCourierNumberType: false,
  1194. prop: "t1.create_time",
  1195. sort: "desc",
  1196. };
  1197. },
  1198. activated() {
  1199. this.$nextTick(() => {
  1200. if (this.$route && this.$route.query.promoterId) {
  1201. this.$set(this.queryParams, "promoterId", this.$route.query.promoterId);
  1202. } else {
  1203. this.$set(this.queryParams, "promoterId", undefined);
  1204. }
  1205. this.getPersonList();
  1206. if (localStorage.getItem("samplingType")) {
  1207. this.$set(
  1208. this.queryParams,
  1209. "collectSampleStatus",
  1210. localStorage.getItem("samplingType")
  1211. );
  1212. } else {
  1213. // this.queryParams.collectSampleStatus = "1";
  1214. }
  1215. this.getList();
  1216. });
  1217. },
  1218. created() {
  1219. this.userId = this.$store.getters.userId;
  1220. this.getPersonList();
  1221. if (this.$route && this.$route.query.promoterId) {
  1222. this.$set(this.queryParams, "promoterId", this.$route.query.promoterId);
  1223. } else {
  1224. this.$set(this.queryParams, "promoterId", undefined);
  1225. }
  1226. this.$nextTick(() => {
  1227. if (localStorage.getItem("samplingType")) {
  1228. this.$set(
  1229. this.queryParams,
  1230. "collectSampleStatus",
  1231. localStorage.getItem("samplingType")
  1232. );
  1233. } else {
  1234. // this.queryParams.collectSampleStatus = "1";
  1235. }
  1236. this.getList();
  1237. });
  1238. },
  1239. filters: {
  1240. activityItemStatusName(status) {
  1241. const statusMap = {
  1242. 1: "待审核",
  1243. 2: "已上架",
  1244. 3: "审核失败(拒绝)",
  1245. 4: "活动结束",
  1246. 5: "失效",
  1247. };
  1248. return statusMap[status];
  1249. },
  1250. collectSampleStatusName(value) {
  1251. let name = {
  1252. 1: "待审核",
  1253. 2: "领样申请审核拒绝",
  1254. 3: "待录入订单号",
  1255. 4: "已发货",
  1256. 5: "已签收待上传作业",
  1257. 6: "待招商审核",
  1258. 7: "审核通过",
  1259. };
  1260. return name[value];
  1261. },
  1262. formatDate: function (value, args) {
  1263. var dt = new Date(value);
  1264. if (args == "yyyy-M-d") {
  1265. // yyyy-M-d
  1266. let year = dt.getFullYear();
  1267. let month = dt.getMonth() + 1;
  1268. let date = dt.getDate();
  1269. return `${year}-${month}-${date}`;
  1270. } else if (args == "yyyy-M-d H:m:s") {
  1271. // yyyy-M-d H:m:s
  1272. let year = dt.getFullYear();
  1273. let month = dt.getMonth() + 1;
  1274. let date = dt.getDate();
  1275. let hour = dt.getHours();
  1276. let minute = dt.getMinutes();
  1277. let second = dt.getSeconds();
  1278. return `${year}-${month}-${date} ${hour}:${minute}:${second}`;
  1279. } else if (args == "yyyy-MM-dd") {
  1280. // yyyy-MM-dd
  1281. let year = dt.getFullYear();
  1282. let month = (dt.getMonth() + 1).toString().padStart(2, "0");
  1283. let date = dt.getDate().toString().padStart(2, "0");
  1284. return `${year}-${month}-${date}`;
  1285. } else {
  1286. // yyyy-MM-dd HH:mm:ss
  1287. let year = dt.getFullYear();
  1288. let month = (dt.getMonth() + 1).toString().padStart(2, "0");
  1289. let date = dt.getDate().toString().padStart(2, "0");
  1290. let hour = dt.getHours().toString().padStart(2, "0");
  1291. let minute = dt.getMinutes().toString().padStart(2, "0");
  1292. let second = dt.getSeconds().toString().padStart(2, "0");
  1293. return `${year}-${month}-${date} ${hour}:${minute}:${second}`;
  1294. }
  1295. },
  1296. },
  1297. methods: {
  1298. getUserList(item) {
  1299. getUserList({ userId: this.userId })
  1300. .then((res) => {
  1301. this.editUserIdVisible = true;
  1302. this.userList = res.data;
  1303. this.ids = item.id;
  1304. })
  1305. .catch(() => {});
  1306. },
  1307. submitFormUser() {
  1308. this.$refs["formUser"].validate((valid) => {
  1309. if (valid) {
  1310. this.confirmLoading = true;
  1311. let params = {};
  1312. params.collectSampleId = this.formUser.userData.split("@")[0];
  1313. params.collectSampleName = this.formUser.userData.split("@")[1];
  1314. params.id = this.ids;
  1315. updatePreview(params).then((res) => {
  1316. this.confirmLoading = false;
  1317. this.editUserIdVisible = false;
  1318. this.formUser = {};
  1319. this.getList();
  1320. this.$modal.msgSuccess("修改成功");
  1321. });
  1322. }
  1323. });
  1324. },
  1325. sortChange(col, prop, order) {
  1326. this.prop =
  1327. col.prop == "createTime"
  1328. ? "t1.create_time"
  1329. : col.prop == "courierNumberTime"
  1330. ? "t1.courier_number_time"
  1331. : "";
  1332. this.sort = !!col.order ? (col.order == "descending" ? "desc" : "asc") : "desc";
  1333. this.handleQuery();
  1334. },
  1335. toIndexDetails(item) {
  1336. let end = new Date();
  1337. let y = end.getFullYear();
  1338. let MM = end.getMonth() + 1;
  1339. MM = MM < 10 ? "0" + MM : MM;
  1340. let dd = end.getDate();
  1341. dd = dd < 10 ? "0" + dd : dd;
  1342. this.$router.replace({
  1343. path: "/supplyChain/indexDetails",
  1344. query: {
  1345. id: item.promoterId,
  1346. name: item.promoterNickName,
  1347. orderStartDate: `${y}-${MM}-${dd}`,
  1348. orderEndDate: `${y}-${MM}-${dd}`,
  1349. },
  1350. });
  1351. },
  1352. getRowKeys(row) {
  1353. return row.id;
  1354. },
  1355. batchProcess() {
  1356. if (this.okIds.length > 0) {
  1357. batchProcess({
  1358. ids: this.okIds,
  1359. status: 3,
  1360. userId: this.$store.getters.userId,
  1361. userName: this.$store.getters.name,
  1362. }).then((res) => {
  1363. this.okIds = [];
  1364. this.handleQuery();
  1365. this.$message.success(res.message);
  1366. });
  1367. } else {
  1368. this.$message.error("请选择领样");
  1369. }
  1370. },
  1371. getPersonList() {
  1372. getSupplyChainUserList().then((response) => {
  1373. this.queryParamsList.personList = response.rows;
  1374. });
  1375. },
  1376. handleSelectionChange(selection) {
  1377. this.okIds = selection.map((item) => item.id);
  1378. },
  1379. copyInfomation(item) {
  1380. copyInfo({ promoterId: item.promoterId }).then((res) => {
  1381. if (navigator.clipboard && window.isSecureContext) {
  1382. // 粉丝量: ${res.data.fansNumber}
  1383. // 总销售额: ${res.data.totalSale}
  1384. navigator.clipboard
  1385. .writeText(
  1386. `
  1387. 商品标题: ${item.itemTitle}
  1388. 领样备注: ${item.sampleRequirement}
  1389. 快手ID: ${item.promoterId}
  1390. 快手昵称: ${item.promoterNickName}
  1391. 收件人: ${item.consignee}
  1392. 手机号: ${item.promoterPhone}
  1393. 地址: ${item.promoterAddress}
  1394. `
  1395. )
  1396. .then(() => {
  1397. this.$message.success("复制成功");
  1398. })
  1399. .catch((err) => {
  1400. this.$message.error("复制失败");
  1401. });
  1402. } else {
  1403. // 创建text area
  1404. const textArea = document.createElement("textarea");
  1405. textArea.value = `
  1406. 商品标题: ${item.itemTitle}
  1407. 领样备注: ${item.sampleRequirement}
  1408. 快手ID: ${item.promoterId}
  1409. 快手昵称: ${item.promoterNickName}
  1410. 收件人: ${item.consignee}
  1411. 手机号: ${item.promoterPhone}
  1412. 地址: ${item.promoterAddress}
  1413. `;
  1414. // 使text area不在viewport,同时设置不可见
  1415. document.body.appendChild(textArea);
  1416. textArea.focus();
  1417. textArea.select();
  1418. return new Promise((resolve, reject) => {
  1419. // 执行复制命令并移除文本框
  1420. document.execCommand("copy") ? resolve() : reject(new Error("出错了"));
  1421. textArea.remove();
  1422. }).then(
  1423. () => {
  1424. this.$message.success("复制成功");
  1425. },
  1426. () => {
  1427. this.$message.error("复制失败");
  1428. }
  1429. );
  1430. }
  1431. });
  1432. },
  1433. toDetail(item) {
  1434. localStorage.setItem("samplingType", this.queryParams.collectSampleStatus);
  1435. this.$router.replace({
  1436. path: "/goodsManagement/detail",
  1437. query: {
  1438. id: item.id,
  1439. },
  1440. });
  1441. },
  1442. getPromoterInfo(item) {
  1443. this.loadingPromoterInfo = true;
  1444. getPromoterInfo({ promoterId: item.promoterId }).then((res) => {
  1445. if (res.code == 200) {
  1446. this.promoterInfo = res.data;
  1447. this.loadingPromoterInfo = false;
  1448. }
  1449. });
  1450. },
  1451. updateKd(item) {
  1452. this.$nextTick(() => {
  1453. this.ids = item.id;
  1454. this.openAllocation = true;
  1455. this.updateCourierNumberType = true;
  1456. getCompany().then((res) => {
  1457. this.superiorList = res;
  1458. });
  1459. });
  1460. },
  1461. courierNumberInfo(item) {
  1462. this.loadingCourierNumber = true;
  1463. courierNumberInfo({ courierNumber: item.courierNumber }).then((res) => {
  1464. if (res.code == 0) {
  1465. this.courierInfo = res.data
  1466. ? {
  1467. ...res.data,
  1468. expressData: JSON.parse(res.data.expressData),
  1469. }
  1470. : null;
  1471. this.loadingCourierNumber = false;
  1472. }
  1473. });
  1474. },
  1475. workReject() {
  1476. if (!!this.innerInfo) {
  1477. var params = {};
  1478. params.id = this.ids;
  1479. params.collectSampleStatus = 5;
  1480. params.collectSampleDesc = this.innerInfo;
  1481. params.userId = this.$store.getters.userId;
  1482. params.userName = this.$store.getters.name;
  1483. editPreview(params)
  1484. .then((res) => {
  1485. this.innerVisible = false;
  1486. this.innerInfo = null;
  1487. this.workLookVisible = false;
  1488. this.showWork = null;
  1489. this.getList();
  1490. this.$modal.msgSuccess("已拒绝");
  1491. })
  1492. .catch(() => {
  1493. this.$message.error("失败");
  1494. });
  1495. } else {
  1496. this.$message.error("请填写拒绝理由");
  1497. }
  1498. },
  1499. workLookUpload() {
  1500. var params = {};
  1501. params.id = this.ids;
  1502. params.collectSampleStatus = 7;
  1503. params.userId = this.$store.getters.userId;
  1504. params.userName = this.$store.getters.name;
  1505. editPreview(params)
  1506. .then((res) => {
  1507. this.innerVisible = false;
  1508. this.innerInfo = null;
  1509. this.workLookVisible = false;
  1510. this.showWork = null;
  1511. this.getList();
  1512. this.$modal.msgSuccess("审核通过");
  1513. })
  1514. .catch(() => {
  1515. this.$message.error("失败");
  1516. });
  1517. },
  1518. workUpload() {
  1519. this.workLoading = true;
  1520. if (!!this.noticeContent) {
  1521. var params = {};
  1522. params.id = this.ids;
  1523. params.taskFileUrl = this.noticeContent;
  1524. params.userId = this.$store.getters.userId;
  1525. params.userName = this.$store.getters.name;
  1526. editPreview(params)
  1527. .then((res) => {
  1528. this.workLoading = false;
  1529. this.workVisible = false;
  1530. this.getList();
  1531. this.$modal.msgSuccess("上传成功");
  1532. })
  1533. .catch(() => {
  1534. this.$message.error("失败");
  1535. });
  1536. } else {
  1537. this.$message.error("请上传作业");
  1538. }
  1539. },
  1540. submitRefuse(item) {
  1541. this.refuseLoading = true;
  1542. if (!!this.refuseInfo) {
  1543. var params = {};
  1544. params.id = this.ids;
  1545. params.collectSampleStatus = 2;
  1546. params.collectSampleDesc = this.refuseInfo;
  1547. params.userId = this.$store.getters.userId;
  1548. params.userName = this.$store.getters.name;
  1549. editPreview(params)
  1550. .then((res) => {
  1551. this.refuseLoading = false;
  1552. this.refuseVisible = false;
  1553. this.getList();
  1554. this.$modal.msgSuccess("已拒绝");
  1555. })
  1556. .catch(() => {
  1557. this.$message.error("失败");
  1558. });
  1559. } else {
  1560. this.$message.error("请填写拒绝理由");
  1561. }
  1562. },
  1563. deleteInfomation(item) {
  1564. this.$modal
  1565. .confirm(`请确认是否作废该领样?`)
  1566. .then(() => {
  1567. var params = {};
  1568. params.id = item.id;
  1569. removePreview(params)
  1570. .then((res) => {
  1571. this.getList();
  1572. this.$modal.msgSuccess("作废成功");
  1573. })
  1574. .catch(() => {
  1575. this.$message.error("失败");
  1576. });
  1577. })
  1578. .catch(() => {});
  1579. },
  1580. toUpdateTask(item) {
  1581. this.$modal.confirm(`请确认是否提交至待上传作业?`).then(() => {
  1582. var params = {};
  1583. params.id = item.id;
  1584. params.collectSampleStatus = 5;
  1585. params.userId = this.$store.getters.userId;
  1586. params.userName = this.$store.getters.name;
  1587. editPreview(params)
  1588. .then((res) => {
  1589. this.getList();
  1590. this.$modal.msgSuccess("审核通过");
  1591. })
  1592. .catch(() => {
  1593. this.$message.error("失败");
  1594. });
  1595. });
  1596. },
  1597. okInfomation(item) {
  1598. this.$modal
  1599. .confirm(`请确认是否审核通过该领样?`)
  1600. .then(() => {
  1601. var params = {};
  1602. params.id = item.id;
  1603. params.collectSampleStatus = 3;
  1604. params.userId = this.$store.getters.userId;
  1605. params.userName = this.$store.getters.name;
  1606. editPreview(params)
  1607. .then((res) => {
  1608. this.getList();
  1609. this.$modal.msgSuccess("审核通过");
  1610. })
  1611. .catch(() => {
  1612. this.$message.error("失败");
  1613. });
  1614. })
  1615. .catch(() => {});
  1616. },
  1617. loadNode(node, resolve) {
  1618. if (node.level === 0) {
  1619. return resolve([{ name: "region" }]);
  1620. }
  1621. if (node.level > 1) return resolve([]);
  1622. console.log(node);
  1623. getCity({ province: node.data.id }).then((res) => {
  1624. const data = res.map((item) => {
  1625. return {
  1626. id: item,
  1627. name: item,
  1628. };
  1629. });
  1630. resolve(data);
  1631. });
  1632. // setTimeout(() => {
  1633. // const data = [
  1634. // {
  1635. // name: "leaf",
  1636. // leaf: true,
  1637. // },
  1638. // {
  1639. // name: "zone",
  1640. // },
  1641. // ];
  1642. // resolve(data);
  1643. // }, 500);
  1644. },
  1645. handleNodeClick(val) {
  1646. console.log(val);
  1647. this.$set(this.formBroadcast, "postArea", val.id);
  1648. this.$set(this.formBroadcast, "postAreaName", val.name);
  1649. if (!val.children || val.children.length == 0) {
  1650. this.$refs.selectReport.blur();
  1651. }
  1652. },
  1653. handleClick() {
  1654. this.queryParams.pageNum = 1;
  1655. this.queryParams.consignee = undefined;
  1656. this.prop = "t1.create_time";
  1657. this.sort = "desc";
  1658. this.getList();
  1659. },
  1660. /** 查询字典类型列表 */
  1661. getList() {
  1662. this.loading = true;
  1663. getList({
  1664. userId: this.userId,
  1665. ...this.queryParams,
  1666. collectSampleStatus:
  1667. this.queryParams.collectSampleStatus == 0
  1668. ? ""
  1669. : this.queryParams.collectSampleStatus,
  1670. fieId: this.prop,
  1671. sort: this.sort,
  1672. }).then((response) => {
  1673. this.typeList = response.rows;
  1674. this.total = response.total;
  1675. this.loading = false;
  1676. });
  1677. },
  1678. // 取消按钮
  1679. cancel() {
  1680. this.open = false;
  1681. this.confirmLoading = false;
  1682. this.reset();
  1683. },
  1684. // 表单重置
  1685. reset() {
  1686. this.form = {};
  1687. this.dateFile = null;
  1688. this.resetForm("formBroadcast");
  1689. },
  1690. /** 搜索按钮操作 */
  1691. handleQuery() {
  1692. this.queryParams.pageNum = 1;
  1693. this.getList();
  1694. },
  1695. /** 重置按钮操作 */
  1696. resetQuery() {
  1697. this.dateRange = [];
  1698. this.resetForm("queryForm");
  1699. this.queryParams.consignee = undefined;
  1700. this.handleQuery();
  1701. },
  1702. addNew() {
  1703. if (this.okIds.length > 0) {
  1704. downFilePost("/itemCollectSamples/exportCollectSamples", {
  1705. ids: this.okIds,
  1706. }).then((res) => {
  1707. let blob = new Blob([res], {
  1708. type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  1709. });
  1710. let downloadElement = document.createElement("a");
  1711. let href = window.URL.createObjectURL(blob); //创建下载的链接
  1712. downloadElement.href = href;
  1713. downloadElement.download = "领样详情.xlsx"; //下载后文件名
  1714. document.body.appendChild(downloadElement);
  1715. downloadElement.click(); //点击下载
  1716. document.body.removeChild(downloadElement); //下载完成移除元素
  1717. window.URL.revokeObjectURL(href); //释放掉blob对象
  1718. });
  1719. } else {
  1720. this.$message.error("请选择领样");
  1721. }
  1722. },
  1723. /** 编辑地址 新增达人*/
  1724. handleAddbroadcast(item) {
  1725. this.$nextTick(() => {
  1726. this.ids = item.id;
  1727. this.openAllocation = true;
  1728. this.updateCourierNumberType = false;
  1729. getCompany().then((res) => {
  1730. this.superiorList = res;
  1731. });
  1732. });
  1733. },
  1734. /** 修改按钮操作 */
  1735. handleUpdate(row) {
  1736. this.reset();
  1737. },
  1738. /** 新增直播确定按钮 */
  1739. submitFormBroadcast: function () {
  1740. this.$refs["formBroadcast"].validate((valid) => {
  1741. if (valid) {
  1742. this.confirmLoading = true;
  1743. var params = { ...this.formBroadcast };
  1744. params.id = this.ids;
  1745. // params.userId = this.$store.getters.userId;
  1746. // params.userName = this.$store.getters.name;
  1747. if (this.updateCourierNumberType) {
  1748. updateCourierNumber(params)
  1749. .then((res) => {
  1750. this.confirmLoading = false;
  1751. this.openAllocation = false;
  1752. this.formBroadcast = {};
  1753. this.getList();
  1754. this.$modal.msgSuccess("修改成功");
  1755. })
  1756. .catch(() => {
  1757. this.confirmLoading = false;
  1758. this.$message.error("失败");
  1759. });
  1760. } else {
  1761. editPreview(params)
  1762. .then((res) => {
  1763. this.confirmLoading = false;
  1764. this.openAllocation = false;
  1765. this.formBroadcast = {};
  1766. this.getList();
  1767. this.$modal.msgSuccess("修改成功");
  1768. })
  1769. .catch(() => {
  1770. this.confirmLoading = false;
  1771. this.$message.error("失败");
  1772. });
  1773. }
  1774. }
  1775. });
  1776. },
  1777. /** 提交按钮 */
  1778. submitForm: function () {
  1779. this.$refs["form"].validate((valid) => {
  1780. if (valid) {
  1781. var fileList = this.$refs.fileUploadDialog.fileList;
  1782. var dapanUrls = this.$refs.fileUpload.fileList;
  1783. var portraitUrls = this.$refs.fileUploadFx.fileList;
  1784. if (fileList.length == 0 && dapanUrls.length == 0 && portraitUrls.length == 0) {
  1785. this.$message.error("直播数据,数据大盘,画像分析必须最少上传一项");
  1786. return;
  1787. } else {
  1788. this.confirmLoading = true;
  1789. let formData = new FormData();
  1790. this.ids;
  1791. formData.append("id", this.ids);
  1792. formData.append("actualGmv", this.delcommafy(this.form.actualGmv));
  1793. formData.append(
  1794. "dapanUrls",
  1795. JSON.stringify(
  1796. dapanUrls.map((item) => {
  1797. return item.url;
  1798. })
  1799. )
  1800. );
  1801. formData.append(
  1802. "portraitUrls",
  1803. JSON.stringify(
  1804. portraitUrls.map((item) => {
  1805. return item.url;
  1806. })
  1807. )
  1808. );
  1809. fileList.forEach((file) => formData.append("files", file.raw));
  1810. dataUpload(formData)
  1811. .then((res) => {
  1812. this.confirmLoading = false;
  1813. this.$message.success("上传成功");
  1814. this.open = false;
  1815. this.ids = null;
  1816. this.cancel();
  1817. this.handleQuery();
  1818. })
  1819. .catch((err) => {
  1820. this.confirmLoading = false;
  1821. });
  1822. }
  1823. console.log(fileList, dapanUrls, portraitUrls);
  1824. }
  1825. });
  1826. },
  1827. },
  1828. };
  1829. </script>
  1830. <style lang="scss" scoped>
  1831. .p-title {
  1832. width: 100%;
  1833. font-size: 10px;
  1834. color: darkgray;
  1835. font-weight: bold;
  1836. text-align: center;
  1837. }
  1838. .p-main {
  1839. width: 100%;
  1840. font-size: 20px;
  1841. font-weight: bold;
  1842. text-align: center;
  1843. line-height: 16px;
  1844. margin: 20px 0 10px 0;
  1845. }
  1846. .entire-line {
  1847. width: 100%;
  1848. ::v-deep .el-form-item__content {
  1849. width: 60%;
  1850. }
  1851. }
  1852. ::v-deep .el-form-item__label {
  1853. white-space: nowrap;
  1854. }
  1855. </style>
  1856. <style scoped lang="scss">
  1857. ::v-deep a {
  1858. color: #409eff;
  1859. display: block;
  1860. text-align: left;
  1861. }
  1862. .item-name-calss p {
  1863. margin: 0;
  1864. text-align: left;
  1865. }
  1866. .tableBox {
  1867. width: 100%;
  1868. }
  1869. ::v-deep .el-tabs__content {
  1870. overflow: initial;
  1871. }
  1872. .show-main {
  1873. display: flex;
  1874. width: 100%;
  1875. justify-content: space-around;
  1876. }
  1877. </style>