index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182
  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="primary"
  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. console.log(this.getNowWeek(date));
  653. } else {
  654. this.tomList[i].week = "";
  655. }
  656. },
  657. // 搜索单位触发
  658. host() {
  659. this.getList();
  660. },
  661. // 查询单位列表
  662. getDept() {
  663. getShouBu().then((res) => {
  664. this.deptOptionss = res.data;
  665. });
  666. },
  667. // 政治人员选中触发
  668. zhengZhi(name) {
  669. this.form.people2Name = name;
  670. },
  671. // 军事人员选中触发
  672. junShi(name) {
  673. this.form.people1Name = name;
  674. },
  675. // 值班领导选中触发
  676. zhiBan(name) {
  677. this.form.peopleName = name;
  678. },
  679. // 获取人员
  680. ZhuChiRen(id) {
  681. getZhuChiRen(id).then((res) => {
  682. this.renYuan = res.data;
  683. });
  684. },
  685. // 重置人员
  686. ChongZhi() {
  687. (this.form.peopleId = null),
  688. (this.form.peopleId1 = null),
  689. (this.form.peopleId2 = null);
  690. },
  691. // 选中单位触发
  692. department(data) {
  693. this.ChongZhi();
  694. this.form.unitId = data.id;
  695. this.form.unitName = data.label;
  696. this.names = data.label;
  697. this.ZhuChiRen(this.form.unitId);
  698. this.tomList.forEach((item, i) => {
  699. this.tomList[i].unitId1 = this.form.unitName;
  700. });
  701. if (
  702. this.form.unitId != null &&
  703. this.form.startTime != null &&
  704. this.form.endTime != null
  705. ) {
  706. this.form.bdglWeekworkRegisterList = null;
  707. exportBdglgetWeekWork(this.form).then((res) => {
  708. this.code = res.code;
  709. if (res.code == 200) {
  710. this.$modal.msgWarning(res.msg);
  711. }
  712. });
  713. }
  714. },
  715. // 开始时间触发
  716. startTimes() {
  717. if (
  718. this.form.unitId != null &&
  719. this.form.startTime != null &&
  720. this.form.endTime != null
  721. ) {
  722. this.form.bdglWeekworkRegisterList = null;
  723. exportBdglgetWeekWork(this.form).then((res) => {
  724. this.code = res.code;
  725. if (res.code == 200) {
  726. this.$modal.msgWarning(res.msg);
  727. }
  728. });
  729. }
  730. },
  731. // 结束时间触发
  732. endTimes() {
  733. if (
  734. this.form.unitId != null &&
  735. this.form.startTime != null &&
  736. this.form.endTime != null
  737. ) {
  738. this.form.unitName = null;
  739. this.form.bdglWeekworkRegisterList = null;
  740. exportBdglgetWeekWork(this.form).then((res) => {
  741. console.log(res.code);
  742. this.code = res.code;
  743. if (res.code == 200) {
  744. this.$modal.msgWarning(res.msg);
  745. }
  746. });
  747. }
  748. },
  749. /** 查询部门下拉树结构 */
  750. getTreeselect() {
  751. getDept().then((response) => {
  752. this.deptOptions = response.data;
  753. });
  754. },
  755. /** 查询一周工作安排列表 */
  756. getList() {
  757. this.loading = true;
  758. listBdglweekwork(this.queryParams).then((response) => {
  759. this.bdglweekworkList = response.rows;
  760. this.total = response.total;
  761. this.loading = false;
  762. });
  763. },
  764. // 取消按钮
  765. cancel() {
  766. this.open = false;
  767. this.reset();
  768. },
  769. // 表单重置
  770. reset() {
  771. this.form = {
  772. id: null,
  773. name: null,
  774. startTime: null,
  775. endTime: null,
  776. peopleId: null,
  777. phone: null,
  778. peopleId1: null,
  779. peopleId2: null,
  780. time: null,
  781. remark: null,
  782. unitId: null,
  783. adminId: null,
  784. peopleName: null,
  785. people1Name: null,
  786. people2Name: null,
  787. unitId: null,
  788. adminId: null,
  789. //工作登记
  790. week: null,
  791. daytime: null,
  792. day: null,
  793. department: null,
  794. personnel: null,
  795. place: null,
  796. content: null,
  797. };
  798. // 一周工作安排字段
  799. (this.tomList = [
  800. {
  801. week: null,
  802. time: null,
  803. deteline: null,
  804. startTime: null,
  805. endTime: null,
  806. unitId1: null,
  807. peopleIds: null,
  808. address: null,
  809. contents: null,
  810. organizer: null,
  811. },
  812. ]),
  813. this.resetForm("refform");
  814. },
  815. /** 搜索按钮操作 */
  816. handleQuery() {
  817. this.queryParams.pageNum = 1;
  818. this.getList();
  819. },
  820. /** 重置按钮操作 */
  821. resetQuery() {
  822. this.resetForm("queryForm");
  823. this.queryParams.startTime = null;
  824. this.handleQuery();
  825. },
  826. /** 对话框重置按钮操作 */
  827. resertwo() {
  828. this.reset();
  829. },
  830. // 多选框选中数据
  831. handleSelectionChange(selection) {
  832. this.ids = selection.map((item) => item.id);
  833. this.single = selection.length !== 1;
  834. this.multiple = !selection.length;
  835. },
  836. /** 新增按钮操作 */
  837. handleAdd() {
  838. // 人员列表
  839. (this.renYuan = []), this.getTreeselect();
  840. this.names = null;
  841. this.reset();
  842. this.open = true;
  843. this.title = "添加一周工作安排";
  844. },
  845. /** 修改按钮操作 */
  846. handleUpdate(row) {
  847. this.reset();
  848. this.getTreeselect();
  849. this.form.unitId = row.unitId;
  850. this.ZhuChiRen(this.form.unitId);
  851. const id = row.id || this.ids;
  852. getBdglweekwork(id).then((response) => {
  853. this.form = response.data;
  854. this.open = true;
  855. this.title = "修改一周工作安排";
  856. // 赋值
  857. this.tomList = response.data.bdglWeekworkRegisterList;
  858. });
  859. },
  860. //查看按钮操作
  861. handleChakan(row) {
  862. // 是否隐藏按钮
  863. this.opens = false;
  864. const id = row.id || this.ids;
  865. getBdglweekwork(id).then((response) => {
  866. this.wordInfo = response.data;
  867. console.log(this.wordInfo);
  868. this.title = "查看一周工作安排";
  869. this.menuRoleVisible = true;
  870. });
  871. },
  872. // 让select失去焦点
  873. blurSelect() {
  874. this.$refs.aa.blur();
  875. },
  876. /** 提交按钮 */
  877. submitForm() {
  878. this.$refs["refform"].validate((valid) => {
  879. if (valid) {
  880. this.form.bdglWeekworkRegisterList = this.tomList;
  881. if (this.form.id != null) {
  882. updateBdglweekwork(this.form).then((response) => {
  883. this.$modal.msgSuccess("修改成功");
  884. this.open = false;
  885. this.getList();
  886. });
  887. } else {
  888. if (
  889. new Date(this.gongZuoTiem) >= new Date(this.form.startTime) &&
  890. new Date(this.gongZuoTiem) <= new Date(this.form.endTime)
  891. ) {
  892. this.form.bdglWeekworkRegisterList = this.tomList;
  893. if (this.code != 200) {
  894. if (this.form.unitId) {
  895. addBdglweekwork(this.form).then((response) => {
  896. this.$modal.msgSuccess("新增成功");
  897. this.open = false;
  898. this.getList();
  899. });
  900. }
  901. }
  902. }
  903. }
  904. }
  905. });
  906. },
  907. /** 删除按钮操作 */
  908. handleDelete(row) {
  909. const ids = row.id || this.ids;
  910. this.$modal
  911. // .confirm('是否确认删除一周工作安排编号为"' + ids + '"的数据项?')
  912. .confirm("是否确认删除该数据?")
  913. .then(function () {
  914. return delBdglweekwork(ids);
  915. })
  916. .then(() => {
  917. this.getList();
  918. this.$modal.msgSuccess("删除成功");
  919. })
  920. .catch(() => {});
  921. },
  922. /** 导出按钮操作 */
  923. handleExport() {
  924. const queryParams = this.queryParams;
  925. this.$modal
  926. .confirm("是否确认导出所有一周工作安排数据项?")
  927. .then(() => {
  928. this.exportLoading = true;
  929. return exportBdglweekwork(queryParams);
  930. })
  931. .then((response) => {
  932. this.$download.name(response.msg);
  933. this.exportLoading = false;
  934. })
  935. .catch(() => {});
  936. },
  937. datelinefun(val) {
  938. console.log(val);
  939. if (val == "早晨") {
  940. this.option.start = "06:00";
  941. this.option.end = "08:00";
  942. } else if (val == "上午") {
  943. this.option.start = "08:00";
  944. this.option.end = "012:00";
  945. } else if (val == "下午") {
  946. this.option.start = "12:00";
  947. this.option.end = "18:00";
  948. } else if (val == "晚上") {
  949. this.option.start = "18:00";
  950. this.option.end = "23:00";
  951. }
  952. },
  953. },
  954. };
  955. </script>
  956. <style scoped>
  957. /* 对话框背景颜色 */
  958. ::v-deep .el-dialog {
  959. background: #004d86 !important;
  960. }
  961. .el-textarea__inner {
  962. width: 920px;
  963. height: 104px;
  964. margin: auto;
  965. }
  966. ::v-deep .el-dialog__header {
  967. border-bottom: 1px solid #718a9d;
  968. }
  969. ::v-deep .el-dialog__title {
  970. color: #fff;
  971. font: 18px;
  972. }
  973. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  974. color: #fff;
  975. }
  976. ::v-deep .el-form-item__label {
  977. font: 16px;
  978. color: #fff;
  979. width: 100px !important;
  980. }
  981. ::v-deep .el-input__inner {
  982. /* width: 200px !important;
  983. height: 36px; */
  984. background: transparent;
  985. color: #fff;
  986. border-color: #fff !important;
  987. }
  988. /* 单位框背景颜色 */
  989. ::v-deep .vue-treeselect__control {
  990. background: #004d86 !important;
  991. }
  992. /* 基本信息背景 */
  993. .jiben {
  994. width: 887px;
  995. height: 32px;
  996. background-image: url(../../../images/小标题底.png);
  997. margin-bottom: 25px;
  998. margin-left: 30px;
  999. color: #fff;
  1000. padding-left: 16px;
  1001. line-height: 32px;
  1002. }
  1003. /*调整表单间距 */
  1004. ::v-deep .el-form-item__content {
  1005. width: 200px;
  1006. }
  1007. ::v-deep .el-dialog__body {
  1008. /* margin: 10px 30px 20px 30px; */
  1009. margin: 10px 0px 20px 52px;
  1010. padding-top: 20px !important;
  1011. box-sizing: border-box;
  1012. padding-bottom: 0px !important;
  1013. padding-left: 0px !important;
  1014. padding-right: 0px !important;
  1015. }
  1016. .contents {
  1017. padding: 0px 40px !important;
  1018. }
  1019. /* 下拉菜单 */
  1020. .el-dropdown-link {
  1021. cursor: pointer;
  1022. color: #409eff;
  1023. }
  1024. .el-icon-arrow-down {
  1025. font-size: 12px;
  1026. }
  1027. /* 刷新图标 */
  1028. /* .el-icon-refresh {
  1029. width: 76px;
  1030. height: 36px;
  1031. color: #fff;
  1032. background-color: #1d96ff !important;
  1033. border-radius: 4px;
  1034. border: none;
  1035. margin-left: 20px;
  1036. font-size: 14px;
  1037. } */
  1038. /* 下拉菜单字体/背景颜色 */
  1039. .el-select-dropdown__item.hover,
  1040. .el-select-dropdown__item:hover {
  1041. background-color: #004d86;
  1042. color: #fff;
  1043. }
  1044. .el-select-dropdown__item {
  1045. color: #fff;
  1046. }
  1047. /* 时间选择 */
  1048. ::v-deep .el-input--small .el-input__inner {
  1049. width: 200px;
  1050. height: 36px;
  1051. line-height: 36px;
  1052. }
  1053. .el-date-editor.el-input {
  1054. width: 200px;
  1055. height: 36px;
  1056. line-height: 36px;
  1057. }
  1058. ::v-deep .el-date-editor.el-input .el-input__inner {
  1059. height: 36px;
  1060. line-height: 36px;
  1061. }
  1062. /* 单位框背景颜色 */
  1063. ::v-deep .vue-treeselect__control {
  1064. background: #004d86 !important;
  1065. color: #fff;
  1066. }
  1067. /* 单位下拉菜单选中字体颜色 */
  1068. ::v-deep .vue-treeselect__single-value {
  1069. color: #fff !important;
  1070. }
  1071. /* 分页按钮 */
  1072. ::v-deep .el-pagination.is-background .el-pager li {
  1073. background-color: #004d86;
  1074. color: #fff;
  1075. }
  1076. ::v-deep .el-pagination.is-background .btn-next {
  1077. background-color: #004d86;
  1078. color: #fff;
  1079. }
  1080. /* 新增工作登记 */
  1081. .box1 {
  1082. width: 887px;
  1083. min-height: 100px;
  1084. /* margin: auto; */
  1085. margin-left: 32px;
  1086. border: 1px solid white;
  1087. color: #fff;
  1088. border-radius: 5px;
  1089. margin-bottom: 30px;
  1090. display: flex;
  1091. padding: 10px 10px;
  1092. position: relative;
  1093. }
  1094. .btn {
  1095. position: absolute;
  1096. bottom: 31px;
  1097. right: 200px;
  1098. }
  1099. /* 新增工作登记开始结束时间 */
  1100. .box1 .el-date-editor.el-input {
  1101. margin-right: 10px;
  1102. width: 134px;
  1103. }
  1104. /* 新增-工作登记-表单长度 */
  1105. ::v-deep .box1 .el-input--small .el-input__inner {
  1106. width: 250px;
  1107. }
  1108. ::v-deep .box1 .el-form-item__content {
  1109. width: 130px;
  1110. }
  1111. /* 新增-工作登记-人员地点 */
  1112. ::v-deep .box1 .box2 .el-form-item__content {
  1113. width: 250px;
  1114. }
  1115. /* 新增-工作登记-内容 */
  1116. ::v-deep .box3 .el-form-item el-form-item--medium {
  1117. width: 510px !important;
  1118. height: 0px;
  1119. }
  1120. ::v-deep .box3 .el-form-item__content {
  1121. width: 510px !important;
  1122. }
  1123. ::v-deep .box3 .el-input el-input--small el-input--suffix {
  1124. width: 510px !important;
  1125. }
  1126. ::v-deep .box3 .el-form-item__content .el-input__inner {
  1127. width: 510px !important;
  1128. }
  1129. .box4 {
  1130. width: 890px;
  1131. min-height: 100px;
  1132. /* border: 1px solid white; */
  1133. margin-left: 31px;
  1134. }
  1135. ::v-deep .box4 .el-textarea__inner {
  1136. min-height: 120px !important;
  1137. }
  1138. /* 底部确定取消按钮 */
  1139. ::v-deep .el-dialog__footer {
  1140. padding: 18px 50px;
  1141. /* margin-right: 42px; */
  1142. margin-right: 36px;
  1143. }
  1144. /* 增加按钮弹框 */
  1145. ::v-deep .el-dialog {
  1146. width: 1060px !important;
  1147. }
  1148. /* 调整输入框提示文字颜色 */
  1149. ::v-deep .vue-treeselect__placeholder {
  1150. color: #bdbdbd4f !important;
  1151. }
  1152. ::v-deep input::-webkit-input-placeholder {
  1153. color: #bdbdbd4f !important;
  1154. }
  1155. ::v-deep input:-moz-placeholder {
  1156. color: #bdbdbd4f !important;
  1157. }
  1158. /* 文本域提示文字颜色 */
  1159. ::v-deep ::-webkit-input-placeholder {
  1160. color: #bdbdbd4f !important;
  1161. }
  1162. ::v-deep .el-picker-panel .el-scrollbar .time-select-item {
  1163. color: #fff !important;
  1164. }
  1165. ::v-deep .el-input.is-disabled .el-input__inner {
  1166. background-color: transparent !important;
  1167. color: #fff;
  1168. }
  1169. </style>