addSeal.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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">实际使用方名称</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">实际使用方名称</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" catchtap="preventdefault">
  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. console.log(params);
  271. const res=await apiSealAdd(params)
  272. if(res.code===200){
  273. uni.showToast({
  274. title:"用印申请单已提交",
  275. icon:"none"
  276. })
  277. uni.$emit('sealApproveListUpdate',{
  278. ContractApprovalId:0,
  279. ContractApprovalRecordId:0,
  280. SealId:0
  281. })
  282. setTimeout(()=>{
  283. uni.navigateBack({
  284. delta:1
  285. })
  286. },1000)
  287. }
  288. }
  289. },
  290. }
  291. </script>
  292. <style lang="scss">
  293. .check-file-box{
  294. width: 102rpx;
  295. height: 120rpx;
  296. background-size: cover;
  297. background-position: center;
  298. position: relative;
  299. .del-icon{
  300. position: absolute;
  301. width: 30rpx;
  302. height: 30rpx;
  303. top: -15rpx;
  304. right: -15rpx;
  305. }
  306. }
  307. .add-page{
  308. width: 100%;
  309. min-height: 100vh;
  310. padding-bottom: calc(150rpx + constant(safe-area-inset-bottom));
  311. padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
  312. }
  313. .section{
  314. padding: 30rpx 34rpx;
  315. border-top: 10rpx solid #F5F5F5;
  316. position: relative;
  317. textarea{
  318. width: 100%;
  319. height: 200rpx;
  320. }
  321. .section-title{
  322. font-size: 16px;
  323. margin-bottom: 20rpx;
  324. }
  325. .require::before{
  326. content: '*';
  327. font-size: 16px;
  328. color: #FF0000;
  329. position: absolute;
  330. left: 20rpx;
  331. }
  332. .section-select-box{
  333. color: #999;
  334. position: relative;
  335. &::after{
  336. position: absolute;
  337. right: 0;
  338. top: 50%;
  339. content: '';
  340. display: block;
  341. width: 18rpx;
  342. height: 18rpx;
  343. border-top: 1px solid #999;
  344. border-right: 1px solid #999;
  345. transform: translateY(-50%) rotate(45deg);
  346. }
  347. }
  348. }
  349. .fix-bottom-wrap{
  350. .btn{
  351. width: 400rpx;
  352. height: 70rpx;
  353. font-size: 15px;
  354. }
  355. }
  356. .radio-wrap{
  357. .radio{
  358. font-size: 14px;
  359. &::before{
  360. content: '';
  361. display: inline-block;
  362. }
  363. }
  364. }
  365. .custome-search-wrap{
  366. padding: 34rpx;
  367. height: 100%;
  368. .search-box {
  369. border: 1px solid #3385FF;
  370. padding: 0 !important;
  371. border-radius: 60rpx;
  372. background-color: #fff !important;
  373. }
  374. .search-con {
  375. background-color: #fff !important;
  376. }
  377. .van-search__content {
  378. background-color: #fff !important;
  379. padding-left: 30rpx !important;
  380. }
  381. .search-btn {
  382. position: relative;
  383. color: #3385FF;
  384. &::before {
  385. content: '';
  386. display: block;
  387. width: 1px;
  388. height: 60%;
  389. background-color: #D1D1D1;
  390. position: absolute;
  391. left: -16rpx;
  392. top: 20%;
  393. }
  394. }
  395. .search-icon{
  396. width: 40rpx;
  397. height: 40rpx;
  398. display: block;
  399. position: relative;
  400. top: 4rpx;
  401. margin-right: 20rpx;
  402. }
  403. .click-icon{
  404. width: 24rpx;
  405. height: 24rpx;
  406. }
  407. .result-item{
  408. align-items: center;
  409. padding: 20rpx 0;
  410. border-bottom: 1px solid #EBEBEB;
  411. .con{
  412. flex: 1;
  413. margin-right: 20rpx;
  414. }
  415. }
  416. .search-result{
  417. overflow-y: auto;
  418. height: 100%;
  419. }
  420. .result-contract-box{
  421. padding: 0 10rpx;
  422. .result-contract-item{
  423. margin-top: 30rpx;
  424. box-shadow: 0px 0px 12rpx rgba(175, 175, 175, 0.38);
  425. padding: 30rpx;
  426. border-radius: 8px;
  427. .name{
  428. font-size: 16px;
  429. font-weight: bold;
  430. &::before{
  431. content:'';
  432. display:inline-block;
  433. width: 31rpx;
  434. height: 34rpx;
  435. background-image: url(../../static/man.png);
  436. background-size: cover;
  437. position: relative;
  438. top: 4rpx;
  439. margin-right: 10rpx;
  440. }
  441. }
  442. }
  443. }
  444. }
  445. .type-popup-wrap{
  446. padding: 20rpx 32rpx;
  447. height: 250px;
  448. .top-title{
  449. justify-content: space-between;
  450. margin-bottom: 124rpx;
  451. }
  452. .van-checkbox{
  453. margin-bottom: 30rpx;
  454. width: 200rpx;
  455. margin-left: auto;
  456. margin-right: auto;
  457. }
  458. }
  459. </style>