2
3

index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <template>
  2. <div>
  3. <el-breadcrumb class="heading">
  4. <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
  5. <el-breadcrumb-item :to="{ path: '/oilsupplier/annualaudit' }">年审申请表</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <el-card class="box-card" style="height: calc(100vh - 115px);">
  8. <div slot="header">
  9. <span>
  10. <i class="icon icon-table2"></i> 年审申请表
  11. </span>
  12. <span style="float: right;">
  13. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="addaudit">添加
  14. </el-button>
  15. </span>
  16. <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
  17. <el-form-item label="年审日期">
  18. <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
  19. start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
  20. </el-form-item>
  21. <el-form-item label="准入类别">
  22. <el-select size="mini" style="width:100px" v-model="searchForm.SupplierTypeName" placeholder="准入类别">
  23. <el-option label="物资类" value="01"></el-option>
  24. <el-option label="技术服务类" value="03"></el-option>
  25. <el-option label="基建类" value="02"></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item>
  29. <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
  30. 查询
  31. <el-dropdown-menu slot="dropdown">
  32. <el-dropdown-item command="search">高级查询</el-dropdown-item>
  33. <el-dropdown-item command="clear">查询重置</el-dropdown-item>
  34. </el-dropdown-menu>
  35. </el-dropdown>
  36. </el-form-item>
  37. </el-form>
  38. </div>
  39. <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
  40. <el-table-column label="操作" min-width="180" align="center" fixed>
  41. <template slot-scope="scope">
  42. <router-link
  43. :to="'/oilsupplier/annualaudit/' + scope.row.SupplierId + '/operation?certid=' + scope.row.CerId +'&WorkflowId='+scope.row.WorkflowId+'&Status='+scope.row.Status+'&Step='+scope.row.Step">
  44. <el-button type="primary" plain title="查看详情" size="mini">打开</el-button>
  45. </router-link>
  46. <el-dropdown @command="MoreCmdClick">
  47. <el-button size="mini" type="primary" plain style="margin-left:5px;">
  48. 更多<i class="el-icon-arrow-down el-icon--right"></i>
  49. </el-button>
  50. <el-dropdown-menu slot="dropdown">
  51. <el-dropdown-item :command="GetCommand('History', scope.row)">审批流程</el-dropdown-item>
  52. <el-dropdown-item :command="GetCommand('Delete', scope.row)" :disabled="scope.row.Status != 0" divided>
  53. 删除数据</el-dropdown-item>
  54. </el-dropdown-menu>
  55. </el-dropdown>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="RecUnitId" label="推荐单位编码" sortable min-width="130" align="center" show-overflow-tooltip>
  59. </el-table-column>
  60. <el-table-column prop="AccessCardNo" label="准入证号" sortable min-width="110" align="center" show-overflow-tooltip>
  61. </el-table-column>
  62. <el-table-column prop="SupplierTypeName" label="准入类别" sortable min-width="110" align="center"
  63. show-overflow-tooltip>
  64. <template slot-scope="scope">
  65. {{ checkSupplierTypeName(scope.row.SupplierTypeName) }}
  66. </template>
  67. </el-table-column>
  68. <el-table-column prop="SupplierName" label="企业名称" sortable min-width="130" align="center" show-overflow-tooltip>
  69. </el-table-column>
  70. <!-- <el-table-column prop="OrganCode" label="组织机构代码" sortable min-width="130" align="center" show-overflow-tooltip>
  71. </el-table-column> -->
  72. <el-table-column sortable min-width="110" align="center" prop="Status" label="审核状态">
  73. <template slot-scope="scope">
  74. <el-alert v-if="scope.row.Status=='2'" :closable="false" style="background:rgba(255,255,255,0.2)"
  75. title="初审未通过" type="error">
  76. </el-alert>
  77. <el-alert v-if="scope.row.Status=='4'" :closable="false" style="background:rgba(255,255,255,0.2)"
  78. title="专业审核通过" type="success">
  79. </el-alert>
  80. <el-alert v-if="scope.row.Status=='0'" :closable="false" style="background:rgba(255,255,255,0.2)"
  81. title="已申请" type="info">
  82. </el-alert>
  83. <el-alert v-if="scope.row.Status=='1'" :closable="false" style="background:rgba(255,255,255,0.2)"
  84. title="初审通过" type="success">
  85. </el-alert>
  86. <el-alert v-if="scope.row.Status=='5'" :closable="false" style="background:rgba(255,255,255,0.2)"
  87. title="专业审核未通过" type="error">
  88. </el-alert>
  89. <el-alert v-if="scope.row.Status=='3'" :closable="false" style="background:rgba(255,255,255,0.2)"
  90. title="业务处已接收" type="warning">
  91. </el-alert>
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="ApplyTime" sortable min-width="130" label="年审日期" align="center" show-overflow-tooltip>
  95. <template slot-scope="scope">
  96. {{ jstimehandle(scope.row.ApplyTime+'') }}
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop="CreateOn" sortable min-width="130" label="申请日期" align="center" show-overflow-tooltip>
  100. <template slot-scope="scope">
  101. {{ jstimehandle(scope.row.CreateOn+'') }}
  102. </template>
  103. </el-table-column>
  104. </el-table>
  105. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  106. :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
  107. :total="currentItemCount">
  108. </el-pagination>
  109. </el-card>
  110. <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
  111. <el-form ref="searchForm" label-width="110px">
  112. <el-row>
  113. <el-col :span="12">
  114. <el-form-item label="推荐单位编码">
  115. <el-input size="mini" v-model="searchForm.RecUnitId" style="width:100%" placeholder="请输入"></el-input>
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="12">
  119. <el-form-item label="准入证号">
  120. <el-input size="mini" v-model="searchForm.AccessCardNo" style="width:100%" placeholder="请输入">
  121. </el-input>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="12">
  125. <el-form-item label="准入类别">
  126. <el-input size="mini" v-model="searchForm.SupplierTypeName" style="width:100%" placeholder="请输入">
  127. </el-input>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="12">
  131. <el-form-item label="企业名称">
  132. <el-input size="mini" v-model="searchForm.SupplierName" style="width:100%" placeholder="请输入"></el-input>
  133. </el-form-item>
  134. </el-col>
  135. </el-row>
  136. </el-form>
  137. <span slot="footer" class="dialog-footer">
  138. <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
  139. <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
  140. </span>
  141. </el-dialog>
  142. <el-dialog title="年审申请添加" :visible.sync="addshow" width="360px">
  143. <el-form label-width="90px" :model="entityForm" :rules="rules" ref="EntityFormref">
  144. <el-row>
  145. <el-col :span="24">
  146. <el-form-item label="企业名称" prop="SupplierId" required>
  147. <el-select filterable default-first-option ref="supselect" v-model="entityForm.SupplierId" required
  148. placeholder="请选择" @change="supplierchange" style="width: 100%">
  149. <el-option v-for="item in selectsupplierlist" :key="item.Id" :label="item.Realname" :value="item.Id">
  150. </el-option>
  151. </el-select>
  152. </el-form-item>
  153. </el-col>
  154. </el-row>
  155. <el-row>
  156. <el-col :span="24">
  157. <el-form-item label="准入类别" prop="SupplierTypeName" required>
  158. <el-select filterable default-first-option v-model="entityForm.SupplierTypeName" placeholder="请选择"
  159. style="width: 100%">
  160. <el-option label="物资类" value="01"></el-option>
  161. <el-option label="技术服务类" value="03"></el-option>
  162. <el-option label="基建类" value="02"></el-option>
  163. </el-select>
  164. </el-form-item>
  165. </el-col>
  166. </el-row>
  167. <el-row>
  168. <el-col :span="24">
  169. <el-form-item label="审批人">
  170. <el-input ref="selectAuditer" readonly v-model="auditerName" placeholder="请选择审批人">
  171. <el-button slot="append" icon="el-icon-search" @click="chooseAuditorShow"></el-button>
  172. </el-input>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="24">
  176. <el-form-item label="说明">
  177. <el-input v-model="entityForm.Remark" type="textarea" placeholder="请输入说明内容">
  178. </el-input>
  179. </el-form-item>
  180. </el-col>
  181. </el-row>
  182. </el-form>
  183. <span style="float: right;margin-top:-10px;">
  184. <el-button size="small" @click="addshow = false">取 消</el-button>
  185. <el-button type="primary" size="small" @click="addAnnualAudit()">确 定</el-button>
  186. </span>
  187. <br>
  188. </el-dialog>
  189. <el-dialog title="审核历史查看" :visible.sync="historyVisible" width="900px">
  190. <wf-history ref="WfHistory" :entryinfo="entrydetail"></wf-history>
  191. </el-dialog>
  192. <choose-auditor ref="chooseAuditor" @close="setAuditer" @hideChooseAuditer="chooseAuditorVisible=false"
  193. :visible="chooseAuditorVisible"></choose-auditor>
  194. </div>
  195. </template>
  196. <script>
  197. import {
  198. mapGetters
  199. } from 'vuex';
  200. import WfHistory from '@/components/workflow/wfhistory.vue'
  201. import supplierapi from '@/api/oilsupplier/supplier'
  202. import api from '@/api/oilsupplier/annualaudit'
  203. import ChooseAuditor from '@/components/oilsupplier/chooseauditor'
  204. export default {
  205. components: {
  206. WfHistory,
  207. ChooseAuditor
  208. },
  209. computed: {
  210. ...mapGetters({
  211. authUser: 'authUser'
  212. })
  213. },
  214. name: 'annualaudit',
  215. data() {
  216. return {
  217. chooseAuditorVisible: false,
  218. orgtreelist: [],
  219. orgtreeprops: {
  220. value: 'id',
  221. label: 'Fullname',
  222. children: 'children'
  223. },
  224. historyVisible: false,
  225. addshow: false,
  226. dialogVisible: false,
  227. delevisble: false,
  228. organizeOption: [], // 审批部门
  229. auditerOption: [],
  230. auditer: '',
  231. auditerName: '',
  232. //列表数据
  233. selectsupplierlist: [],
  234. entityList: [],
  235. //分页参数
  236. size: 10,
  237. currentPage: 1,
  238. currentItemCount: 0,
  239. //列表排序
  240. Column: {
  241. Order: '',
  242. Prop: ''
  243. },
  244. //工作流
  245. entrydetail: {
  246. process: 'oil_audit_apply',
  247. business: '',
  248. instance: '',
  249. },
  250. //查询时间
  251. CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
  252. //查询项
  253. searchFormReset: {},
  254. entityForm: {
  255. Id: '',
  256. SupplierName: '',
  257. SupplierId: '',
  258. SupplierTypeName: '',
  259. FirstAudit: '',
  260. auditer: '',
  261. Step: 0,
  262. Remark: ''
  263. },
  264. searchForm: {
  265. Id: '',
  266. RecUnitId: '',
  267. AccessCardNo: '',
  268. SupplierTypeName: '',
  269. SupplierName: '',
  270. Num: '',
  271. ProjectName: '',
  272. Performance: '',
  273. WorkRange: '',
  274. Status: '',
  275. BackReason: '',
  276. ApplyTime: '',
  277. AuditDate: '',
  278. EnterUserId: '',
  279. EnterUserName: '',
  280. EnterUserTel: '',
  281. SCR: '',
  282. SCRQ: '',
  283. SCYJ: '',
  284. SCJG: '',
  285. SPR: '',
  286. SPRQ: '',
  287. SPYJ: '',
  288. SPJG: '',
  289. CreateOn: '',
  290. CreateUserId: '',
  291. CreateBy: '',
  292. ModifiedOn: '',
  293. ModifiedUserId: '',
  294. ModifiedBy: '',
  295. },
  296. rules: {
  297. SupplierId: [{
  298. required: true,
  299. message: '请选择企业名称',
  300. trigger: 'blur'
  301. }, ],
  302. SupplierTypeName: [{
  303. required: true,
  304. message: '请选择准入类别',
  305. trigger: 'blur'
  306. }],
  307. FirstAudit: [{
  308. required: true,
  309. message: '请选择初审单位',
  310. trigger: 'blur'
  311. }],
  312. auditer: [{
  313. required: true,
  314. message: '请选择审批人',
  315. trigger: 'blur'
  316. }]
  317. }
  318. }
  319. },
  320. created() {
  321. //查询条件初始值备份
  322. Object.assign(this.searchFormReset, this.searchForm)
  323. //查询列表
  324. this.initDatas()
  325. this.getselectsupplier()
  326. this.getorgtreelist()
  327. this.getDictOptions()
  328. },
  329. methods: {
  330. initDatas() {
  331. //分页及列表条件
  332. let params = {
  333. _currentPage: this.currentPage,
  334. _size: this.size,
  335. Order: this.Column.Order,
  336. Prop: this.Column.Prop,
  337. }
  338. let myCreateOn = []
  339. // 解析时间
  340. if (this.CreateOn.length == 2) {
  341. this.CreateOn[1].setHours(23)
  342. this.CreateOn[1].setMinutes(59)
  343. this.CreateOn[1].setSeconds(59)
  344. myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
  345. myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
  346. }
  347. //查询条件
  348. Object.assign(params, this.searchForm)
  349. //访问接口
  350. api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
  351. this.entityList = res.data.items
  352. console.log("---this.entityList ----", this.entityList)
  353. this.currentItemCount = res.data.currentItemCount
  354. }).catch(err => {
  355. console.error(err)
  356. })
  357. },
  358. getorgtreelist() {
  359. let _this = this
  360. let params = {
  361. IsInnerOrganize: 1
  362. }
  363. _this.$axios.get('organizes/orgalllist', {
  364. params
  365. })
  366. .then(res => {
  367. _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
  368. if (_this.authUser.Profile.IsCompanyUser === 0) {
  369. this.secOrganize = _this.authUser.Profile.Superior.split(',').map((val) => {
  370. return parseInt(val)
  371. })
  372. this.auditOrgChang(this.secOrganize)
  373. }
  374. })
  375. .catch(err => {
  376. console.error(err)
  377. })
  378. },
  379. setAuditer(val, name) {
  380. console.log("------", val, name)
  381. this.auditer = val
  382. this.auditerName = name
  383. this.chooseAuditorVisible = false
  384. },
  385. chooseAuditorShow() {
  386. console.log("---this.entityForm---",this.entityForm)
  387. this.$refs['chooseAuditor'].getorgtreelist(this.entityForm.SupplierTypeName)
  388. this.chooseAuditorVisible = true
  389. },
  390. supplierchange(value) {
  391. let obj = {};
  392. obj = this.selectsupplierlist.find((item) => {
  393. return item.Id === value;
  394. });
  395. this.entityForm.SupplierName = obj.Realname
  396. },
  397. addAnnualAudit() {
  398. this.$refs['EntityFormref'].validate((valid) => {
  399. if (valid) {
  400. this.entityForm.auditer = this.auditer
  401. console.log("----this.entityForm.auditer--", this.entityForm.auditer)
  402. api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
  403. if (res.data.code === 0) {
  404. console.log("--------res.data----", res.data)
  405. //保存成功后,初始化数据,变成修改
  406. this.entityForm.Id = res.data.item;
  407. this.initDatas();
  408. this.addshow = false
  409. this.$message({
  410. type: 'success',
  411. message: res.data.message
  412. });
  413. } else {
  414. this.$message({
  415. type: 'warning',
  416. message: res.data.message
  417. });
  418. }
  419. }).catch(err => {
  420. console.error(err)
  421. });
  422. }
  423. })
  424. },
  425. addaudit() {
  426. this.addshow = true
  427. },
  428. getselectsupplier() {
  429. api.getSupList(this.$axios).then(res => {
  430. if (res.data.items.length != 0) {
  431. for (var i = 0; i < res.data.items.length; i++) {
  432. this.selectsupplierlist.push({
  433. Id: res.data.items[i].Id,
  434. Realname: res.data.items[i].SupplierName
  435. })
  436. }
  437. }
  438. }).catch(err => {
  439. console.error(err)
  440. })
  441. },
  442. getorgtreelist() {
  443. let _this = this
  444. let params = {
  445. IsInnerOrganize: 1
  446. }
  447. _this.$axios.get('organizes/orgalllist', {
  448. params
  449. })
  450. .then(res => {
  451. _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
  452. })
  453. .catch(err => {
  454. console.error(err)
  455. })
  456. },
  457. getDictOptions() {
  458. supplierapi.getDictList(this.$axios).then(res => {
  459. this.dictData = res.data.items
  460. //this.organizeOption = res.data.items['Organizes']
  461. }).catch(err => {
  462. console.error(err)
  463. })
  464. },
  465. checkSupplierTypeName(val) {
  466. if (val == '01') {
  467. return '物资类'
  468. } else if (val == '02') {
  469. return '基建类'
  470. } else if (val == '03') {
  471. return '技术服务类'
  472. }
  473. },
  474. searchCommand(command) {
  475. if (command == 'search') {
  476. this.dialogVisible = true
  477. } else if (command == 'clear') {
  478. this.clearSearch()
  479. }
  480. },
  481. //列表排序功能
  482. orderby(column) {
  483. if (column.order == 'ascending') {
  484. this.Column.Order = 'asc'
  485. } else if (column.order == 'descending') {
  486. this.Column.Order = 'desc'
  487. }
  488. this.Column.Prop = column.prop
  489. this.initDatas()
  490. },
  491. clearSearch() {
  492. Object.assign(this.searchForm, this.searchFormReset);
  493. //this.searchForm = this.searchFormReset;
  494. this.CreateOn = ''
  495. this.initDatas()
  496. },
  497. handleSearch() {
  498. this.currentPage = 1;
  499. this.dialogVisible = false;
  500. this.initDatas();
  501. },
  502. handleCurrentChange(value) {
  503. this.currentPage = value
  504. this.initDatas()
  505. },
  506. handleSizeChange(value) {
  507. this.size = value
  508. this.currentPage = 1
  509. this.initDatas()
  510. },
  511. deleteEntity(row) {
  512. api.deleteEntity(row.Id, this.$axios).then(res => {
  513. if (res.data.code === 0) {
  514. this.initDatas();
  515. this.$message({
  516. type: 'success',
  517. message: res.data.message
  518. });
  519. } else {
  520. this.$message({
  521. type: 'warning',
  522. message: res.data.message
  523. });
  524. }
  525. }).catch(err => {
  526. console.error(err)
  527. });
  528. },
  529. getvalues(val) {
  530. this.entrydetail.business = val.Id
  531. this.entrydetail.instance = val.WorkflowId
  532. this.historyVisible = true
  533. },
  534. MoreCmdClick(cmd) {
  535. if (cmd.Command == 'History') {
  536. this.getvalues(cmd.row)
  537. } else if (cmd.Command == 'Delete') {
  538. this.deleteEntity(cmd.row)
  539. }
  540. },
  541. GetCommand(cmdType, row) {
  542. let cmd = {}
  543. cmd.Command = cmdType
  544. cmd.row = row
  545. return cmd
  546. },
  547. jstimehandle(val) {
  548. if (val === '') {
  549. return '----'
  550. } else if (val === '0001-01-01T00:00:00Z') {
  551. return '----'
  552. } else if (val === '0001-01-01T08:00:00+08:00') {
  553. return '----'
  554. } else if (val === '5000-01-01T23:59:59+08:00') {
  555. return '永久'
  556. } else {
  557. val = val.replace('T', ' ')
  558. return val.substring(0, 10)
  559. }
  560. },
  561. formatDateTime(date) {
  562. var y = date.getFullYear();
  563. var m = date.getMonth() + 1;
  564. m = m < 10 ? ('0' + m) : m;
  565. var d = date.getDate();
  566. d = d < 10 ? ('0' + d) : d;
  567. var h = date.getHours();
  568. var minute = date.getMinutes();
  569. minute = minute < 10 ? ('0' + minute) : minute;
  570. return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
  571. }
  572. }
  573. }
  574. </script>
  575. <style lang="scss">
  576. </style>