3fa6cf091356e60e252e830073fb19a9ab4455ed.svn-base 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. <template>
  2. <el-container class="rectify_reform">
  3. <el-main>
  4. <el-card class="box-card" :style="{'height': cardHeight + 'px','overflow-y':'auto'}">
  5. <!--20191220bytanghy-->
  6. <el-row :gutter="20" type="flex" justify="start">
  7. <el-col :span="16">
  8. <el-form :inline="true" size="mini" class="demo-form-inline" label-width="120px">
  9. <el-form-item label="选择年度">
  10. <el-select
  11. v-model="addForm.year"
  12. clearable
  13. collapse-tags
  14. @change="changeYear">
  15. <el-option
  16. v-for="item in yearList"
  17. :key="item.id"
  18. :label="item.year"
  19. :value="item.year">
  20. </el-option>
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item label="选择批次">
  24. <el-select
  25. v-model="addForm.batch"
  26. clearable
  27. collapse-tags>
  28. <el-option
  29. v-for="item in pcList"
  30. :key="item.id"
  31. :label="item.batch"
  32. :value="item.batch">
  33. </el-option>
  34. </el-select>
  35. </el-form-item>
  36. </el-form>
  37. </el-col>
  38. <el-col :span="2" :offset=6 style="text-align: end;">
  39. <el-button type="primary" @click="addZgTz">新建整改通知</el-button>
  40. </el-col>
  41. </el-row>
  42. <div>
  43. <el-table
  44. border
  45. ref="multipleTable"
  46. :height="tableHeight"
  47. :data="tableData"
  48. tooltip-effect="dark"
  49. style="width: 100%"
  50. >
  51. <el-table-column align="center" type="index" label="序号" min-width="25">
  52. <template slot-scope="scope">{{ (pageNum - 1) * pageSize + (scope.$index + 1) }}</template>
  53. </el-table-column>
  54. <el-table-column
  55. header-align="center"
  56. align="center"
  57. min-width="50"
  58. prop="year"
  59. label="年度"
  60. show-overflow-tooltip
  61. ></el-table-column>
  62. <el-table-column
  63. header-align="center"
  64. align="center"
  65. min-width="50"
  66. prop="batch"
  67. label="批次"
  68. show-overflow-tooltip
  69. ></el-table-column>
  70. <el-table-column
  71. header-align="center"
  72. align="center"
  73. min-width="200"
  74. prop="title"
  75. label="通知名称"
  76. show-overflow-tooltip
  77. ></el-table-column>
  78. <el-table-column
  79. header-align="center"
  80. align="center"
  81. min-width="100"
  82. prop="nub"
  83. label="整改意见通知文号"
  84. show-overflow-tooltip
  85. ></el-table-column>
  86. <el-table-column
  87. header-align="center"
  88. align="center"
  89. min-width="100"
  90. prop="printTm"
  91. label="整改通知印发时间"
  92. show-overflow-tooltip
  93. >
  94. <template slot-scope="scope">
  95. <span>{{formatDate(scope.row.printTm)}}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column
  99. header-align="center"
  100. align="center"
  101. min-width="100"
  102. prop="closeTm"
  103. label="整改反馈截止期限"
  104. >
  105. <template slot-scope="scope">
  106. <span>{{formatDate(scope.row.closeTm)}}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. header-align="center"
  111. align="center"
  112. min-width="100"
  113. prop="sendAll"
  114. label="是否全部下发"
  115. >
  116. <template slot-scope="scope">
  117. <span v-if="scope.row.sendAll == '0'">否</span>
  118. <span v-if="scope.row.sendAll == '1'">是</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column
  122. align="center"
  123. min-width="180"
  124. label="操作"
  125. fixed="right"
  126. >
  127. <template slot-scope="scope">
  128. <span v-if="scope.row.sendAll == '1'">
  129. <el-button type="success" size="mini" @click.stop="lookOver(scope.row)">查看</el-button>
  130. </span>
  131. <span v-if="scope.row.sendAll == '0'">
  132. <el-button type="primary" size="mini" @click.stop="editorRow(scope.row)">编辑</el-button>
  133. <el-button type="danger" size="mini" @click.stop="deleteRow(scope.row)">删除</el-button>
  134. </span>
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. <!--<el-pagination-->
  139. <!--style="margin: 10px auto"-->
  140. <!--background-->
  141. <!--:pager-count="5"-->
  142. <!--:current-page="pageNum"-->
  143. <!--:page-size="pageSize"-->
  144. <!--:page-sizes="[10, 20, 30, 40, 50, 100]"-->
  145. <!--layout="sizes, total, prev, pager, next"-->
  146. <!--:total="tableData.length"-->
  147. <!--@current-change="handleCurrentChange"-->
  148. <!--@size-change="handleSizeChange"-->
  149. <!--&gt;</el-pagination>-->
  150. </div>
  151. </el-card>
  152. <el-dialog :title="titleText + '整改通知'" :visible.sync="dialogFormEditorVisible" :close-on-click-modal="false" width="70%" @close="closeDialog">
  153. <h3>
  154. <span>年度</span>
  155. <el-select
  156. v-model="tongZhiForm.year"
  157. clearable
  158. collapse-tags
  159. @change="changeYear" :disabled="yearBatchSelect">
  160. <el-option
  161. v-for="item in yearList"
  162. :key="item.id"
  163. :label="item.year"
  164. :value="item.year">
  165. </el-option>
  166. </el-select>&#x3000;
  167. <span>批次</span>
  168. <el-select
  169. v-model="tongZhiForm.batch"
  170. clearable
  171. collapse-tags :disabled="yearBatchSelect">
  172. <el-option
  173. v-for="item in pcList"
  174. :key="item.id"
  175. :label="item.batch"
  176. :value="item.batch">
  177. </el-option>
  178. </el-select>
  179. </h3>
  180. <el-form :model="tongZhiForm" ref="tongZhiForm" :label-width="formLabelWidth" :rules="TzRules" v-if="dialogFormEditorVisible">
  181. <el-row :gutter="20" type="flex" justify="start">
  182. <el-col :span="12">
  183. <el-form-item label="通知名称" prop="title">
  184. <el-input v-model="tongZhiForm.title" placeholder="请输入通知名称"
  185. :disabled="zgButton"></el-input>
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="12">
  189. <el-form-item label="通知印发时间" prop="printTm">
  190. <el-date-picker
  191. v-model="tongZhiForm.printTm"
  192. type="date"
  193. value-format="yyyy-MM-dd"
  194. placeholder="选择通知印发时间" :disabled="zgButton">
  195. </el-date-picker>
  196. </el-form-item>
  197. </el-col>
  198. </el-row>
  199. <el-row :gutter="20" type="flex" justify="start">
  200. <el-col :span="12">
  201. <el-form-item label="通知文号" prop="nub">
  202. <el-input v-model="tongZhiForm.nub" placeholder="请输入通知文号"
  203. :disabled="zgButton"></el-input>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="12">
  207. <el-form-item label="整改截止期限" prop="closeTm">
  208. <el-date-picker
  209. v-model="tongZhiForm.closeTm"
  210. type="date"
  211. value-format="yyyy-MM-dd"
  212. placeholder="选择整改截止期限" :disabled="zgButton">
  213. </el-date-picker>
  214. </el-form-item>
  215. </el-col>
  216. </el-row>
  217. <el-form-item label="整改说明" prop="planCnt">
  218. <el-input type="textarea" rows="6" v-model="tongZhiForm.explain" clearable
  219. placeholder="请输入整改说明" :disabled="zgButton"></el-input>
  220. </el-form-item>
  221. <el-form-item label="通知附件">
  222. <div v-show="ifFileList">
  223. <upload
  224. ref="uploadFile"
  225. :url="`/pdcApi/file/insert?bizId=`"
  226. accept=".doc,.docx,.pdf"
  227. @uploadOver="removeNewSupervisionPiCi"
  228. ></upload>
  229. </div>
  230. <div v-show="!ifFileList">
  231. <el-table
  232. :data="fileListPiCi"
  233. style="width: 100%">
  234. <el-table-column
  235. prop="name"
  236. label="附件名称"
  237. min-width="200">
  238. </el-table-column>
  239. <el-table-column
  240. label="操作"
  241. min-width="150">
  242. <template slot-scope="scope">
  243. <el-button @click="deleteFiles(scope.row)" type="text" size="small" :disabled="zgButton">删除
  244. </el-button>
  245. <el-button type="text" size="small" @click="toPreview(scope.row)">预览</el-button>
  246. </template>
  247. </el-table-column>
  248. </el-table>
  249. </div>
  250. </el-form-item>
  251. </el-form>
  252. <div style="text-align: end;">
  253. <el-button type="primary" @click="tongZhiSave('tongZhiForm')" :disabled="zgButton">保 存</el-button>
  254. </div>
  255. <el-divider></el-divider>
  256. <div>
  257. <el-row :gutter="20" type="flex" style="margin-bottom: 10px;">
  258. <el-col :span="20">
  259. <el-form :inline="true" size="mini" class="demo-form-inline">
  260. <el-form-item label="选择接收单位">
  261. <el-select
  262. v-model="editorForm.rectOrgId"
  263. clearable
  264. collapse-tags style="width: 8vw;">
  265. <el-option
  266. v-for="item in provincesList"
  267. :key="item.orgId"
  268. :label="item.orgNm"
  269. :value="item.orgId">
  270. </el-option>
  271. </el-select>
  272. </el-form-item>
  273. <el-form-item label="是否上传附件">
  274. <el-select v-model="editorForm.fileState" clearable style="width: 8vw">
  275. <el-option label="未上传" value="0"></el-option>
  276. <el-option label="已上传" value="1"></el-option>
  277. </el-select>
  278. </el-form-item>
  279. <el-form-item label="下发状态">
  280. <el-select v-model="editorForm.state" clearable style="width: 8vw">
  281. <el-option label="未下发" value="0"></el-option>
  282. <el-option label="已下发" value="1"></el-option>
  283. <el-option label="已反馈" value="2"></el-option>
  284. </el-select>
  285. </el-form-item>
  286. </el-form>
  287. </el-col>
  288. <el-col :span="2" :offset=2 style="text-align: end;">
  289. <el-button @click="searchClick" type="success">查询</el-button>
  290. </el-col>
  291. </el-row>
  292. <div>
  293. <el-table
  294. :data="yiShengyiDanList"
  295. :height="tableHeight1"
  296. style="width: 100%"
  297. border
  298. tooltip-effect="dark">
  299. <el-table-column
  300. prop="year"
  301. label="年度"
  302. min-width="50">
  303. </el-table-column>
  304. <el-table-column
  305. prop="batch"
  306. label="批次"
  307. min-width="50">
  308. </el-table-column>
  309. <el-table-column
  310. prop="rectOrgNm"
  311. label="接收单位"
  312. min-width="50">
  313. </el-table-column>
  314. <el-table-column
  315. prop="prjctSize"
  316. label="工程数量"
  317. min-width="60">
  318. </el-table-column>
  319. <el-table-column
  320. prop="pblmSize"
  321. label="问题数量"
  322. min-width="60">
  323. </el-table-column>
  324. <el-table-column
  325. prop="state"
  326. label="下发状态"
  327. min-width="60">
  328. <template slot-scope="scope">
  329. <span v-if="scope.row.state == '0'">未下发</span>
  330. <span v-if="scope.row.state == '1'">已下发</span>
  331. <span v-if="scope.row.state == '2'">已反馈</span>
  332. </template>
  333. </el-table-column>
  334. <!-- <el-table-column
  335. prop="fileName"
  336. label="一省一单"
  337. min-width="200">
  338. <template slot-scope="scope">
  339. <p v-if="scope.row.fileName" class="rowClassP">
  340. <span>{{scope.row.fileName}}</span>
  341. <el-button type="text" size="small" @click="rowPreview(scope.row)">预览</el-button>
  342. <el-button type="text" size="small" @click="rowDelete(scope.row)" :disabled="zgButton">删除</el-button>
  343. </p>
  344. <el-button v-else @click="shengRowUpload(scope.row)" type="text" size="small" :disabled="zgButton">上传</el-button>
  345. </template>
  346. </el-table-column> -->
  347. <el-table-column
  348. label="操作"
  349. min-width="100">
  350. <template slot-scope="scope">
  351. <!--<el-button v-if="scope.row.state == '1'" type="text" size="small">已下发</el-button>-->
  352. <el-button v-if="scope.row.state == '0'" @click="xiaFaClick(scope.row)" type="text" size="small" :disabled="zgButton">下发</el-button>
  353. </template>
  354. </el-table-column>
  355. </el-table>
  356. </div>
  357. </div>
  358. </el-dialog>
  359. <!--一省一单上传文件-->
  360. <el-dialog title="文件上传" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="40%">
  361. <upload
  362. ref="uploadFileRow"
  363. :url="`/pdcApi/file/insert?bizId=`"
  364. accept=".doc,.docx,.pdf"
  365. @uploadOver="removeNewSupervision"
  366. ></upload>
  367. <div slot="footer" class="dialog-footer">
  368. <el-button @click="dialogFormVisible = false">取 消</el-button>
  369. <el-button type="primary" @click="addFileSave">保 存</el-button>
  370. </div>
  371. </el-dialog>
  372. </el-main>
  373. </el-container>
  374. </template>
  375. <script>
  376. import request from '@util/gw_ajax_request'
  377. import {dateFormat} from '@util/gw_date';
  378. import {hostUrl} from '@util/global_variable.js'
  379. import {getZgYearList, getZgPiciList} from '@api/jcOneMapApi.js'
  380. export default {
  381. props: [],
  382. data() {
  383. return {
  384. cardHeight: window.innerHeight - 120,
  385. currentPage: 1,
  386. tableData: [],
  387. tableHeight: window.innerHeight - 300,
  388. tableHeight1: window.innerHeight * .2,
  389. loading: false,
  390. pageSize: 20,
  391. pageNum: 1,
  392. dialogFaTitle: "",
  393. formLabelWidth: '120px',
  394. tongZhiForm: {
  395. "year": null,//年度
  396. "batch": null,//批次
  397. "nub": "",//发文文号
  398. "persId": "",//创建人ID
  399. "printTm": "",//印发时间
  400. "title": "",//标题
  401. "explain": "",//整改说明
  402. "closeTm": ""//整改截止期限
  403. },
  404. curStatus: '编辑',
  405. zgButton: false,
  406. zgfkDialog: false,
  407. ifMinistriesAgencies: false,
  408. groupId: '',
  409. addvcd: '',
  410. treeDataLists: [],
  411. defaultExpanded: [],
  412. defaultProps: {
  413. children: 'children',
  414. label: 'pnm'
  415. },
  416. distributeState: false, //false 未下发 true 已下发
  417. dialogFormVisible: false, //上传文件弹窗
  418. dialogFormEditorVisible: false,
  419. gwComFileList: [],
  420. yiShengyiDanList: [],
  421. year: '',
  422. province: '',
  423. addForm: {
  424. year: '',
  425. batch: ''
  426. },
  427. editorForm: {
  428. rectOrgId: null,
  429. fileState: null,
  430. state: null
  431. },
  432. yearList: [],
  433. pcList: [],
  434. sfType: [
  435. {
  436. label: '是',
  437. value: "1"
  438. },
  439. {
  440. label: '否',
  441. value: "2"
  442. }
  443. ],
  444. titleText: '新建',
  445. header: {
  446. 'persId': localStorage.getItem('userid'),
  447. 'accessToken': localStorage.getItem('accessToken')
  448. },
  449. fileList: [],
  450. provincesList: [],
  451. url: null,
  452. yiShengyiDanRowId: null,
  453. yearBatchSelect: false,
  454. ifFileList: true,
  455. fileListPiCi:[],
  456. PcData: null,
  457. TzRules:{
  458. title:[{ required: true, message: '通知名称不能为空'}],
  459. printTm: [{ required: true, message: '通知印发时间不能为空'}],
  460. nub: [{ required: true, message: '通知文号不能为空'}],
  461. closeTm: [{ required: true, message: '整改截止期限不能为空'}],
  462. rectOrgId: [{ required: true, message: '接收单位不能为空'}],
  463. },
  464. }
  465. },
  466. components: {
  467. upload: resolve => {
  468. require(["@widget/uploadFile.vue"], resolve);
  469. }
  470. },
  471. computed: {
  472. persId() {
  473. return localStorage.getItem("userid")
  474. ? localStorage.getItem("userid")
  475. : "1098101939614724096";
  476. }
  477. },
  478. mounted() {
  479. this.$nextTick(() => {
  480. this.getYear();
  481. this.getNoticeList();
  482. this.getByPid();
  483. })
  484. },
  485. methods: {
  486. getYear(){
  487. request.get(`/tac/pblm/rect/getYear/${this.persId}`)
  488. .then(res =>{
  489. if(res.success){
  490. this.yearList = res.data;
  491. }
  492. })
  493. .catch(err =>{
  494. console.log(err);
  495. })
  496. },
  497. getByPid(){
  498. request.get(`/dc/bis/insp/org/getByPid?pid=${localStorage.getItem('currentOrgId')}`)
  499. .then(res =>{
  500. if(res.success){
  501. this.provincesList = res.data;
  502. }
  503. })
  504. .catch(err =>{
  505. console.log(err);
  506. })
  507. },
  508. handleSizeChange(val) {
  509. this.pageSize = val;
  510. this.getNoticeList();
  511. },
  512. handleCurrentChange(val) {
  513. this.pageNum = val;
  514. this.getNoticeList();
  515. },
  516. //-----------------------------------
  517. formatDate(timestamp) {
  518. return timestamp ? dateFormat(timestamp, 'yyyy-MM-dd') : "";
  519. },
  520. changeYear(item) {
  521. let _self = this;
  522. request.get(`tac/pblm/rect/getBatchByYearPersId/${_self.persId}/${item}`)
  523. .then(res =>{
  524. _self.pcList = res.data;
  525. })
  526. .catch(err =>{
  527. console.log(err);
  528. })
  529. if (item == "" || item == undefined) {
  530. _self.pcList = null;
  531. _self.addForm.batch = "";
  532. }
  533. },
  534. lookOver(row) {
  535. this.titleText = "查看";
  536. this.ifFileList = false;
  537. request.get(`/tac/pblm/rect/${row.id}`)
  538. .then(res => {
  539. if (res.success) {
  540. this.tongZhiForm = res.data;
  541. this.tongZhiForm.printTm = dateFormat(res.data.printTm, "yyyy-MM-dd");
  542. this.tongZhiForm.closeTm = dateFormat(res.data.closeTm, "yyyy-MM-dd");
  543. this.dialogFormEditorVisible = true;
  544. this.editorForm.year = res.data.year;
  545. this.editorForm.batch = res.data.batch;
  546. if(res.data.fileName && res.data.filePath && res.data.id){
  547. this.ifFileList = false;
  548. this.fileListPiCi = [];
  549. this.fileListPiCi.push(
  550. Object.assign({},
  551. {'name':res.data.fileName},
  552. {'url':res.data.filePath},
  553. {'id':res.data.id},
  554. {'fileId':res.data.fileId}
  555. )
  556. );
  557. }
  558. this.getYiShengYiDanList();
  559. this.zgButton = true;
  560. this.yearBatchSelect = true;
  561. } else {
  562. this.$message.warning(res.message);
  563. }
  564. })
  565. .catch(err => {
  566. console.log(err);
  567. })
  568. },
  569. uploadAfter(data){
  570. let obj = {
  571. "id": this.yiShengyiDanRowId,//数据ID
  572. "fileId": data.id,//附件ID
  573. "fileName": data.fileName,//附件名称
  574. "filePath": data.filePath
  575. }
  576. request.post(`/tac/pblm/rect/org/update`,obj)
  577. .then(res =>{
  578. if(res.success){
  579. this.dialogFormVisible = false;
  580. this.$message.success('上传成功');
  581. this.getYiShengYiDanList();
  582. }
  583. })
  584. .catch(err =>{
  585. })
  586. },
  587. //获取一省一单List
  588. getYiShengYiDanList() {
  589. let obj = {
  590. "batch": this.tongZhiForm.batch,
  591. "state": this.editorForm.state,
  592. "year": this.tongZhiForm.year,
  593. "rectOrgId": this.editorForm.rectOrgId,
  594. "fileState": this.editorForm.fileState
  595. }
  596. request.post(`/tac/pblm/rect/org/findList`, obj)
  597. .then(res => {
  598. if (res.success) {
  599. this.$nextTick(() => {
  600. this.yiShengyiDanList = res.data;
  601. })
  602. } else {
  603. this.$message.warning(res.message);
  604. }
  605. })
  606. .catch(err => {
  607. console.log(err);
  608. })
  609. },
  610. addZgTz() {
  611. this.titleText = '新建';
  612. this.zgButton = false;
  613. this.yearBatchSelect = false;
  614. this.dialogFormEditorVisible = true;
  615. this.fileListPiCi = [];
  616. this.ifFileList = true;
  617. this.yiShengyiDanList = [];
  618. for (let obj in this.editorForm) {
  619. this.editorForm[obj] = '';
  620. }
  621. for (let obj in this.tongZhiForm) {
  622. this.tongZhiForm[obj] = '';
  623. }
  624. },
  625. editorRow(row) {
  626. this.PcData = row;
  627. this.titleText = '编辑';
  628. this.zgButton = false;
  629. this.yearBatchSelect = true;
  630. this.fileListPiCi = [];
  631. this.ifFileList = true;
  632. request.get(`/tac/pblm/rect/${row.id}`)
  633. .then(res => {
  634. if (res.success) {
  635. this.$nextTick(()=>{
  636. this.tongZhiForm = res.data;
  637. this.tongZhiForm.printTm = dateFormat(res.data.printTm, "yyyy-MM-dd");
  638. this.tongZhiForm.closeTm = dateFormat(res.data.closeTm, "yyyy-MM-dd");
  639. this.dialogFormEditorVisible = true;
  640. this.editorForm.year = res.data.year;
  641. this.editorForm.batch = res.data.batch;
  642. if(res.data.fileName && res.data.filePath && res.data.id){
  643. this.ifFileList = false;
  644. this.fileListPiCi.push(
  645. Object.assign({},
  646. {'name':res.data.fileName},
  647. {'url':res.data.filePath},
  648. {'id':res.data.id},
  649. {'fileId':res.data.fileId}
  650. )
  651. );
  652. }
  653. this.getYiShengYiDanList();
  654. })
  655. } else {
  656. this.$message.warning(res.message);
  657. }
  658. })
  659. .catch(err => {
  660. console.log(err);
  661. })
  662. },
  663. deleteRow(row) {
  664. this.$confirm('确定要删除该数据, 是否继续?', '提示', {
  665. confirmButtonText: '确定',
  666. cancelButtonText: '取消',
  667. type: 'warning'
  668. }).then(() => {
  669. request.post(`/tac/pblm/rect/delete/${row.id}`)
  670. .then(res => {
  671. if (res.success) {
  672. this.$message.success("删除成功");
  673. this.getNoticeList();
  674. } else {
  675. this.$message.warning(res.message);
  676. }
  677. })
  678. .catch(err => {
  679. console.log(err);
  680. })
  681. }).catch(() => {
  682. this.$message({
  683. type: 'info',
  684. message: '已取消删除'
  685. });
  686. });
  687. },
  688. xiaFaClick(row) {
  689. this.$confirm('下发后通知内容无法更改?', '提示', {
  690. confirmButtonText: '确定',
  691. cancelButtonText: '取消',
  692. type: 'warning'
  693. }).then(() => {
  694. let obj = {
  695. "id": row.id,
  696. "state": "1"
  697. }
  698. request.post(`/tac/pblm/rect/org/update`, obj)
  699. .then(res => {
  700. if (res.success) {
  701. this.$message.success("下发成功");
  702. this.getYiShengYiDanList();
  703. this.zgButton = true;
  704. } else {
  705. this.$message.warning(res.message);
  706. }
  707. })
  708. }).catch(() => {
  709. this.$message({
  710. type: 'info',
  711. message: '已取消下发'
  712. });
  713. });
  714. },
  715. //通知List
  716. getNoticeList() {
  717. let obj = {
  718. "batch": this.addForm.batch,
  719. "year": this.addForm.year,
  720. "pageSize": this.pageSize,
  721. "pageNum": this.pageNum
  722. }
  723. request.post(`/tac/pblm/rect/findList`, obj)
  724. .then(res => {
  725. if (res.success) {
  726. this.tableData = res.data;
  727. }
  728. })
  729. .catch(err => {
  730. console.log(err);
  731. })
  732. },
  733. // 通知保存
  734. tongZhiSave(formName) {
  735. if (this.titleText == '新建') {
  736. this.yearBatchSelect = false;
  737. this.$refs[formName].validate((valid) => {
  738. if (valid) {
  739. let obj = this.tongZhiForm;
  740. obj.persId = localStorage.getItem("userid");
  741. request.post('/tac/pblm/rect/add', obj).then((res) => {
  742. if (res.success) {
  743. this.$nextTick(function () {
  744. if (this.$refs.uploadFile.submitUpload(res.data.id)) {
  745. this.removeNewSupervisionPiCi();
  746. this.$message.success('新建通知成功');
  747. }
  748. // 整改通知新建成功后赋值刷新下发列表
  749. this.tongZhiForm.year = res.data.year
  750. this.tongZhiForm.batch = res.data.batch
  751. this.getYiShengYiDanList()
  752. })
  753. } else {
  754. this.$message.warning(res.message);
  755. }
  756. })
  757. } else {
  758. console.log('error submit!!');
  759. return false;
  760. }
  761. });
  762. } else if (this.titleText == '编辑') {
  763. this.$refs[formName].validate((valid) => {
  764. if (valid) {
  765. let obj = this.tongZhiForm;
  766. obj.persId = localStorage.getItem("userid");
  767. request.post('/tac/pblm/rect/update', obj).then((res) => {
  768. if (res.success) {
  769. this.$nextTick(() => {
  770. if (this.$refs.uploadFile.submitUpload(res.data.id)) {
  771. this.removeNewSupervisionPiCi();
  772. this.$message.success('编辑通知成功');
  773. }
  774. })
  775. } else {
  776. this.$message.warning(res.message);
  777. }
  778. })
  779. } else {
  780. console.log('error submit!!');
  781. return false;
  782. }
  783. });
  784. }
  785. },
  786. searchClick() {
  787. this.$nextTick(() => {
  788. this.getYiShengYiDanList();
  789. })
  790. },
  791. // dialog通知弹窗关闭
  792. closeDialog(){
  793. this.getNoticeList();
  794. },
  795. //一省一单上传
  796. shengRowUpload(row) {
  797. this.yiShengyiDanRowId = row.id;
  798. this.dialogFormVisible = true;
  799. },
  800. addFileSave(){
  801. this.gwComFileList = [];
  802. if (this.$refs.uploadFileRow.submitUpload(this.yiShengyiDanRowId)) {
  803. this.removeNewSupervision();
  804. this.$message.success('保存成功');
  805. this.getYiShengYiDanList();
  806. }
  807. },
  808. removeNewSupervision(arg) {
  809. console.log(arg);
  810. let data = arg[arg.length - 1]
  811. this.uploadAfter(data);
  812. },
  813. removeNewSupervisionPiCi(arg) {
  814. if (arg) {
  815. console.log(arg);
  816. this.$message.success('上传成功');
  817. }
  818. this.editorRow(this.PcData);
  819. this.$refs.uploadFile.init();
  820. },
  821. // 文件上传
  822. submitUpload() {
  823. this.$refs.upload.submit();
  824. },
  825. // 文件预览
  826. rowPreview(row){
  827. window.open(`${hostUrl}${row.filePath}`, "_blank");
  828. },
  829. //批次预览
  830. toPreview(row) {
  831. window.open(`${hostUrl}${row.url}`, "_blank");
  832. },
  833. //删除批次附件
  834. deleteFiles(row) {
  835. this.$confirm('确定删除该附件吗?', '提示', {
  836. confirmButtonText: '确定',
  837. cancelButtonText: '取消',
  838. type: 'warning'
  839. }).then(() => {
  840. request.post(`/file/${row.fileId}`).then(res => {
  841. if (res.success) {
  842. this.fileListPiCi = [];
  843. this.ifFileList = true;
  844. this.$message.success('附件删除成功');
  845. }
  846. })
  847. }).catch(() => {
  848. })
  849. },
  850. //删除下发附件
  851. deleteFile(rowId){
  852. request.post(`/tac/pblm/rect/org/setFileNull/${rowId}`)
  853. .then(res =>{
  854. if(res.success){
  855. this.$message({
  856. type: 'success',
  857. message: '删除成功'
  858. })
  859. this.getYiShengYiDanList();
  860. }else{
  861. this.$message.warning(res.message);
  862. }
  863. })
  864. },
  865. //文件删除
  866. rowDelete(row){
  867. return this.$confirm(`确定移除 ${row.fileName}?`).then(() => {
  868. if(row.fileId){
  869. request.post(`/file/${row.fileId}`).then((res) => {
  870. if (res.success) {
  871. this.deleteFile(row.id);
  872. } else {
  873. this.$alert("删除失败!", '提示', {
  874. confirmButtonText: '确定',
  875. type: 'warning'
  876. })
  877. }
  878. })
  879. }else{
  880. this.$message.warning('fileId不能为空');
  881. }
  882. }).catch(() => {
  883. this.$message({
  884. type: 'info',
  885. message: '已取消删除'
  886. });
  887. });
  888. }
  889. },
  890. watch: {
  891. 'addForm': {
  892. deep: true,
  893. handler: function () {
  894. this.getNoticeList();
  895. }
  896. }
  897. }
  898. }
  899. </script>
  900. <style lang="scss" scoped>
  901. h3 {
  902. text-align: center;
  903. overflow: hidden;
  904. margin-bottom: 20px;
  905. .el-button--mini {
  906. float: right;
  907. margin-left: 10px;
  908. }
  909. }
  910. .rowClassP{
  911. span {
  912. color: #3399ff;
  913. margin-left: 15px;
  914. cursor: pointer;
  915. }
  916. span:first-child{
  917. cursor: default;
  918. margin-left: 0;
  919. color: rgb(51, 51, 51);
  920. }
  921. }
  922. </style>