123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074 |
- <template>
- <view class="detail white-wrap">
- <image :src="statusImg" mode="aspectFill" class="status-img" v-if="statusImg"></image>
- <view class="section white-wrap">
- <view class="section-title require">归属公司
- <span class="tip">(归属公司:申请用章公司)</span>
- </view>
- <view :class="opButton.CheckEdit?'section-select-box':null" :style="{color:belongCompany?'#333':'#999'}" @click="handleOperation('showBelongCompanyPop')">{{belongCompany?belongCompany:'请选择'}}</view>
- </view><view class="section white-wrap">
- <view class="section-title require">用印用途</view>
- <view :class="opButton.CheckEdit?'section-select-box':null" :style="{color:newUse?'#333':'#999'}" @click="handleOperation('showPurpose')">{{newUse?newUse:'请选择'}}</view>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">客户名称(全称)</view>
- <view>{{detail.CompanyName}}</view>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">统一社会信用码</view>
- <input type="text" v-model="detail.CreditCode" placeholder="请填写统一社会信用码" disabled/>
- </view>
- <view class="section white-wrap">
- <view class="section-title">实际使用方名称</view>
- <input type="text" v-model="detail.UseCompanyName" placeholder="请填写实际使用方名称" disabled/>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">业务类型</view>
- <input type="text" v-model="detail.ServiceType" placeholder="请填写业务类型" disabled/>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">文件份数</view>
- <input type="number" v-model="newFileNum" placeholder="请填写总共盖章文件份数" :disabled="!opButton.CheckEdit"/>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">加盖何种印章</view>
- <view :class="opButton.CheckEdit?'section-select-box':null" :style="{color:typeLength?'#333':'#999'}" @click="handleOperation('showType')">{{newSealType.length>0?newSealType.join(','):'请选择'}}</view>
- </view>
- <view class="section white-wrap" v-if="detail.ContractId>0">
- <view class="section-title require">合同附件<span>(合同来源:系统合同)</span> </view>
- <image
- :src="fileList[0].img"
- mode="aspectFill"
- style="width: 102rpx;height: 120rpx"
- @click="handlepreViewFile(fileList[0])">
- </image>
- </view>
- <view class="section white-wrap" v-else>
- <view class="section-title require">合同附件<span>(合同来源:上传附件)</span></view>
- <!-- 合规可修改上传 -->
- <!-- crm_8.7 支持上传多个附件 -->
- <div class="check-file-contain">
- <image @click="handleUpload" src="../static/upload-icon.png" mode="aspectFill"
- style="width: 102rpx;height: 120rpx;margin: 0 16rpx 24rpx 16rpx;"></image>
- <div class="check-file-box" :style="'background-image:url('+item.img+')'"
- @click="handlepreViewFile(item)" v-for="(item,index) in fileList" :key="item.url">
- <image class="del-icon" src="../static/del-icon.png" @click.stop="handleDeleteCheckFile(item)"></image>
- </div>
- </div>
-
- </view>
- <view class="section white-wrap" v-if="detail.Status==='已驳回'">
- <view class="section-title">驳回理由</view>
- <view style="color: #F55768;">{{detail.ApprovalRemark}}</view>
- </view>
- <view class="section white-wrap">
- <view class="section-title">备注</view>
- <textarea type="text" auto-height v-model="newRemark" placeholder="请填写备注" :disabled="!opButton.CheckEdit"></textarea>
- </view>
- <!-- 签回附件模块 -->
- <view class="section white-wrap" v-if="checkBackFilesRes&&checkBackFilesRes.length>0">
- <view class="section-title">签回附件</view>
- <image
- v-for="item in checkBackFilesRes"
- :key="item.url"
- :src="item.img"
- mode="aspectFill"
- style="width: 102rpx;height: 120rpx"
- @click="handlepreViewFile(item)">
- </image>
- </view>
- <!-- 流程模块 -->
- <view class="section white-wrap process-wrap">
- <view class="title" style="font-size: 16px;font-weight: bold;">审批流程</view>
- <steps :data="processData"></steps>
- </view>
-
- <!-- 审批/撤回申请 -->
- <view class="fix-bottom-wrap" style="text-align: center;" v-if="opButton.Approval||opButton.Cancel">
- <view class="flex" style="justify-content: space-between;width:100%">
- <van-button type="info" color="#3385FF" style="flex:1;" custom-class="btn-small" round @click="handleClickPass" v-if="opButton.Approval">通过</van-button>
- <van-button type="info" color="#F55768" style="flex:1;" custom-class="btn-small" round @click="handleApprovalReject" v-if="opButton.Approval">驳回</van-button>
- <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>
- </view>
- </view>
- <!-- 作废 -->
- <view class="fix-bottom-wrap flex" style="text-align: center;align-items:flex-end" v-if="opButton.Invalid||opButton.UploadFile">
- <view style="flex:1" v-if="opButton.Invalid">
- <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>
- <van-button type="info" color="#F55768" :custom-class="opButton.UploadFile?'btn-small':'btn-big'" round @click="handleSealInvalid">用印作废</van-button>
- </view>
- <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>
- </view>
- <!-- 重新提交 -->
- <view class="fix-bottom-wrap" style="text-align: center;" v-if="opButton.Edit">
- <van-button type="info" color="#3385FF" custom-class="btn-big" round @click="handleEdit">重新申请</van-button>
- </view>
- <!-- 撤回申请 -->
- <!-- <view class="fix-bottom-wrap" style="text-align: center;" v-if="opButton.Cancel">
- <van-button type="info" color="#3385FF" custom-class="btn-big" round @click="handleCancelApply">撤回申请</van-button>
- </view> -->
- <!-- 归属公司 -->
- <van-popup :show="showBelongCompanyPop" @close="showBelongCompanyPop=false" position="bottom">
- <van-picker
- ref="howBelongCompanyRef"
- show-toolbar
- title="选择归属公司"
- :columns="belongCompanyOptions"
- @confirm="handleComfirmBelongCmpany"
- @cancel="showBelongCompanyPop=false"
- />
- </van-popup>
-
- <!-- 用印用途 -->
- <van-popup :show="showPurpose" @close="showPurpose=false" position="bottom">
- <van-picker
- ref="showPurposeRef"
- show-toolbar
- title="选择用印用途"
- :columns="purposeArr"
- @confirm="handlePurposeConfirm"
- @cancel="showPurpose=false"
- />
- </van-popup>
- <!-- 何种印章 -->
- <van-popup :show="showType" @close="showType=false" position="bottom">
- <view class="type-popup-wrap">
- <view class="flex top-title">
- <text style="color:#969799" @click="showType=false">取消</text>
- <text style="font-size:16px">选择何种印章</text>
- <text style="color:#576b95" @click="handleTypeConfirm">确认</text>
- </view>
- <van-checkbox-group v-model="temType" @change="onChangeType">
- <van-checkbox shape="square" :name="item" v-for="item in typeArr" :key="item">{{item}}</van-checkbox>
- </van-checkbox-group>
- </view>
- </van-popup>
-
- <!-- 客户搜索 -->
- <van-popup :show="showCustome" @close="showCustome=false" position="bottom" custom-style="height: 100vh">
- <view class="custome-search-wrap">
- <van-search use-left-icon-slot use-action-slot shape="round" :value="searchCustomeVal" placeholder="请输入客户名称/社会信用码" @change="onSearchValChange" @search="onSearch"
- custom-class="search-box" field-class="search-con">
- <view slot="left-icon">
- <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
- </view>
- <view slot="action" @click="showCustome=false" class="search-btn">取消</view>
- </van-search>
- <view class="search-result">
- <view class="result-custome-box" v-if="searchContractList.length===0">
- <view class="result-item flex" v-for="item in searchCustomeList" :key="item" @click="getContract(item)">
- <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
- <view class="con van-ellipsis">{{item}}</view>
- <image src="../static/click-icon.png" mode="aspectFill" class="click-icon"></image>
- </view>
- </view>
- <view class="result-contract-box" v-else>
- <view class="result-contract-item" v-for="item in searchContractList" :key="item.ContractId" @click="handleChooseContract(item)">
- <view class="name">{{item.CompanyName}}</view>
- <view style="margin-top: 20rpx;">合同编号:{{item.ContractCode}}</view>
- <view style="margin-top: 20rpx;">合同类型:{{item.ContractType}}</view>
- <view style="margin-top: 20rpx;">合同金额:{{item.Price}}</view>
- </view>
- </view>
-
- </view>
- </view>
- </van-popup>
- <!-- 上传回签附件弹窗确认弹窗 -->
- <van-popup :show="showConfirmCheckBackfile" @close="showConfirmCheckBackfile=false" position="bottom" round>
- <view class="uploadfile-wrap">
- <view style="text-align: center;font-size: 16px;font-weight: bold;">上传回签附件</view>
- <view class="contract-list" style="height: 30vh;">
- <view class="contract-item" v-for="item in checkBackFiles" :key="item.url"
- @click="handlepreViewCheckFile(item)">
- <image class="contract-img" mode="aspectFill" :src="item.img"></image>
- </view>
- </view>
- <button style="width: 450rpx;" @click='handleConfirmCheckBackFile'>确定</button>
- </view>
- </van-popup>
-
- <van-dialog id="van-dialog" />
- </view>
- </template>
- <script>
- import {
- apiSealDetail,
- apiSearchCustome,
- apiSearchContract,
- apiApprovalPass,
- apiInvalidSeal,
- apiApprovalPassModify,
- apiSealCancelApply,
- apiFlowDetail,
- apiSealCheckBackFiles,
- getBelongCompany
- } from '@/api/approve/seal.js'
- import steps from '../components/steps.vue'
- import {preViewFile} from '../utils/util.js'
- import {uploadFiles} from '@/utils/uploadFile.js'
- export default{
- components:{
- steps
- },
- computed:{
- typeLength() {
- if (this.newSealType.length > 0) {
- return true;
- } else {
- return false;
- }
- },
- statusImg(){
- if(this.detail.Status==='已审批'){
- return require('../static/pass-icon.png')
- }else if(this.detail.Status==='已驳回'){
- return require('../static/fail-icon.png')
- }else if(this.detail.Status==='处理中'){
- return require('../static/processing-icon.png')
- }else if(this.detail.Status==='已撤回'){
- return require('../static/recall-icon.png')
- }else if(this.detail.Status==='已作废'){
- return require('../static/cancel-icon.png')
- }else if(this.detail.Status==='已签回'){
- return require('../static/draw-back-icon.png')
- }
- },
- //页面显示的回签附件
- checkBackFilesRes(){
- const reg = /\.(pdf)$/;
- return this.detail&&this.detail.CheckBackFileUrl&&this.detail.CheckBackFileUrl.split("#").map((item) => {
- if (reg.test(item)) {
- return {
- type: "pdf",
- url: item,
- img: require("@/pages-approve/static/pdf.png"),
- };
- } else {
- return {
- type: "word",
- url: item,
- img: require("@/pages-approve/static/word.png"),
- };
- }
- });
- }
- },
- watch: {
- showType() {
- if (!this.showType) {
- this.temType = JSON.parse(JSON.stringify(this.newSealType));
- }
- }
- },
- data() {
- return {
- checkBackFiles:[],// 上传的签回附件文件
- showConfirmCheckBackfile:false,//确认上传的签回附件弹窗
- ContractApprovalId:0,
- ContractApprovalRecordId:0,
- SealId:0,
- processData:null,
- detail:{},
- opButton:{},
- // files:{
- // type:'',
- // img:'',
- // url:''
- // },//合同附件
- // 上传的附件列表 需求更改,可上传多个附件 crm-8.7
- fileList:[],
- showPurpose:false,//显示用印用途选项
- purposeArr: ["销售合同", "代付合同", "总对总协议", "渠道合同", "付款通知函", "招投标", "战略合作协议"],
- showType:false,//显示用印用途选项
- typeArr:['合同章','公章','法人章',"电子合同章"],
- temType: [], //临时存放选择的用印用途
- showCustome:false,//显示搜索客户名称
- searchCustomeVal:'',//搜索客户输入数据
- searchCustomeList:[],//搜索到的客户名称列表
- searchContractList:[],//选择搜索中的客户后合同列表数据
-
- checked:false,//是否同时作废合同
-
- newUse:"",
- newFileNum:'',
- newSealType:[],
- newRemark:'',
- oldFile:'',
- //归属公司弹窗
- showBelongCompanyPop:false,
- belongCompany:'',
- belongCompanyOptions:[]
- }
- },
- onLoad(options) {
- this.ContractApprovalId=options.ContractApprovalId||0
- this.ContractApprovalRecordId=options.ContractApprovalRecordId||0
- this.SealId=options.SealId||0
- this.getDetail()
- this.getBelongCompanyOptions()
- },
- onShow() {
- uni.$once('updateSealDetail',(data)=>{
- console.log('监听到事件来自updateSealDetail ,携带参数 msg 为:' + data.msg);
- this.getDetail()
- })
- },
- onPullDownRefresh() {
- this.getDetail()
- setTimeout(()=>{
- uni.stopPullDownRefresh()
- },1000)
- },
- methods: {
- async getBelongCompanyOptions() {
- const res = await getBelongCompany()
- if(res.code !==200 ) return
- this.belongCompanyOptions = res.data || []
- },
- // 上传(更新)签回附件
- handleUploadCheckFile(){
- wx.chooseMessageFile({
- count:1,
- type:'file',
- success:(res)=>{
- const tempFile=res.tempFiles[0]
- const reg = /\.(pdf)$/;
- const reg2= /\.doc|\.docx$/
- if(!reg.test(tempFile.path)&&!reg2.test(tempFile.path)){
- uni.showToast({
- title:'请上传pdf/word格式文件',
- icon:"none"
- })
- return
- }
- // pdf
- if(reg.test(tempFile.path)){
- this.checkBackFiles=[{type:'pdf',url:tempFile.path,img: require("@/pages-approve/static/pdf.png")}]
- }
- if(reg2.test(tempFile.path)){
- this.checkBackFiles=[{type:'word',url:tempFile.path,img: require("@/pages-approve/static/word.png")}]
- }
- this.showConfirmCheckBackfile=true
- },
- fail:(error)=>{
- if(error.errMsg.indexOf('not supported')){
- uni.showToast({
- title:'请通过手机上传附件',
- icon:'none'
- })
- }
- }
- })
- // const res=await uploadFiles({type:'file'})
- // const reg = /\.(pdf)$/;
- // const reg2= /\.doc|\.docx$/
- // if(reg.test(res[0])){
- // this.checkBackFiles=[{
- // type:'pdf',
- // url:res[0],
- // img:require('../static/pdf.png')
- // }]
- // this.showConfirmCheckBackfile=true
- // }else if(reg2.test(res[0])){
- // this.checkBackFiles=[{
- // type:'word',
- // url:res[0],
- // img:require('../static/word.png')
- // }]
- // this.showConfirmCheckBackfile=true
- // }else{
- // uni.showToast({
- // title:'请上传pdf/word格式文件',
- // icon:"none"
- // })
- // }
- },
- //确认上传的签回附件
- async handleConfirmCheckBackFile(){
- const temres=await apiSealCheckBackFiles({
- SealId:Number(this.detail.SealId),
- tempPath:this.checkBackFiles[0].url
- })
- const res=JSON.parse(temres.data)
- if(res.code===200){
- uni.showToast({
- title:'操作成功',
- icon:'none'
- })
- // 如果是已审批上传回签附件则更新列表页
- if(this.detail.Status==='已审批'){
- this.handleUpdateList()
- }
- setTimeout(()=>{
- this.checkBackFiles=[]
- this.showConfirmCheckBackfile=false
- this.getDetail()
- },500)
- }
-
- // let FileUrlarr=this.checkBackFiles.map(item=>item.url)
- // const res=await apiSealCheckBackFiles({
- //
- // FileUrl:FileUrlarr.join('#')
- // })
- // if(res.code===200){
- // uni.showToast({
- // title:'操作成功',
- // icon:'none'
- // })
- // // 如果是已审批上传回签附件则更新列表页
- // if(this.detail.Status==='已审批'){
- // this.handleUpdateList()
- // }
- // setTimeout(()=>{
- // this.checkBackFiles=[]
- // this.showConfirmCheckBackfile=false
- // this.getDetail()
- // },500)
- // }
- },
- // 预览要上传的签回附件
- handlepreViewCheckFile(){
- uni.openDocument({
- filePath:this.checkBackFiles[0].url,
- showMenu:true,
- success() {
- console.log('打开成功');
- },
- fail(){
- setTimeout(() => {
- uni.showToast({
- title:'打开失败,请重试',
- icon:"none"
- })
- }, 0);
- }
- })
- },
- // 更新列表页
- handleUpdateList(){
- uni.$emit('sealApproveListUpdate',{
- ContractApprovalId:this.ContractApprovalId,
- ContractApprovalRecordId:this.ContractApprovalRecordId,
- SealId:this.SealId
- })
- },
- // 合规删除合同附件
- handleDeleteCheckFile(file){
- this.fileList = this.fileList.filter(item => item.url!= file.url)
- },
- //合规上传附件
- async handleUpload(){
- const res=await uploadFiles({type:'all'})
- const reg = /\.(pdf)$/;
- const reg2 = /\.doc|\.docx$/;
- if (reg.test(res[0])) {
- this.fileList.push({
- type: "pdf",
- url: res[0],
- img: require("../static/pdf.png"),
- });
- } else if (reg2.test(res[0])) {
- this.fileList.push({
- type: "word",
- url: res[0],
- img: require("../static/word.png"),
- });
- } else {
- this.fileList.push({
- type: "img",
- url: res[0],
- img: res[0],
- });
- }
- },
- // 撤回申请
- handleCancelApply(){
- this.$dialog.confirm({
- title: '提示',
- message: '是否确认撤回',
- }).then(async ()=>{
- const res=await apiSealCancelApply({SealId:Number(this.detail.SealId)})
- if(res.code===200){
- uni.showToast({
- title:'撤回成功',
- icon:'none'
- })
- this.handleUpdateList()
- this.getDetail()
- }
- }).catch(() => {
- console.log('取消撤回');
- });
-
- },
- //归属公司选择
- handleComfirmBelongCmpany(e) {
- this.belongCompany = e.detail.value;
- this.showBelongCompanyPop = false;
- },
-
- handlePurposeConfirm(e){
- this.newUse=e.detail.value
- this.showPurpose=false
- },
-
- // 确认盖章类型
- handleTypeConfirm(e){
- this.newSealType=JSON.parse(JSON.stringify(this.temType))
- this.showType=false
- this.getProcessData()
- },
- // 盖章类型变换
- onChangeType(e){
- this.temType=e.detail
- },
-
- //前去重审
- handleEdit(){
- uni.$once('sealEditSubmit',()=>{
- this.handleUpdateList()
- })
- uni.navigateTo({
- url:`./edit?ContractApprovalId=${this.ContractApprovalId}&ContractApprovalRecordId=${this.ContractApprovalRecordId}&SealId=${this.SealId}`
- })
- },
-
- //用印作废
- handleSealInvalid(){
- this.$dialog.confirm({
- title: '提示',
- message: '是否确认作废',
- }).then(async ()=>{
- const res=await apiInvalidSeal({
- IsInvalidContract:this.checked,
- SealId:this.detail.SealId
- })
- if(res.code===200){
- uni.showToast({
- title:'操作成功',
- icon:'none'
- })
- this.handleUpdateList()
- this.getDetail()
- }
- }).catch(() => {
- console.log('取消作废');
- });
-
- },
-
- //点击通过
- handleClickPass(){
- //判断是否有内容修改
- const flag1=this.newUse===this.detail.Use
- const flag2=Number(this.newFileNum)===Number(this.detail.FileNum)
- // const flag3=this.newSealType.join(',')===this.detail.SealType
- const flag3=this.isArrEqual(this.newSealType,this.detail.SealType.split(','))
- const flag4=this.newRemark===this.detail.Remark
- const flag6=this.belongCompany===this.detail.AffiliatedCompany
- const flag5= JSON.stringify(this.fileList.map(file => file.url))===JSON.stringify(this.detail.FileUrls)
- if(flag1&&flag2&&flag3&&flag4&&flag5&&flag6){
- this.handleApprovalPass()
- }else{
- this.handleApprovePassModify()
- }
- },
- //判断两个数组是否相同
- isArrEqual(arr1, arr2){
- return arr1.length === arr2.length && arr1.every((ele) => arr2.includes(ele));
- },
-
- //审批通过 (修改内容)
- async handleApprovePassModify(){
- if(!this.newFileNum){
- uni.showToast({
- title:'请填写文件份数',
- icon:"none"
- })
- return
- }
- if(this.newFileNum<1){
- uni.showToast({
- title:'文件份数不合法',
- icon:"none"
- })
- return
- }
- if(!this.newSealType){
- uni.showToast({
- title:'印章类型不能为空',
- icon:"none"
- })
- return
- }
- if(!this.belongCompany){
- uni.showToast({
- title:'请选择归属公司',
- icon:"none"
- })
- return
- }
- if(!this.newUse){
- uni.showToast({
- title:'请选择用印用途',
- icon:"none"
- })
- return
- }
- if(!this.fileList || this.fileList.length==0){
- uni.showToast({
- title:'合同附件不能为空',
- icon:"none"
- })
- return
- }
- const res=await apiApprovalPassModify({
- FileNum:Number(this.newFileNum),
- Remark:this.newRemark,
- AffiliatedCompany:this.belongCompany,
- SealId:Number(this.detail.SealId),
- SealType:this.newSealType.join(','),
- Use:this.newUse,
- FileUrls:this.fileList.map(file => file.url)
- })
- if(res.code===200){
- this.$dialog.alert({
- title: "处理成功",
- confirmButtonColor: "#5890FB",
- }).then(() => {
- this.handleUpdateList()
- this.getDetail()
- });
- }
- },
-
- // 审批通过 (未修改内容)
- async handleApprovalPass(){
- const res=await apiApprovalPass({
- SealId:Number(this.detail.SealId),
- Remark:""
- })
- if(res.code===200){
- this.$dialog.alert({
- title: "处理成功",
- confirmButtonColor: "#5890FB",
- }).then(() => {
- this.handleUpdateList()
- this.getDetail()
- });
- }
- },
-
- //驳回
- handleApprovalReject(){
- uni.$once('sealApproveReject',()=>{
- this.handleUpdateList()
- })
- uni.navigateTo({
- url:`./reason?SealId=${this.detail.SealId}`
- })
- },
-
- //预览文件
- handlepreViewFile(e){
- if (e.type === "pdf"||e.type==='word') {
- preViewFile(e.url)
- } else {
- uni.previewImage({
- urls: [e.url]
- })
- }
- },
-
- // 只有当 checkEdit 为true 即合规才能修改
- handleOperation(key){
- if(this.opButton.CheckEdit){
- if(key==='showBelongCompanyPop'){
- let index=this.belongCompanyOptions.findIndex(el=>el===this.belongCompany)
- if(index>-1){
- this.$refs.howBelongCompanyRef.setColumnIndex(0, index)
- }
- }else if(key==='showPurpose'){
- let index=this.purposeArr.findIndex(el=>el===this.newUse)
- if(index>-1){
- this.$refs.showPurposeRef.setColumnIndex(0, index)
- }
- }
- this[key]=true
- }
- },
-
- // 客户搜索
- // 先搜索出客户 再通过客户去请求出客户下面存在的合同
- onSearchValChange(e){
- this.searchCustomeVal=e.detail
- },
-
- //搜索客户
- async onSearch(){
- if(!this.searchCustomeVal){
- uni.showToast({
- title:'请输入搜索关键字',
- icon:'none'
- })
- return
- }
- this.searchContractList=[]
- this.searchCustomeList=[]
- const res=await apiSearchCustome({Keyword:this.searchCustomeVal})
- if(res.code===200){
- this.searchCustomeList=res.data
- }
- },
-
- // 搜索客户对应的合同
- async getContract(e){
- const res=await apiSearchContract({Keyword:e})
- if(res.code===200){
- if(res.data.List){
- this.searchContractList=res.data.List
- }else{
- uni.showToast({
- title:"此客户无合同,请重新选择",
- icon:"none"
- })
- }
- }
- },
-
- // 选择合同 更新表单数据
- handleChooseContract(e){
-
- this.detail.CompanyName=e.CompanyName
- this.detail.ServiceType=e.ContractType
- this.detail.CreditCode=e.CreditCode
- this.detail.UseCompanyName=e.CompanyName
- this.detail.ContractId=e.ContractId
- this.detail.ContractfileUrl=e.FileUrl
- // 关闭搜索弹窗
- this.showCustome=false
- this.searchCustomeVal=''
- this.searchContractList=[]
- this.searchCustomeList=[]
- },
- //合同章5 公章、法人章 6
- async getProcessData(){
- if(this.newSealType.length===0) return
- let id=0
- if (this.newSealType.includes("公章") || this.newSealType.includes("法人章")) {
- id = 6;
- } else {
- id = 5;
- }
-
- let res=await apiFlowDetail({FlowId:id})
- if(res.code===200){
- this.processData=res.data||null
- }
- },
-
- //获取详情
- async getDetail() {
- const res=await apiSealDetail({
- ContractApprovalId:Number(this.ContractApprovalId),
- ContractApprovalRecordId:Number(this.ContractApprovalRecordId),
- SealId:Number(this.SealId)
- })
- if(res.code===200){
- this.detail=res.data.SealDetail
- this.newUse=res.data.SealDetail.Use
- this.newFileNum=res.data.SealDetail.FileNum
- this.newSealType=res.data.SealDetail.SealType.split(',')
- this.temType=res.data.SealDetail.SealType.split(',')
- this.newRemark=res.data.SealDetail.Remark
- this.belongCompany=res.data.SealDetail.AffiliatedCompany
- this.processData=res.data.FlowNodeList
- this.opButton=res.data.OpButton
- this.handleFile(res.data.SealDetail.FileUrls)
- }
- },
-
- //处理文件
- handleFile(filesUrls){
- // 清空 防止操作成功后再获取详情 数组叠加
- this.fileList=[]
- const reg = /\.(pdf)$/;
- const reg2= /\.doc|\.docx$/
- filesUrls.map(filesUrl=>{
- if(reg.test(filesUrl)){
- this.fileList.push({
- type: "pdf",
- url: filesUrl,
- img: require("../static/pdf.png"),
- })
- }else if(reg2.test(filesUrl)){
- this.fileList.push({
- type: "word",
- url: filesUrl,
- img: require("../static/word.png"),
- })
- }else{
- this.fileList.push({
- type: "img",
- url: filesUrl,
- img: filesUrl,
- })
- }
- })
- },
- },
- }
- </script>
- <style lang="scss">
- .uploadfile-wrap{
- width: 100%;
- height: 50vh;
- background-color: #FFFFFF;
- padding: 32rpx;
- button {
- margin-left: auto;
- margin-right: auto;
- width: 260rpx;
- height: 70rpx;
- display: block;
- border-radius: 28px;
- border: none;
- font-size: 15px;
- color: #fff;
- line-height: 70rpx;
- background-color: #5890fb;
- }
- .contract-list {
- display: flex;
- flex-wrap: wrap;
-
- .contract-img {
- width: 102rpx;
- height: 120rpx;
- margin-right: 20rpx;
- margin-bottom: 20rpx;
- }
- }
- }
- .check-file-contain{
- display: flex;
- flex-wrap: wrap;
- .check-file-box{
- width: 102rpx;
- height: 120rpx;
- background-size: cover;
- background-position: center;
- position: relative;
- margin: 0 16rpx;
- .del-icon{
- position: absolute;
- width: 30rpx;
- height: 30rpx;
- top: -15rpx;
- right: -15rpx;
- }
- }
- }
- .detail{
- width: 100%;
- min-height: 100vh;
- padding-bottom: calc(150rpx + constant(safe-area-inset-bottom));
- padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
- position: relative;
- }
- .status-img{
- position: absolute;
- right: 0;
- top: 320rpx;
- width: 220rpx;
- height: 220rpx;
- z-index: 10;
- }
- .section{
- padding: 30rpx 34rpx;
- border-top: 10rpx solid #F5F5F5;
- position: relative;
- .section-title{
- font-size: 16px;
- margin-bottom: 20rpx;
- span{
- font-size: 28rpx;
- font-family: PingFang SC-Regular, PingFang SC;
- font-weight: 400;
- color: #999999;
- -webkit-background-clip: text;
- background-clip: text;
- }
- .tip {
- font-size: 12px;
- color: #999;
- }
- }
- .require::before{
- content: '*';
- font-size: 16px;
- color: #FF0000;
- position: absolute;
- left: 20rpx;
- }
- .section-select-box{
- color: #999;
- position: relative;
- &::after{
- position: absolute;
- right: 0;
- top: 50%;
- content: '';
- display: block;
- width: 18rpx;
- height: 18rpx;
- border-top: 1px solid #999;
- border-right: 1px solid #999;
- transform: translateY(-50%) rotate(45deg);
- }
- }
- }
-
- .btn-big{
- width: 450rpx;
- }
- .btn-small{
- min-width: 220rpx;
- }
- .fix-bottom-wrap{
- button{
- height: 70rpx;
- font-size: 15px;
- }
- }
-
-
- .custome-search-wrap{
- padding: 34rpx;
- height: 100%;
- .search-box {
- border: 1px solid #3385FF;
- padding: 0 !important;
- border-radius: 60rpx;
- background-color: #fff !important;
- }
-
- .search-con {
- background-color: #fff !important;
- }
-
- .van-search__content {
- background-color: #fff !important;
- padding-left: 30rpx !important;
- }
-
- .search-btn {
- position: relative;
- color: #3385FF;
- &::before {
- content: '';
- display: block;
- width: 1px;
- height: 60%;
- background-color: #D1D1D1;
- position: absolute;
- left: -16rpx;
- top: 20%;
- }
- }
- .search-icon{
- width: 40rpx;
- height: 40rpx;
- display: block;
- position: relative;
- top: 4rpx;
- margin-right: 20rpx;
- }
-
- .click-icon{
- width: 24rpx;
- height: 24rpx;
- }
- .result-item{
- align-items: center;
- padding: 20rpx 0;
- border-bottom: 1px solid #EBEBEB;
- .con{
- flex: 1;
- margin-right: 20rpx;
- }
- }
- .search-result{
- overflow-y: auto;
- height: 100%;
- }
-
- .result-contract-box{
- padding: 0 10rpx;
- .result-contract-item{
- margin-top: 30rpx;
- box-shadow: 0px 0px 12rpx rgba(175, 175, 175, 0.38);
- padding: 30rpx;
- border-radius: 8px;
- .name{
- font-size: 16px;
- font-weight: bold;
- &::before{
- content:'';
- display:inline-block;
- width: 31rpx;
- height: 34rpx;
- background-image: url(../../static/man.png);
- background-size: cover;
- position: relative;
- top: 4rpx;
- margin-right: 10rpx;
- }
- }
- }
- }
- }
- .type-popup-wrap{
- padding: 20rpx 32rpx;
- height: 280px;
- .top-title{
- justify-content: space-between;
- margin-bottom: 124rpx;
- }
- .van-checkbox{
- margin-bottom: 30rpx;
- width: 300rpx;
- margin-left: auto;
- margin-right: auto;
- }
- }
- </style>
|