basicindex.vue 25 KB

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