basicindex.vue 25 KB

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