瀏覽代碼

用印修改

jwyu 3 年之前
父節點
當前提交
5141467a62
共有 5 個文件被更改,包括 126 次插入8 次删除
  1. 10 0
      api/approve/seal.js
  2. 26 4
      pages-approve/seal/addSeal.vue
  3. 25 2
      pages-approve/seal/edit.vue
  4. 63 1
      pages-approve/seal/mixin.js
  5. 2 1
      utils/uploadFile.js

+ 10 - 0
api/approve/seal.js

@@ -146,4 +146,14 @@ export const apiSealCheckBackFiles=params=>{
 			SealId:params.SealId
 		}
 	})
+}
+
+/** 
+ * 上传附近时输入客户名称搜索提示
+ * @param {int}	PageSize
+ * @param {int}	CurrentIndex
+ * @param {string} Keyword
+ */
+export const apiSearchAllCustome=params=>{
+	return httpGet('/seal/company_name_list',params)
 }

+ 26 - 4
pages-approve/seal/addSeal.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="add-page white-wrap">
+	<view class="add-page white-wrap" @click="handleClickPage">
 		<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>
@@ -39,9 +39,19 @@
 		</view>
 		<!-- 上传附件模块 -->
 		<view v-if="radioVal==='上传附件'">
-			<view class="section white-wrap">
+			<view class="section white-wrap" style="position:relative">
 				<view class="section-title require">客户名称(全称)</view>
-				<input type="text" v-model="customeName" placeholder="请输入客户名称"/>
+				<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>
@@ -178,7 +188,6 @@
 			}
 		},
 		methods: {
-			
 			// 选择合同 更新表单数据
 			handleChooseContract(e){
 				
@@ -376,6 +385,19 @@
 				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{

+ 25 - 2
pages-approve/seal/edit.vue

@@ -32,9 +32,19 @@
 		</view>
 		<!-- 上传附件模块 -->
 		<view v-if="radioVal==='上传附件'">
-			<view class="section white-wrap">
+			<view class="section white-wrap" style="position:relative">
 				<view class="section-title require">客户名称(全称)</view>
-				<input type="text" v-model="customeName" placeholder="请输入客户名称"/>
+				<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>
@@ -410,6 +420,19 @@
 				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;
+			}
+		}
 	}
 	
 	.btn{

+ 63 - 1
pages-approve/seal/mixin.js

@@ -1,4 +1,4 @@
-import { apiFlowDetail, apiSealAdd, apiSearchCustome, apiSearchContract } from "@/api/approve/seal.js";
+import { apiFlowDetail, apiSealAdd, apiSearchCustome, apiSearchContract,apiSearchAllCustome } from "@/api/approve/seal.js";
 import { uploadFiles } from "@/utils/uploadFile.js";
 import { preViewFile } from "../utils/util.js";
 export const sealMixin = {
@@ -63,6 +63,14 @@ export const sealMixin = {
             searchCustomeStatus: true, //搜索客户 是否有结果
             searchCustomeList: [], //搜索到的客户名称列表
             searchContractList: [], //选择搜索中的客户后合同列表数据
+
+            allCustome:{
+                index:1,
+                list:[],
+                finished:false,
+                loading:false
+            },
+            temCustomeName:''
         };
     },
     methods: {
@@ -194,5 +202,59 @@ export const sealMixin = {
                 this.processData = res.data || null;
             }
         },
+
+        handleAllCutomeInput(e){
+            this.temCustomeName=e.detail.value
+            this.allCustome.index=1
+            this.allCustome.list=[]
+            this.allCustome.finished=false
+            this.allCustome.loading=false
+            if(this.temCustomeName){
+                this.getSearchAllCustome()
+            }
+        },
+
+        // 搜素全部客户
+        async getSearchAllCustome(){
+            this.allCustome.loading=true
+            const res=await apiSearchAllCustome({
+                PageSize:20,
+                CurrentIndex:this.allCustome.index,
+                Keyword:this.temCustomeName,
+            })
+            this.allCustome.loading=false
+            if(res.code===200){
+                if(res.data){
+                    this.allCustome.list=[...this.allCustome.list,...res.data]
+                }else{
+                    this.allCustome.finished=true
+                }
+            }
+        },
+
+        // 搜素全部客户弹窗触底
+        handleScrollToLower(){
+            if(this.allCustome.loading||this.allCustome.finished) return
+            this.allCustome.index++
+            this.getSearchAllCustome()
+        },
+
+        chooseAllCustomeItem(e){
+            this.customeName=e.CompanyName
+            this.allCustome.index=1
+            this.allCustome.list=[]
+            this.allCustome.finished=false
+            this.allCustome.loading=false
+            
+        },
+        // 收起搜索弹窗
+        handleClickPage(){
+            if(this.allCustome.list.length>0){
+                this.allCustome.index=1
+                this.allCustome.list=[]
+                this.allCustome.finished=false
+                this.allCustome.loading=false
+            }
+        },
     },
 };

+ 2 - 1
utils/uploadFile.js

@@ -67,7 +67,8 @@ const asyncChooseFiles=({count,type})=>{
 				resolve(res.tempFiles)
 			},
 			fail:(error)=>{
-				if(error.errMsg.indexOf('not supported')){
+				console.log(error.errMsg);
+				if(error.errMsg.search('not supported')!=-1){
 					uni.showToast({
 						title:'请通过手机上传附件',
 						icon:'none'