index.vue 30 KB

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