predetermineDetail.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <div class="predetermineDetail">
  3. <ul class="predetermineUl">
  4. <li class="predetermineLi">
  5. <div class="liName">项目/企业名称</div>
  6. <input v-model="postData.projectName" class="liIpt">
  7. </li>
  8. <li class="predetermineLi2">
  9. <div class="liName">项目/企业简介</div>
  10. <van-field
  11. :value="postData.projectInfo"
  12. autosize
  13. type="textarea"
  14. placeholder="请输入"
  15. class="myField"
  16. maxlength="800"
  17. show-word-limit
  18. />
  19. </li>
  20. <li class="predetermineLi2">
  21. <div class="liName">企业需求</div>
  22. <van-field
  23. :value="postData.companyNeed"
  24. autosize
  25. type="textarea"
  26. placeholder="请输入"
  27. class="myField"
  28. maxlength="800"
  29. show-word-limit
  30. />
  31. </li>
  32. <li class="predetermineLi">
  33. <div class="liName">项目/企业联系人</div>
  34. <input v-model="postData.projectManager" class="liIpt" placeholder="请输入">
  35. </li>
  36. <li class="predetermineLi" style="border-bottom: none">
  37. <div class="liName">联系电话</div>
  38. <input v-model="postData.managerPhone" class="liIpt" placeholder="请输入">
  39. </li>
  40. </ul>
  41. <div class="predetermineBox">
  42. <div class="titleBox">
  43. <span class="titleName">关联房源</span>
  44. <van-icon name="add" style="color:rgba(3, 101, 249, 1)"/>
  45. <span class="tips">(如有多个房源,可继续添加)</span>
  46. </div>
  47. <div class="houseBox">
  48. <div class="houseTag" v-for="item in buildList">{{item}}</div>
  49. </div>
  50. </div>
  51. <div class="predetermineBox">
  52. <div class="titleBox" style="margin-bottom: 24rpx">
  53. <span class="titleName">其他附件</span>
  54. <span class="tips">(支持图片,最多12张)</span>
  55. </div>
  56. <van-uploader
  57. :max-count="12"
  58. @delete="deleteRYXXZP"
  59. :file-list="fileList"
  60. @after-read="uploadRYXXZP"
  61. :show-upload="true"
  62. />
  63. </div>
  64. <div class="btnBox">
  65. <button class="cancelBtn" @tap="closePage">关闭</button>
  66. <button class="addBtn" @tap="addtoMine">添加至我的招商</button>
  67. </div>
  68. <van-dialog
  69. use-slot
  70. :show="show"
  71. show-cancel-button
  72. confirm-button-open-type="getUserInfo"
  73. @confirm="confirm"
  74. confirm-button-text="好的"
  75. cancel-button-text="不用了"
  76. confirm-button-color="rgba(87, 107, 149, 1)"
  77. @close="show = false"
  78. >
  79. <div class="dialogInfo">
  80. <van-icon name="warning" style="color:#10aeff;font-size: 128rpx"/>
  81. <span style="margin-top: 16rpx">确认添加后将由您负责</span>
  82. <span style="margin-top: 8rpx">跟进该项目!</span>
  83. </div>
  84. </van-dialog>
  85. </div>
  86. </template>
  87. <script>
  88. import {getByCodes, parkRoomSlateAddSale, getParkRoomSlateInfoById, getUserLocalStorageInfo} from "@/js_sdk/http";
  89. export default {
  90. name: "predetermineDetail",
  91. onLoad(options){
  92. this.id = options.id
  93. this.getById()
  94. },
  95. data(){
  96. return{
  97. id: '',
  98. postData:{
  99. },
  100. fileList:[],
  101. show:false,
  102. buildList: []
  103. }
  104. },
  105. methods:{
  106. addtoMine(){
  107. this.show = true
  108. },
  109. confirm(){
  110. this.postData.userId = getUserLocalStorageInfo().userId
  111. parkRoomSlateAddSale(this.postData).then(res=>{
  112. if(res.code == '200'){
  113. this.$showToast("审核成功");
  114. this.cancel()
  115. }else {
  116. this.$showToast(res.msg);
  117. }
  118. })
  119. },
  120. closePage(){
  121. uni.navigateTo({
  122. url:'/pages/subPackages/todo/index'
  123. })
  124. },
  125. deleteRYXXZP(event) {
  126. this.fileList.splice(event.detail.index, 1);
  127. this.$forceUpdate();
  128. },
  129. uploadRYXXZP(event) {
  130. console.log(event)
  131. let that = this;
  132. const { file } = event.detail;
  133. uni.uploadFile({
  134. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  135. filePath: file.url,
  136. name: "file",
  137. formData: { user: "test" },
  138. success(res) {
  139. // 上传完成需要更新 fileList
  140. let data = JSON.parse(res.data);
  141. that.fileList.push({
  142. imgUrl: "/FileController/download/" + data.data[0],
  143. id: data.data[0],
  144. url:
  145. that.$constant.BASE_URI +
  146. "/FileController/download/" +
  147. data.data[0],
  148. isImage: true,
  149. });
  150. },
  151. fail(res) {},
  152. });
  153. },
  154. getById(){
  155. const data = {
  156. id: this.id
  157. }
  158. getParkRoomSlateInfoById(data).then(res=>{
  159. if(res.code == '200'){
  160. this.postData = res.data
  161. this.buildList = []
  162. this.buildList = res.data.fullName.split(",")
  163. }
  164. })
  165. },
  166. cancel(){
  167. uni.navigateBack({})
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. .predetermineDetail{
  174. padding-bottom: 120rpx;
  175. .predetermineUl{
  176. margin: 24rpx 0;
  177. background: white;
  178. box-sizing: border-box;
  179. padding: 0 32rpx;
  180. .predetermineLi{
  181. padding: 32rpx 0;
  182. border-bottom: 1px solid rgba(230, 230, 230, 1);
  183. display: flex;
  184. justify-content: space-between;
  185. }
  186. .predetermineLi2{
  187. padding: 32rpx 0;
  188. border-bottom: 1px solid rgba(230, 230, 230, 1);
  189. display: flex;
  190. flex-direction: column;
  191. }
  192. .van-cell {
  193. background: #F5F7FA !important;
  194. border-radius: 8rpx;
  195. font-size: 28rpx;
  196. margin-top: 16rpx;
  197. }
  198. .liName{
  199. color: rgba(51, 51, 51, 1);
  200. font-size: 32rpx;
  201. }
  202. .liIpt{
  203. color: rgba(102, 102, 102, 1);
  204. font-size: 32rpx;
  205. text-align: right;
  206. }
  207. }
  208. .predetermineBox{
  209. padding: 32rpx;
  210. background: white;
  211. box-sizing: border-box;
  212. margin-bottom: 24rpx;
  213. .titleBox{
  214. display: flex;
  215. align-items: center;
  216. .titleName{
  217. color: rgba(24, 23, 42, 1);
  218. font-size: 32rpx;
  219. font-weight: 600;
  220. margin-right: 16rpx;
  221. }
  222. .tips{
  223. font-size: 28rpx;
  224. color: rgba(179, 179, 179, 1);
  225. }
  226. }
  227. .houseBox{
  228. display: flex;
  229. flex-wrap: wrap;
  230. margin-top: 24rpx;
  231. min-height: 200rpx;
  232. .houseTag{
  233. width: 200rpx;
  234. height: 56rpx;
  235. background: rgba(245, 247, 250, 1);
  236. border-radius: 8rpx;
  237. display: flex;
  238. align-items: center;
  239. justify-content: center;
  240. font-size: 28rpx;
  241. color: rgba(51, 51, 51, 1);
  242. margin-right: 24rpx;
  243. margin-bottom: 24rpx;
  244. }
  245. }
  246. }
  247. .btnBox{
  248. display: flex;
  249. justify-content: space-evenly;
  250. margin-top: 64rpx;
  251. .cancelBtn{
  252. width: 240rpx;
  253. height: 80rpx;
  254. display: flex;
  255. align-items: center;
  256. justify-content: center;
  257. color: rgba(3, 101, 249, 1);
  258. font-size: 34rpx;
  259. background: rgba(0, 0, 0, 0.05);
  260. border-radius: 8rpx;
  261. &::after{
  262. border: none;
  263. }
  264. }
  265. .addBtn{
  266. width: 300rpx;
  267. height: 80rpx;
  268. display: flex;
  269. align-items: center;
  270. justify-content: center;
  271. color: white;
  272. font-size: 34rpx;
  273. background: rgba(3, 101, 249, 1);
  274. border-radius: 8rpx;
  275. &::after{
  276. border: none;
  277. }
  278. }
  279. }
  280. .dialogInfo{
  281. padding: 64rpx 32rpx;
  282. font-size: 34rpx;
  283. color:rgba(51, 51, 51, 1);
  284. display: flex;
  285. flex-direction: column;
  286. align-items: center;
  287. }
  288. }
  289. </style>