detail.vue 27 KB

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