signatureListComponent.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <view class="signatureComponent">
  3. <view class="sub-picker-box">
  4. <view class="mark-box">*</view>
  5. <view class="title-box">回收人员</view>
  6. <view class="picker-box">
  7. <picker @change="userChange" style="width:100px;"
  8. :value="addForm.signature" :range="optionList" :range-key="'realName'">
  9. <view class="picker-p" :class="addForm.signature?'check-picker-p':''">{{addForm.signature?addForm.realName:'请选择回收人员'}}</view>
  10. </picker>
  11. </view>
  12. </view>
  13. <view v-if="!addForm.signature" class="text-position-box">请选择回收人员</view>
  14. <img v-if="addForm.signature" class="text-position-img" :src="baseUrl+addForm.signature">
  15. <view class="agreement-box">
  16. <view class="agreement-min-box" @click="agreementButton">
  17. <img class="agreement-img" v-if="!agreementType" :src="imagesUrl('commonality/icon_12.png')">
  18. <img class="agreement-img" v-if="agreementType" :src="imagesUrl('commonality/icon_13.png')">
  19. <view>* 本人为具备资质的危废回收人员,且已与报备人核实本次回收的危废种类与称重登记重量,签名即表示确认无误。</view>
  20. </view>
  21. </view>
  22. <!-- 操作按钮 -->
  23. <view class="button-group">
  24. <view @click="saveSignature">完成</view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. hwmsAppRegisterOrderAdd,
  31. hwmsSupplierUserSignature,
  32. } from '@/pages_hazardousWasteRecycling/api/index.js'
  33. import {
  34. config
  35. } from '@/api/request/config.js'
  36. export default {
  37. data() {
  38. return {
  39. baseUrl:config.base_url,
  40. newData:null,
  41. //签名确认状态
  42. agreementType:false,
  43. optionList:[],//回收人员签名列表
  44. addForm:{
  45. signature:'',
  46. realName:'',
  47. }
  48. };
  49. },
  50. onLoad(option) {
  51. this.$set(this,'newData',JSON.parse(decodeURIComponent(option.data)));
  52. },
  53. mounted() {
  54. this.hwmsSupplierUserSignature();
  55. },
  56. methods: {
  57. //选中回收人员
  58. userChange(e){
  59. this.$set(this,'addForm',{
  60. realName:this.optionList[e.detail.value].realName,
  61. signature:this.optionList[e.detail.value].signature,
  62. });
  63. this.$set(this.newData,'collectorSign',this.optionList[e.detail.value].signature);
  64. },
  65. //获取回收人员签名列表
  66. async hwmsSupplierUserSignature(){
  67. const {
  68. data
  69. } = await hwmsSupplierUserSignature();
  70. if (data.code == 200) {
  71. this.$set(this,'optionList',data.data);
  72. }
  73. },
  74. //条款确认
  75. agreementButton(){
  76. this.$set(this,'agreementType',!this.agreementType);
  77. },
  78. saveSignature() {
  79. let self = this;
  80. if(!this.newData.collectorSign){
  81. uni.showToast({
  82. title: "请选择回收人员",
  83. icon: "none",
  84. mask: true,
  85. duration: 2000
  86. });
  87. return
  88. }
  89. if(!this.agreementType){
  90. uni.showToast({
  91. title: "请确认相关条款",
  92. icon: "none",
  93. mask: true,
  94. duration: 2000
  95. });
  96. return
  97. }
  98. uni.showModal({
  99. // title: '确认要退出吗?',
  100. content: '确认提交?',
  101. cancelColor: "#999",
  102. confirmColor: "#0183FA",
  103. success: function(res) {
  104. if (res.confirm) {
  105. self.hwmsAppRegisterOrderAdd();
  106. } else if (res.cancel) {
  107. }
  108. }
  109. });
  110. },
  111. //提交
  112. async hwmsAppRegisterOrderAdd(){
  113. const {
  114. data
  115. } = await hwmsAppRegisterOrderAdd(this.newData);
  116. if (data.code == 200) {
  117. uni.showToast({
  118. title: '提交成功',
  119. icon: "none",
  120. mask: true,
  121. duration: 2000
  122. });
  123. setTimeout(function() {
  124. uni.navigateBack({
  125. delta: 3
  126. });
  127. }, 2000);
  128. }
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="stylus" scoped>
  134. .signatureComponent {
  135. height: 100%;
  136. display flex;
  137. flex: 1;
  138. flex-direction column;
  139. overflow: hidden;
  140. position: relative;
  141. background-color: #fff;
  142. .text-position-box{
  143. width:650rpx;
  144. height:217rpx;
  145. line-height:217rpx;
  146. text-align: center;
  147. font-size:26rpx;
  148. color:#dedede;
  149. margin:0 auto;
  150. z-index:1;
  151. margin-top:10rpx;
  152. background-color: #fff;
  153. border:1rpx solid #dedede;
  154. border-radius:10rpx;
  155. }
  156. .text-position-img{
  157. width:650rpx;
  158. height:217rpx;
  159. line-height:217rpx;
  160. text-align: center;
  161. font-size:26rpx;
  162. color:#dedede;
  163. margin:0 auto;
  164. z-index:1;
  165. margin-top:10rpx;
  166. background-color: #fff;
  167. border:1rpx solid #dedede;
  168. border-radius:10rpx;
  169. }
  170. .sub-picker-box{
  171. display: flex;
  172. font-size:30rpx;
  173. height:80rpx;
  174. width:300px;
  175. margin:30rpx auto;
  176. .mark-box{
  177. color:red;
  178. height:80rpx;
  179. line-height:85rpx;
  180. margin-bottom:20rpx;
  181. }
  182. .title-box{
  183. margin:0 10rpx;
  184. height:80rpx;
  185. line-height:80rpx;
  186. }
  187. .picker-box{
  188. height:80rpx;
  189. flex:1;
  190. border:1rpx solid #dedede;
  191. border-radius:10rpx;
  192. .picker-p{
  193. padding:0 30rpx;
  194. color:#999;
  195. line-height:80rpx;
  196. width:380rpx;
  197. display:block;
  198. overflow:hidden;
  199. text-overflow:ellipsis;
  200. white-space:nowrap;
  201. }
  202. .check-picker-p{
  203. }
  204. }
  205. }
  206. .agreement-box{
  207. flex:1;
  208. margin:30rpx 60rpx;
  209. .agreement-min-box{
  210. display: flex;
  211. margin-top:15rpx;
  212. .agreement-img{
  213. width:40rpx;
  214. height:40rpx;
  215. margin:0 10rpx 0 0;
  216. }
  217. view{
  218. flex:1;
  219. line-height:40rpx;
  220. font-size:26rpx;
  221. }
  222. }
  223. }
  224. .button-group{
  225. display: flex;
  226. margin:0 auto;
  227. margin-bottom:80rpx;
  228. view{
  229. font-size:24rpx;
  230. width:200rpx;
  231. height:60rpx;
  232. line-height:60rpx;
  233. text-align: center;
  234. background-color: #fff
  235. border-radius:6rpx;
  236. }
  237. view:nth-child(1){
  238. border:1px solid #0183FA;
  239. background-color: #0183FA;
  240. color:#fff;
  241. }
  242. }
  243. }
  244. </style>