jwyu 3 lat temu
rodzic
commit
89279a09eb

+ 33 - 181
pages-approve/seal/addSeal.vue

@@ -63,7 +63,7 @@
 		</view>
 		<view class="section white-wrap">
 			<view class="section-title require">加盖何种印章</view>
-			<view class="section-select-box" :style="{color:type?'#333':'#999'}" @click="showType=true">{{type?type:'请选择'}}</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>
@@ -104,13 +104,16 @@
 		</van-popup>
 		<!-- 何种印章 -->
 		<van-popup :show="showType" @close="showType=false" position="bottom">
-			<van-picker 
-				show-toolbar 
-				title="选择何种印章" 
-				:columns="typeArr" 
-				@confirm="handleTypeConfirm"  
-				@cancel="showType=false"
-			/>
+			<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>
 		
 		<!-- 业务类型 -->
@@ -161,152 +164,20 @@
 </template>
 
 <script>
-	import steps from '../components/steps.vue'
-	import {apiFlowDetail,apiSealAdd,apiSearchCustome,apiSearchContract} from '@/api/approve/seal.js'
-	import {uploadFiles} from '@/utils/uploadFile.js'
-	import {preViewFile} from '../utils/util.js'
+	import steps from "../components/steps.vue";
+	import { apiSealAdd } from "@/api/approve/seal.js";
+	import {sealMixin} from './mixin'
 	export default{ 
-		components:{
-			steps
-		},
-		watch:{
-			showCustome(){
-				this.searchCustomeVal=''
-				this.searchCustomeStatus=true 
-				this.searchCustomeList=[]
-				this.searchContractList=[]
-			}
+		components: {
+			steps,
 		},
+		mixins: [sealMixin],
 		data() {
 			return {
-				showPurpose:false,//显示用印用途选项
-				purposeArr:['销售合同','渠道合同','付款通知函','招投标','战略合作协议'],
-				purpose:"",
-				
-				showType:false,//显示用印用途选项
-				typeArr:['合同章','公章','法人章'],
-				type:"",
-				
-				showServiceType:false,//显示业务类型选项
-				ServiceTypeArr:['新签合同','续约合同','补充协议'],
-				ServiceType:'',//业务类型
-				
-				
-				showCustome:false,//显示搜索客户名称
-				customeName: '',//客户名称
-				fileNum:'',//文件数
-				remark:'',//备注
-				CreditCode:'',//社会统一信用代码
-				
-				UseCompanyName:'',//实际使用方客户名称
-				ContractId:0,//合同id
 				ContractfileUrl:'',//合同文件地址 pdf
-				
-				file:{
-					type:'',
-					img:'',
-					url:''
-				},//上传附件 文件
-				
-				processData:null,//流程数据
-				
-				radioVal:'系统合同',
-				
-				searchCustomeVal:'',//搜索客户输入数据
-				searchCustomeStatus:true,//搜索客户 是否有结果
-				searchCustomeList:[],//搜索到的客户名称列表
-				searchContractList:[],//选择搜索中的客户后合同列表数据
 			}
 		},
 		methods: {
-			//删除上传的附件
-			handleDeleteCheckFile(){
-				this.file={
-					type:'',
-					img:'',
-					url:''
-				}
-			},
-
-			//预览文件
-			handlePreviewFiles(e){
-				if (e.type === "pdf"||e.type==='word') {
-					preViewFile(e.url)
-				} else {
-					uni.previewImage({
-						urls: [e.url]
-					})
-				}
-			},
-			
-			//上传附件
-			async handleUpload(){
-				const res=await uploadFiles({type:'all'})
-				const reg = /\.(pdf)$/;
-				const reg2=	/\.doc|\.docx$/
-				if(reg.test(res[0])){
-					this.file={
-						type:'pdf',
-						url:res[0],
-						img:require('../static/pdf.png')
-					}
-				}else if(reg2.test(res[0])){
-					this.file={
-						type:'word',
-						url:res[0],
-						img:require('../static/word.png')
-					}
-				}else{
-					this.file={
-						type:'img',
-						url:res[0],
-						img:res[0]
-					}
-				}
-			},
-			
-			// 客户搜索 
-			// 先搜索出客户 再通过客户去请求出客户下面存在的合同
-			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
-					if(res.data.length===0){
-						this.searchCustomeStatus=false
-					}else{
-						this.searchCustomeStatus=true
-					}
-				}
-			},
-			
-			// 搜索客户对应的合同
-			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){
@@ -335,40 +206,6 @@
 				this.fileUrlArr=[]
 			},
 			
