index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="组织保护措施变更描述" prop="changeDescribe" label-width="160px">
  5. <el-input
  6. v-model="queryParams.changeDescribe"
  7. placeholder="请输入组织保护措施变更描述"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="安全评估人" prop="safaerName" label-width="90px">
  14. <el-input
  15. v-model="queryParams.safaerName"
  16. placeholder="请输入安全评估人"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="状态" prop="status">
  23. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" @change="handleQuery">
  24. <el-option
  25. v-for="item in statusList"
  26. :key="item.dictValue"
  27. :label="item.dictLabel"
  28. :value="item.dictValue"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="申请状态" prop="approveStatus">
  33. <el-select v-model="queryParams.approveStatus" placeholder="请选择申请状态" clearable size="small" @change="handleQuery">
  34. <el-option
  35. v-for="item in approveStatusList"
  36. :key="item.dictValue"
  37. :label="item.dictLabel"
  38. :value="item.dictValue"
  39. ></el-option>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item>
  43. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  44. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  45. </el-form-item>
  46. </el-form>
  47. <el-row :gutter="10" class="mb8">
  48. <el-col :span="1.5">
  49. <el-button
  50. type="primary"
  51. icon="el-icon-plus"
  52. size="mini"
  53. @click="handleAdd"
  54. v-hasPermi="['apply:safetychange:add']"
  55. >新增
  56. </el-button>
  57. </el-col>
  58. <el-col :span="1.5">
  59. <el-button
  60. type="success"
  61. icon="el-icon-edit"
  62. size="mini"
  63. :disabled="single"
  64. @click="handleUpdate"
  65. v-hasPermi="['apply:safetychange:edit']"
  66. >修改
  67. </el-button>
  68. </el-col>
  69. <!-- <el-col :span="1.5">
  70. <el-button
  71. type="danger"
  72. icon="el-icon-delete"
  73. size="mini"
  74. :disabled="multiple"
  75. @click="handleDelete"
  76. v-hasPermi="['apply:safetychange:remove']"
  77. >删除
  78. </el-button>
  79. </el-col>-->
  80. <!-- <el-col :span="1.5">
  81. <el-button
  82. type="info"
  83. icon="el-icon-upload2"
  84. size="mini"
  85. @click="handleImport"
  86. v-hasPermi="['apply:safetychange:edit']"
  87. >导入</el-button>
  88. </el-col>-->
  89. <!-- <el-col :span="1.5">
  90. <el-button
  91. type="warning"
  92. icon="el-icon-download"
  93. size="mini"
  94. @click="handleExport"
  95. v-hasPermi="['apply:safetychange:export']"
  96. >导出
  97. </el-button>
  98. </el-col>-->
  99. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  100. </el-row>
  101. <el-table v-loading="loading" :data="safetychangeList" @selection-change="handleSelectionChange"
  102. :height="clientHeight" border>
  103. <el-table-column type="selection" width="55" align="center"/>
  104. <el-table-column label="组织保护措施变更描述" align="center" prop="changeDescribe" :show-overflow-tooltip="true"
  105. fixed="left" width="160"/>
  106. <el-table-column label="状态变更的原因" align="center" prop="changeReason" :show-overflow-tooltip="true"
  107. width="160"/>
  108. <el-table-column label="申请人" align="center" prop="applicantName" :show-overflow-tooltip="true" width="160"/>
  109. <el-table-column label="申请时间" align="center" prop="applicationTime" width="140">
  110. <template slot-scope="scope">
  111. <span>{{ parseTime(scope.row.applicationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="安全评估及临时的安全措施" align="center" prop="safa" :show-overflow-tooltip="true"
  115. width="190"/>
  116. <el-table-column label="安全评估人(评估时间)" align="center" prop="safaerName" :show-overflow-tooltip="true"
  117. width="300">
  118. <template slot-scope="scope">
  119. <span>{{ scope.row.safaerName }} {{ parseTime(scope.row.safaTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="批准人(批准时间)" align="center" prop="approverName" :show-overflow-tooltip="true"
  123. width="300">
  124. <template slot-scope="scope">
  125. <span>{{ scope.row.approverName }} {{ parseTime(scope.row.approveTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="临时安全措施执行人(执行时间)" align="center" prop="executorName"
  129. :show-overflow-tooltip="true"
  130. width="300">
  131. <template slot-scope="scope">
  132. <span>{{ scope.row.executorName }} {{ parseTime(scope.row.executionTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="临时安全措施确认人(确认时间)" align="center" prop="confirmerName"
  136. :show-overflow-tooltip="true"
  137. width="300">
  138. <template slot-scope="scope">
  139. <span>{{ scope.row.confirmerName }} {{ parseTime(scope.row.confirmTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="组织保护措施状态变更执行" align="center" prop="changeExecution"
  143. :show-overflow-tooltip="true" width="200"/>
  144. <el-table-column label="执行人(执行时间)" align="center" prop="changeExecutorName" :show-overflow-tooltip="true"
  145. width="300">
  146. <template slot-scope="scope">
  147. <span>{{ scope.row.changeExecutorName }} {{
  148. parseTime(scope.row.changeExecutorTime, '{y}-{m}-{d} {h}:{i}')
  149. }}</span>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="200"/>
  153. <el-table-column label="申请状态" align="center" prop="approveStatus" :show-overflow-tooltip="true" fixed="left"
  154. width="85" :formatter="approveStatusFormat"/>
  155. <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" fixed="left"
  156. width="85" :formatter="statusFormat"/>
  157. <el-table-column label="操作" align="center" fixed="right" width="140" class-name="small-padding fixed-width">
  158. <template slot-scope="scope">
  159. <el-button
  160. size="mini"
  161. type="text"
  162. icon="el-icon-document"
  163. @click="openDetail(scope.row)"
  164. >详情
  165. </el-button>
  166. <el-button
  167. size="mini"
  168. type="text"
  169. icon="el-icon-document"
  170. @click="openApproveDetail(scope.row)"
  171. >流转详情
  172. </el-button>
  173. </template>
  174. </el-table-column>
  175. </el-table>
  176. <pagination
  177. v-show="total>0"
  178. :total="total"
  179. :page.sync="queryParams.pageNum"
  180. :limit.sync="queryParams.pageSize"
  181. @pagination="getList"
  182. />
  183. <!-- 添加或修改组织保护措施状态变更申请对话框 -->
  184. <el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
  185. <el-form ref="form" :model="form" :rules="rules" label-width="170px">
  186. <el-form-item label="组织保护措施变更描述" prop="changeDescribe">
  187. <el-input type="textarea" v-model="form.changeDescribe" placeholder="请输入组织保护措施变更描述"/>
  188. </el-form-item>
  189. <el-form-item label="状态变更的原因" prop="changeReason">
  190. <el-input type="textarea" v-model="form.changeReason" placeholder="请输入状态变更的原因"/>
  191. </el-form-item>
  192. <el-form-item label="安全评估人" prop="safaer">
  193. <el-select v-model="form.safaer" placeholder="请选择临时措施执行人" clearable size="small" filterable
  194. style="width: 100%" @change="getSafaerName(form.safaer)">
  195. <el-option
  196. v-for="item in safaerList"
  197. :key="item.userId"
  198. :label="item.nickName"
  199. :value="item.userId"
  200. ></el-option>
  201. </el-select>
  202. </el-form-item>
  203. <el-form-item label="临时安全措施执行人" prop="executor">
  204. <el-select v-model="form.executor" placeholder="请选择临时措施执行人" clearable size="small" filterable
  205. style="width: 100%" @change="getExecutorName(form.executor)">
  206. <el-option
  207. v-for="item in executorList"
  208. :key="item.userId"
  209. :label="item.nickName"
  210. :value="item.userId"
  211. ></el-option>
  212. </el-select>
  213. </el-form-item>
  214. <el-form-item label="备注" prop="remarks">
  215. <el-input type="textarea" v-model="form.remarks" placeholder="请输入备注"/>
  216. </el-form-item>
  217. </el-form>
  218. <div slot="footer" class="dialog-footer">
  219. <el-button type="primary" @click="submitForm">确 定</el-button>
  220. <el-button @click="cancel">取 消</el-button>
  221. </div>
  222. </el-dialog>
  223. <!-- 用户导入对话框 -->
  224. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  225. <el-upload
  226. ref="upload"
  227. :limit="1"
  228. accept=".xlsx, .xls"
  229. :headers="upload.headers"
  230. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  231. :disabled="upload.isUploading"
  232. :on-progress="handleFileUploadProgress"
  233. :on-success="handleFileSuccess"
  234. :auto-upload="false"
  235. drag
  236. >
  237. <i class="el-icon-upload"></i>
  238. <div class="el-upload__text">
  239. 将文件拖到此处,或
  240. <em>点击上传</em>
  241. </div>
  242. <div class="el-upload__tip" slot="tip">
  243. <el-checkbox v-model="upload.updateSupport"/>
  244. 是否更新已经存在的用户数据
  245. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  246. </div>
  247. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  248. </el-upload>
  249. <div slot="footer" class="dialog-footer">
  250. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  251. <el-button @click="upload.open = false">取 消</el-button>
  252. </div>
  253. </el-dialog>
  254. <el-dialog title="申请单详情" :visible.sync="detail.open" width="50%" append-to-body>
  255. <el-descriptions :column="2" border size="medium">
  256. <el-descriptions-item label="组织保护措施变更播述" :span="2" :label-style="labelStyle">
  257. {{ this.detail.data.changeDescribe }}
  258. </el-descriptions-item>
  259. <el-descriptions-item label="状态变更的原因" span="2" :label-style="labelStyle">
  260. {{ this.detail.data.changeReason }}
  261. </el-descriptions-item>
  262. <el-descriptions-item label="申请人" :label-style="labelStyle">
  263. {{ this.detail.data.applicantName }}
  264. </el-descriptions-item>
  265. <el-descriptions-item label="申请时间" :label-style="labelStyle">
  266. <template>
  267. <span>{{ parseTime(this.detail.data.applicationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  268. </template>
  269. </el-descriptions-item>
  270. <el-descriptions-item label="状态" :label-style="labelStyle">
  271. <el-tag size="small" :type="statusFlag">{{ status[this.detail.data.status] }}</el-tag>
  272. </el-descriptions-item>
  273. <el-descriptions-item label="申请状态">
  274. <el-tag size="small" :type="approveStatusFlag">{{ approveStatus[this.detail.data.approveStatus] }}</el-tag>
  275. </el-descriptions-item>
  276. <el-descriptions-item label="安全评估及临时的安全措施" :span="2" :label-style="labelStyle">
  277. {{ this.detail.data.safa }}
  278. </el-descriptions-item>
  279. <el-descriptions-item label="安全评估人" :label-style="labelStyle">
  280. {{ this.detail.data.safaerName }}
  281. </el-descriptions-item>
  282. <el-descriptions-item label="安全评估时间" :label-style="labelStyle">
  283. <template>
  284. <span>{{ parseTime(this.detail.data.safaTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  285. </template>
  286. </el-descriptions-item>
  287. <el-descriptions-item label="批准人" :label-style="labelStyle">
  288. {{ this.detail.data.approverName }}
  289. </el-descriptions-item>
  290. <el-descriptions-item label="批准时间" :label-style="labelStyle">
  291. <template>
  292. <span>{{ parseTime(this.detail.data.approveTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  293. </template>
  294. </el-descriptions-item>
  295. <el-descriptions-item label="临时措施执行人" :label-style="labelStyle">
  296. {{ this.detail.data.executorName }}
  297. </el-descriptions-item>
  298. <el-descriptions-item label="临时措施执行时间" :label-style="labelStyle">
  299. <template>
  300. <span>{{ parseTime(this.detail.data.executionTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  301. </template>
  302. </el-descriptions-item>
  303. <el-descriptions-item label="临时措施确认人" :label-style="labelStyle">
  304. {{ this.detail.data.confirmerName }}
  305. </el-descriptions-item>
  306. <el-descriptions-item label="临时措施确认时间" :label-style="labelStyle">
  307. <template>
  308. <span>{{ parseTime(this.detail.data.confirmTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  309. </template>
  310. </el-descriptions-item>
  311. <el-descriptions-item label="组织保护措施状态变更执行" :span="2" :label-style="labelStyle">
  312. {{ this.detail.data.changeExecution }}
  313. </el-descriptions-item>
  314. <el-descriptions-item label="执行人" :label-style="labelStyle">
  315. {{ this.detail.data.changeExecutorName }}
  316. </el-descriptions-item>
  317. <el-descriptions-item label="执行时间" :label-style="labelStyle">
  318. <template>
  319. <span>{{ parseTime(this.detail.data.changeExecutorTime, '{y}-{m}-{d} {h}:{i}') }}</span>
  320. </template>
  321. </el-descriptions-item>
  322. <el-descriptions-item label="组织保护措施是否已经恢复至变更前的状态" :span="2" :label-style="labelStyle">
  323. {{ this.detail.data.resetConfirm }}
  324. </el-descriptions-item>
  325. <el-descriptions-item label="状态恢复,确认人1" :label-style="labelStyle">
  326. {{ this.detail.data.resetConfirmerName1 }}
  327. </el-descriptions-item>
  328. <el-descriptions-item label="确认时间" :label-style="labelStyle">
  329. {{ this.detail.data.resetConfirmTime1 }}
  330. </el-descriptions-item>
  331. <el-descriptions-item label="状态恢复,确认人2" :label-style="labelStyle">
  332. {{ this.detail.data.resetConfirmerName2 }}
  333. </el-descriptions-item>
  334. <el-descriptions-item label="确认时间" :label-style="labelStyle">
  335. {{ this.detail.data.resetConfirmTime2 }}
  336. </el-descriptions-item>
  337. <el-descriptions-item label="状态恢复后,之前采取的安全措施是否已撤销" :span="2" :label-style="labelStyle">
  338. {{ this.detail.data.revokeConfirm }}
  339. </el-descriptions-item>
  340. <el-descriptions-item label="备注" :span="2" :label-style="labelStyle">
  341. {{ this.detail.data.remarks }}
  342. </el-descriptions-item>
  343. </el-descriptions>
  344. </el-dialog>
  345. <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
  346. </div>
  347. </template>
  348. <script>
  349. import {
  350. listSafetychange,
  351. getSafetychange,
  352. delSafetychange,
  353. addSafetychange,
  354. updateSafetychange,
  355. exportSafetychange,
  356. importTemplate
  357. } from "@/api/apply/safetychange";
  358. import {treeselect} from "@/api/system/dept";
  359. import {getToken} from "@/utils/auth";
  360. import Treeselect from "@riophae/vue-treeselect";
  361. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  362. import {listPostUser, listUserPost} from "@/api/system/user";
  363. import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
  364. export default {
  365. name: "Safetychange",
  366. components: {SafetychangeDetail, Treeselect},
  367. data() {
  368. return {
  369. detail: {
  370. open: false,
  371. data: {}
  372. },
  373. //label样式
  374. labelStyle: {'width': '200px'},
  375. executorList: [],
  376. safaerList: [],
  377. statusFlag: '',
  378. approveStatusFlag: '',
  379. status: {0: "未完成", 1: "已完成"},
  380. approveStatus: {1: "申请中", 2: "已通过", 3: "已拒绝"},
  381. // 字典
  382. statusList: [],
  383. approveStatusList: [],
  384. // 遮罩层
  385. loading: true,
  386. // 选中数组
  387. ids: [],
  388. // 非单个禁用
  389. single: true,
  390. // 非多个禁用
  391. multiple: true,
  392. // 显示搜索条件
  393. showSearch: false,
  394. safetychangeDetailVisible: false,
  395. // 总条数
  396. total: 0,
  397. // 组织保护措施状态变更申请表格数据
  398. safetychangeList: [],
  399. // 弹出层标题
  400. title: "",
  401. // 部门树选项
  402. deptOptions: undefined,
  403. clientHeight: 300,
  404. // 是否显示弹出层
  405. open: false,
  406. // 用户导入参数
  407. upload: {
  408. // 是否显示弹出层(用户导入)
  409. open: false,
  410. // 弹出层标题(用户导入)
  411. title: "",
  412. // 是否禁用上传
  413. isUploading: false,
  414. // 是否更新已经存在的用户数据
  415. updateSupport: 0,
  416. // 设置上传的请求头部
  417. headers: {Authorization: "Bearer " + getToken()},
  418. // 上传的地址
  419. url: process.env.VUE_APP_BASE_API + "/apply/safetychange/importData"
  420. },
  421. // 查询参数
  422. queryParams: {
  423. pageNum: 1,
  424. pageSize: 20,
  425. changeDescribe: null,
  426. changeReason: null,
  427. applicant: null,
  428. applicantName: null,
  429. applicationTime: null,
  430. safa: null,
  431. safaer: null,
  432. safaerName: null,
  433. safaTime: null,
  434. approver: null,
  435. approverName: null,
  436. approveTime: null,
  437. executor: null,
  438. executorName: null,
  439. executionTime: null,
  440. confirmer: null,
  441. confirmerName: null,
  442. confirmTime: null,
  443. changeExecution: null,
  444. changeExecutor: null,
  445. changeExecutorName: null,
  446. changeExecutorTime: null,
  447. resetConfirm: null,
  448. resetConfirmer1: null,
  449. resetConfirmerName1: null,
  450. resetConfirmTime1: null,
  451. resetConfirmer2: null,
  452. resetConfirmerName2: null,
  453. resetConfirmTime2: null,
  454. revokeConfirm: null,
  455. remarks: null,
  456. status: null,
  457. createrCode: null,
  458. createdate: null,
  459. updaterCode: null,
  460. updatedate: null,
  461. deptId: null,
  462. approveStatus: null
  463. },
  464. // 表单参数
  465. form: {},
  466. // 表单校验
  467. rules: {
  468. changeDescribe: [
  469. {required: true, message: "请输入组织保护措施变更描述", trigger: "blur"}
  470. ],
  471. changeReason: [
  472. {required: true, message: "请输入状态变更的原因", trigger: "blur"}
  473. ],
  474. safaer: [
  475. {required: true, message: "请选择安全评估人", trigger: "blur"}
  476. ],
  477. executor: [
  478. {required: true, message: "请选择临时措施执行人", trigger: "blur"}
  479. ],
  480. }
  481. };
  482. },
  483. watch: {
  484. // 根据名称筛选部门树
  485. deptName(val) {
  486. this.$refs.tree.filter(val);
  487. }
  488. },
  489. created() {
  490. //设置表格高度对应屏幕高度
  491. this.$nextTick(() => {
  492. this.clientHeight = document.body.clientHeight - 250
  493. })
  494. this.getList();
  495. this.getTreeselect();
  496. this.getDicts("apply_status").then(response => {
  497. this.statusList = response.data;
  498. });
  499. this.getDicts("apply_approve_status").then(response => {
  500. this.approveStatusList = response.data;
  501. });
  502. listUserPost({
  503. actualposts:"20,36,10,11,28,30,32,38,15,12,34",
  504. deptId:103
  505. }).then(response => {
  506. this.executorList = response;
  507. });
  508. listUserPost({
  509. actualposts:"24,26,18,14,16",
  510. deptId:103
  511. }).then(response => {
  512. this.safaerList = response;
  513. });
  514. },
  515. methods: {
  516. openDetail(row) {
  517. this.statusFlag = '';
  518. this.approveStatusFlag = '';
  519. this.detail.open = true;
  520. this.detail.data = row;
  521. if (row.status === 1) {
  522. this.statusFlag = 'success';
  523. }
  524. if (row.approveStatus === '2') {
  525. this.approveStatusFlag = 'success';
  526. } else if (row.approveStatus === '1') {
  527. this.approveStatusFlag = 'warning';
  528. } else if (row.approveStatus === '3') {
  529. this.approveStatusFlag = 'danger';
  530. }
  531. },
  532. getExecutorName(userId) {
  533. for (let item of this.executorList) {
  534. if (userId === item.userId) {
  535. this.form.executorName = item.nickName;
  536. break;
  537. }
  538. }
  539. console.log(this.form.executorName)
  540. },
  541. getSafaerName(userId) {
  542. for (const item of this.safaerList) {
  543. if (userId === item.userId) {
  544. this.form.safaerName = item.nickName;
  545. break;
  546. }
  547. }
  548. console.log(this.form.safaerName)
  549. },
  550. // 字典翻译
  551. statusFormat(row, column) {
  552. let s = this.selectDictLabel(this.statusList, row.status);
  553. let type = '';
  554. if (row.status === 1) {
  555. type = 'success';
  556. }
  557. return <el-tag type={type}>{s}</el-tag>;
  558. },
  559. // 字典翻译
  560. approveStatusFormat(row, column) {
  561. let s = this.selectDictLabel(this.approveStatusList, row.approveStatus)
  562. let type = '';
  563. if (row.approveStatus === '2') {
  564. type = 'success';
  565. } else if (row.approveStatus === '1') {
  566. type = 'warning';
  567. } else if (row.approveStatus === '3') {
  568. type = 'danger';
  569. }
  570. return <el-tag type={type}>{s}</el-tag>;
  571. },
  572. openApproveDetail(row) {
  573. this.safetychangeDetailVisible = true
  574. this.$nextTick(() => {
  575. this.$refs.safetychangeDetail.init(row.id, '', row.processId, '')
  576. })
  577. },
  578. /** 查询组织保护措施状态变更申请列表 */
  579. getList() {
  580. this.loading = true;
  581. listSafetychange(this.queryParams).then(response => {
  582. this.safetychangeList = response.rows;
  583. this.total = response.total;
  584. this.loading = false;
  585. });
  586. },
  587. /** 查询部门下拉树结构 */
  588. getTreeselect() {
  589. treeselect().then(response => {
  590. this.deptOptions = response.data;
  591. });
  592. },
  593. // 取消按钮
  594. cancel() {
  595. this.open = false;
  596. this.reset();
  597. },
  598. // 表单重置
  599. reset() {
  600. this.form = {
  601. id: null,
  602. changeDescribe: null,
  603. changeReason: null,
  604. applicant: null,
  605. applicantName: null,
  606. applicationTime: null,
  607. safa: null,
  608. safaer: null,
  609. safaerName: null,
  610. safaTime: null,
  611. approver: null,
  612. approverName: null,
  613. approveTime: null,
  614. executor: null,
  615. executorName: null,
  616. executionTime: null,
  617. confirmer: null,
  618. confirmerName: null,
  619. confirmTime: null,
  620. changeExecution: null,
  621. changeExecutor: null,
  622. changeExecutorName: null,
  623. changeExecutorTime: null,
  624. resetConfirm: null,
  625. resetConfirmer1: null,
  626. resetConfirmerName1: null,
  627. resetConfirmTime1: null,
  628. resetConfirmer2: null,
  629. resetConfirmerName2: null,
  630. resetConfirmTime2: null,
  631. revokeConfirm: null,
  632. remarks: null,
  633. status: 0,
  634. delFlag: null,
  635. createrCode: null,
  636. createdate: null,
  637. updaterCode: null,
  638. updatedate: null,
  639. deptId: null,
  640. approveStatus: "1"
  641. };
  642. this.resetForm("form");
  643. },
  644. /** 搜索按钮操作 */
  645. handleQuery() {
  646. this.queryParams.pageNum = 1;
  647. this.getList();
  648. },
  649. /** 重置按钮操作 */
  650. resetQuery() {
  651. this.resetForm("queryForm");
  652. this.handleQuery();
  653. },
  654. // 多选框选中数据
  655. handleSelectionChange(selection) {
  656. this.ids = selection.map(item => item.id)
  657. this.single = selection.length !== 1
  658. this.multiple = !selection.length
  659. },
  660. /** 新增按钮操作 */
  661. handleAdd() {
  662. this.reset();
  663. this.open = true;
  664. this.title = "添加组织保护措施状态变更申请";
  665. },
  666. /** 修改按钮操作 */
  667. handleUpdate(row) {
  668. this.reset();
  669. const id = row.id || this.ids
  670. getSafetychange(id).then(response => {
  671. this.form = response.data;
  672. this.form.safaer = parseInt(this.form.safaer);
  673. this.form.executor = parseInt(this.form.executor);
  674. this.open = true;
  675. this.title = "修改组织保护措施状态变更申请";
  676. });
  677. },
  678. /** 提交按钮 */
  679. submitForm() {
  680. this.$refs["form"].validate(valid => {
  681. if (valid) {
  682. if (this.form.id != null) {
  683. updateSafetychange(this.form).then(response => {
  684. this.msgSuccess("修改成功");
  685. this.open = false;
  686. this.getList();
  687. });
  688. } else {
  689. addSafetychange(this.form).then(response => {
  690. this.msgSuccess("新增成功");
  691. this.open = false;
  692. this.getList();
  693. });
  694. }
  695. }
  696. });
  697. },
  698. /** 删除按钮操作 */
  699. handleDelete(row) {
  700. const ids = row.id || this.ids;
  701. this.$confirm('是否确认删除?', "警告", {
  702. confirmButtonText: "确定",
  703. cancelButtonText: "取消",
  704. type: "warning"
  705. }).then(function () {
  706. return delSafetychange(ids);
  707. }).then(() => {
  708. this.getList();
  709. this.msgSuccess("删除成功");
  710. })
  711. },
  712. /** 导出按钮操作 */
  713. handleExport() {
  714. const queryParams = this.queryParams;
  715. this.$confirm('是否确认导出所有组织保护措施状态变更申请数据项?', "警告", {
  716. confirmButtonText: "确定",
  717. cancelButtonText: "取消",
  718. type: "warning"
  719. }).then(function () {
  720. return exportSafetychange(queryParams);
  721. }).then(response => {
  722. this.download(response.msg);
  723. })
  724. },
  725. /** 导入按钮操作 */
  726. handleImport() {
  727. this.upload.title = "用户导入";
  728. this.upload.open = true;
  729. },
  730. /** 下载模板操作 */
  731. importTemplate() {
  732. importTemplate().then(response => {
  733. this.download(response.msg);
  734. });
  735. },
  736. // 文件上传中处理
  737. handleFileUploadProgress(event, file, fileList) {
  738. this.upload.isUploading = true;
  739. },
  740. // 文件上传成功处理
  741. handleFileSuccess(response, file, fileList) {
  742. this.upload.open = false;
  743. this.upload.isUploading = false;
  744. this.$refs.upload.clearFiles();
  745. this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
  746. this.getList();
  747. },
  748. // 提交上传文件
  749. submitFileForm() {
  750. this.$refs.upload.submit();
  751. }
  752. }
  753. };
  754. </script>