predetermineDetail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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} 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. parkRoomSlateAddSale(this.postData).then(res=>{
  111. if(res.code == '200'){
  112. this.$showToast("审核成功");
  113. this.cancel()
  114. }else {
  115. this.$showToast(res.msg);
  116. }
  117. })
  118. },
  119. closePage(){
  120. uni.navigateTo({
  121. url:'/pages/subPackages/todo/index'
  122. })
  123. },
  124. deleteRYXXZP(event) {
  125. this.fileList.splice(event.detail.index, 1);
  126. this.$forceUpdate();
  127. },
  128. uploadRYXXZP(event) {
  129. console.log(event)
  130. let that = this;
  131. const { file } = event.detail;
  132. uni.uploadFile({
  133. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  134. filePath: file.url,
  135. name: "file",
  136. formData: { user: "test" },
  137. success(res) {
  138. // 上传完成需要更新 fileList
  139. let data = JSON.parse(res.data);
  140. that.fileList.push({
  141. imgUrl: "/FileController/download/" + data.data[0],
  142. id: data.data[0],
  143. url:
  144. that.$constant.BASE_URI +
  145. "/FileController/download/" +
  146. data.data[0],
  147. isImage: true,
  148. });
  149. },
  150. fail(res) {},
  151. });
  152. },
  153. getById(){
  154. const data = {
  155. id: this.id
  156. }
  157. getParkRoomSlateInfoById(data).then(res=>{
  158. if(res.code == '200'){
  159. this.postData = res.data
  160. this.buildList = []
  161. this.buildList = res.data.fullName.split(",")
  162. }
  163. })
  164. },
  165. cancel(){
  166. uni.navigateBack({})
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. .predetermineDetail{
  173. padding-bottom: 120rpx;
  174. .predetermineUl{
  175. margin: 24rpx 0;
  176. background: white;
  177. box-sizing: border-box;
  178. padding: 0 32rpx;
  179. .predetermineLi{
  180. padding: 32rpx 0;
  181. border-bottom: 1px solid rgba(230, 230, 230, 1);
  182. display: flex;
  183. justify-content: space-between;
  184. }
  185. .predetermineLi2{
  186. padding: 32rpx 0;
  187. border-bottom: 1px solid rgba(230, 230, 230, 1);
  188. display: flex;
  189. flex-direction: column;
  190. }
  191. .van-cell {
  192. background: #F5F7FA !important;
  193. border-radius: 8rpx;
  194. font-size: 28rpx;
  195. margin-top: 16rpx;
  196. }
  197. .liName{
  198. color: rgba(51, 51, 51, 1);
  199. font-size: 32rpx;
  200. }
  201. .liIpt{
  202. color: rgba(102, 102, 102, 1);
  203. font-size: 32rpx;
  204. text-align: right;
  205. }
  206. }
  207. .predetermineBox{
  208. padding: 32rpx;
  209. background: white;
  210. box-sizing: border-box;
  211. margin-bottom: 24rpx;
  212. .titleBox{
  213. display: flex;
  214. align-items: center;
  215. .titleName{
  216. color: rgba(24, 23, 42, 1);
  217. font-size: 32rpx;
  218. font-weight: 600;
  219. margin-right: 16rpx;
  220. }
  221. .tips{
  222. font-size: 28rpx;
  223. color: rgba(179, 179, 179, 1);
  224. }
  225. }
  226. .houseBox{
  227. display: flex;
  228. flex-wrap: wrap;
  229. margin-top: 24rpx;
  230. min-height: 200rpx;
  231. .houseTag{
  232. width: 200rpx;
  233. height: 56rpx;
  234. background: rgba(245, 247, 250, 1);
  235. border-radius: 8rpx;
  236. display: flex;
  237. align-items: center;
  238. justify-content: center;
  239. font-size: 28rpx;
  240. color: rgba(51, 51, 51, 1);
  241. margin-right: 24rpx;
  242. margin-bottom: 24rpx;
  243. }
  244. }
  245. }
  246. .btnBox{
  247. display: flex;
  248. justify-content: space-evenly;
  249. margin-top: 64rpx;
  250. .cancelBtn{
  251. width: 240rpx;
  252. height: 80rpx;
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. color: rgba(3, 101, 249, 1);
  257. font-size: 34rpx;
  258. background: rgba(0, 0, 0, 0.05);
  259. border-radius: 8rpx;
  260. &::after{
  261. border: none;
  262. }
  263. }
  264. .addBtn{
  265. width: 300rpx;
  266. height: 80rpx;
  267. display: flex;
  268. align-items: center;
  269. justify-content: center;
  270. color: white;
  271. font-size: 34rpx;
  272. background: rgba(3, 101, 249, 1);
  273. border-radius: 8rpx;
  274. &::after{
  275. border: none;
  276. }
  277. }
  278. }
  279. .dialogInfo{
  280. padding: 64rpx 32rpx;
  281. font-size: 34rpx;
  282. color:rgba(51, 51, 51, 1);
  283. display: flex;
  284. flex-direction: column;
  285. align-items: center;
  286. }
  287. }
  288. </style>