-			// 选择用印用途
-			handlePurposeConfirm(e) {
-				this.purpose=e.detail.value 
-				this.showPurpose=false
-			},
-			
-			//选择盖章类型
-			handleTypeConfirm(e){
-				this.type=e.detail.value
-				this.showType=false
-				this.getProcessData()
-			},
-			
-			//选择业务类型
-			handleServiceTypeConfirm(e){
-				this.ServiceType=e.detail.value
-				this.showServiceType=false
-			},
-			
-			//合同章5  公章、法人章 6
-			async getProcessData(){
-				let id=0
-				if(this.type==='合同章'){
-					id=5
-				}else{
-					id=6
-				}
-				
-				let res=await apiFlowDetail({FlowId:id})
-				if(res.code===200){
-					this.processData=res.data||null
-				}
-			},
-			
 			// 提交申请
 			async handleSubmit(){
 				let fileUrl=''
@@ -385,7 +222,7 @@
 					FileUrl:fileUrl,
 					FileNum:Number(this.fileNum),
 					Remark:this.remark,
-					SealType:this.type,
+					SealType:this.type.join(','),
 					ServiceType:this.ServiceType,
 					Use:this.purpose,
 					UseCompanyName:this.UseCompanyName,
@@ -633,4 +470,19 @@
 			}
 		}
 	}
+
+	.type-popup-wrap{
+		padding: 20rpx 32rpx;
+		height: 250px;
+		.top-title{
+			justify-content: space-between;
+			margin-bottom: 124rpx;
+		}
+		.van-checkbox{
+			margin-bottom: 30rpx;
+			width: 200rpx;
+			margin-left: auto;
+			margin-right: auto;
+		}
+	}
 </style>

+ 87 - 40
pages-approve/seal/detail.vue

@@ -3,7 +3,7 @@
 		<image :src="statusImg" mode="aspectFill" class="status-img" v-if="statusImg"></image>
 		<view class="section white-wrap">
 			<view class="section-title require">用印用途</view>
-			<view :class="opButton.CheckEdit?'section-select-box':null" :style="{color:oldUse?'#333':'#999'}" @click="handleOperation('showPurpose')">{{oldUse?oldUse:'请选择'}}</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>
@@ -23,11 +23,11 @@
 		</view>
 		<view class="section white-wrap">
 			<view class="section-title require">文件份数</view>
-			<input type="number" v-model="oldFileNum" placeholder="请填写总共盖章文件份数" :disabled="!opButton.CheckEdit"/>
+			<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:oldSealType?'#333':'#999'}" @click="handleOperation('showType')">{{oldSealType?oldSealType:'请选择'}}</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">合同附件</view>
@@ -52,7 +52,7 @@
 		</view>
 		<view class="section white-wrap">
 			<view class="section-title">备注</view>
-			<textarea type="text" auto-height v-model="oldRemark" placeholder="请填写备注" :disabled="!opButton.CheckEdit"></textarea>
+			<textarea type="text" auto-height v-model="newRemark" placeholder="请填写备注" :disabled="!opButton.CheckEdit"></textarea>
 		</view>
 		<!-- 签回附件模块 -->
 		<view class="section white-wrap" v-if="checkBackFilesRes.length>0">
@@ -109,13 +109,16 @@
 		</van-popup>
 		<!-- 何种印章 -->
 		<van-popup :show="showType" @close="showType=false" position="bottom">
-			<van-picker 
-				show-toolbar 
-				title="选择何种印章" 
-				:columns="typeArr" 
-				@confirm="handleTypeConfirm"  
-				@cancel="showType=false"
-			/>
+			<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>
 		
 		<!-- 客户搜索 -->
@@ -187,6 +190,14 @@
 			steps
 		},
 		computed:{
+			typeLength() {
+				if (this.newSealType.length > 0) {
+					return true;
+				} else {
+					return false;
+				}
+			},
+
 			statusImg(){
 				if(this.detail.Status==='已审批'){
 					return require('../static/pass-icon.png')
@@ -220,14 +231,20 @@
 						};
 					}
 				});
