addressManager.vue 24 KB

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