jwyu 3 years ago
parent
commit
a44abd70b6

+ 9 - 2
api/approve/seal.js

@@ -46,11 +46,11 @@ export const apiSearchCustome=params=>{
 
 /**
  * 根据客户搜索出对应客户下面合同数据
- * @param {string} 	ContractStatus 合同状态(固定 已审批)
+ * @param {string} 	Status 合同状态(固定 已审批)
  * @param {string}  Keyword	搜索关键字(对应客户名称)
  */
 export const apiSearchContract=params=>{
-	return httpGet('/contract/list',{...params,ContractStatus:'已审批'})
+	return httpGet('/contract/list',{...params,Status:'已审批'})
 }
 
 /**
@@ -108,4 +108,11 @@ export const apiInvalidSeal=params=>{
  */
 export const apiSealEdit=params=>{
 	return httpPost('/seal/edit',params)
+}
+
+/**
+ * 用印撤回
+ */
+export const apiSealCancelApply=params=>{
+	return httpGet('/seal_approval/cancelApply',params)
 }

+ 3 - 0
pages-approve/components/approveListItem.vue

@@ -12,8 +12,10 @@
 			<view class="info" v-if="data.status==='已撤回'">撤回时间:{{data.backTime|formatTime}}</view>
 			<view class="info" v-if="data.status==='已作废'">作废时间:{{data.cancelTime|formatTime}}</view>
 			<view class="info" v-if="data.status==='已签回'">签回时间:{{data.checkBackTime|formatTime}}</view>
+			<view class="info" v-if="data.status==='待提交'">保存时间:{{data.ModifyTime|formatTime}}</view>
 		</view>
 		<view class="status approve-list-status-wait" v-if="data.status==='待审批'">待审批</view>
+		<view class="status approve-list-status-wait" v-if="data.status==='待提交'">待提交</view>
 		<view class="status approve-list-status-doing" v-if="data.status==='处理中'">处理中</view>
 		<view class="status approve-list-status-success" v-if="data.status==='已审批'">已审批</view>
 		<view class="status approve-list-status-fail" v-if="data.status==='已驳回'">已驳回</view>
@@ -35,6 +37,7 @@
 			 * backTime:撤回时间,
 			 * cancelTime:作废时间,
 			 * checkBackTime:签回时间
+			 * ModifyTime:修改时间
 			 * status:状态,
 			 * type:类型(客户custome、合同contract、用印seal)
 			 * id:审批单id

+ 58 - 5
pages-approve/contract/list.vue

@@ -23,7 +23,7 @@
 </template>
 
 <script>
-	import {apiContractApproveList} from '@/api/approve/contract.js'
+	import {apiContractApproveList,apiContractList} from '@/api/approve/contract.js'
 	import approveListItem from '../components/approveListItem.vue'
 	export default{
 		components:{
@@ -47,13 +47,21 @@
 			})
 			this.page=1
 			this.list=[]
-			this.getList()
+			if(this.status==='待提交'){
+				this.getContractList()
+			}else{
+				this.getList()
+			}
 		},
 		onPullDownRefresh() {
 			this.page=1
 			this.finished=false
 			this.list=[]
-			this.getList()
+			if(this.status==='待提交'){
+				this.getContractList()
+			}else{
+				this.getList()
+			}
 			setTimeout(()=>{
 				uni.stopPullDownRefresh()
 			},1500)
@@ -61,7 +69,11 @@
 		onReachBottom() {
 			if(this.finished) return
 			this.page++
-			this.getList()
+			if(this.status==='待提交'){
+				this.getContractList()
+			}else{
+				this.getList()
+			}
 		},
 		methods: {
 			//初始化tab
@@ -91,7 +103,11 @@
 				this.page=1
 				this.finished=false
 				this.list=[]
-				this.getList()
+				if(this.status==='待提交'){
+					this.getContractList()
+				}else{
+					this.getList()
+				}
 			},
 			
 			//获取列表数据
@@ -132,6 +148,43 @@
 				}
 			},
 			