-			},
+			}
+		},
+		watch: {
+			showType() {
+				if (!this.showType) {
+					this.temType = JSON.parse(JSON.stringify(this.newSealType));
+				}
+			},			
 		},
 		data() {
 			return {
 				checkBackFiles:[],// 上传的签回附件文件
 				showConfirmCheckBackfile:false,//确认上传的签回附件弹窗
 
-				val:'',
 				ContractApprovalId:0,
 				ContractApprovalRecordId:0,
 				SealId:0,
@@ -241,10 +258,12 @@
 				},//合同附件
 				
 				showPurpose:false,//显示用印用途选项
-				purposeArr:['销售合同','渠道合同','付款通知函','招投标','战略合作协议'],
+				purposeArr: ["销售合同", "代付合同", "总对总协议", "渠道合同", "付款通知函", "招投标", "战略合作协议"],
 
 				showType:false,//显示用印用途选项
 				typeArr:['合同章','公章','法人章'],
+				temType: [], //临时存放选择的用印用途
+
 				showCustome:false,//显示搜索客户名称
 				searchCustomeVal:'',//搜索客户输入数据
 				searchCustomeList:[],//搜索到的客户名称列表
@@ -252,10 +271,10 @@
 				
 				checked:false,//是否同时作废合同
 				
-				oldUse:"",
-				oldFileNum:'',
-				oldSealType:'',
-				oldRemark:'',
+				newUse:"",
+				newFileNum:'',
+				newSealType:[],
+				newRemark:'',
 				oldFile:''
 			}
 		},
@@ -471,15 +490,21 @@
 			},
 			
 			handlePurposeConfirm(e){
-				this.oldUse=e.detail.value
+				this.newUse=e.detail.value
 				this.showPurpose=false
 			},
 			
+			// 确认盖章类型
 			handleTypeConfirm(e){
-				this.oldSealType=e.detail.value
+				this.newSealType=JSON.parse(JSON.stringify(this.temType))
 				this.showType=false
 				this.getProcessData()
 			},
