index.vue 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <el-col :span="24">
  5. <div class="cell">
  6. <div class="cell-title">
  7. <div class="title-left">
  8. <div class="title">周边管理</div>
  9. </div>
  10. </div>
  11. <div class="cell-body">
  12. <div class="controls">
  13. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  14. <el-form-item label="">
  15. <el-input v-model="formInline.name" style="width: 200px;" prefix-icon="el-icon-search" clearable
  16. placeholder="请输入关键字"></el-input>
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button type="primary" class="btn-search" @click="btn_search">查询</el-button>
  20. </el-form-item>
  21. <el-form-item label="周边类型">
  22. <el-select v-model="formInline.type" clearable placeholder="全部">
  23. <el-option v-for="item in formInline.typeOptions" :key="item.type" :label="item.label" :value="item.type">
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="所在乡镇">
  28. <el-select v-model="formInline.status" clearable placeholder="全部">
  29. <el-option v-for="item in formInline.statusOptions" :key="item.status" :label="item.label" :value="item.status">
  30. </el-option>
  31. </el-select>
  32. </el-form-item>
  33. </el-form>
  34. <div>
  35. <el-button class="export" size="small" @click="add_perimeter">
  36. <i class="el-icon el-icon-circle-plus-outline" style="font-size: 20px;"></i>
  37. <span style="font-size: 16px;">新增周边</span>
  38. </el-button>
  39. </div>
  40. </div>
  41. <el-table ref="multipleTable" :data="tableData" height="558" style="width: 100%" :cell-style="cell_style" v-loading="loading"
  42. :header-cell-style="header_cell_style" @selection-change="handleSelectionChange">
  43. <el-table-column label="序号" align="center" width="100">
  44. <template slot-scope="scope">
  45. <span>{{ scope.row.xuhao }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="类型" align="center" width="88">
  49. <template slot-scope="scope">
  50. <span v-if="scope.row.type == 1">代金券</span>
  51. <span v-else-if="scope.row.type == 2">折扣券</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="所在乡镇" align="center">
  55. <template slot-scope="scope">
  56. <span v-if="scope.row.type == 1">{{ scope.row.deductionPrice }}</span>
  57. <span v-else-if="scope.row.type == 2">{{ scope.row.maxDeduction }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="名称" align="center">
  61. <template slot-scope="scope">
  62. <span>{{ scope.row.name }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column label="联系电话" align="center" width="90">
  66. <template slot-scope="scope">
  67. <span>{{ scope.row.grantNumber }}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="地址" align="center">
  71. <template slot-scope="scope">
  72. <span>{{ scope.row.grantNumber }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="产品数量" align="center" width="90">
  76. <template slot-scope="scope">
  77. <span>{{ scope.row.remainderNumber }}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="操作" align="center" width="180">
  81. <template slot-scope="scope">
  82. <el-button @click="handleModifyClick(scope.row)" type="text" size="small">编辑</el-button>
  83. <el-button @click="handleDelClick(scope.row)" type="text" size="small">删除</el-button>
  84. <el-button @click="handleDetailClick(scope.row)" type="text" size="small">查看详情</el-button>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. <div class="pagination-table">
  89. <el-pagination @current-change="currentPageChange" :current-page.sync="pagination.currentPage" :page-size="pagination.pageSize"
  90. layout="prev, pager, next, jumper" :total="pagination.total">
  91. </el-pagination>
  92. </div>
  93. </div>
  94. </div>
  95. </el-col>
  96. </el-row>
  97. <!-- 新增周边 -->
  98. <el-dialog title="新增周边" custom-class="add-dlg-class" :visible.sync="dialogAddVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  99. @close="dialogAddVisible = false">
  100. <el-form :model="formAddHostel" ref="addHostelForm" :rules="addHostelFormRules">
  101. <el-row>
  102. <el-col :span="12">
  103. <el-form-item label="周边类型" :label-width="formLabelWidth" :required="true" prop="jibieId">
  104. <el-select v-model="formAddHostel.jibieId" clearable placeholder="请选择类型" style="width: 100%;">
  105. <el-option v-for="item in formAddHostel.jibie" :key="item.id" :label="item.jibieName" :value="item.id">
  106. </el-option>
  107. </el-select>
  108. </el-form-item>
  109. <el-form-item label="名称" :label-width="formLabelWidth" :required="true" prop="adminName">
  110. <el-input v-model="formAddHostel.adminName" autocomplete="off" placeholder="请输入名称" maxlength="16">
  111. </el-input>
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="12">
  115. <el-form-item label="所在乡镇" :label-width="formLabelWidth" :required="true" prop="id">
  116. <el-select v-model="formAddHostel.hotelTownship" clearable placeholder="请选择乡镇" style="width: 100%;" @change="getHotelId($event)">
  117. <el-option v-for="item in formAddHostel.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
  118. </el-option>
  119. </el-select>
  120. </el-form-item>
  121. <el-form-item label="联系电话" :label-width="formLabelWidth" :required="true" prop="linkproUrl">
  122. <el-input v-model="formAddHostel.linkproUrl" autocomplete="off" placeholder="请输入联系电话"></el-input>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="24" style="margin-top: -20px;">
  126. <el-form-item label="详细地址" :required="true" :label-width="formLabelWidth" prop="addr">
  127. <el-input v-model="formAddHostel.name" placeholder="请输入地址"></el-input>
  128. </el-form-item>
  129. <el-form-item label="简介" :required="true" :label-width="formLabelWidth" prop="jianjie">
  130. <el-input type="textarea" v-model="formAddHostel.desc" rows="5" placeholder="请输入简介" maxlength="300" show-word-limit></el-input>
  131. </el-form-item>
  132. </el-col>
  133. </el-row>
  134. <el-row>
  135. <el-col :span="6" style="display: flex; justify-content: center;">
  136. <div style="display: flex; flex-direction: column; align-items: center;">
  137. <div style="font-size: 18px; margin-bottom: 10px;">封面图:</div>
  138. <div
  139. style="display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; border-radius: 5px;">
  140. <div
  141. style="position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; background: rgba(131, 131, 131, 1.0); border-radius: 50%; font-size: 22px; color: #e3e3e3; cursor: pointer; display: flex; justify-content: center; align-items: center;">
  142. &times;</div>
  143. <viewer>
  144. <img src="https://via.placeholder.com/150x180" alt="" style="border-radius: 5px;">
  145. </viewer>
  146. <el-button
  147. style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
  148. size="small">上传图片</el-button>
  149. </div>
  150. </div>
  151. </el-col>
  152. <el-col :span="6" style="display: flex; justify-content: center;">
  153. <div style="display: flex; flex-direction: column; align-items: center;">
  154. <div style="font-size: 18px; margin-bottom: 10px;">介绍视频:</div>
  155. <div
  156. style="display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; border-radius: 5px;">
  157. <div
  158. style="position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; background: rgba(131, 131, 131, 1.0); border-radius: 50%; font-size: 22px; color: #e3e3e3; cursor: pointer; display: flex; justify-content: center; align-items: center;">
  159. &times;</div>
  160. <img src="https://via.placeholder.com/150x180" alt="" style="border-radius: 5px;">
  161. <el-button
  162. style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
  163. size="small">上传视频</el-button>
  164. </div>
  165. </div>
  166. </el-col>
  167. <el-col :span="12" style="display: flex; justify-content: center;">
  168. <div style="display: flex; flex-direction: column; align-items: center;">
  169. <div style="font-size: 18px; margin-bottom: 10px;">详情图:</div>
  170. <div style="display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 5px;">
  171. <viewer :images="fileInfoListImages" style="width: 390px;">
  172. <el-carousel height="178px" width="100%" style="border-radius: 5px;">
  173. <el-carousel-item v-for="item in fileInfoList" :key="item.id">
  174. <!-- <img :src="item" style="border-radius: 5px; cursor: pointer; width: 100%; height: 178px;"> -->
  175. <img src="https://via.placeholder.com/150x180"
  176. style="border-radius: 5px; cursor: pointer; width: 100%; height: 178px;">
  177. </el-carousel-item>
  178. </el-carousel>
  179. </viewer>
  180. <el-button
  181. style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
  182. size="small">上传图片</el-button>
  183. </div>
  184. </div>
  185. </el-col>
  186. </el-row>
  187. </el-form>
  188. <div slot="footer" class="dialog-footer">
  189. <el-button class="add-info-cancel-btn" @click="dialogAddVisible = false">取 消</el-button>
  190. <el-button class="add-info-confirm-btn" @click="">确 认</el-button>
  191. </div>
  192. </el-dialog>
  193. <!-- 添加产品 -->
  194. <el-dialog title="添加产品" custom-class="add-product-class" :visible.sync="dialogAddProductVisible" :close-on-click-modal="false"
  195. :close-on-press-escape="false" @close="dialogAddProductVisible = false">
  196. <el-form :model="formAddHostel" ref="addHostelForm" :rules="addHostelFormRules">
  197. <el-row>
  198. <el-col :span="24">
  199. <el-form-item label="产品名称" :label-width="formLabelWidth" :required="true" prop="jibieId">
  200. <el-input v-model="formAddHostel.adminName" autocomplete="off" placeholder="请输入产品名称" maxlength="16">
  201. </el-input>
  202. </el-form-item>
  203. <el-form-item label="产品介绍" :label-width="formLabelWidth" :required="true" prop="adminName">
  204. <el-input type="textarea" v-model="formAddHostel.desc" rows="5" placeholder="请输入产品介绍" maxlength="300" show-word-limit></el-input>
  205. </el-form-item>
  206. <el-form-item label="产品价格" :label-width="formLabelWidth" :required="true" prop="id">
  207. <div style="display: flex; align-items: center;">
  208. <el-input v-model="formAddHostel.adminName" style="width: 180px; margin-right: 8px;" autocomplete="off" placeholder="请输入产品价格"
  209. maxlength="16">
  210. </el-input>
  211. <div>元</div>
  212. </div>
  213. </el-form-item>
  214. </el-col>
  215. </el-row>
  216. </el-form>
  217. <div slot="footer" class="dialog-footer">
  218. <el-button class="add-info-cancel-btn" @click="dialogAddProductVisible = false">取 消</el-button>
  219. <el-button class="add-info-confirm-btn" @click="">确 认</el-button>
  220. </div>
  221. </el-dialog>
  222. <!-- 编辑周边 -->
  223. <el-dialog title="编辑周边" custom-class="add-dlg-class" :visible.sync="dialogModifyVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  224. @close="dialogModifyVisible = false">
  225. <el-form :model="formAddHostel" ref="addHostelForm" :rules="addHostelFormRules">
  226. <el-row>
  227. <el-col :span="12">
  228. <el-form-item label="周边类型" :label-width="formLabelWidth" :required="true" prop="jibieId">
  229. <el-select v-model="formAddHostel.jibieId" clearable placeholder="请选择类型" style="width: 100%;">
  230. <el-option v-for="item in formAddHostel.jibie" :key="item.id" :label="item.jibieName" :value="item.id">
  231. </el-option>
  232. </el-select>
  233. </el-form-item>
  234. <el-form-item label="名称" :label-width="formLabelWidth" :required="true" prop="adminName">
  235. <el-input v-model="formAddHostel.adminName" autocomplete="off" placeholder="请输入名称" maxlength="16">
  236. </el-input>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="12">
  240. <el-form-item label="所在乡镇" :label-width="formLabelWidth" :required="true" prop="id">
  241. <el-select v-model="formAddHostel.hotelTownship" clearable placeholder="请选择乡镇" style="width: 100%;" @change="getHotelId($event)">
  242. <el-option v-for="item in formAddHostel.options" :key="item.id" :label="item.hotelTownship" :value="item.id">
  243. </el-option>
  244. </el-select>
  245. </el-form-item>
  246. <el-form-item label="联系电话" :label-width="formLabelWidth" :required="true" prop="linkproUrl">
  247. <el-input v-model="formAddHostel.linkproUrl" autocomplete="off" placeholder="请输入联系电话"></el-input>
  248. </el-form-item>
  249. </el-col>
  250. <el-col :span="24" style="margin-top: -20px;">
  251. <el-form-item label="详细地址" :required="true" :label-width="formLabelWidth" prop="addr">
  252. <el-input v-model="formAddHostel.name" placeholder="请输入地址"></el-input>
  253. </el-form-item>
  254. <el-form-item label="简介" :required="true" :label-width="formLabelWidth" prop="jianjie">
  255. <el-input type="textarea" v-model="formAddHostel.desc" rows="5" placeholder="请输入简介" maxlength="300" show-word-limit></el-input>
  256. </el-form-item>
  257. </el-col>
  258. </el-row>
  259. <el-row>
  260. <el-col :span="6" style="display: flex; justify-content: center;">
  261. <div style="display: flex; flex-direction: column; align-items: center;">
  262. <div style="font-size: 18px; margin-bottom: 10px;">封面图:</div>
  263. <div
  264. style="display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; border-radius: 5px;">
  265. <div
  266. style="position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; background: rgba(131, 131, 131, 1.0); border-radius: 50%; font-size: 22px; color: #e3e3e3; cursor: pointer; display: flex; justify-content: center; align-items: center;">
  267. &times;</div>
  268. <viewer>
  269. <img src="https://via.placeholder.com/150x180" alt="" style="border-radius: 5px;">
  270. </viewer>
  271. <el-button
  272. style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
  273. size="small">上传图片</el-button>
  274. </div>
  275. </div>
  276. </el-col>
  277. <el-col :span="6" style="display: flex; justify-content: center;">
  278. <div style="display: flex; flex-direction: column; align-items: center;">
  279. <div style="font-size: 18px; margin-bottom: 10px;">介绍视频:</div>
  280. <div
  281. style="display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; border-radius: 5px;">
  282. <div
  283. style="position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; background: rgba(131, 131, 131, 1.0); border-radius: 50%; font-size: 22px; color: #e3e3e3; cursor: pointer; display: flex; justify-content: center; align-items: center;">
  284. &times;</div>
  285. <img src="https://via.placeholder.com/150x180" alt="" style="border-radius: 5px;">
  286. <el-button
  287. style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
  288. size="small">上传视频</el-button>
  289. </div>
  290. </div>
  291. </el-col>
  292. <el-col :span="12" style="display: flex; justify-content: center;">
  293. <div style="display: flex; flex-direction: column; align-items: center;">
  294. <div style="font-size: 18px; margin-bottom: 10px;">详情图:</div>
  295. <div style="display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 5px;">
  296. <viewer :images="fileInfoListImages" style="width: 390px;">
  297. <el-carousel height="178px" width="100%" style="border-radius: 5px;">
  298. <el-carousel-item v-for="item in fileInfoList" :key="item.id">
  299. <!-- <img :src="item" style="border-radius: 5px; cursor: pointer; width: 100%; height: 178px;"> -->
  300. <img src="https://via.placeholder.com/150x180"
  301. style="border-radius: 5px; cursor: pointer; width: 100%; height: 178px;">
  302. </el-carousel-item>
  303. </el-carousel>
  304. </viewer>
  305. <el-button
  306. style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
  307. size="small">上传图片</el-button>
  308. </div>
  309. </div>
  310. </el-col>
  311. </el-row>
  312. </el-form>
  313. <div slot="footer" class="dialog-footer">
  314. <el-button class="add-info-cancel-btn" @click="dialogModifyVisible = false">取 消</el-button>
  315. <el-button class="add-info-confirm-btn" @click="">确 认</el-button>
  316. </div>
  317. </el-dialog>
  318. <!-- 删除确认对话框 -->
  319. <el-dialog custom-class="el-dialog-delete-account" :visible.sync="dialogDeleteVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  320. :show-close="false">
  321. <div slot="" class="del-account-body">
  322. <img src="../../icons/serveAC/del_warning.png" alt="">
  323. <div class="del-account-body-txt">是否确定将该【】从列表中移除?</div>
  324. </div>
  325. <div slot="footer" class="dialog-footer">
  326. <el-button class="add-user-cancel-btn" @click="dialogDeleteVisible = false"> 否 </el-button>
  327. <el-button class="add-user-confirm-btn" @click=""> 是 </el-button>
  328. </div>
  329. </el-dialog>
  330. <!-- 周边详情 -->
  331. <el-dialog title="周边详情" custom-class="add-voucher-class" :visible.sync="dialogInfoVisible" :close-on-click-modal="false" :close-on-press-escape="false"
  332. @close="dialogInfoVisible = false">
  333. <div style="padding: 0; margin: 0; overflow:auto;">
  334. <el-row>
  335. <el-col :span="14">
  336. <div style="display: flex; align-items: center; margin-bottom: 20px; ">
  337. <div
  338. style="font-size: 16px; font-weight: 700; min-width: 100px; width: 100px; text-align: right; margin-right: 18px; color: rgba(128, 128, 128, 1);">
  339. 周边类型</div>
  340. <div style="font-size: 16px; font-weight: 700; color: #333;">景点</div>
  341. </div>
  342. <div style="display: flex; align-items: center; margin-bottom: 20px; ">
  343. <div
  344. style="font-size: 16px; font-weight: 700; min-width: 100px; width: 100px; text-align: right; margin-right: 18px; color: rgba(128, 128, 128, 1);">
  345. 名称</div>
  346. <div style="font-size: 16px; font-weight: 700; color: #333;">山爪仑漂流</div>
  347. </div>
  348. <div style="display: flex; align-items: center; margin-bottom: 20px; ">
  349. <div
  350. style="font-size: 16px; font-weight: 700; min-width: 100px; width: 100px; text-align: right; margin-right: 18px; color: rgba(128, 128, 128, 1);">
  351. 所属乡镇</div>
  352. <div style="font-size: 16px; font-weight: 700; color: #333;">山爪仑</div>
  353. </div>
  354. <div style="display: flex; align-items: center; margin-bottom: 20px; ">
  355. <div
  356. style="font-size: 16px; font-weight: 700; min-width: 100px; width: 100px; text-align: right; margin-right: 18px; color: rgba(128, 128, 128, 1);">
  357. 详细地址</div>
  358. <div style="font-size: 16px; font-weight: 700; color: #333;">详细地址详细地址详细地址详细地址详细地址详细地址</div>
  359. </div>
  360. <div style="display: flex; align-items: center; ">
  361. <div
  362. style="font-size: 16px; font-weight: 700; min-width: 100px; width: 100px; text-align: right; margin-right: 18px; color: rgba(128, 128, 128, 1);">
  363. 联系电话</div>
  364. <div style="font-size: 16px; font-weight: 700; color: #333;">18988898898</div>
  365. </div>
  366. </el-col>
  367. <el-col :span="10">
  368. <div style="display: flex;">
  369. <div
  370. style="font-size: 16px; font-weight: 700; min-width: 100px; text-align: right; margin-right: 18px; color: rgba(128, 128, 128, 1);">
  371. 封面图</div>
  372. <viewer>
  373. <img src="https://via.placeholder.com/160x200" alt="" srcset="" style="border-radius: 5px;" />
  374. </viewer>
  375. </div>
  376. </el-col>
  377. </el-row>
  378. <el-divider></el-divider>
  379. <el-row>
  380. <el-col :span="24">
  381. <el-tabs v-model="activeName" @tab-click="handleClick">
  382. <el-tab-pane label="产品" name="first">
  383. <el-button class="export" style="margin-bottom: 10px !important;" size="small" @click="handleAddProduct">
  384. <i class="el-icon el-icon-circle-plus-outline" style="font-size: 16px;"></i>
  385. <span style="font-size: 14px;">添加产品</span>
  386. </el-button>
  387. <el-table ref="multipleTable" :data="tableData" height="220" style="width: 100%" :cell-style="cell_style" v-loading="loading"
  388. :header-cell-style="header_cell_style" @selection-change="handleSelectionChange">
  389. <el-table-column label="序号" align="center" width="100">
  390. <template slot-scope="scope">
  391. <span>{{ scope.row.xuhao }}</span>
  392. </template>
  393. </el-table-column>
  394. <el-table-column label="类型" align="center" width="88">
  395. <template slot-scope="scope">
  396. <span v-if="scope.row.type == 1">代金券</span>
  397. <span v-else-if="scope.row.type == 2">折扣券</span>
  398. </template>
  399. </el-table-column>
  400. <el-table-column label="所在乡镇" align="center">
  401. <template slot-scope="scope">
  402. <span v-if="scope.row.type == 1">{{ scope.row.deductionPrice }}</span>
  403. <span v-else-if="scope.row.type == 2">{{ scope.row.maxDeduction }}</span>
  404. </template>
  405. </el-table-column>
  406. <el-table-column label="名称" align="center">
  407. <template slot-scope="scope">
  408. <span>{{ scope.row.name }}</span>
  409. </template>
  410. </el-table-column>
  411. <el-table-column label="联系电话" align="center" width="90">
  412. <template slot-scope="scope">
  413. <span>{{ scope.row.grantNumber }}</span>
  414. </template>
  415. </el-table-column>
  416. <el-table-column label="地址" align="center">
  417. <template slot-scope="scope">
  418. <span>{{ scope.row.grantNumber }}</span>
  419. </template>
  420. </el-table-column>
  421. <el-table-column label="产品数量" align="center" width="90">
  422. <template slot-scope="scope">
  423. <span>{{ scope.row.remainderNumber }}</span>
  424. </template>
  425. </el-table-column>
  426. <el-table-column label="操作" align="center" width="180">
  427. <template slot-scope="scope">
  428. <el-button @click="handleModifyClick(scope.row)" type="text" size="small">编辑</el-button>
  429. <el-button @click="handleDelClick(scope.row)" type="text" size="small">删除</el-button>
  430. <el-button @click="handleDetailClick(scope.row)" type="text" size="small">查看详情</el-button>
  431. </template>
  432. </el-table-column>
  433. </el-table>
  434. </el-tab-pane>
  435. <el-tab-pane label="简介" name="second">
  436. <div style="height: 264px; overflow-y: auto;">
  437. <div style="font-size: 16px; font-weight: bold; margin: 10px 0;">开放时间</div>
  438. <div style="font-size: 14px; margin: 10px 0 20px; line-height: 22px;">1月1日-12月31日 周一至周日 全天: 08:00-17:00
  439. 最晚入园:15:00<br>以上信息仅供参考,具体以景区当日实际公示信息为准</div>
  440. <div style="font-size: 16px; font-weight: bold; margin: 10px 0;">预订提示</div>
  441. <div style="font-size: 14px; margin: 10px 0 20px; line-height: 22px;">
  442. 为了保护好您的健康与安全,请您一定要做好自我防护,建议减少外出,避免去人群密集的公共场所,进入景区佩戴口罩。同时,请您配合景区做好入园体温检测以及信息登记工作。由此给您带来不便敬请谅解景区介绍:既有森林公园的野趣,又有江南园林的韵致
  443. </div>
  444. </div>
  445. </el-tab-pane>
  446. <el-tab-pane label="介绍视频" name="third">
  447. <div style="height: 264px; overflow-y: auto;">
  448. <div style="display: flex; justify-content: center; align-items: center;">
  449. <div v-for="(video, index) in videoList" :key="index" style="width: 464px; height: 262px;">
  450. <video-player class="video-player vjs-custom-skin" :ref="'videoPlayer' + index" @play="onPlayerPlay($event)"
  451. :playsinline="true" :options="video.playerOptions"></video-player>
  452. </div>
  453. </div>
  454. </div>
  455. </el-tab-pane>
  456. <el-tab-pane label="详情图" name="fourth">
  457. <div style="height: 264px; overflow-y: auto;">
  458. <div style="display: flex; justify-content: center; align-items: center; border-radius: 5px;">
  459. <viewer :images="fileInfoListImages" style="width: 600px;">
  460. <el-carousel height="260px" width="100%" style="border-radius: 5px;">
  461. <el-carousel-item v-for="item in fileInfoList" :key="item.id">
  462. <!-- <img :src="item" style="border-radius: 5px; cursor: pointer; width: 100%; height: 178px;"> -->
  463. <img src="https://via.placeholder.com/600x260"
  464. style="border-radius: 5px; cursor: pointer; width: 100%; height: 260px;">
  465. </el-carousel-item>
  466. </el-carousel>
  467. </viewer>
  468. </div>
  469. </div>
  470. </el-tab-pane>
  471. </el-tabs>
  472. </el-col>
  473. </el-row>
  474. </div>
  475. </el-dialog>
  476. </div>
  477. </template>
  478. <script>
  479. import {
  480. getTableData,
  481. coupomsaveBatchLapse,
  482. coupominsterVoucher,
  483. coupominsterCoupon,
  484. hotelqueryAllHotel
  485. } from '@/api/discountCouponMgr'
  486. import {
  487. isEmpty
  488. } from '@/js/common'
  489. var townOptions = [] // 民宿列表
  490. var townOptions_obj = [] // 民宿列表
  491. export default {
  492. data() {
  493. return {
  494. videoList: [],
  495. activeName: 'second',
  496. fileInfoListImages: [],
  497. fileInfoList: [1, 2, 4],
  498. currentUserLevel: this.$store.state.user.level, // 当前用户的权限
  499. currentUserId: this.$store.state.user.user_id, // 当前用户的权限
  500. formLabelWidth: '100px',
  501. // 表格单元格样式
  502. cell_style: {
  503. color: '#1A202B',
  504. 'font-size': '14px',
  505. 'font-family': 'Microsoft YaHei-3970(82674968)'
  506. },
  507. // 表格头部样式
  508. header_cell_style: {
  509. background: '#E6ECFE',
  510. color: '#1A202B',
  511. 'font-size': '16px',
  512. 'font-family': 'Microsoft YaHei-3970(82674968)'
  513. },
  514. addHostelFormRules: {},
  515. // 查询数据
  516. formInline: {
  517. typeOptions: [{
  518. type: 1,
  519. label: '代金券'
  520. }, {
  521. type: 2,
  522. label: '折扣券'
  523. }],
  524. type: '',
  525. statusOptions: [{ // 1正常 2失效 3过期
  526. status: 1,
  527. label: '正常'
  528. }, {
  529. status: 2,
  530. label: '失效'
  531. }, {
  532. status: 3,
  533. label: '过期'
  534. }],
  535. status: '',
  536. search_datatime: '',
  537. name: ''
  538. },
  539. tableData: [],
  540. cond_data: {},
  541. // 分页参数
  542. pagination: {
  543. currentPage: 1,
  544. pageSize: 9,
  545. total: 0
  546. },
  547. loading: true,
  548. coupon: {},
  549. formAddHostel: {},
  550. dialogAddVisible: false, // 新增周边
  551. dialogInfoVisible: false, // 周边详情
  552. dialogModifyVisible: false, // 修改周边
  553. dialogDeleteVisible: false, // 删除确认对话框
  554. dialogAddProductVisible: false, // 添加产品对话框
  555. formAddVoucher: {}, // 增加代金券数据模型
  556. formModifyVoucher: {}, // 修改代金券数据模型
  557. addVoucherFormRules: {
  558. },
  559. formAddCoupon: {}, // 增加折扣券数据模型
  560. formModifyCoupon: {}, // 修改折扣券数据模型
  561. addCouponFormRules: {
  562. },
  563. voucherCheckAll: false,
  564. couponCheckAll: false,
  565. voucherModifyCheckAll: false,
  566. couponModifyCheckAll: false,
  567. towns: townOptions,
  568. isAddCouponIndeterminate: true,
  569. isAddVoucherIndeterminate: true,
  570. isModifyVoucherIndeterminate: true,
  571. isModifyCouponIndeterminate: true,
  572. multipleSelection: [], // 数据表的多选
  573. couponCheckedTowns: [], // 折扣券适用民宿
  574. voucherCheckedTowns: [], // 代金券适用民宿
  575. voucherModifyCheckedTowns: [], // 修改代金券适用民宿
  576. couponModifyCheckedTowns: [], // 修改折扣券适用民宿
  577. voucherMinSuIds: [], // 增加代金券适用民宿的ids
  578. couponMinSuIds: [], // 增加折扣券适用民宿的ids
  579. voucherModifyMinSuIds: [], // 修改代金券适用民宿的ids
  580. couponModifyMinSuIds: [], // 修改折扣券适用民宿的ids
  581. voucherMinSuIds_bool: false, // 增加代金券适用民宿:全选则为true,否则false
  582. couponMinSuIds_bool: false // 增加折扣券适用民宿:全选则为true,否则false
  583. }
  584. },
  585. created() {
  586. // 检测权限
  587. if (this.currentUserLevel !== 2) {
  588. this.$router.replace({
  589. path: '/data'
  590. })
  591. return
  592. }
  593. // 获取消费记录,表格数据
  594. this.get_table_data('list')
  595. this.videoList.push({
  596. playerOptions: {
  597. playbackRates: [0.5, 0.8, 1.0, 1.25, 1.5, 1.75, 2.0], //播放速度
  598. autoplay: false, // 如果true,浏览器准备好时开始回放。
  599. muted: false, // 默认情况下将会消除任何音频。
  600. loop: false, // 导致视频一结束就重新开始。
  601. preload: "auto", // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
  602. language: "zh-CN",
  603. aspectRatio: "16:9", // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
  604. fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
  605. sources: [{
  606. withCredentials: false,
  607. type: "video/mp4", // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
  608. src: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
  609. }],
  610. controls: true,
  611. hls: true,
  612. poster: "", // 你的封面地址
  613. notSupportedMessage: "此视频暂无法播放,请稍后再试", // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
  614. controlBar: {
  615. progressControl: true,
  616. currentTimeDisplay: true,
  617. timeDivider: true,
  618. durationDisplay: true,
  619. remainingTimeDisplay: false,
  620. fullscreenToggle: true, // 全屏按钮
  621. },
  622. flash: {
  623. hls: {
  624. withCredentials: false
  625. }
  626. },
  627. html5: {
  628. hls: {
  629. withCredentials: false
  630. }
  631. }
  632. }
  633. })
  634. },
  635. mounted() {
  636. document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
  637. document.addEventListener('fullscreenchange', this.handleFullScreenChange);
  638. },
  639. beforeDestroy() {
  640. document.removeEventListener('fullscreenchange', this.handleFullScreenChange);
  641. },
  642. methods: {
  643. handleFullScreenChange() {
  644. if (!document.fullscreenElement) {
  645. // 退出全屏逻辑
  646. this.playering.pause()
  647. }
  648. },
  649. // 定义点击播放按钮,自动全屏化的方法
  650. full(e) {
  651. // 做兼容处理
  652. if (e.requestFullscreen) {
  653. e.requestFullscreen()
  654. } else if (e.mozRequestFullScreen) {
  655. e.mozRequestFullScreen()
  656. } else if (e.msRequestFullscreen) {
  657. e.msRequestFullscreen()
  658. } else if (e.oRequestFullscreen) {
  659. e.oRequestFullscreen()
  660. } else if (e.webkitRequestFullscreen) {
  661. e.webkitRequestFullScreen()
  662. } else {
  663. // var docHtml = document.documentElement;
  664. // var docBody = document.body;
  665. var videobox = document.getElementsByClassName('video-player')
  666. var cssText = 'width:100%;height:100%;overflow:hidden;'
  667. // docHtml.style.cssText = cssText;
  668. // docBody.style.cssText = cssText;
  669. videobox.style.cssText = cssText + ';' + 'margin:0px;padding:0px;'
  670. document.IsFullScreen = true
  671. }
  672. },
  673. // 定义点击播放按钮,调用全屏化的方法
  674. onPlayerPlay(player) {
  675. // console.log('player play===>>>', player)
  676. this.playering = player
  677. this.full(player)
  678. },
  679. handleClick(tab, event) {
  680. console.log(tab, event);
  681. },
  682. /**
  683. * 添加产品
  684. */
  685. handleAddProduct() {
  686. this.dialogAddProductVisible = true
  687. },
  688. /**
  689. * 分页表格勾选
  690. * @param {Object} val
  691. */
  692. handleSelectionChange(val) {
  693. var that = this
  694. this.multipleSelection = []
  695. val.forEach((e) => {
  696. that.multipleSelection.push(e.id)
  697. });
  698. },
  699. /**
  700. * 代金券适用民宿全选
  701. * @param {Object} val
  702. */
  703. handleVoucherCheckAllChange(val) {
  704. this.voucherCheckedTowns = val ? townOptions : [];
  705. this.isAddVoucherIndeterminate = false;
  706. // 获取代金券ids
  707. this.get_daijinquan_ids()
  708. },
  709. /**
  710. * 修改代金券适用民宿全选
  711. * @param {Object} val
  712. */
  713. handleModifyVoucherCheckAllChange(val) {
  714. this.voucherModifyCheckedTowns = val ? townOptions : [];
  715. this.isModifyVoucherIndeterminate = false;
  716. // 获取代金券ids
  717. this.get_modify_daijinquan_ids()
  718. },
  719. /**
  720. * 修改折扣券适用民宿全选
  721. * @param {Object} val
  722. */
  723. handleModifyCouponCheckAllChange(val) {
  724. this.couponModifyCheckedTowns = val ? townOptions : [];
  725. this.isModifyCouponIndeterminate = false;
  726. // 获取代金券ids
  727. this.get_modify_zhekouquan_ids()
  728. },
  729. /**
  730. * 获取增加代金券,适用民宿ids
  731. */
  732. get_daijinquan_ids() {
  733. if (this.voucherCheckedTowns.length == townOptions_obj.length) {
  734. this.voucherMinSuIds_bool = true
  735. } else {
  736. var that = this;
  737. this.voucherMinSuIds.length = 0;
  738. this.voucherCheckedTowns.forEach((item) => {
  739. townOptions_obj.forEach((obj) => {
  740. if (obj.hname === item) {
  741. that.voucherMinSuIds.push(obj.hid);
  742. }
  743. });
  744. });
  745. // console.log(this.voucherMinSuIds);
  746. this.voucherMinSuIds_bool = false
  747. }
  748. },
  749. /**
  750. * 折扣券适用民宿全选
  751. * @param {Object} val
  752. */
  753. handleCouponCheckAllChange(val) {
  754. this.couponCheckedTowns = val ? townOptions : [];
  755. this.isAddCouponIndeterminate = false;
  756. // 获取折扣券ids
  757. this.get_zhekouquan_ids()
  758. },
  759. /**
  760. * 获取折扣券ids
  761. */
  762. get_zhekouquan_ids() {
  763. if (this.couponCheckedTowns.length == townOptions_obj.length) {
  764. this.couponMinSuIds_bool = true;
  765. } else {
  766. var that = this;
  767. this.couponMinSuIds.length = 0;
  768. this.couponCheckedTowns.forEach((item) => {
  769. townOptions_obj.forEach((obj) => {
  770. if (obj.hname === item) {
  771. that.couponMinSuIds.push(obj.hid);
  772. }
  773. });
  774. });
  775. // console.log(this.couponMinSuIds);
  776. this.couponMinSuIds_bool = false;
  777. }
  778. },
  779. /**
  780. * 代金券适用民宿,勾选某一项
  781. * @param {Object} value
  782. */
  783. handleVoucherCheckedTownsChange(value) {
  784. var that = this;
  785. let checkedCount = value.length;
  786. this.voucherCheckAll = checkedCount === this.towns.length;
  787. this.isAddVoucherIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
  788. // 获取代金券ids
  789. this.get_daijinquan_ids()
  790. },
  791. /**
  792. * 修改代金券适用民宿,勾选某一项
  793. * @param {Object} value
  794. */
  795. handleModifyVoucherCheckedTownsChange(value) {
  796. var that = this;
  797. let checkedCount = value.length;
  798. this.voucherModifyCheckAll = checkedCount === this.towns.length;
  799. this.isModifyVoucherIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
  800. // 获取代金券ids
  801. this.get_modify_daijinquan_ids()
  802. },
  803. /**
  804. * 修改折扣券适用民宿,勾选某一项
  805. * @param {Object} value
  806. */
  807. handleModifyCouponCheckedTownsChange(value) {
  808. var that = this;
  809. let checkedCount = value.length;
  810. this.couponModifyCheckAll = checkedCount === this.towns.length;
  811. this.isModifyCouponIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
  812. // 获取代金券ids
  813. this.get_modify_zhekouquan_ids()
  814. },
  815. /**
  816. * 折扣券适用民宿,勾选某一项
  817. * @param {Object} value
  818. */
  819. handleCouponCheckedTownsChange(value) {
  820. let checkedCount = value.length;
  821. this.couponCheckAll = checkedCount === this.towns.length;
  822. this.isAddCouponIndeterminate = checkedCount > 0 && checkedCount < this.towns.length;
  823. // 获取折扣券ids
  824. this.get_zhekouquan_ids()
  825. },
  826. /**
  827. * 获取适用民宿列表
  828. */
  829. getMinSuList() {
  830. var that = this;
  831. townOptions.length = 0;
  832. townOptions_obj.length = 0;
  833. // townOptions.splice(0, townOptions.length);
  834. // 获取民宿列表
  835. hotelqueryAllHotel().then((res) => {
  836. // console.log(res);
  837. if (res.code === 200) {
  838. // console.log(res.data);
  839. if (typeof res.data === 'undefined') {
  840. that.$message.warning('获取适用民宿列表异常!')
  841. } else {
  842. res.data.forEach((item) => {
  843. townOptions.push(item.hname);
  844. townOptions_obj.push({
  845. hname: item.hname,
  846. hid: item.id
  847. });
  848. })
  849. }
  850. } else {
  851. if (typeof res.message === 'undefined') {
  852. that.$message.warning('获取适用民宿列表异常!')
  853. } else {
  854. that.$message.warning(res.message)
  855. }
  856. }
  857. }).catch((err) => {
  858. // console.log(err);
  859. that.$message.error(err.message)
  860. });
  861. },
  862. /**
  863. * 添加代金券
  864. */
  865. add_voucher_dialog_handler() {
  866. var that = this;
  867. var d = this.formAddVoucher;
  868. if (isEmpty(d.name)) {
  869. this.$message.error('请输入【优惠券名称】')
  870. return
  871. }
  872. if (isEmpty(d.deductionPrice)) {
  873. this.$message.error('请输入【减免金额】')
  874. return
  875. }
  876. if (isEmpty(d.grantNumber)) {
  877. this.$message.error('请输入【发放数量】')
  878. return
  879. }
  880. if (isEmpty(d.limitNumber)) {
  881. this.$message.error('请输入【每人限领】')
  882. return
  883. }
  884. if (isEmpty(d.grantTimes)) {
  885. this.$message.error('请选择【发放时间】')
  886. return
  887. }
  888. if (isEmpty(d.meetPrice)) {
  889. this.$message.error('请输入【订单满多少可使用】')
  890. return
  891. }
  892. if (d.radio == 1) {
  893. if (isEmpty(d.effectiveDateTime)) {
  894. this.$message.error('请选择【有效期时间段】')
  895. return
  896. }
  897. } else if (d.radio == 2) {
  898. if (isEmpty(d.effectiveDay)) {
  899. this.$message.error('请选择【多少天开始】')
  900. return
  901. }
  902. if (isEmpty(d.effectiveLoseDay)) {
  903. this.$message.error('请输入【多少天有效】')
  904. return
  905. }
  906. }
  907. if (this.voucherMinSuIds_bool) {
  908. this.formAddVoucher.hotelIds = -1 // 适用民宿ids
  909. } else {
  910. if (isEmpty(this.voucherMinSuIds)) {
  911. this.$message.error('请选择【适用民宿】')
  912. return
  913. }
  914. this.formAddVoucher.hotelIds = this.voucherMinSuIds // 适用民宿ids
  915. }
  916. this.formAddVoucher.createId = this.currentUserId // 创建人
  917. this.formAddVoucher.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
  918. this.formAddVoucher.type = 1 // 类型(1.代金券 2.折扣券)
  919. this.formAddVoucher.status = 1 // 状态(0删除 1正常)
  920. coupominsterVoucher(this.formAddVoucher).then((res) => {
  921. // console.log(res);
  922. if (res.code === 200) {
  923. that.$message.success(res.message)
  924. this.get_table_data('list')
  925. that.dialogInfoVisible = false
  926. that.formAddVoucher = {}
  927. that.voucherMinSuIds = []
  928. that.voucherCheckedTowns = []
  929. } else {
  930. that.$message.warning(res.message)
  931. }
  932. }).catch((err) => {
  933. // console.log(err);
  934. that.$message.error(err.message)
  935. });
  936. },
  937. /**
  938. * 添加折扣券
  939. */
  940. add_coupon_dialog_handler() {
  941. var that = this;
  942. var d = this.formAddCoupon;
  943. if (isEmpty(d.name)) {
  944. this.$message.error('请输入【优惠券名称】')
  945. return
  946. }
  947. if (isEmpty(d.rebatePrice)) {
  948. this.$message.error('请输入【折扣】')
  949. return
  950. } else {
  951. const regex = /^(?:[1-9](?:\.[0-9])?|9(?:\.[0-9])?)$/;
  952. const msg = '【折扣】只能输入1.0-9.9,仅可带有一位小数。';
  953. if (!regex.test(d.rebatePrice)) {
  954. this.$message.error(msg);
  955. const h = this.$createElement;
  956. this.$notify({
  957. title: '提示信息',
  958. message: h('i', {
  959. style: 'color: red'
  960. }, msg)
  961. });
  962. return
  963. }
  964. }
  965. if (isEmpty(d.maxDeduction)) {
  966. this.$message.error('请输入【最大抵扣金额】')
  967. return
  968. }
  969. if (isEmpty(d.grantNumber)) {
  970. this.$message.error('请输入【发放数量】')
  971. return
  972. }
  973. if (isEmpty(d.limitNumber)) {
  974. this.$message.error('请输入【每人限领】')
  975. return
  976. }
  977. if (isEmpty(d.grantTimes)) {
  978. this.$message.error('请选择【发放时间】')
  979. return
  980. }
  981. if (isEmpty(d.meetPrice)) {
  982. this.$message.error('请输入【订单满多少可使用】')
  983. return
  984. }
  985. if (d.radio == 1) {
  986. if (isEmpty(d.effectiveDateTime)) {
  987. this.$message.error('请选择【有效期时间段】')
  988. return
  989. }
  990. } else if (d.radio == 2) {
  991. if (isEmpty(d.effectiveDay)) {
  992. this.$message.error('请选择【多少天开始】')
  993. return
  994. }
  995. if (isEmpty(d.effectiveLoseDay)) {
  996. this.$message.error('请输入【多少天有效】')
  997. return
  998. }
  999. }
  1000. if (this.couponMinSuIds_bool) {
  1001. this.formAddCoupon.hotelIds = -1 // 适用民宿ids
  1002. } else {
  1003. if (isEmpty(this.couponMinSuIds)) {
  1004. this.$message.error('请选择【适用民宿】')
  1005. return
  1006. }
  1007. this.formAddCoupon.hotelIds = this.couponMinSuIds // 适用民宿ids
  1008. }
  1009. this.formAddCoupon.createId = this.currentUserId // 创建人
  1010. this.formAddCoupon.effectiveType = d.radio // 有效期类型(1.时间段 2.生效失效天数)
  1011. this.formAddCoupon.type = 2 // // 类型(1.代金券 2.折扣券)
  1012. this.formAddCoupon.status = 1 // 状态(0删除 1正常)
  1013. coupominsterCoupon(this.formAddCoupon).then((res) => {
  1014. // console.log(res);
  1015. if (res.code === 200) {
  1016. that.$message.success(res.message)
  1017. this.get_table_data('list')
  1018. that.formAddCoupon = {}
  1019. that.couponMinSuIds = []
  1020. that.couponCheckedTowns = []
  1021. } else {
  1022. that.$message.warning(res.message)
  1023. }
  1024. }).catch((err) => {
  1025. // console.log(err);
  1026. that.$message.error(err.message)
  1027. });
  1028. },
  1029. /**
  1030. * 新增周边
  1031. */
  1032. add_perimeter() {
  1033. this.dialogAddVisible = true
  1034. },
  1035. /**
  1036. * 打开编辑周边
  1037. * @param {Object} row
  1038. */
  1039. handleModifyClick(row) {
  1040. this.dialogModifyVisible = true
  1041. },
  1042. /**
  1043. * 删除周边
  1044. */
  1045. handleDelClick() {
  1046. this.dialogDeleteVisible = true
  1047. },
  1048. /**
  1049. * 点击查看优惠券详情,弹出优惠券详情对话框
  1050. * @param {Object} row
  1051. */
  1052. handleDetailClick(row) {
  1053. // console.log(row);
  1054. this.dialogInfoVisible = true
  1055. if (row.type == 1) { // 代金券
  1056. this.coupon.name = row.name
  1057. this.coupon.deductionPrice = row.deductionPrice
  1058. this.coupon.grantNumber = row.grantNumber
  1059. this.coupon.limitNumber = row.limitNumber
  1060. this.coupon.grantStartDate = row.grantStartDate
  1061. this.coupon.grantEndDate = row.grantEndDate
  1062. this.coupon.meetPrice = row.meetPrice
  1063. this.coupon.effectiveType = row.effectiveType
  1064. this.coupon.effectiveStartDate = row.effectiveStartDate
  1065. this.coupon.effectiveEndDate = row.effectiveEndDate
  1066. this.coupon.effectiveDay = row.effectiveDay
  1067. this.coupon.effectiveLoseDay = row.effectiveLoseDay
  1068. this.coupon.hotelNames = row.hotelNames.split(',')
  1069. this.coupon.hotelIds = row.hotelIds
  1070. } else { // 折扣券
  1071. this.coupon.name = row.name
  1072. this.coupon.rebatePrice = row.rebatePrice
  1073. this.coupon.maxDeduction = row.maxDeduction
  1074. this.coupon.grantNumber = row.grantNumber
  1075. this.coupon.limitNumber = row.limitNumber
  1076. this.coupon.grantStartDate = row.grantStartDate
  1077. this.coupon.grantEndDate = row.grantEndDate
  1078. this.coupon.meetPrice = row.meetPrice
  1079. this.coupon.effectiveType = row.effectiveType
  1080. this.coupon.effectiveStartDate = row.effectiveStartDate
  1081. this.coupon.effectiveEndDate = row.effectiveEndDate
  1082. this.coupon.effectiveDay = row.effectiveDay
  1083. this.coupon.effectiveLoseDay = row.effectiveLoseDay
  1084. this.coupon.hotelNames = row.hotelNames.split(',')
  1085. this.coupon.hotelIds = row.hotelIds
  1086. }
  1087. },
  1088. /**
  1089. * 获取消费记录,表格数据
  1090. */
  1091. get_table_data(param) {
  1092. this.loading = true
  1093. this.get_condtion();
  1094. let data = this.cond_data;
  1095. if (param == 'search') {
  1096. data.page = 1
  1097. this.pagination.currentPage = 1
  1098. }
  1099. var that = this
  1100. // console.log(data);
  1101. getTableData(data).then((res) => {
  1102. // console.log(res.data);
  1103. if (res.code === 200) {
  1104. let tempData = res.data.pageList;
  1105. if (typeof tempData !== 'undefined' && tempData !== '') {
  1106. this.pagination.total = res.data.total
  1107. this.tableData = []
  1108. for (var i = 0; i < tempData.length; i++) {
  1109. tempData[i].xuhao = (this.pagination.currentPage - 1) * this.pagination.pageSize + i + 1
  1110. this.tableData.push(tempData[i])
  1111. }
  1112. } else {
  1113. this.tableData = []
  1114. this.$message.warning('没有符合条件的数据!')
  1115. }
  1116. // that.tableData.sort((a,b) => b.createDate.localeCompare(a.createDate))
  1117. } else {
  1118. that.tableData = []
  1119. that.$message.warning('没有符合条件的数据!')
  1120. }
  1121. }).catch((err) => {
  1122. // console.log(err);
  1123. that.$message.error(err.message)
  1124. });
  1125. that.loading = false;
  1126. },
  1127. /**
  1128. * 查询条件
  1129. */
  1130. get_condtion() {
  1131. let data = {
  1132. page: this.pagination.currentPage,
  1133. rows: this.pagination.pageSize
  1134. }
  1135. if (this.formInline.type !== '') {
  1136. data.type = this.formInline.type
  1137. }
  1138. if (this.formInline.status !== '') {
  1139. data.status = this.formInline.status
  1140. }
  1141. if (this.formInline.search_datatime !== '') {
  1142. data.search_datatime = this.formInline.search_datatime
  1143. }
  1144. if (this.formInline.name !== '') {
  1145. data.name = this.formInline.name
  1146. }
  1147. this.cond_data = data;
  1148. },
  1149. /**
  1150. * 搜索
  1151. */
  1152. btn_search() {
  1153. this.get_table_data('search')
  1154. },
  1155. /**
  1156. * currentPage 改变时会触发
  1157. * @param {Object} val
  1158. */
  1159. currentPageChange(val) {
  1160. this.pagination.currentPage = val
  1161. this.get_table_data('pages')
  1162. }
  1163. }
  1164. }
  1165. </script>
  1166. <style lang="scss" scoped>
  1167. .app-container {
  1168. background-color: #EFF2F7;
  1169. padding: 10px;
  1170. .el-row {
  1171. .el-col {
  1172. padding: 10px;
  1173. .cell {
  1174. padding: 30px;
  1175. border-radius: 10px;
  1176. background-color: #FFFFFF;
  1177. box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
  1178. .cell-title {
  1179. display: flex;
  1180. justify-content: space-between;
  1181. align-items: center;
  1182. margin-bottom: 30px;
  1183. padding-bottom: 30px;
  1184. border-bottom: 1px solid #CCCCCC;
  1185. .title-left {
  1186. display: flex;
  1187. align-items: center;
  1188. .title {
  1189. font-size: 22px;
  1190. font-family: Microsoft YaHei-3970(82674968);
  1191. font-weight: bold;
  1192. color: #1A202B;
  1193. }
  1194. .title-detail {
  1195. margin-left: 50px;
  1196. font-size: 18px;
  1197. font-family: Microsoft YaHei-3970(82674968);
  1198. color: #1A202B;
  1199. }
  1200. }
  1201. .title-right {
  1202. display: flex;
  1203. justify-content: space-between;
  1204. align-items: center;
  1205. .el-button {
  1206. width: 110px;
  1207. height: 46px;
  1208. background: #2B4CFE;
  1209. font-size: 18px;
  1210. color: #FFFFFF;
  1211. font-family: Microsoft YaHei-3970(82674968);
  1212. border-radius: 5px;
  1213. }
  1214. .el-button--warning {
  1215. background: #F88A64;
  1216. }
  1217. }
  1218. }
  1219. .cell-body {
  1220. .controls {
  1221. display: flex;
  1222. justify-content: space-between;
  1223. align-items: center;
  1224. .demo-form-inline {
  1225. display: inline-flex;
  1226. flex-wrap: wrap;
  1227. align-items: center;
  1228. justify-content: flex-start;
  1229. .btn-search {
  1230. background: rgba(9, 101, 98, 1);
  1231. font-size: 14px;
  1232. color: #FFFFFF;
  1233. font-family: Microsoft YaHei-3970(82674968);
  1234. border-radius: 5px;
  1235. border: none;
  1236. }
  1237. }
  1238. .export {
  1239. background: rgba(9, 101, 98, 1);
  1240. font-size: 14px;
  1241. color: #FFFFFF;
  1242. font-family: Microsoft YaHei-3970(82674968);
  1243. border-radius: 5px;
  1244. margin-bottom: 22px;
  1245. border: none;
  1246. }
  1247. }
  1248. .pagination-table {
  1249. display: flex;
  1250. justify-content: flex-end;
  1251. align-items: center;
  1252. height: 30px;
  1253. margin-top: 20px;
  1254. padding-right: 100px;
  1255. .txt-notice {
  1256. span {
  1257. font-size: 28px;
  1258. font-weight: 500;
  1259. font-family: '微软雅黑';
  1260. }
  1261. }
  1262. ::v-deep .el-pagination {
  1263. display: flex;
  1264. justify-content: flex-end;
  1265. align-items: center;
  1266. }
  1267. ::v-deep .el-pagination ul {
  1268. display: flex;
  1269. }
  1270. ::v-deep .el-pagination button,
  1271. ::v-deep .el-pagination li {
  1272. display: flex;
  1273. justify-content: center;
  1274. align-items: center;
  1275. width: 50px;
  1276. height: 36px;
  1277. border: 1px solid #626262;
  1278. border-radius: 3px;
  1279. font-size: 14px;
  1280. margin: 0 5px;
  1281. }
  1282. ::v-deep .el-pagination span {
  1283. margin-left: 10px;
  1284. }
  1285. ::v-deep .el-pagination .el-pagination__jump {
  1286. font-size: 16px;
  1287. }
  1288. ::v-deep .el-pagination .el-pagination__editor {
  1289. width: 50px;
  1290. height: 36px;
  1291. margin: 0 5px;
  1292. }
  1293. ::v-deep .el-pagination .el-input__inner {
  1294. width: 50px;
  1295. height: 36px;
  1296. border: 1px solid #626262;
  1297. margin: -4px 0 0 0;
  1298. }
  1299. }
  1300. }
  1301. }
  1302. }
  1303. }
  1304. ::v-deep .el-dialog {
  1305. margin: 0 !important;
  1306. width: 600px;
  1307. height: 560px;
  1308. background: #FFFFFF;
  1309. box-shadow: 0px 0px 13px 0px rgba(0, 0, 0, 0.29);
  1310. border-radius: 6px;
  1311. position: absolute;
  1312. top: 50%;
  1313. left: 50%;
  1314. transform: translate(-50%, -50%);
  1315. .el-dialog__header {
  1316. display: flex;
  1317. align-items: center;
  1318. width: 100%;
  1319. height: 58px;
  1320. padding: 30px;
  1321. border-radius: 6px 6px 0px 0px;
  1322. font-weight: bold;
  1323. border-bottom: 1px solid rgba(230, 230, 230, 1);
  1324. }
  1325. .el-dialog__body {
  1326. padding-bottom: 0;
  1327. .el-form-item__label,
  1328. .el-form-item__content {
  1329. font-size: 16px;
  1330. font-family: Microsoft YaHei-3970(82674968);
  1331. color: #53575A;
  1332. }
  1333. }
  1334. // 删除对话框的样式
  1335. .del-account-body {
  1336. display: flex;
  1337. flex-direction: column;
  1338. justify-content: center;
  1339. align-items: center;
  1340. height: 180px;
  1341. img {
  1342. width: 72px;
  1343. }
  1344. .del-account-body-txt {
  1345. height: 58px;
  1346. line-height: 58px;
  1347. font-size: 18px;
  1348. font-family: Microsoft YaHei-3970(82674968);
  1349. color: #333333;
  1350. }
  1351. }
  1352. .el-dialog__footer {
  1353. padding-bottom: 0 !important;
  1354. text-align: center;
  1355. .el-button.el-button--default {
  1356. width: 75px;
  1357. height: 40px;
  1358. border: 1px solid #2B4CFE;
  1359. border-radius: 6px;
  1360. font-size: 16px;
  1361. font-family: Microsoft YaHei-3970(82674968);
  1362. color: #2B4CFE;
  1363. }
  1364. .el-button.el-button--primary {
  1365. width: 75px;
  1366. height: 40px;
  1367. background: #2B4CFE;
  1368. border-radius: 6px;
  1369. font-size: 16px;
  1370. font-family: Microsoft YaHei-3970(82674968);
  1371. color: #FFFFFF;
  1372. margin-left: 60px;
  1373. }
  1374. }
  1375. }
  1376. }
  1377. </style>
  1378. <style>
  1379. .add-voucher-class {
  1380. width: 900px !important;
  1381. height: 760px !important;
  1382. }
  1383. .el-date-editor--daterange.el-input__inner {
  1384. width: 280px !important;
  1385. }
  1386. .demo-table-expand {
  1387. font-size: 0;
  1388. }
  1389. .demo-table-expand label {
  1390. width: 180px;
  1391. color: #99a9bf;
  1392. }
  1393. .demo-table-expand .el-form-item {
  1394. margin-right: 0;
  1395. margin-bottom: 0;
  1396. width: 33%;
  1397. }
  1398. .show-imgs {
  1399. display: flex;
  1400. }
  1401. .imgs {
  1402. display: flex;
  1403. flex-direction: row;
  1404. margin-left: 20px;
  1405. }
  1406. .lbl-cls {
  1407. display: inline-block;
  1408. width: 100px;
  1409. text-align: right;
  1410. padding-right: 10px;
  1411. color: #bbb;
  1412. }
  1413. .export {
  1414. background: rgba(9, 101, 98, 1) !important;
  1415. font-size: 14px !important;
  1416. color: #FFFFFF !important;
  1417. font-family: Microsoft YaHei-3970(82674968);
  1418. border-radius: 5px !important;
  1419. margin-bottom: 22px !important;
  1420. border: none !important;
  1421. }
  1422. .add-class {
  1423. height: 450px !important;
  1424. width: 800px !important;
  1425. }
  1426. .dialog-footer {
  1427. display: flex;
  1428. justify-content: flex-end;
  1429. }
  1430. .add-info-cancel-btn {
  1431. color: rgba(9, 101, 98, 1) !important;
  1432. border: 1px solid rgba(9, 101, 98, 1) !important;
  1433. }
  1434. .add-info-confirm-btn {
  1435. border: none !important;
  1436. background: rgba(9, 101, 98, 1) !important;
  1437. color: #fff !important;
  1438. border-radius: 5px !important;
  1439. margin-left: 28px !important;
  1440. }
  1441. .el-form-item>label {
  1442. color: rgba(128, 128, 128, 1) !important;
  1443. }
  1444. .custom-input {
  1445. width: 7rem !important;
  1446. }
  1447. .custom-input input {
  1448. width: 7rem !important;
  1449. }
  1450. .el-radio {
  1451. margin-right: 10px;
  1452. }
  1453. .el-form-item {
  1454. margin-bottom: 16px !important;
  1455. }
  1456. .add-dlg-class {
  1457. width: 830px !important;
  1458. height: 768px !important;
  1459. }
  1460. .add-product-class {
  1461. width: 680px !important;
  1462. height: 440px !important;
  1463. }
  1464. .el-carousel__indicators {
  1465. display: none !important;
  1466. }
  1467. .el-tabs__item {
  1468. width: 100px !important;
  1469. text-align: center !important;
  1470. font-size: 20px !important;
  1471. }
  1472. .el-tabs__item.is-active,
  1473. .el-tabs__item:hover {
  1474. color: rgba(9, 101, 98, 1) !important;
  1475. }
  1476. .el-tabs__active-bar {
  1477. color: rgba(9, 101, 98, 1) !important;
  1478. background-color: rgba(9, 101, 98, 1) !important;
  1479. }
  1480. </style>