perfect.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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: [],
  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. computed: {
  102. show(){
  103. if(!this.deptList.companyContant&&!this.deptList){
  104. }
  105. }
  106. },
  107. methods: {
  108. add() {
  109. if (this.label.length >= 6) {
  110. this.inputShow = false
  111. } else {
  112. this.inputShow = true
  113. }
  114. },
  115. getImgUrl(res) {
  116. console.log(res)
  117. this.imgList.push(res);
  118. },
  119. addinput() {
  120. if (!this.value) {
  121. this.$api.msg('标签内容不能为空')
  122. return
  123. }
  124. if (this.value.length < 2 || this.value.length > 6) {
  125. this.$api.msg('标签内容输入有误')
  126. return
  127. }
  128. this.label.push(this.value)
  129. this.value = ""
  130. this.inputShow = false
  131. },
  132. addPerson() {
  133. this.Persons.push({
  134. name: "",
  135. phone: "",
  136. })
  137. },
  138. delPerson(index) {
  139. this.Persons.splice(index, 1)
  140. },
  141. closeForList(index) {
  142. this.label.splice(index, 1)
  143. },
  144. imgRemove(e) {
  145. this.imgList.splice(e, 1)
  146. },
  147. uploadSuccess(e) {
  148. this.imgList.push(e.url)
  149. },
  150. submit() {
  151. var that=this
  152. this.deptList.label=this.label.toString()
  153. this.deptList.sitePhotoAddress=this.imgList.toString()
  154. this.deptList.settledCompanyContacts=this.Persons
  155. uni.showModal({
  156. content: "详细的企业信息有助于客户了解您的企业,是否确定提交?",
  157. showCancel: true,
  158. confirmText: '提交',
  159. success: function(res) {
  160. if (res.confirm) {
  161. that.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', that.deptList).then(res => {
  162. if (res.data.code == 200) {
  163. uni.navigateBack(1)
  164. }
  165. })
  166. }
  167. }
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .center {
  175. padding: 10rpx 20rpx;
  176. }
  177. .label{
  178. padding-right:30px;
  179. border:none;
  180. }
  181. .title {
  182. margin-left: 20rpx;
  183. color: #333333;
  184. line-height: 70rpx;
  185. }
  186. .write {
  187. margin-right: 20px;
  188. color: #71747C;
  189. }
  190. .modular {
  191. background-color: #FFFFFF;
  192. border-radius: 12px;
  193. margin-top: 10px;
  194. }
  195. .areaText {
  196. width: 83%;
  197. padding: 30rpx;
  198. border: 2rpx solid #F9F9FA;
  199. background-color: #F9F9FA;
  200. margin: 10rpx auto 20rpx;
  201. border-radius: 20rpx;
  202. color: #AFB3BF;
  203. font-size: 28rpx;
  204. }
  205. .add {
  206. padding: 15rpx 30rpx;
  207. width: 120rpx;
  208. height: 65rpx;
  209. text-align: center;
  210. margin-left: 24rpx;
  211. font-size: 30rpx;
  212. font-weight: 600;
  213. margin-bottom: 10rpx;
  214. border:1px solid #DCDDDC;
  215. }
  216. .forLists {
  217. margin-bottom: 10rpx;
  218. }
  219. .forList {
  220. height: 64rpx;
  221. background-color: #F4FAF8;
  222. padding: 20rpx 30rpx;
  223. color: #22C572;
  224. margin-left: 24rpx;
  225. text-align: center;
  226. }
  227. .addinput {
  228. width: 70%;
  229. margin: 20rpx auto;
  230. border-radius: 50rpx;
  231. }
  232. .addlabel{
  233. background:#F6F6F6;
  234. position:relative;
  235. border-radius: 50rpx;height: 70rpx;font-size: 10px;
  236. padding-right:40px;
  237. line-height: 52rpx;
  238. margin-bottom:10px;
  239. }
  240. .inputOk {
  241. width: 100rpx;
  242. border-radius: 40rpx;
  243. background-color: #E9EAE9;
  244. color: #FFFFFF;
  245. height:70rpx;
  246. border: none;
  247. position:absolute;
  248. right:0;
  249. }
  250. .picture {
  251. width: 144rpx;
  252. height: 144rpx;
  253. border: 4rpx dashed #AFB3BF;
  254. }
  255. .upload {
  256. text-align: center;
  257. margin: 0px 0;
  258. margin-bottom: 10px;
  259. }
  260. .addPerson {
  261. width: 230rpx;
  262. height: 80rpx;
  263. line-height: 80rpx;
  264. text-align: center;
  265. border: 2rpx solid #979797;
  266. border-radius: 40rpx;
  267. margin: 20rpx auto 20rpx;
  268. }
  269. .information {
  270. background-color: #F4FAF8;
  271. width: 96%;
  272. height: 180rpx;
  273. margin: 0 auto;
  274. border: 1rpx dashed #22C572;
  275. border-radius: 10rpx;
  276. margin-top: 30rpx;
  277. }
  278. .xinxi {
  279. margin-left: 70rpx;
  280. }
  281. .del {
  282. justify-content: flex-end;
  283. margin: 10rpx 20rpx 0 0;
  284. }
  285. </style>