addSeal.vue 14 KB

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