approvalList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. <template>
  2. <div class="seal-approval-wrap">
  3. <div class="content">
  4. <div class="select-wrap" style="margin-bottom:30px">
  5. <el-select v-model="belongCompany" placeholder="请选择归属公司" @change="handleSelectChange" clearable style="margin-right:20px">
  6. <el-option
  7. v-for="item in belongCompanyOption"
  8. :key="item"
  9. :label="item"
  10. :value="item">
  11. </el-option>
  12. </el-select>
  13. <el-select v-model="contractTypeVal" placeholder="合同类型" @change="handleSelectChange" clearable style="margin-right:20px">
  14. <el-option
  15. v-for="item in contractTypeList"
  16. :key="item"
  17. :label="item"
  18. :value="item">
  19. </el-option>
  20. </el-select>
  21. <el-select v-model="sealStatusVal" placeholder="用印状态" @change="handleSelectChange" clearable style="margin-right:20px">
  22. <el-option
  23. v-for="item in sealStatusList"
  24. :key="item"
  25. :label="item"
  26. :value="item">
  27. </el-option>
  28. </el-select>
  29. <el-cascader
  30. v-if="RoleType!='ficc_seller'&&RoleType!='rai_seller'"
  31. v-model="seller"
  32. placeholder="申请销售"
  33. style="min-width:250px;margin-bottom: 20px;margin-right:20px"
  34. :options="sellerList"
  35. :props="defaultSalesProps"
  36. :show-all-levels="false"
  37. collapse-tags
  38. clearable
  39. filterable
  40. @change="handleSelectChange">
  41. </el-cascader>
  42. <el-date-picker
  43. v-model="time"
  44. type="daterange"
  45. range-separator="至"
  46. value-format="yyyy-MM-dd"
  47. start-placeholder="开始日期"
  48. end-placeholder="结束日期"
  49. @change="handleSelectChange"
  50. style="margin-right:20px">
  51. </el-date-picker>
  52. <el-input
  53. placeholder="客户名称/社会信用码"
  54. prefix-icon="el-icon-search"
  55. v-model="searchVal"
  56. style="display:inline-block;width:300px"
  57. clearable
  58. @input="handleSearch">
  59. </el-input>
  60. <div style="float:right" >
  61. <el-button
  62. type="primary"
  63. @click="$router.push('/addSeal')"
  64. v-if="['ficc_seller','rai_seller','compliance'].includes(RoleType)"
  65. >添加用印</el-button>
  66. <a :href="exportUrl" download v-if="['admin','ficc_admin','compliance'].includes(RoleType)">
  67. <el-button type="primary">导出</el-button>
  68. </a>
  69. </div>
  70. </div>
  71. <div class="list-wrap">
  72. <el-table :data="tableList" border>
  73. <el-table-column align="center" prop="CompanyName" label="归属公司">
  74. <template slot-scope="scope">
  75. <span>{{scope.row.AffiliatedCompany}}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column align="center" prop="CompanyName" label="客户名称">
  79. <template slot-scope="scope">
  80. <span>{{scope.row.CompanyName}}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column align="center" prop="CreditCode" label="社会信用码"></el-table-column>
  84. <el-table-column align="center" prop="Use" label="用印用途" width="120px"></el-table-column>
  85. <el-table-column align="center" prop="ContractCode" label="合同编号" width="180px"></el-table-column>
  86. <el-table-column align="center" prop="ContractType" label="合同类型" width="100px"></el-table-column>
  87. <el-table-column align="center" prop="SealType" label="加盖印章"></el-table-column>
  88. <el-table-column align="center" prop="ApplyUserName" label="所属销售" width="100px"></el-table-column>
  89. <el-table-column align="center" prop="CreateTimeStr" label="提交时间" width="150px">
  90. <template slot-scope="scope">
  91. <span>{{scope.row.CreateTimeStr|formatTime}}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="center" prop="Status" label="用印状态" width="100px"></el-table-column>
  95. <el-table-column align="center" label="操作">
  96. <template slot-scope="scope">
  97. <span class="btn" @click="handleDetail(scope.row)" v-if="scope.row.Status!='已撤回'&&!scope.row.OpButton.Approval">审批详情</span>
  98. <span class="btn" v-if="scope.row.OpButton.Cancel" @click="handleOpt('back',scope.row)">撤回</span>
  99. <span class="btn" v-if="scope.row.OpButton.Edit" @click="$router.push('/editSeal?id='+scope.row.SealId)">编辑重提</span>
  100. <span class="btn" style="color:#FF4040" v-if="scope.row.Status=='已撤回'&&scope.row.ApplyUserId==userId" @click="handleOpt('delete',scope.row)">删除</span>
  101. <span class="btn" v-if="scope.row.OpButton.Invalid" @click="handleOpt('invalid',scope.row)">用印作废</span>
  102. <span class="btn" v-if="scope.row.CheckBackFileUrl" @click="handlePreFile(scope.row)">查看附件</span>
  103. <span class="btn" v-if="scope.row.OpButton.Approval&&scope.row.Status=='待审批'" @click="handleDetail(scope.row)">审批</span>
  104. <span class="btn" v-if="scope.row.OpButton.UploadFile" @click="handleShowUploadAttachment(scope.row)">{{scope.row.CheckBackFileUrl?'更新附件':'签回附件'}}</span>
  105. </template>
  106. </el-table-column>
  107. <div slot="empty" style="padding:100px 0">暂无数据</div>
  108. </el-table>
  109. <el-pagination
  110. layout="total,prev,pager,next,jumper"
  111. background
  112. :current-page="page"
  113. @current-change="handlePageChange"
  114. :page-size="pageSize"
  115. :total="total"
  116. class="pagination-wrap">
  117. </el-pagination>
  118. </div>
  119. <!-- 审批弹窗 -->
  120. <el-dialog
  121. width="58%"
  122. top="5vh"
  123. v-dialogDrag
  124. :visible.sync="showDetail"
  125. :modal-append-to-body="false"
  126. :append-to-body="true"
  127. @close="showDetail=false">
  128. <div slot="title" v-if="detail">
  129. <span>{{detail.OpButton.Approval?'审批':'审批详情'}}</span>
  130. </div>
  131. <div class="detail-wrap" v-if="detail">
  132. <div class="main" v-if="detail.OpButton">
  133. <table class="table-wrap" >
  134. <tbody>
  135. <tr>
  136. <td class="table-item width-50">所属公司:{{detail.SealDetail.AffiliatedCompany}}</td>
  137. <td class="table-item width-50">
  138. <p v-if="detail.OpButton.CheckEdit">
  139. <span>用印用途:</span>
  140. <el-select v-model="approvalEditData.Use" placeholder="请选择">
  141. <el-option label="销售合同" value="销售合同"></el-option>
  142. <el-option label="代付合同" value="代付合同"></el-option>
  143. <el-option label="总对总协议" value="总对总协议"></el-option>
  144. <el-option label="渠道合同" value="渠道合同"></el-option>
  145. <el-option label="付款通知函" value="付款通知函"></el-option>
  146. <el-option label="招投标" value="招投标"></el-option>
  147. <el-option label="战略合作协议" value="战略合作协议"></el-option>
  148. </el-select>
  149. </p>
  150. <p v-else>用印用途:{{detail.SealDetail.Use}}</p>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td class="table-item width-50">所属销售:{{detail.SealDetail.UserName}}</td>
  155. <td class="table-item width-50">客户名称:{{detail.SealDetail.CompanyName}}</td>
  156. </tr>
  157. <tr>
  158. <td class="table-item width-50">社会信用码:{{detail.SealDetail.CreditCode}}</td>
  159. <td class="table-item width-50">合同类型:{{detail.SealDetail.ServiceType}}</td>
  160. </tr>
  161. <tr>
  162. <td class="table-item width-50">
  163. <p v-if="detail.OpButton.CheckEdit">
  164. <span>文件份数:</span>
  165. <!-- <el-input type="number" v-model="approvalEditData.FileNum"></el-input> -->
  166. <el-input-number :min="1" v-model="approvalEditData.FileNum"></el-input-number>
  167. </p>
  168. <p v-else>文件份数:{{detail.SealDetail.FileNum}}</p>
  169. </td>
  170. <td class="table-item">
  171. <p v-if="detail.OpButton.CheckEdit">
  172. <span>加盖印章:</span>
  173. <el-select v-model="approvalEditData.Type" collapse-tags multiple placeholder="请选择">
  174. <el-option label="合同章" value="合同章"></el-option>
  175. <el-option label="公章" value="公章"></el-option>
  176. <el-option label="法人章" value="法人章"></el-option>
  177. <el-option label="电子合同章" value="电子合同章"></el-option>
  178. </el-select>
  179. </p>
  180. <p v-else>加盖印章:{{detail.SealDetail.SealType}}</p>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td class="table-item" colspan="2">实际使用方:{{detail.SealDetail.UseCompanyName||detail.SealDetail.CompanyName}}</td>
  185. </tr>
  186. <tr>
  187. <td class="table-item" colspan="2" style="text-align: left">
  188. <p v-if="detail.OpButton.CheckEdit" style="display:flex">
  189. <span>审批备注:</span>
  190. <el-input type="textarea" placeholder="请填写备注" v-model="approvalEditData.Remark" style="flex:1"></el-input>
  191. </p>
  192. <p v-else>审批备注:{{detail.SealDetail.Remark}}</p>
  193. </td>
  194. </tr>
  195. </tbody>
  196. </table>
  197. <!-- 审批流程 -->
  198. <div class="process-box" style="margin-top:30px">
  199. <h2>审批流程:</h2>
  200. <div class="approval-step-wrap">
  201. <div v-for="(step,index) in stepArr" :key="index" class="step-item">
  202. <span class="title" v-if="step.stepName">{{step.stepName}}:</span>
  203. <div v-if="step.stepName" class="user-box">
  204. <span>审批人:</span>
  205. <span v-for="user in step.allUser" :key="user.ApproveUserName">{{user.ApproveUserName}}</span>
  206. <p></p>
  207. </div>
  208. <div v-else class="user-box">
  209. <span>抄送人:</span>
  210. <span v-for="user in step.allUser" :key="user.ApproveUserName">{{user.ApproveUserName}}</span>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. <div class="dashed-line" v-if="detail.OpButton.Approval"></div>
  216. <el-form ref="form" :model="form" :rules="formRule" label-width="100px" label-position="left" v-if="detail.OpButton.Approval">
  217. <el-form-item prop="status" label="审批状态">
  218. <el-radio-group v-model="form.status" @change="approvalFromStatusChange">
  219. <el-radio label="通过"></el-radio>
  220. <el-radio label="驳回"></el-radio>
  221. </el-radio-group>
  222. </el-form-item>
  223. <el-form-item prop="reason" label="驳回理由" v-if="form.status === '驳回'">
  224. <el-input v-model="form.reason" placeholder="请输入理由" type="textarea"></el-input>
  225. </el-form-item>
  226. </el-form>
  227. </div>
  228. <div class="right">
  229. <el-button type="primary" style="width: 100%" @click="handlePreContractFile(detail.SealDetail.FileUrls)">预览合同</el-button>
  230. <div class="contract-origin">合同来源:{{detail.SealDetail.ContractId == 0?'上传附件':'系统合同'}}</div>
  231. <div class="timeline-wrap">
  232. <el-timeline>
  233. <el-timeline-item
  234. color="#409EFF"
  235. v-for="item in optList"
  236. :key="item.Id"
  237. placement="top"
  238. :timestamp="item.CreateTimeStr"
  239. >
  240. {{ item.OpUserName }}{{ item.Remark }}
  241. <span
  242. style="color:#409EFF;cursor: pointer;display:inline-block"
  243. v-if="item.Operation=='reject'"
  244. @click="handleShowRejectReason(item)"
  245. >驳回理由</span>
  246. </el-timeline-item>
  247. </el-timeline>
  248. </div>
  249. </div>
  250. </div>
  251. <div style="text-align: center; margin-bottom: 40px; margin-top: 40px" v-if="detail">
  252. <block v-if="detail.OpButton.Approval">
  253. <el-button type="primary" style="margin-right: 24px" plain @click="showDetail=false">取消</el-button>
  254. <el-button type="primary" @click="handleConfirmApproval">确定</el-button>
  255. </block>
  256. <block v-else><el-button type="primary" @click="showDetail=false">知道了</el-button></block>
  257. </div>
  258. <!-- 预览合同附件弹窗 当附件大于1个时显示 -->
  259. <el-dialog title="请选择附件" :visible.sync="showAttachment" @close = "showAttachment=false"
  260. :close-on-click-modal='false' :append-to-body="true" >
  261. <div class="attachment-contain" style="min-height: 240px;">
  262. <el-image v-for="item in attachmentUrls" :key="item"
  263. :src="fileTypeIcon(item)"
  264. @click="viewAttachment(item)"
  265. class="attachment-image"></el-image>
  266. </div>
  267. </el-dialog>
  268. </el-dialog>
  269. <!-- 上传\更新 附件 -->
  270. <el-dialog
  271. top="30vh"
  272. v-dialogDrag
  273. width="570px"
  274. :visible.sync="showUploadAttachment"
  275. :modal-append-to-body="false"
  276. @close="showUploadAttachment=false"
  277. >
  278. <div slot="title">
  279. <img width='15' src="../../assets/img/icons/edit1.png" alt="" v-if="fileData.type==2">
  280. <img width="15" src="../../assets/img/icons/up.png" alt="" v-else>
  281. <span style="display:inline-block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:450px">{{fileData.title}}</span>
  282. </div>
  283. <div class="upload-attachment-wrap">
  284. <div style="display:flex;align-items: center;">
  285. <div class="box">
  286. <span :style="{color:fileData.name?'':'#999'}">{{!fileData.name?'请选择文件':fileData.name}}</span>
  287. </div>
  288. <el-upload :before-upload="checkFileBeforeUpload">
  289. <el-button type="primary">选择文件</el-button>
  290. </el-upload>
  291. </div>
  292. <div style="text-align:center;margin:60px 0 30px 0">
  293. <el-button type="primary" @click="handleConfirmAttachment">确定</el-button>
  294. <el-button type="primary" plain @click="showUploadAttachment=false">取消</el-button>
  295. </div>
  296. </div>
  297. </el-dialog>
  298. </div>
  299. </div>
  300. </template>
  301. <script>
  302. import {contractInterface,sealInterence} from "@/api/api.js";
  303. export default {
  304. watch:{
  305. showDetail(nval){// 弹窗关闭清除弹窗的值
  306. if(!nval){
  307. this.detail=null
  308. this.optList=[]
  309. this.stepArr=[]
  310. this.approvalEditData={
  311. Use:'',//用印用途
  312. Type:'',//加盖印章 类型
  313. FileNum:'',//文件份数
  314. Remark:'',//备注
  315. }
  316. this.form={
  317. status: "通过",
  318. reason: "",
  319. }
  320. }
  321. },
  322. showUploadAttachment(nval){//上传附件弹窗关闭清除值
  323. if(!nval){
  324. this.fileData={
  325. type:0,//1 上传附件 2 更新附件
  326. title:"",
  327. name:"",
  328. file:null,
  329. sealId:0,
  330. }
  331. }
  332. }
  333. },
  334. computed: {
  335. exportUrl() {
  336. let auth = localStorage.getItem("auth") || "";
  337. let salesArr=[]
  338. if(this.seller.length){
  339. salesArr=this.seller.map(item=>{
  340. return item[item.length-1]
  341. })
  342. }
  343. return `${process.env.API_ROOT}/seal/getApprovalPageList?IsExport=true&${auth}&PageSize=${this.pageSize}&CurrentIndex=${this.page}&ContractType=${this.contractTypeVal}&Status=${this.sealStatusVal}&SellerId=${salesArr.join(',')}&StartTime=${this.time&&this.time[0]||''}&EndTime=${this.time&&this.time[1]||''}&Keyword=${this.searchVal}&AffiliatedCompany=${this.belongCompany}`
  344. }
  345. },
  346. data () {
  347. return {
  348. RoleType:localStorage.getItem('Role')||'',
  349. userId:localStorage.getItem('AdminId'),
  350. contractTypeList:['新签合同','续约合同','补充协议','代付合同'],
  351. contractTypeVal:'',
  352. sealStatusList:['待审批','待提交','已撤回','处理中','已审批','已驳回','已签回','已作废'],
  353. sealStatusVal:'',
  354. time:['',''],
  355. searchVal:'',
  356. tableList:[],
  357. page:1,
  358. pageSize:10,
  359. total:0,
  360. sellerList: [], //申请销售列表
  361. seller: "", //选择的申请销售
  362. defaultSalesProps:{
  363. multiple: true,
  364. label:'RealName',
  365. children:'ChildrenList',
  366. value:'AdminId'
  367. },//销售级联配置
  368. detail:null,
  369. showDetail:false,
  370. optList:[],
  371. stepArr:[],//审批流程数据
  372. approvalEditData:{
  373. Use:'',//用印用途
  374. Type:'',//加盖印章 类型
  375. FileNum:'',//文件份数
  376. Remark:'',//备注
  377. },
  378. form: {
  379. status: "通过",
  380. reason: "",
  381. },
  382. formRule: {
  383. status: [{ required: true, message: "请选择状态", trigger: "change" }],
  384. reason: [{ required: true, message: "请填写驳回理由", trigger: "blur" }],
  385. },
  386. showUploadAttachment:false,//显示上传(更新附件)
  387. fileData:{
  388. type:0,//1 上传附件 2 更新附件
  389. title:"",
  390. name:"",
  391. file:null,
  392. sealId:0,
  393. },//上传/更新附件文件数据
  394. showAttachment:false,// 是否显示预览附件弹窗
  395. attachmentUrls:[],// 附件列表
  396. belongCompany: '',//归属公司
  397. belongCompanyOption: []
  398. }
  399. },
  400. created () {
  401. this.getSellerList();
  402. this.getSealApprovalList()
  403. this.getBelongCompanyOptions()
  404. if(['ficc_seller','rai_seller'].includes(this.RoleType)){
  405. this.sealStatusList=['待审批','已撤回','处理中','已审批','已驳回','已签回','已作废']
  406. }else{
  407. this.sealStatusList=['待审批','处理中','已审批','已驳回','已签回','已作废']
  408. }
  409. },
  410. methods: {
  411. async getBelongCompanyOptions() {
  412. const res = await sealInterence.getBelongCompany()
  413. if(res.Ret !==200 ) return
  414. this.belongCompanyOption = res.Data || []
  415. },
  416. //获取所属销售列表
  417. getSellerList() {
  418. contractInterface.getSellerList().then((res) => {
  419. if (res.Ret === 200) {
  420. this.sellerList = res.Data.List;
  421. }
  422. });
  423. },
  424. async getSealApprovalList(){
  425. let salesArr=[]
  426. if(this.seller.length){
  427. salesArr=this.seller.map(item=>{
  428. return item[item.length-1]
  429. })
  430. }
  431. const res=await sealInterence.getSealApprovalList({
  432. PageSize:this.pageSize,
  433. CurrentIndex:this.page,
  434. ContractType:this.contractTypeVal,
  435. Status:this.sealStatusVal,
  436. SellerId:salesArr.join(','),
  437. StartTime:this.time&&this.time[0]||'',
  438. EndTime:this.time&&this.time[1]||'',
  439. Keyword:this.searchVal,
  440. AffiliatedCompany: this.belongCompany
  441. })
  442. if(res.Ret===200){
  443. this.tableList=res.Data.List
  444. this.total=res.Data.Paging.Totals
  445. }
  446. },
  447. handleSelectChange(){
  448. this.searchVal=''
  449. this.getSealApprovalList()
  450. },
  451. handleSearch(){
  452. this.contractTypeVal=''
  453. this.sealStatusVal=''
  454. this.time=['','']
  455. this.seller=''
  456. this.getSealApprovalList()
  457. },
  458. handlePageChange(e){
  459. this.page = e
  460. this.getSealApprovalList()
  461. },
  462. async handleDetail(e){
  463. this.getSealOprationList(e.SealId)
  464. const res=await sealInterence.getSealDetail({SealId:e.SealId})
  465. if(res.Ret==200){
  466. this.showDetail=true
  467. this.detail=res.Data
  468. this.approvalEditData.Use=res.Data.SealDetail.Use
  469. this.approvalEditData.Type=res.Data.SealDetail.SealType.split(',')
  470. this.approvalEditData.FileNum=res.Data.SealDetail.FileNum
  471. this.approvalEditData.Remark=res.Data.SealDetail.Remark
  472. this.handleStepArr()
  473. }
  474. },
  475. // 处理审批流程节点
  476. handleStepArr(){
  477. let arr=[]
  478. let count=0
  479. arr=this.detail.FlowNodeList&&this.detail.FlowNodeList.map(item=>{
  480. item[0].NodeType==='check'&&count++
  481. let stepCon={
  482. name:item[0].NodeType==='check'?'审批人':'抄送人',//审批节点标题
  483. intro:'',//描述
  484. user:item.slice(0,2),//审批节点人列表
  485. allUser:item,
  486. approve:[],//审批人信息{name:'',time:""}
  487. auditType:1,
  488. stepName:''
  489. }
  490. if(item[0].NodeType==='check'){
  491. if(item[0].AuditType===1){
  492. stepCon.intro=item.length>1?item.length+'人或签':''
  493. stepCon.auditType=1
  494. }else if(item[0].AuditType===2){
  495. stepCon.intro=item.length>1?item.length+'人会签':''
  496. stepCon.auditType=2
  497. }
  498. item.forEach(item2=>{
  499. if(item2.Status!=='待审批'&&item2.Status!=='已撤回'){
  500. let time=''
  501. if(item2.Status==='已驳回'){
  502. time=`驳回时间:${item2.ApproveTime}`
  503. }else {
  504. time=`审批时间:${item2.ApproveTime}`
  505. }
  506. let obj={name:item2.ApproveUserName,time:time}
  507. stepCon.approve.push(obj)
  508. }
  509. })
  510. }
  511. if(item[0].NodeType==='cc'){
  512. stepCon.intro='抄送'+item.length+'人'
  513. }
  514. return stepCon
  515. })
  516. // 处理审批节点标题描述 若有多级审批 则 为 一级审批 二级审批 若只有一级 则 不变
  517. // if(count>1){
  518. let tag=0
  519. arr.forEach(item=>{
  520. if(item.name==='审批人'){
  521. tag++
  522. switch (tag) {
  523. case 1:
  524. item.stepName='一级审批'
  525. break;
  526. case 2:
  527. item.stepName='二级审批'
  528. break;
  529. case 3:
  530. item.stepName='三级审批'
  531. break;
  532. }
  533. }
  534. })
  535. // }
  536. this.stepArr=arr
  537. },
  538. // 获取操作记录
  539. async getSealOprationList(id){
  540. const res=await sealInterence.getSealOperationList({SealId:id})
  541. if(res.Ret===200){
  542. this.optList=res.Data.List
  543. }
  544. },
  545. // 预览合同
  546. handlePreContractFile(urls){
  547. if(urls.length ==0) return
  548. if(urls.length==1){
  549. this.viewAttachment(urls[0])
  550. }else{
  551. this.attachmentUrls = urls
  552. this.showAttachment = true
  553. }
  554. },
  555. // 根据文件返回文件图标
  556. fileTypeIcon(url) {
  557. if (!url) return "";
  558. const fileType = this.fileType(url);
  559. return fileType === "word"
  560. ? require("@/assets/img/constract/word-icon.png")
  561. : require("@/assets/img/constract/pdf.png");
  562. },
  563. // 根据fileUrl判断文件类型
  564. fileType(fileUrl) {
  565. if (/^.+(\.pdf)$/i.test(fileUrl)) {
  566. return "pdf";
  567. } else if (/^.+(\.doc|\.docx)$/i.test(fileUrl)) {
  568. return "word";
  569. } else {
  570. return "other";
  571. }
  572. },
  573. // 预览合同附件
  574. viewAttachment(url){
  575. const reg = /\.(pdf)$/;
  576. // pdf
  577. if(reg.test(url)){
  578. window.open(url,'_blank');
  579. }else{
  580. window.open('https://view.officeapps.live.com/op/view.aspx?src='+url,'_blank');
  581. }
  582. },
  583. // 审批弹窗审批状态切换
  584. approvalFromStatusChange(){
  585. if(this.form.status==='驳回'){
  586. let top=$('.detail-wrap')[0].offsetTop
  587. $('.detail-wrap').animate({
  588. "scrollTop": top+1000
  589. })
  590. }
  591. },
  592. handleConfirmApproval(){
  593. this.$refs.form.validate((valid)=>{
  594. if (valid){
  595. if(this.form.status=='通过'){
  596. //判断是否有内容修改
  597. const flag1=this.approvalEditData.Use===this.detail.SealDetail.Use
  598. const flag2=Number(this.approvalEditData.FileNum)===Number(this.detail.SealDetail.FileNum)
  599. const flag3=this.approvalEditData.Type.join(',')===this.detail.SealDetail.SealType
  600. const flag4=this.approvalEditData.Remark===this.detail.SealDetail.Remark
  601. if(flag1&&flag2&&flag3&&flag4){
  602. this.handleApprovalPass()
  603. }else{
  604. this.handleApprovePassModify()
  605. }
  606. }else{
  607. this.handleApprvoalReject()
  608. }
  609. }
  610. })
  611. },
  612. // 通过审批
  613. async handleApprovalPass(){
  614. const res=await sealInterence.sealApprovalPass({
  615. SealId:this.detail.SealDetail.SealId
  616. })
  617. if(res.Ret==200){
  618. this.$message.success('审批成功')
  619. this.showDetail=false
  620. setTimeout(() => {
  621. this.getSealApprovalList()
  622. }, 300);
  623. }
  624. },
  625. // 审批人修改后通过审批
  626. async handleApprovePassModify(){
  627. const res=await sealInterence.sealApprovalPassModify({
  628. CompanyName:this.detail.SealDetail.CompanyName,
  629. ContractId:this.detail.SealDetail.ContractId,
  630. CreditCode:this.detail.SealDetail.CreditCode,
  631. FileUrls:this.detail.SealDetail.FileUrls,
  632. SealId:this.detail.SealDetail.SealId,
  633. ServiceType:this.detail.SealDetail.ServiceType,
  634. UseCompanyName:this.detail.SealDetail.UseCompanyName,
  635. FileNum:Number(this.approvalEditData.FileNum),
  636. Remark:this.approvalEditData.Remark,
  637. SealType:this.approvalEditData.Type.join(','),
  638. Use:this.approvalEditData.Use,
  639. })
  640. if(res.Ret==200){
  641. this.$message.success('审批成功')
  642. this.showDetail=false
  643. setTimeout(() => {
  644. this.getSealApprovalList()
  645. }, 300);
  646. }
  647. },
  648. // 申请驳回
  649. async handleApprvoalReject(){
  650. const res=await sealInterence.sealApprovalReject({
  651. SealId:this.detail.SealDetail.SealId,
  652. Remark:this.form.reason
  653. })
  654. if(res.Ret==200){
  655. this.$message.success('操作成功')
  656. this.showDetail=false
  657. setTimeout(() => {
  658. this.getSealApprovalList()
  659. }, 300);
  660. }
  661. },
  662. // 操作
  663. // 删除-delete 撤回-back 作废-invalid
  664. handleOpt(e,data){
  665. if(e=='delete'){
  666. this.$confirm("确定删除该用印申请吗?", "提示", {
  667. confirmButtonText: "确定",
  668. cancelButtonText: "取消",
  669. type: "warning",
  670. }).then(() => {
  671. sealInterence.sealDelete({ SealId: data.SealId }).then((res) => {
  672. if (res.Ret === 200) {
  673. this.$message.success("删除成功");
  674. this.getSealApprovalList()
  675. }
  676. });
  677. });
  678. }
  679. if(e=='back'){
  680. this.$confirm("确定撤回该用印申请吗?", "提示", {
  681. confirmButtonText: "确定",
  682. cancelButtonText: "取消",
  683. type: "warning",
  684. }).then(() => {
  685. sealInterence.sealApprovalBack({ SealId: data.SealId }).then((res) => {
  686. if (res.Ret === 200) {
  687. this.$message.success("撤回成功");
  688. this.getSealApprovalList()
  689. }
  690. });
  691. });
  692. }
  693. if(e=='invalid'){
  694. this.$confirm("确定作废该用印申请吗?", "提示", {
  695. confirmButtonText: "确定",
  696. cancelButtonText: "取消",
  697. type: "warning",
  698. }).then(() => {
  699. sealInterence.sealInvalid({ SealId: data.SealId }).then((res) => {
  700. if (res.Ret === 200) {
  701. this.$message.success("撤回成功");
  702. this.getSealApprovalList()
  703. }
  704. });
  705. });
  706. }
  707. },
  708. // 显示驳回理由
  709. handleShowRejectReason(e){
  710. this.$confirm(e.ApprovalRemark, '驳回理由', {
  711. confirmButtonText: '知道了',
  712. showCancelButton:false,
  713. type: 'info '
  714. })
  715. },
  716. //选择文件
  717. checkFileBeforeUpload(file){
  718. let hostfile = file;
  719. let size = Math.floor(hostfile.size / 1024 / 1024);
  720. if (size > 200) {
  721. this.$message.warning("上传文件大小不能大于200M!");
  722. hostfile = {};
  723. return false;
  724. }
  725. if (hostfile.name.toLowerCase().includes(".pdf")||hostfile.name.toLowerCase().includes(".doc")||hostfile.name.toLowerCase().includes(".docx")) {
  726. this.fileData.file=hostfile
  727. this.fileData.name=hostfile.name.toLowerCase()
  728. } else {
  729. this.$message.warning("请上传PDF/word文件!");
  730. }
  731. return false
  732. },
  733. // 显示上传签回弹窗
  734. handleShowUploadAttachment(e){
  735. this.fileData.sealId=e.SealId
  736. if(e.CheckBackFileUrl){
  737. this.fileData.type=2
  738. this.fileData.title=`更新签回附件(${e.CompanyName})`
  739. this.fileData.name=e.CheckBackFileUrl.substring(e.CheckBackFileUrl.lastIndexOf('/') + 1)
  740. }else{
  741. this.fileData.type=1
  742. this.fileData.title=`上传签回附件(${e.CompanyName})`
  743. }
  744. this.showUploadAttachment=true
  745. },
  746. // 提交上传/更新签回附件
  747. async handleConfirmAttachment(){
  748. if(!this.fileData.file){
  749. this.$message.warning('请选择文件')
  750. return
  751. }
  752. let form = new FormData();
  753. form.append("file", this.fileData.file)
  754. form.append('SealId',this.fileData.sealId)
  755. const res=await sealInterence.sealCheckFileUpload(form)
  756. if(res.Ret==200){
  757. this.$message.success('操作成功')
  758. this.getSealApprovalList()
  759. this.showUploadAttachment=false
  760. }
  761. },
  762. handlePreFile(e){
  763. let url=e.CheckBackFileUrl
  764. const reg = /\.(pdf)$/;
  765. // pdf
  766. if(reg.test(url)){
  767. window.open(url,'_blank');
  768. }else{
  769. window.open('https://view.officeapps.live.com/op/view.aspx?src='+url,'_blank');
  770. }
  771. }
  772. }
  773. }
  774. </script>
  775. <style>
  776. .el-message-box__header .el-message-box__title {
  777. color: #333 !important;
  778. }
  779. .detail-wrap .el-input{
  780. width: 100% !important;
  781. }
  782. .detail-wrap .el-input-number .el-input__inner{
  783. pointer-events: none;
  784. }
  785. </style>
  786. <style lang="scss" scoped>
  787. .upload-attachment-wrap{
  788. .box{
  789. width: 380px;
  790. display: inline-block;
  791. box-sizing: border-box;
  792. height: 40px;
  793. line-height: 40px;
  794. padding: 0 17px;
  795. font-size: 14px;
  796. border: 1px solid #DCDFE6;
  797. border-radius: 4px;
  798. margin-right: 20px;
  799. overflow: hidden;
  800. text-overflow: ellipsis;
  801. white-space: nowrap;
  802. }
  803. }
  804. .seal-approval-wrap{
  805. .content{
  806. background: #FFFFFF;
  807. border: 1px solid #ECECEC;
  808. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  809. border-radius: 4px;
  810. padding: 30px;
  811. min-height: 80vh;
  812. }
  813. .btn{
  814. display: inline-block;
  815. color:#409EFF;
  816. cursor:pointer;
  817. margin: 0 5px;
  818. }
  819. }
  820. .pagination-wrap{
  821. margin-top: 30px;
  822. display: flex;
  823. justify-content: flex-end;
  824. }
  825. .detail-wrap{
  826. max-height: 70vh;
  827. overflow-y: scroll;
  828. display: flex;
  829. justify-content: space-between;
  830. .main {
  831. width: 75%;
  832. .table-wrap {
  833. width: 100%;
  834. // text-align: center;
  835. border-top: 1px solid #dcdfe6;
  836. border-left: 1px solid #dcdfe6;
  837. .table-item {
  838. padding: 14px 10px;
  839. border-right: 1px solid #dcdfe6;
  840. border-bottom: 1px solid #dcdfe6;
  841. position: relative;
  842. }
  843. .width-50 {
  844. width: 50%;
  845. }
  846. }
  847. .service-wrap {
  848. margin-top: 42px;
  849. font-size: 14px;
  850. display: flex;
  851. color: #333;
  852. }
  853. .dashed-line {
  854. margin: 40px 0;
  855. border-top: 1px dashed #aab4cc;
  856. }
  857. }
  858. .right {
  859. width: 22%;
  860. .contract-origin{
  861. margin: 15px 0;
  862. }
  863. .timeline-wrap {
  864. max-height: 500px;
  865. overflow-y: auto;
  866. // margin-top: 20px;
  867. background-color: #fff;
  868. border: 1px solid #aab4cc;
  869. padding: 20px;
  870. border-radius: 4px;
  871. text-align: left;
  872. height: calc(100% - 120px);
  873. }
  874. }
  875. }
  876. .approval-step-wrap{
  877. .step-item{
  878. margin: 15px 0;
  879. .title{
  880. font-size: 16px;
  881. font-weight: bold;
  882. color: #333;
  883. float: left;
  884. }
  885. .user-box{
  886. padding-left: 100px;
  887. span{
  888. display: inline-block;
  889. background-color: #409eff;
  890. color: #fff;
  891. padding: 3px 5px;
  892. border-radius: 3px;
  893. margin-right: 10px;
  894. }
  895. span:first-child{
  896. background-color: #fff;
  897. color: #333;
  898. padding: 0;
  899. }
  900. }
  901. }
  902. }
  903. .attachment-contain{
  904. display: flex;
  905. flex-wrap: wrap;
  906. padding: 20px 0;
  907. .attachment-image{
  908. height: 100px;
  909. width: 100px;
  910. cursor: pointer;
  911. margin:0 10px 20px 10px ;
  912. }
  913. }
  914. </style>