index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <!-- <el-form-item prop="unitId">
  11. <el-select
  12. v-model="queryParams.unitId"
  13. placeholder="请选择单位"
  14. @change="host"
  15. >
  16. <el-option
  17. v-for="(item, i) in deptOptionss"
  18. :key="i"
  19. :label="item.deptName"
  20. :value="item.deptId"
  21. class="input_xiala"
  22. >
  23. </el-option>
  24. </el-select>
  25. </el-form-item> -->
  26. <el-form-item label="" prop="time">
  27. <el-date-picker
  28. clearable
  29. size="small"
  30. v-model="queryParams.startTime"
  31. type="date"
  32. value-format="yyyy-MM-dd"
  33. placeholder="请选择时间"
  34. :editable="false"
  35. @change="tiem"
  36. >
  37. </el-date-picker>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button size="btr" @click="resetQuery">重置</el-button>
  41. </el-form-item>
  42. </el-form>
  43. <el-row :gutter="10" class="mb8">
  44. <el-col :span="1.5">
  45. <el-button
  46. type="primary"
  47. plain
  48. icon="el-icon-plus"
  49. size="mini"
  50. @click="handleAdd"
  51. v-hasPermi="['grassrootsregistration:bdglweekwork:add']"
  52. >新增</el-button
  53. >
  54. </el-col>
  55. <!-- <el-col :span="1.5">
  56. <el-button
  57. type="success"
  58. plain
  59. icon="el-icon-edit"
  60. size="mini"
  61. :disabled="single"
  62. @click="handleUpdate"
  63. v-hasPermi="['grassrootsregistration:bdglweekwork:edit']"
  64. >修改</el-button
  65. >
  66. </el-col>
  67. <el-col :span="1.5">
  68. <el-button
  69. type="danger"
  70. plain
  71. icon="el-icon-delete"
  72. size="mini"
  73. :disabled="multiple"
  74. @click="handleDelete"
  75. v-hasPermi="['grassrootsregistration:bdglweekwork:remove']"
  76. >删除</el-button
  77. >
  78. </el-col>
  79. <el-col :span="1.5">
  80. <el-button
  81. type="warning"
  82. plain
  83. icon="el-icon-download"
  84. size="mini"
  85. :loading="exportLoading"
  86. @click="handleExport"
  87. v-hasPermi="['grassrootsregistration:bdglweekwork:export']"
  88. >导出</el-button
  89. >
  90. </el-col> -->
  91. <!-- <right-toolbar
  92. :showSearch.sync="showSearch"
  93. @queryTable="getList"
  94. ></right-toolbar> -->
  95. </el-row>
  96. <el-table
  97. v-loading="loading"
  98. :data="bdglweekworkList"
  99. @selection-change="handleSelectionChange"
  100. :header-cell-style="{ background: '#003C69', color: 'white' }"
  101. style="width: 100%"
  102. >
  103. <el-table-column type="selection" width="55" align="center" />
  104. <!-- <el-table-column label="序号" align="center" prop="id" /> -->
  105. <el-table-column label="序号" type="index" width="50" align="center">
  106. <template scope="scope">
  107. <span>{{
  108. (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
  109. }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="单位" align="center" prop="unitName" />
  113. <el-table-column label="工作标题" align="center" prop="name" />
  114. <el-table-column
  115. label="开始时间"
  116. align="center"
  117. prop="startTime"
  118. width="180"
  119. >
  120. <template slot-scope="scope">
  121. <span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column
  125. label="结束时间"
  126. align="center"
  127. prop="endTime"
  128. width="180"
  129. >
  130. <template slot-scope="scope">
  131. <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="连值班领导" align="center" prop="peopleName" />
  135. <el-table-column label="电话" align="center" prop="phone" />
  136. <el-table-column label="军事主官" align="center" prop="people1Name" />
  137. <el-table-column label="政治主官" align="center" prop="people2Name" />
  138. <!-- <el-table-column label="时间" align="center" prop="time" width="180">
  139. <template slot-scope="scope">
  140. <span>{{ parseTime(scope.row.time, "{y}-{m}-{d}") }}</span>
  141. </template>
  142. </el-table-column> -->
  143. <!-- <el-table-column label="备注" align="center" prop="remark" />
  144. <el-table-column label="单位" align="center" prop="unitId" />
  145. <el-table-column label="填写人" align="center" prop="adminId" /> -->
  146. <el-table-column
  147. label="操作"
  148. align="center"
  149. class-name="small-padding fixed-width"
  150. width="200"
  151. >
  152. <template slot-scope="scope">
  153. <el-button
  154. size="btk"
  155. type="text"
  156. @click="handleChakan(scope.row)"
  157. v-hasPermi="['grassrootsregistration:bdgldiary:edit']"
  158. ><span class="chakan">查看</span></el-button
  159. >
  160. <el-button
  161. size="btu"
  162. type="text"
  163. @click="handleUpdate(scope.row)"
  164. v-hasPermi="['grassrootsregistration:bdglweekwork:edit']"
  165. ><span class="edit">修改</span></el-button
  166. >
  167. <el-button
  168. size="btd"
  169. type="text"
  170. @click="handleDelete(scope.row)"
  171. v-hasPermi="['grassrootsregistration:bdglweekwork:remove']"
  172. ><span class="delete">删除</span></el-button
  173. >
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. <pagination
  178. v-show="total > 0"
  179. :total="total"
  180. :page.sync="queryParams.pageNum"
  181. :limit.sync="queryParams.pageSize"
  182. @pagination="getList"
  183. />
  184. <!-- 添加或修改一周工作安排对话框 -->
  185. <el-dialog
  186. :title="title"
  187. :visible.sync="open"
  188. width="1016px"
  189. append-to-body
  190. :close-on-click-modal="false"
  191. >
  192. <div class="userAgree">
  193. <div class="jiben">基本信息</div>
  194. <el-form
  195. ref="refform"
  196. :model="form"
  197. :rules="rules"
  198. label-width="80px"
  199. append-to-body
  200. :inline="true"
  201. >
  202. <el-form-item label="单位" prop="unitId">
  203. <treeselect
  204. v-model="form.unitId"
  205. :options="deptOptions"
  206. :show-count="true"
  207. placeholder="请选择单位"
  208. @select="department"
  209. @open="blurSelect"
  210. />
  211. <!-- @input="department" -->
  212. </el-form-item>
  213. <el-form-item label="连值班领导" prop="peopleId">
  214. <el-select v-model="form.peopleId" placeholder="请选择值连值班领导">
  215. <el-option
  216. v-for="item in renYuan"
  217. :key="item.id"
  218. :label="item.name"
  219. :value="item.id"
  220. @click.native="zhiBan(item.name)"
  221. class="input_xiala"
  222. >
  223. </el-option>
  224. </el-select>
  225. </el-form-item>
  226. <el-form-item label="电话" prop="phone">
  227. <el-input v-model="form.phone" placeholder="请输入电话" />
  228. </el-form-item>
  229. <el-form-item label="军事主官" prop="peopleId1">
  230. <el-select
  231. ref="aa"
  232. v-model="form.peopleId1"
  233. placeholder="请选择军事主官"
  234. >
  235. <el-option
  236. v-for="item in renYuan"
  237. :key="item.id"
  238. :label="item.name"
  239. :value="item.id"
  240. @click.native="junShi(item.name)"
  241. class="input_xiala"
  242. >
  243. </el-option>
  244. </el-select>
  245. </el-form-item>
  246. <el-form-item label="政治主官" prop="peopleId2">
  247. <!-- <el-input v-model="form.peopleId2" placeholder="请输入政治长官" /> -->
  248. <el-select v-model="form.peopleId2" placeholder="请选择政治主官">
  249. <el-option
  250. v-for="item in renYuan"
  251. :key="item.id"
  252. :label="item.name"
  253. :value="item.id"
  254. @click.native="zhengZhi(item.name)"
  255. class="input_xiala"
  256. >
  257. </el-option>
  258. </el-select>
  259. </el-form-item>
  260. <el-form-item label="工作标题" prop="name">
  261. <el-input v-model="form.name" placeholder="请输入工作标题" />
  262. </el-form-item>
  263. <el-form-item label="开始时间" prop="startTime">
  264. <el-date-picker
  265. clearable
  266. size="small"
  267. :editable="false"
  268. v-model="form.startTime"
  269. type="date"
  270. value-format="yyyy-MM-dd"
  271. placeholder="请选择开始时间"
  272. @change="startTimes"
  273. >
  274. </el-date-picker>
  275. </el-form-item>
  276. <el-form-item label="结束时间" prop="endTime">
  277. <el-date-picker
  278. clearable
  279. size="small"
  280. :editable="false"
  281. v-model="form.endTime"
  282. type="date"
  283. value-format="yyyy-MM-dd"
  284. placeholder="请选择结束时间"
  285. @change="endTimes"
  286. >
  287. </el-date-picker>
  288. </el-form-item>
  289. <!-- 文本对话框--工作登记表单 -->
  290. <div class="jiben">工作登记</div>
  291. <div class="box1" v-for="(item, i) in tomList" :key="i">
  292. <el-form
  293. ref="form"
  294. :model="form"
  295. :rules="rules"
  296. label-width="80px"
  297. :inline="true"
  298. >
  299. <el-form-item label="" prop="daytime">
  300. <el-date-picker
  301. v-model="item.time"
  302. type="date"
  303. value-format="yyyy-MM-dd"
  304. placeholder="选择时间"
  305. @change="
  306. (val) => {
  307. change_time(val, i);
  308. }
  309. "
  310. >
  311. </el-date-picker>
  312. </el-form-item>
  313. <el-form-item label="" prop="week">
  314. <!-- <el-select v-model="item.week" placeholder="星期">
  315. <el-option
  316. v-for="item in week"
  317. :key="item.value"
  318. :label="item.label"
  319. :value="item.label"
  320. class="input_xiala"
  321. >
  322. </el-option>
  323. </el-select> -->
  324. <el-input v-model="item.week" disabled />
  325. </el-form-item>
  326. <el-form-item label="" prop="day">
  327. <el-select
  328. v-model="item.dateline"
  329. @change="datelinefun"
  330. placeholder="早晨"
  331. >
  332. <el-option
  333. v-for="item in day"
  334. :key="item.value"
  335. :label="item.label"
  336. :value="item.label"
  337. class="input_xiala"
  338. >
  339. </el-option>
  340. </el-select>
  341. </el-form-item>
  342. <el-time-select
  343. class="b1"
  344. placeholder="起始时间"
  345. v-model="item.startTime"
  346. :picker-options="option"
  347. >
  348. </el-time-select>
  349. <el-time-select
  350. class="b1"
  351. placeholder="结束时间"
  352. v-model="item.endTime"
  353. :picker-options="option"
  354. >
  355. </el-time-select>
  356. <el-form-item label="" prop="unitId5">
  357. <el-input v-model="item.unitId1" placeholder="单位" readonly />
  358. </el-form-item>
  359. <div class="box2">
  360. <el-form-item label="" prop="organizer">
  361. <el-input
  362. v-model="item.organizer"
  363. placeholder="组织人"
  364. clearable
  365. size="small"
  366. />
  367. </el-form-item>
  368. <el-form-item label="" prop="personnel">
  369. <el-input
  370. v-model="item.peopleIds"
  371. placeholder="参加人员"
  372. clearable
  373. size="small"
  374. />
  375. </el-form-item>
  376. <el-form-item label="" prop="place">
  377. <el-input
  378. v-model="item.address"
  379. placeholder="地点"
  380. clearable
  381. size="small"
  382. />
  383. </el-form-item>
  384. </div>
  385. <div class="box3">
  386. <el-form-item label="" prop="content">
  387. <el-input
  388. type="textarea"
  389. v-model="item.contents"
  390. placeholder="内容"
  391. clearable
  392. size="small"
  393. />
  394. </el-form-item>
  395. </div>
  396. <!-- 工作登记-添加删除按钮 -->
  397. <div class="btn">
  398. <el-button
  399. type="primary"
  400. icon="el-icon-plus"
  401. @click="tianJia"
  402. v-if="i == tomList.length - 1"
  403. ></el-button>
  404. <el-button
  405. type="danger"
  406. icon="el-icon-delete"
  407. @click="jtDelete(i)"
  408. v-if="i != 0"
  409. ></el-button>
  410. </div>
  411. </el-form>
  412. </div>
  413. <div class="jiben">备注</div>
  414. <div class="box4">
  415. <el-input
  416. type="textarea"
  417. :rows="5"
  418. placeholder="请输入内容"
  419. v-model="form.remark"
  420. autosize
  421. >
  422. </el-input>
  423. </div>
  424. </el-form>
  425. </div>
  426. <div slot="footer" class="dialog-footer">
  427. <el-button type="primary" @click="submitForm">确 定</el-button>
  428. <el-button @click="resertwo" size="btn">重置</el-button>
  429. </div>
  430. </el-dialog>
  431. <!-- 查看 -->
  432. <el-dialog
  433. :visible.sync="menuRoleVisible"
  434. :title="title"
  435. append-to-body
  436. id="chakan"
  437. :close-on-click-modal="false"
  438. >
  439. <bdglweekwork
  440. v-if="menuRoleVisible"
  441. ref="menuRole"
  442. :message="wordInfo"
  443. ></bdglweekwork>
  444. </el-dialog>
  445. </div>
  446. </template>
  447. <script>
  448. import bdglweekwork from "@/components/look_word/bdglweekwork.vue";
  449. import {
  450. listBdglweekwork,
  451. getBdglweekwork,
  452. delBdglweekwork,
  453. addBdglweekwork,
  454. updateBdglweekwork,
  455. exportBdglweekwork,
  456. exportBdglgetWeekWork,
  457. } from "@/api/grassrootsregistration/bdglweekwork";
  458. import Treeselect from "@riophae/vue-treeselect";
  459. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  460. import {
  461. getZhuChiRen,
  462. getDept,
  463. getShouBu,
  464. } from "@/api/grassrootsregistration/bdglmeeting";
  465. export default {
  466. name: "Bdglweekwork",
  467. components: { Treeselect, bdglweekwork },
  468. data() {
  469. return {
  470. //查看页面
  471. menuRoleVisible: false,
  472. wordInfo: {},
  473. // 遮罩层
  474. loading: true,
  475. // 导出遮罩层
  476. exportLoading: false,
  477. // 选中数组
  478. ids: [],
  479. // 非单个禁用
  480. single: true,
  481. // 非多个禁用
  482. multiple: true,
  483. // 显示搜索条件
  484. showSearch: true,
  485. // 总条数
  486. total: 0,
  487. // 一周工作安排表格数据
  488. bdglweekworkList: [],
  489. // 弹出层标题
  490. title: "",
  491. // 是否显示弹出层
  492. open: false,
  493. // 查询参数
  494. queryParams: {
  495. pageNum: 1,
  496. pageSize: 10,
  497. name: null,
  498. startTime: null,
  499. endTime: null,
  500. peopleId: null,
  501. phone: null,
  502. peopleId1: null,
  503. peopleId2: null,
  504. time: null,
  505. unitId: null,
  506. adminId: null,
  507. },
  508. // 表单参数
  509. form: {},
  510. // 表单校验
  511. rules: {
  512. unitId: [
  513. { required: true, message: "单位名称不能为空", trigger: "change" },
  514. ],
  515. startTime: [
  516. { required: true, message: "时间不能为空", trigger: "change" },
  517. ],
  518. },
  519. //下拉s
  520. options: [],
  521. //备注文本内容
  522. textarea: "",
  523. //工作等级时间(开始-结束)
  524. startTime: "",
  525. endTime: "",
  526. //星期选择
  527. week: [
  528. {
  529. value: "选项1",
  530. label: "星期一",
  531. },
  532. {
  533. value: "选项2",
  534. label: "星期二",
  535. },
  536. {
  537. value: "选项3",
  538. label: "星期三",
  539. },
  540. {
  541. value: "选项4",
  542. label: "星期四",
  543. },
  544. {
  545. value: "选项5",
  546. label: "星期五",
  547. },
  548. {
  549. value: "选项6",
  550. label: "星期六",
  551. },
  552. {
  553. value: "选项7",
  554. label: "星期日",
  555. },
  556. ],
  557. //早中晚选中
  558. day: [
  559. {
  560. value: "选项1",
  561. label: "早晨",
  562. },
  563. {
  564. value: "选项2",
  565. label: "上午",
  566. },
  567. {
  568. value: "选项3",
  569. label: "下午",
  570. },
  571. {
  572. value: "选项4",
  573. label: "晚上",
  574. },
  575. ],
  576. // 树形列表
  577. deptOptions: [],
  578. // 人员列表
  579. renYuan: [],
  580. // 一周工作安排字段
  581. tomList: [
  582. {
  583. week: null,
  584. time: null,
  585. deteline: null,
  586. startTime: null,
  587. endTime: null,
  588. unitId1: null,
  589. peopleIds: null,
  590. address: null,
  591. contents: null,
  592. organizer: null,
  593. },
  594. ],
  595. // 搜索单位列表
  596. deptOptionss: [],
  597. // 已有时间不能发送
  598. code: 0,
  599. // 单位的保存
  600. names: "",
  601. // start: "06:00",
  602. // end: "08:00",
  603. option: {
  604. start: "06:00",
  605. step: "00:05",
  606. end: "08:00",
  607. },
  608. // 工作安排时间
  609. gongZuoTiem: null,
  610. };
  611. },
  612. created() {
  613. this.getList();
  614. // 获取部门
  615. this.getDept();
  616. },
  617. methods: {
  618. //增加工作登记表单
  619. tianJia() {
  620. this.tomList.push({
  621. week: null,
  622. time: null,
  623. deteline: null,
  624. startTime: null,
  625. endTime: null,
  626. unitId1: this.names || this.form.unitName,
  627. peopleIds: null,
  628. address: null,
  629. contents: null,
  630. organizer: null,
  631. });
  632. },
  633. //点击删除工作登记
  634. jtDelete(i) {
  635. this.tomList.splice(i, 1);
  636. },
  637. // 搜索时间触发
  638. tiem() {
  639. this.getList();
  640. },
  641. change_time(date, i) {
  642. this.gongZuoTiem = date;
  643. if (
  644. new Date(this.gongZuoTiem) >= new Date(this.form.startTime) &&
  645. new Date(this.gongZuoTiem) <= new Date(this.form.endTime)
  646. ) {
  647. } else {
  648. this.$modal.msgWarning("请选择开始时间与结束时间区级内的日期");
  649. }
  650. if (date) {
  651. this.tomList[i].week = this.getNowWeek(date);
  652. } else {
  653. this.tomList[i].week = "";
  654. }
  655. },
  656. // 搜索单位触发
  657. host() {
  658. this.getList();
  659. },
  660. // 查询单位列表
  661. getDept() {
  662. getShouBu().then((res) => {
  663. this.deptOptionss = res.data;
  664. });
  665. },
  666. // 政治人员选中触发
  667. zhengZhi(name) {
  668. this.form.people2Name = name;
  669. },
  670. // 军事人员选中触发
  671. junShi(name) {
  672. this.form.people1Name = name;
  673. },
  674. // 值班领导选中触发
  675. zhiBan(name) {
  676. this.form.peopleName = name;
  677. },
  678. // 获取人员
  679. ZhuChiRen(id) {
  680. getZhuChiRen(id).then((res) => {
  681. this.renYuan = res.data;
  682. });
  683. },
  684. // 重置人员
  685. ChongZhi() {
  686. (this.form.peopleId = null),
  687. (this.form.peopleId1 = null),
  688. (this.form.peopleId2 = null);
  689. },
  690. // 选中单位触发
  691. department(data) {
  692. this.ChongZhi();
  693. this.form.unitId = data.id;
  694. this.form.unitName = data.label;
  695. this.names = data.label;
  696. this.ZhuChiRen(this.form.unitId);
  697. this.tomList.forEach((item, i) => {
  698. this.tomList[i].unitId1 = this.form.unitName;
  699. });
  700. if (
  701. this.form.unitId != null &&
  702. this.form.startTime != null &&
  703. this.form.endTime != null
  704. ) {
  705. this.form.bdglWeekworkRegisterList = null;
  706. exportBdglgetWeekWork(this.form).then((res) => {
  707. this.code = res.code;
  708. if (res.code == 200) {
  709. this.$modal.msgWarning(res.msg);
  710. }
  711. });
  712. }
  713. },
  714. // 开始时间触发
  715. startTimes() {
  716. if (
  717. this.form.unitId != null &&
  718. this.form.startTime != null &&
  719. this.form.endTime != null
  720. ) {
  721. this.form.bdglWeekworkRegisterList = null;
  722. exportBdglgetWeekWork(this.form).then((res) => {
  723. this.code = res.code;
  724. if (res.code == 200) {
  725. this.$modal.msgWarning(res.msg);
  726. }
  727. });
  728. }
  729. },
  730. // 结束时间触发
  731. endTimes() {
  732. if (
  733. this.form.unitId != null &&
  734. this.form.startTime != null &&
  735. this.form.endTime != null
  736. ) {
  737. this.form.unitName = null;
  738. this.form.bdglWeekworkRegisterList = null;
  739. exportBdglgetWeekWork(this.form).then((res) => {
  740. this.code = res.code;
  741. if (res.code == 200) {
  742. this.$modal.msgWarning(res.msg);
  743. }
  744. });
  745. }
  746. },
  747. /** 查询部门下拉树结构 */
  748. getTreeselect() {
  749. getDept().then((response) => {
  750. this.deptOptions = response.data;
  751. });
  752. },
  753. /** 查询一周工作安排列表 */
  754. getList() {
  755. this.loading = true;
  756. listBdglweekwork(this.queryParams).then((response) => {
  757. this.bdglweekworkList = response.rows;
  758. this.total = response.total;
  759. this.loading = false;
  760. });
  761. },
  762. // 取消按钮
  763. cancel() {
  764. this.open = false;
  765. this.reset();
  766. },
  767. // 表单重置
  768. reset() {
  769. this.form = {
  770. id: null,
  771. name: null,
  772. startTime: null,
  773. endTime: null,
  774. peopleId: null,
  775. phone: null,
  776. peopleId1: null,
  777. peopleId2: null,
  778. time: null,
  779. remark: null,
  780. unitId: null,
  781. adminId: null,
  782. peopleName: null,
  783. people1Name: null,
  784. people2Name: null,
  785. unitId: null,
  786. adminId: null,
  787. //工作登记
  788. week: null,
  789. daytime: null,
  790. day: null,
  791. department: null,
  792. personnel: null,
  793. place: null,
  794. content: null,
  795. };
  796. // 一周工作安排字段
  797. (this.tomList = [
  798. {
  799. week: null,
  800. time: null,
  801. deteline: null,
  802. startTime: null,
  803. endTime: null,
  804. unitId1: null,
  805. peopleIds: null,
  806. address: null,
  807. contents: null,
  808. organizer: null,
  809. },
  810. ]),
  811. this.resetForm("refform");
  812. },
  813. /** 搜索按钮操作 */
  814. handleQuery() {
  815. this.queryParams.pageNum = 1;
  816. this.getList();
  817. },
  818. /** 重置按钮操作 */
  819. resetQuery() {
  820. this.resetForm("queryForm");
  821. this.queryParams.startTime = null;
  822. this.handleQuery();
  823. },
  824. /** 对话框重置按钮操作 */
  825. resertwo() {
  826. this.reset();
  827. },
  828. // 多选框选中数据
  829. handleSelectionChange(selection) {
  830. this.ids = selection.map((item) => item.id);
  831. this.single = selection.length !== 1;
  832. this.multiple = !selection.length;
  833. },
  834. /** 新增按钮操作 */
  835. handleAdd() {
  836. // 人员列表
  837. (this.renYuan = []), this.getTreeselect();
  838. this.names = null;
  839. this.reset();
  840. this.open = true;
  841. this.title = "添加一周工作安排";
  842. },
  843. /** 修改按钮操作 */
  844. handleUpdate(row) {
  845. this.reset();
  846. this.getTreeselect();
  847. this.form.unitId = row.unitId;
  848. this.ZhuChiRen(this.form.unitId);
  849. const id = row.id || this.ids;
  850. getBdglweekwork(id).then((response) => {
  851. this.form = response.data;
  852. this.open = true;
  853. this.title = "修改一周工作安排";
  854. // 赋值
  855. this.tomList = response.data.bdglWeekworkRegisterList;
  856. this.gongZuoTiem = response.data.bdglWeekworkRegisterList[0].time;
  857. });
  858. },
  859. //查看按钮操作
  860. handleChakan(row) {
  861. // 是否隐藏按钮
  862. this.opens = false;
  863. const id = row.id || this.ids;
  864. getBdglweekwork(id).then((response) => {
  865. this.wordInfo = response.data;
  866. this.title = "查看一周工作安排";
  867. this.menuRoleVisible = true;
  868. });
  869. },
  870. // 让select失去焦点
  871. blurSelect() {
  872. this.$refs.aa.blur();
  873. },
  874. /** 提交按钮 */
  875. submitForm() {
  876. this.$refs["refform"].validate((valid) => {
  877. if (valid) {
  878. if (this.form.id != null) {
  879. if (
  880. new Date(this.gongZuoTiem) >= new Date(this.form.startTime) &&
  881. new Date(this.gongZuoTiem) <= new Date(this.form.endTime)
  882. ) {
  883. this.form.bdglWeekworkRegisterList = this.tomList;
  884. updateBdglweekwork(this.form).then((response) => {
  885. this.$modal.msgSuccess("修改成功");
  886. this.open = false;
  887. this.getList();
  888. });
  889. } else {
  890. // console.log(this.gongZuoTiem, this.form.startTime);
  891. // console.log(this.gongZuoTiem, this.form.endTime);
  892. this.$modal.msgWarning("请选择开始时间与结束时间区级内的日期");
  893. }
  894. } else {
  895. if (
  896. new Date(this.gongZuoTiem) >= new Date(this.form.startTime) &&
  897. new Date(this.gongZuoTiem) <= new Date(this.form.endTime)
  898. ) {
  899. this.form.bdglWeekworkRegisterList = this.tomList;
  900. if (this.code != 200) {
  901. if (this.form.unitId) {
  902. addBdglweekwork(this.form).then((response) => {
  903. this.$modal.msgSuccess("新增成功");
  904. this.open = false;
  905. this.getList();
  906. });
  907. }
  908. }
  909. } else {
  910. this.$modal.msgWarning("请选择开始时间与结束时间区级内的日期");
  911. }
  912. }
  913. }
  914. });
  915. },
  916. /** 删除按钮操作 */
  917. handleDelete(row) {
  918. const ids = row.id || this.ids;
  919. this.$modal
  920. // .confirm('是否确认删除一周工作安排编号为"' + ids + '"的数据项?')
  921. .confirm("是否确认删除该数据?")
  922. .then(function () {
  923. return delBdglweekwork(ids);
  924. })
  925. .then(() => {
  926. this.getList();
  927. this.$modal.msgSuccess("删除成功");
  928. })
  929. .catch(() => {});
  930. },
  931. /** 导出按钮操作 */
  932. handleExport() {
  933. const queryParams = this.queryParams;
  934. this.$modal
  935. .confirm("是否确认导出所有一周工作安排数据项?")
  936. .then(() => {
  937. this.exportLoading = true;
  938. return exportBdglweekwork(queryParams);
  939. })
  940. .then((response) => {
  941. this.$download.name(response.msg);
  942. this.exportLoading = false;
  943. })
  944. .catch(() => {});
  945. },
  946. datelinefun(val) {
  947. if (val == "早晨") {
  948. this.option.start = "06:00";
  949. this.option.end = "08:00";
  950. } else if (val == "上午") {
  951. this.option.start = "08:00";
  952. this.option.end = "012:00";
  953. } else if (val == "下午") {
  954. this.option.start = "12:00";
  955. this.option.end = "18:00";
  956. } else if (val == "晚上") {
  957. this.option.start = "18:00";
  958. this.option.end = "23:00";
  959. }
  960. },
  961. },
  962. };
  963. </script>
  964. <style scoped>
  965. /* 对话框背景颜色 */
  966. ::v-deep .el-dialog {
  967. background: #004d86 !important;
  968. }
  969. .el-textarea__inner {
  970. width: 920px;
  971. height: 104px;
  972. margin: auto;
  973. }
  974. ::v-deep .el-dialog__header {
  975. border-bottom: 1px solid #718a9d;
  976. }
  977. ::v-deep .el-dialog__title {
  978. color: #fff;
  979. font: 18px;
  980. }
  981. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  982. color: #fff;
  983. }
  984. ::v-deep .el-form-item__label {
  985. font: 16px;
  986. color: #fff;
  987. width: 100px !important;
  988. }
  989. ::v-deep .el-input__inner {
  990. /* width: 200px !important;
  991. height: 36px; */
  992. background: transparent;
  993. color: #fff;
  994. border-color: #fff !important;
  995. }
  996. /* 单位框背景颜色 */
  997. ::v-deep .vue-treeselect__control {
  998. background: #004d86 !important;
  999. }
  1000. /* 基本信息背景 */
  1001. .jiben {
  1002. width: 887px;
  1003. height: 32px;
  1004. background-image: url(../../../images/小标题底.png);
  1005. margin-bottom: 25px;
  1006. margin-left: 30px;
  1007. color: #fff;
  1008. padding-left: 16px;
  1009. line-height: 32px;
  1010. }
  1011. /*调整表单间距 */
  1012. ::v-deep .el-form-item__content {
  1013. width: 200px;
  1014. }
  1015. ::v-deep .el-dialog__body {
  1016. /* margin: 10px 30px 20px 30px; */
  1017. margin: 10px 0px 20px 52px;
  1018. padding-top: 20px !important;
  1019. box-sizing: border-box;
  1020. padding-bottom: 0px !important;
  1021. padding-left: 0px !important;
  1022. padding-right: 0px !important;
  1023. }
  1024. .contents {
  1025. padding: 0px 40px !important;
  1026. }
  1027. /* 下拉菜单 */
  1028. .el-dropdown-link {
  1029. cursor: pointer;
  1030. color: #409eff;
  1031. }
  1032. .el-icon-arrow-down {
  1033. font-size: 12px;
  1034. }
  1035. /* 刷新图标 */
  1036. /* .el-icon-refresh {
  1037. width: 76px;
  1038. height: 36px;
  1039. color: #fff;
  1040. background-color: #1d96ff !important;
  1041. border-radius: 4px;
  1042. border: none;
  1043. margin-left: 20px;
  1044. font-size: 14px;
  1045. } */
  1046. /* 下拉菜单字体/背景颜色 */
  1047. .el-select-dropdown__item.hover,
  1048. .el-select-dropdown__item:hover {
  1049. background-color: #004d86;
  1050. color: #fff;
  1051. }
  1052. .el-select-dropdown__item {
  1053. color: #fff;
  1054. }
  1055. /* 时间选择 */
  1056. ::v-deep .el-input--small .el-input__inner {
  1057. width: 200px;
  1058. height: 36px;
  1059. line-height: 36px;
  1060. }
  1061. .el-date-editor.el-input {
  1062. width: 200px;
  1063. height: 36px;
  1064. line-height: 36px;
  1065. }
  1066. ::v-deep .el-date-editor.el-input .el-input__inner {
  1067. height: 36px;
  1068. line-height: 36px;
  1069. }
  1070. /* 单位框背景颜色 */
  1071. ::v-deep .vue-treeselect__control {
  1072. background: #004d86 !important;
  1073. color: #fff;
  1074. }
  1075. /* 单位下拉菜单选中字体颜色 */
  1076. ::v-deep .vue-treeselect__single-value {
  1077. color: #fff !important;
  1078. }
  1079. /* 分页按钮 */
  1080. ::v-deep .el-pagination.is-background .el-pager li {
  1081. background-color: #004d86;
  1082. color: #fff;
  1083. }
  1084. ::v-deep .el-pagination.is-background .btn-next {
  1085. background-color: #004d86;
  1086. color: #fff;
  1087. }
  1088. /* 新增工作登记 */
  1089. .box1 {
  1090. width: 887px;
  1091. min-height: 100px;
  1092. /* margin: auto; */
  1093. margin-left: 32px;
  1094. border: 1px solid white;
  1095. color: #fff;
  1096. border-radius: 5px;
  1097. margin-bottom: 30px;
  1098. display: flex;
  1099. padding: 10px 10px;
  1100. position: relative;
  1101. }
  1102. .btn {
  1103. position: absolute;
  1104. bottom: 31px;
  1105. right: 200px;
  1106. }
  1107. /* 新增工作登记开始结束时间 */
  1108. .box1 .el-date-editor.el-input {
  1109. margin-right: 10px;
  1110. width: 134px;
  1111. }
  1112. /* 新增-工作登记-表单长度 */
  1113. ::v-deep .box1 .el-input--small .el-input__inner {
  1114. width: 250px;
  1115. }
  1116. ::v-deep .box1 .el-form-item__content {
  1117. width: 130px;
  1118. }
  1119. /* 新增-工作登记-人员地点 */
  1120. ::v-deep .box1 .box2 .el-form-item__content {
  1121. width: 250px;
  1122. }
  1123. /* 新增-工作登记-内容 */
  1124. ::v-deep .box3 .el-form-item el-form-item--medium {
  1125. width: 510px !important;
  1126. height: 0px;
  1127. }
  1128. ::v-deep .box3 .el-form-item__content {
  1129. width: 510px !important;
  1130. }
  1131. ::v-deep .box3 .el-input el-input--small el-input--suffix {
  1132. width: 510px !important;
  1133. }
  1134. ::v-deep .box3 .el-form-item__content .el-input__inner {
  1135. width: 510px !important;
  1136. }
  1137. .box4 {
  1138. width: 890px;
  1139. min-height: 100px;
  1140. /* border: 1px solid white; */
  1141. margin-left: 31px;
  1142. }
  1143. ::v-deep .box4 .el-textarea__inner {
  1144. min-height: 120px !important;
  1145. }
  1146. /* 底部确定取消按钮 */
  1147. ::v-deep .el-dialog__footer {
  1148. padding: 18px 50px;
  1149. /* margin-right: 42px; */
  1150. margin-right: 36px;
  1151. }
  1152. /* 增加按钮弹框 */
  1153. ::v-deep .el-dialog {
  1154. width: 1060px !important;
  1155. }
  1156. /* 调整输入框提示文字颜色 */
  1157. ::v-deep .vue-treeselect__placeholder {
  1158. color: #bdbdbd4f !important;
  1159. }
  1160. ::v-deep input::-webkit-input-placeholder {
  1161. color: #bdbdbd4f !important;
  1162. }
  1163. ::v-deep input:-moz-placeholder {
  1164. color: #bdbdbd4f !important;
  1165. }
  1166. /* 文本域提示文字颜色 */
  1167. ::v-deep ::-webkit-input-placeholder {
  1168. color: #bdbdbd4f !important;
  1169. }
  1170. ::v-deep .el-picker-panel .el-scrollbar .time-select-item {
  1171. color: #fff !important;
  1172. }
  1173. ::v-deep .el-input.is-disabled .el-input__inner {
  1174. background-color: transparent !important;
  1175. color: #fff;
  1176. }
  1177. #chakan /deep/ .el-dialog__body {
  1178. margin: 10px 0px 20px 0px;
  1179. }
  1180. </style>