index.blade.php 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184
  1. @extends('layouts.base')
  2. @section('title', "商品列表")
  3. @section('content')
  4. <style>
  5. .sort_active{
  6. color: #29BA9C;
  7. }
  8. .el-icon-caret-top{
  9. cursor: pointer;
  10. }
  11. .el-icon-caret-bottom{
  12. cursor: pointer;
  13. }
  14. .el-icon-caret-top:hover{
  15. color: #29BA9C;
  16. }
  17. .el-icon-caret-bottom:hover{
  18. color: #29BA9C;
  19. }
  20. </style>
  21. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods.css')}}"/>
  22. <div id="qrcode" ref="qrcode" style="display:none;"></div>
  23. <div class="rightlist">
  24. <div id="app" v-cloak v-loading="all_loading">
  25. <template>
  26. <div class="second-list">
  27. <div class="third-list">
  28. <div class="form-list">
  29. <el-form :inline="true" :model="search_form" ref="search_form" style="margin-left:10px;">
  30. <el-row>
  31. <el-form-item label="" prop="">
  32. <el-select v-model="search_form.status" placeholder="请选择商品状态" clearable>
  33. <el-option v-for="item in status_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="" prop="">
  37. <el-select v-model="search_form.sell_stock" placeholder="请选择售中库存" clearable>
  38. <el-option v-for="item in sell_stock_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item>
  42. <el-select v-model="search_form.id_v1" placeholder="请选择一级分类" clearable @change="changeV1()" filterable>
  43. <el-option v-for="item in category_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-select v-model="search_form.id_v2" placeholder="请选择二级分类" clearable @change="changeV2()" filterable>
  48. <el-option v-for="item in category_list_v2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item>
  52. <el-select v-model="search_form.id_v3" placeholder="请选择三级分类" clearable v-if="catlevel==3" filterable>
  53. <el-option v-for="item in category_list_v3" :key="item.id" :label="item.name" :value="item.id"></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="" prop="">
  57. <el-select v-model="search_form.brand_id" placeholder="请选择品牌" clearable remote filterable :remote-method="getBrandData">
  58. <el-option v-for="item in brands_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="" prop="">
  62. <el-select v-model="search_form.middleground_configuration_id" placeholder="请选择供应链" clearable remote filterable >
  63. <el-option v-for="item in middleground_configuration" :key="item.id" :label="item.title" :value="item.id"></el-option>
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item label="" prop="keyword">
  67. <el-input v-model="search_form.keyword" placeholder="请输入商品ID或关键字"></el-input>
  68. </el-form-item>
  69. <el-form-item label="" prop="filtering_name">
  70. <el-input v-model="search_form.filtering_name" placeholder="请输入商品标签"></el-input>
  71. </el-form-item>
  72. <el-form-item label="价格区间" prop="">
  73. <el-input v-model="search_form.min_price" placeholder="最低价" style="width:150px;"></el-input>
  74. <el-input v-model="search_form.max_price" placeholder="最高价" style="width:150px;"></el-input>
  75. </el-form-item>
  76. <el-form-item label="毛利率" prop="">
  77. <el-input v-model="search_form.min_ratio" placeholder="最低" style="width:150px;"></el-input>
  78. <el-input v-model="search_form.max_ratio" placeholder="最高" style="width:150px;"></el-input>
  79. </el-form-item>
  80. <el-form-item label="" prop="">
  81. <el-select v-model="search_form.page_size" placeholder="每页条数" clearable>
  82. <el-option v-for="item in page_size" :key="item.id" :label="item.name" :value="item.id"></el-option>
  83. </el-select>
  84. </el-form-item>
  85. <el-form-item>
  86. <el-select v-model="search_form.is_hide" placeholder="请选择商品是否显示" clearable>
  87. <el-option label="显示" value="1"></el-option>
  88. <el-option label="隐藏" value="2"></el-option>
  89. </el-select>
  90. </el-form-item>
  91. <el-form-item label="" prop="">
  92. <el-select v-model="search_form.source_id" placeholder="请选择商品来源" clearable v-if="is_source_open">
  93. <el-option v-for="item in source_list" :key="item.id" :label="item.source_name" :value="item.id"></el-option>
  94. </el-select>
  95. </el-form-item>
  96. <el-form-item label="商品类型" prop="leader_name">
  97. <el-checkbox v-model.number="search_form.is_new" :true-label="1" :false-label="0">新品</el-checkbox>
  98. <el-checkbox v-model.number="search_form.is_hot" :true-label="1" :false-label="0">热卖</el-checkbox>
  99. <el-checkbox v-model.number="search_form.is_recommand" :true-label="1" :false-label="0">推荐</el-checkbox>
  100. <el-checkbox v-model.number="search_form.is_discount" :true-label="1" :false-label="0">促销</el-checkbox>
  101. </el-form-item>
  102. <a href="#">
  103. <el-button type="primary" icon="el-icon-search" @click="search(1)">搜索</el-button>
  104. </a>
  105. </el-col>
  106. </el-row>
  107. </el-form>
  108. </div>
  109. <div class="table-list">
  110. <div style="margin-left:10px;">
  111. <el-checkbox v-model.number="is_all_choose" :true-label="1" :false-label="0" @change="allChoose">[[is_all_choose==1?'全不选':'全选']]</el-checkbox>
  112. <el-button size="small" @click="batchPutAway(1)">批量上架</el-button>
  113. <el-button size="small" @click="batchPutAway(0)">批量下架</el-button>
  114. <el-button size="small" @click="batchDestroy">批量删除</el-button>
  115. <el-button size="small" @click="batchUpdate">批量更新</el-button>
  116. <el-button size="small" @click="UpdateJob">一键更新</el-button>
  117. <el-button size="small" @click="openCategory">批量修改分类</el-button>
  118. <el-button size="small" @click="setLocks(1)">批量锁定</el-button>
  119. <el-button size="small" @click="setLocks(2)">批量解锁</el-button>
  120. </div>
  121. <div style="color: red;margin:10px;">*如果锁定商品状态,第三方商品上下架,更新时触发风控都不会改变商品在商城的上下架状态</div>
  122. <div>
  123. @section('search')
  124. <template>
  125. <!-- 表格start -->
  126. <el-table :data="goods_list" style="width: 100%" :class="table_loading==true?'loading-height':''" v-loading="table_loading">
  127. <el-table-column prop="id" label="选择" width="60" align="center">
  128. <template slot-scope="scope">
  129. <el-checkbox v-model.number="scope.row.is_choose" :true-label="1" :false-label="0" @change="oneChange(scope.row)"></el-checkbox>
  130. </template>
  131. </el-table-column>
  132. <el-table-column prop="id" label="ID" width="70" align="center"></el-table-column>
  133. </el-table-column>
  134. <el-table-column prop="member_name" label="排序" max-width="80" align="center">
  135. <template slot-scope="scope">
  136. <el-popover class="item" placement="top" effect="light">
  137. <div style="text-align:center;">
  138. <el-input v-model="change_sort" size="small" style="width:100px;"></el-input>
  139. <el-button size="small" @click="confirmChangeSort(scope.row.id)">确定</el-button>
  140. </div>
  141. <a slot="reference" >
  142. <i class="el-icon-edit edit-i" title="点击编辑排序" @click="editTitle(scope.$index,'sort')"></i>
  143. </a>
  144. </el-popover>
  145. [[scope.row.display_order]]
  146. </template>
  147. </el-table-column>
  148. <el-table-column prop="total" label="商品" width="60" align="center">
  149. <template slot-scope="scope">
  150. <img :src="scope.row.thumb" style="width:50px;height:50px;">
  151. </template>
  152. </el-table-column>
  153. <el-table-column prop="down_time" label="" min-width="180" align="left" class="edit-cell">
  154. <template slot-scope="scope">
  155. <el-popover class="item" placement="top" effect="light">
  156. <div style="text-align:center;">
  157. <div style="text-align:left;margin-bottom:10px;font-weight:900">修改商品标题</div>
  158. <el-input v-model="change_title" style="width:400px" size="small"></el-input>
  159. <el-button size="small" @click="confirmChange(scope.row.id,'title')">确定</el-button>
  160. </div>
  161. <a slot="reference">
  162. <i class="el-icon-edit edit-i" title="点击编辑" @click="editTitle(scope.$index,'title')"></i>
  163. </a>
  164. </el-popover>
  165. [[scope.row.title]]
  166. </template>
  167. </el-table-column>
  168. <el-table-column prop="title" label="供应链名称" width="150" align="center">
  169. <template slot-scope="scope" v-if="scope.row.has_one_yz_goods">
  170. [[scope.row.has_one_yz_goods.has_one_middleground_configuration.title]]
  171. </template>
  172. </el-table-column>
  173. <el-table-column prop="member_num" label="价格" max-width="80" align="center">
  174. <template slot="header" slot-scope="scope">
  175. <div style="display: flex;align-items: center;justify-content:center">
  176. <span>价格</span>
  177. <div style="display: flex;flex-direction: column;margin-left: 5px;">
  178. <i class="el-icon-caret-top" :class="sort_price == 'asc' ? 'sort_active' : '' " @click="btnPositiveSequence('price')" ></i>
  179. <i class="el-icon-caret-bottom" :class="sort_price == 'desc' ? 'sort_active' : '' " @click="btnReverseOrder('price')"></i>
  180. </div>
  181. </div>
  182. </template>
  183. <template slot-scope="scope">
  184. <el-popover class="item" placement="top" effect="light"
  185. :disabled="scope.row.has_option==1">
  186. <div style="text-align:center;">
  187. <el-input v-model="change_price" size="small"
  188. style="width:100px;"></el-input>
  189. <el-button size="small"
  190. @click="confirmChange(scope.row.id,'price')">确定
  191. </el-button>
  192. </div>
  193. <a slot="reference">
  194. <i class="el-icon-edit edit-i"
  195. :title="scope.row.has_option==1?'多规格不支持快速修改':'点击编辑'"
  196. @click="editTitle(scope.$index,'price')"></i>
  197. </a>
  198. </el-popover>
  199. ¥[[scope.row.price]]
  200. </template>
  201. </el-table-column>
  202. <el-table-column prop="member_num" label="成本价" width="80" align="center">
  203. <template slot-scope="scope">
  204. ¥[[scope.row.cost_price]]
  205. </template>
  206. </el-table-column>
  207. <el-table-column prop="member_num" label="毛利率" width="80" align="center">
  208. <template slot-scope="scope" >
  209. <div v-if="scope.row.price != 0"> [[((scope.row.price - scope.row.cost_price)* 100 /scope.row.price).toFixed(2)]]% </div>
  210. <div v-else>0%</div>
  211. </template>
  212. </el-table-column>
  213. <el-table-column label="库存" align="center" max-width="80">
  214. <template slot="header" slot-scope="scope">
  215. <div style="display: flex;align-items: center;justify-content:center">
  216. <span>库存</span>
  217. <div style="display: flex;flex-direction: column;margin-left: 5px;">
  218. <i class="el-icon-caret-top" :class="sort_stock == 'asc' ? 'sort_active' : '' " @click="btnPositiveSequence('stock')" ></i>
  219. <i class="el-icon-caret-bottom" :class="sort_stock == 'desc' ? 'sort_active' : '' " @click="btnReverseOrder('stock')"></i>
  220. </div>
  221. </div>
  222. </template>
  223. <template slot-scope="scope">
  224. <el-popover class="item" placement="top" effect="light"
  225. :disabled="scope.row.has_option==1">
  226. <div style="text-align:center;">
  227. <el-input v-model="change_stock" size="small"
  228. style="width:100px;"></el-input>
  229. <el-button size="small"
  230. @click="confirmChange(scope.row.id,'stock')">确定
  231. </el-button>
  232. </div>
  233. <a slot="reference">
  234. <i class="el-icon-edit edit-i"
  235. :title="scope.row.has_option==1?'多规格不支持快速修改':'点击编辑'"
  236. @click="editTitle(scope.$index,'stock')"></i>
  237. </a>
  238. </el-popover>
  239. [[scope.row.stock]]
  240. </template>
  241. </el-table-column>
  242. <el-table-column prop="real_sales" label="销量" max-width="80" align="center">
  243. <template slot="header" slot-scope="scope">
  244. <div style="display: flex;align-items: center;justify-content:center">
  245. <span>销量</span>
  246. <div style="display: flex;flex-direction: column;margin-left: 5px;">
  247. <i class="el-icon-caret-top" :class="sort_sales == 'asc' ? 'sort_active' : '' " @click="btnPositiveSequence('sales')" ></i>
  248. <i class="el-icon-caret-bottom" :class="sort_sales == 'desc' ? 'sort_active' : '' " @click="btnReverseOrder('sales')"></i>
  249. </div>
  250. </div>
  251. </template>
  252. </el-table-column>
  253. <el-table-column class="goods_status" prop="stock" >
  254. <template slot="header" slot-scope="scope">
  255. <p>商品状态</p>
  256. <p>锁定状态</p>
  257. </template>
  258. <template slot-scope="scope" >
  259. [[scope.row.status?'上架':'下架']]
  260. <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" @change="putAway(scope.row.id,scope.$index)"></el-switch>
  261. <p v-if="scope.row.has_one_yz_goods">
  262. [[scope.row.has_one_yz_goods.is_lock_status == 2?'未锁':'锁定']]
  263. <el-switch v-model="scope.row.has_one_yz_goods.is_lock_status" :active-value="1" :inactive-value="2" @change="setLock(scope.row.id,scope.$index)"></el-switch>
  264. </p>
  265. </template>
  266. </el-table-column>
  267. <el-table-column label="操作" width="320" align="center">
  268. <template slot-scope="scope">
  269. <div class="table-option">
  270. <el-popover class="item" placement="left" effect="light"
  271. trigger="hover">
  272. <div style="text-align:center;">
  273. <img :src="smallImg" alt=""
  274. style="margin:10px;width:100px;height:100px;">
  275. </div>
  276. <a slot="reference" @mouseover="SmallCode(scope.$index)" :href="'{{ yzWebFullUrl('plugin.yz-supply.admin.shop-goods.generate-small-code', array('id' => '')) }}'+[[scope.row.id]]">小程序</a>
  277. </el-popover>&nbsp;
  278. <el-popover class="item" placement="left" effect="light" trigger="hover">
  279. <div style="text-align:center;">
  280. <img :src="img" alt="" style="margin:10px;width:100px;height:100px;">
  281. </div>
  282. <a slot="reference" @mouseover="listCode(scope.$index)">推广链接</a>
  283. </el-popover>&nbsp;
  284. <a v-if="isUpdatePrice == 1" :href="'{{ yzWebFullUrl('plugin.yz-supply.admin.shop-goods.edit', array('id' => '')) }}'+[[scope.row.id]]">
  285. 编辑
  286. </a>&nbsp;
  287. <a @click="delOne(scope.row.id)">
  288. 删除
  289. </a>&nbsp;
  290. <a @click="copyList(scope.row.id)">
  291. 复制链接
  292. </a>&nbsp;
  293. <a :href="'{{ yzWebFullUrl('plugin.yz-supply.admin.shop-goods.update-yz-goods', array('id' => '')) }}'+[[scope.row.id]]">
  294. 更新商品
  295. </a>
  296. <div>
  297. <input v-model="scope.row.link" :ref="'list'+scope.row.id" style="position:absolute;opacity:0;height:1px;" />
  298. </div>
  299. </div>
  300. <div>
  301. <el-checkbox border size="mini" v-model.number="scope.row.is_new" :true-label="1" :false-label="0" @change="setProperty(scope.row.id,scope.$index,'is_new')">新品</el-checkbox>
  302. <el-checkbox border size="mini" v-model.number="scope.row.is_hot" :true-label="1" :false-label="0" @change="setProperty(scope.row.id,scope.$index,'is_hot')">热卖</el-checkbox>
  303. <el-checkbox border size="mini" v-model.number="scope.row.is_recommand" :true-label="1" :false-label="0" @change="setProperty(scope.row.id,scope.$index,'is_recommand')">推荐</el-checkbox>
  304. <el-checkbox border size="mini" v-model.number="scope.row.is_discount" :true-label="1" :false-label="0" @change="setProperty(scope.row.id,scope.$index,'is_discount')">促销</el-checkbox>
  305. </div>
  306. </template>
  307. </el-table-column>
  308. </el-table>
  309. <!-- 表格end -->
  310. </template>
  311. @show
  312. </div>
  313. </div>
  314. </div>
  315. <el-dialog :visible.sync="category_show" width="60%" center title="选择分类">
  316. <div style="height:500px">
  317. <el-select v-model="batch_v1" placeholder="请选择一级分类" clearable @change="batchChangeV1($event)" :style="{width:catlevel==3?'33%':'48%'}">
  318. <el-option v-for="(item,index) in batch_category" :key="item.id" :label="item.name" :value="item.id"></el-option>
  319. </el-select>
  320. <el-select v-model="batch_v2" placeholder="请选择二级分类" clearable @change="batchChangeV2($event)" :style="{width:catlevel==3?'33%':'48%'}">
  321. <el-option v-for="item in batch_category_v2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  322. </el-select>
  323. <el-select v-model="batch_v3" placeholder="请选择三级分类" clearable v-if="catlevel==3" style="width:33%">
  324. <el-option v-for="item in batch_category_v3" :key="item.id" :label="item.name" :value="item.id"></el-option>
  325. </el-select>
  326. </div>
  327. <span slot="footer" class="dialog-footer">
  328. <el-button @click="category_show = false">取 消</el-button>
  329. <el-button type="primary" @click="batchCategory">确 定 </el-button>
  330. </span>
  331. </el-dialog>
  332. <!-- 分页 -->
  333. <div class="vue-page" v-show="total>1">
  334. <el-row>
  335. <el-col align="right">
  336. <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total" :page-size="per_size" :current-page="current_page" background v-loading="loading"></el-pagination>
  337. </el-col>
  338. </el-row>
  339. </div>
  340. </div>
  341. </template>
  342. </div>
  343. </div>
  344. <script src="{{resource_get('static/js/qrcode.min.js')}}"></script>
  345. <script>
  346. var app = new Vue({
  347. el:"#app",
  348. delimiters: ['[[', ']]'],
  349. data() {
  350. let topic_id = '{!! $topic_id !!}';
  351. return{
  352. isUpdatePrice:2,
  353. //批量修改分类
  354. batch_category:[],
  355. batch_category_v2:[],
  356. batch_category_v3:[],
  357. batch_v1:'',
  358. batch_v2:'',
  359. batch_v3:'',
  360. category_show:false,
  361. middleground_configuration:[],
  362. middleground_configuration_id:0,
  363. id:"",
  364. img:"",//二维码
  365. smallImg:"",//小程序二维码
  366. catlevel:0,//是否显示三级分类
  367. is_all_choose:0,//是否全选
  368. goods_list:[],//商品列表
  369. change_title:"",//修改标题弹框赋值
  370. change_price:"",//修改价格弹框赋值
  371. change_stock:"",//修改库存弹框赋值
  372. change_sort:"",//修改排序弹框赋值
  373. all_loading:false,
  374. status_list:[
  375. {id:'',name:'全部状态'},
  376. {id:0,name:'下架'},
  377. {id:1,name:'上架'},
  378. ],
  379. page_size:[
  380. {id:'',name:''},
  381. {id:20,name:'20条'},
  382. {id:50,name:'50条'},
  383. {id:100,name:'100条'},
  384. ],
  385. sell_stock_list:[
  386. {id:'',name:'全部'},
  387. {id:0,name:'售罄'},
  388. {id:1,name:'出售中'},
  389. ],
  390. brands_list:[],//品牌名称
  391. category_list:[],
  392. category_list_v2:[],
  393. category_list_v3:[],
  394. search_form:{
  395. topic_id:topic_id,
  396. id_v1:'',
  397. id_v2:'',
  398. id_v3:''
  399. },
  400. form:{},
  401. level_list:[],
  402. loading:false,
  403. table_loading:false,
  404. rules:{},
  405. //分页
  406. total:0,
  407. per_size:0,
  408. current_page:0,
  409. rules:{},
  410. sort_price:"",
  411. sort_stock:"",
  412. sort_sales:"",
  413. source_list:[],
  414. is_source_open:0,
  415. }
  416. },
  417. created() {
  418. this.getData();
  419. this.getMiddlegroundConfiguration();
  420. },
  421. methods: {
  422. btnPositiveSequence(val){
  423. switch (val) {
  424. case 'price'://价格
  425. this.sort_price = this.sort_price == 'asc'? '' : 'asc';
  426. break;
  427. case 'stock': //库存
  428. this.sort_stock = this.sort_stock == 'asc'? '' : 'asc';
  429. break;
  430. case 'sales': //销量
  431. this.sort_sales = this.sort_sales == 'asc'? '' : 'asc';
  432. break;
  433. default:
  434. break;
  435. }
  436. this.search(1);
  437. },
  438. btnReverseOrder(val){
  439. switch (val) {
  440. case 'price'://价格
  441. this.sort_price = this.sort_price == 'desc'? '' : 'desc';
  442. break;
  443. case 'stock': //库存
  444. this.sort_stock = this.sort_stock == 'desc'? '' : 'desc';
  445. break;
  446. case 'sales': //销量
  447. this.sort_sales = this.sort_sales == 'desc'? '' : 'desc';
  448. break;
  449. default:
  450. break;
  451. }
  452. this.search(1);
  453. },
  454. //一键解锁与锁定
  455. setLocks(status){
  456. var that = this;
  457. var msg = "解定";
  458. if(status == 1) {
  459. msg = "锁定"
  460. }
  461. let ids = [];
  462. that.goods_list.forEach((item,index) => {
  463. if(item.is_choose == 1){
  464. ids.push(item.id);
  465. }
  466. })
  467. that.$confirm('确定'+msg+'吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  468. that.table_loading = true;
  469. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.set-locks') !!}",{status:status,ids:ids}).then(response => {
  470. console.log(response);
  471. if(response.data.result==1){
  472. that.$message.success(""+msg+"成功!");
  473. that.search(1);
  474. }
  475. else{
  476. that.$message.error(response.data.msg);
  477. }
  478. that.table_loading = false;
  479. }),function(res){
  480. console.log(res);
  481. that.table_loading = false;
  482. };
  483. }).catch(() => {
  484. this.$message({type: 'info',message: '已取消'});
  485. });
  486. },
  487. /**
  488. * 锁定与解锁
  489. * @param item
  490. */
  491. setLock(id,index){
  492. var that = this;
  493. that.table_loading = true;
  494. let json = {id:id};
  495. // yzWebFullUrl('plugin.yz-supply.admin.shop-goods.goods-search')
  496. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.set-lock') !!}",json).then(response => {
  497. console.log(response);
  498. if(response.data.result==1){
  499. that.$message.success('操作成功!');
  500. }
  501. else{
  502. that.$message.error(response.data.msg);
  503. that.goods_list[index].has_one_yz_goods.is_lock_status == 1 ? 2 : 1;
  504. }
  505. that.table_loading = false;
  506. }),function(res){
  507. console.log(res);
  508. that.table_loading = false;
  509. };
  510. },
  511. getMiddlegroundConfiguration(){
  512. this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.get-middleground-configurations') !!}',{"is_all":1}).then(function (response) {
  513. if (response.data.result) {
  514. this.middleground_configuration = response.data.data;
  515. } else {
  516. this.$message({message: response.data.msg, type: 'error'});
  517. }
  518. }, function (response) {
  519. this.$message({message: response.data.msg, type: 'error'});
  520. })
  521. },
  522. getData() {
  523. var that = this;
  524. that.table_loading = true;
  525. let json = {
  526. search:{
  527. topic_id:that.search_form.topic_id,//商品专题
  528. },
  529. };
  530. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.goods-list') !!}",json).then(response => {
  531. console.log(response);
  532. if(response.data.result==1){
  533. that.goods_list = response.data.data.list.data;
  534. let arr =[];
  535. that.goods_list.forEach((item,index) => {
  536. item.title = that.escapeHTML(item.title)
  537. arr.push(Object.assign({},item,{is_choose:0}))//是否选中
  538. });
  539. that.goods_list=arr;
  540. that.isUpdatePrice = response.data.data.isUpdatePrice;
  541. that.total = response.data.data.list.total;
  542. that.current_page = response.data.data.list.current_page;
  543. that.per_size = response.data.data.list.per_page;
  544. that.brands_list = response.data.data.brands;
  545. that.category_list = response.data.data.catetory;
  546. that.catlevel = response.data.data.cat_level;
  547. that.catlevel = response.data.data.cat_level;
  548. that.catlevel = response.data.data.cat_level;
  549. that.source_list = response.data.data.source_list;
  550. that.is_source_open = response.data.data.is_source_open;
  551. console.log(that.goods_list);
  552. }
  553. else{
  554. that.$message.error(response.data.msg);
  555. }
  556. that.table_loading = false;
  557. }),function(res){
  558. console.log(res);
  559. that.table_loading = false;
  560. };
  561. },
  562. // 一级分类改变
  563. changeV1(){
  564. if(this.search_form.id_v1 == ""){
  565. return true;
  566. }
  567. let that = this;
  568. this.search_form.id_v2 = "";
  569. this.search_form.id_v3 = "";
  570. this.category_list_v2 = [];
  571. this.category_list_v3 = [];
  572. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.get-parent-category') !!}",{level:2,parent_id:this.search_form.id_v1}).then(response => {
  573. if (response.data.result == 1) {
  574. this.category_list_v2 = response.data.data;
  575. } else {
  576. that.$message.error(response.data.msg);
  577. }
  578. }), function (res) {
  579. //console.log(res);
  580. };
  581. this.category_list.find(item => {
  582. if (item.id == this.search_form.id_v1) {
  583. this.category_list_v2 = item.childrens;
  584. }
  585. });
  586. },
  587. // 二级分类改变
  588. changeV2(){
  589. if(this.search_form.id_v2 == ""){
  590. return true;
  591. }
  592. let that = this;
  593. this.search_form.id_v3 = "";
  594. this.category_list_v3 = [];
  595. if(this.catlevel==3) {
  596. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.category.get-categorys-json') !!}",{level:3,parent_id:this.search_form.id_v2}).then(response => {
  597. if (response.data.result == 1) {
  598. this.category_list_v3 = response.data.data;
  599. } else {
  600. that.$message.error(response.data.msg);
  601. }
  602. }), function (res) {
  603. //console.log(res);
  604. };
  605. }
  606. },
  607. getBrandData(keyword) {
  608. if(keyword=="") {
  609. return;
  610. }
  611. let that = this;
  612. that.$http.post("{!! yzWebFullUrl('goods.brand.search-brand') !!}",{keyword:keyword}).then(response => {
  613. if (response.data.result == 1) {
  614. this.brands_list = response.data.data;
  615. } else {
  616. that.$message.error(response.data.msg);
  617. }
  618. }), function (res) {
  619. //console.log(res);
  620. };
  621. },
  622. // 搜索、分页
  623. search(page) {
  624. var that = this;
  625. console.log(that.search_form)
  626. // 商品类型
  627. let product_attr = [];
  628. if(that.search_form.is_new == 1){
  629. product_attr.push('is_new')
  630. }
  631. if(that.search_form.is_hot == 1){
  632. product_attr.push('is_hot')
  633. }
  634. if(that.search_form.is_recommand == 1){
  635. product_attr.push('is_recommand')
  636. }
  637. if(that.search_form.is_discount == 1){
  638. product_attr.push('is_discount')
  639. }
  640. let order_by = {};
  641. if (this.sort_price) {
  642. order_by.price = this.sort_price;
  643. }
  644. if (this.sort_stock) {
  645. order_by.stock = this.sort_stock;
  646. }
  647. if (this.sort_sales) {
  648. order_by.real_sales = this.sort_sales;
  649. }
  650. let json = {
  651. page:page,
  652. order_by:order_by,
  653. search:{
  654. keyword:that.search_form.keyword,
  655. status:that.search_form.status,
  656. sell_stock:that.search_form.sell_stock,
  657. brand_id:that.search_form.brand_id,
  658. min_price:that.search_form.min_price,
  659. max_price:that.search_form.max_price,
  660. min_ratio:that.search_form.min_ratio,
  661. max_ratio:that.search_form.max_ratio,
  662. is_hide:that.search_form.is_hide,
  663. filtering_name:that.search_form.filtering_name,
  664. product_attr:product_attr,//商品类型
  665. page_size:that.search_form.page_size,//商品类型
  666. middleground_configuration_id:that.search_form.middleground_configuration_id,
  667. topic_id:that.search_form.topic_id,//商品专题
  668. source_id:that.search_form.source_id,//商品来源
  669. },
  670. category:{
  671. parentid:that.search_form.id_v1,
  672. childid:that.search_form.id_v2,
  673. thirdid:that.search_form.id_v3,
  674. }
  675. };
  676. that.table_loading = true;
  677. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.goods-search') !!}",json).then(response => {
  678. if(response.data.result==1){
  679. let arr = [];
  680. that.goods_list = response.data.data.data;
  681. that.goods_list.forEach((item,index) => {
  682. item.title = that.escapeHTML(item.title)
  683. arr.push(Object.assign({},item,{is_choose:0}))//是否选中
  684. });
  685. that.goods_list=arr;
  686. that.total = response.data.data.total;
  687. that.current_page = response.data.data.current_page;
  688. that.per_size = response.data.data.per_page;
  689. }
  690. else{
  691. that.$message.error(response.data.msg);
  692. }
  693. that.table_loading = false;
  694. }),function(res){
  695. console.log(res);
  696. that.table_loading = false;
  697. };
  698. },
  699. qrcodeScan (url) {//生成二维码
  700. let qrcode = new QRCode('qrcode', {
  701. width: 100, // 二维码宽度
  702. height: 100, // 二维码高度
  703. render: 'image',
  704. text: url
  705. });
  706. var data = $("canvas")[$("canvas").length-1].toDataURL().replace("image/png", "image/octet-stream;");
  707. console.log(data)
  708. this.img = data;
  709. },
  710. // 活动二维码
  711. listCode(index) {
  712. this.qrcodeScan(this.goods_list[index].link);
  713. },
  714. // 小程序二维码
  715. SmallCode(index) {
  716. this.smallImg = this.goods_list[index].small_link;
  717. },
  718. // 复制活动链接
  719. copyList(index) {
  720. that = this;
  721. let Url = that.$refs['list'+index];
  722. console.log(Url)
  723. Url.select(); // 选择对象
  724. document.execCommand("Copy",false);
  725. that.$message({message:"复制成功!",type:"success"});
  726. },
  727. // 单个选择
  728. oneChange(item) {
  729. let that = this;
  730. let is_all = 0;
  731. that.goods_list.some((item,index) => {
  732. if(item.is_choose == 1) {
  733. is_all = 1;
  734. }
  735. else {
  736. is_all = 0;
  737. return true;
  738. }
  739. })
  740. that.is_all_choose = is_all;
  741. },
  742. // 全选
  743. allChoose() {
  744. let that = this;
  745. let status = 0;
  746. if(that.is_all_choose == 1){
  747. status = 1;
  748. }
  749. else{
  750. status = 0;
  751. }
  752. that.goods_list.forEach((item,index) => {
  753. item.is_choose = status;
  754. })
  755. },
  756. // 上架、下架
  757. putAway(id,index) {
  758. var that = this;
  759. that.table_loading = true;
  760. let data = that.goods_list[index].status;
  761. let json = {id:id,type:'status',data:data};
  762. // yzWebFullUrl('plugin.yz-supply.admin.shop-goods.goods-search')
  763. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.setPutaway') !!}",json).then(response => {
  764. console.log(response);
  765. if(response.data.result==1){
  766. that.$message.success('操作成功!');
  767. }
  768. else{
  769. that.$message.error(response.data.msg);
  770. that.goods_list[index].is_choose == 1 ? 0 : 1;
  771. }
  772. that.table_loading = false;
  773. }),function(res){
  774. console.log(res);
  775. that.table_loading = false;
  776. };
  777. },
  778. // 批量上架、下架
  779. batchPutAway(data) {
  780. var that = this;
  781. that.table_loading = true;
  782. let ids = [];
  783. that.goods_list.forEach((item,index) => {
  784. if(item.is_choose == 1){
  785. ids.push(item.id);
  786. }
  787. })
  788. let json = {data:data,ids:ids}
  789. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.batchSetProperty') !!}",json).then(response => {
  790. console.log(response);
  791. if(response.data.result==1){
  792. that.$message.success('操作成功!');
  793. that.is_all_choose = 0;
  794. that.search(1);
  795. }
  796. else{
  797. that.$message.error(response.data.msg);
  798. }
  799. that.table_loading = false;
  800. }),function(res){
  801. console.log(res);
  802. that.table_loading = false;
  803. };
  804. },
  805. // 单个删除
  806. delOne(id) {
  807. var that = this;
  808. that.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  809. that.table_loading = true;
  810. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.delete') !!}",{id:id}).then(response => {
  811. console.log(response);
  812. if(response.data.result==1){
  813. that.$message.success("删除成功!");
  814. that.search(1);
  815. }
  816. else{
  817. that.$message.error(response.data.msg);
  818. }
  819. that.table_loading = false;
  820. }),function(res){
  821. console.log(res);
  822. that.table_loading = false;
  823. };
  824. }).catch(() => {
  825. this.$message({type: 'info',message: '已取消修改'});
  826. });
  827. },
  828. // 一键更新
  829. UpdateJob() {
  830. var that = this;
  831. let job_num = 0;
  832. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.update-job-nums') !!}").then(response => {
  833. if(response.data.result==1){
  834. job_num = response.data.data.nums;
  835. let job = Math.ceil(this.total / 20);
  836. console.log(job);
  837. that.$confirm('一键更新所有供应链商品。该操作将产生'+job+'条队列。可能造成商城其他队列延迟执行,队列堵塞等情况,建议开启多个队列运行,请谨慎操作(每条队列所需时间约等于批量更新20条商品所需时间,当前约有'+job_num +'条队列等待执行)', '提示', {confirmButtonText: '确定更新',cancelButtonText: '取消',type: 'warning'}).then(() => {
  838. that.table_loading = true;
  839. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.update-job') !!}").then(response => {
  840. console.log(response);
  841. if(response.data.result==1){
  842. that.$message.success('队列生成成功!');
  843. that.is_all_choose = 0;
  844. that.search(1);
  845. }
  846. else{
  847. that.$message.error(response.data.msg);
  848. }
  849. that.table_loading = false;
  850. }),function(res){
  851. console.log(res);
  852. that.table_loading = false;
  853. };
  854. }).catch(() => {
  855. this.$message({type: 'info',message: '已取消'});
  856. });
  857. }
  858. }),function(res){
  859. console.log(res);
  860. };
  861. },
  862. // 批量删除
  863. batchDestroy() {
  864. var that = this;
  865. that.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  866. that.table_loading = true;
  867. let ids = [];
  868. that.goods_list.forEach((item,index) => {
  869. if(item.is_choose == 1){
  870. ids.push(item.id);
  871. }
  872. })
  873. let json = {ids:ids}
  874. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.batch-delete') !!}",json).then(response => {
  875. console.log(response);
  876. if(response.data.result==1){
  877. that.$message.success('操作成功!');
  878. that.is_all_choose = 0;
  879. that.search(1);
  880. }
  881. else{
  882. that.$message.error(response.data.msg);
  883. }
  884. that.table_loading = false;
  885. }),function(res){
  886. console.log(res);
  887. that.table_loading = false;
  888. };
  889. }).catch(() => {
  890. this.$message({type: 'info',message: '已取消修改'});
  891. });
  892. },
  893. // 批量更新
  894. batchUpdate() {
  895. var that = this;
  896. that.$confirm('确定更新吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
  897. that.table_loading = true;
  898. let ids = [];
  899. that.goods_list.forEach((item,index) => {
  900. if(item.is_choose == 1){
  901. ids.push(item.id);
  902. }
  903. })
  904. let json = {ids:ids}
  905. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.batchUpdate') !!}",json).then(response => {
  906. console.log(response);
  907. if(response.data.result==1){
  908. that.$message.success(response.data.msg);
  909. that.is_all_choose = 0;
  910. that.search(1);
  911. }
  912. else{
  913. that.$message.error(response.data.msg);
  914. }
  915. that.table_loading = false;
  916. }),function(res){
  917. console.log(res);
  918. that.table_loading = false;
  919. };
  920. }).catch(() => {
  921. this.$message({type: 'info',message: '已取消修改'});
  922. });
  923. },
  924. // 新品、热卖、推荐、促销、
  925. setProperty(id,index,type) {
  926. var that = this;
  927. that.table_loading = true;
  928. console.log(that.goods_list[index][type])
  929. let data = that.goods_list[index][type];
  930. let json = {id:id,type:type,data:data};
  931. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.setProperty') !!}",json).then(response => {
  932. console.log(response);
  933. if(response.data.result==1){
  934. that.$message.success('操作成功!');
  935. }
  936. else{
  937. that.$message.error(response.data.msg);
  938. that.goods_list[index][type] == 1 ? 0 : 1;
  939. }
  940. that.table_loading = false;
  941. }),function(res){
  942. console.log(res);
  943. that.table_loading = false;
  944. };
  945. },
  946. // 编辑商品标题
  947. editTitle(index,type) {
  948. let that = this;
  949. if(type == 'title') {
  950. that.change_title = "";
  951. that.change_title = that.goods_list[index].title;
  952. }
  953. if(type == 'price') {
  954. if(that.goods_list[index].has_option == 1) {
  955. that.$message.error('多规格不支持快速修改');
  956. return false;
  957. }
  958. that.change_price = "";
  959. that.change_price = that.goods_list[index].price;
  960. }
  961. if(type == 'stock') {
  962. if(that.goods_list[index].has_option == 1) {
  963. that.$message.error('多规格不支持快速修改');
  964. return false;
  965. }
  966. that.change_stock = "";
  967. that.change_stock = that.goods_list[index].stock;
  968. }
  969. if(type == 'sort') {
  970. that.change_sort = "";
  971. that.change_sort = that.goods_list[index].display_order;
  972. }
  973. },
  974. // 确认修改标题、价格、库存
  975. confirmChange(id,type) {
  976. let that = this;
  977. let value = '';
  978. if(type == 'title'){
  979. value = that.change_title;
  980. if(that.change_title == ''){
  981. that.$message.error('标题不能为空');
  982. return false;
  983. }
  984. }
  985. if(type == 'price'){
  986. value = that.change_price;
  987. if(!(/^\d+(\.\d+)?$/.test(that.change_price))){
  988. that.$message.error('请输入正确价格');
  989. return false;
  990. }
  991. }
  992. if(type == 'stock'){
  993. value = that.change_stock;
  994. if(!(/^\d+$/.test(that.change_stock))){
  995. that.$message.error('请输入正确数字');
  996. return false;
  997. }
  998. }
  999. let json = {
  1000. id:id,
  1001. type:type,
  1002. value:value,
  1003. };
  1004. that.table_loading = true;
  1005. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.change') !!}",json).then(response => {
  1006. console.log(response);
  1007. if(response.data.result==1){
  1008. that.$message.success('操作成功!');
  1009. if (document.all) {
  1010. document.getElementById('app').click();
  1011. }
  1012. else {// 其它浏览器
  1013. var e = document.createEvent('MouseEvents')
  1014. e.initEvent('click', true, true)
  1015. document.getElementById('app').dispatchEvent(e)
  1016. }
  1017. that.search(1);
  1018. }
  1019. else{
  1020. that.$message.error(response.data.msg);
  1021. }
  1022. that.table_loading = false;
  1023. }),function(res){
  1024. console.log(res);
  1025. that.table_loading = false;
  1026. };
  1027. },
  1028. // 确认修改排序
  1029. confirmChangeSort(id) {
  1030. let that = this;
  1031. if(!(/^\d+$/.test(that.change_sort))){
  1032. that.$message.error('请输入正确数字');
  1033. return false;
  1034. }
  1035. that.table_loading = true;
  1036. let json = {id:id,value:that.change_sort};
  1037. that.$http.post("{!! yzWebFullUrl('goods.goods.displayorder') !!}",json).then(response => {
  1038. console.log(response);
  1039. if(response.data.result==1){
  1040. that.$message.success('操作成功!');
  1041. // that.$refs.search_form.click();
  1042. if (document.all) {
  1043. document.getElementById('app').click();
  1044. }
  1045. else {// 其它浏览器
  1046. var e = document.createEvent('MouseEvents')
  1047. e.initEvent('click', true, true)
  1048. document.getElementById('app').dispatchEvent(e)
  1049. }
  1050. that.search(1);
  1051. }
  1052. else{
  1053. that.$message.error(response.data.msg);
  1054. }
  1055. that.table_loading = false;
  1056. }),function(res){
  1057. console.log(res);
  1058. that.table_loading = false;
  1059. };
  1060. },
  1061. // 批量修改分类-打开分类选择框
  1062. openCategory() {
  1063. this.category_show = true;
  1064. if(this.batch_category.length==0) {
  1065. this.getBatchCategory();
  1066. }
  1067. },
  1068. getBatchCategory() {
  1069. var that = this;
  1070. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.category.get-all-shop-category') !!}", {}).then(response => {
  1071. console.log(response);
  1072. if (response.data.result == 1) {
  1073. this.batch_category = response.data.data.list;
  1074. } else {
  1075. that.$message.error(response.data.msg);
  1076. }
  1077. }), function (res) {
  1078. console.log(res);
  1079. };
  1080. },
  1081. batchCategory() {
  1082. let that = this;
  1083. let json = {
  1084. level_1:this.batch_v1,
  1085. level_2:this.batch_v2,
  1086. goods_id_arr:[],
  1087. };
  1088. if(!json.level_1) {
  1089. this.$message.error('请选择一级分类')
  1090. return;
  1091. }
  1092. if(!json.level_2) {
  1093. this.$message.error('请选择二级分类')
  1094. return;
  1095. }
  1096. that.goods_list.forEach((item, index) => {
  1097. if (item.is_choose == 1) {
  1098. json.goods_id_arr.push(item.id);
  1099. }
  1100. })
  1101. if(this.catlevel == 3) {
  1102. json.level_3 = this.batch_v3
  1103. if(!json.level_3) {
  1104. this.$message.error('请选择三级分类')
  1105. return;
  1106. }
  1107. }
  1108. that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.category.change-many-goods-category') !!}", json).then(response => {
  1109. console.log(response);
  1110. if (response.data.result == 1) {
  1111. that.$message.success('操作成功!');
  1112. that.is_all_choose = 0;
  1113. this.category_show = false;
  1114. that.search(1);
  1115. } else {
  1116. that.$message.error(response.data.msg);
  1117. }
  1118. }), function (res) {
  1119. console.log(res);
  1120. };
  1121. },
  1122. batchChangeV1(val) {
  1123. console.log(val)
  1124. this.batch_category_v2 = [];
  1125. this.batch_category_v3 = [];
  1126. this.batch_v2 = '';
  1127. this.batch_v3 = '';
  1128. let obj = this.batch_category.find((item,index) => {
  1129. return item.id == val
  1130. })
  1131. this.batch_category_v2 = obj?obj.has_many_children:[]
  1132. },
  1133. batchChangeV2(val) {
  1134. if(this.catlevel!=3) {
  1135. return
  1136. }
  1137. this.batch_category_v3 = [];
  1138. this.batch_v3 = '';
  1139. let obj = this.batch_category_v2.find((item,index) => {
  1140. return item.id == val
  1141. })
  1142. this.batch_category_v3 = obj?obj.has_many_children:[]
  1143. },
  1144. // 字符转义
  1145. escapeHTML(a) {
  1146. a = "" + a;
  1147. return a.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&apos;/g, "'");;
  1148. },
  1149. },
  1150. })
  1151. </script>
  1152. @endsection