CreateNewspaper.vue 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663
  1. <template>
  2. <div class="manage-root newspaper-create">
  3. <Header />
  4. <div class="manage-root-contain">
  5. <nav-menu
  6. class="manage-root-contain-left"
  7. :activeMenuIndex="activeMenuIndex"
  8. ></nav-menu>
  9. <div class="manage-root-contain-right">
  10. <breadcrumb
  11. :breadcrumbList="breadcrumbList"
  12. class="breadcrumb-box"
  13. ></breadcrumb>
  14. <div class="create-top">
  15. <div class="common-title-box">
  16. <h3>{{ id ? "编辑报纸" : "创建报纸" }}</h3>
  17. <div class="btn-box" v-if="id || (!id && stepIndex !== 2)">
  18. <el-button
  19. size="small"
  20. @click="handleStep('-')"
  21. :disabled="stepIndex === 0"
  22. >上一步</el-button
  23. >
  24. <el-button
  25. type="primary"
  26. size="small"
  27. @click="handleStep('+')"
  28. :disabled="stepIndex === 2"
  29. :loading="loading"
  30. >下一步</el-button
  31. >
  32. </div>
  33. </div>
  34. <el-steps :active="stepIndex" align-center>
  35. <el-step title="报纸信息" description="填写报纸基本信息">
  36. <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
  37. </el-step>
  38. <el-step title="添加内容" description="为报纸添加内容">
  39. <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
  40. </el-step>
  41. <el-step
  42. :title="id ? '完成编辑' : '完成创建'"
  43. :description="id ? '报纸编辑完成' : '报纸创建完成'"
  44. >
  45. <svg-icon icon-class="dot" slot="icon" class="svg-dot"></svg-icon>
  46. </el-step>
  47. </el-steps>
  48. </div>
  49. <div class="create-bottom">
  50. <template v-if="stepIndex === 0">
  51. <el-form
  52. :model="newspaperForm"
  53. :rules="rulesNewspaper"
  54. ref="newspaperForm"
  55. label-width="100px"
  56. class="registerForm"
  57. >
  58. <el-form-item label="报纸封面" prop="cover_image_url">
  59. <upload
  60. :datafileList="newspaperForm.cover_image_list"
  61. :changeFillId="handleAvatarSuccess"
  62. :fileName="'cover'"
  63. :showList="true"
  64. uploadType="image"
  65. :filleNumber="1"
  66. v-if="!newspaperForm.cover_image_url"
  67. styleType="upload"
  68. />
  69. <div
  70. class="cover-box"
  71. v-else
  72. @mouseover="Imagemouseover('coverFlag', true)"
  73. @mouseout="Imagemouseover('coverFlag', false)"
  74. >
  75. <el-image
  76. :src="newspaperForm.cover_image_url"
  77. fit="cover"
  78. style="width: 200px; height: 280px"
  79. ></el-image>
  80. <p v-show="coverFlag" @click="handleDeleteFile('cover', 0)">
  81. <i class="el-icon-delete"></i>
  82. </p>
  83. </div>
  84. <p class="tips">建议上传宽高为200*280的图</p>
  85. </el-form-item>
  86. <el-form-item label="报纸名称" prop="iss_name">
  87. <el-input
  88. v-model="newspaperForm.iss_name"
  89. placeholder="请输入报纸名称"
  90. @blur="handleTrim('newspaperForm', 'iss_name')"
  91. maxlength="100"
  92. ></el-input>
  93. </el-form-item>
  94. <el-form-item label="出版机构" prop="vendor_name">
  95. <el-select
  96. v-model="newspaperForm.vendor_name"
  97. filterable
  98. allow-create
  99. default-first-option
  100. placeholder="请选择"
  101. >
  102. <el-option
  103. v-for="(item, i) in vendorList"
  104. :key="item + i"
  105. :label="item"
  106. :value="item"
  107. >
  108. </el-option>
  109. </el-select>
  110. </el-form-item>
  111. <el-form-item label="是否合刊" required="" prop="comb_flag">
  112. <el-radio-group v-model="newspaperForm.comb_flag">
  113. <el-radio :label="0">否</el-radio>
  114. <el-radio :label="1">是</el-radio>
  115. </el-radio-group>
  116. </el-form-item>
  117. <el-form-item
  118. label="期数"
  119. prop="iss_no"
  120. class="validity-box"
  121. v-if="newspaperForm.comb_flag === 0"
  122. >
  123. <el-input
  124. placeholder="请输入"
  125. v-model="newspaperForm.iss_no"
  126. type="number"
  127. maxlength="5"
  128. @input="$forceUpdate()"
  129. >
  130. <template slot="append">期</template>
  131. </el-input>
  132. </el-form-item>
  133. <el-form-item
  134. label="期数"
  135. prop="iss_no_start"
  136. v-if="newspaperForm.comb_flag === 1"
  137. >
  138. <el-input
  139. v-model="newspaperForm.iss_no_start"
  140. style="width: 114px"
  141. maxlength="20"
  142. @input="$forceUpdate()"
  143. >
  144. </el-input>
  145. <!-- <el-input v-model="newspaperForm.iss_no_end" type="number">
  146. <template slot="append">期</template>
  147. </el-input> -->
  148. </el-form-item>
  149. <template v-if="issueKS">
  150. <el-form-item label="配置刊数">
  151. <el-input
  152. placeholder="请输入"
  153. v-model="issueKS.comb_count"
  154. disabled
  155. style="width: 114px"
  156. >
  157. </el-input>
  158. </el-form-item>
  159. <el-form-item label="当前刊数">
  160. <el-input
  161. placeholder="请输入"
  162. v-model="issueKS.ks"
  163. disabled
  164. style="width: 114px; margin-right: 10px"
  165. >
  166. </el-input>
  167. <el-button
  168. type="primary"
  169. size="small"
  170. @click="handleSyncIssueKS"
  171. >同步刊数</el-button
  172. >
  173. </el-form-item>
  174. </template>
  175. <el-form-item label="发行日期" prop="release_date">
  176. <el-date-picker
  177. v-model="newspaperForm.release_date"
  178. type="date"
  179. placeholder="选择日期"
  180. value-format="yyyy-MM-dd"
  181. format="yyyy-MM-dd"
  182. >
  183. </el-date-picker>
  184. </el-form-item>
  185. <el-form-item label="学段" prop="study_phase">
  186. <el-select
  187. v-model="newspaperForm.study_phase"
  188. placeholder="请选择"
  189. @change="getVlList(1)"
  190. >
  191. <el-option
  192. v-for="item in $studyType"
  193. :key="item.study_phase"
  194. :label="item.study_phase_name"
  195. :value="item.study_phase"
  196. >
  197. </el-option>
  198. </el-select>
  199. </el-form-item>
  200. <el-form-item label="课标词表" prop="vl_id">
  201. <el-select
  202. v-model="newspaperForm.vl_id"
  203. filterable
  204. placeholder="请选择"
  205. >
  206. <el-option
  207. v-for="item in vlList"
  208. :key="item.id"
  209. :label="item.name"
  210. :value="item.id"
  211. >
  212. </el-option>
  213. </el-select>
  214. </el-form-item>
  215. <el-form-item label="栏目模板" prop="chn_data">
  216. <el-select
  217. v-model="newspaperForm.chn_data"
  218. filterable
  219. placeholder="请选择"
  220. @change="handleChangeChn"
  221. >
  222. <el-option
  223. v-for="item in tplList"
  224. :key="item.id"
  225. :label="item.tpl_name"
  226. :value="item.chn_data_string"
  227. >
  228. </el-option>
  229. </el-select>
  230. <a @click="handleLinkChannel" class="tpl-maintain"
  231. >栏目模板维护</a
  232. >
  233. <br />
  234. <el-input
  235. type="textarea"
  236. :rows="4"
  237. disabled
  238. style="margin-top: 20px"
  239. v-model="newspaperForm.chn_data_str"
  240. >
  241. </el-input>
  242. </el-form-item>
  243. <el-form-item label="标签" prop="info_tag_data">
  244. <el-select
  245. v-model="newspaperForm.info_tag_data"
  246. multiple
  247. filterable
  248. allow-create
  249. default-first-option
  250. placeholder="请选择"
  251. >
  252. <el-option
  253. v-for="(item, i) in tabsList"
  254. :key="item + i"
  255. :label="item"
  256. :value="item"
  257. >
  258. </el-option>
  259. </el-select>
  260. </el-form-item>
  261. <el-form-item label="简介" prop="iss_note">
  262. <el-input
  263. type="textarea"
  264. :rows="4"
  265. placeholder="请输入简介"
  266. v-model="newspaperForm.iss_note"
  267. maxlength="140"
  268. show-word-limit
  269. >
  270. </el-input>
  271. </el-form-item>
  272. <!-- <el-form-item label="讲解版" required="" prop="with_addon_flag">
  273. <el-radio-group v-model="newspaperForm.with_addon_flag">
  274. <el-radio :label="0">否</el-radio>
  275. <el-radio :label="1">是</el-radio>
  276. </el-radio-group>
  277. </el-form-item> -->
  278. <!-- <template v-if="newspaperForm.with_addon_flag===1">
  279. <el-divider></el-divider>
  280. <h6>讲解版售价</h6>
  281. <el-form-item label="原价" prop="with_addon_price_org" class="price-box" :key="'with_addon_price'">
  282. <el-input-number v-model="newspaperForm.with_addon_price_org" :min="0" size="small" :precision="2" class="personal-ceil"></el-input-number>
  283. <span class="prepend">¥</span>
  284. <span class="append">元</span>
  285. </el-form-item>
  286. <el-form-item label="优惠价格" prop="has_discount_addon">
  287. <el-radio-group v-model="newspaperForm.has_discount_addon">
  288. <el-radio :label="0">没有</el-radio>
  289. <el-radio :label="1">有</el-radio>
  290. </el-radio-group>
  291. </el-form-item>
  292. <el-form-item label="优惠价格" prop="with_addon_price_sell" class="price-box" v-if="newspaperForm.has_discount_addon===1">
  293. <el-input-number v-model="newspaperForm.with_addon_price_sell" :min="0" size="small" :precision="2" class="personal-ceil"></el-input-number>
  294. <span class="prepend">¥</span>
  295. <span class="append">元</span>
  296. <p class="tips">优惠价格必须低于原价</p>
  297. </el-form-item>
  298. </template>
  299. <el-divider></el-divider>
  300. <h6>普通版售价</h6> -->
  301. <template>
  302. <el-form-item
  303. label="原价"
  304. prop="iss_price_org"
  305. class="price-box"
  306. :key="'iss_price'"
  307. >
  308. <el-input-number
  309. v-model="newspaperForm.iss_price_org"
  310. :min="0"
  311. size="small"
  312. :precision="2"
  313. class="personal-ceil"
  314. ></el-input-number>
  315. <span class="prepend">¥</span>
  316. <span class="append">元</span>
  317. </el-form-item>
  318. <el-form-item label="优惠价格" prop="has_discount">
  319. <el-radio-group v-model="newspaperForm.has_discount">
  320. <el-radio :label="0">没有</el-radio>
  321. <el-radio :label="1">有</el-radio>
  322. </el-radio-group>
  323. </el-form-item>
  324. <el-form-item
  325. label="优惠价格"
  326. prop="iss_price_sell"
  327. class="price-box"
  328. v-if="newspaperForm.has_discount === 1"
  329. >
  330. <el-input-number
  331. v-model="newspaperForm.iss_price_sell"
  332. :min="0"
  333. size="small"
  334. :precision="2"
  335. class="personal-ceil"
  336. ></el-input-number>
  337. <span class="prepend">¥</span>
  338. <span class="append">元</span>
  339. <p class="tips">优惠价格必须低于原价</p>
  340. </el-form-item>
  341. </template>
  342. </el-form>
  343. </template>
  344. <div v-if="stepIndex === 1">
  345. <div class="issue-channel" v-if="issueChannel">
  346. <div class="issue-top">
  347. <h4 class="issue-top-left">
  348. 栏目
  349. <span
  350. >共 {{ issueChannel.chn_count }} 个栏目
  351. {{ issueChannel.art_count }} 篇文章</span
  352. >
  353. </h4>
  354. <div>
  355. <el-button type="primary" size="small" @click="addChnDate"
  356. >新增栏目</el-button
  357. >
  358. <el-button
  359. type="primary"
  360. size="small"
  361. @click="previewBookItem"
  362. >预览</el-button
  363. >
  364. </div>
  365. </div>
  366. <draggable
  367. v-model="issueChannel.chn_art_data"
  368. chosenClass="chosen"
  369. forceFallback="true"
  370. group="peoples"
  371. animation="100"
  372. @start="onStarts"
  373. @end="onEnds()"
  374. class="article-list"
  375. handle=".movers"
  376. >
  377. <div
  378. class="channel-item"
  379. v-for="(item, index) in issueChannel.chn_art_data"
  380. :key="index"
  381. >
  382. <div class="channel-top">
  383. <svg-icon
  384. icon-class="sort"
  385. draggable="true"
  386. class="movers"
  387. ></svg-icon>
  388. <i
  389. class="el-icon-caret-bottom"
  390. v-if="item.show"
  391. @click="item.show = !item.show"
  392. ></i>
  393. <i
  394. class="el-icon-caret-top"
  395. v-else
  396. @click="item.show = !item.show"
  397. ></i>
  398. <div class="channel-top-name">
  399. <template v-if="!item.editFlag">
  400. <span>{{ item.chn_name }}</span>
  401. <svg-icon
  402. icon-class="edit"
  403. class="edit-chn-name"
  404. @click="editChnDate(item, index)"
  405. ></svg-icon>
  406. </template>
  407. <template v-else>
  408. <el-input
  409. v-model="item.edit_name"
  410. maxlength="200"
  411. ></el-input>
  412. <svg-icon
  413. icon-class="save-line"
  414. class="edit-chn-name"
  415. @click="saveChnDate(item.edit_name, index)"
  416. ></svg-icon>
  417. </template>
  418. <svg-icon
  419. icon-class="deletes-line"
  420. class="edit-chn-name"
  421. @click="deleteChnDate(index)"
  422. ></svg-icon>
  423. </div>
  424. <el-button
  425. type="text"
  426. @click="handleArticle('', 1, item.chn_name)"
  427. ><i class="el-icon-plus"></i>新增英文内容</el-button
  428. >
  429. <el-button
  430. type="text"
  431. @click="handleArticle('', 0, item.chn_name)"
  432. ><i class="el-icon-plus"></i>新增中文内容</el-button
  433. >
  434. </div>
  435. <el-collapse-transition>
  436. <template v-if="item.show">
  437. <draggable
  438. v-model="item.arts"
  439. chosenClass="chosen"
  440. forceFallback="true"
  441. group="people"
  442. animation="1000"
  443. @start="onStart"
  444. @end="onEnd()"
  445. class="article-list"
  446. handle=".mover"
  447. >
  448. <li v-for="(itema, indexa) in item.arts" :key="indexa">
  449. <svg-icon
  450. icon-class="sort"
  451. draggable="true"
  452. class="mover"
  453. ></svg-icon>
  454. <div class="items">
  455. <h6>{{ itema.art_title }}</h6>
  456. <span>BY {{ itema.art_author }}</span>
  457. <span
  458. >创建人:{{
  459. itema.creator_real_name ||
  460. itema.creator_user_name
  461. }}</span
  462. >
  463. <span>{{ itema.create_time }}</span>
  464. <span
  465. >最后编辑:{{
  466. itema.updater_real_name ||
  467. itema.updater_user_name
  468. }}</span
  469. >
  470. <span>{{ itema.update_time }}</span>
  471. </div>
  472. <svg-icon
  473. icon-class="edit"
  474. class="edit-article"
  475. @click="
  476. handleArticle(
  477. itema.id,
  478. itema.en_flag,
  479. item.chn_name
  480. )
  481. "
  482. ></svg-icon>
  483. <span class="border"></span>
  484. <i
  485. class="el-icon-delete"
  486. @click="
  487. handleDeleteArticle(item.arts, indexa, itema.id)
  488. "
  489. ></i>
  490. </li>
  491. </draggable>
  492. </template>
  493. </el-collapse-transition>
  494. </div>
  495. </draggable>
  496. </div>
  497. </div>
  498. <div v-if="stepIndex === 2">
  499. <el-result
  500. icon="success"
  501. :subTitle="id ? '报纸编辑成功' : '报纸创建成功'"
  502. >
  503. <template slot="extra">
  504. <el-button size="small" @click="handleback">返回列表</el-button>
  505. <el-button type="primary" size="small" @click="handleCreate"
  506. >继续创建</el-button
  507. >
  508. </template>
  509. </el-result>
  510. </div>
  511. </div>
  512. </div>
  513. </div>
  514. <el-dialog
  515. :visible.sync="previewBook"
  516. :show-close="false"
  517. :close-on-click-modal="false"
  518. :append-to-body="true"
  519. width="100%"
  520. top="0"
  521. class="login-dialog"
  522. v-if="previewBook"
  523. >
  524. <book-item
  525. :id="id ? id : issueId"
  526. @closePreview="closePreview"
  527. ></book-item>
  528. </el-dialog>
  529. </div>
  530. </template>
  531. <script>
  532. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  533. //例如:import 《组件名称》from ‘《组件路径》';
  534. import Header from "../../../components/Header.vue";
  535. import NavMenu from "../../../components/NavMenu.vue";
  536. import Breadcrumb from "../../../components/Breadcrumb.vue";
  537. import Upload from "../../../components/Upload.vue";
  538. import { getLogin } from "@/api/ajax";
  539. import { mapState } from "vuex";
  540. import draggable from "vuedraggable";
  541. import BookItem from "./BookItem.vue";
  542. export default {
  543. //import引入的组件需要注入到对象中才能使用
  544. components: { Header, NavMenu, Breadcrumb, Upload, draggable, BookItem },
  545. props: {},
  546. data() {
  547. const validateIssNo = (rule, value, callback) => {
  548. if (value === "") {
  549. callback(new Error("请输入期数"));
  550. } else {
  551. let start = this.newspaperForm.iss_no_start;
  552. let end = this.newspaperForm.iss_no_end;
  553. if (start !== null && end !== null) {
  554. if (start >= end) {
  555. callback(new Error("开始期数需小于结束期数"));
  556. } else {
  557. callback();
  558. }
  559. } else {
  560. callback(new Error("请输入期数"));
  561. }
  562. }
  563. };
  564. const validatePrice = (rule, value, callback) => {
  565. if (value === "") {
  566. callback(new Error("请输入价格"));
  567. } else {
  568. let price = this.newspaperForm.iss_price_org;
  569. let currentPrice = this.newspaperForm.iss_price_sell;
  570. if (price !== undefined && currentPrice !== undefined) {
  571. if (price === 0 && rule.fullField === "price") {
  572. callback(new Error("原价需大于0"));
  573. } else if (currentPrice >= price && this.newspaperForm.has_discount) {
  574. callback(new Error("优惠价格必须低于原价"));
  575. } else {
  576. callback();
  577. }
  578. } else {
  579. callback(new Error("请输入"));
  580. }
  581. }
  582. };
  583. const validatePrices = (rule, value, callback) => {
  584. if (value === "") {
  585. callback(new Error("请输入价格"));
  586. } else {
  587. let price = this.newspaperForm.with_addon_price_org;
  588. let currentPrice = this.newspaperForm.with_addon_price_sell;
  589. if (price !== undefined && currentPrice !== undefined) {
  590. if (price === 0 && rule.fullField === "price") {
  591. callback(new Error("原价需大于0"));
  592. } else if (
  593. currentPrice >= price &&
  594. this.newspaperForm.has_discount_addon
  595. ) {
  596. callback(new Error("优惠价格必须低于原价"));
  597. } else {
  598. callback();
  599. }
  600. } else {
  601. callback(new Error("请输入"));
  602. }
  603. }
  604. };
  605. const validateIssNoDan = (rule, value, callback) => {
  606. if (value === "") {
  607. callback(new Error("请输入期数"));
  608. } else {
  609. if (value.length > 5) {
  610. callback(new Error("期数过长"));
  611. } else {
  612. let reg = /^[0-9]*[1-9][0-9]*$/;
  613. let result = reg.test(value);
  614. if (!result) {
  615. callback(new Error("期数只能输入正整数"));
  616. } else {
  617. callback();
  618. }
  619. }
  620. }
  621. };
  622. return {
  623. activeMenuIndex: "newspaper_manage",
  624. breadcrumbList: [
  625. {
  626. icon: "file-list-line",
  627. url: "",
  628. text: "",
  629. },
  630. {
  631. icon: "",
  632. url: "",
  633. notLink: true,
  634. text: "内容管理",
  635. },
  636. {
  637. icon: "",
  638. url: "",
  639. text: "报纸管理",
  640. },
  641. ],
  642. id: this.$route.query.id ? this.$route.query.id : "",
  643. stepIndex: window.localStorage.getItem("newsStep")
  644. ? window.localStorage.getItem("newsStep") * 1
  645. : 0, // 步骤索引
  646. coverFlag: false,
  647. newspaperForm: window.localStorage.getItem("newsForm")
  648. ? JSON.parse(window.localStorage.getItem("newsForm"))
  649. : {
  650. cover_image_url: "",
  651. cover_image_list: [],
  652. cover_image_id: null,
  653. iss_name: "",
  654. vendor_name: "21世纪报社",
  655. comb_flag: 0,
  656. iss_no: null,
  657. iss_no_start: null,
  658. iss_no_end: null,
  659. release_date: "",
  660. study_phase: null,
  661. vl_id: "",
  662. chn_data: "",
  663. chn_data_str: "",
  664. info_tag_data: [],
  665. iss_note: "",
  666. with_addon_flag: 0,
  667. iss_price_org: null,
  668. iss_price_sell: null,
  669. with_addon_price_org: null,
  670. with_addon_price_sell: null,
  671. has_discount: 1,
  672. has_discount_addon: 1,
  673. },
  674. rulesNewspaper: {
  675. iss_name: [
  676. { required: true, message: "请输入报纸名称", trigger: "blur" },
  677. ],
  678. vendor_name: [
  679. { required: true, message: "请输入出版机构", trigger: "blur" },
  680. ],
  681. iss_no: [
  682. { required: true, validator: validateIssNoDan, trigger: "blur" },
  683. ],
  684. iss_no_start: [
  685. { required: true, message: "请输入期数", trigger: "blur" },
  686. ],
  687. iss_no_end: [
  688. { required: true, validator: validateIssNo, trigger: "blur" },
  689. ],
  690. study_phase: [
  691. { required: true, message: "请选择学段", trigger: "change" },
  692. ],
  693. vl_id: [
  694. { required: true, message: "请选择课标词表", trigger: "change" },
  695. ],
  696. chn_data: [
  697. { required: true, message: "请选择栏目模板", trigger: "change" },
  698. ],
  699. iss_price_org: [
  700. { required: true, validator: validatePrice, trigger: "blur" },
  701. ],
  702. iss_price_sell: [
  703. { required: true, validator: validatePrice, trigger: "blur" },
  704. ],
  705. with_addon_price_org: [
  706. { required: true, validator: validatePrices, trigger: "blur" },
  707. ],
  708. with_addon_price_sell: [
  709. { required: true, validator: validatePrices, trigger: "blur" },
  710. ],
  711. },
  712. vendorList: [], // 出版机构列表
  713. vlList: [], // 课标词表
  714. tplList: [], // 栏目列表
  715. tabsList: ["中英双语", "少儿必读"],
  716. issueId: "",
  717. issueChannel: null,
  718. drag: false,
  719. loading: false,
  720. previewBook: false,
  721. oldArtsList: [], // 记录旧文章栏目列表
  722. issueKS: null, // 刊数信息
  723. };
  724. },
  725. //计算属性 类似于data概念
  726. computed: {
  727. ...mapState(["$studyType"]),
  728. },
  729. //监控data中数据变化
  730. watch: {},
  731. //方法集合
  732. methods: {
  733. // 上一步下一步
  734. handleStep(type) {
  735. if (type == "-") {
  736. if (this.stepIndex > 0) this.stepIndex--;
  737. } else {
  738. if (this.stepIndex === 0) {
  739. this.$refs["newspaperForm"].validate((valid) => {
  740. if (valid) {
  741. this.handleAddIssue();
  742. } else {
  743. return false;
  744. }
  745. });
  746. } else if (this.stepIndex === 1) {
  747. this.handleEditIssue();
  748. }
  749. }
  750. },
  751. // 返回列表
  752. handleback() {
  753. this.$router.push({
  754. path: "/newspaper_manage",
  755. query: {},
  756. });
  757. },
  758. //继续创建
  759. handleCreate() {
  760. this.$router.replace("/createNewspaper");
  761. location.reload();
  762. },
  763. // 跳转栏目列表
  764. handleLinkChannel() {
  765. window.localStorage.setItem(
  766. "newsForm",
  767. JSON.stringify(this.newspaperForm)
  768. );
  769. window.localStorage.setItem("newsStep", 0);
  770. window.localStorage.setItem("clearForm", true);
  771. this.$router.push({
  772. path: "/channelList",
  773. });
  774. },
  775. handleAvatarSuccess(fileList, name) {
  776. if (name === "cover") {
  777. this.newspaperForm.cover_image_list = fileList;
  778. this.newspaperForm.cover_image_id =
  779. fileList[0] &&
  780. fileList[0].response &&
  781. fileList[0].response.file_info_list &&
  782. fileList[0].response.file_info_list[0]
  783. ? fileList[0].response.file_info_list[0].file_id
  784. : "";
  785. this.newspaperForm.cover_image_url =
  786. fileList[0] &&
  787. fileList[0].response &&
  788. fileList[0].response.file_info_list &&
  789. fileList[0].response.file_info_list[0]
  790. ? fileList[0].response.file_info_list[0].file_url
  791. : "";
  792. this.$forceUpdate();
  793. }
  794. },
  795. Imagemouseover(item, flag) {
  796. this[item] = flag;
  797. },
  798. handleDeleteFile(item, i) {
  799. this.$confirm("确定删除吗?", "提示", {
  800. confirmButtonText: "确定",
  801. cancelButtonText: "取消",
  802. type: "warning",
  803. }).then(() => {
  804. if (item === "cover") {
  805. this.newspaperForm.cover_image_list.splice(i, 1);
  806. this.newspaperForm.cover_image_url = "";
  807. this.newspaperForm.cover_image_id = null;
  808. this.$forceUpdate();
  809. }
  810. });
  811. },
  812. handleDeleteArticle(item, i, id) {
  813. this.$confirm("确定删除吗?", "提示", {
  814. confirmButtonText: "确定",
  815. cancelButtonText: "取消",
  816. type: "warning",
  817. }).then(() => {
  818. item.splice(i, 1);
  819. getLogin("/PaperServer/Manager/ArticleManager/DeleteArticle", {
  820. id: id,
  821. }).then((res) => {
  822. if (res.status === 1) {
  823. }
  824. });
  825. });
  826. },
  827. // 去掉前后空格
  828. handleTrim(form, fild) {
  829. this[form][fild] = this[form][fild].trim();
  830. },
  831. // 获取出版机构列表
  832. getVendorList() {
  833. let MethodName = "/PaperServer/Manager/IssueManager/FindVendors";
  834. let data = {
  835. key_word: "",
  836. };
  837. getLogin(MethodName, data)
  838. .then((res) => {
  839. if (res.status === 1) {
  840. this.vendorList = res.data;
  841. }
  842. })
  843. .catch(() => {});
  844. // getLogin('/PaperServer/Manager/IssueManager/FindPubs', {})
  845. // .then((res) => {
  846. // if(res.status===1){
  847. // }
  848. // })
  849. // .catch(() => {
  850. // });
  851. },
  852. // 课标词表
  853. getVlList(flag) {
  854. if (flag) {
  855. this.newspaperForm.vl_id = "";
  856. this.newspaperForm.chn_data = "";
  857. this.newspaperForm.chn_data_str = "";
  858. }
  859. let MethodName = "/PaperServer/Manager/VocListManager/FindSimplesByCond";
  860. let data = {
  861. study_phase: this.newspaperForm.study_phase,
  862. };
  863. getLogin(MethodName, data)
  864. .then((res) => {
  865. if (res.status === 1) {
  866. this.vlList = res.data;
  867. }
  868. })
  869. .catch(() => {});
  870. let MethodNames =
  871. "/PaperServer/Manager/ChannelTplManager/PickChannelTplByCond";
  872. getLogin(MethodNames, data)
  873. .then((res) => {
  874. if (res.status === 1) {
  875. let tplList = res.data;
  876. tplList.forEach((item) => {
  877. item.chn_data_string = JSON.stringify(item.chn_data);
  878. });
  879. this.tplList = tplList;
  880. }
  881. })
  882. .catch(() => {});
  883. },
  884. handleChangeChn() {
  885. this.newspaperForm.chn_data_str = JSON.parse(
  886. this.newspaperForm.chn_data
  887. ).join("\n");
  888. if (this.id || this.issueId) {
  889. let chn_art_data = [];
  890. let chn_art_data_new = []; // 新的文章栏目列表
  891. if (this.issueChannel.chn_art_data) {
  892. chn_art_data = JSON.parse(JSON.stringify(this.oldArtsList));
  893. JSON.parse(this.newspaperForm.chn_data).forEach((item, index) => {
  894. let flag = true;
  895. for (let i = 0; i < chn_art_data.length; i++) {
  896. if (item === chn_art_data[i].chn_name) {
  897. chn_art_data_new.push(chn_art_data[i]);
  898. flag = false;
  899. return false;
  900. }
  901. }
  902. if (flag) {
  903. let obj = {
  904. arts: [],
  905. editFlag: false,
  906. chn_idx: index,
  907. chn_name: item,
  908. editFlag: false,
  909. edit_name: item,
  910. show: index === 0 ? true : false,
  911. };
  912. chn_art_data_new.push(obj);
  913. }
  914. });
  915. } else {
  916. JSON.parse(this.newspaperForm.chn_data).forEach((item, index) => {
  917. let obj = {
  918. arts: [],
  919. editFlag: false,
  920. chn_idx: index,
  921. chn_name: item,
  922. editFlag: false,
  923. edit_name: item,
  924. show: index === 0 ? true : false,
  925. };
  926. chn_art_data_new.push(obj);
  927. });
  928. }
  929. this.issueChannel = {
  930. chn_art_data: chn_art_data_new,
  931. };
  932. }
  933. },
  934. handleAddIssue() {
  935. this.loading = true;
  936. let MethodName = "/PaperServer/Manager/IssueManager/AddIssue";
  937. let form = this.newspaperForm;
  938. let data = {
  939. iss_cover_id: form.cover_image_id,
  940. iss_name: form.iss_name,
  941. vendor_name: form.vendor_name,
  942. release_date: form.release_date,
  943. comb_flag: form.comb_flag,
  944. iss_no: form.comb_flag === 0 ? form.iss_no : form.iss_no_start,
  945. study_phase: form.study_phase,
  946. vl_id: form.vl_id,
  947. iss_price_org: form.iss_price_org,
  948. iss_price_sell:
  949. this.newspaperForm.has_discount === 1
  950. ? form.iss_price_sell
  951. : form.iss_price_org,
  952. with_addon_price_org: form.with_addon_price_org,
  953. with_addon_price_sell:
  954. this.newspaperForm.has_discount_addon === 1
  955. ? form.with_addon_price_sell
  956. : form.with_addon_price_org,
  957. iss_note: form.iss_note,
  958. info_tag_data: form.info_tag_data,
  959. chn_data: JSON.parse(form.chn_data),
  960. with_addon_flag: form.with_addon_flag,
  961. };
  962. if (this.id || this.issueId) {
  963. this.loading = false;
  964. this.stepIndex++;
  965. return false;
  966. }
  967. getLogin(MethodName, data)
  968. .then((res) => {
  969. this.loading = false;
  970. if (res.status === 1) {
  971. window.localStorage.removeItem("newsForm");
  972. window.localStorage.removeItem("newsStep");
  973. window.localStorage.removeItem("clearForm");
  974. this.issueId = res.data.id;
  975. this.$router.replace(
  976. "/createNewspaper?id=" + res.data.id + "&isCreate=true"
  977. );
  978. this.stepIndex++;
  979. let chn_art_data = [];
  980. if (res.data.chn_art_data) {
  981. chn_art_data = JSON.parse(JSON.stringify(res.data.chn_art_data));
  982. chn_art_data.forEach((item, index) => {
  983. if (index === 0) {
  984. item.show = true;
  985. } else {
  986. item.show = true;
  987. }
  988. });
  989. } else {
  990. res.data.chn_data.forEach((itemc, index) => {
  991. let obj = {
  992. chn_name: itemc,
  993. edit_name: itemc,
  994. arts: [],
  995. show: true,
  996. };
  997. chn_art_data.push(obj);
  998. });
  999. }
  1000. this.issueChannel = {
  1001. chn_count: res.data.chn_count,
  1002. art_count: res.data.art_count,
  1003. chn_art_data: chn_art_data,
  1004. };
  1005. }
  1006. })
  1007. .catch(() => {
  1008. this.loading = false;
  1009. });
  1010. },
  1011. handleEditIssue() {
  1012. this.loading = true;
  1013. let MethodName = "/PaperServer/Manager/IssueManager/EditIssue";
  1014. let form = this.newspaperForm;
  1015. let data = {
  1016. iss_cover_id: form.cover_image_id,
  1017. iss_name: form.iss_name,
  1018. vendor_name: form.vendor_name,
  1019. release_date: form.release_date,
  1020. comb_flag: form.comb_flag,
  1021. iss_no: form.comb_flag === 0 ? form.iss_no : form.iss_no_start,
  1022. study_phase: form.study_phase,
  1023. vl_id: form.vl_id,
  1024. iss_price_org: form.iss_price_org,
  1025. iss_price_sell:
  1026. this.newspaperForm.has_discount === 1
  1027. ? form.iss_price_sell
  1028. : form.iss_price_org,
  1029. with_addon_price_org: form.with_addon_price_org,
  1030. with_addon_price_sell:
  1031. this.newspaperForm.has_discount_addon === 1
  1032. ? form.with_addon_price_sell
  1033. : form.with_addon_price_org,
  1034. iss_note: form.iss_note,
  1035. info_tag_data: form.info_tag_data,
  1036. chn_data: JSON.parse(form.chn_data),
  1037. with_addon_flag: form.with_addon_flag,
  1038. id: this.id ? this.id : this.issueId,
  1039. chn_art_data: this.issueChannel.chn_art_data,
  1040. };
  1041. getLogin(MethodName, data)
  1042. .then((res) => {
  1043. this.loading = false;
  1044. if (res.status === 1) {
  1045. window.localStorage.removeItem("newsForm");
  1046. window.localStorage.removeItem("newsStep");
  1047. window.localStorage.removeItem("clearForm");
  1048. this.stepIndex++;
  1049. let chn_art_data = [];
  1050. if (res.data.chn_art_data) {
  1051. chn_art_data = JSON.parse(JSON.stringify(res.data.chn_art_data));
  1052. chn_art_data.forEach((item, index) => {
  1053. if (index === 0) {
  1054. item.show = true;
  1055. } else {
  1056. item.show = true;
  1057. }
  1058. });
  1059. } else {
  1060. JSON.parse(res.data.chn_data).forEach((itemc, index) => {
  1061. let obj = {
  1062. chn_name: itemc,
  1063. edit_name: itemc,
  1064. arts: [],
  1065. show: true,
  1066. };
  1067. chn_art_data.push(obj);
  1068. });
  1069. }
  1070. this.issueChannel = {
  1071. chn_count: res.data.chn_count,
  1072. art_count: res.data.art_count,
  1073. chn_art_data: chn_art_data,
  1074. };
  1075. }
  1076. })
  1077. .catch(() => {
  1078. this.loading = false;
  1079. });
  1080. },
  1081. getInfo() {
  1082. let MethodName = "/PaperServer/Manager/IssueManager/FindIssueById";
  1083. let data = {
  1084. id: this.id ? this.id : this.issueId,
  1085. };
  1086. getLogin(MethodName, data)
  1087. .then((res) => {
  1088. if (res.status === 1) {
  1089. this.newspaperForm = res.data;
  1090. this.newspaperForm.cover_image_list = [];
  1091. this.newspaperForm.chn_data = JSON.stringify(res.data.chn_data);
  1092. this.newspaperForm.chn_data_str = JSON.parse(
  1093. res.data.chn_data
  1094. ).join("\n");
  1095. this.newspaperForm.cover_image_id = res.data.iss_cover_id;
  1096. this.newspaperForm.iss_no_start = res.data.iss_no;
  1097. if (res.data.iss_cover_id) {
  1098. if (res.data.iss_cover_id.indexOf("http") === -1) {
  1099. getLogin("/FileServer/GetFileInfo", {
  1100. file_id: res.data.iss_cover_id,
  1101. }).then((res) => {
  1102. if (res.status === 1) {
  1103. this.newspaperForm.cover_image_url = res.file_url;
  1104. this.$forceUpdate();
  1105. }
  1106. });
  1107. } else {
  1108. this.newspaperForm.cover_image_url = res.data.iss_cover_id;
  1109. }
  1110. this.newspaperForm.cover_image_list.push[
  1111. {
  1112. id: res.data.iss_cover_id,
  1113. }
  1114. ];
  1115. } else if (res.data.iss_cover_url) {
  1116. this.newspaperForm.cover_image_url = res.data.iss_cover_url;
  1117. this.newspaperForm.cover_image_list.push[
  1118. {
  1119. id: res.data.cover_image_url,
  1120. }
  1121. ];
  1122. }
  1123. if (res.data.iss_price_org === res.data.iss_price_sell) {
  1124. this.$set(this.newspaperForm, "has_discount", 0);
  1125. } else {
  1126. this.$set(this.newspaperForm, "has_discount", 1);
  1127. }
  1128. if (
  1129. res.data.with_addon_price_org === res.data.with_addon_price_sell
  1130. ) {
  1131. this.$set(this.newspaperForm, "has_discount_addon", 0);
  1132. } else {
  1133. this.$set(this.newspaperForm, "has_discount_addon", 1);
  1134. }
  1135. // let chn_art_data = JSON.parse(JSON.stringify(res.data.chn_art_data))
  1136. // chn_art_data.forEach((item,index)=>{
  1137. // if(!item.hasOwnProperty('arts')){
  1138. // this.$set(item,'arts',[])
  1139. // }
  1140. // item.editFlag = false
  1141. // item.edit_name = item.chn_name
  1142. // if(index===0){
  1143. // item.show = this.issueChannel&&this.issueChannel.chn_art_data&&this.issueChannel.chn_art_data[index]?this.issueChannel.chn_art_data[index].show:true
  1144. // }else{
  1145. // item.show = this.issueChannel&&this.issueChannel.chn_art_data&&this.issueChannel.chn_art_data[index]?this.issueChannel.chn_art_data[index].show:false
  1146. // }
  1147. // })
  1148. let chn_art_data = [];
  1149. if (res.data.chn_art_data) {
  1150. chn_art_data = JSON.parse(JSON.stringify(res.data.chn_art_data));
  1151. chn_art_data.forEach((item, index) => {
  1152. if (!item.hasOwnProperty("arts")) {
  1153. this.$set(item, "arts", []);
  1154. }
  1155. item.editFlag = false;
  1156. item.edit_name = item.chn_name;
  1157. if (index === 0) {
  1158. item.show = true;
  1159. } else {
  1160. item.show = true;
  1161. }
  1162. });
  1163. } else {
  1164. JSON.parse(res.data.chn_data).forEach((itemc, index) => {
  1165. if (itemc) {
  1166. let obj = {
  1167. chn_name: itemc,
  1168. edit_name: itemc,
  1169. arts: [],
  1170. show: true,
  1171. };
  1172. chn_art_data.push(obj);
  1173. }
  1174. });
  1175. }
  1176. this.issueChannel = {
  1177. chn_count: res.data.chn_count,
  1178. art_count: res.data.art_count,
  1179. chn_art_data: chn_art_data,
  1180. };
  1181. this.oldArtsList = chn_art_data;
  1182. }
  1183. })
  1184. .catch(() => {});
  1185. },
  1186. // 跳转文章
  1187. handleArticle(id, type, name) {
  1188. window.localStorage.setItem(
  1189. "newsForm",
  1190. JSON.stringify(this.newspaperForm)
  1191. );
  1192. window.localStorage.setItem("newsStep", 1);
  1193. this.$router.push({
  1194. path: "/createArticle",
  1195. query: {
  1196. id: id,
  1197. en_flag: type ? type : 0,
  1198. issueId: this.id ? this.id : this.issueId,
  1199. chn_name: name,
  1200. isCreate: this.$route.query.isCreate === "true" ? true : "",
  1201. },
  1202. });
  1203. },
  1204. //开始拖拽事件
  1205. onStart(val) {
  1206. this.drag = true;
  1207. },
  1208. //拖拽结束事件
  1209. onEnd() {
  1210. this.drag = false;
  1211. this.issueChannel.chn_art_data.forEach((item) => {
  1212. if (item.arts && item.arts.length > 0) {
  1213. item.arts.forEach((items, indexs) => {
  1214. items.art_idx = indexs;
  1215. });
  1216. }
  1217. });
  1218. this.handleUpdateChnArtData();
  1219. },
  1220. //开始拖拽事件
  1221. onStarts(val) {},
  1222. //拖拽结束事件
  1223. onEnds() {
  1224. this.issueChannel.chn_art_data.forEach((item, index) => {
  1225. item.chn_idx = index;
  1226. });
  1227. this.handleUpdateChnArtData();
  1228. },
  1229. // 更新栏目数据
  1230. handleUpdateChnArtData() {
  1231. getLogin("/PaperServer/Manager/IssueManager/EditIssueChnArtData", {
  1232. chn_art_data: this.issueChannel.chn_art_data,
  1233. id: this.id ? this.id : this.issueId,
  1234. }).then((res) => {
  1235. if (res.status === 1) {
  1236. this.getInfo();
  1237. }
  1238. });
  1239. },
  1240. saveChnDate(value, index) {
  1241. let flag = false;
  1242. // 判断是否有值并且trim
  1243. this.issueChannel.chn_art_data.forEach((item) => {
  1244. if (item.edit_name && item.edit_name.trim()) {
  1245. item.chn_name = item.edit_name.trim();
  1246. } else {
  1247. flag = true;
  1248. }
  1249. });
  1250. if (flag) {
  1251. this.$message.warning("栏目名称不能为空");
  1252. } else {
  1253. this.onEnd();
  1254. }
  1255. // if(this.issueChannel.chn_art_data[index].)
  1256. },
  1257. // 点击编辑栏目名称按钮
  1258. editChnDate(item, index) {
  1259. if (!item.hasOwnProperty("editFlag")) {
  1260. this.$set(item, "editFlag", false);
  1261. }
  1262. item.editFlag = true;
  1263. },
  1264. // 删除栏目
  1265. deleteChnDate(index) {
  1266. this.$confirm("确定删除此栏目吗?", "提示", {
  1267. confirmButtonText: "确定",
  1268. cancelButtonText: "取消",
  1269. type: "warning",
  1270. })
  1271. .then(() => {
  1272. this.issueChannel.chn_art_data.splice(index, 1);
  1273. this.issueChannel.chn_art_data.forEach((item, indexs) => {
  1274. item.chn_idx = indexs;
  1275. });
  1276. this.onEnd();
  1277. })
  1278. .catch(() => {});
  1279. },
  1280. // 新增栏目
  1281. addChnDate() {
  1282. let obj = {
  1283. chn_name: "",
  1284. edit_name: "",
  1285. chn_idx: this.issueChannel.chn_art_data.length - 1,
  1286. arts: [],
  1287. show: true,
  1288. };
  1289. this.issueChannel.chn_art_data.push(obj);
  1290. },
  1291. // 预览栏目
  1292. previewBookItem() {
  1293. this.previewBook = true;
  1294. },
  1295. closePreview() {
  1296. this.previewBook = false;
  1297. },
  1298. // 获取报纸刊数
  1299. getIssueKS() {
  1300. let MethodName = "/ShopServer/Manager/GoodsQuery/GetIssueKS";
  1301. let data = {
  1302. issue_id: this.id,
  1303. };
  1304. getLogin(MethodName, data).then((res) => {
  1305. if (res.status === 1) {
  1306. this.issueKS = {
  1307. ks: res.ks,
  1308. comb_count: res.comb_count,
  1309. };
  1310. }
  1311. });
  1312. },
  1313. // 同步刊数
  1314. handleSyncIssueKS() {
  1315. let MethodName = "/ShopServer/Manager/GoodsManager/SyncIssueKS";
  1316. let data = {
  1317. issue_id: this.id,
  1318. };
  1319. getLogin(MethodName, data).then((res) => {
  1320. if (res.status === 1) {
  1321. this.$message.success("同步成功");
  1322. this.getIssueKS();
  1323. }
  1324. });
  1325. },
  1326. },
  1327. //生命周期 - 创建完成(可以访问当前this实例)
  1328. async created() {
  1329. this.getVendorList();
  1330. await this.getVlList();
  1331. let obj = {
  1332. icon: "",
  1333. url: "",
  1334. text: "创建报纸",
  1335. };
  1336. if (this.$route.query.isCreate === "false") {
  1337. obj.text = "编辑报纸";
  1338. }
  1339. if (this.id) {
  1340. this.getInfo();
  1341. this.getIssueKS();
  1342. }
  1343. this.breadcrumbList.push(obj);
  1344. },
  1345. //生命周期 - 挂载完成(可以访问DOM元素)
  1346. mounted() {},
  1347. //生命周期-创建之前
  1348. beforeCreated() {},
  1349. //生命周期-挂载之前
  1350. beforeMount() {},
  1351. //生命周期-更新之前
  1352. beforUpdate() {},
  1353. //生命周期-更新之后
  1354. updated() {},
  1355. //生命周期-销毁之前
  1356. beforeDestory() {},
  1357. //生命周期-销毁完成
  1358. destoryed() {},
  1359. //如果页面有keep-alive缓存功能,这个函数会触发
  1360. activated() {},
  1361. };
  1362. </script>
  1363. <style lang="scss" scoped>
  1364. /* @import url(); 引入css类 */
  1365. .create-top {
  1366. background: #ffffff;
  1367. border-radius: 4px;
  1368. padding: 24px;
  1369. .common-title-box {
  1370. margin-bottom: 4px;
  1371. }
  1372. }
  1373. .create-bottom {
  1374. padding: 40px 40px;
  1375. margin-top: 16px;
  1376. background: #ffffff;
  1377. border-radius: 4px;
  1378. height: calc(100vh - 292px);
  1379. overflow: auto;
  1380. .tips {
  1381. margin: 0;
  1382. color: #86909c;
  1383. font-size: 12px;
  1384. line-height: 20px;
  1385. }
  1386. .step-table {
  1387. border: 1px solid #e5e6eb;
  1388. border-collapse: collapse;
  1389. font-size: 14px;
  1390. line-height: 22px;
  1391. color: #1d2129;
  1392. text-align: center;
  1393. margin-bottom: 24px;
  1394. &-header {
  1395. background: #f7f8fa;
  1396. width: 120px !important;
  1397. color: #86909c;
  1398. font-weight: 500;
  1399. }
  1400. td {
  1401. height: 40px;
  1402. width: 260px;
  1403. border: 1px solid #e5e6eb;
  1404. &.td1 {
  1405. width: 130px;
  1406. }
  1407. }
  1408. .step-cascader {
  1409. width: 250px;
  1410. height: 32px;
  1411. line-height: 32px;
  1412. }
  1413. }
  1414. .tpl-maintain {
  1415. margin: 0 16px;
  1416. color: #4f75ff;
  1417. &:hover {
  1418. text-decoration: underline;
  1419. }
  1420. }
  1421. h6 {
  1422. color: #000;
  1423. font-size: 16px;
  1424. font-weight: 400;
  1425. line-height: 24px;
  1426. margin: 0 0 16px 0;
  1427. }
  1428. }
  1429. .cover-box {
  1430. position: relative;
  1431. width: 200px;
  1432. height: 280px;
  1433. p {
  1434. position: absolute;
  1435. bottom: 0;
  1436. left: 0;
  1437. width: 100%;
  1438. height: 280px;
  1439. line-height: 280px;
  1440. font-size: 20px;
  1441. text-align: center;
  1442. cursor: pointer;
  1443. background: rgba(0, 0, 0, 0.3);
  1444. color: #f2f3f5;
  1445. margin: 0;
  1446. }
  1447. }
  1448. .issue-channel {
  1449. .issue-top {
  1450. display: flex;
  1451. justify-content: space-between;
  1452. margin-bottom: 8px;
  1453. &-left {
  1454. margin: 0;
  1455. color: #1d2129;
  1456. font-size: 20px;
  1457. font-weight: 500;
  1458. line-height: 28px;
  1459. span {
  1460. margin-left: 4px;
  1461. color: #86909c;
  1462. font-size: 14px;
  1463. font-weight: 400;
  1464. line-height: 22px;
  1465. }
  1466. }
  1467. }
  1468. .channel-item {
  1469. border: 1px solid #e5e6eb;
  1470. margin: 12px 0;
  1471. .channel-top {
  1472. display: flex;
  1473. padding: 0 12px;
  1474. height: 42px;
  1475. align-items: center;
  1476. .el-icon-caret-bottom,
  1477. .el-icon-caret-top {
  1478. color: #4e5969;
  1479. width: 14px;
  1480. height: 14px;
  1481. cursor: pointer;
  1482. }
  1483. &-name {
  1484. margin-left: 6px;
  1485. flex: 1;
  1486. word-break: break-word;
  1487. color: #1d2129;
  1488. font-size: 14px;
  1489. font-weight: 400;
  1490. line-height: 22px;
  1491. .edit-chn-name {
  1492. margin-left: 4px;
  1493. cursor: pointer;
  1494. }
  1495. }
  1496. .el-button--text {
  1497. padding: 2px 12px;
  1498. color: #165dff;
  1499. .el-icon-plus {
  1500. width: 12px;
  1501. height: 12px;
  1502. margin-right: 8px;
  1503. font-weight: bold;
  1504. }
  1505. }
  1506. }
  1507. .article-list {
  1508. margin: 0;
  1509. padding: 8px;
  1510. list-style: none;
  1511. background: #f7f8fa;
  1512. min-height: 44px;
  1513. border-top: 1px solid #e5e6eb;
  1514. li {
  1515. padding: 13px 20px;
  1516. border-bottom: 1px solid #e5e6eb;
  1517. display: flex;
  1518. align-items: center;
  1519. .svg-icon {
  1520. width: 16px;
  1521. height: 16px;
  1522. cursor: move;
  1523. }
  1524. .edit-article {
  1525. cursor: pointer;
  1526. padding: 8px;
  1527. width: 32px;
  1528. height: 48px;
  1529. }
  1530. .items {
  1531. flex: 1;
  1532. margin: 0 16px;
  1533. h6 {
  1534. font-size: 16px;
  1535. font-weight: 500;
  1536. line-height: 24px;
  1537. margin-bottom: 2px;
  1538. word-break: break-word;
  1539. }
  1540. span {
  1541. color: #1d2129;
  1542. font-size: 14px;
  1543. font-weight: 400;
  1544. line-height: 22px;
  1545. margin-right: 8px;
  1546. }
  1547. }
  1548. .border {
  1549. height: 12px;
  1550. width: 1px;
  1551. display: block;
  1552. background: #e5e6eb;
  1553. }
  1554. .el-icon-delete {
  1555. font-weight: bold;
  1556. cursor: pointer;
  1557. padding: 8px;
  1558. height: 48px;
  1559. line-height: 32px;
  1560. }
  1561. }
  1562. }
  1563. }
  1564. .movers {
  1565. cursor: move;
  1566. }
  1567. }
  1568. </style>
  1569. <style lang="scss">
  1570. .newspaper-create {
  1571. .validity-box {
  1572. // width: 114px;
  1573. .el-input-group {
  1574. width: 114px;
  1575. }
  1576. .el-input__inner {
  1577. text-align: center;
  1578. }
  1579. .el-input-group__append {
  1580. border: none;
  1581. background: #f2f3f5;
  1582. padding: 0 8px 0 0;
  1583. }
  1584. }
  1585. .iss-no-box {
  1586. .el-form-item__content {
  1587. display: flex;
  1588. border-radius: 4px;
  1589. width: 164px;
  1590. }
  1591. .el-input-group {
  1592. width: 82px;
  1593. flex-shrink: 0;
  1594. border-radius: 0 4px 4px 0;
  1595. overflow: hidden;
  1596. }
  1597. .el-input__inner {
  1598. border-radius: 0;
  1599. padding: 0;
  1600. text-align: center;
  1601. }
  1602. .el-input-group__append {
  1603. border: none;
  1604. background: #f2f3f5;
  1605. padding: 0;
  1606. border-radius: 0;
  1607. width: 34px;
  1608. text-align: center;
  1609. }
  1610. .iss-start {
  1611. &.el-input-group {
  1612. border-radius: 4px 0 0 4px;
  1613. }
  1614. .el-input-group__append {
  1615. width: 32px;
  1616. }
  1617. }
  1618. }
  1619. input::-webkit-outer-spin-button,
  1620. input::-webkit-inner-spin-button {
  1621. -webkit-appearance: none !important;
  1622. }
  1623. .el-divider {
  1624. width: 600px;
  1625. }
  1626. .price-box {
  1627. width: 300px;
  1628. display: inline-block;
  1629. .el-form-item__content {
  1630. position: relative;
  1631. .prepend,
  1632. .append {
  1633. position: absolute;
  1634. left: 44px;
  1635. font-size: 14px;
  1636. line-height: 22px;
  1637. color: #1d2129;
  1638. line-height: 34px;
  1639. }
  1640. .append {
  1641. left: 142px;
  1642. }
  1643. }
  1644. }
  1645. .personal-ceil {
  1646. width: 200px;
  1647. .el-input__inner {
  1648. width: 200px;
  1649. padding: 0 60px;
  1650. }
  1651. }
  1652. }
  1653. </style>