perfect.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view class="center">
  3. <u-form>
  4. <view class="modular">
  5. <u-form-item label="公司名称" label-width="30%" class="title Medium" :border-bottom="topBorder">
  6. <view style='width:100%;text-align:right;margin-right:10px;'>{{deptList.compName}}</view>
  7. </u-form-item>
  8. </view>
  9. <view style='padding-bottom:10px;' class="modular">
  10. <view class="title Medium">企业概况</view>
  11. <!-- <u-input v-model="value" :type="type" :height="height" :auto-height="autoHeight" placeholder="请输入企业概况,如经营项目、产品类型、企业规模等,不超过300个字" /> -->
  12. <textarea value="" placeholder="请输入企业概况,如经营项目、产品类型、企业规模等,不超过300个字" class="areaText Regular"
  13. v-model="deptList.companyContant" placeholder-style="color:#AFB3BF"/>
  14. <view class="title Regular">添加标签(标签应突出企业特色,最多6个)</view>
  15. <view class="flex" style="width: 100%;">
  16. <view class="forLists" v-for="(item,index) in label" :Key="index">
  17. <u-tag :text="item" mode="dark" class="forList Medium" shape="circle" :show="show"
  18. :closeable="closeable" color="#22C572" @close="closeForList(index)" />
  19. </view>
  20. <u-tag text="+" mode="plain" shape="circle" :show="show1" color="#2E2E2D" bg-color="#FFFFFF"
  21. border-color="#F9F9FA" class="add" @click="add"></u-tag>
  22. </view>
  23. <view class="addinput addlabel flex" v-if="inputShow">
  24. <u-input class='label' v-model="value" type="type" border focus v-if="inputShow"
  25. placeholder="请输入标签内容,不超过6个字" />
  26. <u-button :type="types" class="inputOk" shape="circle" @click="addinput">确定</u-button>
  27. </view>
  28. </view>
  29. <view style='padding-bottom:10px;' class="modular">
  30. <view class="title Regular">场地照片(图片清晰,最多9张)</view>
  31. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="9"
  32. :size-type="['compressed']" :options="uploadOptions" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  33. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  34. </view>
  35. <view style='padding-bottom:10px;' class="modular">
  36. <view class="title Medium">联系方式</view>
  37. <view v-for="(item,index) in Persons">
  38. <view class="information flex">
  39. <view class="xinxi">
  40. <u-form-item label="姓名" label-width="30%" class="Regular" label-position="top"
  41. style="font-size: 28rpx; color: #71747C;" :border-bottom="topBorder">
  42. <u-input v-model="item.contacts" class="Regular" placeholder="请输入姓名" />
  43. </u-form-item>
  44. </view>
  45. <view class="xinxi">
  46. <u-form-item label="电话" label-width="30%" class="Regular" label-position="top"
  47. style="font-size: 28rpx; color: #71747C;" :border-bottom="topBorder">
  48. <u-input v-model="item.contactsPhone" class="Regular" placeholder="请输入电话" />
  49. </u-form-item>
  50. </view>
  51. <div class="del" @click="delPerson(index)">
  52. <span style="font-size: 46rpx; color: #22C572;">×</span>
  53. </div>
  54. </view>
  55. </view>
  56. <view class="addPerson" @click="addPerson">
  57. <image src="../../static/img/liangmai/jia@3x.png" mode=""
  58. style="width: 26rpx;height: 26rpx;top: 2rpx;"></image>
  59. 添加联系人
  60. </view>
  61. </view>
  62. <view class="modular">
  63. <u-form-item label="邮箱" label-width="30%" class="title Regular">
  64. <u-input v-model="deptList.email" input-align="right" class="write Regular" placeholder="请输入电子邮箱" />
  65. </u-form-item>
  66. <u-form-item label="传真" label-width="30%" class="title Regular" :border-bottom="topBorder">
  67. <u-input v-model="deptList.fax" input-align="right" class="write Regular" placeholder="请输入传真号" />
  68. </u-form-item>
  69. </view>
  70. </u-form>
  71. <u-button type="success" shape="circle" style="margin-top: 20rpx;" @click="submit">提交</u-button>
  72. </view>
  73. </template>
  74. <script>
  75. import upload from '@/components/upload.vue';
  76. export default {
  77. components: {
  78. upload
  79. },
  80. data() {
  81. return {
  82. deptList: {},
  83. label: ["世界一流", "世界500强"],
  84. closeable: true,
  85. show: true,
  86. show1: true,
  87. types: "",
  88. inputShow: false,
  89. value: "", //临时标签内容字段 后期更换
  90. action: 'https://www.zthymaoyi.com/upload/admin',
  91. fileList: [],
  92. imgList: [],
  93. Persons: [],
  94. topBorder: false,
  95. }
  96. },
  97. onLoad(options) {
  98. this.deptList=JSON.parse(options.deptList)
  99. console.log(this.deptList)
  100. },
  101. methods: {
  102. add() {
  103. if (this.label.length >= 6) {
  104. this.inputShow = false
  105. } else {
  106. this.inputShow = true
  107. }
  108. },
  109. getImgUrl(res) {
  110. console.log(res)
  111. this.imgList.push(res);
  112. },
  113. addinput() {
  114. if (!this.value) {
  115. this.$api.msg('标签内容不能为空')
  116. return
  117. }
  118. if (this.value.length < 2 || this.value.length > 6) {
  119. this.$api.msg('标签内容输入有误')
  120. return
  121. }
  122. this.label.push(this.value)
  123. this.value = ""
  124. this.inputShow = false
  125. },
  126. addPerson() {
  127. this.Persons.push({
  128. name: "",
  129. phone: "",
  130. })
  131. },
  132. delPerson(index) {
  133. this.Persons.splice(index, 1)
  134. },
  135. closeForList(index) {
  136. this.label.splice(index, 1)
  137. },
  138. imgRemove(e) {
  139. this.imgList.splice(e, 1)
  140. },
  141. uploadSuccess(e) {
  142. this.imgList.push(e.url)
  143. },
  144. submit() {
  145. var that=this
  146. this.deptList.label=this.label.toString()
  147. this.deptList.sitePhotoAddress=this.imgList.toString()
  148. this.deptList.settledCompanyContacts=this.Persons
  149. uni.showModal({
  150. content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
  151. showCancel: true,
  152. confirmText: '提交',
  153. success: function(res) {
  154. if (res.confirm) {
  155. that.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', that.deptList).then(res => {
  156. if (res.data.code == 200) {
  157. uni.navigateBack(1)
  158. }
  159. })
  160. }
  161. }
  162. })
  163. }
  164. }
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .center {
  169. padding: 10rpx 20rpx;
  170. }
  171. .label{
  172. padding-right:30px;
  173. border:none;
  174. }
  175. .title {
  176. margin-left: 20rpx;
  177. color: #333333;
  178. line-height: 70rpx;
  179. }
  180. .write {
  181. margin-right: 20px;
  182. color: #71747C;
  183. }
  184. .modular {
  185. background-color: #FFFFFF;
  186. border-radius: 12px;
  187. margin-top: 10px;
  188. }
  189. .areaText {
  190. width: 83%;
  191. padding: 30rpx;
  192. border: 2rpx solid #F9F9FA;
  193. background-color: #F9F9FA;
  194. margin: 10rpx auto 20rpx;
  195. border-radius: 20rpx;
  196. color: #AFB3BF;
  197. font-size: 28rpx;
  198. }
  199. .add {
  200. padding: 15rpx 30rpx;
  201. width: 120rpx;
  202. height: 65rpx;
  203. text-align: center;
  204. margin-left: 24rpx;
  205. font-size: 30rpx;
  206. font-weight: 600;
  207. margin-bottom: 10rpx;
  208. border:1px solid #DCDDDC;
  209. }
  210. .forLists {
  211. margin-bottom: 10rpx;
  212. }
  213. .forList {
  214. height: 64rpx;
  215. background-color: #F4FAF8;
  216. padding: 20rpx 30rpx;
  217. color: #22C572;
  218. margin-left: 24rpx;
  219. text-align: center;
  220. }
  221. .addinput {
  222. width: 70%;
  223. margin: 20rpx auto;
  224. border-radius: 50rpx;
  225. }
  226. .addlabel{
  227. background:#F6F6F6;
  228. position:relative;
  229. border-radius: 50rpx;height: 70rpx;font-size: 10px;
  230. padding-right:40px;
  231. line-height: 52rpx;
  232. margin-bottom:10px;
  233. }
  234. .inputOk {
  235. width: 100rpx;
  236. border-radius: 40rpx;
  237. background-color: #E9EAE9;
  238. color: #FFFFFF;
  239. height:70rpx;
  240. border: none;
  241. position:absolute;
  242. right:0;
  243. }
  244. .picture {
  245. width: 144rpx;
  246. height: 144rpx;
  247. border: 4rpx dashed #AFB3BF;
  248. }
  249. .upload {
  250. text-align: center;
  251. margin: 0px 0;
  252. margin-bottom: 10px;
  253. }
  254. .addPerson {
  255. width: 230rpx;
  256. height: 80rpx;
  257. line-height: 80rpx;
  258. text-align: center;
  259. border: 2rpx solid #979797;
  260. border-radius: 40rpx;
  261. margin: 20rpx auto 20rpx;
  262. }
  263. .information {
  264. background-color: #F4FAF8;
  265. width: 96%;
  266. height: 180rpx;
  267. margin: 0 auto;
  268. border: 1rpx dashed #22C572;
  269. border-radius: 10rpx;
  270. margin-top: 30rpx;
  271. }
  272. .xinxi {
  273. margin-left: 70rpx;
  274. }
  275. .del {
  276. justify-content: flex-end;
  277. margin: 10rpx 20rpx 0 0;
  278. }
  279. </style>