+
+			// 盖章类型变换
+			onChangeType(e){
+				this.temType=e.detail
+			},
 			
 			//前去重审
 			handleEdit(){
@@ -518,10 +543,11 @@
 			//点击通过
 			handleClickPass(){
 				//判断是否有内容修改
-				const flag1=this.oldUse===this.detail.Use 
-				const flag2=Number(this.oldFileNum)===Number(this.detail.FileNum)
-				const flag3=this.oldSealType===this.detail.SealType
-				const flag4=this.oldRemark===this.detail.Remark
+				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 flag5=this.files.url===this.detail.FileUrl
 				if(flag1&&flag2&&flag3&&flag4&&flag5){
 					this.handleApprovalPass()
@@ -529,31 +555,36 @@
 					this.handleApprovePassModify()
 				}
 			},
+
+			//判断两个数组是否相同
+			isArrEqual(arr1, arr2){
+				return arr1.length === arr2.length && arr1.every((ele) => arr2.includes(ele));
+			};
 			
 			//审批通过 (修改内容)
 			async handleApprovePassModify(){
-				if(!this.oldFileNum){
+				if(!this.newFileNum){
 					uni.showToast({
 						title:'请填写文件份数',
 						icon:"none"
 					})
 					return
 				}
-				if(this.oldFileNum<1){
+				if(this.newFileNum<1){
 					uni.showToast({
 						title:'文件份数不合法',
 						icon:"none"
 					})
 					return
 				}
-				if(!this.oldSealType){
+				if(!this.newSealType){
 					uni.showToast({
 						title:'印章类型不能为空',
 						icon:"none"
 					})
 					return
 				}
-				if(!this.oldUse){
+				if(!this.newUse){
 					uni.showToast({
 						title:'请选择用印用途',
 						icon:"none"
@@ -568,11 +599,11 @@
 					return
 				}
 				const res=await apiApprovalPassModify({
-					FileNum:Number(this.oldFileNum),
-					Remark:this.oldRemark,
+					FileNum:Number(this.newFileNum),
+					Remark:this.newRemark,
 					SealId:Number(this.detail.SealId),
-					SealType:this.oldSealType,
-					Use:this.oldUse,
+					SealType:this.newSealType.join(','),
+					Use:this.newUse,
 					FileUrl:this.files.url
 				})
 				if(res.code===200){
@@ -688,10 +719,10 @@
 			//合同章5  公章、法人章 6
 			async getProcessData(){
 				let id=0
-				if(this.type==='合同章'){
-					id=5
-				}else{
-					id=6
+				if (this.newSealType.includes("公章") || this.newSealType.includes("法人章")) {
+					id = 6;
+				} else {
+					id = 5;
 				}
 				
 				let res=await apiFlowDetail({FlowId:id})
@@ -709,10 +740,11 @@
 				})
 				if(res.code===200){
 					this.detail=res.data.SealDetail
-					this.oldUse=res.data.SealDetail.Use
-					this.oldFileNum=res.data.SealDetail.FileNum
-					this.oldSealType=res.data.SealDetail.SealType
-					this.oldRemark=res.data.SealDetail.Remark
+					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.processData=res.data.FlowNodeList
 					this.opButton=res.data.OpButton
 					this.handleFile(res.data.SealDetail.FileUrl)
@@ -940,4 +972,19 @@
 			}
 		}
 	}
+
+	.type-popup-wrap{
+		padding: 20rpx 32rpx;
+		height: 250px;
+		.top-title{
+			justify-content: space-between;
+			margin-bottom: 124rpx;
+		}
+		.van-checkbox{
+			margin-bottom: 30rpx;
+			width: 200rpx;
+			margin-left: auto;
+			margin-right: auto;
+		}
+	}
 </style>

+ 35 - 185
pages-approve/seal/edit.vue

@@ -56,7 +56,7 @@
 		</view>
 		<view class="section white-wrap">
 			<view class="section-title require">加盖何种印章</view>
-			<view class="section-select-box" :style="{color:type?'#333':'#999'}" @click="showType=true">{{type?type:'请选择'}}</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>
@@ -99,13 +99,16 @@
 		</van-popup>
 		<!-- 何种印章 -->
 		<van-popup :show="showType" @close="showType=false" position="bottom">
-			<van-picker 
-				show-toolbar 
-				title="选择何种印章" 
-				:columns="typeArr" 
-				@confirm="handleTypeConfirm"  
-				@cancel="showType=false"
-			/>
+			<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>
 		
 		<!-- 业务类型 -->
@@ -156,64 +159,17 @@
 </template>
 
 <script>
-	import steps from '../components/steps.vue'
-	import {apiFlowDetail,apiSealEdit,apiSearchCustome,apiSearchContract,apiSealDetail} from '@/api/approve/seal.js'
-	import {uploadFiles} from '@/utils/uploadFile.js'
-	import {preViewFile} from '../utils/util.js'
+	import steps from "../components/steps.vue";
+	import {sealMixin} from './mixin'
+	import { apiSealDetail,apiSealEdit } from "@/api/approve/seal.js";
 	export default{ 
-		components:{
-			steps
-		},
-		watch:{
-			showCustome(){
-				this.searchCustomeVal=''
-				this.searchCustomeStatus=true 
-				this.searchCustomeList=[]
-				this.searchContractList=[]
-			}
+		components: {
+			steps,
 		},
+		mixins: [sealMixin],
 		data() {
 			return {
 				SealId:0,
-				showPurpose:false,//显示用印用途选项
-				purposeArr:['销售合同','渠道合同','付款通知函','招投标','战略合作协议'],
-				purpose:"",
-				
-				showType:false,//显示用印用途选项
-				typeArr:['合同章','公章','法人章'],
-				type:"",
-				
-				showServiceType:false,//显示业务类型选项
-				ServiceTypeArr:['新签合同','续约合同','补充协议'],
-				ServiceType:'',//业务类型
-				
-				
-				showCustome:false,//显示搜索客户名称
-				customeName: '',//客户名称
-				fileNum:'',//文件数
-				remark:'',//备注
-				CreditCode:'',//社会统一信用代码
-				
-				UseCompanyName:'',//实际使用方客户名称
-				ContractId:0,//合同id
-				// ContractfileUrl:'',//合同文件地址 pdf
-				
-				// fileUrlArr:[],//上传附件 文件地址
-
-				file:{
-					type:'',
-					img:'',
-					url:''
-				},
-				
-				processData:null,//流程数据
-				
-				radioVal:'系统合同',
-				
-				searchCustomeVal:'',//搜索客户输入数据
-				searchCustomeStatus:true,//搜索客户 是否有结果
-				searchCustomeList:[],//搜索到的客户名称列表
-				searchContractList:[],//选择搜索中的客户后合同列表数据
 			}
 		},
 		onLoad(options) {
@@ -223,26 +179,7 @@
 			this.getDetail({ContractApprovalId,ContractApprovalRecordId,SealId})
 		},
 		methods: {
-			//删除上传的附件
-			handleDeleteCheckFile(){
-				this.file={
-					type:'',
-					img:'',
-					url:''
-				}
-			},
-
-			//预览文件
-			handlePreviewFiles(e){
-				if (e.type === "pdf"||e.type==='word') {
-					preViewFile(e.url)
-				} else {
-					uni.previewImage({
-						urls: [e.url]
-					})
-				}
-			},
-
+			
 			// 获取详情
 			async getDetail({ContractApprovalId,ContractApprovalRecordId,SealId}){
 				const res=await apiSealDetail({
@@ -258,7 +195,8 @@
 					}
 					this.SealId=res.data.SealDetail.SealId
 					this.purpose=res.data.SealDetail.Use
-					this.type=res.data.SealDetail.SealType
+					this.type=res.data.SealDetail.SealType.split(',')
+					this.temType=res.data.SealDetail.SealType.split(',')
 					this.ServiceType=res.data.SealDetail.ServiceType
 					this.customeName=res.data.SealDetail.CompanyName
 					this.fileNum=res.data.SealDetail.FileNum
@@ -297,75 +235,6 @@
 				}
 			},
 			
-			//上传附件
-			async handleUpload(){
-				const res=await uploadFiles({type:'all'})
-				const reg = /\.(pdf)$/;
-				const reg2=	/\.doc|\.docx$/
-				if(reg.test(res[0])){
-					this.file={
-						type:'pdf',
-						url:res[0],
-						img:require('../static/pdf.png')
-					}
-				}else if(reg2.test(res[0])){
-					this.file={
-						type:'word',
-						url:res[0],
-						img:require('../static/word.png')
-					}
-				}else{
-					this.file={
-						type:'img',
-						url:res[0],
-						img:res[0]
-					}
-				}
-			},
-			
-			// 客户搜索 
-			// 先搜索出客户 再通过客户去请求出客户下面存在的合同
-			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
-					if(res.data.length===0){
-						this.searchCustomeStatus=false
-					}else{
-						this.searchCustomeStatus=true
-					}
-				}
-			},
-			
-			// 搜索客户对应的合同
-			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){
 				
@@ -383,40 +252,6 @@
 				this.searchCustomeList=[]
 			},
 			
-			// 选择用印用途
-			handlePurposeConfirm(e) {
-				this.purpose=e.detail.value 
-				this.showPurpose=false
-			},
-			
-			//选择盖章类型
-			handleTypeConfirm(e){
-				this.type=e.detail.value
-				this.showType=false
-				this.getProcessData()
-			},
-			
-			//选择业务类型
-			handleServiceTypeConfirm(e){
-				this.ServiceType=e.detail.value
-				this.showServiceType=false
-			},
-			
-			//合同章5  公章、法人章 6
-			async getProcessData(){
-				let id=0
-				if(this.type==='合同章'){
-					id=5
-				}else{
-					id=6
-				}
-				
-				let res=await apiFlowDetail({FlowId:id})
-				if(res.code===200){
-					this.processData=res.data||[]
-				}
-			},
-			
 			// 提交申请
 			async handleSubmit(){
 				
@@ -667,4 +502,19 @@
 			}
 		}
 	}
+
+	.type-popup-wrap{
+		padding: 20rpx 32rpx;
+		height: 250px;
+		.top-title{
+			justify-content: space-between;
+			margin-bottom: 124rpx;
+		}
+		.van-checkbox{
+			margin-bottom: 30rpx;
+			width: 200rpx;
+			margin-left: auto;
+			margin-right: auto;
+		}
+	}
 </style>

+ 197 - 0
pages-approve/seal/mixin.js

@@ -0,0 +1,197 @@
+import { apiFlowDetail, apiSealAdd, apiSearchCustome, apiSearchContract } from "@/api/approve/seal.js";
+import { uploadFiles } from "@/utils/uploadFile.js";
+import { preViewFile } from "../utils/util.js";
+export const sealMixin = {
+    computed: {
+        typeLength() {
+            if (this.type.length > 0) {
+                return true;
+            } else {
+                return false;
+            }
+        },
+    },
+    watch: {
+        showCustome() {
+            this.searchCustomeVal = "";
+            this.searchCustomeStatus = true;
+            this.searchCustomeList = [];
+            this.searchContractList = [];
+        },
+
+        showType() {
+            if (!this.showType) {
+                this.temType = JSON.parse(JSON.stringify(this.type));
+            }
+        },
+    },
+    data() {
+        return {
+            showPurpose: false, //显示用印用途选项
+            purposeArr: ["销售合同", "代付合同", "总对总协议", "渠道合同", "付款通知函", "招投标", "战略合作协议"],
+            purpose: "",
+
+            showType: false, //显示用印用途选项
+            typeArr: ["合同章", "公章", "法人章"],
+            type: [],
+            temType: [], //临时存放选择的用印用途
+
+            showServiceType: false, //显示业务类型选项
+            ServiceTypeArr: ["新签合同", "续约合同", "补充协议"],
+            ServiceType: "", //业务类型
+
+            showCustome: false, //显示搜索客户名称
+            customeName: "", //客户名称
+            fileNum: "", //文件数
+            remark: "", //备注
+            CreditCode: "", //社会统一信用代码
+
+            UseCompanyName: "", //实际使用方客户名称
+            ContractId: 0, //合同id
+
+            file: {
+                type: "",
+                img: "",
+                url: "",
+            }, //上传附件 文件
+
+            processData: null, //流程数据
+
+            radioVal: "系统合同",
+
+            searchCustomeVal: "", //搜索客户输入数据
+            searchCustomeStatus: true, //搜索客户 是否有结果
+            searchCustomeList: [], //搜索到的客户名称列表
+            searchContractList: [], //选择搜索中的客户后合同列表数据
+        };
+    },
+    methods: {
+        //删除上传的附件
+        handleDeleteCheckFile() {
+            this.file = {
+                type: "",
+                img: "",
+                url: "",
+            };
+        },
+
+        //预览文件
+        handlePreviewFiles(e) {
+            if (e.type === "pdf" || e.type === "word") {
+                preViewFile(e.url);
+            } else {
+                uni.previewImage({
+                    urls: [e.url],
+                });
+            }
+        },
+
+        //上传附件
+        async handleUpload() {
+            const res = await uploadFiles({ type: "all" });
+            const reg = /\.(pdf)$/;
+            const reg2 = /\.doc|\.docx$/;
+            if (reg.test(res[0])) {
+                this.file = {
+                    type: "pdf",
+                    url: res[0],
+                    img: require("../static/pdf.png"),
+                };
+            } else if (reg2.test(res[0])) {
+                this.file = {
+                    type: "word",
+                    url: res[0],
+                    img: require("../static/word.png"),
+                };
+            } else {
+                this.file = {
+                    type: "img",
+                    url: res[0],
+                    img: res[0],
+                };
+            }
+        },
+
+        // 客户搜索
+        // 先搜索出客户 再通过客户去请求出客户下面存在的合同
+        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;
+                if (res.data.length === 0) {
+                    this.searchCustomeStatus = false;
+                } else {
+                    this.searchCustomeStatus = true;
+                }
+            }
+        },
+
+        // 搜索客户对应的合同
+        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",
+                    });
+                }
+            }
+        },
+
+        // 选择用印用途
+        handlePurposeConfirm(e) {
+            this.purpose = e.detail.value;
+            this.showPurpose = false;
+        },
+
+        //确认盖章类型
+        handleTypeConfirm(e) {
+            this.type = JSON.parse(JSON.stringify(this.temType));
+            this.showType = false;
+            this.getProcessData();
+        },
+
+        // 盖章类型变换
+        onChangeType(e) {
+            this.temType = e.detail;
+        },
+
+        //选择业务类型
+        handleServiceTypeConfirm(e) {
+            this.ServiceType = e.detail.value;
+            this.showServiceType = false;
+        },
+
+        //合同章5  公章、法人章 6
+        async getProcessData() {
+            let id = 0;
+            if (this.type.includes("公章") || this.type.includes("法人章")) {
+                id = 6;
+            } else {
+                id = 5;
+            }
+
+            let res = await apiFlowDetail({ FlowId: id });
+            if (res.code === 200) {
+                this.processData = res.data || null;
+            }
+        },
+    },
+};

+ 3 - 1
pages.json

@@ -148,7 +148,9 @@
       "van-empty": "/wxcomponents/vant/empty/index",
       "van-picker": "/wxcomponents/vant/picker/index",
       "van-radio": "/wxcomponents/vant/radio/index",
-      "van-radio-group": "/wxcomponents/vant/radio-group/index"
+      "van-radio-group": "/wxcomponents/vant/radio-group/index",
+      "van-checkbox": "/wxcomponents/vant/checkbox/index",
+      "van-checkbox-group": "/wxcomponents/vant/checkbox-group/index"
     }
   },
   "tabBar": {