detail.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. <template>
  2. <view class="detail white-wrap">
  3. <image :src="statusImg" mode="aspectFill" class="status-img" v-if="statusImg"></image>
  4. <view class="section white-wrap">
  5. <view class="section-title require">用印用途</view>
  6. <view :class="opButton.CheckEdit?'section-select-box':null" :style="{color:newUse?'#333':'#999'}" @click="handleOperation('showPurpose')">{{newUse?newUse:'请选择'}}</view>
  7. </view>
  8. <view class="section white-wrap">
  9. <view class="section-title require">客户名称(全称)</view>
  10. <view>{{detail.CompanyName}}</view>
  11. </view>
  12. <view class="section white-wrap">
  13. <view class="section-title require">统一社会信用码</view>
  14. <input type="text" v-model="detail.CreditCode" placeholder="请填写统一社会信用码" disabled/>
  15. </view>
  16. <view class="section white-wrap">
  17. <view class="section-title">实际使用方名称</view>
  18. <input type="text" v-model="detail.UseCompanyName" placeholder="请填写实际使用方名称" disabled/>
  19. </view>
  20. <view class="section white-wrap">
  21. <view class="section-title require">业务类型</view>
  22. <input type="text" v-model="detail.ServiceType" placeholder="请填写业务类型" disabled/>
  23. </view>
  24. <view class="section white-wrap">
  25. <view class="section-title require">文件份数</view>
  26. <input type="number" v-model="newFileNum" placeholder="请填写总共盖章文件份数" :disabled="!opButton.CheckEdit"/>
  27. </view>
  28. <view class="section white-wrap">
  29. <view class="section-title require">加盖何种印章</view>
  30. <view :class="opButton.CheckEdit?'section-select-box':null" :style="{color:typeLength?'#333':'#999'}" @click="handleOperation('showType')">{{newSealType.length>0?newSealType.join(','):'请选择'}}</view>
  31. </view>
  32. <view class="section white-wrap" v-if="detail.ContractId>0">
  33. <view class="section-title require">合同附件<span>(合同来源:系统合同)</span> </view>
  34. <image
  35. :src="fileList[0].img"
  36. mode="aspectFill"
  37. style="width: 102rpx;height: 120rpx"
  38. @click="handlepreViewFile(fileList[0])">
  39. </image>
  40. </view>
  41. <view class="section white-wrap" v-else>
  42. <view class="section-title require">合同附件<span>(合同来源:上传附件)</span></view>
  43. <!-- 合规可修改上传 -->
  44. <!-- crm_8.7 支持上传多个附件 -->
  45. <div class="check-file-contain">
  46. <image @click="handleUpload" src="../static/upload-icon.png" mode="aspectFill"
  47. style="width: 102rpx;height: 120rpx;margin: 0 16rpx 24rpx 16rpx;"></image>
  48. <div class="check-file-box" :style="'background-image:url('+item.img+')'"
  49. @click="handlepreViewFile(item)" v-for="(item,index) in fileList" :key="item.url">
  50. <image class="del-icon" src="../static/del-icon.png" @click.stop="handleDeleteCheckFile(item)"></image>
  51. </div>
  52. </div>
  53. </view>
  54. <view class="section white-wrap" v-if="detail.Status==='已驳回'">
  55. <view class="section-title">驳回理由</view>
  56. <view style="color: #F55768;">{{detail.ApprovalRemark}}</view>
  57. </view>
  58. <view class="section white-wrap">
  59. <view class="section-title">备注</view>
  60. <textarea type="text" auto-height v-model="newRemark" placeholder="请填写备注" :disabled="!opButton.CheckEdit"></textarea>
  61. </view>
  62. <!-- 签回附件模块 -->
  63. <view class="section white-wrap" v-if="checkBackFilesRes.length>0">
  64. <view class="section-title">签回附件</view>
  65. <image
  66. v-for="item in checkBackFilesRes"
  67. :key="item.url"
  68. :src="item.img"
  69. mode="aspectFill"
  70. style="width: 102rpx;height: 120rpx"
  71. @click="handlepreViewFile(item)">
  72. </image>
  73. </view>
  74. <!-- 流程模块 -->
  75. <view class="section white-wrap process-wrap">
  76. <view class="title" style="font-size: 16px;font-weight: bold;">审批流程</view>
  77. <steps :data="processData"></steps>
  78. </view>
  79. <!-- 审批/撤回申请 -->
  80. <view class="fix-bottom-wrap" style="text-align: center;" v-if="opButton.Approval||opButton.Cancel">
  81. <view class="flex" style="justify-content: space-between;width:100%">
  82. <van-button type="info" color="#3385FF" style="flex:1;" custom-class="btn-small" round @click="handleClickPass" v-if="opButton.Approval">通过</van-button>
  83. <van-button type="info" color="#F55768" style="flex:1;" custom-class="btn-small" round @click="handleApprovalReject" v-if="opButton.Approval">驳回</van-button>
  84. <van-button type="info" color="#F55768" style="flex:1;" :custom-class="opButton.Approval?'btn-small':'btn-big'" round @click="handleCancelApply" v-if="opButton.Cancel">撤回申请</van-button>
  85. </view>
  86. </view>
  87. <!-- 作废 -->
  88. <view class="fix-bottom-wrap flex" style="text-align: center;align-items:flex-end" v-if="opButton.Invalid||opButton.UploadFile">
  89. <view style="flex:1" v-if="opButton.Invalid">
  90. <view v-if="detail.ContractId>0" style="margin-bottom: 10rpx;" @click="checked=!checked"><radio value="同时作废合同" :checked="checked" color="#3385FF" style="transform:scale(0.8)"/>是否同时作废合同?</view>
  91. <van-button type="info" color="#F55768" :custom-class="opButton.UploadFile?'btn-small':'btn-big'" round @click="handleSealInvalid">用印作废</van-button>
  92. </view>
  93. <van-button v-if="opButton.UploadFile" style="flex:1" type="info" color="#3385FF" :custom-class="opButton.Invalid?'btn-small':'btn-big'" round @click="handleUploadCheckFile">{{checkBackFilesRes.length>0?'更新回签附件':'上传回签附件'}}</van-button>
  94. </view>
  95. <!-- 重新提交 -->
  96. <view class="fix-bottom-wrap" style="text-align: center;" v-if="opButton.Edit">
  97. <van-button type="info" color="#3385FF" custom-class="btn-big" round @click="handleEdit">重新申请</van-button>
  98. </view>
  99. <!-- 撤回申请 -->
  100. <!-- <view class="fix-bottom-wrap" style="text-align: center;" v-if="opButton.Cancel">
  101. <van-button type="info" color="#3385FF" custom-class="btn-big" round @click="handleCancelApply">撤回申请</van-button>
  102. </view> -->
  103. <!-- 用印用途 -->
  104. <van-popup :show="showPurpose" @close="showPurpose=false" position="bottom">
  105. <van-picker
  106. show-toolbar
  107. title="选择用印用途"
  108. :columns="purposeArr"
  109. @confirm="handlePurposeConfirm"
  110. @cancel="showPurpose=false"
  111. />
  112. </van-popup>
  113. <!-- 何种印章 -->
  114. <van-popup :show="showType" @close="showType=false" position="bottom">
  115. <view class="type-popup-wrap">
  116. <view class="flex top-title">
  117. <text style="color:#969799" @click="showType=false">取消</text>
  118. <text style="font-size:16px">选择何种印章</text>
  119. <text style="color:#576b95" @click="handleTypeConfirm">确认</text>
  120. </view>
  121. <van-checkbox-group v-model="temType" @change="onChangeType">
  122. <van-checkbox shape="square" :name="item" v-for="item in typeArr" :key="item">{{item}}</van-checkbox>
  123. </van-checkbox-group>
  124. </view>
  125. </van-popup>
  126. <!-- 客户搜索 -->
  127. <van-popup :show="showCustome" @close="showCustome=false" position="bottom" custom-style="height: 100vh">
  128. <view class="custome-search-wrap">
  129. <van-search use-left-icon-slot use-action-slot shape="round" :value="searchCustomeVal" placeholder="请输入客户名称/社会信用码" @change="onSearchValChange" @search="onSearch"
  130. custom-class="search-box" field-class="search-con">
  131. <view slot="left-icon">
  132. <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
  133. </view>
  134. <view slot="action" @click="showCustome=false" class="search-btn">取消</view>
  135. </van-search>
  136. <view class="search-result">
  137. <view class="result-custome-box" v-if="searchContractList.length===0">
  138. <view class="result-item flex" v-for="item in searchCustomeList" :key="item" @click="getContract(item)">
  139. <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
  140. <view class="con van-ellipsis">{{item}}</view>
  141. <image src="../static/click-icon.png" mode="aspectFill" class="click-icon"></image>
  142. </view>
  143. </view>
  144. <view class="result-contract-box" v-else>
  145. <view class="result-contract-item" v-for="item in searchContractList" :key="item.ContractId" @click="handleChooseContract(item)">
  146. <view class="name">{{item.CompanyName}}</view>
  147. <view style="margin-top: 20rpx;">合同编号:{{item.ContractCode}}</view>
  148. <view style="margin-top: 20rpx;">合同类型:{{item.ContractType}}</view>
  149. <view style="margin-top: 20rpx;">合同金额:{{item.Price}}</view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. </van-popup>
  155. <!-- 上传回签附件弹窗确认弹窗 -->
  156. <van-popup :show="showConfirmCheckBackfile" @close="showConfirmCheckBackfile=false" position="bottom" round>
  157. <view class="uploadfile-wrap">
  158. <view style="text-align: center;font-size: 16px;font-weight: bold;">上传回签附件</view>
  159. <view class="contract-list" style="height: 30vh;">
  160. <view class="contract-item" v-for="item in checkBackFiles" :key="item.url"
  161. @click="handlepreViewCheckFile(item)">
  162. <image class="contract-img" mode="aspectFill" :src="item.img"></image>
  163. </view>
  164. </view>
  165. <button style="width: 450rpx;" @click='handleConfirmCheckBackFile'>确定</button>
  166. </view>
  167. </van-popup>
  168. <van-dialog id="van-dialog" />
  169. </view>
  170. </template>
  171. <script>
  172. import {
  173. apiSealDetail,
  174. apiSearchCustome,
  175. apiSearchContract,
  176. apiApprovalPass,
  177. apiInvalidSeal,
  178. apiApprovalPassModify,
  179. apiSealCancelApply,
  180. apiFlowDetail,
  181. apiSealCheckBackFiles
  182. } from '@/api/approve/seal.js'
  183. import steps from '../components/steps.vue'
  184. import {preViewFile} from '../utils/util.js'
  185. import {uploadFiles} from '@/utils/uploadFile.js'
  186. export default{
  187. components:{
  188. steps
  189. },
  190. computed:{
  191. typeLength() {
  192. if (this.newSealType.length > 0) {
  193. return true;
  194. } else {
  195. return false;
  196. }
  197. },
  198. statusImg(){
  199. if(this.detail.Status==='已审批'){
  200. return require('../static/pass-icon.png')
  201. }else if(this.detail.Status==='已驳回'){
  202. return require('../static/fail-icon.png')
  203. }else if(this.detail.Status==='处理中'){
  204. return require('../static/processing-icon.png')
  205. }else if(this.detail.Status==='已撤回'){
  206. return require('../static/recall-icon.png')
  207. }else if(this.detail.Status==='已作废'){
  208. return require('../static/cancel-icon.png')
  209. }else if(this.detail.Status==='已签回'){
  210. return require('../static/draw-back-icon.png')
  211. }
  212. },
  213. //页面显示的回签附件
  214. checkBackFilesRes(){
  215. const reg = /\.(pdf)$/;
  216. return this.detail&&this.detail.CheckBackFileUrl&&this.detail.CheckBackFileUrl.split("#").map((item) => {
  217. if (reg.test(item)) {
  218. return {
  219. type: "pdf",
  220. url: item,
  221. img: require("@/pages-approve/static/pdf.png"),
  222. };
  223. } else {
  224. return {
  225. type: "word",
  226. url: item,
  227. img: require("@/pages-approve/static/word.png"),
  228. };
  229. }
  230. });
  231. }
  232. },
  233. watch: {
  234. showType() {
  235. if (!this.showType) {
  236. this.temType = JSON.parse(JSON.stringify(this.newSealType));
  237. }
  238. }
  239. },
  240. data() {
  241. return {
  242. checkBackFiles:[],// 上传的签回附件文件
  243. showConfirmCheckBackfile:false,//确认上传的签回附件弹窗
  244. ContractApprovalId:0,
  245. ContractApprovalRecordId:0,
  246. SealId:0,
  247. processData:null,
  248. detail:{},
  249. opButton:{},
  250. // files:{
  251. // type:'',
  252. // img:'',
  253. // url:''
  254. // },//合同附件
  255. // 上传的附件列表 需求更改,可上传多个附件 crm-8.7
  256. fileList:[],
  257. showPurpose:false,//显示用印用途选项
  258. purposeArr: ["销售合同", "代付合同", "总对总协议", "渠道合同", "付款通知函", "招投标", "战略合作协议"],
  259. showType:false,//显示用印用途选项
  260. typeArr:['合同章','公章','法人章'],
  261. temType: [], //临时存放选择的用印用途
  262. showCustome:false,//显示搜索客户名称
  263. searchCustomeVal:'',//搜索客户输入数据
  264. searchCustomeList:[],//搜索到的客户名称列表
  265. searchContractList:[],//选择搜索中的客户后合同列表数据
  266. checked:false,//是否同时作废合同
  267. newUse:"",
  268. newFileNum:'',
  269. newSealType:[],
  270. newRemark:'',
  271. oldFile:''
  272. }
  273. },
  274. onLoad(options) {
  275. this.ContractApprovalId=options.ContractApprovalId||0
  276. this.ContractApprovalRecordId=options.ContractApprovalRecordId||0
  277. this.SealId=options.SealId||0
  278. this.getDetail()
  279. },
  280. onShow() {
  281. uni.$once('updateSealDetail',(data)=>{
  282. console.log('监听到事件来自updateSealDetail ,携带参数 msg 为:' + data.msg);
  283. this.getDetail()
  284. })
  285. },
  286. onPullDownRefresh() {
  287. this.getDetail()
  288. setTimeout(()=>{
  289. uni.stopPullDownRefresh()
  290. },1000)
  291. },
  292. methods: {
  293. // 上传(更新)签回附件
  294. handleUploadCheckFile(){
  295. wx.chooseMessageFile({
  296. count:1,
  297. type:'file',
  298. success:(res)=>{
  299. const tempFile=res.tempFiles[0]
  300. const reg = /\.(pdf)$/;
  301. const reg2= /\.doc|\.docx$/
  302. if(!reg.test(tempFile.path)&&!reg2.test(tempFile.path)){
  303. uni.showToast({
  304. title:'请上传pdf/word格式文件',
  305. icon:"none"
  306. })
  307. return
  308. }
  309. // pdf
  310. if(reg.test(tempFile.path)){
  311. this.checkBackFiles=[{type:'pdf',url:tempFile.path,img: require("@/pages-approve/static/pdf.png")}]
  312. }
  313. if(reg2.test(tempFile.path)){
  314. this.checkBackFiles=[{type:'word',url:tempFile.path,img: require("@/pages-approve/static/word.png")}]
  315. }
  316. this.showConfirmCheckBackfile=true
  317. },
  318. fail:(error)=>{
  319. if(error.errMsg.indexOf('not supported')){
  320. uni.showToast({
  321. title:'请通过手机上传附件',
  322. icon:'none'
  323. })
  324. }
  325. }
  326. })
  327. // const res=await uploadFiles({type:'file'})
  328. // const reg = /\.(pdf)$/;
  329. // const reg2= /\.doc|\.docx$/
  330. // if(reg.test(res[0])){
  331. // this.checkBackFiles=[{
  332. // type:'pdf',
  333. // url:res[0],
  334. // img:require('../static/pdf.png')
  335. // }]
  336. // this.showConfirmCheckBackfile=true
  337. // }else if(reg2.test(res[0])){
  338. // this.checkBackFiles=[{
  339. // type:'word',
  340. // url:res[0],
  341. // img:require('../static/word.png')
  342. // }]
  343. // this.showConfirmCheckBackfile=true
  344. // }else{
  345. // uni.showToast({
  346. // title:'请上传pdf/word格式文件',
  347. // icon:"none"
  348. // })
  349. // }
  350. },
  351. //确认上传的签回附件
  352. async handleConfirmCheckBackFile(){
  353. const temres=await apiSealCheckBackFiles({
  354. SealId:Number(this.detail.SealId),
  355. tempPath:this.checkBackFiles[0].url
  356. })
  357. const res=JSON.parse(temres.data)
  358. if(res.code===200){
  359. uni.showToast({
  360. title:'操作成功',
  361. icon:'none'
  362. })
  363. // 如果是已审批上传回签附件则更新列表页
  364. if(this.detail.Status==='已审批'){
  365. this.handleUpdateList()
  366. }
  367. setTimeout(()=>{
  368. this.checkBackFiles=[]
  369. this.showConfirmCheckBackfile=false
  370. this.getDetail()
  371. },500)
  372. }
  373. // let FileUrlarr=this.checkBackFiles.map(item=>item.url)
  374. // const res=await apiSealCheckBackFiles({
  375. //
  376. // FileUrl:FileUrlarr.join('#')
  377. // })
  378. // if(res.code===200){
  379. // uni.showToast({
  380. // title:'操作成功',
  381. // icon:'none'
  382. // })
  383. // // 如果是已审批上传回签附件则更新列表页
  384. // if(this.detail.Status==='已审批'){
  385. // this.handleUpdateList()
  386. // }
  387. // setTimeout(()=>{
  388. // this.checkBackFiles=[]
  389. // this.showConfirmCheckBackfile=false
  390. // this.getDetail()
  391. // },500)
  392. // }
  393. },
  394. // 预览要上传的签回附件
  395. handlepreViewCheckFile(){
  396. uni.openDocument({
  397. filePath:this.checkBackFiles[0].url,
  398. showMenu:true,
  399. success() {
  400. console.log('打开成功');
  401. },
  402. fail(){
  403. setTimeout(() => {
  404. uni.showToast({
  405. title:'打开失败,请重试',
  406. icon:"none"
  407. })
  408. }, 0);
  409. }
  410. })
  411. },
  412. // 更新列表页
  413. handleUpdateList(){
  414. uni.$emit('sealApproveListUpdate',{
  415. ContractApprovalId:this.ContractApprovalId,
  416. ContractApprovalRecordId:this.ContractApprovalRecordId,
  417. SealId:this.SealId
  418. })
  419. },
  420. // 合规删除合同附件
  421. handleDeleteCheckFile(file){
  422. this.fileList = this.fileList.filter(item => item.url!= file.url)
  423. },
  424. //合规上传附件
  425. async handleUpload(){
  426. const res=await uploadFiles({type:'all'})
  427. const reg = /\.(pdf)$/;
  428. const reg2 = /\.doc|\.docx$/;
  429. if (reg.test(res[0])) {
  430. this.fileList.push({
  431. type: "pdf",
  432. url: res[0],
  433. img: require("../static/pdf.png"),
  434. });
  435. } else if (reg2.test(res[0])) {
  436. this.fileList.push({
  437. type: "word",
  438. url: res[0],
  439. img: require("../static/word.png"),
  440. });
  441. } else {
  442. this.fileList.push({
  443. type: "img",
  444. url: res[0],
  445. img: res[0],
  446. });
  447. }
  448. },
  449. // 撤回申请
  450. handleCancelApply(){
  451. this.$dialog.confirm({
  452. title: '提示',
  453. message: '是否确认撤回',
  454. }).then(async ()=>{
  455. const res=await apiSealCancelApply({SealId:Number(this.detail.SealId)})
  456. if(res.code===200){
  457. uni.showToast({
  458. title:'撤回成功',
  459. icon:'none'
  460. })
  461. this.handleUpdateList()
  462. this.getDetail()
  463. }
  464. }).catch(() => {
  465. console.log('取消撤回');
  466. });
  467. },
  468. handlePurposeConfirm(e){
  469. this.newUse=e.detail.value
  470. this.showPurpose=false
  471. },
  472. // 确认盖章类型
  473. handleTypeConfirm(e){
  474. this.newSealType=JSON.parse(JSON.stringify(this.temType))
  475. this.showType=false
  476. this.getProcessData()
  477. },
  478. // 盖章类型变换
  479. onChangeType(e){
  480. this.temType=e.detail
  481. },
  482. //前去重审
  483. handleEdit(){
  484. uni.$once('sealEditSubmit',()=>{
  485. this.handleUpdateList()
  486. })
  487. uni.navigateTo({
  488. url:`./edit?ContractApprovalId=${this.ContractApprovalId}&ContractApprovalRecordId=${this.ContractApprovalRecordId}&SealId=${this.SealId}`
  489. })
  490. },
  491. //用印作废
  492. handleSealInvalid(){
  493. this.$dialog.confirm({
  494. title: '提示',
  495. message: '是否确认作废',
  496. }).then(async ()=>{
  497. const res=await apiInvalidSeal({
  498. IsInvalidContract:this.checked,
  499. SealId:this.detail.SealId
  500. })
  501. if(res.code===200){
  502. uni.showToast({
  503. title:'操作成功',
  504. icon:'none'
  505. })
  506. this.handleUpdateList()
  507. this.getDetail()
  508. }
  509. }).catch(() => {
  510. console.log('取消作废');
  511. });
  512. },
  513. //点击通过
  514. handleClickPass(){
  515. //判断是否有内容修改
  516. const flag1=this.newUse===this.detail.Use
  517. const flag2=Number(this.newFileNum)===Number(this.detail.FileNum)
  518. // const flag3=this.newSealType.join(',')===this.detail.SealType
  519. const flag3=this.isArrEqual(this.newSealType,this.detail.SealType.split(','))
  520. const flag4=this.newRemark===this.detail.Remark
  521. const flag5= JSON.stringify(this.fileList.map(file => file.url))===JSON.stringify(this.detail.FileUrls)
  522. if(flag1&&flag2&&flag3&&flag4&&flag5){
  523. this.handleApprovalPass()
  524. }else{
  525. this.handleApprovePassModify()
  526. }
  527. },
  528. //判断两个数组是否相同
  529. isArrEqual(arr1, arr2){
  530. return arr1.length === arr2.length && arr1.every((ele) => arr2.includes(ele));
  531. },
  532. //审批通过 (修改内容)
  533. async handleApprovePassModify(){
  534. if(!this.newFileNum){
  535. uni.showToast({
  536. title:'请填写文件份数',
  537. icon:"none"
  538. })
  539. return
  540. }
  541. if(this.newFileNum<1){
  542. uni.showToast({
  543. title:'文件份数不合法',
  544. icon:"none"
  545. })
  546. return
  547. }
  548. if(!this.newSealType){
  549. uni.showToast({
  550. title:'印章类型不能为空',
  551. icon:"none"
  552. })
  553. return
  554. }
  555. if(!this.newUse){
  556. uni.showToast({
  557. title:'请选择用印用途',
  558. icon:"none"
  559. })
  560. return
  561. }
  562. if(!this.fileList || this.fileList.length==0){
  563. uni.showToast({
  564. title:'合同附件不能为空',
  565. icon:"none"
  566. })
  567. return
  568. }
  569. const res=await apiApprovalPassModify({
  570. FileNum:Number(this.newFileNum),
  571. Remark:this.newRemark,
  572. SealId:Number(this.detail.SealId),
  573. SealType:this.newSealType.join(','),
  574. Use:this.newUse,
  575. FileUrls:this.fileList.map(file => file.url)
  576. })
  577. if(res.code===200){
  578. this.$dialog.alert({
  579. title: "处理成功",
  580. confirmButtonColor: "#5890FB",
  581. }).then(() => {
  582. this.handleUpdateList()
  583. this.getDetail()
  584. });
  585. }
  586. },
  587. // 审批通过 (未修改内容)
  588. async handleApprovalPass(){
  589. const res=await apiApprovalPass({
  590. SealId:Number(this.detail.SealId),
  591. Remark:""
  592. })
  593. if(res.code===200){
  594. this.$dialog.alert({
  595. title: "处理成功",
  596. confirmButtonColor: "#5890FB",
  597. }).then(() => {
  598. this.handleUpdateList()
  599. this.getDetail()
  600. });
  601. }
  602. },
  603. //驳回
  604. handleApprovalReject(){
  605. uni.$once('sealApproveReject',()=>{
  606. this.handleUpdateList()
  607. })
  608. uni.navigateTo({
  609. url:`./reason?SealId=${this.detail.SealId}`
  610. })
  611. },
  612. //预览文件
  613. handlepreViewFile(e){
  614. if (e.type === "pdf"||e.type==='word') {
  615. preViewFile(e.url)
  616. } else {
  617. uni.previewImage({
  618. urls: [e.url]
  619. })
  620. }
  621. },
  622. // 只有当 checkEdit 为true 即合规才能修改
  623. handleOperation(key){
  624. if(this.opButton.CheckEdit){
  625. this[key]=true
  626. }
  627. },
  628. // 客户搜索
  629. // 先搜索出客户 再通过客户去请求出客户下面存在的合同
  630. onSearchValChange(e){
  631. this.searchCustomeVal=e.detail
  632. },
  633. //搜索客户
  634. async onSearch(){
  635. if(!this.searchCustomeVal){
  636. uni.showToast({
  637. title:'请输入搜索关键字',
  638. icon:'none'
  639. })
  640. return
  641. }
  642. this.searchContractList=[]
  643. this.searchCustomeList=[]
  644. const res=await apiSearchCustome({Keyword:this.searchCustomeVal})
  645. if(res.code===200){
  646. this.searchCustomeList=res.data
  647. }
  648. },
  649. // 搜索客户对应的合同
  650. async getContract(e){
  651. const res=await apiSearchContract({Keyword:e})
  652. if(res.code===200){
  653. if(res.data.List){
  654. this.searchContractList=res.data.List
  655. }else{
  656. uni.showToast({
  657. title:"此客户无合同,请重新选择",
  658. icon:"none"
  659. })
  660. }
  661. }
  662. },
  663. // 选择合同 更新表单数据
  664. handleChooseContract(e){
  665. this.detail.CompanyName=e.CompanyName
  666. this.detail.ServiceType=e.ContractType
  667. this.detail.CreditCode=e.CreditCode
  668. this.detail.UseCompanyName=e.CompanyName
  669. this.detail.ContractId=e.ContractId
  670. this.detail.ContractfileUrl=e.FileUrl
  671. // 关闭搜索弹窗
  672. this.showCustome=false
  673. this.searchCustomeVal=''
  674. this.searchContractList=[]
  675. this.searchCustomeList=[]
  676. },
  677. //合同章5 公章、法人章 6
  678. async getProcessData(){
  679. if(this.newSealType.length===0) return
  680. let id=0
  681. if (this.newSealType.includes("公章") || this.newSealType.includes("法人章")) {
  682. id = 6;
  683. } else {
  684. id = 5;
  685. }
  686. let res=await apiFlowDetail({FlowId:id})
  687. if(res.code===200){
  688. this.processData=res.data||null
  689. }
  690. },
  691. //获取详情
  692. async getDetail() {
  693. const res=await apiSealDetail({
  694. ContractApprovalId:Number(this.ContractApprovalId),
  695. ContractApprovalRecordId:Number(this.ContractApprovalRecordId),
  696. SealId:Number(this.SealId)
  697. })
  698. if(res.code===200){
  699. this.detail=res.data.SealDetail
  700. this.newUse=res.data.SealDetail.Use
  701. this.newFileNum=res.data.SealDetail.FileNum
  702. this.newSealType=res.data.SealDetail.SealType.split(',')
  703. this.temType=res.data.SealDetail.SealType.split(',')
  704. this.newRemark=res.data.SealDetail.Remark
  705. this.processData=res.data.FlowNodeList
  706. this.opButton=res.data.OpButton
  707. this.handleFile(res.data.SealDetail.FileUrls)
  708. }
  709. },
  710. //处理文件
  711. handleFile(filesUrls){
  712. // 清空 防止操作成功后再获取详情 数组叠加
  713. this.fileList=[]
  714. const reg = /\.(pdf)$/;
  715. const reg2= /\.doc|\.docx$/
  716. filesUrls.map(filesUrl=>{
  717. if(reg.test(filesUrl)){
  718. this.fileList.push({
  719. type: "pdf",
  720. url: filesUrl,
  721. img: require("../static/pdf.png"),
  722. })
  723. }else if(reg2.test(filesUrl)){
  724. this.fileList.push({
  725. type: "word",
  726. url: filesUrl,
  727. img: require("../static/word.png"),
  728. })
  729. }else{
  730. this.fileList.push({
  731. type: "img",
  732. url: filesUrl,
  733. img: filesUrl,
  734. })
  735. }
  736. })
  737. },
  738. },
  739. }
  740. </script>
  741. <style lang="scss">
  742. .uploadfile-wrap{
  743. width: 100%;
  744. height: 50vh;
  745. background-color: #FFFFFF;
  746. padding: 32rpx;
  747. button {
  748. margin-left: auto;
  749. margin-right: auto;
  750. width: 260rpx;
  751. height: 70rpx;
  752. display: block;
  753. border-radius: 28px;
  754. border: none;
  755. font-size: 15px;
  756. color: #fff;
  757. line-height: 70rpx;
  758. background-color: #5890fb;
  759. }
  760. .contract-list {
  761. display: flex;
  762. flex-wrap: wrap;
  763. .contract-img {
  764. width: 102rpx;
  765. height: 120rpx;
  766. margin-right: 20rpx;
  767. margin-bottom: 20rpx;
  768. }
  769. }
  770. }
  771. .check-file-contain{
  772. display: flex;
  773. flex-wrap: wrap;
  774. .check-file-box{
  775. width: 102rpx;
  776. height: 120rpx;
  777. background-size: cover;
  778. background-position: center;
  779. position: relative;
  780. margin: 0 16rpx;
  781. .del-icon{
  782. position: absolute;
  783. width: 30rpx;
  784. height: 30rpx;
  785. top: -15rpx;
  786. right: -15rpx;
  787. }
  788. }
  789. }
  790. .detail{
  791. width: 100%;
  792. min-height: 100vh;
  793. padding-bottom: calc(150rpx + constant(safe-area-inset-bottom));
  794. padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
  795. position: relative;
  796. }
  797. .status-img{
  798. position: absolute;
  799. right: 0;
  800. top: 50rpx;
  801. width: 220rpx;
  802. height: 220rpx;
  803. z-index: 10;
  804. }
  805. .section{
  806. padding: 30rpx 34rpx;
  807. border-top: 10rpx solid #F5F5F5;
  808. position: relative;
  809. .section-title{
  810. font-size: 16px;
  811. margin-bottom: 20rpx;
  812. span{
  813. font-size: 28rpx;
  814. font-family: PingFang SC-Regular, PingFang SC;
  815. font-weight: 400;
  816. color: #999999;
  817. -webkit-background-clip: text;
  818. background-clip: text;
  819. }
  820. }
  821. .require::before{
  822. content: '*';
  823. font-size: 16px;
  824. color: #FF0000;
  825. position: absolute;
  826. left: 20rpx;
  827. }
  828. .section-select-box{
  829. color: #999;
  830. position: relative;
  831. &::after{
  832. position: absolute;
  833. right: 0;
  834. top: 50%;
  835. content: '';
  836. display: block;
  837. width: 18rpx;
  838. height: 18rpx;
  839. border-top: 1px solid #999;
  840. border-right: 1px solid #999;
  841. transform: translateY(-50%) rotate(45deg);
  842. }
  843. }
  844. }
  845. .btn-big{
  846. width: 450rpx;
  847. }
  848. .btn-small{
  849. min-width: 220rpx;
  850. }
  851. .fix-bottom-wrap{
  852. button{
  853. height: 70rpx;
  854. font-size: 15px;
  855. }
  856. }
  857. .custome-search-wrap{
  858. padding: 34rpx;
  859. height: 100%;
  860. .search-box {
  861. border: 1px solid #3385FF;
  862. padding: 0 !important;
  863. border-radius: 60rpx;
  864. background-color: #fff !important;
  865. }
  866. .search-con {
  867. background-color: #fff !important;
  868. }
  869. .van-search__content {
  870. background-color: #fff !important;
  871. padding-left: 30rpx !important;
  872. }
  873. .search-btn {
  874. position: relative;
  875. color: #3385FF;
  876. &::before {
  877. content: '';
  878. display: block;
  879. width: 1px;
  880. height: 60%;
  881. background-color: #D1D1D1;
  882. position: absolute;
  883. left: -16rpx;
  884. top: 20%;
  885. }
  886. }
  887. .search-icon{
  888. width: 40rpx;
  889. height: 40rpx;
  890. display: block;
  891. position: relative;
  892. top: 4rpx;
  893. margin-right: 20rpx;
  894. }
  895. .click-icon{
  896. width: 24rpx;
  897. height: 24rpx;
  898. }
  899. .result-item{
  900. align-items: center;
  901. padding: 20rpx 0;
  902. border-bottom: 1px solid #EBEBEB;
  903. .con{
  904. flex: 1;
  905. margin-right: 20rpx;
  906. }
  907. }
  908. .search-result{
  909. overflow-y: auto;
  910. height: 100%;
  911. }
  912. .result-contract-box{
  913. padding: 0 10rpx;
  914. .result-contract-item{
  915. margin-top: 30rpx;
  916. box-shadow: 0px 0px 12rpx rgba(175, 175, 175, 0.38);
  917. padding: 30rpx;
  918. border-radius: 8px;
  919. .name{
  920. font-size: 16px;
  921. font-weight: bold;
  922. &::before{
  923. content:'';
  924. display:inline-block;
  925. width: 31rpx;
  926. height: 34rpx;
  927. background-image: url(../../static/man.png);
  928. background-size: cover;
  929. position: relative;
  930. top: 4rpx;
  931. margin-right: 10rpx;
  932. }
  933. }
  934. }
  935. }
  936. }
  937. .type-popup-wrap{
  938. padding: 20rpx 32rpx;
  939. height: 280px;
  940. .top-title{
  941. justify-content: space-between;
  942. margin-bottom: 124rpx;
  943. }
  944. .van-checkbox{
  945. margin-bottom: 30rpx;
  946. width: 200rpx;
  947. margin-left: auto;
  948. margin-right: auto;
  949. }
  950. }
  951. </style>