addaduit.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <view class='container'>
  3. <view>
  4. <u-form :model="dataobj" ref="uForm">
  5. <u-form-item class='typeform' :border-bottom='false' label="类型"><view style='color:#000;width:100%;text-align:right;' @click='typeselect'>{{dataobj.businessType?dataobj.businessType+" >":'请选择类型 >'}}</view></u-form-item>
  6. </u-form>
  7. <u-form :model="dataobj" ref="uForm">
  8. <u-form-item :border-bottom='false' :label-position='"top"' label="备注">
  9. <view class="u-textarea-style">
  10. <view class="right-bottom">
  11. {{dataobj.remark.length}}/2000个字
  12. </view>
  13. <!-- <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  14. maxlength="100" /> -->
  15. <textarea style='font-size:12px;' maxlength="2000" v-model='dataobj.remark' placeholder="请输入备注信息" name="" id="" cols="30" rows="11"></textarea>
  16. </view>
  17. </u-form-item>
  18. </u-form>
  19. <u-form v-if='dataobj.businessType=="大可以物流"' label-width='120' :model="dataobj" ref="uForm">
  20. <u-form-item class='typeform' :border-bottom='false' label="付款名头"><view style='color:#000;width:100%;text-align:right;' @click='typeselect1'>{{dataobj.payerHeader?dataobj.payerHeader+" >":'请选择付款名头 >'}}</view></u-form-item>
  21. </u-form>
  22. <view class='wrap'>
  23. <view class="c-row">
  24. <view class="title">
  25. <view>附件</view><view><text style='color:#617AE0;'>{{imglist2.length}}</text>/20</view></view>
  26. </view>
  27. <view style="display: flex;flex-wrap: wrap;">
  28. <view v-for='(item,index) in imglist2' v-if="imglist2 && imglist2.length > 0"
  29. style="position: relative;margin:20rpx 0 20rpx 20rpx;">
  30. <view class="delete_img" @click="deleteImg(index)">X</view>
  31. <image :src="item.appendixPath" mode="" style="width: 100px;height: 100px;"></image>
  32. </view>
  33. <view class="biankuang" @click="uploadClick" v-if="imglist2.length < 20">
  34. <view class="tubiao">
  35. 上传附件
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <u-picker @confirm='typeconfirm1' :range="xialaList1" mode="selector" v-model="show1" range-key="value" :default-selector="[0]"></u-picker>
  41. <u-picker @confirm='typeconfirm' :range="xialaList" mode="selector" v-model="show" range-key="constValue" :default-selector="[0]"></u-picker>
  42. </view>
  43. <u-toast ref="uToast" />
  44. <view class="bottom-btn">
  45. <view @click="submit()" class="btn">提交</view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. mapState
  52. } from 'vuex';
  53. import * as config from '../../config'
  54. export default {
  55. data() {
  56. return {
  57. xialaList:[],
  58. xialaList1:[{value:'中天昊元公户'},{value:'大可以公户'},{value:'范成凤私户'}],
  59. show:false,
  60. show1:false,
  61. dataobj:{remark:''},
  62. imglist:[],
  63. imglist2:[]
  64. }
  65. },
  66. onShow(){
  67. this.getList()
  68. },
  69. computed: {
  70. ...mapState(['hasLogin', 'userInfo']),
  71. },
  72. watch: {
  73. imglist: {
  74. handler: function() {
  75. this.$api.doRequest('get', 'appendix/query/getFileList', {
  76. appendixIds: this.imglist.toString()
  77. }).then(res => {
  78. this.imglist2 = res.data.data
  79. })
  80. },
  81. deep: true
  82. }
  83. },
  84. methods: {
  85. async uploadClick() {
  86. let baseUrlNew = config.def().baseUrlNew
  87. console.log('baseUrlNew',baseUrlNew)
  88. let pcUserInfo = uni.getStorageSync('pcUserInfo')
  89. if(!pcUserInfo){
  90. uni.showToast({
  91. title:"登录已失效,请重新登录"
  92. })
  93. return
  94. }
  95. uni.chooseImage({
  96. count:10,
  97. success: (chooseImageRes) => {
  98. console.log('chooseImageRes',chooseImageRes)
  99. let files = []
  100. for (let item of chooseImageRes.tempFiles) {
  101. files.push({
  102. name: 'fileName',
  103. url : item.path
  104. });
  105. }
  106. for (let i = 0; i < files.length; i++) {
  107. uni.uploadFile({
  108. url: baseUrlNew + 'appendix/api/uploadFiles',
  109. // url: baseUrlNew+'appendix/api/uploadFiles', //仅为示例,非真实的接口地址
  110. filePath: files[i].url,
  111. name: files[i].name,
  112. formData: {
  113. // fileName: chooseImageRes.tempFiles[0],
  114. companyId: pcUserInfo.compId,
  115. modelId: '',
  116. vesselId: '',
  117. },
  118. success: (uploadFileRes) => {
  119. console.log(JSON.parse(uploadFileRes.data))
  120. var data = JSON.parse(uploadFileRes.data).data
  121. data.compId = pcUserInfo.compId
  122. this.$api.doRequest('post', '/appendix/api/saveFilesApp', {
  123. newAppendixs: [data],
  124. oldAppendixIds: ""
  125. }).then(res => {
  126. this.imglist.push(res.data.data[0])
  127. console.log(res)
  128. })
  129. console.log(uploadFileRes.data);
  130. },
  131. fail(res) {
  132. console.log(res);
  133. }
  134. });
  135. }
  136. }
  137. });
  138. },
  139. deleteImg(index) {
  140. this.imglist.splice(index, 1)
  141. },
  142. getList(){
  143. this.$api.doRequest('get', '/commonSysParameter/getInfo', {
  144. constId:'EXA1'
  145. }).then(res => {
  146. this.xialaList=res.data.data
  147. })
  148. },
  149. typeselect(){
  150. this.show=true
  151. },
  152. typeselect1(){
  153. this.show1=true
  154. },
  155. typeconfirm(e){
  156. console.log(this.xialaList[e[0]])
  157. this.dataobj.businessType=this.xialaList[e[0]].constValue
  158. },
  159. typeconfirm1(e){
  160. console.log(this.xialaList1[e[0]])
  161. this.dataobj.payerHeader=this.xialaList1[e[0]].value
  162. },
  163. submit() {
  164. if (!this.dataobj.businessType) {
  165. this.$api.msg('类型不能为空')
  166. return
  167. }
  168. var that = this
  169. this.dataobj.compId=uni.getStorageSync('pcUserInfo').compId
  170. this.dataobj.sponsor=this.userInfo.userName
  171. uni.showModal({
  172. content: '确定发起申请?',
  173. showCancel: true,
  174. confirmText: '提交',
  175. success: function(res) {
  176. if (res.confirm) {
  177. if (that.imglist.length > 0) {
  178. that.dataobj.addressUrl = that.imglist.toString()
  179. }
  180. uni.showLoading({
  181. title: "加载中",
  182. mask: true
  183. })
  184. that.$api.doRequest('post', '/generalAuditInfo/api/insertGeneralAuditInfo', that.dataobj)
  185. .then(res => {
  186. if (res.data.code == 200) {
  187. uni.hideLoading()
  188. that.$api.msg('提交成功')
  189. uni.navigateBack({
  190. delta: 1
  191. });
  192. } else {
  193. that.$api.msg('提交失败')
  194. }
  195. })
  196. }
  197. }
  198. })
  199. },
  200. }
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. .container{
  205. padding-bottom: 20rpx;
  206. }
  207. page {
  208. background: #F5F6FA;
  209. }
  210. .u-form {
  211. margin: 20rpx;
  212. background: #fff;
  213. border-radius: 10px;
  214. padding: 30rpx 10px;
  215. .u-form-item {
  216. line-height: 30px;
  217. padding: 0px 0;
  218. font-size: 26rpx;
  219. color: #878C9C;
  220. }
  221. }
  222. .delete_img {
  223. position: absolute;
  224. z-index: 100;
  225. left: 84px;
  226. color: #ffffff;
  227. font-size: 24rpx;
  228. border: 1px;
  229. border-radius: 5rpx 5rpx 5rpx 20rpx;
  230. width: 32rpx;
  231. height: 32rpx;
  232. background-color: rgba(17, 26, 52, 0.5000);
  233. padding:0 3px 0 5px;
  234. text-align: center;
  235. }
  236. .title_b {
  237. margin: 20rpx 20rpx 0rpx 20rpx;
  238. padding: 20rpx 10rpx 20rpx 10rpx;
  239. font-size: 18px;
  240. font-weight: 550;
  241. }
  242. .xinxi {
  243. padding: 20rpx 30rpx;
  244. }
  245. .tubiao {
  246. margin: 0 auto;
  247. text-align: center;
  248. margin-top: 35rpx;
  249. }
  250. .biankuang {
  251. width: 100%;
  252. height: 120rpx;
  253. border-radius: 30px;
  254. margin:0 20rpx;
  255. background:#F5F9FC;
  256. color:#617AE0;
  257. }
  258. .upload {
  259. width: 80rpx;
  260. height: 80rpx;
  261. }
  262. .c-row {
  263. display: -webkit-box;
  264. display: -webkit-flex;
  265. display: flex;
  266. -webkit-box-align: center;
  267. -webkit-align-items: center;
  268. align-items: center;
  269. padding: 20rpx 30rpx;
  270. position: relative;
  271. }
  272. .con-list {
  273. -webkit-box-flex: 1;
  274. flex: 1;
  275. display: flex;
  276. -webkit-box-orient: vertical;
  277. -webkit-box-direction: normal;
  278. flex-direction: column;
  279. color: #303133;
  280. line-height: 20px;
  281. text-align: right;
  282. padding-right: 10px;
  283. justify-content: space-between;
  284. }
  285. .title {
  286. width:100%;
  287. display:flex;
  288. justify-content: space-between;
  289. }
  290. .buns_item {
  291. display: flex;
  292. padding: 80rpx 0 50rpx 0;
  293. justify-content: space-around;
  294. }
  295. .but_css {
  296. background: #22C572;
  297. width: 40%;
  298. padding: 20rpx;
  299. color: #fff;
  300. text-align: center;
  301. border-radius: 20rpx;
  302. }
  303. /deep/.u-radio-group {
  304. flex-direction: row-reverse;
  305. }
  306. .no-boder {
  307. border: 0;
  308. }
  309. .textarea {
  310. background: #F9F9FA;
  311. border: 1px solid #EEEEEE;
  312. }
  313. .remark {
  314. position: absolute;
  315. right: 10px;
  316. bottom: 20px;
  317. color: #AFB3BF;
  318. }
  319. .submit {
  320. width: 100%;
  321. background: #2c8ac5;
  322. border-radius: 10rpx;
  323. }
  324. .bottom-btn {
  325. padding: 30rpx;
  326. background: #FFFFFF;
  327. width: 100%;
  328. position: fixed;
  329. bottom: 0rpx;
  330. display: flex;
  331. z-index: 9999;
  332. }
  333. .content {
  334. overflow: hidden;
  335. }
  336. .btn {
  337. border-radius: 50rpx;
  338. padding: 20rpx 0;
  339. background: #22C572;
  340. color: #fff;
  341. font-size: 32rpx;
  342. width: 100%;
  343. box-sizing: border-box;
  344. display: flex;
  345. justify-content: center;
  346. }
  347. .margin-bottom{
  348. margin-bottom:84px;
  349. }
  350. .u-textarea-style {
  351. margin: 20rpx;
  352. background: #F9F9FA;
  353. border-radius: 10px;
  354. border: 1px solid #EEEEEE;
  355. padding: 10rpx 20rpx;
  356. position: relative;
  357. height:240px;
  358. /deep/.uni-textarea-textarea{
  359. width: 80%;
  360. }
  361. .right-bottom {
  362. position: absolute;
  363. right: 20rpx;
  364. bottom: 20rpx;
  365. color: #AFB3BF;
  366. }
  367. }
  368. .wrap{
  369. border-radius:10px;
  370. background:#fff;
  371. margin:10px 10px 80px 10px;
  372. padding:0 0 10px 0;
  373. }
  374. </style>