addSeal.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. <template>
  2. <view class="add-page white-wrap" @click="handleClickPage">
  3. <view class="section white-wrap">
  4. <view class="section-title require">归属公司
  5. <span class="tip">(归属公司:申请用章公司)</span>
  6. </view>
  7. <view class="section-select-box" :style="{color:belongCompany?'#333':'#999'}" @click="showBelongCompanyPop=true">{{belongCompany?belongCompany:'请选择'}}</view>
  8. </view>
  9. <view class="section white-wrap">
  10. <view class="section-title require">用印用途</view>
  11. <view class="section-select-box" :style="{color:purpose?'#333':'#999'}" @click="showPurpose=true">{{purpose?purpose:'请选择'}}</view>
  12. </view>
  13. <view class="section white-wrap">
  14. <van-radio-group :value="radioVal" @change="radioChange" direction="horizontal">
  15. <van-radio name="系统合同" style="margin-right: 70px;">系统合同</van-radio>
  16. <van-radio name="上传附件">上传附件</van-radio>
  17. </van-radio-group>
  18. </view>
  19. <!-- 系统合同模块 -->
  20. <view v-if="radioVal==='系统合同'">
  21. <view class="section white-wrap">
  22. <view class="section-title require">客户名称(全称)</view>
  23. <view
  24. class="section-select-box"
  25. :style="{color:customeName?'#333':'#999'}"
  26. @click="showCustome=true"
  27. >
  28. {{customeName?customeName:'请输入客户名称'}}
  29. </view>
  30. </view>
  31. <view class="section white-wrap" v-if="CreditCode">
  32. <view class="section-title require">统一社会信用码</view>
  33. <input type="text" v-model="CreditCode" placeholder="请填写统一社会信用码" disabled/>
  34. </view>
  35. <view class="section white-wrap" v-if="UseCompanyName">
  36. <view :class="['section-title',purpose=='代付合同'?'require':'']">实际使用方名称</view>
  37. <input type="text" v-model="UseCompanyName" placeholder="请填写实际使用方名称" disabled/>
  38. </view>
  39. <view class="section white-wrap" v-if="ServiceType">
  40. <view class="section-title require">业务类型</view>
  41. <view :style="{color:ServiceType?'#333':'#999'}">{{ServiceType?ServiceType:'请选择业务类型'}}</view>
  42. </view>
  43. </view>
  44. <!-- 上传附件模块 -->
  45. <view v-if="radioVal==='上传附件'">
  46. <view class="section white-wrap" style="position:relative">
  47. <view class="section-title require">客户名称(全称)</view>
  48. <input type="text" v-model="customeName" @input="handleAllCutomeInput" placeholder="请输入客户名称"/>
  49. <view class="show-all-custome-box" v-if="allCustome.list.length>0">
  50. <scroll-view scroll-y @scrolltolower="handleScrollToLower" style="height: 100%;width:100%">
  51. <view
  52. class="all-custome-item"
  53. v-for="item in allCustome.list"
  54. :key="item.CompanyId"
  55. @click="chooseAllCustomeItem(item)"
  56. >{{item.CompanyName}}</view>
  57. </scroll-view>
  58. </view>
  59. </view>
  60. <view class="section white-wrap">
  61. <view class="section-title require">统一社会信用码</view>
  62. <input type="text" v-model="CreditCode" placeholder="请填写统一社会信用码"/>
  63. </view>
  64. <view class="section white-wrap">
  65. <view :class="['section-title',purpose=='代付合同'?'require':'']">实际使用方名称</view>
  66. <input type="text" v-model="UseCompanyName" placeholder="请填写实际使用方名称"/>
  67. </view>
  68. <view class="section white-wrap">
  69. <view class="section-title require">业务类型</view>
  70. <view class="section-select-box" :style="{color:ServiceType?'#333':'#999'}" @click="showServiceType=true">{{ServiceType?ServiceType:'请选择业务类型'}}</view>
  71. </view>
  72. </view>
  73. <view class="section white-wrap">
  74. <view class="section-title require">文件份数</view>
  75. <input type="number" v-model="fileNum" placeholder="请填写总共盖章文件份数"/>
  76. </view>
  77. <view class="section white-wrap">
  78. <view class="section-title require">加盖何种印章</view>
  79. <view class="section-select-box" :style="{color:typeLength?'#333':'#999'}" @click="showType=true">{{type.length>0?type.join(','):'请选择'}}</view>
  80. </view>
  81. <view class="section white-wrap">
  82. <view class="section-title">备注</view>
  83. <textarea type="text" auto-height v-model="remark" placeholder="请填写备注"></textarea>
  84. </view>
  85. <view class="section white-wrap" v-if="radioVal==='系统合同'&&ContractfileUrl">
  86. <view class="section-title require">合同附件</view>
  87. <image src="../static/pdf.png" mode="aspectFill" style="width: 102rpx;height: 120rpx;" @click="handlePreviewFiles({type:'pdf',url:ContractfileUrl})"></image>
  88. </view>
  89. <view class="section white-wrap" v-if="radioVal==='上传附件'">
  90. <view class="section-title require">附件上传</view>
  91. <div class="check-file-contain">
  92. <image @click="handleUpload" src="../static/upload-icon.png" mode="aspectFill"
  93. style="width: 102rpx;height: 120rpx;margin: 0 16rpx 24rpx 16rpx;"></image>
  94. <div class="check-file-box" :style="'background-image:url('+item.img+')'"
  95. @click="handlePreviewFiles(item)" v-for="(item,index) in fileList" :key="item.url">
  96. <image class="del-icon" src="../static/del-icon.png" @click.stop="handleDeleteCheckFile(item)"></image>
  97. </div>
  98. </div>
  99. </view>
  100. <!-- 流程模块 -->
  101. <view class="section white-wrap process-wrap" v-if="processData">
  102. <view class="title" style="font-size: 16px;font-weight: bold;">审批流程</view>
  103. <steps :data="processData"></steps>
  104. </view>
  105. <view class="fix-bottom-wrap" style="text-align: center;">
  106. <van-button type="info" custom-class="btn" round @click="handleSubmit">提交</van-button>
  107. </view>
  108. <!-- 归属公司 -->
  109. <van-popup :show="showBelongCompanyPop" @close="showBelongCompanyPop=false" position="bottom">
  110. <van-picker
  111. show-toolbar
  112. title="选择归属公司"
  113. :columns="belongCompanyOptions"
  114. @confirm="handleComfirmBelongCmpany"
  115. @cancel="showBelongCompanyPop=false"
  116. />
  117. </van-popup>
  118. <!-- 用印用途 -->
  119. <van-popup :show="showPurpose" @close="showPurpose=false" position="bottom">
  120. <van-picker
  121. show-toolbar
  122. title="选择用印用途"
  123. :columns="purposeArr"
  124. @confirm="handlePurposeConfirm"
  125. @cancel="showPurpose=false"
  126. />
  127. </van-popup>
  128. <!-- 何种印章 -->
  129. <van-popup :show="showType" @close="showType=false" position="bottom">
  130. <view class="type-popup-wrap">
  131. <view class="flex top-title">
  132. <text style="color:#969799" @click="showType=false">取消</text>
  133. <text style="font-size:16px">选择何种印章</text>
  134. <text style="color:#576b95" @click="handleTypeConfirm">确认</text>
  135. </view>
  136. <van-checkbox-group v-model="temType" @change="onChangeType">
  137. <van-checkbox shape="square" :name="item" v-for="item in typeArr" :key="item">{{item}}</van-checkbox>
  138. </van-checkbox-group>
  139. </view>
  140. </van-popup>
  141. <!-- 业务类型 -->
  142. <van-popup :show="showServiceType" @close="showServiceType=false" position="bottom">
  143. <van-picker
  144. show-toolbar
  145. title="选择业务类型"
  146. :columns="ServiceTypeArr"
  147. @confirm="handleServiceTypeConfirm"
  148. @cancel="showServiceType=false"
  149. />
  150. </van-popup>
  151. <!-- 客户搜索 -->
  152. <van-popup :show="showCustome" @close="showCustome=false" position="bottom" custom-style="height: 100vh">
  153. <view class="custome-search-wrap">
  154. <van-search use-left-icon-slot use-action-slot shape="round" :value="searchCustomeVal" placeholder="请输入客户名称/社会信用码" @change="onSearchValChange" @search="onSearch"
  155. custom-class="search-box" field-class="search-con">
  156. <view slot="left-icon">
  157. <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
  158. </view>
  159. <view slot="action" @click="showCustome=false" class="search-btn">取消</view>
  160. </van-search>
  161. <view class="search-result">
  162. <view class="result-custome-box" v-if="searchContractList.length===0">
  163. <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="!searchCustomeStatus"/>
  164. <view v-else>
  165. <view class="result-item flex" v-for="item in searchCustomeList" :key="item" @click="getContract(item)">
  166. <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
  167. <view class="con van-ellipsis">{{item}}</view>
  168. <image src="../static/click-icon.png" mode="aspectFill" class="click-icon"></image>
  169. </view>
  170. </view>
  171. </view>
  172. <view class="result-contract-box" v-else>
  173. <view class="result-contract-item" v-for="item in searchContractList" :key="item.ContractId" @click="handleChooseContract(item)">
  174. <view class="name">{{item.CompanyName}}</view>
  175. <view style="margin-top: 20rpx;">合同编号:{{item.ContractCode}}</view>
  176. <view style="margin-top: 20rpx;">合同类型:{{item.ContractType}}</view>
  177. <view style="margin-top: 20rpx;">合同金额:{{item.Price}}</view>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. </van-popup>
  183. </view>
  184. </template>
  185. <script>
  186. import steps from "../components/steps.vue";
  187. import { apiSealAdd } from "@/api/approve/seal.js";
  188. import {sealMixin} from './mixin'
  189. export default{
  190. components: {
  191. steps,
  192. },
  193. mixins: [sealMixin],
  194. data() {
  195. return {
  196. ContractfileUrl:'',//合同文件地址 pdf
  197. }
  198. },
  199. onLoad() {
  200. this.getBelongCompanyOptions('add')
  201. },
  202. methods: {
  203. // 选择合同 更新表单数据
  204. handleChooseContract(e){
  205. this.customeName=e.CompanyName
  206. this.CreditCode=e.CreditCode
  207. this.ServiceType=e.ContractType
  208. this.UseCompanyName=e.ContractBusinessType=='代付合同'?e.UseCompanyName:e.CompanyName
  209. this.ContractId=e.ContractId
  210. this.ContractfileUrl=e.FileUrl
  211. // 关闭搜索弹窗
  212. this.showCustome=false
  213. this.searchCustomeVal=''
  214. this.searchContractList=[]
  215. this.searchCustomeList=[]
  216. },
  217. // 系统合同 上传附件类型切换
  218. radioChange(e){
  219. this.radioVal=e.detail
  220. this.customeName=''
  221. this.CreditCode=''
  222. this.ServiceType=''
  223. this.UseCompanyName=''
  224. this.ContractfileUrl=''
  225. this.fileUrlArr=[]
  226. },
  227. // 提交申请
  228. async handleSubmit(){
  229. let fileUrls=''
  230. if(this.radioVal==='系统合同'){
  231. fileUrls=[this.ContractfileUrl]
  232. }else{
  233. fileUrls=this.fileList.map(item => item.url)
  234. }
  235. let params={
  236. CompanyName:this.customeName,
  237. ContractId:this.ContractId,
  238. CreditCode:this.CreditCode,
  239. FileUrls:fileUrls,
  240. FileNum:Number(this.fileNum),
  241. Remark:this.remark,
  242. SealType:this.type.join(','),
  243. ServiceType:this.ServiceType,
  244. Use:this.purpose,
  245. UseCompanyName:this.UseCompanyName,
  246. AffiliatedCompany: this.belongCompany
  247. }
  248. if(!params.AffiliatedCompany){
  249. uni.showToast({
  250. title:'请选择归属公司',
  251. icon:"none"
  252. })
  253. return
  254. }
  255. if(!params.Use){
  256. uni.showToast({
  257. title:'请选择用印用途',
  258. icon:"none"
  259. })
  260. return
  261. }
  262. if(!params.CompanyName){
  263. uni.showToast({
  264. title:'客户名称不能为空',
  265. icon:"none"
  266. })
  267. return
  268. }
  269. if(!params.CreditCode){
  270. uni.showToast({
  271. title:'信用代码不能为空',
  272. icon:"none"
  273. })
  274. return
  275. }
  276. if(!params.ServiceType){
  277. uni.showToast({
  278. title:'业务类型不能为空',
  279. icon:"none"
  280. })
  281. return
  282. }
  283. if(!params.FileNum){
  284. uni.showToast({
  285. title:'请填写文件份数',
  286. icon:"none"
  287. })
  288. return
  289. }
  290. if(params.FileNum<1){
  291. uni.showToast({
  292. title:'文件份数不合法',
  293. icon:"none"
  294. })
  295. return
  296. }
  297. if(!params.SealType){
  298. uni.showToast({
  299. title:'印章类型不能为空',
  300. icon:"none"
  301. })
  302. return
  303. }
  304. if(!params.FileUrls){
  305. uni.showToast({
  306. title:'请上传文件',
  307. icon:"none"
  308. })
  309. return
  310. }
  311. // 代付合同 实际使用方必填
  312. if(params.Use=='代付合同'){
  313. if(!params.UseCompanyName&&this.radioVal==='上传附件'){
  314. uni.showToast({
  315. title:'请填写实际使用方',
  316. icon:"none"
  317. })
  318. return
  319. }
  320. }
  321. console.log(params);
  322. const res=await apiSealAdd(params)
  323. if(res.code===200){
  324. uni.showToast({
  325. title:"用印申请单已提交",
  326. icon:"none"
  327. })
  328. uni.$emit('sealApproveListUpdate',{
  329. ContractApprovalId:0,
  330. ContractApprovalRecordId:0,
  331. SealId:0
  332. })
  333. setTimeout(()=>{
  334. uni.navigateBack({
  335. delta:1
  336. })
  337. },1000)
  338. }
  339. }
  340. },
  341. }
  342. </script>
  343. <style lang="scss">
  344. .check-file-contain{
  345. display: flex;
  346. flex-wrap: wrap;
  347. .check-file-box{
  348. width: 102rpx;
  349. height: 120rpx;
  350. background-size: cover;
  351. background-position: center;
  352. position: relative;
  353. margin: 0 16rpx;
  354. .del-icon{
  355. position: absolute;
  356. width: 30rpx;
  357. height: 30rpx;
  358. top: -15rpx;
  359. right: -15rpx;
  360. }
  361. }
  362. }
  363. .add-page{
  364. width: 100%;
  365. min-height: 100vh;
  366. padding-bottom: calc(150rpx + constant(safe-area-inset-bottom));
  367. padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
  368. }
  369. .section{
  370. padding: 30rpx 34rpx;
  371. border-top: 10rpx solid #F5F5F5;
  372. position: relative;
  373. textarea{
  374. width: 100%;
  375. height: 200rpx;
  376. }
  377. .section-title{
  378. font-size: 16px;
  379. margin-bottom: 20rpx;
  380. .tip {
  381. font-size: 12px;
  382. color: #999;
  383. }
  384. }
  385. .require::before{
  386. content: '*';
  387. font-size: 16px;
  388. color: #FF0000;
  389. position: absolute;
  390. left: 20rpx;
  391. }
  392. .section-select-box{
  393. color: #999;
  394. position: relative;
  395. &::after{
  396. position: absolute;
  397. right: 0;
  398. top: 50%;
  399. content: '';
  400. display: block;
  401. width: 18rpx;
  402. height: 18rpx;
  403. border-top: 1px solid #999;
  404. border-right: 1px solid #999;
  405. transform: translateY(-50%) rotate(45deg);
  406. }
  407. }
  408. .show-all-custome-box{
  409. top: 100%;
  410. width: 85vw;
  411. height: 440rpx;
  412. z-index: 10;
  413. padding: 30rpx 40rpx;
  414. position: absolute;
  415. background: #FFFFFF;
  416. box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.16);
  417. .all-custome-item{
  418. margin-bottom: 30rpx;
  419. }
  420. }
  421. }
  422. .fix-bottom-wrap{
  423. .btn{
  424. width: 400rpx;
  425. height: 70rpx;
  426. font-size: 15px;
  427. }
  428. }
  429. .radio-wrap{
  430. .radio{
  431. font-size: 14px;
  432. &::before{
  433. content: '';
  434. display: inline-block;
  435. }
  436. }
  437. }
  438. .custome-search-wrap{
  439. padding: 34rpx;
  440. height: 100%;
  441. .search-box {
  442. border: 1px solid #3385FF;
  443. padding: 0 !important;
  444. border-radius: 60rpx;
  445. background-color: #fff !important;
  446. }
  447. .search-con {
  448. background-color: #fff !important;
  449. }
  450. .van-search__content {
  451. background-color: #fff !important;
  452. padding-left: 30rpx !important;
  453. }
  454. .search-btn {
  455. position: relative;
  456. color: #3385FF;
  457. &::before {
  458. content: '';
  459. display: block;
  460. width: 1px;
  461. height: 60%;
  462. background-color: #D1D1D1;
  463. position: absolute;
  464. left: -16rpx;
  465. top: 20%;
  466. }
  467. }
  468. .search-icon{
  469. width: 40rpx;
  470. height: 40rpx;
  471. display: block;
  472. position: relative;
  473. top: 4rpx;
  474. margin-right: 20rpx;
  475. }
  476. .click-icon{
  477. width: 24rpx;
  478. height: 24rpx;
  479. }
  480. .result-item{
  481. align-items: center;
  482. padding: 20rpx 0;
  483. border-bottom: 1px solid #EBEBEB;
  484. .con{
  485. flex: 1;
  486. margin-right: 20rpx;
  487. }
  488. }
  489. .search-result{
  490. overflow-y: auto;
  491. height: 100%;
  492. }
  493. .result-contract-box{
  494. padding: 0 10rpx;
  495. .result-contract-item{
  496. margin-top: 30rpx;
  497. box-shadow: 0px 0px 12rpx rgba(175, 175, 175, 0.38);
  498. padding: 30rpx;
  499. border-radius: 8px;
  500. .name{
  501. font-size: 16px;
  502. font-weight: bold;
  503. &::before{
  504. content:'';
  505. display:inline-block;
  506. width: 31rpx;
  507. height: 34rpx;
  508. background-image: url(../../static/man.png);
  509. background-size: cover;
  510. position: relative;
  511. top: 4rpx;
  512. margin-right: 10rpx;
  513. }
  514. }
  515. }
  516. }
  517. }
  518. .type-popup-wrap{
  519. padding: 20rpx 32rpx;
  520. height: 280px;
  521. .top-title{
  522. justify-content: space-between;
  523. margin-bottom: 124rpx;
  524. }
  525. .van-checkbox{
  526. margin-bottom: 30rpx;
  527. width: 300rpx;
  528. margin-left: auto;
  529. margin-right: auto;
  530. }
  531. }
  532. </style>