bMeeting.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template>
  2. <div>
  3. <el-button
  4. v-if="this.meetingId == null"
  5. style="margin: 15px 1px 1px 35px;"
  6. type="success"
  7. icon="el-icon-edit"
  8. size="mini"
  9. @click="handleAdd"
  10. v-hasPermi="['plant:keymaintenance:edit']"
  11. >保存会议
  12. </el-button>
  13. <el-button
  14. type="primary"
  15. v-if="this.meetingId == null"
  16. style="margin: 15px 1px 1px 35px;"
  17. icon="el-icon-s-order"
  18. size="mini"
  19. @click="openDialog"
  20. >历史行动项管理
  21. </el-button>
  22. <h3
  23. v-if="this.meetingId != null"
  24. style="margin: 15px 1px 1px 35px;"
  25. >会议内容</h3>
  26. <el-tabs tab-position="left" class="app-container">
  27. <el-tab-pane label="参会人员">
  28. <person :meetingId="meetingId"/>
  29. </el-tab-pane>
  30. <el-tab-pane label="内容">
  31. <Content :meetingId="meetingId"/>
  32. </el-tab-pane>
  33. </el-tabs>
  34. <!-- 添加或修改装置会议对话框 -->
  35. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
  36. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  37. <el-form-item label="主题" prop="subject">
  38. <el-input v-model="form.subject" placeholder="请输入主题"/>
  39. </el-form-item>
  40. <el-form-item label="主持人" prop="presided">
  41. <el-input v-model="form.presided" placeholder="请输入主持人"/>
  42. </el-form-item>
  43. <el-form-item label="记录人" prop="recorder">
  44. <el-input v-model="form.recorder" placeholder="请输入记录人"/>
  45. </el-form-item>
  46. <el-form-item label="会议编号" prop="meetingNo">
  47. <el-input v-model="form.meetingNo" placeholder="请输入 +会议编号"/>
  48. </el-form-item>
  49. <el-form-item label="会议时间" prop="meetingDate">
  50. <el-date-picker clearable size="small" style="width: 200px"
  51. v-model="form.meetingDate"
  52. type="date"
  53. value-format="yyyy-MM-dd"
  54. placeholder="请选择会议时间">
  55. </el-date-picker>
  56. </el-form-item>
  57. <el-form-item label="会议地点" prop="venue">
  58. <el-input v-model="form.venue" placeholder="请输入会议地点"/>
  59. </el-form-item>
  60. <el-form-item label="备注" prop="remarks">
  61. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  62. </el-form-item>
  63. </el-form>
  64. <div slot="footer" class="dialog-footer">
  65. <el-button type="primary" @click="submitForm">确 定</el-button>
  66. <el-button @click="cancel">取 消</el-button>
  67. </div>
  68. </el-dialog>
  69. <el-dialog :close-on-click-modal="false" title="历史行动项管理" :visible.sync="his.open" width="70%" append-to-body>
  70. <el-form :model="his.query" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  71. <el-form-item label="回顾/截止日期" prop="deadlineTime">
  72. <el-date-picker clearable size="small" style="width: 200px"
  73. v-model="his.query.deadlineTime"
  74. type="date"
  75. value-format="yyyy-MM-dd"
  76. placeholder="请选择回顾/截止日期" @change="getContentList">
  77. </el-date-picker>
  78. </el-form-item>
  79. <el-form-item label="类型" prop="workType" label-width="50px">
  80. <el-select v-model="his.query.workType" placeholder="请选择类型" clearable size="small"
  81. style="width: 100%;" @change="getContentList">
  82. <el-option
  83. v-for="dict in workTypeOptions"
  84. :key="dict.dictValue"
  85. :label="dict.dictLabel"
  86. :value="dict.dictValue"
  87. />
  88. </el-select>
  89. </el-form-item>
  90. <el-form-item label="状态" prop="status" label-width="50px">
  91. <el-select v-model="his.query.status" placeholder="请选择状态" clearable size="small"
  92. style="width: 100%;" @change="getContentList">
  93. <el-option
  94. v-for="dict in agendaStatusOptions"
  95. :key="dict.dictValue"
  96. :label="dict.dictLabel"
  97. :value="dict.dictValue"
  98. />
  99. </el-select>
  100. </el-form-item>
  101. <el-form-item label="跟踪人" prop="responsible" label-width="70px">
  102. <el-input v-model="his.query.responsible" placeholder="请输入跟踪人" />
  103. </el-form-item>
  104. <el-form-item>
  105. <el-button type="cyan" icon="el-icon-search" size="mini" @click="getContentList">搜索</el-button>
  106. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  107. </el-form-item>
  108. </el-form>
  109. <el-row :gutter="10" class="mb8">
  110. <right-toolbar :showSearch.sync="showSearch" @queryTable="getContentList"></right-toolbar>
  111. </el-row>
  112. <el-table :data="his.contentList" :height="clientHeight" border>
  113. <el-table-column label="主题" align="center" prop="subject"/>
  114. <el-table-column label="会议编号" align="center" prop="meetingNo"/>
  115. <el-table-column label="会议时间" align="center" prop="meetingDate">
  116. <template slot-scope="scope">
  117. <span>{{ parseTime(scope.row.meetingDate, '{y}-{m}-{d}') }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="内容" align="center" prop="agendaContent">
  121. <template slot-scope="scope">
  122. <el-input type="textarea" v-model="scope.row.agendaContent" placeholder="请输入行动项内容" v-if="scope.row.isEdit&&scope.row.workType==='P'"/>
  123. <span v-else>{{ scope.row.agendaContent }}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="类型" align="center" prop="workType"/>
  127. <el-table-column label="跟踪人" align="center" prop="responsible"/>
  128. <el-table-column label="回顾/截止时间" align="center" prop="deadlineTime" width="180">
  129. <template slot-scope="scope">
  130. <span>{{ parseTime(scope.row.deadlineTime, '{y}-{m}-{d}') }}</span>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="状态" align="center" prop="status">
  134. <template slot-scope="scope">
  135. <el-select v-if="scope.row.isEdit" v-model="scope.row.status" placeholder="请选择状态"
  136. clearable
  137. size="small" style="width: 100%;">
  138. <el-option
  139. v-for="dict in agendaStatusOptions"
  140. :key="dict.dictValue"
  141. :label="dict.dictLabel"
  142. :value="dict.dictValue"
  143. />
  144. </el-select>
  145. <span v-else>{{ scope.row.status }}</span>
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  149. <template slot-scope="scope">
  150. <el-button
  151. v-if="!scope.row.isEdit&&scope.row.workType!=='I'"
  152. size="mini"
  153. type="text"
  154. icon="el-icon-edit"
  155. @click="handleUpdateRecord(scope.row)"
  156. v-hasPermi="['plant:content:edit']"
  157. >修改
  158. </el-button>
  159. <el-button v-if="scope.row.isEdit"
  160. size="mini"
  161. type="text"
  162. icon="el-icon-check"
  163. @click="save(scope.row)"
  164. >保存
  165. </el-button>
  166. <el-button v-if="scope.row.isEdit"
  167. size="mini"
  168. type="text"
  169. icon="el-icon-close"
  170. @click="cancelRecord(scope.row,scope.$index)"
  171. >取消
  172. </el-button>
  173. </template>
  174. </el-table-column>
  175. </el-table>
  176. <pagination
  177. v-show="his.total>0"
  178. :total="his.total"
  179. :page.sync="his.query.pageNum"
  180. :limit.sync="his.query.pageSize"
  181. @pagination="getContentList"
  182. />
  183. </el-dialog>
  184. </div>
  185. </template>
  186. <script>
  187. import {addMeeting, getMeeting, updateMeeting} from "@/api/plant/meeting";
  188. import Treeselect from "@riophae/vue-treeselect";
  189. import {treeselect} from "@/api/system/dept";
  190. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  191. import {getToken} from "@/utils/auth";
  192. import Content from "@/views/plant/content/index.vue";
  193. import Person from "@/views/components/meeting/person.vue";
  194. import {listContent2, updateContent} from "@/api/plant/content";
  195. export default {
  196. name: "Weekmeeting",
  197. components: {
  198. Content,
  199. Person,
  200. Treeselect
  201. },
  202. data() {
  203. return {
  204. workTypeOptions: [],
  205. agendaStatusOptions: [],
  206. his: {
  207. open: false,
  208. contentList: [],
  209. total: 0,
  210. query: {
  211. pageNum: 1,
  212. pageSize: 10,
  213. isHis: 1,
  214. }
  215. },
  216. // 遮罩层
  217. loading: true,
  218. // 选中数组
  219. ids: [],
  220. // 非单个禁用
  221. single: true,
  222. // 非多个禁用
  223. multiple: true,
  224. // 显示搜索条件
  225. showSearch: false,
  226. // 总条数
  227. total: 0,
  228. // 装置会议表格数据
  229. meetingList: [],
  230. // 弹出层标题
  231. title: "",
  232. // 部门树选项
  233. deptOptions: undefined,
  234. clientHeight: 300,
  235. // 是否显示弹出层
  236. open: false,
  237. // 装置字典
  238. plantCodeOptions: [],
  239. // 表单参数
  240. form: {},
  241. meetingId: 0,
  242. // 附件参数
  243. doc: {
  244. file: "123",
  245. // 是否显示弹出层(报告附件)
  246. open: false,
  247. // 弹出层标题(报告附件)
  248. title: "",
  249. // 是否禁用上传
  250. isUploading: false,
  251. // 是否更新已经存在的用户数据
  252. updateSupport: 0,
  253. // 报告附件上传位置编号
  254. ids: 0,
  255. // 设置上传的请求头部
  256. headers: {Authorization: "Bearer " + getToken()},
  257. // 上传的地址
  258. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  259. commonfileList: null,
  260. queryParams: {
  261. pId: null,
  262. pType: 'manageactivity'
  263. },
  264. pType: 'manageactivity',
  265. pId: null
  266. },
  267. // 表单校验
  268. rules: {
  269. subject: [
  270. {required: true, message: '会议主题不能为空', trigger: "change"}
  271. ],
  272. }
  273. };
  274. },
  275. watch: {
  276. // 根据名称筛选部门树
  277. deptName(val) {
  278. this.$refs.tree.filter(val);
  279. }
  280. },
  281. created() {
  282. this.meetingId = this.$route.params && this.$route.params.tableId;
  283. //设置表格高度对应屏幕高度
  284. this.$nextTick(() => {
  285. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  286. })
  287. this.getTreeselect();
  288. this.getDicts("PLANT_DIVIDE").then(response => {
  289. this.plantCodeOptions = response.data;
  290. });
  291. this.getDicts("agenda_status").then(res => {
  292. this.agendaStatusOptions = res.data;
  293. });
  294. },
  295. methods: {
  296. save(row) {
  297. let data = {
  298. id: row.id,
  299. status: row.status
  300. }
  301. updateContent(data).then(res => {
  302. this.$modal.msgSuccess("修改成功");
  303. row.isEdit = false;
  304. this.getContentList();
  305. })
  306. },
  307. handleUpdateRecord(row) {
  308. // 备份原始数据
  309. row['oldRow'] = JSON.parse(JSON.stringify(row));
  310. this.$nextTick(() => {
  311. row.isEdit = true;
  312. })
  313. },
  314. cancelRecord(row, index) {
  315. // 如果是新增的数据
  316. if (row.isAdd) {
  317. this.record.dataList.splice(index, 1)
  318. } else {
  319. // 不是新增的数据 还原数据
  320. for (const i in row.oldRow) {
  321. row[i] = row.oldRow[i]
  322. }
  323. row.isEdit = false
  324. }
  325. },
  326. openDialog() {
  327. this.his.open = true;
  328. this.getContentList();
  329. this.getDicts("agenda_type").then(res => {
  330. this.workTypeOptions = res.data;
  331. });
  332. this.getDicts("agenda_status").then(res => {
  333. this.agendaStatusOptions = res.data;
  334. });
  335. },
  336. getContentList() {
  337. listContent2(this.his.query).then(response => {
  338. response.rows.forEach(item => {
  339. item["isEdit"] = false;
  340. })
  341. this.his.contentList = response.rows;
  342. this.his.total = response.total;
  343. });
  344. },
  345. /** 查询部门下拉树结构 */
  346. getTreeselect() {
  347. treeselect().then(response => {
  348. this.deptOptions = response.data;
  349. });
  350. },
  351. // 装置字典翻译
  352. plantCodeFormat(row, column) {
  353. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  354. },
  355. // 取消按钮
  356. cancel() {
  357. this.open = false;
  358. this.reset();
  359. },
  360. // 表单重置
  361. reset() {
  362. this.form = {
  363. id: null,
  364. plantCode: null,
  365. recorder: null,
  366. meetingNo: null,
  367. meetingDate: null,
  368. venue: null,
  369. subject: null,
  370. delFlag: null,
  371. createrCode: null,
  372. createdate: null,
  373. updaterCode: null,
  374. updatedate: null,
  375. deptId: null,
  376. remarks: null,
  377. presided: null,
  378. mtType: 2,
  379. };
  380. this.resetForm("form");
  381. },
  382. /** 搜索按钮操作 */
  383. handleQuery() {
  384. this.queryParams.pageNum = 1;
  385. this.getList();
  386. },
  387. /** 重置按钮操作 */
  388. resetQuery() {
  389. this.resetForm("queryForm");
  390. this.handleQuery();
  391. },
  392. // 多选框选中数据
  393. handleSelectionChange(selection) {
  394. this.ids = selection.map(item => item.id)
  395. this.single = selection.length !== 1
  396. this.multiple = !selection.length
  397. },
  398. /** 新增按钮操作 */
  399. handleAdd() {
  400. this.reset();
  401. this.open = true;
  402. this.title = '新增装置会议';
  403. },
  404. /** 修改按钮操作 */
  405. handleUpdate(row) {
  406. this.reset();
  407. const id = row.id || this.ids
  408. getMeeting(id).then(response => {
  409. this.form = response.data;
  410. this.open = true;
  411. this.title = '修改装置会议';
  412. });
  413. },
  414. /** 提交按钮 */
  415. submitForm() {
  416. this.$refs["form"].validate(valid => {
  417. if (valid) {
  418. if (this.form.id != null) {
  419. updateMeeting(this.form).then(response => {
  420. this.$modal.msgSuccess('修改成功');
  421. this.open = false;
  422. window.location.reload();
  423. });
  424. } else {
  425. addMeeting(this.form).then(response => {
  426. this.$modal.msgSuccess('新增成功');
  427. this.open = false;
  428. location.reload();
  429. });
  430. }
  431. }
  432. });
  433. },
  434. /** 报告附件按钮操作 */
  435. importMeeting(row) {
  436. this.doc.open = true;
  437. this.$nextTick(() => {
  438. this.$refs.doc.clearFiles()
  439. })
  440. },
  441. }
  442. };
  443. </script>
  444. <style>
  445. </style>