addacceptbind.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <view class="content">
  3. <view class="acountbox">
  4. <view v-for="(item,index) in form.contractDrafts" :key="index" v-if="!openhe">
  5. <view class="listitem">
  6. <text class="lys">承兑人</text>
  7. <view class="chosbox">
  8. <uni-data-select v-model="item.acceptor" :localdata="range1" @change="changeacPerson"
  9. :showas="false" :plname="'搜索承兑人名称'" @search="searchAcceptor" :checklistIn="index"
  10. @checkin="checkacptIndex"></uni-data-select>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. <view v-for="(item,index) in range2" class="text-box" scroll-y="true">
  16. <text class="text-data">{{index+1}}:</text>
  17. <text>{{item.acceptorName}}</text>
  18. <!-- <text @click='deletData(index)'>删除</text> -->
  19. <view class="item" @click='deletData(index)'>
  20. <icon :type="'clear'" size="16"></icon>
  21. </view>
  22. </view>
  23. <view class="logininbtn" @click="makeNewAcept">
  24. <text>确认</text>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. let that
  30. export default {
  31. data() {
  32. return {
  33. number: '',
  34. supplierId: '', //供应商id
  35. id: '',
  36. range1: [], //下拉框数据
  37. range2: [], //展示数据
  38. acceptor: '', //承兑人
  39. seacept: '',
  40. acceptorName: '',
  41. name:'',
  42. acceptorIds:[],
  43. form: {
  44. name: '',
  45. supplierId: '',
  46. contractDrafts: [{
  47. acceptorName: '',
  48. acceptor: '',
  49. }, ],
  50. },
  51. }
  52. },
  53. onLoad(o) {
  54. that = this
  55. if (o.id) {
  56. this.number = o.id
  57. }
  58. },
  59. onShow() {
  60. this.getAcceptors()
  61. },
  62. methods: {
  63. //模糊查询
  64. searchAcceptor(e) {
  65. if(e!=''){
  66. let value = e
  67. uni.showLoading()
  68. uni.$u.http.get(`/api/Acceptor/search?name=${value}`,
  69. ).then((res) => {
  70. uni.hideLoading()
  71. this.range1 = res.result
  72. console.log(this.range1);
  73. this.range1.forEach((item, index) => {
  74. this.range1[index].value = index
  75. this.range1[index].text = item.name
  76. })
  77. })
  78. }else{
  79. this.getAcceptors()
  80. }
  81. },
  82. changeacPerson(e) {
  83. // this.acceptor = e
  84. let r = {
  85. acceptorName: this.range1[e].name,
  86. id: this.range1[e].id
  87. }
  88. this.range2.push(r)
  89. console.log(this.range2);
  90. },
  91. getAcceptors() {
  92. uni.showLoading()
  93. uni.$u.http.get('/api/Acceptor/search?pageSize=-1&status=5',
  94. ).then((res) => {
  95. uni.hideLoading()
  96. this.range1 = res.result
  97. console.log(this.range1);
  98. this.range1.forEach((item, index) => {
  99. this.range1[index].value = index
  100. this.range1[index].text = item.name
  101. })
  102. })
  103. },
  104. checkacptIndex(index) {
  105. console.log(index);
  106. this.acptIndex = index
  107. },
  108. //删除数据
  109. deletData(i){
  110. this.range2.splice(i,1)
  111. },
  112. //确定提交
  113. makeNewAcept() {
  114. if (this.range2.length == 0) {
  115. that.$toast("请输入承兑人名称")
  116. return
  117. }
  118. this.range2.forEach(item=>{
  119. this.acceptorIds.push(item.id)
  120. })
  121. uni.showLoading()
  122. uni.$u.http.post('/api/SupplierAcceptor', {
  123. supplierId:this.number,
  124. acceptorIds:this.acceptorIds
  125. }, {
  126. custom: {
  127. auth: true
  128. }
  129. }).then((res) => {
  130. uni.hideLoading()
  131. that.$toast("提交成功")
  132. setTimeout(() => {
  133. uni.navigateBack({
  134. delta: 1
  135. })
  136. }, 500)
  137. }).catch((err) => {
  138. uni.hideLoading()
  139. that.$toast(err.msg)
  140. })
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. /* uni.scss */
  147. @import 'uview-ui/theme.scss';
  148. .content {
  149. display: flex;
  150. flex-direction: column;
  151. align-items: center;
  152. justify-content: center;
  153. }
  154. .loginbg {
  155. background-image: url("https://t39.9026.com/web/uploads/thumbs/mall10000/20220629/e01b927c95ee1f05364f5e456f281388.png");
  156. height: 559rpx;
  157. width: 750rpx;
  158. background-size: 100% 100%;
  159. // display: flex;
  160. // align-items: center;
  161. // justify-content: center;
  162. }
  163. .logo {
  164. margin: 0 auto;
  165. height: 200rpx;
  166. width: 200rpx;
  167. margin-left: auto;
  168. margin-right: auto;
  169. margin-bottom: 50rpx;
  170. }
  171. .text-area {
  172. display: flex;
  173. justify-content: center;
  174. }
  175. .title {
  176. font-size: 36rpx;
  177. color: #8f8f94;
  178. }
  179. .logobox {
  180. margin: 0 auto;
  181. margin-top: 212rpx;
  182. width: 269rpx;
  183. height: 191rpx;
  184. // background-color: #F1F1F1;
  185. image {
  186. width: 100%;
  187. height: 100%;
  188. }
  189. }
  190. .checkbox {}
  191. .business {
  192. width: 305rpx;
  193. height: 90rpx;
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. text-align: center;
  198. // background-color: #D8AB5A;
  199. border-raotherdius: 20rpx;
  200. color: #FFFFFF;
  201. margin-top: 57rpx;
  202. }
  203. .bnesper {
  204. background-size: 100%;
  205. background-image: url("@/static/img/loginbtn4.png");
  206. padding-top: 10rpx;
  207. color: #FFF1D8;
  208. line-height: 90rpx;
  209. }
  210. .applyper {
  211. background-image: url("@/static/img/loginbt1.png");
  212. background-size: 100%;
  213. padding-top: 10rpx;
  214. color: #FFF1D8;
  215. }
  216. .actapp {
  217. background-image: url("@/static/img/loginbtn3.png");
  218. background-size: 100%;
  219. color: #D05C39;
  220. }
  221. .actbnes {
  222. background-image: url("@/static/img/loginbt2.png");
  223. background-size: 100%;
  224. color: #D05C39;
  225. }
  226. .acountbox {
  227. .inacount {
  228. display: flex;
  229. padding: 35rpx 20rpx;
  230. box-sizing: border-box;
  231. width: 690rpx;
  232. margin-top: 40rpx;
  233. background-color: #F6F6F6;
  234. border-radius: 20rpx;
  235. font-size: 30rpx;
  236. color: #1F242A;
  237. input {
  238. width: 360rpx;
  239. }
  240. }
  241. .acoutitle {
  242. font-weight: 600;
  243. }
  244. .checkword {
  245. padding-left: 20rpx;
  246. color: #1F242A;
  247. font-size: 30rpx;
  248. }
  249. }
  250. .otherbt {
  251. width: 606rpx;
  252. display: flex;
  253. justify-content: space-between;
  254. font-size: 24rpx;
  255. padding-top: 30rpx;
  256. }
  257. .regbt {
  258. color: $uni-all-theme;
  259. }
  260. .logininbtn {
  261. margin-top: 80rpx;
  262. width: 690rpx;
  263. border-radius: 20rpx;
  264. background: linear-gradient(to right, #FFE1AD, #D8AB5A);
  265. box-shadow: 0 10rpx 20rpx 1rpx rgba(179, 116, 5, 0.2);
  266. height: 100rpx;
  267. text-align: center;
  268. color: #fff;
  269. line-height: 100rpx;
  270. }
  271. ::v-deep .text-box {
  272. text-align: left !important;
  273. width: 87%;
  274. border-bottom: 1px solid #ccc;
  275. text-align: left !important;
  276. font-size: 18px;
  277. margin: 20px 0px 0px;
  278. }
  279. .text-box{
  280. position: relative;
  281. }
  282. .item{
  283. position: absolute;
  284. right: 8px;
  285. top: 0px;
  286. }
  287. .text-data{
  288. display: inline-block;
  289. margin-right: 10px;
  290. }
  291. </style>