addressManager.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 教学点管理
  6. </h2>
  7. <div
  8. class="m-core"
  9. v-if="
  10. (tableList.length > 0 ||
  11. pageInfo.page > 1 ||
  12. searchForm.search ||
  13. searchForm.organId ||
  14. searchForm.publicFlag) &&
  15. contextFlag
  16. "
  17. >
  18. <save-form
  19. :inline="true"
  20. class="searchForm"
  21. @submit="search"
  22. @reset="onReset"
  23. :model="searchForm"
  24. >
  25. <el-form-item>
  26. <el-input
  27. type="text"
  28. clearable
  29. v-model.trim="searchForm.search"
  30. placeholder="教学点名称"
  31. ></el-input>
  32. </el-form-item>
  33. <el-form-item>
  34. <el-select
  35. v-model.trim="searchForm.organId"
  36. clearable
  37. filterable
  38. placeholder="请选择分部"
  39. >
  40. <el-option
  41. v-for="item in selects.branchs"
  42. :key="item.id"
  43. :label="item.name"
  44. :value="item.id"
  45. ></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item>
  49. <el-select
  50. v-model.trim="searchForm.publicFlag"
  51. clearable
  52. filterable
  53. placeholder="可用状态"
  54. >
  55. <el-option label="个人" value="0"></el-option>
  56. <el-option label="公共" value="1"></el-option>
  57. </el-select>
  58. </el-form-item>
  59. <el-form-item>
  60. <el-button native-type="submit" type="danger">搜索</el-button>
  61. <el-button native-type="reset" type="primary">重置</el-button>
  62. <el-button
  63. @click="onExport"
  64. type="primary"
  65. v-permission="'export/exportSchoolList'"
  66. >导出</el-button
  67. >
  68. </el-form-item>
  69. </save-form>
  70. <el-button
  71. @click="openTeaching('create')"
  72. v-permission="'school/add'"
  73. type="primary"
  74. style="margin-bottom: 20px"
  75. >
  76. 新建
  77. </el-button>
  78. <!-- 列表 -->
  79. <div class="tableWrap">
  80. <el-table
  81. :data="tableList"
  82. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  83. >
  84. <el-table-column align="center" width="55" prop="id" label="编号">
  85. </el-table-column>
  86. <el-table-column align="center" prop="name" label="教学点名称">
  87. </el-table-column>
  88. <el-table-column align="center" prop="organName" label="所属分部">
  89. </el-table-column>
  90. <el-table-column
  91. align="center"
  92. label="教学点来源"
  93. :formatter="filterOrgan"
  94. width="120px"
  95. >
  96. <!-- <template slot-scope="scope">
  97. {{ scope.row.cooperationOrganId ? scope.row.cooperationOrganId : '租赁' }}
  98. </template> -->
  99. </el-table-column>
  100. <el-table-column align="center" label="可用状态" width="120px">
  101. <template slot-scope="scope">
  102. {{ scope.row.userId ? scope.row.realName : "公共" }}
  103. </template>
  104. </el-table-column>
  105. <el-table-column align="center" width="120px" label="租赁费用">
  106. <template slot-scope="scope">
  107. {{ scope.row.cooperationOrganId ? "免费" : scope.row.remark }}
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" label="上课地点详情">
  111. <template slot-scope="scope">
  112. {{ scope.row.address.split(",").join("") }}
  113. </template>
  114. </el-table-column>
  115. <el-table-column align="center" prop="delFlag" label="状态">
  116. <template slot-scope="scope">
  117. {{ scope.row.delFlag == 2 ? "停用" : "启用" }}
  118. </template>
  119. </el-table-column>
  120. <!-- <el-table-column align='center'
  121. label="课酬补贴">
  122. <template slot-scope="scope">
  123. {{ scope.row.subsidy ? scope.row.subsidy : '无' }}
  124. </template>
  125. </el-table-column> -->
  126. <el-table-column align="center" label="操作">
  127. <template slot-scope="scope">
  128. <el-button
  129. @click="openTeaching('update', scope.row)"
  130. v-if="$helpers.permission('school/update')"
  131. type="text"
  132. >修改</el-button
  133. >
  134. <el-button
  135. v-if="scope.row.delFlag == 0 && $helpers.permission('school/update/stop')"
  136. @click="onUpdateSubmit(scope.row, 2)"
  137. type="text"
  138. >停用</el-button
  139. >
  140. <el-button
  141. v-if="scope.row.delFlag == 2 && $helpers.permission('school/update/open')"
  142. @click="onUpdateSubmit(scope.row, 0)"
  143. type="text"
  144. >启用</el-button
  145. >
  146. <el-button
  147. @click="onUpdateSubmit(scope.row, 1)"
  148. v-if="$helpers.permission('school/update/del')"
  149. type="text"
  150. >删除</el-button
  151. >
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. <pagination
  156. sync
  157. :total.sync="pageInfo.total"
  158. :page.sync="pageInfo.page"
  159. :limit.sync="pageInfo.limit"
  160. :page-sizes="pageInfo.page_size"
  161. @pagination="getList"
  162. />
  163. </div>
  164. </div>
  165. <emptyPage
  166. @submit="openTeaching('create')"
  167. title="教学点管理"
  168. btnTitle="新建教学点"
  169. :context="context"
  170. v-if="
  171. !(
  172. tableList.length > 0 ||
  173. pageInfo.page > 1 ||
  174. searchForm.search ||
  175. searchForm.organId ||
  176. searchForm.publicFlag
  177. ) && contextFlag
  178. "
  179. />
  180. <el-dialog
  181. :title="formTitle[formActionTitle]"
  182. :visible.sync="teachingStatus"
  183. @close="onFormClose('ruleForm')"
  184. width="500px"
  185. >
  186. <el-form :model="form" :rules="rules" ref="ruleForm">
  187. <el-form-item label="教学点名称" prop="name" :label-width="formLabelWidth">
  188. <el-input v-model.trim="form.name" autocomplete="off"></el-input>
  189. </el-form-item>
  190. <el-form-item label="教学点来源" prop="source" :label-width="formLabelWidth">
  191. <template v-if="formActionTitle == 'update'">
  192. <el-select
  193. v-model.trim="form.source"
  194. style="width: 100% !important"
  195. filterable
  196. clearable
  197. disabled
  198. >
  199. <el-option label="合作单位" value="1"></el-option>
  200. <el-option label="租赁" value="2"></el-option>
  201. </el-select>
  202. </template>
  203. <template v-else>
  204. <el-select
  205. v-model.trim="form.source"
  206. filterable
  207. style="width: 100% !important"
  208. clearable
  209. >
  210. <el-option label="合作单位" value="1"></el-option>
  211. <el-option label="租赁" value="2"></el-option>
  212. </el-select>
  213. </template>
  214. </el-form-item>
  215. <el-form-item
  216. v-if="form.source == 1"
  217. prop="cooperationOrganId"
  218. label="合作单位"
  219. :label-width="formLabelWidth"
  220. >
  221. <el-select
  222. v-model.trim="form.cooperationOrganId"
  223. filterable
  224. style="width: 100% !important"
  225. clearable
  226. @change="onCooperationChange"
  227. >
  228. <el-option
  229. v-for="item in cooperationList"
  230. :key="item.value"
  231. :label="item.label"
  232. :value="item.value"
  233. ></el-option>
  234. </el-select>
  235. </el-form-item>
  236. <el-form-item
  237. v-if="formActionTitle == 'update'"
  238. prop="user"
  239. label="可用状态"
  240. :label-width="formLabelWidth"
  241. >
  242. <el-input v-model="form.user" disabled></el-input>
  243. </el-form-item>
  244. <el-form-item
  245. v-if="form.source == 2"
  246. prop="remark"
  247. label="租赁费用"
  248. :label-width="formLabelWidth"
  249. >
  250. <el-input
  251. v-model.trim="form.remark"
  252. type="number"
  253. autocomplete="off"
  254. ></el-input>
  255. </el-form-item>
  256. <!-- v-if="form.source == 2" -->
  257. <el-form-item prop="organId" label="所属分部" :label-width="formLabelWidth">
  258. <el-select
  259. :disabled="form.source != 2"
  260. v-model.trim="form.organId"
  261. clearable
  262. style="width: 100% !important"
  263. filterable
  264. >
  265. <el-option
  266. v-for="item in selects.branchs"
  267. :key="item.id"
  268. :label="item.name"
  269. :value="item.id"
  270. ></el-option>
  271. </el-select>
  272. </el-form-item>
  273. <!-- :show-message="addressMessage" -->
  274. <el-form-item prop="address" label="上课地点" :label-width="formLabelWidth">
  275. <el-input class="text-address" v-model.trim="form.address" :disabled="true">
  276. <template slot="append">
  277. <el-button
  278. class="addMapBtn"
  279. @click="addMap"
  280. type="primary"
  281. icon="el-icon-plus"
  282. >选择</el-button
  283. >
  284. </template>
  285. </el-input>
  286. </el-form-item>
  287. <!-- <el-form-item
  288. label="课酬补贴"
  289. prop="subsidy"
  290. :label-width="formLabelWidth"
  291. >
  292. <el-input
  293. v-model.trim.number="form.subsidy"
  294. type="number"
  295. autocomplete="off"
  296. ></el-input>
  297. </el-form-item> -->
  298. </el-form>
  299. <span slot="footer" class="dialog-footer">
  300. <el-button @click="onTeachingCancel('ruleForm')">取 消</el-button>
  301. <el-button type="primary" @click="onTeachingSubmit('ruleForm')">确 定</el-button>
  302. </span>
  303. </el-dialog>
  304. <el-dialog
  305. :close-on-click-modal="false"
  306. title="选择地图"
  307. custom-class="map-container"
  308. :visible.sync="mapStatus"
  309. width="800px"
  310. >
  311. <div style="padding: 0 20px">
  312. <el-alert
  313. style="margin: 10px 0"
  314. title="选中地点:"
  315. :closable="false"
  316. type="info"
  317. :description="addressDetail.address"
  318. >
  319. </el-alert>
  320. <el-amap-search-box
  321. class="search-box"
  322. value="searchValue"
  323. :search-option="searchOption"
  324. :on-search-result="onSearchResult"
  325. ></el-amap-search-box>
  326. <el-amap :zoom="zoom" :plugin="plugin" :center="center" :events="events">
  327. <el-amap-marker
  328. :events="markerEvents()"
  329. v-for="(marker, index) in markers"
  330. :key="index"
  331. :position="marker"
  332. ></el-amap-marker>
  333. </el-amap>
  334. </div>
  335. <span slot="footer" class="dialog-footer">
  336. <el-button @click="mapStatus = false">取 消</el-button>
  337. <el-button type="primary" @click="setAddrss">确 定</el-button>
  338. </span>
  339. </el-dialog>
  340. </div>
  341. </template>
  342. <script>
  343. import pagination from "@/components/Pagination/index";
  344. import { Export } from "@/utils/downLoadFile";
  345. import qs from "qs";
  346. import cleanDeep from "clean-deep";
  347. // 地图
  348. (function () {
  349. let func = EventTarget.prototype.addEventListener;
  350. let supportsPassive = false;
  351. try {
  352. let opts = Object.defineProperty({}, "passive", {
  353. get: function () {
  354. supportsPassive = true;
  355. },
  356. });
  357. document.addEventListener("testPassive", null, opts);
  358. document.removeEventListener("testPassive", null, opts);
  359. } catch (e) {}
  360. EventTarget.prototype.addEventListener = function (type, fn, capture) {
  361. this.func = func;
  362. capture = capture instanceof Object ? capture : {};
  363. capture.passive = supportsPassive;
  364. this.func(type, fn, capture);
  365. };
  366. })();
  367. import {
  368. schoolQueryPage,
  369. schoolAdd,
  370. schoolUpdate,
  371. queryByOrganId,
  372. schoolDel,
  373. } from "@/api/systemManage";
  374. import { getEmployeeOrgan } from "@/api/buildTeam";
  375. import store from "@/store";
  376. import VueAMap from "vue-amap";
  377. // Vue.use(VueAMap)
  378. VueAMap.initAMapApiLoader({
  379. key: "b1e6ac2eb28902ce91a490edf194e000",
  380. plugin: ["AMap.Geolocation", "AMap.PlaceSearch", "AMap.Geocoder", "Geocoder"],
  381. v: "1.4.4",
  382. });
  383. import emptyPage from "@/components/emptyPage";
  384. export default {
  385. name: "addressManager",
  386. components: { pagination, emptyPage },
  387. data() {
  388. let self = this;
  389. return {
  390. searchForm: {
  391. search: null,
  392. organId: null,
  393. publicFlag: null,
  394. },
  395. searchLsit: [],
  396. tableList: [],
  397. pageInfo: {
  398. // 分页规则
  399. limit: 10, // 限制显示条数
  400. page: 1, // 当前页
  401. total: 0, // 总条数
  402. page_size: [10, 20, 40, 50], // 选择限制显示条数
  403. },
  404. formActionTitle: "create",
  405. formTitle: {
  406. create: "添加教学点",
  407. update: "修改教学点",
  408. },
  409. teachingStatus: false, // 添加教学点
  410. formLabelWidth: "100px",
  411. addressDetail: {},
  412. form: {
  413. name: null, // 教学点名称
  414. source: null, // 来源
  415. cooperationOrganId: null, // 合作单位
  416. remark: null, // 费用
  417. address: null, // 上课地点
  418. subsidy: null, // 课酬补贴
  419. organId: null, // 分部编号
  420. },
  421. selectOrganId: null, // 选中的分部编号
  422. rules: {
  423. name: [{ required: true, message: "请输入教学点名称", trigger: "blur" }],
  424. source: [{ required: true, message: "请选择教学点来源", trigger: "change" }],
  425. remark: [{ required: true, message: "请输入租赁费用", trigger: "blur" }],
  426. address: [{ required: true, message: "请选择上课地点", trigger: "blur" }],
  427. cooperationOrganId: [
  428. { required: true, message: "请选择合作单位", trigger: "change" },
  429. ],
  430. organId: [{ required: true, message: "请选择所属分部", trigger: "change" }],
  431. subsidy: [{ type: "number", message: "课酬补贴只能为数字", trigger: "blur" }],
  432. },
  433. events: {
  434. init(o) {},
  435. zoomchange: (e) => {
  436. // console.log(e);
  437. },
  438. zoomend: (e) => {
  439. //获取当前缩放zoom值
  440. // console.log(this.$refs.map.$$getInstance().getZoom());
  441. // console.log(e);
  442. },
  443. click: (e) => {
  444. this.getpoient(e);
  445. },
  446. },
  447. addressMessage: true,
  448. mapStatus: false,
  449. zoom: 16,
  450. center: [114.34371, 30.55939],
  451. markers: [],
  452. plugin: [],
  453. searchOption: {
  454. city: "",
  455. citylimit: true,
  456. pageSize: 1, // 单页显示结果条数
  457. pageIndex: 1, // 页码
  458. autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
  459. },
  460. cooperationList: [], // 合作单位列表
  461. searchValue: "测试",
  462. activeAddress: {},
  463. context:
  464. "教学点是乐团、VIP课线下课的教学位置,不同分部可创建不同的教学点,线下课排课时需选择教学点,老师需在课程教学点的定位范围内完成考勤。教学点可设置合作单位提供、租赁两种方式。",
  465. contextFlag: false,
  466. };
  467. },
  468. mounted() {
  469. this.getList();
  470. this.getBreachList();
  471. },
  472. methods: {
  473. onTeachingSubmit(formName) {
  474. // 添加数据
  475. this.$refs[formName].validate((valid) => {
  476. if (valid) {
  477. // if(this.form.source == 1) { // 判断是租赁还是合作单位
  478. // this.form.organId = this.selectOrganId
  479. // }
  480. if (this.formActionTitle == "create") {
  481. schoolAdd(this.form).then((res) => {
  482. if (res.code == 200) {
  483. this.$message.success("添加成功");
  484. this.teachingStatus = false;
  485. this.getList();
  486. } else {
  487. this.$message.error(res.msg);
  488. }
  489. });
  490. } else if (this.formActionTitle == "update") {
  491. schoolUpdate(this.form).then((res) => {
  492. if (res.code == 200) {
  493. this.$message.success("修改成功");
  494. this.teachingStatus = false;
  495. this.getList();
  496. } else {
  497. this.$message.error(res.msg);
  498. }
  499. });
  500. }
  501. } else {
  502. return false;
  503. }
  504. });
  505. },
  506. onTeachingCancel(formName) {
  507. this.teachingStatus = false;
  508. this.$refs[formName].clearValidate();
  509. },
  510. addMap() {
  511. //
  512. this.mapStatus = true;
  513. // let poi = this.addressDetail.poi
  514. // let address = this.addressDetail.address
  515. this.addressDetail.address = this.form.address;
  516. this.addressDetail.poi = this.form.longitudeLatitude;
  517. let poi = this.form.longitudeLatitude;
  518. let address = this.form.address;
  519. // 获取经纬度
  520. if (poi) {
  521. this.markers = [];
  522. this.center = [poi.split(",")[0], poi.split(",")[1]];
  523. this.markers.push([poi.split(",")[0], poi.split(",")[1]]);
  524. } else if (address && poi == "") {
  525. let that = this;
  526. //构造地点查询类
  527. let placeSearch = new AMap.PlaceSearch({
  528. pageSize: 1, // 单页显示结果条数
  529. pageIndex: 1, // 页码
  530. });
  531. //关键字查询
  532. placeSearch.search(address, function (status, result) {
  533. if (status === "complete") {
  534. let pois = result.poiList.pois[0];
  535. poi = pois.location.lng + "," + pois.location.lat;
  536. that.center = [pois.location.lng, pois.location.lat];
  537. that.markers.push([pois.location.lng, pois.location.lat]);
  538. }
  539. });
  540. }
  541. },
  542. onCooperationChange(value) {
  543. this.form.organId = null;
  544. this.cooperationList.forEach((item) => {
  545. if (item.value == value) {
  546. // this.selectOrganId = item.organId
  547. this.form.organId = item.organId;
  548. }
  549. });
  550. },
  551. onSearchResult(pois) {
  552. // 搜索出来的Marker
  553. this.markers = []; // 搜索时进行数据重置
  554. let latSum = 0;
  555. let lngSum = 0;
  556. if (pois.length > 0) {
  557. pois.forEach((poi) => {
  558. let { lng, lat } = poi.location;
  559. lngSum += lng;
  560. latSum += lat;
  561. this.markers.push([poi.location.lng, poi.location.lat]);
  562. });
  563. let center = {
  564. lng: lngSum / pois.length,
  565. lat: latSum / pois.length,
  566. };
  567. this.center = [center.lng, center.lat];
  568. }
  569. let geocoder = null;
  570. AMap.plugin(["AMap.Geocoder"], function () {
  571. geocoder = new AMap.Geocoder();
  572. });
  573. let that = this;
  574. geocoder.getAddress(pois[0].location, function (status, result) {
  575. if (status === "complete" && result.regeocode) {
  576. result.regeocode.lnglat = pois[0].location;
  577. let ct = result.regeocode.addressComponent;
  578. that.addressDetail = {
  579. address:
  580. ct.province +
  581. "," +
  582. ct.city +
  583. "," +
  584. ct.district +
  585. "," +
  586. ct.township +
  587. ct.street +
  588. ct.streetNumber,
  589. poi: pois[0].location.lng + "," + pois[0].location.lat,
  590. };
  591. // console.log(that.form.address,that.form.longitudeLatitude)
  592. // that.form.address = result.regeocode.formattedAddress;
  593. // that.mapStatus = false
  594. // that.addressMessage = false
  595. } else {
  596. that.$message.error("请重新选择地址");
  597. }
  598. });
  599. },
  600. getpoient(e) {
  601. // let geocoder = new AMap.Geocoder()
  602. this.onSearchResult([{ location: e.lnglat }]);
  603. },
  604. markerEvents() {
  605. // marker 事件添加
  606. let that = this;
  607. return {
  608. click: (e) => {
  609. this.getpoient(e);
  610. },
  611. };
  612. },
  613. setAddrss() {
  614. this.form.address = this.addressDetail.address;
  615. this.form.longitudeLatitude = this.addressDetail.poi;
  616. this.mapStatus = false;
  617. this.addressMessage = false;
  618. },
  619. getList() {
  620. let searchForm = this.searchForm;
  621. let params = {
  622. search: searchForm.search ? searchForm.search : null,
  623. organId: searchForm.organId ? searchForm.organId : null,
  624. publicFlag: searchForm.publicFlag ? searchForm.publicFlag : null,
  625. rows: this.pageInfo.limit,
  626. page: this.pageInfo.page,
  627. };
  628. schoolQueryPage(params).then((res) => {
  629. if (res.code == 200 && res.data) {
  630. this.contextFlag = true;
  631. this.tableList = res.data.rows;
  632. this.pageInfo.total = res.data.total;
  633. }
  634. });
  635. },
  636. async getBreachList() {
  637. // 获取分部列表
  638. // 获取当前用户分部
  639. await this.$store.dispatch("setBranchs");
  640. let branchIds = [];
  641. this.selects.branchs.forEach((item) => {
  642. branchIds.push(item.id);
  643. });
  644. await queryByOrganId({
  645. organId: branchIds.join(","),
  646. }).then((res) => {
  647. if (res.code == 200) {
  648. // 判断是否有数据
  649. if (!res.data && res.data.length <= 0) return;
  650. res.data.forEach((r) => {
  651. this.cooperationList.push({
  652. value: r.id,
  653. organId: r.organId,
  654. label: r.name,
  655. });
  656. });
  657. }
  658. });
  659. },
  660. openTeaching(type, row) {
  661. // 重置数据
  662. // this.form = {
  663. // id: null,
  664. // name: null, // 教学点名称
  665. // linkman: null, // 来源
  666. // job: null, // 费用
  667. // mobileNo: null, // 合作单位
  668. // }
  669. this.teachingStatus = true;
  670. this.formActionTitle = type;
  671. // this.form.organId = ''
  672. // 修改的时候赋值
  673. if (type == "update") {
  674. // this.addressDetail = {
  675. // address: row.address,
  676. // poi: row.longitudeLatitude,
  677. // };
  678. this.form = {
  679. id: row.id,
  680. name: row.name, // 教学点名称
  681. source: row.cooperationOrganId ? "1" : "2", // 来源
  682. cooperationOrganId: row.cooperationOrganId, // 合作单位
  683. remark: row.remark, // 费用
  684. address: row.address.split(",").join(""), // 上课地点
  685. subsidy: row.subsidy, // 课酬补贴
  686. organId: row.organId,
  687. longitudeLatitude: row.longitudeLatitude,
  688. user: row.realName ? row.realName : "公共",
  689. };
  690. }
  691. },
  692. onFormClose(formName) {
  693. // 关闭弹窗重置验证
  694. // this.$refs[formName].clearValidate()
  695. this.form = {
  696. name: null, // 教学点名称
  697. source: null, // 来源
  698. cooperationOrganId: null, // 合作单位
  699. remark: null, // 费用
  700. address: null, // 上课地点
  701. subsidy: null, // 课酬补贴
  702. };
  703. this.$refs[formName].resetFields();
  704. },
  705. filterOrgan(val) {
  706. let result = "";
  707. if (val.cooperationOrganId) {
  708. this.cooperationList.forEach((res) => {
  709. if (res.value == val.cooperationOrganId) {
  710. result = res.label;
  711. }
  712. });
  713. } else {
  714. result = "租赁";
  715. }
  716. return result;
  717. },
  718. onUpdateSubmit(row, type) {
  719. let msg;
  720. if (type == 2) {
  721. msg = "停用";
  722. } else if (type == 0) {
  723. msg = "启用";
  724. } else {
  725. msg = "删除";
  726. }
  727. this.$confirm(`您确定${msg}吗?`, "提示", {
  728. confirmButtonText: "确定",
  729. cancelButtonText: "取消",
  730. type: "warning",
  731. }).then(() => {
  732. schoolUpdate({
  733. id: row.id,
  734. delFlag: type,
  735. }).then((res) => {
  736. if (res.code == 200) {
  737. this.$message.success("修改成功");
  738. this.teachingStatus = false;
  739. if (type == 2 || type == 0) {
  740. row.delFlag = type;
  741. } else {
  742. this.getList();
  743. }
  744. } else {
  745. this.$message.error(res.msg);
  746. }
  747. });
  748. });
  749. },
  750. search() {
  751. this.pageInfo.page = 1;
  752. this.getList();
  753. },
  754. onReset() {
  755. this.searchForm = {
  756. search: null,
  757. organId: null,
  758. publicFlag: null,
  759. };
  760. this.search();
  761. },
  762. onExport() {
  763. const { ...rest } = this.searchForm;
  764. let searchForm = this.searchForm;
  765. Export(
  766. this,
  767. {
  768. url: "/api-web/export/exportSchoolList",
  769. fileName: "教学点.xls",
  770. method: "post",
  771. params: qs.stringify(
  772. cleanDeep({
  773. search: searchForm.search ? searchForm.search : null,
  774. organId: searchForm.organId ? searchForm.organId : null,
  775. publicFlag: searchForm.publicFlag ? searchForm.publicFlag : null,
  776. rows: this.pageInfo.limit,
  777. page: this.pageInfo.page,
  778. })
  779. ),
  780. },
  781. "您确定导出教学点?"
  782. );
  783. },
  784. },
  785. };
  786. </script>
  787. <style lang="scss">
  788. .el-select {
  789. width: auto !important;
  790. }
  791. .el-vue-amap-container {
  792. width: 100%;
  793. height: 50vh !important;
  794. }
  795. * {
  796. // touch-action: pan-y;
  797. touch-action: none;
  798. }
  799. .map-container {
  800. .el-dialog__body {
  801. padding: 0;
  802. }
  803. }
  804. .addMapBtn {
  805. background-color: var(--color-primary) !important;
  806. color: #fff !important;
  807. }
  808. .el-input-group__append {
  809. background: #f5f7fa;
  810. border-color: #dcdfe6;
  811. color: #909399;
  812. &:hover,
  813. &:active,
  814. &:focus {
  815. background: #f5f7fa;
  816. border-color: #dcdfe6;
  817. color: #909399;
  818. }
  819. }
  820. .el-vue-search-box-container {
  821. position: absolute !important;
  822. left: 30px;
  823. margin-top: 10px;
  824. z-index: 99999 !important;
  825. }
  826. </style>