add-contact.vue 39KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  1. <template>
  2. <div>
  3. <div class="feature ">
  4. <ul >
  5. <li @click="slideshow = true">
  6. <span>
  7. <img :src="new1" alt="" style="width:40px;height:40px">
  8. <p>轮播图</p>
  9. </span>
  10. </li>
  11. <li @click="hospitaAddress()">
  12. <span>
  13. <img :src="new2" alt="" style="width:40px;height:40px">
  14. <p>医院地址</p>
  15. </span>
  16. </li>
  17. <li @click="contact = true">
  18. <span>
  19. <img :src="new3" alt="" style="width:40px;height:40px">
  20. <p>联系方式</p>
  21. </span>
  22. </li>
  23. <li @click="time = true">
  24. <span>
  25. <img :src="new4" alt="" style="width:40px;height:40px">
  26. <p>工作时间</p>
  27. </span>
  28. </li>
  29. <li @click="type = true">
  30. <span>
  31. <img :src="new5" alt="" style="width:40px;height:40px">
  32. <p>乘车方式</p>
  33. </span>
  34. </li>
  35. </ul>
  36. </div>
  37. <!-- 新增轮播图 -->
  38. <el-dialog
  39. title="新增轮播图"
  40. :visible.sync="slideshow"
  41. width="50%"
  42. center>
  43. <el-form ref="rotationform" :model="rotationform" label-width="90px" :rules="rules" >
  44. <el-form-item label="模块标题:" required prop="title">
  45. <el-input v-model="rotationform.title"></el-input>
  46. </el-form-item>
  47. <el-form-item label="排序值:" required prop="sort">
  48. <el-input v-model="rotationform.sort" type="number"></el-input>
  49. <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
  50. </el-form-item>
  51. <el-form-item label="添加图片:">
  52. <div class="flex-img">
  53. <div class="el-upload-list el-upload-list--picture-card" >
  54. <div class="el-upload-list__item is-success" v-for="(item,index) in this.rotationdata" :key="item.id">
  55. <img class="flex-img__image" :src="item.images">
  56. <label class="el-upload-list__item-status-label">
  57. <i class="el-icon-upload-success el-icon-check"></i>
  58. </label>
  59. <span class="el-upload-list__item-actions">
  60. <span class="el-upload-list__item-delete">
  61. <i class="el-icon-edit-outline" @click="editcenterDialogVisible = true;editRotationEmages(item.id)"></i>
  62. <i class="el-icon-delete" @click="deleteImages(item.id,index)"></i>
  63. </span>
  64. </span>
  65. </div>
  66. </div>
  67. <div class="addrot" @click="addVisible = true;showpic = false" v-show="isNoEpity">
  68. <div class="docone">
  69. <li class="el-icon-plus"></li>
  70. <div class="doctwo">
  71. <span>新增图片</span>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <p class="tips">图片已上传{{totalImages}}张,最多上传9张</p>
  77. </el-form-item>
  78. </el-form>
  79. <span slot="footer" class="dialog-footer">
  80. <el-button @click="slideshow = false">取 消</el-button>
  81. <el-button type="primary" @click="addrotationImage('rotationform')">确 定</el-button>
  82. </span>
  83. </el-dialog>
  84. <!-- 医院地址 -->
  85. <el-dialog
  86. title="新增医院地址"
  87. :visible.sync="hostaddress"
  88. width="35%"
  89. center>
  90. <el-form ref="hospitalform" :model="hospitalform" label-width="90px" :rules="rules">
  91. <el-form-item label="模块标题:" required prop="title">
  92. <el-input v-model="hospitalform.title" ></el-input>
  93. </el-form-item>
  94. <el-form-item label="排序值:" required prop="sort">
  95. <el-input v-model="hospitalform.sort" type="number"></el-input>
  96. <!-- <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p> -->
  97. </el-form-item>
  98. <el-form-item label="医院地址:" required prop="address">
  99. <el-input v-model="hospitalform.address"></el-input>
  100. </el-form-item>
  101. <!-- <el-form-item label="医院地图:">
  102. <baidu-map>
  103. <bm-overview-map anchor="BMAP_ANCHOR_BOTTOM_RIGHT" :isOpen="true"></bm-overview-map>
  104. <bm-local-search :keyword="hospitalform.address" :auto-viewport="true" style="display:none" :center="location" :zoom="zoom"></bm-local-search>
  105. <bm-view class="map"></bm-view>
  106. </baidu-map>
  107. </el-form-item> -->
  108. </el-form>
  109. <span slot="footer" class="dialog-footer">
  110. <el-button @click="hostaddress=false">取 消</el-button>
  111. <el-button type="primary" @click="addHospital('hospitalform');">确 定</el-button>
  112. </span>
  113. </el-dialog>
  114. <!-- 新增联系方式 -->
  115. <el-dialog
  116. title="新增联系方式"
  117. :visible.sync="contact"
  118. width="550px"
  119. center>
  120. <el-form ref="contractform" :model="contractform" label-width="90px" :rules="rules">
  121. <el-form-item label="模块标题:" required prop="title">
  122. <el-input v-model="contractform.title"></el-input>
  123. </el-form-item>
  124. <el-form-item label="排序值:" required prop="sort">
  125. <el-input v-model="contractform.sort" type="number"></el-input>
  126. <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
  127. </el-form-item>
  128. <el-form-item label="联系方式:">
  129. <div class="used">
  130. <ul>
  131. <li v-for="(item,index) in this.connectionway" :key="item.id">
  132. <span class="name">{{item.title}}</span>
  133. <span class="icon">
  134. <i class="el-icon-edit-outline" @click="editLink=true;editConnecWay(item.id)"></i>
  135. <i class="el-icon-delete" @click="deleteConnecWay(item.id,index)"></i>
  136. </span>
  137. </li>
  138. </ul>
  139. </div>
  140. </el-form-item>
  141. </el-form>
  142. <span slot="footer" class="dialog-footer">
  143. <el-button @click="addLink = true">添加联系方式</el-button>
  144. <el-button @click="contact = false">取 消</el-button>
  145. <el-button type="primary" @click="addContract('contractform');">确 定</el-button>
  146. </span>
  147. </el-dialog>
  148. <!-- 添加联系方式内容 -->
  149. <el-dialog
  150. title="新增联系方式"
  151. :visible.sync="addLink"
  152. width="550px"
  153. >
  154. <el-form ref="connecform" :model="connecform" label-width="90px" :rules="rules" >
  155. <el-row>
  156. <el-col :span="20">
  157. <el-form-item label="标题:" required prop="title">
  158. <el-input v-model="connecform.title" style="width:400px"></el-input>
  159. </el-form-item>
  160. </el-col>
  161. </el-row>
  162. <el-form-item label="联系方式:" required prop="connecway">
  163. <el-row>
  164. <el-col :span="20">
  165. <el-radio-group v-model="connecform.connecway">
  166. <el-radio :label="way.id" :value="way.id" v-for="(way,index) in connections" :key="index">{{way.name}}</el-radio>
  167. </el-radio-group>
  168. </el-col>
  169. </el-row>
  170. </el-form-item>
  171. <el-form-item label="内容:" required prop="content">
  172. <el-row>
  173. <el-col :span="20">
  174. <el-input v-model="connecform.content" style="width:400px"></el-input>
  175. </el-col>
  176. </el-row>'
  177. </el-form-item>
  178. </el-form>
  179. <span slot="footer" class="dialog-footer">
  180. <el-button @click="addLink = false">取 消</el-button>
  181. <el-button type="primary" @click="addconnection('connecform');addLink = false">确 定</el-button>
  182. </span>
  183. </el-dialog>
  184. <!-- 编辑联系方式 -->
  185. <el-dialog
  186. title="编辑联系方式"
  187. :visible.sync="editLink"
  188. width="550px"
  189. >
  190. <el-form ref="editconnecform" :model="editconnecform" label-width="90px" :rules="rules" >
  191. <el-row>
  192. <el-col :span="20">
  193. <el-form-item label="标题:" required prop="title">
  194. <el-input v-model="editconnecform.title" style="width:400px"></el-input>
  195. </el-form-item>
  196. </el-col>
  197. </el-row>
  198. <el-form-item label="联系方式:" required prop="connecway">
  199. <el-row>
  200. <el-col :span="20">
  201. <el-radio-group v-model="editconnecform.connecway">
  202. <el-radio :label="way.id" :value="way.id" v-for="(way,index) in connections" :key="index">{{way.name}}</el-radio>
  203. </el-radio-group>
  204. </el-col>
  205. </el-row>
  206. </el-form-item>
  207. <el-form-item label="内容:" required prop="content">
  208. <el-row>
  209. <el-col :span="20">
  210. <el-input v-model="editconnecform.content" style="width:400px"></el-input>
  211. </el-col>
  212. </el-row>'
  213. </el-form-item>
  214. </el-form>
  215. <span slot="footer" class="dialog-footer">
  216. <el-button @click="editLink = false">取 消</el-button>
  217. <el-button type="primary" @click="saveConnecform('editconnecform')">确 定</el-button>
  218. </span>
  219. </el-dialog>
  220. <!-- 工作时间 -->
  221. <el-dialog
  222. title="新增工作时间"
  223. :visible.sync="time"
  224. width="550px"
  225. center>
  226. <el-form ref="woketimeform" :model="woketimeform" label-width="90px" :rules="rules">
  227. <el-form-item label="模块标题:" required prop="title">
  228. <el-input v-model="woketimeform.title"></el-input>
  229. </el-form-item>
  230. <el-form-item label="排序值:" required prop="sort">
  231. <el-input v-model="woketimeform.sort" type="number"></el-input>
  232. <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
  233. </el-form-item>
  234. <el-form-item label="工作时间:" required prop="worktime">
  235. <el-input
  236. type="textarea"
  237. :rows="6"
  238. placeholder="请输入内容"
  239. v-model="woketimeform.worktime">
  240. </el-input>
  241. </el-form-item>
  242. </el-form>
  243. <span slot="footer" class="dialog-footer">
  244. <el-button @click="time = false">取 消</el-button>
  245. <el-button type="primary" @click="addWorkTime('woketimeform');">确 定</el-button>
  246. </span>
  247. </el-dialog>
  248. <!-- 新增乘车方式 -->
  249. <el-dialog
  250. title="新增乘车方式"
  251. :visible.sync="type"
  252. width="550px"
  253. center>
  254. <el-form ref="rideform" :model="rideform" label-width="90px" :rules="rules" :label-position="labelPosition">
  255. <template>
  256. <el-form-item label="模块标题:" required prop="title">
  257. <el-input v-model="rideform.title"></el-input>
  258. </el-form-item>
  259. <el-form-item label="排序值:" required prop="sort">
  260. <el-input v-model="rideform.sort" type="number"></el-input>
  261. <p class="tips">请输入1-99的整数,数值越小,模块排序越靠前</p>
  262. </el-form-item>
  263. <el-form-item label="乘车方式:" required prop="content">
  264. <el-input
  265. type="textarea"
  266. :rows="6"
  267. placeholder="请输入内容"
  268. v-model="rideform.content">
  269. </el-input>
  270. </el-form-item>
  271. </template>
  272. </el-form>
  273. <span slot="footer" class="dialog-footer">
  274. <el-button @click="type = false">取 消</el-button>
  275. <el-button type="primary" @click="addRideWay('rideform');">确 定</el-button>
  276. </span>
  277. </el-dialog>
  278. <!-- 编辑图片 -->
  279. <el-dialog
  280. class="avatar-uploader"
  281. title="编辑图片"
  282. :visible.sync="addVisible"
  283. width="30%"
  284. center>
  285. <el-form ref="picform" :model="picform" label-width="90px" :rules="rules">
  286. <el-form-item label="图片编辑:" required prop="Images">
  287. <el-col :span="5">
  288. <el-upload
  289. :data="Data"
  290. class="avatar-uploader"
  291. action="https://upload.qiniup.com/"
  292. :show-file-list="false"
  293. :on-success="RotationSuccess"
  294. :before-upload="RotationUpload"
  295. :limit="9">
  296. <img v-if="picform.Images" :src="picform.Images" class="avatar" style="width:100px;height:98px">
  297. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  298. </el-upload>
  299. </el-col>
  300. <!-- <el-col :span="19">
  301. <div class="tpic" v-show="showpic">
  302. <img :src="picform.Images" style="width:200px;height:100px">
  303. </div>
  304. </el-col> -->
  305. </el-form-item>
  306. <el-form-item label="排序值:" required prop="sort">
  307. <el-col :span="15">
  308. <el-input v-model="picform.sort" type="number"></el-input>
  309. </el-col>
  310. </el-form-item>
  311. <el-form-item label="图片链接:">
  312. <el-radio-group v-model="picform.piclink">
  313. <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in genderOptions" :key="index" @change="selectGender(gender.id)">{{gender.name}}</el-radio>
  314. </el-radio-group>
  315. </el-form-item>
  316. <el-form-item label="链接地址:" v-show="definetwo">
  317. <el-col :span="10">
  318. <el-input v-model="picform.linkaddress" :disabled="true"></el-input>
  319. </el-col>
  320. <el-col :span="5">
  321. <el-button size="medium" @click="addVisibleThree = true">设置链接</el-button>
  322. </el-col>
  323. </el-form-item>
  324. </el-form>
  325. <span slot="footer" class="dialog-footer">
  326. <el-button @click="addVisible = false">取 消</el-button>
  327. <el-button type="primary" @click="addrotationpic('picform');">确 定</el-button>
  328. </span>
  329. </el-dialog>
  330. <el-dialog
  331. title="添加图片"
  332. :visible.sync="addVisibletwo"
  333. width="30%"
  334. center>
  335. <el-form>
  336. <el-form-item label="添加图片:">
  337. <el-upload
  338. :data="Data"
  339. class="avatar-uploader"
  340. action="https://upload.qiniup.com/"
  341. :show-file-list="false"
  342. :on-success="RotationSuccess"
  343. :before-upload="RotationUpload">
  344. <div class="addimage">
  345. <img v-if="picform.Images" :src="picform.Images" class="avatar" style="width:100px;height:98px">
  346. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  347. </div>
  348. </el-upload>
  349. </el-form-item>
  350. </el-form>
  351. <span slot="footer" class="dialog-footer">
  352. <el-button @click="addVisibletwo = false">取 消</el-button>
  353. <el-button type="primary" @click="addVisibletwo = false">确 定</el-button>
  354. </span>
  355. </el-dialog>
  356. <el-dialog
  357. title="设置图片链接地址:"
  358. :visible.sync="addVisibleThree"
  359. width="30%"
  360. center>
  361. <el-form label-width="120px" :model="linkform" ref="linkform">
  362. <el-form-item label="站外链接:">
  363. <el-input v-model="linkform.defineaddress"></el-input>
  364. </el-form-item>
  365. </el-form>
  366. <span slot="footer" class="dialog-footer">
  367. <el-button @click="addVisibleThree = false">取 消</el-button>
  368. <el-button type="primary" @click="AddPiCLink('linkform');addVisibleThree = false">确 定</el-button>
  369. </span>
  370. </el-dialog>
  371. <el-dialog
  372. title="编辑轮播图"
  373. :visible.sync="editcenterDialogVisible"
  374. width="35%"
  375. center>
  376. <el-form label-width="90px" :model="editrotationform" ref="editrotationform">
  377. <el-form-item label="图片编辑">
  378. <el-col :span="5">
  379. <el-upload
  380. :data="rotationData"
  381. class="avatar-uploader"
  382. action="https://upload.qiniup.com/"
  383. :show-file-list="false"
  384. :on-success="handleAvatarSuccess"
  385. :before-upload="beforeAvatarUpload">
  386. <img v-if="editrotationform.images" style="width:100%;height:100px" :src="editrotationform.images" class="avatar">
  387. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  388. </el-upload>
  389. </el-col>
  390. </el-form-item>
  391. <el-form-item label="排序值:" required prop="sort">
  392. <el-col :span="24">
  393. <el-input v-model="editrotationform.sort" style="width:410px" type="number"></el-input>
  394. </el-col>
  395. </el-form-item>
  396. <el-form-item label="图片链接:">
  397. <el-radio-group v-model="editrotationform.piclink">
  398. <el-radio :label="gender.id" :value="gender.id" v-for="(gender, index) in genderOptions" :key="index" @change="select(gender.id)">{{gender.name}}</el-radio>
  399. </el-radio-group>
  400. </el-form-item>
  401. <el-form-item label="链接地址:">
  402. <el-col :span="15">
  403. <el-input v-model="editrotationform.linkaddress" style="width:300px" :disabled="true"></el-input>
  404. </el-col>
  405. <el-col :span="4">
  406. <el-button size="medium" @click="linkVisible = true;getOutRotationlink(editrotationform.linkid)" >设置链接</el-button>
  407. </el-col>
  408. </el-form-item>
  409. </el-form>
  410. <span slot="footer" class="dialog-footer">
  411. <el-button @click="editcenterDialogVisible = false">取 消</el-button>
  412. <el-button type="primary" @click="UpdatedConrotation('editrotationform')">确 定</el-button>
  413. </span>
  414. </el-dialog>
  415. <el-dialog
  416. title="设置图片链接地址"
  417. :visible.sync="linkVisible"
  418. width="30%"
  419. center>
  420. <el-form label-width="90px" ref="rotationformTwo" :model="rotationformTwo" :rules="rules">
  421. <el-form-item label="站外链接" required prop="defineaddress">
  422. <el-input v-model="rotationformTwo.defineaddress"></el-input>
  423. </el-form-item>
  424. </el-form>
  425. <span slot="footer" class="dialog-footer">
  426. <el-button @click="linkVisible = false">取 消</el-button>
  427. <el-button type="primary" @click="UpdatedRolinkAddress('rotationformTwo')">确 定</el-button>
  428. </span>
  429. </el-dialog>
  430. </div>
  431. </template>
  432. <script>
  433. import { getToken } from '@/api/qiniu'
  434. import { getFileExtension} from '@/utils/tools'
  435. import { addRotationUpload,addHospital,addRideWay,addWorkTime,addconnection,queryConnetion,deleteConnecWay,editConnecWay,
  436. saveConnecform,addContract,addrotationpic,GetRotationImages,addrotationImage,deleteImages,getArticleType,GetArticleById,GetAllActivity,
  437. AddPiCLink,editRotationEmages,GetOutRotationlink,UpdatedRolinkAddress,UpdatedConrotation} from '@/api/site/site'
  438. import { truncateSync } from 'fs';
  439. import {checkNumber} from "@/utils/tools";
  440. export default {
  441. name: "addcontact",
  442. data() {
  443. var checkNumberRule = (rule, value, callback) => {
  444. if (!checkNumber(value)) {
  445. callback(new Error('请输入1-99的整数'));
  446. }else {
  447. callback();
  448. }
  449. };
  450. return {
  451. location: {
  452. lng: 116.404,
  453. lat: 39.915
  454. },
  455. zoom: 12.8,
  456. keyword:"",
  457. show:false,
  458. imageUrl:false,
  459. dialogshow:false,
  460. slideshow:false,
  461. address:false,
  462. hostaddress:false,
  463. contact:false,
  464. addLink:false,
  465. editLink:false,
  466. time:false,
  467. type:false,
  468. disabled: false,
  469. dialogFormVisibleAdd:true,
  470. editcenterDialogVisible:false,
  471. showone:false,
  472. showtwo:false,
  473. showthree:false,
  474. showFour:false,
  475. showFive:false,
  476. linkVisible:false,
  477. definetwo:true,
  478. labelPosition: 'left',
  479. qiniuDomain: 'https://images.shengws.com/',
  480. Data: { token:'',key: '' },
  481. rotationData: { token:'',key: '' },
  482. new1: require("../../../assets/preview/轮播图.png"),
  483. new2: require("../../../assets/preview/医院地址.png"),
  484. new3: require("../../../assets/preview/联系方式.png"),
  485. new4: require("../../../assets/preview/工作时间.png"),
  486. new5: require("../../../assets/preview/公交.png"),
  487. form: {
  488. name: "",
  489. sort:"",
  490. title:"",
  491. },
  492. userlocation: {lng: "", lat: ""},
  493. rotationform:{
  494. title:"",
  495. sort:"",
  496. rotationImages:[],
  497. ids:[],
  498. },
  499. rotationdata:[],
  500. rideform:{
  501. title:"",
  502. sort:"",
  503. content:"",
  504. },
  505. woketimeform:{
  506. title:"",
  507. sort:"",
  508. worktime:"",
  509. },
  510. hospitalform:{
  511. title:"",
  512. sort:"",
  513. address:"",
  514. },
  515. connecform:{
  516. title:"",
  517. connecway:"",
  518. content:"",
  519. },
  520. editconnecform:{
  521. title:"",
  522. connecway:"",
  523. content:"",
  524. },
  525. connections:[
  526. {id:1,name:'电话'},
  527. {id:2,name:'非电话'},
  528. ],
  529. connectionway:[],
  530. contractform:{
  531. title:"",
  532. sort:"",
  533. },
  534. linkform:{
  535. defineaddress:"",
  536. },
  537. linkType:[
  538. {id:1,name:'无'},
  539. {id:2,name:'站内链接:'},
  540. {id:3,name:'站外链接:'},
  541. ],
  542. options:[
  543. {id:1,name:'文章'},
  544. {id:2,name:'活动'},
  545. ],
  546. editrotationform:{
  547. images:"",
  548. sort:"",
  549. piclink:1,
  550. linkaddress:"",
  551. linkid:"",
  552. },
  553. rotationformTwo:{
  554. id:"",
  555. defineaddress:"",
  556. },
  557. rules: {
  558. title: [{required: true, message: "请填写模块标题",},],
  559. sort: [{required: true,message:"请填写排序值"},{validator:checkNumberRule}],
  560. rotationImages:[{required:true,message:"请填写添加图片"}],
  561. content:[{required:true,message:"请填写乘车方式"}],
  562. worktime:[{required:true,message:"请填写工作时间"}],
  563. connecway:[{required:true,message:"请选择联系方式"}],
  564. linkaddress:[{required:true,message:"请填写链接地址"}],
  565. address:[{required:true,message:"请填写医院地址"}],
  566. Images:[{required:true,message:"请上传图片"}],
  567. defineaddress:[{required:true,message:"请填写站外链接"}]
  568. },
  569. addVisible:false,
  570. addVisibletwo:false,
  571. addVisibleThree:false,
  572. picform:{
  573. sort:"",
  574. Images:"",
  575. piclink:2,
  576. linkaddress:"",
  577. linkid:"",
  578. },
  579. showpic:false,
  580. genderOptions:[
  581. {id:1, name:'无'},
  582. {id:2, name:'自定义'},
  583. ],
  584. genderPicLink:[
  585. {id:1,name:"自定义"},
  586. {id:2,name:"不跳转"},
  587. ],
  588. define:false,
  589. articeTypelist:[],
  590. articeNamelist:[],
  591. isNoEpity:true,
  592. totalImages:0,
  593. };
  594. },
  595. methods:{
  596. changeInput(e){
  597. this.$forceUpdate();
  598. },
  599. selectGender(id){
  600. if(id == 1){
  601. this.definetwo = false;
  602. }
  603. if(id == 2){
  604. this.definetwo = true;
  605. }
  606. },
  607. selectItem(id){
  608. if(id == 1){
  609. this.showone = false;
  610. this.showtwo = false;
  611. this.showthree = false;
  612. this.showFour = false;
  613. this.showFive = false;
  614. }
  615. if(id == 2){
  616. this.showone = true;
  617. this.showtwo = false;
  618. this.showthree = false;
  619. this.showFive = true;
  620. }
  621. if(id == 3){
  622. this.showone = false;
  623. this.showtwo = false;
  624. this.showthree = true;
  625. this.showFive = false;
  626. }
  627. },
  628. changeType(id){
  629. if(id == 1){
  630. this.showFour = true;
  631. }
  632. if(id == 2){
  633. this.showFour = false;
  634. GetAllActivity(this.articeNamelist).then(response=>{
  635. if(response.data.state == 1){
  636. var activtity = response.data.data.activtity;
  637. this.articeNamelist = response.data.data.activtity;
  638. }
  639. })
  640. }
  641. },
  642. GetArticleById(id){
  643. GetArticleById(id,this.linkform).then(response=>{
  644. if(response.data.state == 1){
  645. var articlelist = response.data.data.articlelist;
  646. this.articeNamelist = response.data.data.articlelist;
  647. }
  648. })
  649. },
  650. AddPiCLink(formName){
  651. this.$refs[formName].validate((valid)=>{
  652. if(valid){
  653. AddPiCLink(this.linkform).then(response=>{
  654. if(response.data.state == 1){
  655. var conlinkaddress = response.data.data.conlinkaddress;
  656. console.log("conlinkaddress是什么",conlinkaddress)
  657. this.picform.linkaddress = conlinkaddress.defineaddress;
  658. this.picform.linkid = conlinkaddress.id;
  659. }
  660. })
  661. }
  662. })
  663. },
  664. RotationSuccess(res,file,filelist){
  665. this.picform.Images =this.qiniuDomain + res.url;
  666. this.showpic = true;
  667. },
  668. RotationUpload(file){
  669. var fileType = file.type
  670. const isJPG = fileType.indexOf("image") > -1;
  671. const isLt2M = file.size / 1024 / 1024 < 2;
  672. if (!isJPG) {
  673. this.$message.error("只能上传图片");
  674. return false;
  675. }
  676. if (!isLt2M) {
  677. this.$message.error("图片大小不能超过 2MB!");
  678. return false;
  679. }
  680. var date = new Date()
  681. var ext = getFileExtension(file.name)
  682. var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
  683. const _self = this
  684. return new Promise((resolve, reject) => {
  685. getToken().then(response => {
  686. const token= response.data.data.uptoken
  687. console.log("联系我们轮播图token是什么?",token)
  688. _self._data.Data.token = token;
  689. _self._data.Data.key = key;
  690. resolve(true)
  691. }).catch(err => {
  692. reject(false)
  693. })
  694. })
  695. return isJPG && isLt2M;
  696. },
  697. handleAvatarSuccess(res,file){
  698. this.editrotationform.images = this.qiniuDomain +res.url;
  699. console.log("是什么",this.editrotationform.imageUrl)
  700. },
  701. beforeAvatarUpload(file){
  702. var fileType = file.type
  703. const isJPG = fileType.indexOf("image") > -1;
  704. const isLt2M = file.size / 1024 / 1024 < 2;
  705. if (!isJPG) {
  706. this.$message.error("只能上传图片");
  707. return false;
  708. }
  709. if (!isLt2M) {
  710. this.$message.error("图片大小不能超过 2MB!");
  711. return false;
  712. }
  713. var date = new Date()
  714. var ext = getFileExtension(file.name)
  715. var key = date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() +'_o_' + file.uid + '.' + ext;
  716. const _self = this
  717. return new Promise((resolve, reject) => {
  718. getToken().then(response => {
  719. const token= response.data.data.uptoken
  720. console.log("联系我们轮播图token是什么?",token)
  721. _self._data.rotationData.token = token;
  722. _self._data.rotationData.key = key;
  723. resolve(true)
  724. }).catch(err => {
  725. reject(false)
  726. })
  727. })
  728. return isJPG && isLt2M;
  729. },
  730. //新增医院地址
  731. addHospital(formName){
  732. var sorts = this.hospitalform.sort
  733. var sort = parseInt(sorts)
  734. this.hospitalform.sort = sort
  735. this.$refs[formName].validate((valid)=>{
  736. if(valid){
  737. addHospital(this.hospitalform).then(response=>{
  738. if(response.data.state ==1){
  739. this.hostaddress = false;
  740. var hosaddress = response.data.data.hosaddress;
  741. console.log('新增医院地址数据',hosaddress);
  742. this.$emit('getOrderModel');
  743. }
  744. })
  745. }
  746. })
  747. },
  748. //新增联系方式
  749. addconnection(formName){
  750. this.$refs[formName].validate((valid)=>{
  751. if(valid){
  752. addconnection(this.connecform).then(response=>{
  753. if(response.data.state==1){
  754. var cooection = response.data.data.connection;
  755. // console.log("返回数据",cooection);
  756. this.queryConnetion();
  757. this.connecform.title = "";
  758. this.connecform.content = "";
  759. }
  760. })
  761. }
  762. })
  763. },
  764. //获取联系方式
  765. queryConnetion(){
  766. queryConnetion().then(response=>{
  767. if(response.data.state ==1){
  768. this.connectionway = response.data.data.conection;
  769. // console.log("联系方式返回数据",this.connectionway);
  770. }
  771. })
  772. },
  773. //删除联系方式
  774. deleteConnecWay(id,index){
  775. this.$confirm('确定要删除该信息么?,删除后将无法恢复!',{
  776. dangerouslyUseHTMLString:true,
  777. confirmButtonText: '确定',
  778. cancelButtonText: '取消',
  779. type: 'warning'
  780. }).then(()=>{
  781. deleteConnecWay(id).then(response=>{
  782. if(response.data.state==1){
  783. this.connectionway.splice(index,1);
  784. }
  785. }).catch(e=>{});
  786. }).catch(e=>{});
  787. },
  788. //编辑联系方式
  789. editConnecWay(id){
  790. console.log("id是啥",id);
  791. editConnecWay(id).then(response=>{
  792. if(response.data.state == 1){
  793. this.editconnecform = response.data.data.connection;
  794. // console.log("返回数据",this.connecform);
  795. }
  796. })
  797. },
  798. //编辑保存后的联系方式
  799. saveConnecform(formName){
  800. this.$refs[formName].validate((valid)=>{
  801. if(valid){
  802. saveConnecform(this.editconnecform.id,this.editconnecform).then(response=>{
  803. if(response.data.state == 1){
  804. var connection = response.data.data.connection;
  805. // console.log("返回数据",connection);
  806. this.editLink =false;
  807. this.queryConnetion();
  808. }
  809. })
  810. }
  811. })
  812. },
  813. //添加联系方式
  814. addContract(formName){
  815. var sorts = this.contractform.sort
  816. var sort = parseInt(sorts)
  817. this.contractform.sort = sort
  818. this.$refs[formName].validate((valid)=>{
  819. if(valid){
  820. addContract(this.contractform).then(response=>{
  821. if(response.data.state == 1){
  822. this.contact = false;
  823. var connectway = response.data.data.connectway;
  824. var ordmodel = response.data.data.ordmodel;
  825. this.$emit('getOrderModel');
  826. // console.log("返回数据",connectway);
  827. // console.log("返回数据",ordmodel)
  828. }
  829. })
  830. }
  831. })
  832. },
  833. //添加工作时间
  834. addWorkTime(formName){
  835. var sorts = this.woketimeform.sort
  836. var sort = parseInt(sorts)
  837. this.woketimeform.sort = sort
  838. this.$refs[formName].validate((valid)=>{
  839. if(valid){
  840. addWorkTime(this.woketimeform).then(response=>{
  841. if(response.data.state==1){
  842. this.time = false;
  843. var ordmodel = response.data.data.ordmodel;
  844. var patientWorktime = response.data.data.patientWorktime
  845. // console.log("返回数据",ordmodel);
  846. // console.log("返回数据",patientWorktime)
  847. this.time = false;
  848. this.$emit('getOrderModel');
  849. }
  850. })
  851. }
  852. })
  853. },
  854. //添加乘车方式
  855. addRideWay(formName){
  856. var sorts = this.rideform.sort
  857. var sort = parseInt(sorts)
  858. this.rideform.sort = sort
  859. this.$refs[formName].validate((valid)=>{
  860. if(valid){
  861. addRideWay(this.rideform).then(response=>{
  862. if(response.data.state==1){
  863. var rideway = response.data.data.rideway;
  864. // console.log("返回数据",rideway);
  865. var ordemodel = response.data.data.ordemodel;
  866. // console.log("返回数据",ordemodel)
  867. this.type = false;
  868. this.$emit('getOrderModel');
  869. }
  870. })
  871. }
  872. })
  873. },
  874. hospitaAddress(){
  875. this.hostaddress = true;
  876. },
  877. addrotationpic(formName){
  878. if(this.picform.linkid == ""){
  879. this.picform.linkid = 0;
  880. }
  881. var sorts = this.picform.sort
  882. var sort = parseInt(sorts)
  883. this.picform.sort = sort
  884. this.$refs[formName].validate((valid)=>{
  885. if(valid){
  886. addrotationpic(this.picform).then(response=>{
  887. if(response.data.state ==1){
  888. this.addVisible = false;
  889. var conrotation = response.data.data.conrotation;
  890. var total = response.data.data.total;
  891. this.totalImages = total;
  892. if(total >=9){
  893. this.isNoEpity = false;
  894. }
  895. this.picform.Images = "";
  896. this.picform.sort = "";
  897. this.picform.linkaddress = "";
  898. this.GetRotationImages();
  899. }
  900. })
  901. }
  902. })
  903. },
  904. GetRotationImages(){
  905. GetRotationImages(this.picform.id).then(response=>{
  906. if(response.data.state == 1){
  907. var conrotations = response.data.data.conrotations;
  908. console.log("获取轮播图片",conrotations)
  909. this.rotationdata = response.data.data.conrotations;
  910. }
  911. })
  912. },
  913. addrotationImage(formName){
  914. var sorts = this.rotationform.sort;
  915. var sort = parseInt(sorts);
  916. this.rotationform.sort = sort;
  917. for (let index = 0; index < this.rotationdata.length; index++) {
  918. this.rotationform.rotationImages.push(this.rotationdata[index].images);
  919. this.rotationform.ids.push(this.rotationdata[index].id);
  920. }
  921. console.log("this.rotationform.raotationimages",this.rotationform.rotationImages)
  922. this.$refs[formName].validate((valid)=>{
  923. if(valid){
  924. addrotationImage(this.rotationform).then(response=>{
  925. if(response.data.state == 1){
  926. var oldrotation = response.data.data.oldrotation;
  927. this.slideshow = false;
  928. this.$emit('getOrderModel');
  929. this.rotationform.title = "";
  930. this.rotationform.sort = "";
  931. this.rotationdata = [];
  932. this.rotationform.ids = [];
  933. this.totalImages = 0;
  934. }
  935. })
  936. }
  937. })
  938. },
  939. deleteImages(id,imgshow,index){
  940. deleteImages(id).then(response=>{
  941. if(response.data.state == 1){
  942. this.rotationdata.splice(index,1);
  943. var total = response.data.data.total;
  944. this.totalImages = total;
  945. this.isNoEpity = true;
  946. }
  947. })
  948. },
  949. getArticleType(){
  950. getArticleType(this.articeTypelist).then(response=>{
  951. if(response.data.state == 1){
  952. var category = response.data.data.category;
  953. this.articeTypelist = response.data.data.category;
  954. console.log("文章分类是什么",this.articeTypelist)
  955. }
  956. })
  957. },
  958. editRotationEmages(id){
  959. editRotationEmages(id).then(response=>{
  960. if(response.data.state == 1){
  961. var conrotation = response.data.data.conrotation;
  962. this.editrotationform = conrotation;
  963. // console.log("conrotation是什么",conrotation)
  964. }
  965. })
  966. },
  967. getOutRotationlink(linkid){
  968. GetOutRotationlink(linkid).then(response=>{
  969. if(response.data.state == 1){
  970. var conlinkaddress = response.data.data.conlinkaddress;
  971. console.log("conlinkaddress",conlinkaddress)
  972. this.rotationformTwo.defineaddress = conlinkaddress.defineaddress;
  973. this.rotationformTwo.id = conlinkaddress.id;
  974. console.log("hh",this.rotationformTwo.defineaddress)
  975. console.log(this.rotationformTwo.id)
  976. }
  977. })
  978. },
  979. UpdatedRolinkAddress(formName){
  980. this.$refs[formName].validate((valid)=>{
  981. if(valid){
  982. UpdatedRolinkAddress(this.rotationformTwo.id,this.rotationformTwo).then(response=>{
  983. if(response.data.state == 1){
  984. this.linkVisible = false;
  985. var conlinkaddress = response.data.data.conlinkaddress;
  986. this.editrotationform.linkaddress = conlinkaddress.defineaddress;
  987. }
  988. })
  989. }
  990. })
  991. },
  992. UpdatedConrotation(formName){
  993. var sort = this.editrotationform.sort;
  994. var sorts = parseInt(sort);
  995. this.editrotationform.sort = sorts;
  996. this.$refs[formName].validate((valid)=>{
  997. if(valid){
  998. UpdatedConrotation(this.editrotationform.id,this.editrotationform).then(response=>{
  999. if(response.data.state == 1){
  1000. this.editcenterDialogVisible = false;
  1001. var conrotation = response.data.data.conrotation;
  1002. conrotation.log("conrotation",conrotation)
  1003. }
  1004. })
  1005. }
  1006. })
  1007. }
  1008. },
  1009. created(){
  1010. this.queryConnetion();
  1011. this.GetRotationImages();
  1012. this.getArticleType();
  1013. },
  1014. };
  1015. </script>
  1016. <style rel="stylesheet/scss" lang="scss" scoped>
  1017. .tpic{
  1018. margin-left: 50px;
  1019. }
  1020. .map {
  1021. width: 100%;
  1022. height: 400px;
  1023. }
  1024. .tips {
  1025. font-size: 12px;
  1026. line-height: 18px;
  1027. }
  1028. .addrot{
  1029. width: 100px;
  1030. height: 100px;
  1031. border: dashed 1px #409EFF;
  1032. }
  1033. .docone{
  1034. width: 30px;
  1035. height: 30px;
  1036. // border: solid 1px red;
  1037. margin-top: 30px;
  1038. margin-left: 30px;
  1039. font-size: 30px;
  1040. }
  1041. .doctwo{
  1042. width: 70px;
  1043. height: 30px;
  1044. font-size: 14px;
  1045. // border: solid 1px red;
  1046. margin-left: -8px;
  1047. margin-top: -10px;
  1048. }
  1049. .el-upload-list--picture-card .el-upload-list__item {
  1050. overflow: hidden;
  1051. background-color: #fff;
  1052. border: 1px solid #c0ccda;
  1053. border-radius: 6px;
  1054. -webkit-box-sizing: border-box;
  1055. box-sizing: border-box;
  1056. width: 100px;
  1057. height: 100px;
  1058. margin: 0 8px 8px 0;
  1059. display: inline-block;
  1060. }
  1061. .flex-img__image{
  1062. width: 100%;
  1063. height: 100%;
  1064. }
  1065. .addimage{
  1066. width: 100px;
  1067. height: 100px;
  1068. border: dashed 1px #409EFF;
  1069. font-size: 30px;
  1070. }
  1071. .avatar-uploader-icon{
  1072. margin-top: 30px;
  1073. margin-left: 25px;
  1074. }
  1075. .avatar-uploader{
  1076. border-color: #409EFF;
  1077. border:dashed 1px #409eff;
  1078. width: 100px;
  1079. height: 100px;
  1080. }
  1081. .avatar-uploader-icon {
  1082. font-size: 28px;
  1083. color: #8c939d;
  1084. width: 50px;
  1085. height: 50px;
  1086. line-height: 50px;
  1087. margin-left: 25px;
  1088. margin-top: 25px;
  1089. text-align: center;
  1090. }
  1091. .used {
  1092. ul {
  1093. li {
  1094. height: 44px;
  1095. line-height: 44px;
  1096. font-size: 14px;
  1097. display: flex;
  1098. color: #606266;
  1099. align-items: center;
  1100. justify-content: space-between;
  1101. border: 1px solid #e4e7ed;
  1102. padding: 0 10px;
  1103. margin-bottom: 10px;
  1104. border-radius: 4px;
  1105. i {
  1106. font-size: 19px;
  1107. margin: 0 6px;
  1108. cursor: pointer;
  1109. }
  1110. }
  1111. }
  1112. }
  1113. </style>