branchManager.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. <template>
  2. <div class="m-container" v-cloak>
  3. <h2>
  4. <div class="squrt"></div>
  5. 合作单位
  6. </h2>
  7. <transition name="el-fade-in-linear">
  8. <div
  9. class="m-core"
  10. v-if="((tableList.length > 0 || pageInfo.page > 1) && contextFlag) || !isSearch"
  11. >
  12. <!-- 搜索类型 -->
  13. <save-form
  14. :inline="true"
  15. class="searchForm"
  16. ref="searchForm"
  17. @submit="search"
  18. @reset="onReSet"
  19. :model="searchForm"
  20. >
  21. <el-form-item prop="search">
  22. <el-input
  23. v-model="searchForm.search"
  24. clearable
  25. placeholder="单位/乐团主管名称"
  26. ></el-input>
  27. </el-form-item>
  28. <el-form-item prop="organId">
  29. <el-select
  30. v-model.trim="searchForm.organId"
  31. placeholder="请选择分部"
  32. filterable
  33. clearable
  34. >
  35. <el-option
  36. v-for="item in selects.branchs"
  37. :key="item.id"
  38. :label="item.name"
  39. :value="item.id"
  40. ></el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item prop="isEnable">
  44. <el-select
  45. v-model.trim="searchForm.isEnable"
  46. placeholder="请选择状态"
  47. filterable
  48. clearable
  49. >
  50. <el-option label="开启" :value="true"></el-option>
  51. <el-option label="关闭" :value="false"></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item>
  55. <el-button native-type="submit" type="danger">搜索</el-button>
  56. <el-button native-type="reset" type="primary">重置</el-button>
  57. <!-- export/isSettlementCourseSalarys -->
  58. <el-button
  59. @click="onExport"
  60. v-permission="'export/cooperationOrgan'"
  61. type="primary"
  62. >导出</el-button
  63. >
  64. </el-form-item>
  65. </save-form>
  66. <el-button
  67. @click="openTeaching('create')"
  68. v-permission="'cooperationOrgan/add'"
  69. type="primary"
  70. style="margin-bottom: 20px"
  71. >
  72. 新建
  73. </el-button>
  74. <!-- 列表 -->
  75. <div class="tableWrap">
  76. <el-table
  77. :data="tableList"
  78. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  79. >
  80. <el-table-column align="center" prop="id" label="单位编号"> </el-table-column>
  81. <el-table-column align="center" prop="name" label="单位名称">
  82. </el-table-column>
  83. <el-table-column align="center" prop="logo" label="logo">
  84. <template slot-scope="scope">
  85. <el-image
  86. style="width: 100px; height: 100px"
  87. :src="scope.row.logo"
  88. :preview-src-list="[scope.row.logo]"
  89. >
  90. </el-image>
  91. </template>
  92. </el-table-column>
  93. <el-table-column align="center" prop="name" label="所属分部">
  94. <template slot-scope="scope">
  95. <div>
  96. {{ scope.row.organization.name }}
  97. </div>
  98. </template>
  99. </el-table-column>
  100. <el-table-column align="center" prop="realName" label="乐团主管">
  101. </el-table-column>
  102. <!-- <el-table-column align="center" prop="linkman" label="联系人">
  103. </el-table-column>
  104. <el-table-column align="center" prop="job" label="职位">
  105. </el-table-column>
  106. <el-table-column align="center" prop="mobileNo" label="手机号">
  107. </el-table-column> -->
  108. <el-table-column align="center" label="是否全职资源" v-if="tenantId == 1">
  109. <template slot-scope="scope">
  110. {{ scope.row.fullJobResource ? "是" : "否" }}
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="center" label="状态">
  114. <template slot-scope="scope">
  115. <div>
  116. {{ scope.row.isEnable ? "开启" : "关闭" }}
  117. </div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column align="center" label="操作" width="140px">
  121. <template slot-scope="scope">
  122. <el-button @click="openTeaching('look', scope.row)" type="text"
  123. >查看</el-button
  124. >
  125. <el-button
  126. @click="openTeaching('update', scope.row)"
  127. v-permission="'cooperationOrgan/update'"
  128. type="text"
  129. >修改</el-button
  130. >
  131. <el-button
  132. @click="onDelete(scope.row)"
  133. v-permission="'cooperationOrgan/del'"
  134. type="text"
  135. >删除</el-button
  136. >
  137. <el-button @click="rejuest(scope.row)" type="text">领队注册</el-button>
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. <pagination
  142. sync
  143. :total.sync="pageInfo.total"
  144. :page.sync="pageInfo.page"
  145. :limit.sync="pageInfo.limit"
  146. :page-sizes="pageInfo.page_size"
  147. @pagination="getList"
  148. />
  149. </div>
  150. </div>
  151. <emptyPage
  152. @submit="openTeaching('create')"
  153. title="合作单位"
  154. btnTitle="新建合作单位"
  155. :context="context"
  156. v-if="!(tableList.length > 0 || pageInfo.page > 1) && contextFlag && isSearch"
  157. />
  158. </transition>
  159. <el-dialog
  160. :title="formTitle[formActionTitle]"
  161. :visible.sync="teachingStatus"
  162. width="1060px"
  163. v-if="teachingStatus"
  164. >
  165. <el-form
  166. :model="form"
  167. :rules="rules"
  168. ref="ruleForm"
  169. :inline="true"
  170. class="eidtForm"
  171. label-position="left"
  172. >
  173. <el-alert
  174. style="margin: 10px 0"
  175. title="合作单位信息"
  176. :closable="false"
  177. type="info"
  178. >
  179. </el-alert>
  180. <el-row>
  181. <el-form-item label="单位名称" prop="name" :label-width="formLabelWidth">
  182. <el-input
  183. v-model.trim="form.name"
  184. :disabled="basdisabled"
  185. autocomplete="off"
  186. ></el-input>
  187. </el-form-item>
  188. <el-form-item label="所属分部" prop="organId" :label-width="formLabelWidth">
  189. <el-select
  190. :disabled="basdisabled"
  191. v-model.trim="form.organId"
  192. @change="changeOrgan"
  193. filterable
  194. clearable
  195. >
  196. <el-option
  197. v-for="item in selects.branchs"
  198. :key="item.id"
  199. :label="item.name"
  200. :value="item.id"
  201. ></el-option>
  202. </el-select>
  203. </el-form-item>
  204. </el-row>
  205. <el-row>
  206. <el-form-item
  207. label="乐团主管"
  208. prop="educationUserId"
  209. :label-width="formLabelWidth"
  210. :rules="[{ required: true, message: '乐团主管不能为空' }]"
  211. >
  212. <el-select
  213. :disabled="!form.organId || basdisabled"
  214. v-model.trim="form.educationUserId"
  215. filterable
  216. clearable
  217. >
  218. <el-option
  219. v-for="(item, key) in educationList"
  220. :key="key"
  221. :label="item.userName"
  222. :value="item.userId"
  223. >
  224. <span style="float: left">{{ item.userName }}</span>
  225. <span style="float: right; color: #8492a6; font-size: 13px">{{
  226. String(item.userId)
  227. }}</span>
  228. </el-option>
  229. </el-select>
  230. </el-form-item>
  231. <el-form-item
  232. label="合作单位状态"
  233. prop="isEnable"
  234. :label-width="formLabelWidth"
  235. >
  236. <el-select
  237. :disabled="basdisabled"
  238. v-model.trim="form.isEnable"
  239. filterable
  240. clearable
  241. >
  242. <el-option label="开启" :value="true"></el-option>
  243. <el-option label="关闭" :value="false"></el-option>
  244. </el-select>
  245. </el-form-item>
  246. <el-form-item
  247. v-if="tenantId == 1"
  248. label="是否全职资源"
  249. prop="fullJobResource"
  250. :label-width="formLabelWidth"
  251. >
  252. <el-select :disabled="basdisabled" v-model.trim="form.fullJobResource">
  253. <el-option label="是" :value="1"></el-option>
  254. <el-option label="否" :value="0"></el-option>
  255. </el-select>
  256. </el-form-item>
  257. </el-row>
  258. <el-row>
  259. <el-form-item label="合作单位logo" :label-width="formLabelWidth">
  260. <image-cropper
  261. :options="cropperOptions"
  262. bucket_name="daya"
  263. :imgSize="2"
  264. :imageUrl="form.logo"
  265. showSize
  266. @crop-upload-success="cropSuccess"
  267. />
  268. <p style="color: red">大小2M以内,格式为jpg、png、gif图片</p>
  269. </el-form-item>
  270. </el-row>
  271. <el-alert
  272. style="margin: 10px 0"
  273. title="合作单位联系人"
  274. :closable="false"
  275. type="info"
  276. >
  277. </el-alert>
  278. <el-row
  279. v-for="(item, index) in form.cooperationOrganLinkmanList"
  280. :key="index"
  281. class="greyRow"
  282. >
  283. <div class="concatTitle">
  284. <p>联系人{{ index + 1 }}</p>
  285. <i
  286. class="el-icon-delete-solid marginLeft10 iconStyle"
  287. v-if="form.cooperationOrganLinkmanList.length > 1 && !basdisabled"
  288. @click="deleteLinkMan(index)"
  289. style="font-size: 20px; cursor: pointer"
  290. ></i>
  291. </div>
  292. <el-form-item
  293. :rules="[{ required: true, message: '请输入联系人', trigger: 'blur' }]"
  294. :label="'联系人姓名'"
  295. :prop="'cooperationOrganLinkmanList.' + index + '.linkman'"
  296. :label-width="formLabelWidth"
  297. >
  298. <el-input
  299. :disabled="basdisabled"
  300. v-model.trim="item.linkman"
  301. autocomplete="off"
  302. ></el-input>
  303. </el-form-item>
  304. <el-form-item
  305. :rules="[{ required: true, message: '请输入职位', trigger: 'blur' }]"
  306. :label="'联系人职位'"
  307. :prop="'cooperationOrganLinkmanList.' + index + '.job'"
  308. :label-width="formLabelWidth"
  309. >
  310. <el-input
  311. :disabled="basdisabled"
  312. v-model.trim="item.job"
  313. autocomplete="off"
  314. ></el-input>
  315. </el-form-item>
  316. <el-form-item
  317. :rules="[
  318. { required: true, validator: validPhone, trigger: 'blur' },
  319. ,
  320. {
  321. pattern: /^1[3456789]\d{9}$/,
  322. message: '请输入正确的手机号',
  323. trigger: 'blur',
  324. },
  325. ]"
  326. :label="'联系人手机号'"
  327. :prop="'cooperationOrganLinkmanList.' + index + '.mobileNo'"
  328. :label-width="formLabelWidth"
  329. >
  330. <el-input
  331. :disabled="basdisabled"
  332. :max="11"
  333. :min="11"
  334. maxlength="11"
  335. v-model.trim="item.mobileNo"
  336. autocomplete="off"
  337. ></el-input>
  338. </el-form-item>
  339. <!-- <i
  340. class="el-icon-circle-plus-outline marginLeft10 iconStyle"
  341. style="font-size: 20px; cursor: pointer"
  342. ></i> -->
  343. </el-row>
  344. <!-- index + 1 == form.cooperationOrganLinkmanList.length -->
  345. <el-button
  346. v-if="!basdisabled"
  347. class="greyRow"
  348. style="width: 100%"
  349. icon="el-icon-plus"
  350. @click="addLinkMan"
  351. >添加联系人</el-button
  352. >
  353. </el-form>
  354. <span slot="footer" class="dialog-footer">
  355. <el-button @click="teachingStatus = false">取 消</el-button>
  356. <el-button
  357. type="primary"
  358. v-if="!basdisabled"
  359. @click="onTeachingSubmit('ruleForm')"
  360. >确 定</el-button
  361. >
  362. </span>
  363. </el-dialog>
  364. <qr-code
  365. v-model="codeStatus"
  366. title="领队注册"
  367. :codeUrl="codeUrl"
  368. :value="radio"
  369. :isDown="true"
  370. ref="qrCode"
  371. >
  372. <el-radio-group v-model="radio" @change="changeRadio" class="groupWrap">
  373. <el-radio label="SCHOOL_LEADER">分管领导</el-radio>
  374. <el-radio label="TEACHER">负责老师</el-radio>
  375. <el-radio :disabled="staffStat.orchestraLeaderNums > 0" label="ORCHESTRA_LEADER"
  376. >乐团领队</el-radio
  377. >
  378. <el-radio :disabled="staffStat.schoolmasterNums > 0" label="SCHOOLMASTER"
  379. >学校校长</el-radio
  380. >
  381. </el-radio-group>
  382. </qr-code>
  383. </div>
  384. </template>
  385. <script>
  386. import pagination from "@/components/Pagination/index";
  387. import {
  388. cooperationOrganAdd,
  389. cooperationOrganUpdate,
  390. cooperationOrganDel,
  391. queryPage,
  392. } from "@/api/systemManage";
  393. import cleanDeep from "clean-deep";
  394. import { isvalidPhone } from "@/utils/validate";
  395. import { Export } from "@/utils/downLoadFile";
  396. import { getOrganRole } from "@/api/buildTeam";
  397. import emptyPage from "@/components/emptyPage";
  398. import qs from "qs";
  399. import { isBoolean } from "@rongcloud/engine";
  400. import ImageCropper from "@/components/ImageCropper";
  401. import qrCode from "@/components/QrCode/index";
  402. import { vaildTeachingUrl } from "@/utils/validate";
  403. import { getCooperation } from "./api";
  404. let validPhone = (rule, value, callback) => {
  405. if (!value) {
  406. callback(new Error("请输入电话号码"));
  407. } else if (!isvalidPhone(value)) {
  408. callback(new Error("请输入正确的11位手机号码"));
  409. } else {
  410. callback();
  411. }
  412. };
  413. export default {
  414. name: "branchManager",
  415. components: { pagination, emptyPage, ImageCropper, qrCode },
  416. data() {
  417. return {
  418. searchForm: {
  419. organId: null,
  420. isEnable: null,
  421. search: null,
  422. },
  423. validPhone,
  424. searchLsit: [],
  425. tableList: [],
  426. educationList: [],
  427. pageInfo: {
  428. // 分页规则
  429. limit: 10, // 限制显示条数
  430. page: 1, // 当前页
  431. total: 0, // 总条数
  432. page_size: [10, 20, 40, 50], // 选择限制显示条数
  433. },
  434. teachingStatus: false, // 添加教学点
  435. formActionTitle: "create",
  436. formTitle: {
  437. create: "添加合作单位",
  438. update: "修改合作单位",
  439. look: "查看合作单位",
  440. },
  441. formLabelWidth: "120px",
  442. form: {
  443. id: null,
  444. name: null, // 教学点名称
  445. linkman: null, // 来源
  446. job: null, // 费用
  447. mobileNo: null,
  448. fullJobResource: null,
  449. organId: null,
  450. educationUserId: null,
  451. logo: null,
  452. cooperationOrganLinkmanList: [
  453. { cooperationOrganId: "", job: "", linkman: "", mobileNo: "" },
  454. ],
  455. },
  456. rules: {
  457. name: [{ required: true, message: "请输入教学点名称", trigger: "blur" }],
  458. organId: [{ required: true, message: "请选择所属分部", trigger: "change" }],
  459. educationUserId: [
  460. { required: true, message: "请选择乐团主管", trigger: "change" },
  461. ],
  462. fullJobResource: [
  463. { required: true, message: "请选择是否全职资源", trigger: "change" },
  464. ],
  465. isEnable: [{ required: true, message: "请选择状态", trigger: "change" }],
  466. },
  467. basdisabled: false,
  468. actionRow: null,
  469. tenantId: null,
  470. context:
  471. "合作单位即为合作学校,可以为本机构下的各个分部创建合作单位,创建乐团时需选择合作单位用于区分和管理各合作方的乐团。若本机构乐团无合作方,可将本机构创建为合作单位,并在创建乐团时选择。",
  472. contextFlag: false,
  473. cropperOptions: {
  474. autoCrop: true, //是否默认生成截图框
  475. autoCropWidth: 200, //默认生成截图框宽度
  476. autoCropHeight: 200, //默认生成截图框高度
  477. fixedBox: true, //是否固定截图框大小 不允许改变
  478. previewsCircle: false, //预览图是否是圆形
  479. full: true, // 是否输出原图比例的截图
  480. enlarge: 2,
  481. title: "logo", //模态框上显示的标题
  482. },
  483. codeStatus: false,
  484. codeUrl: "www.baidu.com",
  485. radio: "SCHOOL_LEADER",
  486. staffStat: {
  487. orchestraLeaderNums: 0,
  488. orchestraNums: 0,
  489. schoolLeaderNums: 0,
  490. schoolmasterNums: 0,
  491. studentNums: 0,
  492. teacherNums: 0,
  493. },
  494. };
  495. },
  496. async mounted() {
  497. this.tenantId = this.$helpers.tenantId;
  498. this.getList(); // 获取列表数据
  499. // 获取当前用户分部
  500. await this.$store.dispatch("setBranchs");
  501. if (this.selects.branchs.length <= 0) {
  502. this.$bus.$emit("showguide", ["organ"]);
  503. }
  504. },
  505. methods: {
  506. onDelete(rows) {
  507. this.$confirm("您确定删除合作单位?", "提示", {
  508. confirmButtonText: "确定",
  509. cancelButtonText: "取消",
  510. type: "warning",
  511. })
  512. .then(() => {
  513. cooperationOrganDel(rows.id).then((res) => {
  514. if (res.code == 200) {
  515. this.$message.success("删除成功");
  516. this.teachingStatus = false;
  517. this.getList();
  518. } else {
  519. this.$message.error(res.msg);
  520. }
  521. });
  522. })
  523. .catch(() => {});
  524. },
  525. search() {
  526. this.pageInfo.page = 1;
  527. this.getList();
  528. },
  529. onReSet() {
  530. this.searchForm = {
  531. organId: null,
  532. isEnable: null,
  533. search: null,
  534. };
  535. this.$refs.searchForm.resetFields();
  536. this.$refs.searchForm.save();
  537. this.search();
  538. this.$forceUpdate();
  539. },
  540. changeRadio() {
  541. this.$refs.qrCode.resetImage();
  542. this.codeUrl = `${vaildTeachingUrl()}/school/#/school-register?id=${
  543. this.activeRow.id
  544. }&type=${this.radio}`;
  545. },
  546. onExport() {
  547. Export(
  548. this,
  549. {
  550. url: "/api-web/export/cooperationOrgan",
  551. fileName: "合作单位.xls",
  552. method: "post",
  553. params: qs.stringify(cleanDeep(this.searchForm)),
  554. },
  555. "您确定导出合作单位?"
  556. );
  557. },
  558. onTeachingSubmit(formName) {
  559. // 添加数据
  560. this.$refs[formName].validate((valid) => {
  561. if (valid) {
  562. if (this.formActionTitle == "create") {
  563. if (this.form.id) {
  564. // 判断有没有Id,如果有则删除
  565. delete this.form.id;
  566. }
  567. cooperationOrganAdd(this.form).then((res) => {
  568. if (res.code == 200) {
  569. this.$message.success("创建成功");
  570. this.teachingStatus = false;
  571. this.getList();
  572. } else {
  573. this.$message.error(res.msg);
  574. }
  575. });
  576. } else if (this.formActionTitle == "update") {
  577. cooperationOrganUpdate(this.form).then((res) => {
  578. if (res.code == 200) {
  579. this.$message.success("修改成功");
  580. this.teachingStatus = false;
  581. this.getList();
  582. } else {
  583. this.$message.error(res.msg);
  584. }
  585. });
  586. }
  587. } else {
  588. return false;
  589. }
  590. });
  591. },
  592. getList() {
  593. this.contextFlag = false;
  594. queryPage({
  595. rows: this.pageInfo.limit,
  596. page: this.pageInfo.page,
  597. ...this.searchForm,
  598. }).then((res) => {
  599. if (res.code == 200 && res.data) {
  600. // this.contextFlag = res.data.rows.length>0?true:false
  601. this.contextFlag = true;
  602. this.tableList = res.data.rows;
  603. this.pageInfo.total = res.data.total;
  604. }
  605. });
  606. },
  607. openTeaching(type, rows) {
  608. // 重置数据
  609. this.teachingStatus = true;
  610. this.actionRow = { ...rows } || null;
  611. this.formActionTitle = type;
  612. // 修改的时候赋值
  613. if (type == "update") {
  614. this.changeOrgan(rows.organId);
  615. this.form = {
  616. id: rows.id,
  617. name: rows.name, // 教学点名称
  618. linkman: rows.linkman, // 来源
  619. job: rows.job, // 费用
  620. mobileNo: rows.mobileNo ? rows.mobileNo : null,
  621. ownershipType: rows.ownershipType,
  622. organId: rows.organId,
  623. fullJobResource: rows.fullJobResource,
  624. isEnable: rows.isEnable,
  625. educationUserId: rows.educationUserId,
  626. logo: rows.logo,
  627. };
  628. let cooperationOrganLinkmanList =
  629. rows.cooperationOrganLinkmanList.length > 0
  630. ? [...rows.cooperationOrganLinkmanList]
  631. : [
  632. {
  633. cooperationOrganId: rows.id,
  634. job: "",
  635. linkman: "",
  636. mobileNo: "",
  637. },
  638. ];
  639. this.$set(this.form, "cooperationOrganLinkmanList", cooperationOrganLinkmanList);
  640. this.basdisabled = false;
  641. } else if (type == "look") {
  642. this.changeOrgan(rows.organId);
  643. this.form = {
  644. id: rows.id,
  645. name: rows.name, // 教学点名称
  646. linkman: rows.linkman, // 来源
  647. job: rows.job, // 费用
  648. mobileNo: rows.mobileNo ? rows.mobileNo : null,
  649. ownershipType: rows.ownershipType,
  650. organId: rows.organId,
  651. fullJobResource: rows.fullJobResource,
  652. isEnable: rows.isEnable,
  653. educationUserId: rows.educationUserId,
  654. logo: rows.logo,
  655. };
  656. let cooperationOrganLinkmanList =
  657. rows.cooperationOrganLinkmanList.length > 0
  658. ? [...rows.cooperationOrganLinkmanList]
  659. : [];
  660. this.$set(this.form, "cooperationOrganLinkmanList", cooperationOrganLinkmanList);
  661. this.basdisabled = true;
  662. // 查看
  663. } else {
  664. this.basdisabled = false;
  665. this.actionRow = null;
  666. }
  667. },
  668. async changeOrgan(val) {
  669. this.form.educationUserId = null;
  670. if (val) {
  671. try {
  672. const ruselt = await getOrganRole({
  673. id: val,
  674. });
  675. this.educationList = ruselt?.data?.EDUCATION;
  676. if (!this.educationList || this.educationList?.length <= 0) {
  677. this.$bus.$emit("showguide", ["teamManager"]);
  678. }
  679. } catch (e) {
  680. console.log(e);
  681. }
  682. }
  683. },
  684. deleteLinkMan(index) {
  685. this.form.cooperationOrganLinkmanList.splice(index, 1);
  686. },
  687. addLinkMan() {
  688. if (this.actionRow) {
  689. // 修改
  690. this.form.cooperationOrganLinkmanList.push({
  691. cooperationOrganId: this.actionRow.id,
  692. job: "",
  693. linkman: "",
  694. mobileNo: "",
  695. });
  696. } else {
  697. // 新增
  698. this.form.cooperationOrganLinkmanList.push({
  699. cooperationOrganId: "",
  700. job: "",
  701. linkman: "",
  702. mobileNo: "",
  703. });
  704. }
  705. },
  706. cropClose() {
  707. console.log("上传操作结束");
  708. },
  709. //上传图片成功
  710. cropSuccess(data) {
  711. // this.imgUrl = data.data.avatar
  712. // this.form.logo = data.data.url;
  713. this.$set(this.form, "logo", data.data.url);
  714. console.log(this.form.logo, "cropSuccess");
  715. },
  716. async rejuest(row) {
  717. // 查询该单位是否有 校长 乐团领队
  718. try {
  719. const res = await getCooperation({ id: row.id });
  720. console.log(res, "rejuest");
  721. this.staffStat = { ...res.data.staffStat };
  722. this.activeRow = row;
  723. this.codeUrl = `${vaildTeachingUrl()}/school/#/school-register?id=${
  724. row.id
  725. }&type=${this.radio}`;
  726. this.codeStatus = true;
  727. } catch (e) {}
  728. },
  729. },
  730. watch: {
  731. teachingStatus(val) {
  732. if (!val) {
  733. this.form = {
  734. id: null,
  735. name: null, // 教学点名称
  736. linkman: null, // 来源
  737. job: null, // 费用
  738. mobileNo: null,
  739. fullJobResource: null,
  740. organId: null,
  741. isEnable: null,
  742. educationUserId: null,
  743. cooperationOrganLinkmanList: [],
  744. };
  745. this.$refs.ruleForm.resetFields();
  746. }
  747. },
  748. },
  749. computed: {
  750. isSearch() {
  751. return (
  752. !this.searchForm.search &&
  753. !this.searchForm.organId &&
  754. !isBoolean(this.searchForm.isEnable) &&
  755. !this.searchForm.isEnable
  756. );
  757. },
  758. },
  759. };
  760. </script>
  761. <style lang="scss" scoped>
  762. // .groupWrap {
  763. // display: flex;
  764. // flex-direction: row;
  765. // justify-content: space-around;
  766. // flex-wrap: wrap;
  767. // }
  768. .eidtForm {
  769. ::v-deep .el-form-item__content {
  770. display: block !important;
  771. }
  772. // ::v-deep .el-form--inline {
  773. // }
  774. ::v-deep .el-select {
  775. width: 300px !important;
  776. }
  777. ::v-deep .el-date-editor {
  778. width: 300px !important;
  779. }
  780. ::v-deep .el-checkbox {
  781. margin-left: 15px !important;
  782. }
  783. ::v-deep .el-input {
  784. position: relative;
  785. font-size: 14px;
  786. display: inline-block;
  787. width: 300px !important;
  788. }
  789. }
  790. .greyRow {
  791. background-color: #f9f9f9;
  792. padding: 10px;
  793. margin-bottom: 10px;
  794. }
  795. ::v-deep .el-select {
  796. width: 100% !important;
  797. }
  798. .el-vue-search-box-container {
  799. position: absolute !important;
  800. left: 10px;
  801. margin-top: 10px;
  802. z-index: 99999 !important;
  803. }
  804. .iconStyle {
  805. color: #999;
  806. line-height: 40px;
  807. }
  808. .marginLeft10 {
  809. margin-left: 10px;
  810. }
  811. .concatTitle {
  812. line-height: 36px;
  813. font-size: 14px;
  814. font-weight: bold;
  815. display: flex;
  816. flex-direction: row;
  817. justify-content: space-between;
  818. }
  819. </style>