approvalList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <template>
  2. <div class="approvalList_container">
  3. <div class="approvalList_top">
  4. <el-select v-model="status" placeholder="请选择状态" style="width:200px;marginRight:16px;" @change="changeStatus" v-if="Role=='ficc_admin'||Role=='rai_admin'">
  5. <el-option
  6. v-for="item in statusArr"
  7. :key="item"
  8. :label="item"
  9. :value="item">
  10. </el-option>
  11. </el-select>
  12. <el-input
  13. placeholder="公司名称/信用代码"
  14. v-model="search_txt"
  15. @input="handlSearch"
  16. clearable
  17. style="maxWidth:500px">
  18. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  19. </el-input>
  20. </div>
  21. <div class="approvalList_cont">
  22. <el-table
  23. ref="userTable"
  24. :data="tableData"
  25. v-loading="isShowloadding"
  26. element-loading-text="数据加载中..."
  27. border>
  28. <el-table-column
  29. prop="CompanyName"
  30. label="客户名称"
  31. align="center">
  32. <template slot-scope="scope"> <span style="color:#409EFF;cursor:pointer;" @click="goDetail(scope.row)" class="customName">{{scope.row.CompanyName}}</span></template>
  33. </el-table-column>
  34. <el-table-column
  35. prop="CompanyType"
  36. label="客户类型"
  37. align="center">
  38. <template slot-scope="scope"> <span>{{scope.row.CompanyType}}</span> </template>
  39. </el-table-column>
  40. <el-table-column
  41. prop="IndustryName"
  42. label="所属行业"
  43. align="center">
  44. <template slot-scope="scope"> <span>{{scope.row.IndustryName}}</span> </template>
  45. </el-table-column>
  46. <el-table-column
  47. prop="SellerName"
  48. label="所属销售"
  49. align="center">
  50. <template slot-scope="scope"> <span>{{scope.row.SellerName}}</span> </template>
  51. </el-table-column>
  52. <el-table-column
  53. prop="ApprovalTime"
  54. label="提交审批时间"
  55. align="center">
  56. <template slot-scope="scope"> <span>{{scope.row.ApprovalTime|formatTime}}</span> </template>
  57. </el-table-column>
  58. <el-table-column
  59. prop="CreateTime"
  60. label="审批时间"
  61. align="center">
  62. <template slot-scope="scope">
  63. <span v-if="scope.row.ApproveStatus!=='待审批' && scope.row.ApproveStatus!=='已撤回'">{{
  64. scope.row.ApproveTime|formatTime}}
  65. </span>
  66. <span v-else>--</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column
  70. prop="Status"
  71. label="客户状态"
  72. align="center">
  73. <template slot-scope="scope"> <span>{{scope.row.Status}}</span> </template>
  74. </el-table-column>
  75. <el-table-column
  76. prop="ApproveContent"
  77. label="待审内容"
  78. align="center">
  79. <template slot-scope="scope">
  80. <span :style="(Role=='ficc_seller' || Role=='rai_seller')?'':status=='已审批'?'color:#666;':'color:#F00;'">{{scope.row.ApproveContent}}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column
  84. prop="ApproveStatus"
  85. label="当前状态"
  86. align="center">
  87. <template slot-scope="scope">
  88. <span :style="scope.row.ApproveStatus=='已审批'?'':scope.row.ApproveStatus=='已撤回'?'color:#409EFF':'color:#F00'">{{scope.row.ApproveStatus=='驳回'?'已驳回':scope.row.ApproveStatus}}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. prop="ApproveStatus"
  93. label="申请人"
  94. align="center">
  95. <template slot-scope="scope">
  96. <span :style="scope.row.ApproveStatus=='待审批'?'color:#F00':''">{{scope.row.ApplyRealName}}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="操作" align="center" min-width="110" v-if="Role!='admin'">
  100. <template slot-scope="scope">
  101. <div style="color:#4099ef; font-size:24px;">
  102. <span class="editsty" style="marginRight:10px;" @click="retractHandle(scope.row)"
  103. v-if="scope.row.OpButton.Cancel&&scope.row.ApproveStatus=='待审批'">撤回</span>
  104. <template
  105. v-if="scope.row.ApproveStatus=='驳回'&&(Role=='ficc_seller' || Role=='rai_seller')">
  106. <span class="editsty" style="marginRight:10px;" @click="openHandle(scope.row)">驳回理由</span>
  107. <span class="editsty" style="marginRight:10px;" @click="editHandle(scope.row)">重新申请</span>
  108. </template>
  109. <span class="editsty" style="marginRight:10px;" @click="openApproval(scope.row)"
  110. v-if="scope.row.OpButton.Approval&&scope.row.ApproveStatus=='待审批'">审批</span>
  111. <span class="editsty" @click="openApprovalDtl(scope.row)"
  112. v-if="(Role=='ficc_admin'||Role=='rai_admin')&&scope.row.ApproveStatus=='已审批'">审批信息</span>
  113. <template
  114. v-if="scope.row.ApproveStatus=='已撤回'&&(Role=='ficc_seller' || Role=='rai_seller')">
  115. <span class="editsty" style="marginRight:10px;" @click="editHandle(scope.row)">重新申请</span>
  116. <span class="deletesty" style="marginRight:10px;" @click="delHandle(scope.row)">删除</span>
  117. </template>
  118. </div>
  119. </template>
  120. </el-table-column>
  121. <div slot="empty" style="lineHeight:44px;margin:60px 0;color:#999;">
  122. <img src="~@/assets/img/cus_m/nodata.png" alt="" style="display:block;width:160px;height:128px;margin: auto;">
  123. <span>暂无数据</span>
  124. </div>
  125. </el-table>
  126. <el-col :span="24" class="toolbar">
  127. <el-pagination
  128. layout="total,prev,pager,next,jumper"
  129. background
  130. :current-page="page_no"
  131. @current-change="handleCurrentChange"
  132. :page-size="pageSize"
  133. @size-change="handleSizeChange"
  134. :total="total"
  135. style="float:right;">
  136. </el-pagination>
  137. </el-col>
  138. </div>
  139. <!-- 撤回弹窗 -->
  140. <el-dialog
  141. title=""
  142. :visible.sync="isRetract"
  143. :close-on-click-modal="false"
  144. :show-close="false"
  145. :modal-append-to-body='false'
  146. custom-class="appro_dialog"
  147. center
  148. width="22%">
  149. <div style="display:flex;justify-content:center;alignItems:center;margin:20px 0 50px;color:#606266;fontSize:16px;">
  150. <i class="el-icon-success" style="fontSize:20px;color:#409EFF;marginRight:10px;"></i>
  151. <span>撤回成功</span>
  152. </div>
  153. <div style="display:flex;justify-content:center;margin:0 0 25px;">
  154. <el-button type="primary" style="width:112px;marginRight:24px;" @click="editHandle(revokeItem)">重新申请</el-button>
  155. <el-button style="width:112px;" @click="cancelHandle(1)" type="primary" plain>关闭</el-button>
  156. </div>
  157. </el-dialog>
  158. <!-- 驳回弹窗 -->
  159. <el-dialog
  160. title="驳回理由"
  161. :visible.sync="isReject"
  162. :close-on-click-modal="false"
  163. :modal-append-to-body='false'
  164. custom-class="appro_dialog"
  165. @close="cancelHandle(2)"
  166. center
  167. top="20vh"
  168. width="22%">
  169. <div style="display:flex;margin:13px 0 50px;color:#606266;">
  170. <span>{{rejectTxt}}</span>
  171. </div>
  172. <div style="display:flex;justify-content:flex-end;margin:0 0 26px;">
  173. <el-button type="primary" style="width:80px;" @click="cancelHandle(2)">知道了</el-button>
  174. </div>
  175. </el-dialog>
  176. <!-- 审批弹窗 -->
  177. <CapprovalDia
  178. :isLook="isLookApproval"
  179. :approvalInfo="approvalInfo"
  180. :isApproval="isApproval"
  181. :title="approval_title"
  182. @cancelHandle="cancelHandle(3)"
  183. @approvalOver="approvalOver"
  184. ></CapprovalDia>
  185. <!-- 申请弹窗 -->
  186. <Capplydia
  187. :isApply="isApply"
  188. :title="applyTit"
  189. :formdata="applyForm"
  190. @cancelHandle="closeApply">
  191. </Capplydia>
  192. <!-- 申请转正、续约申请、补充协议选择申请合同模式弹窗 根据申请时类型跳过选择 -->
  193. <!-- <el-dialog
  194. :visible.sync="contractModel.show"
  195. :modal-append-to-body='false'
  196. width="670px"
  197. class="self-dialog"
  198. >
  199. <div style="text-align:center;margin:50px 0 100px 0">
  200. <img width="200" src="../../assets/img/cus_m/bzht.png" @click="handleContractModel('标准')" style="margin-right:50px;cursor: pointer;">
  201. <img width="200" src="../../assets/img/cus_m/fbzht.png" @click="handleContractModel('非标准')" style="cursor: pointer;">
  202. </div>
  203. </el-dialog> -->
  204. <!-- 申请转正、续约申请、补充协议标准合同模式下 合同信息弹窗 -->
  205. <ContractInfo
  206. :initData="contractDialog"
  207. @contractInfoDialogClose="contractInfoDialogClose"
  208. ></ContractInfo>
  209. </div>
  210. </template>
  211. <script>
  212. import CapprovalDia from './compontents/Capprovedialog.vue'
  213. import { customInterence } from '@/api/api.js'
  214. import Capplydia from './compontents/Capplydialog.vue'
  215. import ContractInfo from './compontents/ContractInfo.vue'
  216. export default {
  217. name:'',
  218. components: {CapprovalDia,Capplydia,ContractInfo},
  219. computed:{
  220. Role() {
  221. let role = localStorage.getItem('Role') || '';
  222. return role;
  223. },
  224. RoleType() {
  225. let type = localStorage.getItem('RoleType') || '';
  226. return type;
  227. },
  228. },
  229. data () {
  230. return {
  231. contractModel:{
  232. show:false,
  233. data:null,//客户信息(列表用户数据)
  234. type:'',//类型 申请转正、续约申请、补充协议
  235. },// 申请转正、续约申请、补充协议 选择合同类型弹窗
  236. contractDialog:{
  237. show:false,
  238. type:'',//类型 申请转正、续约申请、补充协议
  239. cusdata:null,//客户信息(列表用户数据)
  240. },//申请转正、续约申请、补充协议 合同信息弹窗
  241. search_txt:'',
  242. status:"待审批",
  243. statusArr:['全部','待审批','已审批'],
  244. tableData:[],
  245. isShowloadding:false,
  246. total:1,
  247. page_no:sessionStorage.getItem('approvalListBack')?JSON.parse(sessionStorage.getItem('approvalListBack')).page_no:1,
  248. pageSize:10,
  249. isRetract:false,//撤回弹窗
  250. revokeItem:'',//撤回的列信息
  251. isReject:false,//驳回弹窗
  252. rejectTxt:'',//驳回理由
  253. approvalInfo:{},//审批信息
  254. isApproval:false,//审批弹窗
  255. approval_title:'',//审批标题
  256. isApply:false,//申请弹窗
  257. applyTit:'',//申请标题
  258. applyForm:{},//申请信息
  259. isLookApproval:false,//是否查看审批信息
  260. };
  261. },
  262. /* 页面跳转前记录参数 */
  263. beforeRouteLeave(to, form, next) {
  264. let backData = {
  265. page_no:this.page_no,
  266. status:this.status,
  267. keyword:this.search_txt
  268. }
  269. sessionStorage.setItem('approvalListBack',JSON.stringify(backData))
  270. next()
  271. },
  272. /* 页面进入前是否清除参数 */
  273. beforeRouteEnter(to,from,next) {
  274. if(from.path!='/approvalUpdate'&&from.path!='/approvalTurn'&&from.path!='/updateCustom'&&from.path!='/customDetail'&&from.path!='/turnCustom') {
  275. sessionStorage.removeItem('approvalListBack')
  276. }
  277. next()
  278. },
  279. methods: {
  280. contractInfoDialogClose(){
  281. this.contractDialog={
  282. show:false,
  283. type:'',//类型 申请转正、续约申请、补充协议
  284. cusdata:null,//客户信息(列表用户数据)
  285. }
  286. },
  287. // 申请转正、续约申请、补充协议点击合同类型
  288. handleContractModel(e){
  289. this.contractModel.show=false
  290. if(e==='非标准'){
  291. if(this.contractModel.type==='申请转正'){
  292. sessionStorage.setItem('companyInfo',JSON.stringify(this.contractModel.data))
  293. this.$router.push({
  294. path:'/turnCustom',
  295. query:{
  296. isReapply:true
  297. }
  298. })
  299. }else if(this.contractModel.type==='续约申请'){
  300. sessionStorage.setItem('companyInfo',JSON.stringify(this.contractModel.data))
  301. this.$router.push({
  302. path:'/updateCustom',
  303. query:{
  304. isReapply:true
  305. }
  306. })
  307. }else if(this.contractModel.type==='补充协议'){
  308. sessionStorage.setItem('companyInfo',JSON.stringify(this.contractModel.data))
  309. this.$router.push({
  310. path:'/addAgreement',
  311. query:{
  312. isReapply:true
  313. }
  314. })
  315. }
  316. return
  317. }
  318. // 标准合同
  319. this.contractDialog.show=true
  320. this.contractDialog.type=this.contractModel.type
  321. this.contractDialog.cusdata=this.contractModel.data
  322. },
  323. //搜索
  324. handlSearch(){
  325. this.status='全部'
  326. this.page_no=1
  327. this.getTableData()
  328. },
  329. /* 获取表格数据 */
  330. getTableData() {
  331. this.isShowloadding = true;
  332. let status=''
  333. if(this.Role=='ficc_admin'||this.Role=='rai_admin'){
  334. status=this.status=='全部'?'':this.status
  335. }
  336. customInterence.approvalList({
  337. PageSize:this.pageSize,
  338. CurrentIndex:this.page_no,
  339. Status:status,
  340. KeyWord:this.search_txt
  341. }).then(res => {
  342. this.isShowloadding = false;
  343. if(res.Ret === 200) {
  344. res.Data.List&&res.Data.List.forEach(item => {
  345. item.StartDate = item.StartDate.replace(/-/g,'.');
  346. item.EndDate = item.EndDate.replace(/-/g,'.');
  347. item.FreezeStartDate = item.FreezeStartDate?item.FreezeStartDate.replace(/-/g,'.'):'';
  348. item.FreezeEndDate = item.FreezeEndDate?item.FreezeEndDate.replace(/-/g,'.'):'';
  349. })
  350. this.tableData = res.Data.List || [];
  351. this.total = res.Data.Paging.Totals;
  352. }
  353. })
  354. },
  355. /* 详情页 */
  356. goDetail(item) {
  357. this.$router.push({
  358. path:'/customDetail',
  359. query:{
  360. id:item.CompanyId
  361. }
  362. })
  363. },
  364. // 状态改变
  365. changeStatus() {
  366. this.page_no = 1;//当前页
  367. this.getTableData();
  368. },
  369. /* 页码改变 */
  370. handleCurrentChange(page) {
  371. this.page_no = page;
  372. this.getTableData();
  373. },
  374. /* 重新申请 */
  375. editHandle(item) {
  376. console.log(item);
  377. this.isRetract = false;
  378. /* 转正申请 */
  379. // ApplyContractType:申请合同类型 0 非标 1 标准
  380. if(item.ApplyMethod == 1) {
  381. this.contractModel={
  382. show:false,
  383. data:item,
  384. type:'申请转正'
  385. }
  386. if(item.ApplyContractType==0){
  387. this.handleContractModel('非标准')
  388. }else{
  389. this.handleContractModel('标准')
  390. }
  391. // sessionStorage.setItem('companyInfo',JSON.stringify(item));
  392. // this.$router.push({
  393. // path:'/turnCustom',
  394. // query:{
  395. // isReapply:true
  396. // }
  397. // })
  398. }else if(item.ApplyMethod == 2 || item.ApplyMethod == 3 || item.ApplyMethod == 4) {
  399. this.applyForm = item;
  400. this.applyTit = item.ApplyMethod == 2?'申请解冻':item.ApplyMethod == 3?'申请延期':'申请领取';
  401. this.isApply = true;
  402. /* 续约申请 */
  403. }else if(item.ApplyMethod == 5) {
  404. this.contractModel={
  405. show:false,
  406. data:item,
  407. type:'续约申请'
  408. }
  409. if(item.ApplyContractType==0){
  410. this.handleContractModel('非标准')
  411. }else{
  412. this.handleContractModel('标准')
  413. }
  414. // sessionStorage.setItem('companyInfo',JSON.stringify(item));
  415. // this.$router.push({
  416. // path:'/updateCustom',
  417. // query:{
  418. // isReapply:true
  419. // }
  420. // })
  421. }else if(item.ApplyMethod == 6){
  422. this.contractModel={
  423. show:false,
  424. data:item,
  425. type:'补充协议'
  426. }
  427. if(item.ApplyContractType==0){
  428. this.handleContractModel('非标准')
  429. }else{
  430. this.handleContractModel('标准')
  431. }
  432. }
  433. },
  434. /* 删除 */
  435. delHandle(item) {
  436. this.$confirm('确定删除该条审批单吗?','提示',{
  437. type:'warning'
  438. }).then(() => {
  439. customInterence.approvalDel({
  440. CompanyApprovalId:item.CompanyApprovalId,
  441. CompanyId:item.CompanyId
  442. }).then(res => {
  443. if(res.Ret === 200) {
  444. this.$message.success(res.Msg)
  445. let index = this.tableData.indexOf(item);
  446. this.tableData.splice(index,1)
  447. }
  448. })
  449. }).catch(() => {});
  450. },
  451. /* 撤回 */
  452. retractHandle(item) {
  453. this.revokeItem = item;
  454. customInterence.Revoke({
  455. CompanyId:item.CompanyId
  456. }).then(res => {
  457. this.isRetract = true;
  458. this.getTableData();
  459. })
  460. },
  461. /* 驳回理由弹窗 */
  462. openHandle(item) {
  463. this.rejectTxt = item.ApproveRemark;
  464. this.isReject = true;
  465. },
  466. /* 审批*/
  467. openApproval(item) {
  468. /* 转正审批 */
  469. if(item.ApplyMethod == 1) {
  470. sessionStorage.setItem('companyInfo',JSON.stringify(item));
  471. this.$router.push({
  472. path:'/approvalTurn',
  473. query:{
  474. id:item.CompanyId,
  475. contractId:item.CompanyContractId
  476. }
  477. })
  478. }else if(item.ApplyMethod == 2 || item.ApplyMethod == 3 || item.ApplyMethod == 4) {//item.ApprovalCount
  479. this.approvalInfo = item;
  480. this.approval_title = item.ApplyMethod == 2?'解冻审批':item.ApplyMethod == 3?'延期审批':'领取审批';
  481. let str=item.ApprovalCount>0?`(第${item.ApprovalCount}次申请)`:''
  482. this.approval_title=this.approval_title+str
  483. this.isLookApproval = false;
  484. this.isApproval = true;
  485. }else if(item.ApplyMethod == 5||item.ApplyMethod==6) { // 续约审批
  486. sessionStorage.setItem('companyInfo',JSON.stringify(item));
  487. this.$router.push({
  488. path:'/approvalUpdate',
  489. query:{
  490. id:item.CompanyId,
  491. contractId:item.CompanyContractId,
  492. ApplyMethod:item.ApplyMethod
  493. }
  494. })
  495. }
  496. },
  497. /* 查看审批信息 */
  498. openApprovalDtl(item) {
  499. /* 转正审批 */
  500. if(item.ApplyMethod == 1) {
  501. sessionStorage.setItem('companyInfo',JSON.stringify(item));
  502. this.$router.push({
  503. path:'/approvalTurn',
  504. query:{
  505. id:item.CompanyId,
  506. contractId:item.CompanyContractId,
  507. isLook:true
  508. }
  509. })
  510. }else if(item.ApplyMethod == 2 || item.ApplyMethod == 3 || item.ApplyMethod == 4) {
  511. this.approvalInfo = item;
  512. // this.approval_title = item.ApplyMethod == 2?'解冻审批':item.ApplyMethod == 3?'延期审批'+(item.ApprovalCount!=0?'(第'+item.ApprovalCount+'次申请)':''):'领取审批';
  513. this.approval_title = item.ApplyMethod == 2?'解冻审批':item.ApplyMethod == 3?'延期审批':'领取审批';
  514. let str=item.ApprovalCount>0?`(第${item.ApprovalCount}次申请)`:''
  515. this.approval_title=this.approval_title+str
  516. this.isLookApproval = true;
  517. this.isApproval = true;
  518. }else if(item.ApplyMethod == 5) { // 续约审批
  519. sessionStorage.setItem('companyInfo',JSON.stringify(item));
  520. this.$router.push({
  521. path:'/approvalUpdate',
  522. query:{
  523. id:item.CompanyId,
  524. contractId:item.CompanyContractId,
  525. isLook:true
  526. }
  527. })
  528. }
  529. },
  530. /* 审批完成 */
  531. approvalOver() {
  532. this.isApproval = false;
  533. this.getTableData();
  534. },
  535. /* 取消 */
  536. cancelHandle(type) {
  537. if(type === 1) {
  538. this.isRetract = false
  539. }else if(type === 2) {
  540. this.isReject = false
  541. }else if(type === 3) {
  542. this.isApproval = false
  543. }
  544. },
  545. /* 关闭重新申请弹窗 */
  546. closeApply(type) {
  547. this.isApply = false;
  548. if(type == 1) {
  549. this.getTableData();
  550. }
  551. }
  552. },
  553. created() {
  554. },
  555. mounted() {
  556. if(sessionStorage.getItem('approvalListBack')) {
  557. let backData = JSON.parse(sessionStorage.getItem('approvalListBack'));
  558. this.search_txt = backData.keyword;
  559. this.page_no = backData.page_no,
  560. this.status = backData.status
  561. }
  562. this.getTableData();
  563. },
  564. }
  565. </script>
  566. <style lang='scss'>
  567. .self-dialog {
  568. width: 100%;
  569. }
  570. .approvalList_container {
  571. .appro_dialog .el-dialog__header{
  572. background: #fff !important;
  573. }
  574. .appro_dialog .el-dialog__title {
  575. color: #333 !important;
  576. }
  577. .appro_dialog .el-dialog__close {
  578. color: #909399 !important;
  579. }
  580. .approvalList_top {
  581. display: flex;
  582. justify-content:flex-end;
  583. align-items: center;
  584. border: 1px solid #ECECEC;
  585. padding: 20px 30px;
  586. background: #fff;
  587. border-radius: 4px;
  588. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  589. }
  590. .approvalList_cont {
  591. min-height: calc(100vh - 260px);
  592. padding: 20px 30px 80px;
  593. background: #fff;
  594. margin-top: 20px;
  595. position: relative;
  596. border: 1px solid #ECECEC;
  597. border-radius: 4px;
  598. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  599. }
  600. }
  601. </style>