+			// 获取合同列表
+			async getContractList(){
+				const res=await apiContractList({
+					CurrentIndex:this.page,
+					Status:this.status,
+					KeyWord:''
+				})
+				if(res.code===200){
+					if(res.data.Paging.IsEnd){
+						this.finished=true
+					}
+					let arr=res.data.List.map(item=>{
+						let backTime=''
+						if(item.Status==='已撤回'){
+							backTime=item.ModifyTime
+						}
+						return {
+							title:item.CompanyName,
+							saller:item.SellerName,
+							submitTime:item.CreateTime,
+							approveTime:item.ApproveTime,
+							checkBackTime:item.CheckBackFileTime,
+							backTime:backTime,
+							cancelTime:item.InvalidTime,
+							status:item.Status,
+							applyType:'',
+							id:item.ContractId,
+							ContractApprovalId:0,
+							ContractApprovalRecordId:0,
+							ContractId:item.ContractId,
+							ModifyTime:item.ModifyTime,
+							type:'contract',
+						}
+					})
+					this.list=[...this.list,...arr]
+				}
+			}
 		},
 	}
 </script>

+ 1 - 1
pages-approve/contract/search.vue

@@ -23,7 +23,7 @@
 					<view class="info">合同金额:<text style="color:#FF4343">{{item.Price}}</text></view>
 					<view class="info">合同类型:{{item.ContractType}}</view>
 					<view class="info">销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;售:{{item.SellerName}}</view>
-					<view class="info">更新时间:{{item.ModifyTimeStr}}</view>
+					<view class="info">更新时间:{{item.ModifyTime|format}}</view>
 				</view>
 				<image :src="item.statusImg" mode="aspectFill" class="status-img"></image>
 			</view>

+ 29 - 19
pages-approve/seal/addSeal.vue

@@ -57,23 +57,6 @@
 			</view>
 		</view>
 		
-		<!-- <view class="section white-wrap">
-			<view class="section-title require">客户名称(全称)</view>
-			<view class="section-select-box" :style="{color:customeName?'#333':'#999'}" @click="showCustome=true" v-if="radioVal==='系统合同'">{{customeName?customeName:'请输入客户名称'}}</view>
-			<input type="text" v-model="customeName" placeholder="请输入客户名称" v-else/>
-		</view>
-		<view class="section white-wrap">
-			<view class="section-title require">统一社会信用码</view>
-			<input type="text" v-model="CreditCode" placeholder="请填写统一社会信用码" :disabled="radioVal==='系统合同'"/>
-		</view>
-		<view class="section white-wrap">
-			<view class="section-title">实际使用方名称</view>
-			<input type="text" v-model="UseCompanyName" placeholder="请填写实际使用方名称" :disabled="radioVal==='系统合同'"/>
-		</view>
-		<view class="section white-wrap">
-			<view class="section-title require">业务类型</view>
-			<view class="section-select-box" :style="{color:ServiceType?'#333':'#999'}" @click="handleShowServiceType">{{ServiceType?ServiceType:'请选择业务类型'}}</view>
-		</view> -->
 		<view class="section white-wrap">
 			<view class="section-title require">文件份数</view>
 			<input type="number" v-model="fileNum" placeholder="请填写总共盖章文件份数"/>
@@ -88,11 +71,18 @@
 		</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;"></image>
+			<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>
-			<image :src="img.img" mode="aspectFill" style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0" v-for="img in fileUrlArr" :key="img"></image>
+			<image 
+				:src="img.img" 
+				mode="aspectFill" 
+				style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0" 
+				v-for="img in fileUrlArr" 
+				:key="img" 
+				@click="handlePreviewFiles(img)">
+			</image>
 			<image @click="handleUpload" src="../static/upload-icon.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;margin:0 10rpx 10rpx 0"></image>
 		</view>
 		
