index.vue 29 KB

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