123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563 |
- <template>
- <view class="add-page white-wrap" @click="handleClickPage">
- <view class="section white-wrap">
- <view class="section-title require">归属公司
- <span class="tip">(归属公司:申请用章公司)</span>
- </view>
- <view class="section-select-box" :style="{color:belongCompany?'#333':'#999'}" @click="showBelongCompanyPop=true">{{belongCompany?belongCompany:'请选择'}}</view>
- </view>
-
- <view class="section white-wrap">
- <view class="section-title require">用印用途</view>
- <view class="section-select-box" :style="{color:purpose?'#333':'#999'}" @click="showPurpose=true">{{purpose?purpose:'请选择'}}</view>
- </view>
-
- <view class="section white-wrap">
- <van-radio-group :value="radioVal" @change="radioChange" direction="horizontal">
- <van-radio name="系统合同" style="margin-right: 70px;">系统合同</van-radio>
- <van-radio name="上传附件">上传附件</van-radio>
- </van-radio-group>
- </view>
-
- <!-- 系统合同模块 -->
- <view v-if="radioVal==='系统合同'">
- <view class="section white-wrap">
- <view class="section-title require">客户名称(全称)</view>
- <view
- class="section-select-box"
- :style="{color:customeName?'#333':'#999'}"
- @click="showCustome=true"
- >
- {{customeName?customeName:'请输入客户名称'}}
- </view>
- </view>
- <view class="section white-wrap" v-if="CreditCode">
- <view class="section-title require">统一社会信用码</view>
- <input type="text" v-model="CreditCode" placeholder="请填写统一社会信用码" disabled/>
- </view>
- <view class="section white-wrap" v-if="UseCompanyName">
- <view :class="['section-title',purpose=='代付合同'?'require':'']">实际使用方名称</view>
- <input type="text" v-model="UseCompanyName" placeholder="请填写实际使用方名称" disabled/>
- </view>
- <view class="section white-wrap" v-if="ServiceType">
- <view class="section-title require">业务类型</view>
- <view :style="{color:ServiceType?'#333':'#999'}">{{ServiceType?ServiceType:'请选择业务类型'}}</view>
- </view>
- </view>
- <!-- 上传附件模块 -->
- <view v-if="radioVal==='上传附件'">
- <view class="section white-wrap" style="position:relative">
- <view class="section-title require">客户名称(全称)</view>
- <input type="text" v-model="customeName" @input="handleAllCutomeInput" placeholder="请输入客户名称"/>
- <view class="show-all-custome-box" v-if="allCustome.list.length>0">
- <scroll-view scroll-y @scrolltolower="handleScrollToLower" style="height: 100%;width:100%">
- <view
- class="all-custome-item"
- v-for="item in allCustome.list"
- :key="item.CompanyId"
- @click="chooseAllCustomeItem(item)"
- >{{item.CompanyName}}</view>
- </scroll-view>
- </view>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">统一社会信用码</view>
- <input type="text" v-model="CreditCode" placeholder="请填写统一社会信用码"/>
- </view>
- <view class="section white-wrap">
- <view :class="['section-title',purpose=='代付合同'?'require':'']">实际使用方名称</view>
- <input type="text" v-model="UseCompanyName" placeholder="请填写实际使用方名称"/>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">业务类型</view>
- <view class="section-select-box" :style="{color:ServiceType?'#333':'#999'}" @click="showServiceType=true">{{ServiceType?ServiceType:'请选择业务类型'}}</view>
- </view>
- </view>
-
- <view class="section white-wrap">
- <view class="section-title require">文件份数</view>
- <input type="number" v-model="fileNum" placeholder="请填写总共盖章文件份数"/>
- </view>
- <view class="section white-wrap">
- <view class="section-title require">加盖何种印章</view>
- <view class="section-select-box" :style="{color:typeLength?'#333':'#999'}" @click="showType=true">{{type.length>0?type.join(','):'请选择'}}</view>
- </view>
- <view class="section white-wrap">
- <view class="section-title">备注</view>
- <textarea type="text" auto-height v-model="remark" placeholder="请填写备注"></textarea>
- </view>
- <view class="section white-wrap" v-if="radioVal==='系统合同'&&ContractfileUrl">
- <view class="section-title require">合同附件</view>
- <image src="../static/pdf.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;" @click="handlePreviewFiles({type:'pdf',url:ContractfileUrl})"></image>
- </view>
- <view class="section white-wrap" v-if="radioVal==='上传附件'">
- <view class="section-title require">附件上传</view>
- <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="handlePreviewFiles(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 process-wrap" v-if="processData">
- <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;">
- <van-button type="info" custom-class="btn" round @click="handleSubmit">提交</van-button>
- </view>
-
-
- <!-- 归属公司 -->
- <van-popup :show="showBelongCompanyPop" @close="showBelongCompanyPop=false" position="bottom">
- <van-picker
- show-toolbar
- title="选择归属公司"
- :columns="belongCompanyOptions"
- @confirm="handleComfirmBelongCmpany"
- @cancel="showBelongCompanyPop=false"
- />
- </van-popup>
- <!-- 用印用途 -->
- <van-popup :show="showPurpose" @close="showPurpose=false" position="bottom">
- <van-picker
- 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="showServiceType" @close="showServiceType=false" position="bottom">
- <van-picker
- show-toolbar
- title="选择业务类型"
- :columns="ServiceTypeArr"
- @confirm="handleServiceTypeConfirm"
- @cancel="showServiceType=false"
- />
- </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">
- <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="!searchCustomeStatus"/>
- <view v-else>
- <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>
- <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>
- </view>
- </template>
- <script>
- import steps from "../components/steps.vue";
- import { apiSealAdd } from "@/api/approve/seal.js";
- import {sealMixin} from './mixin'
- export default{
- components: {
- steps,
- },
- mixins: [sealMixin],
- data() {
- return {
- ContractfileUrl:'',//合同文件地址 pdf
- }
- },
- onLoad() {
- this.getBelongCompanyOptions('add')
- },
- methods: {
- // 选择合同 更新表单数据
- handleChooseContract(e){
-
- this.customeName=e.CompanyName
- this.CreditCode=e.CreditCode
- this.ServiceType=e.ContractType
- this.UseCompanyName=e.ContractBusinessType=='代付合同'?e.UseCompanyName:e.CompanyName
- this.ContractId=e.ContractId
- this.ContractfileUrl=e.FileUrl
- // 关闭搜索弹窗
- this.showCustome=false
- this.searchCustomeVal=''
- this.searchContractList=[]
- this.searchCustomeList=[]
- },
-
- // 系统合同 上传附件类型切换
- radioChange(e){
- this.radioVal=e.detail
- this.customeName=''
- this.CreditCode=''
- this.ServiceType=''
- this.UseCompanyName=''
- this.ContractfileUrl=''
- this.fileUrlArr=[]
- },
-
- // 提交申请
- async handleSubmit(){
- let fileUrls=''
- if(this.radioVal==='系统合同'){
- fileUrls=[this.ContractfileUrl]
- }else{
- fileUrls=this.fileList.map(item => item.url)
- }
-
- let params={
- CompanyName:this.customeName,
- ContractId:this.ContractId,
- CreditCode:this.CreditCode,
- FileUrls:fileUrls,
- FileNum:Number(this.fileNum),
- Remark:this.remark,
- SealType:this.type.join(','),
- ServiceType:this.ServiceType,
- Use:this.purpose,
- UseCompanyName:this.UseCompanyName,
- AffiliatedCompany: this.belongCompany
- }
-
- if(!params.AffiliatedCompany){
- uni.showToast({
- title:'请选择归属公司',
- icon:"none"
- })
- return
- }
- if(!params.Use){
- uni.showToast({
- title:'请选择用印用途',
- icon:"none"
- })
- return
- }
- if(!params.CompanyName){
- uni.showToast({
- title:'客户名称不能为空',
- icon:"none"
- })
- return
- }
- if(!params.CreditCode){
- uni.showToast({
- title:'信用代码不能为空',
- icon:"none"
- })
- return
- }
- if(!params.ServiceType){
- uni.showToast({
- title:'业务类型不能为空',
- icon:"none"
- })
- return
- }
- if(!params.FileNum){
- uni.showToast({
- title:'请填写文件份数',
- icon:"none"
- })
- return
- }
- if(params.FileNum<1){
- uni.showToast({
- title:'文件份数不合法',
- icon:"none"
- })
- return
- }
- if(!params.SealType){
- uni.showToast({
- title:'印章类型不能为空',
- icon:"none"
- })
- return
- }
- if(!params.FileUrls){
- uni.showToast({
- title:'请上传文件',
- icon:"none"
- })
- return
- }
- // 代付合同 实际使用方必填
- if(params.Use=='代付合同'){
- if(!params.UseCompanyName&&this.radioVal==='上传附件'){
- uni.showToast({
- title:'请填写实际使用方',
- icon:"none"
- })
- return
- }
- }
- console.log(params);
-
- const res=await apiSealAdd(params)
- if(res.code===200){
- uni.showToast({
- title:"用印申请单已提交",
- icon:"none"
- })
- uni.$emit('sealApproveListUpdate',{
- ContractApprovalId:0,
- ContractApprovalRecordId:0,
- SealId:0
- })
- setTimeout(()=>{
- uni.navigateBack({
- delta:1
- })
- },1000)
- }
- }
- },
- }
- </script>
- <style lang="scss">
- .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;
- }
- }
- }
- .add-page{
- width: 100%;
- min-height: 100vh;
- padding-bottom: calc(150rpx + constant(safe-area-inset-bottom));
- padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
- }
- .section{
- padding: 30rpx 34rpx;
- border-top: 10rpx solid #F5F5F5;
- position: relative;
- textarea{
- width: 100%;
- height: 200rpx;
- }
- .section-title{
- font-size: 16px;
- margin-bottom: 20rpx;
- .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);
- }
- }
- .show-all-custome-box{
- top: 100%;
- width: 85vw;
- height: 440rpx;
- z-index: 10;
- padding: 30rpx 40rpx;
- position: absolute;
- background: #FFFFFF;
- box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.16);
- .all-custome-item{
- margin-bottom: 30rpx;
- }
- }
- }
- .fix-bottom-wrap{
- .btn{
- width: 400rpx;
- height: 70rpx;
- font-size: 15px;
- }
- }
-
-
- .radio-wrap{
- .radio{
- font-size: 14px;
- &::before{
- content: '';
- display: inline-block;
- }
- }
- }
-
- .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>
|