@@ -179,10 +169,19 @@
 	import steps from '../components/steps.vue'
 	import {apiFlowDetail,apiSealAdd,apiSearchCustome,apiSearchContract} from '@/api/approve/seal.js'
 	import {uploadImg,uploadFiles} from '@/utils/uploadFile.js'
+	import {preViewFile} from '../utils/util.js'
 	export default{ 
 		components:{
 			steps
 		},
+		watch:{
+			showCustome(){
+				this.searchCustomeVal=''
+				this.searchCustomeStatus=true 
+				this.searchCustomeList=[]
+				this.searchContractList=[]
+			}
+		},
 		data() {
 			return {
 				showPurpose:false,//显示用印用途选项
@@ -221,6 +220,17 @@
 			}
 		},
 		methods: {
+			//预览文件
+			handlePreviewFiles(e){
+				if (e.type === "pdf") {
+					preViewFile(e.url)
+				} else {
+					uni.previewImage({
+						urls: [e.url]
+					})
+				}
+			},
+			
 			//上传附件
 			async handleUpload(){
 				const res=await uploadFiles({type:'all'})

+ 33 - 1
pages-approve/seal/detail.vue

@@ -68,6 +68,10 @@
 		<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="showPurpose" @close="showPurpose=false" position="bottom">
@@ -126,7 +130,15 @@
 </template>
 
 <script>
-	import {apiSealDetail,apiSearchCustome,apiSearchContract,apiApprovalPass,apiInvalidSeal,apiApprovalPassModify} from '@/api/approve/seal.js'
+	import {
+		apiSealDetail,
+		apiSearchCustome,
+		apiSearchContract,
+		apiApprovalPass,
+		apiInvalidSeal,
+		apiApprovalPassModify,
+		apiSealCancelApply
+		} from '@/api/approve/seal.js'
 	import steps from '../components/steps.vue'
 	import {preViewFile} from '../utils/util.js'
 	export default{
@@ -190,6 +202,26 @@
 			},1000)
 		},
 		methods: {
+			// 撤回申请
+			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.getDetail()
+					}
+				}).catch(() => {
+					console.log('取消撤回');
+				});
+				
+			},
+			
 			handlePurposeConfirm(e){
 				this.oldUse=e.detail.value
 				this.showPurpose=false

+ 2 - 2
pages-approve/seal/list.vue

@@ -129,8 +129,8 @@
 							return {
 								title:item.CompanyName,
 								saller:item.UserName,
-								submitTime:item.CreateTimeStr,
-								approveTime:item.ApproveTimeStr,
+								submitTime:item.CreateTime,
+								approveTime:item.ApproveTime,
 								backTime:'',
 								cancelTime:item.InvalidTime,
 								status:item.Status,

+ 5 - 5
pages-approve/search/result.vue

@@ -64,7 +64,7 @@
 				const res=await apiCustomeList({
 					CurrentIndex:this.page,
 					Status:'',
-					KeyWord:this.keyword
+					Keyword:this.keyword
 				})
 				if(res.code===200){
 					if(!res.data.List||res.data.List.length===0){
@@ -113,7 +113,7 @@
 				const res=await apiSealList({
 					CurrentIndex:this.page,
 					Status:'',
-					KeyWord:this.keyword
+					Keyword:this.keyword
 				})
 				if(res.code===200){
 					if(!res.data.List||res.data.List.length===0){
@@ -123,10 +123,10 @@
 							return {
 								title:item.CompanyName,
 								saller:item.UserName,
-								submitTime:item.CreateTimeStr,
-								approveTime:item.ApproveTimeStr,
+								submitTime:item.CreateTime,
+								approveTime:item.ApproveTime,
+								cancelTime:item.InvalidTime,
 								backTime:'',
-								cancelTime:'',
 								status:item.Status,
 								applyType:item.SealType,
 								ContractApprovalId:item.ContractApprovalId,